home-manager: added 1password cli (includes wsl hack)

pull/1/head
Tudor Roman 2023-06-03 23:22:44 +02:00
parent c8f109f7b5
commit adc74969fb
4 changed files with 23 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, configName, ... }:
with lib;
let

View File

@ -6,5 +6,6 @@
./git.nix
./hx.nix
./neovim.nix
./op.nix
];
}

View File

@ -0,0 +1,18 @@
{ config, lib, pkgs, configName, ... }:
let
cfg = config.homeModules.tools.op;
in
with lib; {
options = {
homeModules.tools.op = {
enable = mkEnableOption "Enable 1Password CLI";
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
_1password
];
home.shellAliases.op = if configName == "wsl2" then "op.exe" else "";
};
}

View File

@ -23,6 +23,9 @@
enable = true;
defaultEditor = true;
};
op = {
enable = true;
};
};
};
}