From 07ad5b45941fa3e33a70270592815fa317a14c19 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Fri, 31 Jul 2026 19:44:36 -0500 Subject: environment string instead of trying to detect env --- module.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module.nix') diff --git a/module.nix b/module.nix index e9acd17..25b508e 100644 --- a/module.nix +++ b/module.nix @@ -1,3 +1,4 @@ +environment: { lib, config, @@ -6,7 +7,6 @@ }: let cfg = config.programs.neovim-vanilla; - isHomeManager = lib.hasAttrByPath [ "home" "packages" ] config; pluginDir = let @@ -131,13 +131,15 @@ in config = lib.mkIf cfg.enable ( # NOTE: Don't use programs.neovim since that will build neovim from source in either case - if isHomeManager then + if environment == "home-manager" then { home.packages = [ finalPackage ]; } - else + else if environment == "nixos" then { environment.systemPackages = [ finalPackage ]; } + else + throw "Unknown environment: ${environment}" ); } -- cgit v1.2.3