···16 generate = name: value:
17 let mkParam = k: v:
18 if v == null then []
19- else if isBool v then if v then [("--"+k)] else []
20 else [("--"+k) v];
21 mkParams = k: v: map (mkParam k) (if isList v then v else [v]);
22 in escapeShellArgs (concatLists (concatLists (mapAttrsToList mkParams value)));
···16 generate = name: value:
17 let mkParam = k: v:
18 if v == null then []
19+ else if isBool v then optional v ("--"+k)
20 else [("--"+k) v];
21 mkParams = k: v: map (mkParam k) (if isList v then v else [v]);
22 in escapeShellArgs (concatLists (concatLists (mapAttrsToList mkParams value)));
···305306 # If you really have to access root via FTP use mkOverride or userlistDeny
307 # = false and whitelist root
308- services.vsftpd.userlist = if cfg.userlistDeny then ["root"] else [];
309310 systemd = {
311 tmpfiles.rules = optional cfg.anonymousUser
···305306 # If you really have to access root via FTP use mkOverride or userlistDeny
307 # = false and whitelist root
308+ services.vsftpd.userlist = optional cfg.userlistDeny "root";
309310 systemd = {
311 tmpfiles.rules = optional cfg.anonymousUser
+2-3
nixos/modules/services/security/tor.nix
···769 };
770 options.SOCKSPort = mkOption {
771 description = lib.mdDoc (descriptionGeneric "SOCKSPort");
772- default = if cfg.settings.HiddenServiceNonAnonymousMode == true then [{port = 0;}] else [];
773 defaultText = literalExpression ''
774 if config.${opt.settings}.HiddenServiceNonAnonymousMode == true
775 then [ { port = 0; } ]
···897 allowedTCPPorts =
898 concatMap (o:
899 if isInt o && o > 0 then [o]
900- else if o ? "port" && isInt o.port && o.port > 0 then [o.port]
901- else []
902 ) (flatten [
903 cfg.settings.ORPort
904 cfg.settings.DirPort
···769 };
770 options.SOCKSPort = mkOption {
771 description = lib.mdDoc (descriptionGeneric "SOCKSPort");
772+ default = lib.optionals cfg.settings.HiddenServiceNonAnonymousMode [{port = 0;}];
773 defaultText = literalExpression ''
774 if config.${opt.settings}.HiddenServiceNonAnonymousMode == true
775 then [ { port = 0; } ]
···897 allowedTCPPorts =
898 concatMap (o:
899 if isInt o && o > 0 then [o]
900+ else optionals (o ? "port" && isInt o.port && o.port > 0) [o.port]
0901 ) (flatten [
902 cfg.settings.ORPort
903 cfg.settings.DirPort
+1-1
nixos/modules/services/web-apps/dex.nix
···6 cfg = config.services.dex;
7 fixClient = client: if client ? secretFile then ((builtins.removeAttrs client [ "secretFile" ]) // { secret = client.secretFile; }) else client;
8 filteredSettings = mapAttrs (n: v: if n == "staticClients" then (builtins.map fixClient v) else v) cfg.settings;
9- secretFiles = flatten (builtins.map (c: if c ? secretFile then [ c.secretFile ] else []) (cfg.settings.staticClients or []));
1011 settingsFormat = pkgs.formats.yaml {};
12 configFile = settingsFormat.generate "config.yaml" filteredSettings;
···980 ++ luks.cryptoModules
981 # workaround until https://marc.info/?l=linux-crypto-vger&m=148783562211457&w=4 is merged
982 # remove once 'modprobe --show-depends xts' shows ecb as a dependency
983- ++ (if builtins.elem "xts" luks.cryptoModules then ["ecb"] else []);
984985 # copy the cryptsetup binary and it's dependencies
986 boot.initrd.extraUtilsCommands = let
···980 ++ luks.cryptoModules
981 # workaround until https://marc.info/?l=linux-crypto-vger&m=148783562211457&w=4 is merged
982 # remove once 'modprobe --show-depends xts' shows ecb as a dependency
983+ ++ (optional (builtins.elem "xts" luks.cryptoModules) "ecb");
984985 # copy the cryptsetup binary and it's dependencies
986 boot.initrd.extraUtilsCommands = let