Assert host config exists

Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-01 21:01:25 +00:00
parent 3d1018dcc3
commit 2f4cbd863a
2 changed files with 3 additions and 2 deletions

View File

@@ -45,7 +45,8 @@
&& builtins.match "^_+$" username == null
&& builtins.match "^nix.*" username == null
&& username != "root";
hostConfig = ./hosts + "/${hostname}/hardware-configuration.nix";
hostConfig = assert builtins.pathExists (./hosts + "/${hostname}/hardware-configuration.nix");
./hosts + "/${hostname}/hardware-configuration.nix";
passwordHashPath = "/etc/nixos/secrets/${username}/password.hash";
specialArgs = { inherit inputs system hostname username usernameValid passwordHashPath; };

View File

@@ -117,7 +117,7 @@
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "video" "seat" ];
# IMPORTANT: Generate a password hash with: mkpasswd -m sha-512
# Save it to the path defined in flake.nix (ensure permissions are 600)
# Save it to /etc/nixos/secrets/${username}/password.hash (ensure permissions are 600)
hashedPasswordFile = passwordHashPath;
packages = with pkgs; [
# -- Noctalia Shell --