nixy: add global USER variable

This commit is contained in:
Asmir A 2025-01-15 11:41:32 +01:00
parent 1240d5d3a2
commit 9f78cde62f
Signed by: asmir
GPG Key ID: 020C42B7A9ABA3E2

View File

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