nixpkgs/nixos/modules/programs/_1password.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
807 B
Nix
Raw Normal View History

2022-03-26 00:50:04 +00:00
{ config, pkgs, lib, ... }:
let
2022-03-26 00:50:04 +00:00
cfg = config.programs._1password;
in
{
imports = [
(lib.mkRemovedOptionModule [ "programs" "_1password" "gid" ] ''
A preallocated GID will be used instead.
'')
];
2022-03-26 00:50:04 +00:00
options = {
programs._1password = {
enable = lib.mkEnableOption "the 1Password CLI tool";
2022-03-26 00:50:04 +00:00
package = lib.mkPackageOption pkgs "1Password CLI" {
default = [ "_1password" ];
2022-03-26 00:50:04 +00:00
};
};
};
config = lib.mkIf cfg.enable {
2022-03-26 00:50:04 +00:00
environment.systemPackages = [ cfg.package ];
users.groups.onepassword-cli.gid = config.ids.gids.onepassword-cli;
2022-03-26 00:50:04 +00:00
security.wrappers = {
"op" = {
source = "${cfg.package}/bin/op";
owner = "root";
group = "onepassword-cli";
setuid = false;
setgid = true;
};
};
};
}