diff --git a/flake.nix b/flake.nix index c33a355..f1924e7 100755 --- a/flake.nix +++ b/flake.nix @@ -129,6 +129,7 @@ label = "SerenityOS"; version = "SerenityOS_0.8.9"; # proper versioning system before v1.0.0? primaryUser = "serenity"; # used for admin purposes + userDesc = "Serenity Amalgam"; homeDir = "/home/${primaryUser}"; # for easy configuration disksPath = "${homeDir}/Disks/"; # for easy disk navigation flakePath = "${homeDir}/flakes/nixdots/"; # current path to flake - unused @@ -147,7 +148,7 @@ inherit inputs outputs; inherit label version; inherit flakePath disksPath; - inherit primaryUser homeDir; + inherit primaryUser userDesc homeDir; inherit wallpaper; }; modules = [ @@ -164,7 +165,7 @@ inherit inputs outputs; inherit label version; inherit flakePath disksPath; - inherit primaryUser homeDir; + inherit primaryUser userDesc homeDir; inherit wallpaper; }; modules = [ @@ -180,7 +181,7 @@ inherit inputs outputs; inherit label version; inherit flakePath disksPath; - inherit primaryUser homeDir; + inherit primaryUser userDesc homeDir; inherit wallpaper; }; modules = [ @@ -202,7 +203,7 @@ inherit inputs outputs; inherit label version; inherit flakePath disksPath; - inherit primaryUser homeDir; + inherit primaryUser userDesc homeDir; inherit wallpaper; }; modules = [ diff --git a/home/default.nix b/home/default.nix index fd4cf5c..acbd6a7 100755 --- a/home/default.nix +++ b/home/default.nix @@ -1,5 +1,5 @@ { inputs, outputs, config, pkgs, label, version, flakePath, disksPath -, primaryUser, homeDir, wallpaper, ... }: +, primaryUser, userDesc, homeDir, wallpaper, ... }: let hostname = "${config.networking.hostName}"; @@ -9,6 +9,7 @@ in { ## Modules inputs.home-manager.nixosModules.default # home-manager module + inputs.sops-nix.nixosModules.sops # sops-nix module ## User themes - ## to set a different theme for a user, @@ -28,14 +29,17 @@ in { ## making sure to replace all instances of ## `${primaryUser}` with the new username. + ## Needed for sops-nix to handle loginPassword + sops.secrets.loginPassword.neededForUsers = true; + users.mutableUsers = false; + ## System-level user declarations users.users = { ${primaryUser} = { - description = "Serenity Amalgam"; + description = "${userDesc}"; isNormalUser = true; extraGroups = [ "wheel" "networkmanager" "gamemode" "audio" ]; - ## be sure to change this with 'passwd' - initialPassword = "password"; + hashedPasswordFile = config.sops.secrets.loginPassword.path; ## A catgirl's favourite shell shell = pkgs.fish; }; diff --git a/secrets/default.nix b/secrets/default.nix index d89f06e..f972782 100644 --- a/secrets/default.nix +++ b/secrets/default.nix @@ -10,15 +10,12 @@ sops = { defaultSopsFile = ./secrets.yaml; # default sops file defaultSopsFormat = "yaml"; # yaml for ease of use - age.keyFile = "${homeDir}/.config/sops/age/keys.txt"; # keyfile location - # move this to a separate private repo directory + generateKey = true; # generate a new key if the one above is missing secrets = { - example_key = { }; - - "example_service/example_subdir/example_secret" = { }; + loginPassword = { }; }; }; diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml index 8964ab0..c6955d2 100644 --- a/secrets/secrets.yaml +++ b/secrets/secrets.yaml @@ -13,6 +13,7 @@ example_number: ENC[AES256_GCM,data:gxzec/b+0cL9kQ==,iv:dV4rMTf2CzF1yRp66cplfJ7f example_booleans: - ENC[AES256_GCM,data:6vp2cw==,iv:Wtu2qxbNGYVJ/p9TCWafupusHDpHB6ebI9ywdvG8gU4=,tag:pde0H3f32YPTyGyCfZ/pWA==,type:bool] - ENC[AES256_GCM,data:c+gP21M=,iv:gK4Rv9aK7WhyQgfgFKQNZ5+XJGQZVog7Iw8riHr3j2E=,tag:AQdSIXrUrkmHwOqhzkTM3g==,type:bool] +loginPassword: ENC[AES256_GCM,data:CRZJzt/euKNAz6R7xL/+8+kN+I5dgWGOUsm3owsEcN7bmWp9GkNDqEuwIESgM6ofONPNw5B2W28oZAb0vLjNwArG0HOLep5Whg==,iv:rj4qvlm9Dd032FTZQY8MWRtq08pKVS7siraoQyhbPO8=,tag:duiTteFqbZgLhUGSc/Cx2w==,type:str] sops: kms: [] gcp_kms: [] @@ -28,8 +29,8 @@ sops: d1dydnhrYURjQzdGWmRneHNHTDRhUWcKKh9csHYkTTl+KQtWHJc9SqNpF590jd/A nb1ANVrf7xz7kkPTWEQaCFrPuuZeTrteNti0WfXm6fXT/O8KFzJMaQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-03-08T12:41:21Z" - mac: ENC[AES256_GCM,data:5gQQzODL3YKb3FrXO8h7eQJuNsc2uOSmEmjFjhybQ8mPENhAXp75nLloxIzmErDA0Pcc3RR1P5hBMJRbhAE9gMMA15XH7yh1XA16Gqkd2RAEX4V3UMxiwWjpMuV1oPx7VRNjr1lbH+i62P3NQGSZEAFVrG1HRkD59EqLvAgFC7M=,iv:hN8+r8EYWz928s1lSXsJh2W0VU1TQ4Jq2LEwhD6XXr8=,tag:Ljz+EzVFTEJMjIKnT6eRtg==,type:str] + lastmodified: "2025-03-08T16:33:21Z" + mac: ENC[AES256_GCM,data:SsuGyraKmnrpe76V56fwFjPbW9WQkV5U/aBAm6yY0+Phxjqca9Iwkw/08ud31Im4qXZDsUfc0w3QDImddIc0dwthEfYD9IcwfRD/2ll+NBEkgwvTPRNu1YLx/7xeVhF7k6XKp5pZCytDh7NxUz21Vs0rA5+1/UgthS+mOfS2LQw=,iv:fCXNRN9gT+7d0sMzEzy6CUr9lpEzS8BnYKtdHYYjZtQ=,tag:Jd0b+3C9LRHtSjneuAX6JA==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.9.4