1Password: Difference between revisions

From NixOS Wiki
imported>Pluiedev
m forgot to specify nixpkgs as an input
imported>Pluiedev
m not required
Line 2: Line 2:
If you're using NixOS, you can enable 1Password and its GUI by:
If you're using NixOS, you can enable 1Password and its GUI by:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{ config, lib, pkgs, nixpkgs, ... }:
{ config, lib, pkgs, ... }:
{
{
   # Enable the unfree 1Password packages
   # Enable the unfree 1Password packages

Revision as of 03:44, 10 July 2023

Using 1Password on NixOS

If you're using NixOS, you can enable 1Password and its GUI by:

/etc/nixos/configuration.nix
{ config, lib, pkgs, ... }:
{
  # Enable the unfree 1Password packages
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "1password-gui"
    "1password"
  ];
  # Alternatively, you could also just allow all unfree packages
  # nixpkgs.config.allowUnfree = true;

  programs._1password.enable = true;
  programs._1password-gui = {
    enable = true;
    # Certain features, including CLI integration and system authentication support,
    # require enabling PolKit integration on some desktop environments (e.g. Plasma).
    polkitPolicyOwners = [ "yourUsernameHere" ];
  };
  ...
}

On non-NixOS installs (TODO)