1
1
Fork 0

1password: add custom browser option and move ssh config

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-12-21 13:42:52 -05:00
parent 0d629d507f
commit 685b8e8cdd
Signed by: myned
GPG key ID: C7224454F7881A34
2 changed files with 24 additions and 9 deletions

View file

@ -7,7 +7,11 @@
with lib; let with lib; let
cfg = config.custom.programs._1password; cfg = config.custom.programs._1password;
in { 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 { config = mkIf cfg.enable {
programs = { programs = {
@ -22,5 +26,23 @@ in {
polkitPolicyOwners = [config.custom.username]; # Desktop integration 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
'';
};
}; };
} }

View file

@ -16,14 +16,7 @@ in {
''; '';
home-manager.users.${config.custom.username} = { home-manager.users.${config.custom.username} = {
programs.ssh = { programs.ssh.enable = true;
enable = true;
extraConfig = ''
Host *
IdentityAgent ~/.1password/agent.sock
'';
};
# Work around FHS permissions # Work around FHS permissions
# https://github.com/nix-community/home-manager/issues/322#issuecomment-1856128020 # https://github.com/nix-community/home-manager/issues/322#issuecomment-1856128020