From dff0d407770cd16b6c1eb89fd1eb0c7a71273d5a Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Thu, 11 Jan 2024 00:19:11 +0100 Subject: [PATCH] split ssh away from nix --- modules/default.nix | 1 + modules/nix/default.nix | 8 -------- modules/ssh/default.nix | 18 ++++++++++++++++++ systems/installer/default.nix | 1 + systems/inugami/default.nix | 1 + systems/kami/default.nix | 2 +- systems/kami/hardware.nix | 6 ++---- systems/tuny/default.nix | 1 + systems/yokai/default.nix | 1 + 9 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 modules/ssh/default.nix diff --git a/modules/default.nix b/modules/default.nix index 3e6e1e3..bfc4ddb 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -18,6 +18,7 @@ ./plasma/6.nix ./printing ./repo-sync + ./ssh ./steam ./users self.inputs.home-manager.nixosModules.home-manager diff --git a/modules/nix/default.nix b/modules/nix/default.nix index d6e0fa5..a4d2a41 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -59,14 +59,6 @@ in { }; system.stateVersion = "24.05"; - services.openssh = { - enable = true; - banner = "Hackers are in Your System!!!"; - settings = { - PasswordAuthentication = false; - PermitRootLogin = "prohibit-password"; - }; - }; systemd.services.nix-daemon.serviceConfig.LimitNOFILE = lib.mkForce 1048576000; }; } diff --git a/modules/ssh/default.nix b/modules/ssh/default.nix new file mode 100644 index 0000000..a0b1a14 --- /dev/null +++ b/modules/ssh/default.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, self, ... }: + +let cfg = config.jopejoe1.ssh; +in { + options.jopejoe1.ssh = { enable = lib.mkEnableOption "Enable ssh"; }; + + config = lib.mkIf cfg.enable { + services.openssh = { + enable = true; + banner = "Hackers are in Your System!!!"; + settings = { + PasswordAuthentication = false; + PermitRootLogin = "prohibit-password"; + }; + }; + }; +} + diff --git a/systems/installer/default.nix b/systems/installer/default.nix index d5f6e53..b7e0cc0 100644 --- a/systems/installer/default.nix +++ b/systems/installer/default.nix @@ -11,6 +11,7 @@ overlays.enable = true; jopejoe1.enable = true; root.enable = true; + ssh.enable = true; }; networking = { diff --git a/systems/inugami/default.nix b/systems/inugami/default.nix index 7760ca5..038e180 100644 --- a/systems/inugami/default.nix +++ b/systems/inugami/default.nix @@ -27,6 +27,7 @@ plasma.enable = true; root.enable = true; jopejoe1.enable = true; + ssh.enable = true; }; networking = { diff --git a/systems/kami/default.nix b/systems/kami/default.nix index ce3141a..a42e1a4 100644 --- a/systems/kami/default.nix +++ b/systems/kami/default.nix @@ -23,6 +23,7 @@ printing.enable = true; overlays.enable = true; steam.enable = true; + ssh.enable = true; asf.enable = true; minecraft-server.enable = true; repo-sync.enable = true; @@ -93,7 +94,6 @@ mumble sshfs - # Theming catppuccin-kvantum catppuccin-kde diff --git a/systems/kami/hardware.nix b/systems/kami/hardware.nix index 7c9be42..52f0eb6 100644 --- a/systems/kami/hardware.nix +++ b/systems/kami/hardware.nix @@ -17,8 +17,7 @@ nvidiaBusId = "PCI:1:0:0"; }; - boot.initrd.availableKernelModules = - [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; @@ -73,6 +72,5 @@ #nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; - hardware.cpu.intel.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/systems/tuny/default.nix b/systems/tuny/default.nix index 0e3999e..fefd3c0 100644 --- a/systems/tuny/default.nix +++ b/systems/tuny/default.nix @@ -17,6 +17,7 @@ nix.enable = true; root.enable = true; boot.systemd.enable = true; + ssh.enable = true; }; networking = { hostName = "tuny"; }; diff --git a/systems/yokai/default.nix b/systems/yokai/default.nix index 0986fe0..7e4b8fe 100644 --- a/systems/yokai/default.nix +++ b/systems/yokai/default.nix @@ -15,6 +15,7 @@ printing.enable = true; jopejoe1.enable = true; root.enable = true; + ssh.enable = true; }; networking = {