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