From 435f1b3aa15e7f4de322084c0225972626b928b3 Mon Sep 17 00:00:00 2001 From: jahanson Date: Thu, 30 May 2024 23:55:10 -0500 Subject: [PATCH] Moving more stuff around --- nixos/modules/README.md | 2 +- nixos/modules/nixos/system/impermanence.nix | 5 +---- nixos/modules/nixos/system/nix.nix | 7 +------ nixos/modules/nixos/system/openssh.nix | 7 +------ nixos/modules/nixos/system/pushover/default.nix | 2 +- nixos/modules/nixos/system/security.nix | 5 +---- nixos/modules/nixos/system/systempackages.nix | 6 +----- nixos/modules/nixos/system/time.nix | 5 +---- nixos/modules/nixos/system/zfs.nix | 7 +------ nixos/profiles/global.nix | 2 +- nixos/profiles/global/default.nix | 1 - nixos/profiles/global/sops.nix | 2 +- nixos/profiles/global/system.nix | 3 +-- 13 files changed, 12 insertions(+), 42 deletions(-) diff --git a/nixos/modules/README.md b/nixos/modules/README.md index 59f655c..b82e9a9 100644 --- a/nixos/modules/README.md +++ b/nixos/modules/README.md @@ -1,6 +1,6 @@ ## Modules -A set of 'custom' modules with the aim to enable easy on/off/settings to build up a system modulary to my 'specs'. +A set of 'custom' modules with the aim to enable easy on/off/settings to build up a system modularly to my 'specs'. The main goal is to build up a `mySystem` options key which is easy to read and toggle functionality on and off. diff --git a/nixos/modules/nixos/system/impermanence.nix b/nixos/modules/nixos/system/impermanence.nix index a6aebb2..6285963 100644 --- a/nixos/modules/nixos/system/impermanence.nix +++ b/nixos/modules/nixos/system/impermanence.nix @@ -1,7 +1,4 @@ -{ lib -, config -, ... -}: +{ lib, config, ... }: let cfg = config.mySystem.system.impermanence; in diff --git a/nixos/modules/nixos/system/nix.nix b/nixos/modules/nixos/system/nix.nix index 29019aa..c6a0b67 100644 --- a/nixos/modules/nixos/system/nix.nix +++ b/nixos/modules/nixos/system/nix.nix @@ -1,8 +1,4 @@ -{ lib -, config -, self -, ... -}: +{ lib, config, ... }: with lib; let cfg = config.mySystem.nix; @@ -27,7 +23,6 @@ in }; }; }; - config.nix = { optimise.automatic = cfg.autoOptimiseStore; # automatically garbage collect nix store diff --git a/nixos/modules/nixos/system/openssh.nix b/nixos/modules/nixos/system/openssh.nix index 3933aac..b794596 100644 --- a/nixos/modules/nixos/system/openssh.nix +++ b/nixos/modules/nixos/system/openssh.nix @@ -1,8 +1,4 @@ -{ lib -, config -, self -, ... -}: +{ lib, config, ... }: with lib; let cfg = config.mySystem.services.openssh; @@ -23,7 +19,6 @@ in default = "no"; }; }; - config = mkIf cfg.enable { services.openssh = { enable = true; diff --git a/nixos/modules/nixos/system/pushover/default.nix b/nixos/modules/nixos/system/pushover/default.nix index 4f0866e..68f02bd 100644 --- a/nixos/modules/nixos/system/pushover/default.nix +++ b/nixos/modules/nixos/system/pushover/default.nix @@ -8,7 +8,7 @@ let cfg = config.mySystem.system.systemd.pushover-alerts; in { - options.mySystem.system.systemd.pushover-alerts.enable = mkEnableOption "Pushover alers for systemd failures" // { default = true; }; + options.mySystem.system.systemd.pushover-alerts.enable = mkEnableOption "Pushover alerts for systemd failures" // { default = true; }; options.systemd.services = mkOption { type = with types; attrsOf ( submodule { diff --git a/nixos/modules/nixos/system/security.nix b/nixos/modules/nixos/system/security.nix index d02137f..4bbadfc 100644 --- a/nixos/modules/nixos/system/security.nix +++ b/nixos/modules/nixos/system/security.nix @@ -1,7 +1,4 @@ -{ lib -, config -, ... -}: +{ lib, config, ... }: with lib; let cfg = config.mySystem.security; diff --git a/nixos/modules/nixos/system/systempackages.nix b/nixos/modules/nixos/system/systempackages.nix index 4e4fc53..bfa6f37 100644 --- a/nixos/modules/nixos/system/systempackages.nix +++ b/nixos/modules/nixos/system/systempackages.nix @@ -1,8 +1,4 @@ -{ lib -, config -, self -, ... -}: +{ lib, config, ... }: with lib; let cfg = config.mySystem.system; diff --git a/nixos/modules/nixos/system/time.nix b/nixos/modules/nixos/system/time.nix index 76b8dc2..c1af81e 100644 --- a/nixos/modules/nixos/system/time.nix +++ b/nixos/modules/nixos/system/time.nix @@ -1,7 +1,4 @@ -{ lib -, config -, ... -}: +{ lib, config, ... }: let cfg = config.mySystem.time; in diff --git a/nixos/modules/nixos/system/zfs.nix b/nixos/modules/nixos/system/zfs.nix index fecbcd5..5cce269 100644 --- a/nixos/modules/nixos/system/zfs.nix +++ b/nixos/modules/nixos/system/zfs.nix @@ -1,8 +1,4 @@ -{ lib -, config -, pkgs -, ... -}: +{ lib, config, pkgs, ... }: let cfg = config.mySystem.system.zfs; in @@ -40,6 +36,5 @@ with lib; ZED_PUSHOVER_TOKEN = "$(${pkgs.busybox}/bin/cat ${config.sops.secrets.pushover-api-key.path})"; ZED_PUSHOVER_USER = "$(${pkgs.busybox}/bin/cat ${config.sops.secrets.pushover-user-key.path})"; }; - }; } diff --git a/nixos/profiles/global.nix b/nixos/profiles/global.nix index 495bd8b..a2887e1 100644 --- a/nixos/profiles/global.nix +++ b/nixos/profiles/global.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, imports, modulesPath, ... }: +{ config, lib, pkgs, modulesPath, ... }: with lib; { diff --git a/nixos/profiles/global/default.nix b/nixos/profiles/global/default.nix index 9a3b0c0..395d6ee 100644 --- a/nixos/profiles/global/default.nix +++ b/nixos/profiles/global/default.nix @@ -5,5 +5,4 @@ ./system.nix ./users.nix ]; - } diff --git a/nixos/profiles/global/sops.nix b/nixos/profiles/global/sops.nix index 77bd84e..6e0f23b 100644 --- a/nixos/profiles/global/sops.nix +++ b/nixos/profiles/global/sops.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ ... }: { sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; # Secret for machine-specific pushover diff --git a/nixos/profiles/global/system.nix b/nixos/profiles/global/system.nix index 6c6301a..62356f1 100644 --- a/nixos/profiles/global/system.nix +++ b/nixos/profiles/global/system.nix @@ -1,5 +1,4 @@ -{ config, lib, pkgs, ... }: -with lib; +{ lib, pkgs, ... }: { system = { # Enable printing changes on nix build etc with nvd