chore: use config instead of cfg everywhere

This commit is contained in:
2026-02-22 13:03:26 +01:00
parent b6ae96cb84
commit 97b7348c2b
3 changed files with 8 additions and 16 deletions

View File

@@ -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

View File

@@ -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";

View File

@@ -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";