From bd70062391dffcc37819503fd9c0de35f0ab14bf Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 22 Nov 2024 23:25:38 -0500 Subject: [PATCH] fix: make live-image work again --- devices/live-image/default.nix | 51 ++++++++++++++++++++++++++++++++++ nixosModules/server/sshd.nix | 4 +-- outputs.nix | 6 ++-- 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 devices/live-image/default.nix 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]; }; };