1Password: Difference between revisions
m →Configuring Git: Typo Fix |
Format an clean up the nix code |
||
| (5 intermediate revisions by 5 users not shown) | |||
| Line 7: | Line 7: | ||
If you're using [[NixOS]], you can enable 1Password and its GUI with: | If you're using [[NixOS]], you can enable 1Password and its GUI with: | ||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
{ | { | ||
lib, | |||
... | |||
}: | |||
{ | { | ||
# Enable the unfree 1Password packages | # Enable the unfree 1Password packages | ||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ | nixpkgs.config.allowUnfreePredicate = | ||
pkg: | |||
builtins.elem (lib.getName pkg) [ | |||
"1password-cli" | |||
"1password-gui" | |||
"1password" | |||
]; | |||
# Alternatively, you could also just allow all unfree packages | # Alternatively, you could also just allow all unfree packages | ||
# nixpkgs.config.allowUnfree = true; | # nixpkgs.config.allowUnfree = true; | ||
| Line 24: | Line 31: | ||
polkitPolicyOwners = [ "yourUsernameHere" ]; | polkitPolicyOwners = [ "yourUsernameHere" ]; | ||
}; | }; | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
| Line 42: | Line 48: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ | |||
environment.etc = { | |||
"1password/custom_allowed_browsers" = { | |||
text = '' | |||
vivaldi-bin | |||
wavebox | |||
''; | |||
mode = "0755"; | |||
}; | }; | ||
}; | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Unlocking with System Authentication === | |||
1Password allows [https://support.1password.com/system-authentication-linux/ unlocking with system authentication]. This means fingerprints or login passwords may be used in addition to the master password. This must be enabled under the Security preferences tab of 1Password as outlined in the 1Password documentation, but also requires a few other system tools to work. | |||
For the graphical authentication prompt to work, a user [[Polkit#Authentication_agents|Polkit authentication agent]] must be started. The authentication agent may automatically be started under Gnome, KDE, or other DE at login, but may need to be explicitly enabled for other window managers. | |||
For fingerprint unlocking to work, [[Fingerprint scanner|fingerprint scanning]] to be enabled and allowed for typical system authentication. | |||
== Home Manager == | == Home Manager == | ||
{{warning|1=Non-[[NixOS]] installs [https://1password.community/ | {{warning|1=Non-[[NixOS]] installs [https://www.1password.community/discussions/1password/sandboxed-application-cant-communicate-with-browser-extension/91984/replies/92015 will not link with browser extensions or system authentication] }} | ||
=== Installation === | === Installation === | ||
| Line 62: | Line 78: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ | |||
pkgs, | |||
... | |||
}: | |||
{ | |||
home.packages = [ | home.packages = [ | ||
pkgs._1password | pkgs._1password | ||
pkgs._1password-gui | pkgs._1password-gui | ||
]; | ]; | ||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 79: | Line 102: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ | |||
config, | |||
pkgs, | |||
in { | ... | ||
}: | |||
let | |||
onePassPath = | |||
if pkgs.stdenv.isDarwin then | |||
"${config.home.homeDirectory}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" | |||
else | |||
"${config.home.homeDirectory}/.1password/agent.sock"; | |||
in | |||
{ | |||
home.sessionVariables.SSH_AUTH_SOCK = onePassPath; | |||
# or, alternatively, set it in `.ssh/config` which has higher precedence: | |||
programs.ssh = { | programs.ssh = { | ||
enable = true; | enable = true; | ||
| Line 98: | Line 134: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ | |||
lib, | |||
pkgs, | |||
... | |||
}: | |||
{ | { | ||
programs.git = { | programs.git = { | ||