mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 00:53:12 +03:00
Merge pull request #165806 from Enzime/add/1password-module
nixos/_1password: init
This commit is contained in:
commit
2a3b62e922
@ -118,6 +118,7 @@
|
|||||||
./misc/version.nix
|
./misc/version.nix
|
||||||
./misc/wordlist.nix
|
./misc/wordlist.nix
|
||||||
./misc/nixops-autoluks.nix
|
./misc/nixops-autoluks.nix
|
||||||
|
./programs/_1password.nix
|
||||||
./programs/_1password-gui.nix
|
./programs/_1password-gui.nix
|
||||||
./programs/adb.nix
|
./programs/adb.nix
|
||||||
./programs/appgate-sdp.nix
|
./programs/appgate-sdp.nix
|
||||||
|
46
nixos/modules/programs/_1password.nix
Normal file
46
nixos/modules/programs/_1password.nix
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs._1password;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
programs._1password = {
|
||||||
|
enable = mkEnableOption "The 1Password CLI tool with biometric unlock and integration with the 1Password GUI.";
|
||||||
|
|
||||||
|
groupId = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
example = literalExpression "5001";
|
||||||
|
description = ''
|
||||||
|
The GroupID to assign to the onepassword-cli group, which is needed for integration with the 1Password GUI. The group ID must be 1000 or greater.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs._1password;
|
||||||
|
defaultText = literalExpression "pkgs._1password";
|
||||||
|
example = literalExpression "pkgs._1password";
|
||||||
|
description = ''
|
||||||
|
The 1Password CLI derivation to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
users.groups.onepassword-cli.gid = cfg.groupId;
|
||||||
|
|
||||||
|
security.wrappers = {
|
||||||
|
"op" = {
|
||||||
|
source = "${cfg.package}/bin/op";
|
||||||
|
owner = "root";
|
||||||
|
group = "onepassword-cli";
|
||||||
|
setuid = false;
|
||||||
|
setgid = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user