diff --git a/nixos/modules/programs/nh.nix b/nixos/modules/programs/nh.nix index 21ffa5cc17d2..321893f4bd23 100644 --- a/nixos/modules/programs/nh.nix +++ b/nixos/modules/programs/nh.nix @@ -8,7 +8,10 @@ let cfg = config.programs.nh; in { - meta.maintainers = [ lib.maintainers.viperML ]; + meta.maintainers = with lib.maintainers; [ + NotAShelf + viperML + ]; options.programs.nh = { enable = lib.mkEnableOption "nh, yet another Nix CLI helper"; @@ -19,9 +22,18 @@ in type = lib.types.nullOr lib.types.path; default = null; description = '' - The path that will be used for the `FLAKE` environment variable. + The path that will be used for the `NH_FLAKE` environment variable. - `FLAKE` is used by nh as the default flake for performing actions, like `nh os switch`. + `NH_FLAKE` is used by nh as the default flake for performing actions, such as + `nh os switch`. This behaviour can be overriden per-command with environment + variables that will take priority. + + - `NH_OS_FLAKE`: will take priority for `nh os` commands. + - `NH_HOME_FLAKE`: will take priority for `nh home` commands. + - `NH_DARWIN_FLAKE`: will take priority for `nh darwin` commands. + + The formerly valid `FLAKE` is now deprecated by nh, and will cause hard errors + in future releases if `NH_FLAKE` is not set. ''; }; @@ -77,7 +89,7 @@ in environment = lib.mkIf cfg.enable { systemPackages = [ cfg.package ]; variables = lib.mkIf (cfg.flake != null) { - FLAKE = cfg.flake; + NH_FLAKE = cfg.flake; }; };