fix(nixos): preserve editor for host sops helper
This commit is contained in:
@@ -42,6 +42,10 @@ in
|
|||||||
|
|
||||||
users.groups.storage.gid = 10000;
|
users.groups.storage.gid = 10000;
|
||||||
|
|
||||||
|
security.sudo.extraConfig = ''
|
||||||
|
Defaults env_keep += "EDITOR VISUAL"
|
||||||
|
'';
|
||||||
|
|
||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
i18n.defaultLocale = "en_GB.UTF-8";
|
i18n.defaultLocale = "en_GB.UTF-8";
|
||||||
|
|
||||||
@@ -87,6 +91,10 @@ in
|
|||||||
|
|
||||||
update = "sudo nixos-rebuild switch --flake .#${config.networking.hostName}";
|
update = "sudo nixos-rebuild switch --flake .#${config.networking.hostName}";
|
||||||
cleanup = "sudo nix-collect-garbage -d";
|
cleanup = "sudo nix-collect-garbage -d";
|
||||||
|
sops-host = {
|
||||||
|
command = "sudo --preserve-env=EDITOR,VISUAL env SOPS_AGE_KEY_FILE=/var/lib/sops-nix/key.txt nix shell nixpkgs#sops nixpkgs#neovim -c sops";
|
||||||
|
abbreviation = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
modules.shell.fish.enable = lib.mkDefault true;
|
modules.shell.fish.enable = lib.mkDefault true;
|
||||||
|
|||||||
@@ -103,13 +103,6 @@ in
|
|||||||
body = builtins.readFile ./functions/deploy-to.fish;
|
body = builtins.readFile ./functions/deploy-to.fish;
|
||||||
};
|
};
|
||||||
|
|
||||||
sops-host = {
|
|
||||||
description = "Run sops with the host age key";
|
|
||||||
body = ''
|
|
||||||
sudo env SOPS_AGE_KEY_FILE=/var/lib/sops-nix/key.txt nix shell nixpkgs#sops -c sops $argv
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Rendered by home-manager into ~/.config/fish/config.fish.
|
# Rendered by home-manager into ~/.config/fish/config.fish.
|
||||||
|
|||||||
Reference in New Issue
Block a user