diff --git a/hosts/bootstrap/default.nix b/hosts/bootstrap/default.nix index f92dae0..2569098 100644 --- a/hosts/bootstrap/default.nix +++ b/hosts/bootstrap/default.nix @@ -14,7 +14,6 @@ in # Import core options ./hardware-configuration.nix ../common/core - ]; nixpkgs = { diff --git a/hosts/common/core/sops.nix b/hosts/common/core/sops.nix index 30dc04a..a78e6ea 100644 --- a/hosts/common/core/sops.nix +++ b/hosts/common/core/sops.nix @@ -3,6 +3,7 @@ let secretsDirectory = builtins.toString inputs.nix-secrets; secretsFile = "${secretsDirectory}/secrets.yaml"; hostname = config.networking.hostName; + username = config.username; in { imports = [ @@ -16,10 +17,10 @@ in age = { sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; }; - secrets = { - "passwords/root".neededForUsers = true; - "passwords/sam".neededForUsers = true; - "passwords/media".neededForUsers = true; - }; + secrets = builtins.merge ({ + "passwords/root".neededForUsers = true; + }) + if username != null then { "passwords/${username}".neededForUsers = true; } else {}; + }; }; } diff --git a/hosts/sparky/default.nix b/hosts/sparky/default.nix index 3cd3f7c..6739c9e 100644 --- a/hosts/sparky/default.nix +++ b/hosts/sparky/default.nix @@ -11,6 +11,9 @@ in ../common/optional/btrfs-impermanence.nix inputs.impermanence.nixosModules.impermanence + # Create users for this host + ../common/users/media + # Import core options ./hardware-configuration.nix ../common/core @@ -18,9 +21,6 @@ in # Import optional options ../common/optional/openssh.nix - # Create users for this host - ../common/users/media - ]; nixpkgs = { @@ -48,7 +48,7 @@ in "/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_ed25519_key.pub" ]; - users.media = { + users.${config.username} = { directories = [ "sync" "keep" @@ -88,8 +88,8 @@ in services = { qemuGuest.enable = true; }; - services.libinput.enable = true; - services.displayManager.defaultSession = "cinnamon"; + #services.libinput.enable = true; + #services.displayManager.defaultSession = "cinnamon"; # services.xserver = { # enable = true;