mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 21:29:12 +02:00
wip: migrate client modules
This commit is contained in:
parent
f6d2ff1544
commit
7ce27d5d2f
245 changed files with 20254 additions and 188 deletions
24
aspects/battery-sops.nix
Normal file
24
aspects/battery-sops.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, den, ... }:
|
||||
let
|
||||
hostContext = { name, args, class }: { host }: {
|
||||
nixos.sops.secrets.${name} = lib.mkIf (!host.isPublic) args // lib.optionalAttrs (class == "homeManager") { owner = host.mainUser; };
|
||||
};
|
||||
|
||||
# deadnix: skip
|
||||
hostUserContext = { name, args, class }: { host, user }: {
|
||||
nixos.sops.secrets.${name} = lib.mkIf (!host.isPublic) args // lib.optionalAttrs (class == "homeManager") { owner = host.mainUser; };
|
||||
};
|
||||
|
||||
homeContext = { name, args }: { home }: {
|
||||
homeManager.sops.secrets.${name} = lib.mkIf (!home.isPublic) args;
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
den.provides.sops = { name, args, class ? "homeManager" }: den.lib.parametric.exactly {
|
||||
includes = [
|
||||
(hostContext { inherit name args class; })
|
||||
(hostUserContext { inherit name args class; })
|
||||
] ++ lib.optional (class == "homeManager") (homeContext { inherit name args; });
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue