mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
Replace some uses of lib.mapAttrsToList
This commit is contained in:
parent
d5f3296bf0
commit
be8712c85a
4 changed files with 12 additions and 8 deletions
|
|
@ -24,13 +24,15 @@
|
||||||
|
|
||||||
hostCreationRules =
|
hostCreationRules =
|
||||||
self.nixosConfigurations
|
self.nixosConfigurations
|
||||||
|> lib.filterAttrs (_: value: value.config.custom.sops.enable or false)
|
|> lib.attrValues
|
||||||
|> lib.mapAttrsToList (_: value: mkCreationRule value.config.custom.sops);
|
|> lib.filter (value: value.config.custom.sops.enable or false)
|
||||||
|
|> lib.map (value: mkCreationRule value.config.custom.sops);
|
||||||
|
|
||||||
userCreationRules =
|
userCreationRules =
|
||||||
self.nixosConfigurations
|
self.nixosConfigurations
|
||||||
|> lib.filterAttrs (_: value: value.config.home-manager.users.seb.custom.sops.enable or false)
|
|> lib.attrValues
|
||||||
|> lib.mapAttrsToList (_: value: mkCreationRule value.config.home-manager.users.seb.custom.sops);
|
|> lib.filter (value: value.config.home-manager.users.seb.custom.sops.enable or false)
|
||||||
|
|> lib.map (value: mkCreationRule value.config.home-manager.users.seb.custom.sops);
|
||||||
|
|
||||||
jsonConfig = { creation_rules = hostCreationRules ++ userCreationRules; } |> lib.strings.toJSON;
|
jsonConfig = { creation_rules = hostCreationRules ++ userCreationRules; } |> lib.strings.toJSON;
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
{
|
{
|
||||||
channel.enable = false;
|
channel.enable = false;
|
||||||
registry = flakeInputs |> lib.mapAttrs (_: flake: { inherit flake; });
|
registry = flakeInputs |> lib.mapAttrs (_: flake: { inherit flake; });
|
||||||
nixPath = flakeInputs |> lib.mapAttrsToList (name: _: "${name}=flake:${name}");
|
nixPath = flakeInputs |> lib.attrNames |> lib.map (name: "${name}=flake:${name}");
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
flake-registry = "";
|
flake-registry = "";
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ in
|
||||||
type = lib.types.listOf lib.types.nonEmptyStr;
|
type = lib.types.listOf lib.types.nonEmptyStr;
|
||||||
default =
|
default =
|
||||||
self.nixosConfigurations
|
self.nixosConfigurations
|
||||||
|> lib.mapAttrsToList (_: value: value.config.meta.domains.list)
|
|> lib.attrValues
|
||||||
|
|> lib.map (value: value.config.meta.domains.list)
|
||||||
|> lib.concatLists;
|
|> lib.concatLists;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
};
|
};
|
||||||
|
|
@ -29,7 +30,8 @@ in
|
||||||
let
|
let
|
||||||
duplicateDomains =
|
duplicateDomains =
|
||||||
self.nixosConfigurations
|
self.nixosConfigurations
|
||||||
|> lib.mapAttrsToList (_: value: value.options.meta.domains.list.definitionsWithLocations)
|
|> lib.attrValues
|
||||||
|
|> lib.map (value: value.options.meta.domains.list.definitionsWithLocations)
|
||||||
|> lib.concatLists
|
|> lib.concatLists
|
||||||
|> lib.concatMap (
|
|> lib.concatMap (
|
||||||
entry:
|
entry:
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules =
|
systemd.tmpfiles.rules =
|
||||||
resticBackups |> lib.mapAttrsToList (name: _: "d /var/cache/restic-backups-${name} 700 - - -");
|
resticBackups |> lib.attrNames |> lib.map (name: "d /var/cache/restic-backups-${name} 700 - - -");
|
||||||
|
|
||||||
services.restic.backups =
|
services.restic.backups =
|
||||||
resticBackups
|
resticBackups
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue