modules: Use inherit instead of with
This commit is contained in:
parent
5b4cf12ed7
commit
935d4a5ee5
2 changed files with 12 additions and 4 deletions
|
@ -34,6 +34,14 @@
|
||||||
{ config, lib, dgn-lib, meta, name, ... }:
|
{ config, lib, dgn-lib, meta, name, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkDefault
|
||||||
|
mkEnableOption
|
||||||
|
mkIf
|
||||||
|
mkOption
|
||||||
|
|
||||||
|
types;
|
||||||
|
|
||||||
nodeMeta = meta.nodes.${name};
|
nodeMeta = meta.nodes.${name};
|
||||||
admins = meta.members.groups.root ++ nodeMeta.admins
|
admins = meta.members.groups.root ++ nodeMeta.admins
|
||||||
++ (builtins.concatMap (g: meta.members.groups.${g}) nodeMeta.adminGroups);
|
++ (builtins.concatMap (g: meta.members.groups.${g}) nodeMeta.adminGroups);
|
||||||
|
@ -41,8 +49,6 @@ let
|
||||||
cfg = config.dgn-access-control;
|
cfg = config.dgn-access-control;
|
||||||
in
|
in
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
options.dgn-access-control = {
|
options.dgn-access-control = {
|
||||||
enable = mkEnableOption "DGNum access control." // { default = true; };
|
enable = mkEnableOption "DGNum access control." // { default = true; };
|
||||||
|
|
|
@ -34,9 +34,11 @@
|
||||||
|
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkEnableOption
|
||||||
|
mkIf;
|
||||||
|
|
||||||
cfg = config.dgn-ssh;
|
cfg = config.dgn-ssh;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue