more secrets config

This commit is contained in:
serenity-F 2025-03-09 02:38:22 +10:00
parent 7107f42717
commit ddd394a607
4 changed files with 18 additions and 15 deletions

View file

@ -129,6 +129,7 @@
label = "SerenityOS"; label = "SerenityOS";
version = "SerenityOS_0.8.9"; # proper versioning system before v1.0.0? version = "SerenityOS_0.8.9"; # proper versioning system before v1.0.0?
primaryUser = "serenity"; # used for admin purposes primaryUser = "serenity"; # used for admin purposes
userDesc = "Serenity Amalgam";
homeDir = "/home/${primaryUser}"; # for easy configuration homeDir = "/home/${primaryUser}"; # for easy configuration
disksPath = "${homeDir}/Disks/"; # for easy disk navigation disksPath = "${homeDir}/Disks/"; # for easy disk navigation
flakePath = "${homeDir}/flakes/nixdots/"; # current path to flake - unused flakePath = "${homeDir}/flakes/nixdots/"; # current path to flake - unused
@ -147,7 +148,7 @@
inherit inputs outputs; inherit inputs outputs;
inherit label version; inherit label version;
inherit flakePath disksPath; inherit flakePath disksPath;
inherit primaryUser homeDir; inherit primaryUser userDesc homeDir;
inherit wallpaper; inherit wallpaper;
}; };
modules = [ modules = [
@ -164,7 +165,7 @@
inherit inputs outputs; inherit inputs outputs;
inherit label version; inherit label version;
inherit flakePath disksPath; inherit flakePath disksPath;
inherit primaryUser homeDir; inherit primaryUser userDesc homeDir;
inherit wallpaper; inherit wallpaper;
}; };
modules = [ modules = [
@ -180,7 +181,7 @@
inherit inputs outputs; inherit inputs outputs;
inherit label version; inherit label version;
inherit flakePath disksPath; inherit flakePath disksPath;
inherit primaryUser homeDir; inherit primaryUser userDesc homeDir;
inherit wallpaper; inherit wallpaper;
}; };
modules = [ modules = [
@ -202,7 +203,7 @@
inherit inputs outputs; inherit inputs outputs;
inherit label version; inherit label version;
inherit flakePath disksPath; inherit flakePath disksPath;
inherit primaryUser homeDir; inherit primaryUser userDesc homeDir;
inherit wallpaper; inherit wallpaper;
}; };
modules = [ modules = [

View file

@ -1,5 +1,5 @@
{ inputs, outputs, config, pkgs, label, version, flakePath, disksPath { inputs, outputs, config, pkgs, label, version, flakePath, disksPath
, primaryUser, homeDir, wallpaper, ... }: , primaryUser, userDesc, homeDir, wallpaper, ... }:
let hostname = "${config.networking.hostName}"; let hostname = "${config.networking.hostName}";
@ -9,6 +9,7 @@ in {
## Modules ## Modules
inputs.home-manager.nixosModules.default # home-manager module inputs.home-manager.nixosModules.default # home-manager module
inputs.sops-nix.nixosModules.sops # sops-nix module
## User themes - ## User themes -
## to set a different theme for a user, ## to set a different theme for a user,
@ -28,14 +29,17 @@ in {
## making sure to replace all instances of ## making sure to replace all instances of
## `${primaryUser}` with the new username. ## `${primaryUser}` with the new username.
## Needed for sops-nix to handle loginPassword
sops.secrets.loginPassword.neededForUsers = true;
users.mutableUsers = false;
## System-level user declarations ## System-level user declarations
users.users = { users.users = {
${primaryUser} = { ${primaryUser} = {
description = "Serenity Amalgam"; description = "${userDesc}";
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "gamemode" "audio" ]; extraGroups = [ "wheel" "networkmanager" "gamemode" "audio" ];
## be sure to change this with 'passwd' hashedPasswordFile = config.sops.secrets.loginPassword.path;
initialPassword = "password";
## A catgirl's favourite shell ## A catgirl's favourite shell
shell = pkgs.fish; shell = pkgs.fish;
}; };

View file

@ -10,15 +10,12 @@
sops = { sops = {
defaultSopsFile = ./secrets.yaml; # default sops file defaultSopsFile = ./secrets.yaml; # default sops file
defaultSopsFormat = "yaml"; # yaml for ease of use defaultSopsFormat = "yaml"; # yaml for ease of use
age.keyFile = "${homeDir}/.config/sops/age/keys.txt"; # keyfile location 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 = { secrets = {
example_key = { }; loginPassword = { };
"example_service/example_subdir/example_secret" = { };
}; };
}; };

View file

@ -13,6 +13,7 @@ example_number: ENC[AES256_GCM,data:gxzec/b+0cL9kQ==,iv:dV4rMTf2CzF1yRp66cplfJ7f
example_booleans: example_booleans:
- ENC[AES256_GCM,data:6vp2cw==,iv:Wtu2qxbNGYVJ/p9TCWafupusHDpHB6ebI9ywdvG8gU4=,tag:pde0H3f32YPTyGyCfZ/pWA==,type:bool] - 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] - 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: sops:
kms: [] kms: []
gcp_kms: [] gcp_kms: []
@ -28,8 +29,8 @@ sops:
d1dydnhrYURjQzdGWmRneHNHTDRhUWcKKh9csHYkTTl+KQtWHJc9SqNpF590jd/A d1dydnhrYURjQzdGWmRneHNHTDRhUWcKKh9csHYkTTl+KQtWHJc9SqNpF590jd/A
nb1ANVrf7xz7kkPTWEQaCFrPuuZeTrteNti0WfXm6fXT/O8KFzJMaQ== nb1ANVrf7xz7kkPTWEQaCFrPuuZeTrteNti0WfXm6fXT/O8KFzJMaQ==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2025-03-08T12:41:21Z" lastmodified: "2025-03-08T16:33:21Z"
mac: ENC[AES256_GCM,data:5gQQzODL3YKb3FrXO8h7eQJuNsc2uOSmEmjFjhybQ8mPENhAXp75nLloxIzmErDA0Pcc3RR1P5hBMJRbhAE9gMMA15XH7yh1XA16Gqkd2RAEX4V3UMxiwWjpMuV1oPx7VRNjr1lbH+i62P3NQGSZEAFVrG1HRkD59EqLvAgFC7M=,iv:hN8+r8EYWz928s1lSXsJh2W0VU1TQ4Jq2LEwhD6XXr8=,tag:Ljz+EzVFTEJMjIKnT6eRtg==,type:str] mac: ENC[AES256_GCM,data:SsuGyraKmnrpe76V56fwFjPbW9WQkV5U/aBAm6yY0+Phxjqca9Iwkw/08ud31Im4qXZDsUfc0w3QDImddIc0dwthEfYD9IcwfRD/2ll+NBEkgwvTPRNu1YLx/7xeVhF7k6XKp5pZCytDh7NxUz21Vs0rA5+1/UgthS+mOfS2LQw=,iv:fCXNRN9gT+7d0sMzEzy6CUr9lpEzS8BnYKtdHYYjZtQ=,tag:Jd0b+3C9LRHtSjneuAX6JA==,type:str]
pgp: [] pgp: []
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.9.4 version: 3.9.4