diff --git a/flake.nix b/flake.nix index ac0b0b8..40eaca8 100644 --- a/flake.nix +++ b/flake.nix @@ -77,11 +77,11 @@ (filter (name: !hasPrefix "_" (builtins.baseNameOf name))) ]; - lib1 = with lib0; extend (_: _: pipe (collectNixFiles ./lib) [ + lib1 = with lib0; extend (const (const (pipe (collectNixFiles ./lib) [ (map (file: import file lib0)) (filter (thunk: !isFunction thunk)) (foldl' recursiveUpdate {}) - ]); + ]))); nixpkgsOverlayModule = with lib1; { nixpkgs.overlays = [(final: prev: { @@ -97,7 +97,7 @@ }; homeManagerModule = { lib, ... }: with lib; { - home-manager.users = genAttrs allNormalUsers (_: {}); + home-manager.users = genAttrs allNormalUsers (const {}); home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; @@ -135,12 +135,12 @@ modules = [ ./hosts/${name} ] ++ optionModules; }; - in extend (_: _: pipe (collectNixFiles ./lib) [ + in extend (const (const (pipe (collectNixFiles ./lib) [ (map (file: import file lib1)) (filter (isFunction)) (map (func: func hostStub.config)) (foldl' recursiveUpdate {}) - ])); + ])))); configurations = lib1.genAttrs hosts (name: lib2s.${name}.nixosSystem { inherit specialArgs; @@ -153,5 +153,5 @@ nixosConfigurations = configurations; # This is here so we can do self. instead of self.nixosConfigurations..config. - } // lib1.mapAttrs (_: value: value.config) configurations; + } // lib1.mapAttrs (lib1.const (value: value.config)) configurations; } diff --git a/hosts/cube/forgejo/default.nix b/hosts/cube/forgejo/default.nix index e5b4a2f..53e734f 100644 --- a/hosts/cube/forgejo/default.nix +++ b/hosts/cube/forgejo/default.nix @@ -24,7 +24,7 @@ in systemConfiguration { }]; }; - services.restic.backups = genAttrs config.resticHosts (_: { + services.restic.backups = genAttrs config.resticHosts (const { paths = [ "/var/lib/gitea-runner" "/var/lib/forgejo" ]; }); diff --git a/hosts/cube/grafana/default.nix b/hosts/cube/grafana/default.nix index 75c469c..bbea952 100644 --- a/hosts/cube/grafana/default.nix +++ b/hosts/cube/grafana/default.nix @@ -24,7 +24,7 @@ in systemConfiguration { }]; }; - services.restic.backups = genAttrs config.resticHosts (_: { + services.restic.backups = genAttrs config.resticHosts (const { paths = [ "/var/lib/grafana" ]; }); diff --git a/hosts/cube/matrix/default.nix b/hosts/cube/matrix/default.nix index d159b0c..ac055ea 100644 --- a/hosts/cube/matrix/default.nix +++ b/hosts/cube/matrix/default.nix @@ -59,7 +59,7 @@ in serverSystemConfiguration { ]; }; - services.restic.backups = genAttrs config.resticHosts (_: { + services.restic.backups = genAttrs config.resticHosts (const { paths = [ "/var/lib/matrix-synapse" "/var/lib/matrix-sliding-sync" ]; }); diff --git a/hosts/cube/nextcloud/default.nix b/hosts/cube/nextcloud/default.nix index 176a297..f54eca0 100644 --- a/hosts/cube/nextcloud/default.nix +++ b/hosts/cube/nextcloud/default.nix @@ -32,7 +32,7 @@ in systemConfiguration { }]; }; - services.restic.backups = genAttrs config.resticHosts (_: { + services.restic.backups = genAttrs config.resticHosts (const { paths = [ "/var/lib/nextcloud" ]; }); diff --git a/hosts/cube/postgresql.nix b/hosts/cube/postgresql.nix index 149bca8..89db7e7 100644 --- a/hosts/cube/postgresql.nix +++ b/hosts/cube/postgresql.nix @@ -6,7 +6,7 @@ runAsLocalSuperUser = true; }; - services.restic.backups = genAttrs config.resticHosts (_: { + services.restic.backups = genAttrs config.resticHosts (const { paths = [ "/tmp/postgresql-dump.sql.gz" ]; backupPrepareCommand = '' diff --git a/hosts/cube/prometheus.nix b/hosts/cube/prometheus.nix index ba497aa..857b908 100644 --- a/hosts/cube/prometheus.nix +++ b/hosts/cube/prometheus.nix @@ -22,7 +22,7 @@ systemConfiguration { scrapeConfigs = with lib; let configToScrapeConfig = name: { config, ... }: pipe config.services.prometheus.exporters [ - (filterAttrs (_: value: value.enable or false)) + (filterAttrs (const (value: value.enable or false))) (mapAttrsToList (expName: expConfig: { job_name = "${expName}-${name}"; diff --git a/hosts/disk/mail/default.nix b/hosts/disk/mail/default.nix index d685621..9fbff9e 100644 --- a/hosts/disk/mail/default.nix +++ b/hosts/disk/mail/default.nix @@ -13,7 +13,7 @@ in systemConfiguration { listenAddress = "[::]"; }; - services.restic.backups = genAttrs config.resticHosts (_: { + services.restic.backups = genAttrs config.resticHosts (const { paths = [ config.mailserver.dkimKeyDirectory config.mailserver.mailDirectory ]; }); diff --git a/lib/configuration2.nix b/lib/configuration2.nix index aa59e78..ccc3298 100644 --- a/lib/configuration2.nix +++ b/lib/configuration2.nix @@ -1,15 +1,15 @@ lib: config: let userHomeConfiguration = users: cfg: { - home-manager.users = lib.genAttrs users (_: cfg); + home-manager.users = lib.genAttrs users (lib.const cfg); }; allNormalUsers = [ "root" ] ++ lib.pipe config.users.users [ - (lib.filterAttrs (_: lib.getAttr "isNormalUser")) + (lib.filterAttrs (lib.const (lib.getAttr "isNormalUser"))) lib.attrNames ]; desktopUsers = lib.pipe config.users.users [ - (lib.filterAttrs (_: lib.getAttr "isDesktopUser")) + (lib.filterAttrs (lib.const (lib.getAttr "isDesktopUser"))) lib.attrNames ]; in rec { diff --git a/modules/helix.nix b/modules/helix.nix index d28c870..c048e9c 100644 --- a/modules/helix.nix +++ b/modules/helix.nix @@ -159,7 +159,7 @@ render.tab = "all"; }; - settings.keys = genAttrs [ "normal" "select" ] (_: { + settings.keys = genAttrs [ "normal" "select" ] (const { D = "extend_to_line_end"; }); }; diff --git a/modules/hyprland/fuzzel.nix b/modules/hyprland/fuzzel.nix index da1749f..b122a3d 100644 --- a/modules/hyprland/fuzzel.nix +++ b/modules/hyprland/fuzzel.nix @@ -42,7 +42,7 @@ desktopUserHomeConfiguration { inner-pad = padding; }; - settings.colors = mapAttrs (_: color: color + "FF") { + settings.colors = mapAttrs (const (color: color + "FF")) { background = base00; text = base05; match = base0A; diff --git a/modules/localisation.nix b/modules/localisation.nix index 7d5a1fc..dc80b8d 100644 --- a/modules/localisation.nix +++ b/modules/localisation.nix @@ -25,5 +25,5 @@ "LC_PAPER" "LC_TELEPHONE" "LC_TIME" - ] (_: "tr_TR.UTF-8"); + ] (const "tr_TR.UTF-8"); }) diff --git a/modules/nix.nix b/modules/nix.nix index 4f338c0..5a7d61b 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -17,7 +17,7 @@ registry = { default.flake = inputs.nixpkgs; - } // mapAttrs (_: value: mkIf (isType "flake" value) { + } // mapAttrs (const (value: mkIf (isType "flake" value)) { flake = value; }) inputs; diff --git a/modules/nushell/default.nix b/modules/nushell/default.nix index 43425df..7036c81 100644 --- a/modules/nushell/default.nix +++ b/modules/nushell/default.nix @@ -40,7 +40,7 @@ configFile.text = readFile ./configuration.nu; envFile.source = ./environment.nu; - environmentVariables = mapAttrs (_: value: ''"${value}"'') config.environment.variables; + environmentVariables = mapAttrs (const (value: ''"${value}"'')) config.environment.variables; shellAliases = (attrsets.removeAttrs config.environment.shellAliases [ "ls" "l" ]) // { cdtmp = "cd (mktemp --directory)"; diff --git a/modules/restic/password.age b/modules/restic/password.age new file mode 100644 index 0000000..7737abd --- /dev/null +++ b/modules/restic/password.age @@ -0,0 +1,13 @@ +age-encryption.org/v1 +-> ssh-ed25519 +rZ0Tw Em0WbO4gplG2ja+XW889tC0EGeuc8Mv3IfOWvwN0QXE +5zIOO6qXiBcOOPe00D5hWMaQiA8pM6zmsWxV2wubNJE +-> ssh-ed25519 spFFQA Dp3QVWKHnrPnJXQ3n9t6PzDLuulZu98CZDm25WZaJgA +4PexDQzjTEA3KQ2oo+2lC8cHdYp8iOc5ilKrnf54uOU +-> ssh-ed25519 CzqbPQ Ove5RO0REKpcyDrcihPYFqAxO0ynvK9MIJhM2BX8v1A +KyIbllnvM+Eiir2wsMp1mdkyjbKPcsCQy8tNLoF+CNA +-> ssh-ed25519 dASlBQ P3eVN6O2MfcSzdIlV6z7ALBtKC0HhtW296qDIjtayEk ++drcAG52h0dzmp45woWadyNlUqaY156XaGEeq5AR0JM +-> ssh-ed25519 f5VzMA 4e4M6qzgt1qiZp2DJrd9Jk5wDEVBB8Gac31litJ62Ug +QretaVV5MLi5qwt18eQyDCJiTvicV/VAvvImfx1//FI +--- 5AqRIM2qsjiMytT70BtR7JS/XRNj5U7mpzSu6mjmmrY +}M}K6aGs⒞B$i[ն@LoIL \ No newline at end of file diff --git a/secrets.nix b/secrets.nix index c3a8756..c68cd90 100644 --- a/secrets.nix +++ b/secrets.nix @@ -14,8 +14,6 @@ with import ./keys.nix; { "hosts/cube/nextcloud/password.age".publicKeys = [ cube ] ++ admins; - "hosts/cube/restic/password.age".publicKeys = [ cube ] ++ admins; - # disk "hosts/disk/id.age".publicKeys = [ disk ] ++ admins; "hosts/disk/password.floppy.age".publicKeys = [ disk ] ++ admins; @@ -33,5 +31,6 @@ with import ./keys.nix; { "hosts/nine/password.seven.age".publicKeys = [ nine ] ++ admins; # shared - "modules/ssh/config.age".publicKeys = all; + "modules/ssh/config.age".publicKeys = all; + "modules/restic/password.age".publicKeys = all; }