From 97b7348c2bbf676fde7c2ee2bc77543885ee64a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Sun, 22 Feb 2026 13:03:26 +0100 Subject: [PATCH] chore: use config instead of cfg everywhere --- modules/nixos/initrd-ssh.nix | 12 +++++------- modules/nixos/tuigreet.nix | 7 ++----- modules/nixos/workstation.nix | 5 +---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/modules/nixos/initrd-ssh.nix b/modules/nixos/initrd-ssh.nix index 76edb61..4afeddb 100644 --- a/modules/nixos/initrd-ssh.nix +++ b/modules/nixos/initrd-ssh.nix @@ -7,8 +7,6 @@ let # TODO:(@janezicmatej) restructure keys import keys = import ../../users/matej/keys.nix; - cfg = config.initrd-ssh; - # generate host keys for new machines: ./scripts/initrd-ssh-keygen.sh keyDir = "/etc/secrets/initrd"; @@ -63,10 +61,10 @@ in }; }; - config = lib.mkIf cfg.enable { - boot.initrd.kernelModules = [ cfg.networkModule ]; - boot.kernelParams = lib.mkIf cfg.ip.enable [ - "ip=${mkIpString cfg.ip}" + config = lib.mkIf config.initrd-ssh.enable { + boot.initrd.kernelModules = [ config.initrd-ssh.networkModule ]; + boot.kernelParams = lib.mkIf config.initrd-ssh.ip.enable [ + "ip=${mkIpString config.initrd-ssh.ip}" ]; boot.initrd.network = { @@ -78,7 +76,7 @@ in "${keyDir}/ssh_host_rsa_key" "${keyDir}/ssh_host_ed25519_key" ]; - inherit (cfg) authorizedKeys; + inherit (config.initrd-ssh) authorizedKeys; }; postCommands = '' echo 'cryptsetup-askpass' >> /root/.profile diff --git a/modules/nixos/tuigreet.nix b/modules/nixos/tuigreet.nix index ec59f35..764f06b 100644 --- a/modules/nixos/tuigreet.nix +++ b/modules/nixos/tuigreet.nix @@ -4,9 +4,6 @@ pkgs, ... }: -let - cfg = config.tuigreet; -in { options = { tuigreet = { @@ -18,7 +15,7 @@ in }; }; - config = lib.mkIf cfg.enable { + config = lib.mkIf config.tuigreet.enable { services.greetd = { enable = true; useTextGreeter = true; @@ -27,7 +24,7 @@ in command = builtins.toString ( pkgs.writeShellScript "tuigreet-session" '' ${pkgs.util-linux}/bin/setterm --blank 1 --powersave powerdown --powerdown 1 - exec ${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd ${cfg.command} + exec ${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd ${config.tuigreet.command} '' ); user = "greeter"; diff --git a/modules/nixos/workstation.nix b/modules/nixos/workstation.nix index 6ac1315..4f83637 100644 --- a/modules/nixos/workstation.nix +++ b/modules/nixos/workstation.nix @@ -4,9 +4,6 @@ pkgs, ... }: -let - cfg = config.workstation; -in { options = { workstation = { @@ -14,7 +11,7 @@ in }; }; - config = lib.mkIf cfg.enable { + config = lib.mkIf config.workstation.enable { virtualisation.docker = { enable = true; logDriver = "json-file";