about summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-07-17 01:21:42 +0200
committerGitHub <noreply@github.com>2022-07-17 01:21:42 +0200
commit769329f5f883f991c3cc6f4eb18737c441e2e747 (patch)
tree03c59e7e835145d6c2172a3de0badceb37293197 /nixos/modules/programs
parent6d01ecd13630e1dc2546a564e21cc101ac2b36d2 (diff)
parent2a58907251af76c67c6d14c1e84e73f7eaeb95e8 (diff)
Merge pull request #172058 from midchildan/improvement/1pw-gid
nixos/_1password{,-gui}: use a static gid
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/_1password-gui.nix17
-rw-r--r--nixos/modules/programs/_1password.nix17
2 files changed, 14 insertions, 20 deletions
diff --git a/nixos/modules/programs/_1password-gui.nix b/nixos/modules/programs/_1password-gui.nix
index 42f6a0b52252c..657116c267d92 100644
--- a/nixos/modules/programs/_1password-gui.nix
+++ b/nixos/modules/programs/_1password-gui.nix
@@ -8,19 +8,16 @@ let
 
 in
 {
+  imports = [
+    (mkRemovedOptionModule [ "programs" "_1password-gui" "gid" ] ''
+      A preallocated GID will be used instead.
+    '')
+  ];
+
   options = {
     programs._1password-gui = {
       enable = mkEnableOption "the 1Password GUI application";
 
-      gid = mkOption {
-        type = types.addCheck types.int (x: x >= 1000);
-        example = literalExpression "5000";
-        description = ''
-          The gid to assign to the onepassword group, which is needed for browser integration.
-          It must be 1000 or greater.
-        '';
-      };
-
       polkitPolicyOwners = mkOption {
         type = types.listOf types.str;
         default = [ ];
@@ -44,7 +41,7 @@ in
     in
     mkIf cfg.enable {
       environment.systemPackages = [ package ];
-      users.groups.onepassword.gid = cfg.gid;
+      users.groups.onepassword.gid = config.ids.gids.onepassword;
 
       security.wrappers = {
         "1Password-BrowserSupport" = {
diff --git a/nixos/modules/programs/_1password.nix b/nixos/modules/programs/_1password.nix
index 547c12867a916..b87e9b776e85b 100644
--- a/nixos/modules/programs/_1password.nix
+++ b/nixos/modules/programs/_1password.nix
@@ -8,19 +8,16 @@ let
 
 in
 {
+  imports = [
+    (mkRemovedOptionModule [ "programs" "_1password" "gid" ] ''
+      A preallocated GID will be used instead.
+    '')
+  ];
+
   options = {
     programs._1password = {
       enable = mkEnableOption "the 1Password CLI tool";
 
-      gid = mkOption {
-        type = types.addCheck types.int (x: x >= 1000);
-        example = literalExpression "5001";
-        description = ''
-          The gid to assign to the onepassword-cli group, which is needed for integration with the 1Password GUI.
-          It must be 1000 or greater.
-        '';
-      };
-
       package = mkPackageOption pkgs "1Password CLI" {
         default = [ "_1password" ];
       };
@@ -29,7 +26,7 @@ in
 
   config = mkIf cfg.enable {
     environment.systemPackages = [ cfg.package ];
-    users.groups.onepassword-cli.gid = cfg.gid;
+    users.groups.onepassword-cli.gid = config.ids.gids.onepassword-cli;
 
     security.wrappers = {
       "op" = {