mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 12:51:34 +01:00
sops: Align home module with system module
This commit is contained in:
parent
2db3be17a6
commit
2f4a83a906
5 changed files with 12 additions and 15 deletions
|
|
@ -7,36 +7,35 @@
|
||||||
}@moduleArgs:
|
}@moduleArgs:
|
||||||
let
|
let
|
||||||
cfg = config.custom.sops;
|
cfg = config.custom.sops;
|
||||||
|
|
||||||
absoluteSecretsPath = "${self}/${cfg.secretsFile}";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ inputs.sops.homeManagerModules.sops ];
|
imports = [ inputs.sops.homeManagerModules.sops ];
|
||||||
|
|
||||||
options.custom.sops = {
|
options.custom.sops = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
agePublicKey = lib.mkOption {
|
|
||||||
type = lib.types.nonEmptyStr;
|
|
||||||
default = "";
|
|
||||||
};
|
|
||||||
hostName = lib.mkOption {
|
hostName = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
default = moduleArgs.osConfig.networking.hostName or "";
|
default = moduleArgs.osConfig.networking.hostName or "";
|
||||||
};
|
};
|
||||||
secretsFile = lib.mkOption {
|
agePublicKey = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
default = "users/${config.home.username}/@${cfg.hostName}/secrets.json";
|
default =
|
||||||
|
"${self}/users/${config.home.username}/@${cfg.hostName}/keys/age.pub" |> lib.readFile |> lib.trim;
|
||||||
|
};
|
||||||
|
secretsFile = lib.mkOption {
|
||||||
|
type = lib.types.path;
|
||||||
|
default = "${self}/users/${config.home.username}/@${cfg.hostName}/secrets.json";
|
||||||
};
|
};
|
||||||
secrets = lib.mkOption {
|
secrets = lib.mkOption {
|
||||||
type = lib.types.anything;
|
type = lib.types.anything;
|
||||||
default = absoluteSecretsPath |> lib.readFile |> lib.strings.fromJSON;
|
default = cfg.secretsFile |> lib.readFile |> lib.strings.fromJSON;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
sops = {
|
sops = {
|
||||||
age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
|
age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
|
||||||
defaultSopsFile = absoluteSecretsPath;
|
defaultSopsFile = cfg.secretsFile;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,7 @@ _: {
|
||||||
|
|
||||||
home.stateVersion = "23.11";
|
home.stateVersion = "23.11";
|
||||||
|
|
||||||
custom = {
|
custom.theme = "dark";
|
||||||
sops.agePublicKey = "age1p32cyzakxtcx346ej82ftln4r2aw2pcuazq3583s85nzsan4ygqsj32hjf";
|
|
||||||
theme = "dark";
|
|
||||||
};
|
|
||||||
|
|
||||||
wayland.windowManager.hyprland.settings.monitor = [ "DP-1,2560x1440@180,0x0,1" ];
|
wayland.windowManager.hyprland.settings.monitor = [ "DP-1,2560x1440@180,0x0,1" ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
users/seb/@desktop/keys/age.pub
Normal file
1
users/seb/@desktop/keys/age.pub
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
age1p32cyzakxtcx346ej82ftln4r2aw2pcuazq3583s85nzsan4ygqsj32hjf
|
||||||
|
|
@ -4,7 +4,6 @@ _: {
|
||||||
home.stateVersion = "24.11";
|
home.stateVersion = "24.11";
|
||||||
|
|
||||||
custom = {
|
custom = {
|
||||||
sops.agePublicKey = "age190mf9wx4ct7qvne3ly9j3cj9740z5wnfhsl6vsc5wtfyc5pueuas9hnjtr";
|
|
||||||
theme = "light";
|
theme = "light";
|
||||||
programs.brightnessctl.enable = true;
|
programs.brightnessctl.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
1
users/seb/@laptop/keys/age.pub
Normal file
1
users/seb/@laptop/keys/age.pub
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
age190mf9wx4ct7qvne3ly9j3cj9740z5wnfhsl6vsc5wtfyc5pueuas9hnjtr
|
||||||
Loading…
Add table
Add a link
Reference in a new issue