Skip to content

Commit fe05f3c

Browse files
committed
Update to allow passing custom package version
1 parent f2ce41e commit fe05f3c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nix/shell-plugins.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let
88
pkgs.runCommand "op-plugin-list" { }
99
# 1Password CLI tries to create the config directory automatically, so set a temp XDG_CONFIG_HOME
1010
# since we don't actually need it for this
11-
"mkdir $out && XDG_CONFIG_HOME=$out ${pkgs._1password}/bin/op plugin list | cut -d ' ' -f1 | tail -n +2 > $out/plugins.txt"
11+
"mkdir $out && XDG_CONFIG_HOME=$out ${cfg.package}/bin/op plugin list | cut -d ' ' -f1 | tail -n +2 > $out/plugins.txt"
1212
}/plugins.txt");
1313
getExeName = package:
1414
# NOTE: SAFETY: This is okay because the `packages` list is also referred
@@ -21,6 +21,9 @@ in {
2121
options = {
2222
programs._1password-shell-plugins = {
2323
enable = mkEnableOption "1Password Shell Plugins";
24+
25+
package = lib.mkPackageOption pkgs "_1password";
26+
2427
plugins = mkOption {
2528
type = types.listOf types.package;
2629
default = [ ];
@@ -62,7 +65,7 @@ in {
6265
name = package;
6366
value = "op plugin run -- ${package}";
6467
}) pkg-exe-names);
65-
packages = [ pkgs._1password ] ++ cfg.plugins;
68+
packages = [ cfg.package ] ++ cfg.plugins;
6669
in mkIf cfg.enable (mkMerge [
6770
({
6871
programs = {

0 commit comments

Comments
 (0)