From 85dafae4a6c5b2dc12d2cdfda20b025241b5d6c3 Mon Sep 17 00:00:00 2001 From: Gabor Nagy Date: Fri, 14 Jun 2024 22:10:41 +0100 Subject: [PATCH] Make installing the 1Password package optional 1Password CLI requires setting the group to onepassword-cli. This isn't possible when home-manager is installed in standalone mode (e.g. Ubuntu or other distributions). Opting out of installing the 1Password CLI with nix allows using the system-wide installation (e.g. via apt). --- nix/shell-plugins.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/shell-plugins.nix b/nix/shell-plugins.nix index 7e474620..acb82d03 100644 --- a/nix/shell-plugins.nix +++ b/nix/shell-plugins.nix @@ -21,7 +21,7 @@ in { options = { programs._1password-shell-plugins = { enable = mkEnableOption "1Password Shell Plugins"; - package = mkPackageOption pkgs "_1password" { }; + package = mkPackageOption pkgs "_1password" { nullable = true; }; plugins = mkOption { type = types.listOf types.package; default = [ ]; @@ -63,7 +63,7 @@ in { name = package; value = "op plugin run -- ${package}"; }) pkg-exe-names); - packages = [ cfg.package ] ++ cfg.plugins; + packages = lib.optional (cfg.package != null) cfg.package ++ cfg.plugins; in mkIf cfg.enable (mkMerge [ ({ programs = {