diff --git a/devices/live-image/default.nix b/devices/live-image/default.nix new file mode 100644 index 00000000..d7231949 --- /dev/null +++ b/devices/live-image/default.nix @@ -0,0 +1,51 @@ +{ + mainUser, + nixpkgs, + self, + ... +}: { + # ------------------------------------------------ + # Imports + # ------------------------------------------------ + imports = [ + "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" + + self.nixosModules.base + self.nixosModules.server + ]; + + # ------------------------------------------------ + # `Self` Modules configuration + # ------------------------------------------------ + roles.base = { + enable = true; + user = mainUser; + }; + + roles.server = { + user = mainUser; + sshd.enable = true; + }; + + services.kmscon.enable = true; + + home-manager.users.${mainUser} = { + imports = [ + self.homeManagerModules.neovim + self.homeManagerModules.shell + ]; + + programs = { + bash = { + enable = true; + promptMainColor = "purple"; + }; + + neovim = { + enable = true; + enableIde = true; + user = mainUser; + }; + }; + }; +} diff --git a/nixosModules/server/sshd.nix b/nixosModules/server/sshd.nix index d144b404..5de75ee3 100644 --- a/nixosModules/server/sshd.nix +++ b/nixosModules/server/sshd.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) mkIf; + inherit (lib) mkForce mkIf; cfg = config.roles.server; in { @@ -13,7 +13,7 @@ in { enable = true; settings = { PasswordAuthentication = false; - PermitRootLogin = "no"; + PermitRootLogin = mkForce "no"; }; }; }; diff --git a/outputs.nix b/outputs.nix index 7fcce8fd..968a4fb8 100644 --- a/outputs.nix +++ b/outputs.nix @@ -118,10 +118,8 @@ }; live-image = mkNixOS { - extraModules = [ - "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" - # {vars.mainUser = "nixos";} FIXME: add default modules and stuff - ]; + mainUser = "nixos"; + extraModules = [./devices/live-image]; }; };