From 2f4cbd863a67ccb1a2d4cd1891d2b15ccebc4059 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Feb 2026 21:01:25 +0000 Subject: [PATCH] Assert host config exists Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com> --- flake.nix | 3 ++- modules/common.nix | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c5f4752..448218a 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; diff --git a/modules/common.nix b/modules/common.nix index ac3b882..20b71a3 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -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 --