1password: add custom browser option and move ssh config
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
0d629d507f
commit
685b8e8cdd
2 changed files with 24 additions and 9 deletions
|
@ -7,7 +7,11 @@
|
|||
with lib; let
|
||||
cfg = config.custom.programs._1password;
|
||||
in {
|
||||
options.custom.programs._1password.enable = mkOption {default = false;};
|
||||
options.custom.programs._1password = {
|
||||
enable = mkOption {default = false;};
|
||||
agent = mkOption {default = true;};
|
||||
browser = mkOption {default = null;};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
|
@ -22,5 +26,23 @@ in {
|
|||
polkitPolicyOwners = [config.custom.username]; # Desktop integration
|
||||
};
|
||||
};
|
||||
|
||||
# https://wiki.nixos.org/wiki/1Password#Unlocking_browser_extensions
|
||||
environment.etc = mkIf (isString cfg.browser) {
|
||||
"1password/custom_allowed_browsers" = {
|
||||
mode = "0755";
|
||||
|
||||
text = ''
|
||||
${cfg.browser}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.${config.custom.username} = {
|
||||
programs.ssh.extraConfig = mkIf cfg.agent ''
|
||||
Host *
|
||||
IdentityAgent ~/.1password/agent.sock
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -16,14 +16,7 @@ in {
|
|||
'';
|
||||
|
||||
home-manager.users.${config.custom.username} = {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
Host *
|
||||
IdentityAgent ~/.1password/agent.sock
|
||||
'';
|
||||
};
|
||||
programs.ssh.enable = true;
|
||||
|
||||
# Work around FHS permissions
|
||||
# https://github.com/nix-community/home-manager/issues/322#issuecomment-1856128020
|
||||
|
|
Loading…
Reference in a new issue