From 935d4a5ee517360cd3cc6074d652589711d43ab1 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 18 Jul 2023 17:00:51 +0200 Subject: [PATCH] modules: Use inherit instead of with --- modules/dgn-access-control.nix | 10 ++++++++-- modules/dgn-ssh.nix | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/dgn-access-control.nix b/modules/dgn-access-control.nix index 1813262..b073a09 100644 --- a/modules/dgn-access-control.nix +++ b/modules/dgn-access-control.nix @@ -34,6 +34,14 @@ { config, lib, dgn-lib, meta, name, ... }: let + inherit (lib) + mkDefault + mkEnableOption + mkIf + mkOption + + types; + nodeMeta = meta.nodes.${name}; admins = meta.members.groups.root ++ nodeMeta.admins ++ (builtins.concatMap (g: meta.members.groups.${g}) nodeMeta.adminGroups); @@ -41,8 +49,6 @@ let cfg = config.dgn-access-control; in -with lib; - { options.dgn-access-control = { enable = mkEnableOption "DGNum access control." // { default = true; }; diff --git a/modules/dgn-ssh.nix b/modules/dgn-ssh.nix index 88c6b67..ede7bae 100644 --- a/modules/dgn-ssh.nix +++ b/modules/dgn-ssh.nix @@ -34,9 +34,11 @@ { config, lib, ... }: -with lib; - let + inherit (lib) + mkEnableOption + mkIf; + cfg = config.dgn-ssh; in