Skip to content

Commit 9e0c714

Browse files
authored
Merge pull request #471 from Aigeruth/optional-package
Optional package
2 parents 61135fa + 1ed2b8b commit 9e0c714

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nix/shell-plugins.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ in {
2121
options = {
2222
programs._1password-shell-plugins = {
2323
enable = mkEnableOption "1Password Shell Plugins";
24+
package = mkPackageOption pkgs "_1password-cli" { nullable = true; };
2425
plugins = mkOption {
2526
type = types.listOf types.package;
2627
default = [ ];
@@ -62,7 +63,7 @@ in {
6263
name = package;
6364
value = "op plugin run -- ${package}";
6465
}) pkg-exe-names);
65-
packages = [ pkgs._1password ] ++ cfg.plugins;
66+
packages = lib.optional (cfg.package != null) cfg.package ++ cfg.plugins;
6667
in mkIf cfg.enable (mkMerge [
6768
({
6869
programs = {

0 commit comments

Comments
 (0)