fix(nixos): preserve editor for host sops helper

This commit is contained in:
2026-09-10 09:40:08 -04:00
parent eefe203045
commit f8b8273764
2 changed files with 8 additions and 7 deletions

View File

@@ -42,6 +42,10 @@ in
users.groups.storage.gid = 10000;
security.sudo.extraConfig = ''
Defaults env_keep += "EDITOR VISUAL"
'';
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_GB.UTF-8";
@@ -87,6 +91,10 @@ in
update = "sudo nixos-rebuild switch --flake .#${config.networking.hostName}";
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;

View File

@@ -103,13 +103,6 @@ in
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.