From 9f78cde62f828004b9130a97785b37c467734e52 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Wed, 15 Jan 2025 11:41:32 +0100 Subject: [PATCH] nixy: add global USER variable --- nixy/configuration.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/nixy/configuration.nix b/nixy/configuration.nix index 3d4279a..0bb8c2e 100644 --- a/nixy/configuration.nix +++ b/nixy/configuration.nix @@ -7,6 +7,9 @@ zremap, ... }: +let + USER = "akill"; +in { imports = [ ]; @@ -45,12 +48,12 @@ "borgbase_enc_key" = { sopsFile = ./secrets/borgbase_enc_key.yaml; - owner = config.users.users.akill.name; + owner = config.users.users.${USER}.name; }; "borgbase_ssh_key" = { sopsFile = ./secrets/borgbase_ssh_key.yaml; - owner = config.users.users.akill.name; + owner = config.users.users.${USER}.name; }; }; }; @@ -110,7 +113,7 @@ doas.enable = true; doas.extraRules = [ { - users = [ "akill" ]; + users = [ USER ]; keepEnv = true; persist = true; } @@ -437,7 +440,7 @@ { keys = [ 113 ]; events = [ "key" ]; - command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master toggle'"; + command = "/run/current-system/sw/bin/runuser -l ${USER} -c 'amixer -q set Master toggle'"; } { @@ -446,7 +449,7 @@ "key" "rep" ]; - command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%- unmute'"; + command = "/run/current-system/sw/bin/runuser -l ${USER} -c 'amixer -q set Master 5%- unmute'"; } { @@ -455,7 +458,7 @@ "key" "rep" ]; - command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%+ unmute'"; + command = "/run/current-system/sw/bin/runuser -l ${USER} -c 'amixer -q set Master 5%+ unmute'"; } { @@ -494,7 +497,7 @@ borgbackup.jobs."borgbase" = let - user = config.users.users.akill; + user = config.users.users.${USER}; home = user.home; in { @@ -631,7 +634,7 @@ algorithm = "zstd"; }; - users.users.akill = { + users.users.${USER} = { isNormalUser = true; shell = pkgs.zsh; extraGroups = [