mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
This commit is contained in:
@@ -96,7 +96,6 @@ let
|
||||
# Rule names can currently be looked up here:
|
||||
# https://github.com/nix-community/nixd/blob/main/libnixf/src/Basic/diagnostic.py
|
||||
# TODO: Remove the following and fix things.
|
||||
"--ignore=parse-redundant-paren"
|
||||
"--ignore=sema-unused-def-lambda-noarg-formal"
|
||||
"--ignore=sema-unused-def-lambda-witharg-arg"
|
||||
"--ignore=sema-unused-def-lambda-witharg-formal"
|
||||
|
||||
@@ -35,7 +35,7 @@ stdenvNoCC.mkDerivation (
|
||||
decl:
|
||||
let
|
||||
declStr = toString decl;
|
||||
root = toString (../..);
|
||||
root = toString ../..;
|
||||
subpath = lib.removePrefix "/" (lib.removePrefix root declStr);
|
||||
in
|
||||
if lib.hasPrefix root declStr then
|
||||
|
||||
@@ -396,7 +396,7 @@ rec {
|
||||
outputs = drv.outputs or [ "out" ];
|
||||
|
||||
commonAttrs =
|
||||
drv // (listToAttrs outputsList) // ({ all = map (x: x.value) outputsList; }) // passthru;
|
||||
drv // (listToAttrs outputsList) // { all = map (x: x.value) outputsList; } // passthru;
|
||||
|
||||
outputToAttrListElement = outputName: {
|
||||
name = outputName;
|
||||
|
||||
@@ -26,29 +26,29 @@ in
|
||||
{
|
||||
imports = [
|
||||
# Module A
|
||||
({
|
||||
{
|
||||
options.attrsOfModule = attrsOfModule;
|
||||
options.mergedAttrsOfModule = attrsOfModule;
|
||||
options.listOfModule = listOfModule;
|
||||
options.mergedListOfModule = listOfModule;
|
||||
})
|
||||
}
|
||||
# Module B
|
||||
({
|
||||
{
|
||||
options.mergedAttrsOfModule = attrsOfModule;
|
||||
options.mergedListOfModule = listOfModule;
|
||||
})
|
||||
}
|
||||
# Values
|
||||
# It is important that the value is defined in a separate module
|
||||
# Without valueMeta the actual value and sub-options wouldn't be accessible via:
|
||||
# options.attrsOfModule.type.getSubOptions
|
||||
({
|
||||
{
|
||||
attrsOfModule = {
|
||||
foo.bar = 42;
|
||||
};
|
||||
mergedAttrsOfModule = {
|
||||
foo.bar = 42;
|
||||
};
|
||||
})
|
||||
}
|
||||
(
|
||||
{ options, ... }:
|
||||
{
|
||||
|
||||
@@ -4,9 +4,9 @@ let
|
||||
in
|
||||
{
|
||||
options.number = mkOption {
|
||||
type = types.submodule ({
|
||||
type = types.submodule {
|
||||
freeformType = types.attrsOf (types.either types.int types.int);
|
||||
});
|
||||
};
|
||||
default = {
|
||||
int = 42;
|
||||
}; # should not emit a warning
|
||||
|
||||
@@ -4,31 +4,31 @@ let
|
||||
in
|
||||
{
|
||||
options.either = mkOption {
|
||||
type = types.submodule ({
|
||||
type = types.submodule {
|
||||
freeformType = (types.either types.int types.int);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
options.eitherBehindNullor = mkOption {
|
||||
type = types.submodule ({
|
||||
type = types.submodule {
|
||||
freeformType = types.nullOr (types.either types.int types.int);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
options.oneOf = mkOption {
|
||||
type = types.submodule ({
|
||||
type = types.submodule {
|
||||
freeformType = (
|
||||
types.oneOf [
|
||||
types.int
|
||||
types.int
|
||||
]
|
||||
);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
options.number = mkOption {
|
||||
type = types.submodule ({
|
||||
type = types.submodule {
|
||||
freeformType = (types.number); # either int float
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ in
|
||||
default = lib.concatStringsSep " " (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (k: v: if k == "_module" then [ ] else [ (lib.showOption v.loc) ]) (
|
||||
(options.fun.type.getSubOptions [ "fun" ])
|
||||
options.fun.type.getSubOptions [ "fun" ]
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -157,9 +157,7 @@ lib.runTests (
|
||||
"x86_64-genode"
|
||||
];
|
||||
testredox = mseteq redox [ "x86_64-redox" ];
|
||||
testgnu = mseteq gnu (
|
||||
linux # ++ kfreebsd ++ ...
|
||||
);
|
||||
testgnu = mseteq gnu linux; # ++ kfreebsd ++ ...
|
||||
testillumos = mseteq illumos [ "x86_64-solaris" ];
|
||||
testlinux = mseteq linux [
|
||||
"aarch64-linux"
|
||||
|
||||
@@ -104,7 +104,7 @@ let
|
||||
in
|
||||
locatedModules ++ legacyModules;
|
||||
|
||||
noUserModules = evalModulesMinimal ({
|
||||
noUserModules = evalModulesMinimal {
|
||||
inherit prefix specialArgs;
|
||||
modules =
|
||||
baseModules
|
||||
@@ -113,7 +113,7 @@ let
|
||||
pkgsModule
|
||||
modulesModule
|
||||
];
|
||||
});
|
||||
};
|
||||
|
||||
# Extra arguments that are useful for constructing a similar configuration.
|
||||
modulesModule = {
|
||||
|
||||
@@ -361,12 +361,13 @@ rec {
|
||||
}:
|
||||
let
|
||||
typeDir =
|
||||
({
|
||||
{
|
||||
system = "system";
|
||||
initrd = "system";
|
||||
user = "user";
|
||||
nspawn = "nspawn";
|
||||
}).${type};
|
||||
}
|
||||
.${type};
|
||||
in
|
||||
pkgs.runCommand "${type}-units"
|
||||
{
|
||||
|
||||
@@ -104,9 +104,9 @@ let
|
||||
optionalString (
|
||||
config.networking.primaryIPAddress != ""
|
||||
) "${config.networking.primaryIPAddress} ${hostnames}"
|
||||
+ optionalString (config.networking.primaryIPv6Address != "") (
|
||||
"${config.networking.primaryIPv6Address} ${hostnames}"
|
||||
)
|
||||
+ optionalString (
|
||||
config.networking.primaryIPv6Address != ""
|
||||
) "${config.networking.primaryIPv6Address} ${hostnames}"
|
||||
);
|
||||
|
||||
virtualisation.qemu.options = qemuOptions;
|
||||
|
||||
@@ -241,7 +241,7 @@ in
|
||||
Invalid machine specifications:
|
||||
''
|
||||
+ " "
|
||||
+ (concatStringsSep "\n " (map (m: m.hostName) (filter (badMachine) cfg.buildMachines)));
|
||||
+ (concatStringsSep "\n " (map (m: m.hostName) (filter badMachine cfg.buildMachines)));
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ in
|
||||
etc = lib.mapAttrs' (
|
||||
desktop: terminals:
|
||||
# map desktop name such as GNOME to `xdg/gnome-xdg-terminals.list`, default to `xdg/xdg-terminals.list`
|
||||
lib.nameValuePair (
|
||||
"xdg/${if desktop == "default" then "" else "${lib.toLower desktop}-"}xdg-terminals.list"
|
||||
) { text = lib.concatLines terminals; }
|
||||
lib.nameValuePair "xdg/${
|
||||
if desktop == "default" then "" else "${lib.toLower desktop}-"
|
||||
}xdg-terminals.list" { text = lib.concatLines terminals; }
|
||||
) cfg.settings;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -333,7 +333,7 @@ in
|
||||
lib.mkIf cfg.enabled (
|
||||
lib.mkMerge [
|
||||
# Common
|
||||
({
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = !(nvidiaEnabled && cfg.datacenter.enable);
|
||||
@@ -388,7 +388,7 @@ in
|
||||
extraPackages32 = [ nvidia_x11.lib32 ];
|
||||
};
|
||||
environment.systemPackages = [ nvidia_x11.bin ];
|
||||
})
|
||||
}
|
||||
|
||||
# X11
|
||||
(lib.mkIf nvidiaEnabled {
|
||||
@@ -709,7 +709,7 @@ in
|
||||
"L+ /run/nvidia-docker/extras/bin/nvidia-persistenced - - - - ${nvidia_x11.persistenced}/origBin/nvidia-persistenced";
|
||||
|
||||
services = lib.mkMerge [
|
||||
({
|
||||
{
|
||||
nvidia-fabricmanager = {
|
||||
enable = true;
|
||||
description = "Start NVIDIA NVLink Management";
|
||||
@@ -736,7 +736,7 @@ in
|
||||
LimitCORE = "infinity";
|
||||
};
|
||||
};
|
||||
})
|
||||
}
|
||||
(lib.mkIf cfg.nvidiaPersistenced {
|
||||
"nvidia-persistenced" = {
|
||||
description = "NVIDIA Persistence Daemon";
|
||||
|
||||
@@ -117,7 +117,7 @@ in
|
||||
++ lib.optionals (cfg.quickPhraseFiles != { }) [
|
||||
(pkgs.linkFarm "quickPhraseFiles" (
|
||||
lib.mapAttrs' (
|
||||
name: value: lib.nameValuePair ("share/fcitx5/data/quickphrase.d/${name}.mb") value
|
||||
name: value: lib.nameValuePair "share/fcitx5/data/quickphrase.d/${name}.mb" value
|
||||
) cfg.quickPhraseFiles
|
||||
))
|
||||
];
|
||||
|
||||
@@ -950,7 +950,7 @@ in
|
||||
let
|
||||
cfgFiles =
|
||||
cfg:
|
||||
lib.optionals cfg.isoImage.showConfiguration ([
|
||||
lib.optionals cfg.isoImage.showConfiguration [
|
||||
{
|
||||
source = cfg.boot.kernelPackages.kernel + "/" + cfg.system.boot.loader.kernelFile;
|
||||
target = "/boot/" + cfg.boot.kernelPackages.kernel + "/" + cfg.system.boot.loader.kernelFile;
|
||||
@@ -959,7 +959,7 @@ in
|
||||
source = cfg.system.build.initialRamdisk + "/" + cfg.system.boot.loader.initrdFile;
|
||||
target = "/boot/" + cfg.system.build.initialRamdisk + "/" + cfg.system.boot.loader.initrdFile;
|
||||
}
|
||||
])
|
||||
]
|
||||
++ lib.concatLists (
|
||||
lib.mapAttrsToList (_: { configuration, ... }: cfgFiles configuration) cfg.specialisation
|
||||
);
|
||||
|
||||
@@ -212,18 +212,18 @@ in
|
||||
''
|
||||
);
|
||||
|
||||
run-builder = hostPkgs.writeShellScriptBin "run-builder" (''
|
||||
run-builder = hostPkgs.writeShellScriptBin "run-builder" ''
|
||||
set -euo pipefail
|
||||
KEYS="''${KEYS:-./keys}"
|
||||
KEYS="$(${hostPkgs.nix}/bin/nix-store --add "$KEYS")" ${lib.getExe config.system.build.vm}
|
||||
'');
|
||||
'';
|
||||
|
||||
script = hostPkgs.writeShellScriptBin "create-builder" (''
|
||||
script = hostPkgs.writeShellScriptBin "create-builder" ''
|
||||
set -euo pipefail
|
||||
export KEYS="''${KEYS:-./keys}"
|
||||
${lib.getExe add-keys}
|
||||
${lib.getExe run-builder}
|
||||
'');
|
||||
'';
|
||||
|
||||
in
|
||||
script.overrideAttrs (old: {
|
||||
|
||||
@@ -29,7 +29,7 @@ in
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
# Common
|
||||
({
|
||||
{
|
||||
environment.systemPackages = with pkgs.coolercontrol; [
|
||||
coolercontrol-gui
|
||||
];
|
||||
@@ -46,7 +46,7 @@ in
|
||||
coolercontrold.wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
# Nvidia support
|
||||
(lib.mkIf cfg.nvidiaSupport {
|
||||
|
||||
@@ -149,7 +149,7 @@ in
|
||||
languagePacks = lib.mkOption {
|
||||
# Available languages can be found in https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/
|
||||
type = lib.types.listOf (
|
||||
lib.types.enum ([
|
||||
lib.types.enum [
|
||||
"ach"
|
||||
"af"
|
||||
"an"
|
||||
@@ -253,7 +253,7 @@ in
|
||||
"xh"
|
||||
"zh-CN"
|
||||
"zh-TW"
|
||||
])
|
||||
]
|
||||
);
|
||||
default = [ ];
|
||||
description = ''
|
||||
@@ -285,7 +285,7 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
nativeMessagingHosts = ({
|
||||
nativeMessagingHosts = {
|
||||
packages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
default = [ ];
|
||||
@@ -293,7 +293,7 @@ in
|
||||
Additional packages containing native messaging hosts that should be made available to Firefox extensions.
|
||||
'';
|
||||
};
|
||||
})
|
||||
}
|
||||
// (builtins.mapAttrs (k: v: lib.mkEnableOption "${v.name} support") nmhOptions);
|
||||
};
|
||||
|
||||
|
||||
@@ -382,8 +382,8 @@ in
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/rm -f %t/ssh-agent";
|
||||
ExecStart =
|
||||
"${cfg.package}/bin/ssh-agent "
|
||||
+ lib.optionalString (cfg.agentTimeout != null) ("-t ${cfg.agentTimeout} ")
|
||||
+ lib.optionalString (cfg.agentPKCS11Whitelist != null) ("-P ${cfg.agentPKCS11Whitelist} ")
|
||||
+ lib.optionalString (cfg.agentTimeout != null) "-t ${cfg.agentTimeout} "
|
||||
+ lib.optionalString (cfg.agentPKCS11Whitelist != null) "-P ${cfg.agentPKCS11Whitelist} "
|
||||
+ "-a %t/ssh-agent";
|
||||
StandardOutput = "null";
|
||||
Type = "forking";
|
||||
|
||||
@@ -280,22 +280,22 @@ let
|
||||
# skip `null` value
|
||||
else
|
||||
[
|
||||
(
|
||||
" ${key}${
|
||||
if value == true then
|
||||
""
|
||||
# just output key if value is `true`
|
||||
else if isInt value then
|
||||
" ${builtins.toString value}"
|
||||
else if path.check value then
|
||||
" \"${value}\""
|
||||
# enclose path in ".."
|
||||
else if singleLineStr.check value then
|
||||
" ${value}"
|
||||
else
|
||||
throw "assertion failed: cannot convert type" # should never happen
|
||||
}"
|
||||
)
|
||||
|
||||
" ${key}${
|
||||
if value == true then
|
||||
""
|
||||
# just output key if value is `true`
|
||||
else if isInt value then
|
||||
" ${builtins.toString value}"
|
||||
else if path.check value then
|
||||
" \"${value}\""
|
||||
# enclose path in ".."
|
||||
else if singleLineStr.check value then
|
||||
" ${value}"
|
||||
else
|
||||
throw "assertion failed: cannot convert type" # should never happen
|
||||
}"
|
||||
|
||||
];
|
||||
|
||||
makeDsmSysStanza =
|
||||
|
||||
@@ -10,7 +10,7 @@ let
|
||||
in
|
||||
{
|
||||
options.programs.winbox = {
|
||||
enable = lib.mkEnableOption ("MikroTik Winbox");
|
||||
enable = lib.mkEnableOption "MikroTik Winbox";
|
||||
package = lib.mkPackageOption pkgs "winbox" { };
|
||||
|
||||
openFirewall = lib.mkOption {
|
||||
|
||||
@@ -37,7 +37,7 @@ in
|
||||
|
||||
# https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
|
||||
type = lib.types.listOf (
|
||||
lib.types.enum ([
|
||||
lib.types.enum [
|
||||
"main"
|
||||
"brackets"
|
||||
"pattern"
|
||||
@@ -45,7 +45,7 @@ in
|
||||
"regexp"
|
||||
"root"
|
||||
"line"
|
||||
])
|
||||
]
|
||||
);
|
||||
|
||||
description = ''
|
||||
|
||||
@@ -97,7 +97,7 @@ in
|
||||
|
||||
etc."please.ini".source = ini.generate "please.ini" (
|
||||
cfg.settings
|
||||
// (rec {
|
||||
// rec {
|
||||
# The "root" user is allowed to do anything by default and this cannot
|
||||
# be overridden.
|
||||
root_run_as_any = {
|
||||
@@ -113,7 +113,7 @@ in
|
||||
root_list_as_any = root_run_as_any // {
|
||||
type = "list";
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -294,11 +294,11 @@ in
|
||||
where = parentWrapperDir;
|
||||
what = "tmpfs";
|
||||
type = "tmpfs";
|
||||
options = lib.concatStringsSep "," ([
|
||||
options = lib.concatStringsSep "," [
|
||||
"nodev"
|
||||
"mode=755"
|
||||
"size=${config.security.wrapperDirSize}"
|
||||
]);
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ in
|
||||
|
||||
controls = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule ({
|
||||
lib.types.submodule {
|
||||
options.name = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
@@ -187,7 +187,7 @@ in
|
||||
The maximum volume in dB.
|
||||
'';
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
@@ -206,7 +206,7 @@ in
|
||||
|
||||
cardAliases = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule ({
|
||||
lib.types.submodule {
|
||||
options.driver = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
@@ -220,7 +220,7 @@ in
|
||||
The ID of the sound card
|
||||
'';
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
|
||||
@@ -81,18 +81,21 @@ in
|
||||
SupplementaryGroups = [ "audio" ];
|
||||
ExecStart =
|
||||
"${cfg.package}/bin/gmediarender "
|
||||
+ lib.optionalString (cfg.audioDevice != null) (
|
||||
"--gstout-audiodevice=${utils.escapeSystemdExecArg cfg.audioDevice} "
|
||||
)
|
||||
+ lib.optionalString (cfg.audioSink != null) (
|
||||
"--gstout-audiosink=${utils.escapeSystemdExecArg cfg.audioSink} "
|
||||
)
|
||||
+ lib.optionalString (cfg.friendlyName != null) (
|
||||
"--friendly-name=${utils.escapeSystemdExecArg cfg.friendlyName} "
|
||||
)
|
||||
+ lib.optionalString (cfg.initialVolume != 0) ("--initial-volume=${toString cfg.initialVolume} ")
|
||||
+ lib.optionalString (cfg.port != null) ("--port=${toString cfg.port} ")
|
||||
+ lib.optionalString (cfg.uuid != null) ("--uuid=${utils.escapeSystemdExecArg cfg.uuid} ");
|
||||
+ lib.optionalString (
|
||||
cfg.audioDevice != null
|
||||
) "--gstout-audiodevice=${utils.escapeSystemdExecArg cfg.audioDevice} "
|
||||
|
||||
+ lib.optionalString (
|
||||
cfg.audioSink != null
|
||||
) "--gstout-audiosink=${utils.escapeSystemdExecArg cfg.audioSink} "
|
||||
|
||||
+ lib.optionalString (
|
||||
cfg.friendlyName != null
|
||||
) "--friendly-name=${utils.escapeSystemdExecArg cfg.friendlyName} "
|
||||
|
||||
+ lib.optionalString (cfg.initialVolume != 0) "--initial-volume=${toString cfg.initialVolume} "
|
||||
+ lib.optionalString (cfg.port != null) "--port=${toString cfg.port} "
|
||||
+ lib.optionalString (cfg.uuid != null) "--uuid=${utils.escapeSystemdExecArg cfg.uuid} ";
|
||||
Restart = "always";
|
||||
RuntimeDirectory = "gmediarender";
|
||||
|
||||
|
||||
@@ -206,14 +206,13 @@ let
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
}
|
||||
(
|
||||
|
||||
''
|
||||
makeWrapper "${original}" "$out/bin/${name}" \
|
||||
${lib.concatStringsSep " \\\n " (
|
||||
lib.mapAttrsToList (name: value: ''--set ${name} "${value}"'') set
|
||||
)}
|
||||
'');
|
||||
''
|
||||
makeWrapper "${original}" "$out/bin/${name}" \
|
||||
${lib.concatStringsSep " \\\n " (
|
||||
lib.mapAttrsToList (name: value: ''--set ${name} "${value}"'') set
|
||||
)}
|
||||
'';
|
||||
|
||||
# Returns a singleton list, due to usage of lib.optional
|
||||
mkBorgWrapper =
|
||||
|
||||
@@ -31,39 +31,38 @@ let
|
||||
# datasets.
|
||||
buildAllowCommand =
|
||||
permissions: dataset:
|
||||
(
|
||||
"-+${pkgs.writeShellScript "zfs-allow-${dataset}" ''
|
||||
# Here we explicitly use the booted system to guarantee the stable API needed by ZFS
|
||||
|
||||
# Run a ZFS list on the dataset to check if it exists
|
||||
if ${
|
||||
lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"list"
|
||||
dataset
|
||||
]
|
||||
} 2> /dev/null; then
|
||||
"-+${pkgs.writeShellScript "zfs-allow-${dataset}" ''
|
||||
# Here we explicitly use the booted system to guarantee the stable API needed by ZFS
|
||||
|
||||
# Run a ZFS list on the dataset to check if it exists
|
||||
if ${
|
||||
lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"list"
|
||||
dataset
|
||||
]
|
||||
} 2> /dev/null; then
|
||||
${lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"allow"
|
||||
cfg.user
|
||||
(lib.concatStringsSep "," permissions)
|
||||
dataset
|
||||
]}
|
||||
${lib.optionalString ((builtins.dirOf dataset) != ".") ''
|
||||
else
|
||||
${lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"allow"
|
||||
cfg.user
|
||||
(lib.concatStringsSep "," permissions)
|
||||
dataset
|
||||
# Remove the last part of the path
|
||||
(builtins.dirOf dataset)
|
||||
]}
|
||||
${lib.optionalString ((builtins.dirOf dataset) != ".") ''
|
||||
else
|
||||
${lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"allow"
|
||||
cfg.user
|
||||
(lib.concatStringsSep "," permissions)
|
||||
# Remove the last part of the path
|
||||
(builtins.dirOf dataset)
|
||||
]}
|
||||
''}
|
||||
fi
|
||||
''}"
|
||||
);
|
||||
''}
|
||||
fi
|
||||
''}";
|
||||
|
||||
# Function to build "zfs unallow" commands for the filesystems we've
|
||||
# delegated permissions to. Here we unallow both the target but also
|
||||
@@ -73,28 +72,27 @@ let
|
||||
# since the dataset should have been created at this point.
|
||||
buildUnallowCommand =
|
||||
permissions: dataset:
|
||||
(
|
||||
"-+${pkgs.writeShellScript "zfs-unallow-${dataset}" ''
|
||||
# Here we explicitly use the booted system to guarantee the stable API needed by ZFS
|
||||
${lib.escapeShellArgs [
|
||||
|
||||
"-+${pkgs.writeShellScript "zfs-unallow-${dataset}" ''
|
||||
# Here we explicitly use the booted system to guarantee the stable API needed by ZFS
|
||||
${lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"unallow"
|
||||
cfg.user
|
||||
(lib.concatStringsSep "," permissions)
|
||||
dataset
|
||||
]}
|
||||
${lib.optionalString ((builtins.dirOf dataset) != ".") (
|
||||
lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"unallow"
|
||||
cfg.user
|
||||
(lib.concatStringsSep "," permissions)
|
||||
dataset
|
||||
]}
|
||||
${lib.optionalString ((builtins.dirOf dataset) != ".") (
|
||||
lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"unallow"
|
||||
cfg.user
|
||||
(lib.concatStringsSep "," permissions)
|
||||
# Remove the last part of the path
|
||||
(builtins.dirOf dataset)
|
||||
]
|
||||
)}
|
||||
''}"
|
||||
);
|
||||
# Remove the last part of the path
|
||||
(builtins.dirOf dataset)
|
||||
]
|
||||
)}
|
||||
''}";
|
||||
in
|
||||
{
|
||||
|
||||
|
||||
@@ -189,13 +189,13 @@ in
|
||||
services.hadoop.yarnSiteInternal =
|
||||
with cfg.yarn.nodemanager;
|
||||
lib.mkMerge [
|
||||
({
|
||||
{
|
||||
"yarn.nodemanager.local-dirs" = lib.mkIf (localDir != null) (concatStringsSep "," localDir);
|
||||
"yarn.scheduler.maximum-allocation-vcores" = resource.maximumAllocationVCores;
|
||||
"yarn.scheduler.maximum-allocation-mb" = resource.maximumAllocationMB;
|
||||
"yarn.nodemanager.resource.cpu-vcores" = resource.cpuVCores;
|
||||
"yarn.nodemanager.resource.memory-mb" = resource.memoryMB;
|
||||
})
|
||||
}
|
||||
(lib.mkIf useCGroups (
|
||||
lib.warnIf (lib.versionOlder cfg.package.version "3.5.0")
|
||||
''
|
||||
|
||||
@@ -342,14 +342,12 @@ in
|
||||
# dns addon is enabled by default
|
||||
services.kubernetes.addons.dns.enable = lib.mkDefault true;
|
||||
|
||||
services.kubernetes.apiserverAddress = lib.mkDefault (
|
||||
"https://${
|
||||
if cfg.apiserver.advertiseAddress != null then
|
||||
cfg.apiserver.advertiseAddress
|
||||
else
|
||||
"${cfg.masterAddress}:${toString cfg.apiserver.securePort}"
|
||||
}"
|
||||
);
|
||||
services.kubernetes.apiserverAddress = lib.mkDefault "https://${
|
||||
if cfg.apiserver.advertiseAddress != null then
|
||||
cfg.apiserver.advertiseAddress
|
||||
else
|
||||
"${cfg.masterAddress}:${toString cfg.apiserver.securePort}"
|
||||
}";
|
||||
}
|
||||
)
|
||||
];
|
||||
|
||||
@@ -137,7 +137,7 @@ in
|
||||
"@chown"
|
||||
];
|
||||
}
|
||||
// (lib.optionalAttrs (usingDefaultDataDir) {
|
||||
// (lib.optionalAttrs usingDefaultDataDir {
|
||||
StateDirectory = "temporal";
|
||||
StateDirectoryMode = "0700";
|
||||
});
|
||||
|
||||
@@ -200,10 +200,10 @@ in
|
||||
after = [
|
||||
"network-online.target"
|
||||
]
|
||||
++ optionals (wantsDocker) [
|
||||
++ optionals wantsDocker [
|
||||
"docker.service"
|
||||
]
|
||||
++ optionals (wantsPodman) [
|
||||
++ optionals wantsPodman [
|
||||
"podman.service"
|
||||
];
|
||||
wantedBy = [
|
||||
@@ -213,7 +213,7 @@ in
|
||||
optionalAttrs (instance.token != null) {
|
||||
TOKEN = "${instance.token}";
|
||||
}
|
||||
// optionalAttrs (wantsPodman) {
|
||||
// optionalAttrs wantsPodman {
|
||||
DOCKER_HOST = "unix:///run/podman/podman.sock";
|
||||
}
|
||||
// {
|
||||
@@ -266,10 +266,10 @@ in
|
||||
];
|
||||
ExecStart = "${cfg.package}/bin/act_runner daemon --config ${configFile}";
|
||||
SupplementaryGroups =
|
||||
optionals (wantsDocker) [
|
||||
optionals wantsDocker [
|
||||
"docker"
|
||||
]
|
||||
++ optionals (wantsPodman) [
|
||||
++ optionals wantsPodman [
|
||||
"podman"
|
||||
];
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ in
|
||||
'';
|
||||
|
||||
type = lib.types.nullOr (
|
||||
lib.types.submodule ({
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
certificate = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
@@ -258,7 +258,7 @@ in
|
||||
'';
|
||||
};
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -274,7 +274,7 @@ in
|
||||
FoundationDB locality settings.
|
||||
'';
|
||||
|
||||
type = lib.types.submodule ({
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
machineId = lib.mkOption {
|
||||
default = null;
|
||||
@@ -316,7 +316,7 @@ in
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
extraReadWritePaths = lib.mkOption {
|
||||
|
||||
@@ -357,7 +357,7 @@ in
|
||||
]
|
||||
) contentsFiles)
|
||||
++ [ "${openldap}/bin/slaptest -u -F ${configDir}" ];
|
||||
ExecStart = lib.escapeShellArgs ([
|
||||
ExecStart = lib.escapeShellArgs [
|
||||
"${openldap}/libexec/slapd"
|
||||
"-d"
|
||||
"0"
|
||||
@@ -365,7 +365,7 @@ in
|
||||
configDir
|
||||
"-h"
|
||||
(lib.concatStringsSep " " cfg.urlList)
|
||||
]);
|
||||
];
|
||||
Type = "notify";
|
||||
# Fixes an error where openldap attempts to notify from a thread
|
||||
# outside the main process:
|
||||
|
||||
@@ -136,9 +136,9 @@ let
|
||||
++ (optional (a.nice != null) "nice=${toString a.nice}")
|
||||
++ (optional (a.class != null) "sched=${prioToString a.class a.prio}")
|
||||
++ (optional (a.ioClass != null) "io=${prioToString a.ioClass a.ioPrio}")
|
||||
++ (optional ((builtins.length a.matchers) != 0) (
|
||||
++ (optional ((builtins.length a.matchers) != 0)
|
||||
"{\n${concatStringsSep "\n" (map (m: " ${indent}${m}") a.matchers)}\n${indent}}"
|
||||
))
|
||||
)
|
||||
);
|
||||
|
||||
in
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
let
|
||||
cfg = config.services.athens;
|
||||
|
||||
athensConfig = lib.flip lib.recursiveUpdate cfg.extraConfig ({
|
||||
athensConfig = lib.flip lib.recursiveUpdate cfg.extraConfig {
|
||||
GoBinary = "${cfg.goBinary}/bin/go";
|
||||
GoEnv = cfg.goEnv;
|
||||
GoBinaryEnvVars = lib.mapAttrsToList (k: v: "${k}=${v}") cfg.goBinaryEnvVars;
|
||||
@@ -141,7 +141,7 @@ let
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
configFile = lib.pipe athensConfig [
|
||||
(lib.filterAttrsRecursive (_k: v: v != null))
|
||||
|
||||
@@ -132,7 +132,7 @@ in
|
||||
|
||||
hardware.display.outputs = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule ({
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
edid = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
@@ -161,7 +161,7 @@ in
|
||||
'';
|
||||
};
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
description = ''
|
||||
Hardware/kernel-level configuration of specific outputs.
|
||||
|
||||
@@ -370,12 +370,12 @@ in
|
||||
(
|
||||
option:
|
||||
lib.mkRenamedOptionModule
|
||||
([
|
||||
[
|
||||
"services"
|
||||
"xserver"
|
||||
"libinput"
|
||||
option
|
||||
])
|
||||
]
|
||||
[
|
||||
"services"
|
||||
"libinput"
|
||||
|
||||
@@ -104,7 +104,7 @@ in
|
||||
MemoryDenyWriteExecute = true;
|
||||
PrivateUsers = true;
|
||||
|
||||
SupplementaryGroups = lib.optional (allowSystemdJournal) "systemd-journal";
|
||||
SupplementaryGroups = lib.optional allowSystemdJournal "systemd-journal";
|
||||
}
|
||||
// (optionalAttrs (!pkgs.stdenv.hostPlatform.isAarch64) {
|
||||
# FIXME: figure out why this breaks on aarch64
|
||||
|
||||
@@ -165,11 +165,11 @@ in
|
||||
# Default parameters from https://github.com/knadh/listmonk/blob/master/config.toml.sample
|
||||
services.listmonk.settings."app".address = lib.mkDefault "localhost:9000";
|
||||
services.listmonk.settings."db" = lib.mkMerge [
|
||||
({
|
||||
{
|
||||
max_open = lib.mkDefault 25;
|
||||
max_idle = lib.mkDefault 25;
|
||||
max_lifetime = lib.mkDefault "300s";
|
||||
})
|
||||
}
|
||||
(lib.mkIf cfg.database.createLocally {
|
||||
host = lib.mkDefault "/run/postgresql";
|
||||
port = lib.mkDefault 5432;
|
||||
|
||||
@@ -605,7 +605,7 @@ in
|
||||
];
|
||||
}
|
||||
)
|
||||
({
|
||||
{
|
||||
public-inbox-init =
|
||||
let
|
||||
PI_CONFIG = gitIni.generate "public-inbox.ini" (
|
||||
@@ -674,7 +674,7 @@ in
|
||||
};
|
||||
}
|
||||
];
|
||||
})
|
||||
}
|
||||
];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
};
|
||||
|
||||
@@ -129,7 +129,7 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
# backward compatibility: if password is set but not passwordFile, make one.
|
||||
services.roundcube.database.passwordFile = lib.mkIf (!localDB && cfg.database.password != "") (
|
||||
lib.mkDefault ("${pkgs.writeText "roundcube-password" cfg.database.password}")
|
||||
lib.mkDefault "${pkgs.writeText "roundcube-password" cfg.database.password}"
|
||||
);
|
||||
warnings =
|
||||
lib.optional (!localDB && cfg.database.password != "")
|
||||
|
||||
@@ -133,7 +133,7 @@ in
|
||||
in
|
||||
{
|
||||
path = "/var/cache/stalwart-mail";
|
||||
resource = lib.mkIf (hasHttpListener) (lib.mkDefault "file://${cfg.package.webadmin}/webadmin.zip");
|
||||
resource = lib.mkIf hasHttpListener (lib.mkDefault "file://${cfg.package.webadmin}/webadmin.zip");
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -143,10 +143,10 @@ in
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
environment = lib.mkMerge ([
|
||||
environment = lib.mkMerge [
|
||||
{ CONDUIT_CONFIG = configFile; }
|
||||
cfg.extraEnvironment
|
||||
]);
|
||||
];
|
||||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
User = "conduit";
|
||||
|
||||
@@ -232,7 +232,7 @@ let
|
||||
profileToFiles =
|
||||
name: profile:
|
||||
with profile;
|
||||
lib.mkMerge ([
|
||||
lib.mkMerge [
|
||||
{
|
||||
"xdg/autorandr/${name}/setup".text = lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList fingerprintToString fingerprint
|
||||
@@ -244,7 +244,7 @@ let
|
||||
(lib.mapAttrs' (hookToFile "${name}/postswitch.d") hooks.postswitch)
|
||||
(lib.mapAttrs' (hookToFile "${name}/preswitch.d") hooks.preswitch)
|
||||
(lib.mapAttrs' (hookToFile "${name}/predetect.d") hooks.predetect)
|
||||
]);
|
||||
];
|
||||
fingerprintToString = name: edid: "${name} ${edid}";
|
||||
configToString =
|
||||
name: config:
|
||||
@@ -373,12 +373,12 @@ in
|
||||
|
||||
environment = {
|
||||
systemPackages = [ pkgs.autorandr ];
|
||||
etc = lib.mkMerge ([
|
||||
etc = lib.mkMerge [
|
||||
(lib.mapAttrs' (hookToFile "postswitch.d") cfg.hooks.postswitch)
|
||||
(lib.mapAttrs' (hookToFile "preswitch.d") cfg.hooks.preswitch)
|
||||
(lib.mapAttrs' (hookToFile "predetect.d") cfg.hooks.predetect)
|
||||
(lib.mkMerge (lib.mapAttrsToList profileToFiles cfg.profiles))
|
||||
]);
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services.autorandr = {
|
||||
|
||||
@@ -138,7 +138,7 @@ in
|
||||
# creates gunicorn systemd service for each configured server
|
||||
systemd.services = lib.mapAttrs' (
|
||||
name: server:
|
||||
lib.nameValuePair ("bepasty-server-${name}-gunicorn") ({
|
||||
lib.nameValuePair "bepasty-server-${name}-gunicorn" {
|
||||
description = "Bepasty Server ${name}";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
@@ -186,7 +186,7 @@ in
|
||||
-k gevent
|
||||
'';
|
||||
};
|
||||
})
|
||||
}
|
||||
) cfg.servers;
|
||||
|
||||
users.users.${user} = {
|
||||
|
||||
@@ -270,9 +270,9 @@ in
|
||||
PORTUNUS_SLAPD_USER = cfg.ldap.user;
|
||||
PORTUNUS_SLAPD_SCHEMA_DIR = "${cfg.ldap.package}/etc/schema";
|
||||
}
|
||||
// (lib.optionalAttrs (cfg.seedPath != null) ({
|
||||
// (lib.optionalAttrs (cfg.seedPath != null) {
|
||||
PORTUNUS_SEED_PATH = cfg.seedPath;
|
||||
}))
|
||||
})
|
||||
// (lib.optionalAttrs cfg.ldap.tls (
|
||||
let
|
||||
acmeDirectory = config.security.acme.certs."${cfg.domain}".directory;
|
||||
|
||||
@@ -20,10 +20,10 @@ let
|
||||
|
||||
cfg = config.services.redlib;
|
||||
|
||||
args = concatStringsSep " " ([
|
||||
args = concatStringsSep " " [
|
||||
"--port ${toString cfg.port}"
|
||||
"--address ${cfg.address}"
|
||||
]);
|
||||
];
|
||||
|
||||
boolToString' = b: if b then "on" else "off";
|
||||
in
|
||||
|
||||
@@ -265,11 +265,11 @@ in
|
||||
}
|
||||
// (lib.mapAttrs' (
|
||||
name: subvolume:
|
||||
lib.nameValuePair "snapper/configs/${name}" ({
|
||||
lib.nameValuePair "snapper/configs/${name}" {
|
||||
text = lib.generators.toKeyValue { inherit mkKeyValue; } (
|
||||
lib.filterAttrs (k: v: v != defaultOf k) subvolume
|
||||
);
|
||||
})
|
||||
}
|
||||
) cfg.configs)
|
||||
// (lib.optionalAttrs (cfg.filters != null) { "snapper/filters/default.txt".text = cfg.filters; });
|
||||
};
|
||||
|
||||
@@ -129,7 +129,7 @@ in
|
||||
}${
|
||||
lib.optionalString (cfgS.screenName != "") " -n ${cfgS.screenName}"
|
||||
}${lib.optionalString cfgS.tls.enable " --enable-crypto"}${
|
||||
lib.optionalString (cfgS.tls.cert != null) (" --tls-cert ${cfgS.tls.cert}")
|
||||
lib.optionalString (cfgS.tls.cert != null) " --tls-cert ${cfgS.tls.cert}"
|
||||
}'';
|
||||
serviceConfig.Restart = "on-failure";
|
||||
};
|
||||
|
||||
@@ -354,7 +354,7 @@ in
|
||||
];
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.web.enable ({
|
||||
(lib.mkIf cfg.web.enable {
|
||||
systemd.services.graphiteWeb = {
|
||||
description = "Graphite Web Interface";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
@@ -415,7 +415,7 @@ in
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.python3Packages.graphite-web ];
|
||||
}))
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.seyren.enable {
|
||||
systemd.services.seyren = {
|
||||
|
||||
@@ -344,7 +344,7 @@ let
|
||||
"-m comment --comment ${name}-exporter -j nixos-fw-accept"
|
||||
]);
|
||||
networking.firewall.extraInputRules = mkIf (conf.openFirewall && nftables) conf.firewallRules;
|
||||
systemd.services."prometheus-${name}-exporter" = mkMerge ([
|
||||
systemd.services."prometheus-${name}-exporter" = mkMerge [
|
||||
{
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
@@ -381,14 +381,14 @@ let
|
||||
serviceConfig.UMask = "0077";
|
||||
}
|
||||
serviceOpts
|
||||
]);
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
options.services.prometheus.exporters = mkOption {
|
||||
type = types.submodule {
|
||||
options = (mkSubModules);
|
||||
options = mkSubModules;
|
||||
imports = [
|
||||
../../../misc/assertions.nix
|
||||
(lib.mkRenamedOptionModule [ "unifi-poller" ] [ "unpoller" ])
|
||||
|
||||
@@ -49,9 +49,9 @@ in
|
||||
For more information, take a look at the official documentation
|
||||
(https://github.com/prometheus-community/json_exporter) of the json_exporter.
|
||||
'')
|
||||
({
|
||||
{
|
||||
options.warnings = options.warnings;
|
||||
options.assertions = options.assertions;
|
||||
})
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@ in
|
||||
(mkRemovedOptionModule [ "insecure" ] ''
|
||||
This option was replaced by 'prometheus.exporters.nginx.sslVerify'.
|
||||
'')
|
||||
({
|
||||
{
|
||||
options.warnings = options.warnings;
|
||||
options.assertions = options.assertions;
|
||||
})
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -188,9 +188,9 @@ in
|
||||
into the cmdline of the exporter making the connection string effectively
|
||||
world-readable.
|
||||
'')
|
||||
({
|
||||
{
|
||||
options.warnings = options.warnings;
|
||||
options.assertions = options.assertions;
|
||||
})
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ in
|
||||
{
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "interval" ] "This option has been removed.")
|
||||
({
|
||||
{
|
||||
options.warnings = options.warnings;
|
||||
options.assertions = options.assertions;
|
||||
})
|
||||
}
|
||||
];
|
||||
|
||||
port = 9617;
|
||||
|
||||
@@ -111,9 +111,9 @@ in
|
||||
For more information, take a look at the official documentation
|
||||
(https://github.com/prometheus-community/json_exporter) of the json_exporter.
|
||||
'')
|
||||
({
|
||||
{
|
||||
options.warnings = options.warnings;
|
||||
options.assertions = options.assertions;
|
||||
})
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ in
|
||||
(mkRemovedOptionModule [
|
||||
"fetchType"
|
||||
] "This option was removed, use the `unbound.host` option instead.")
|
||||
({
|
||||
{
|
||||
options.warnings = options.warnings;
|
||||
options.assertions = options.assertions;
|
||||
})
|
||||
}
|
||||
];
|
||||
|
||||
port = 9167;
|
||||
|
||||
@@ -774,10 +774,8 @@ in
|
||||
};
|
||||
|
||||
query-frontend = paramsToOptions params.query-frontend // {
|
||||
enable = mkEnableOption (
|
||||
"the Thanos query frontend implements a service deployed in front of queriers to
|
||||
improve query parallelization and caching."
|
||||
);
|
||||
enable = mkEnableOption "the Thanos query frontend implements a service deployed in front of queriers to
|
||||
improve query parallelization and caching.";
|
||||
arguments = mkArgumentsOption "query-frontend";
|
||||
};
|
||||
|
||||
@@ -800,9 +798,7 @@ in
|
||||
};
|
||||
|
||||
receive = paramsToOptions params.receive // {
|
||||
enable = mkEnableOption (
|
||||
"the Thanos receiver which accept Prometheus remote write API requests and write to local tsdb"
|
||||
);
|
||||
enable = mkEnableOption "the Thanos receiver which accept Prometheus remote write API requests and write to local tsdb";
|
||||
arguments = mkArgumentsOption "receive";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -336,7 +336,7 @@ in
|
||||
ConfigurationDirectory = "bind";
|
||||
ReadWritePaths = [
|
||||
(lib.mapAttrsToList (
|
||||
name: config: if (lib.hasPrefix "/" config.file) then ("-${dirOf config.file}") else ""
|
||||
name: config: if (lib.hasPrefix "/" config.file) then "-${dirOf config.file}" else ""
|
||||
) cfg.zones)
|
||||
cfg.directory
|
||||
];
|
||||
|
||||
@@ -170,7 +170,7 @@ in
|
||||
'';
|
||||
};
|
||||
connectTo = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule (connectToSubmodule));
|
||||
type = lib.types.attrsOf (lib.types.submodule connectToSubmodule);
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
@@ -216,7 +216,7 @@ in
|
||||
};
|
||||
|
||||
connectTo = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule (connectToSubmodule));
|
||||
type = lib.types.attrsOf (lib.types.submodule connectToSubmodule);
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ in
|
||||
}
|
||||
'';
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule ({
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
server = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
@@ -60,7 +60,7 @@ in
|
||||
};
|
||||
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ let
|
||||
int
|
||||
listOf
|
||||
;
|
||||
innerType = coercedTo bool (x: if x then "Yes" else "No") (coercedTo int (toString) str);
|
||||
innerType = coercedTo bool (x: if x then "Yes" else "No") (coercedTo int toString str);
|
||||
in
|
||||
attrsOf (coercedTo innerType lib.singleton (listOf innerType));
|
||||
|
||||
|
||||
@@ -89,9 +89,9 @@ in
|
||||
};
|
||||
in
|
||||
{
|
||||
enable = lib.mkEnableOption (''
|
||||
enable = lib.mkEnableOption ''
|
||||
synchronise your machine's IP address with a dynamic DNS provider using inadyn
|
||||
'');
|
||||
'';
|
||||
user = lib.mkOption {
|
||||
default = "inadyn";
|
||||
type = lib.types.str;
|
||||
|
||||
@@ -56,7 +56,7 @@ in
|
||||
}
|
||||
'';
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule ({
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
server = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
@@ -85,7 +85,7 @@ in
|
||||
description = "Path to a file containing the password.";
|
||||
};
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ in
|
||||
};
|
||||
|
||||
config = mkIf (!config.networking.nftables.enable) (mkMerge [
|
||||
({ networking.firewall.extraCommands = mkBefore flushNat; })
|
||||
{ networking.firewall.extraCommands = mkBefore flushNat; }
|
||||
(mkIf config.networking.nat.enable {
|
||||
|
||||
networking.firewall = mkIf config.networking.firewall.enable {
|
||||
|
||||
@@ -347,7 +347,7 @@ in
|
||||
];
|
||||
|
||||
unitConfig.RequiresMountsFor = lib.concatStringsSep " " (
|
||||
[ "${cfg.cache.dataPath}" ] ++ lib.optional (isSqlite) dbDir
|
||||
[ "${cfg.cache.dataPath}" ] ++ lib.optional isSqlite dbDir
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -160,7 +160,7 @@ in
|
||||
|
||||
###### implementation
|
||||
|
||||
config = lib.mkIf (lib.length (enabledNylons) > 0) {
|
||||
config = lib.mkIf (lib.length enabledNylons > 0) {
|
||||
|
||||
users.users.nylon = {
|
||||
group = "nylon";
|
||||
|
||||
@@ -186,7 +186,7 @@ in
|
||||
};
|
||||
|
||||
queryLogDeleter = {
|
||||
enable = mkEnableOption ("Pi-hole FTL DNS query log deleter");
|
||||
enable = mkEnableOption "Pi-hole FTL DNS query log deleter";
|
||||
|
||||
age = mkOption {
|
||||
type = types.int;
|
||||
|
||||
@@ -21,7 +21,7 @@ in
|
||||
|
||||
config = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.submodule ({
|
||||
types.submodule {
|
||||
options = {
|
||||
encrypt = mkOption {
|
||||
type = types.bool;
|
||||
@@ -138,7 +138,7 @@ in
|
||||
description = "Disable target address re-resolution.";
|
||||
};
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
|
||||
default = { };
|
||||
|
||||
@@ -45,13 +45,13 @@ rec {
|
||||
paramsToRenderedStrings =
|
||||
cfg: ps:
|
||||
filterEmptySets (
|
||||
(mapParamsRecursive (
|
||||
mapParamsRecursive (
|
||||
path: name: param:
|
||||
let
|
||||
value = attrByPath path null cfg;
|
||||
in
|
||||
optionalAttrs (value != null) (param.render name value)
|
||||
) ps)
|
||||
) ps
|
||||
);
|
||||
|
||||
filterEmptySets =
|
||||
|
||||
@@ -376,11 +376,11 @@ in
|
||||
network: data:
|
||||
flip mapAttrs' data.hosts (
|
||||
host: text:
|
||||
nameValuePair ("tinc/${network}/hosts/${host}") ({
|
||||
nameValuePair "tinc/${network}/hosts/${host}" {
|
||||
mode = "0644";
|
||||
user = "tinc-${network}";
|
||||
inherit text;
|
||||
})
|
||||
}
|
||||
)
|
||||
// {
|
||||
"tinc/${network}/tinc.conf" = {
|
||||
@@ -399,7 +399,7 @@ in
|
||||
|
||||
systemd.services = flip mapAttrs' cfg.networks (
|
||||
network: data:
|
||||
nameValuePair ("tinc.${network}") (
|
||||
nameValuePair "tinc.${network}" (
|
||||
let
|
||||
version = getVersion data.package;
|
||||
in
|
||||
@@ -481,11 +481,11 @@ in
|
||||
|
||||
users.users = flip mapAttrs' cfg.networks (
|
||||
network: _:
|
||||
nameValuePair ("tinc-${network}") ({
|
||||
nameValuePair "tinc-${network}" {
|
||||
description = "Tinc daemon user for ${network}";
|
||||
isSystemUser = true;
|
||||
group = "tinc-${network}";
|
||||
})
|
||||
}
|
||||
);
|
||||
users.groups = flip mapAttrs' cfg.networks (network: _: nameValuePair "tinc-${network}" { });
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ in
|
||||
|
||||
type =
|
||||
with types;
|
||||
listOf (submodule ({
|
||||
listOf (submodule {
|
||||
|
||||
options = {
|
||||
|
||||
@@ -130,7 +130,7 @@ in
|
||||
|
||||
};
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ in
|
||||
TimeoutStartSec = "infinity";
|
||||
DynamicUser = usingDefaultUserAndGroup && usingDefaultDataDir;
|
||||
}
|
||||
// (lib.optionalAttrs (usingDefaultDataDir) {
|
||||
// (lib.optionalAttrs usingDefaultDataDir {
|
||||
StateDirectory = "opensearch";
|
||||
StateDirectoryMode = "0700";
|
||||
});
|
||||
|
||||
@@ -182,7 +182,7 @@ in
|
||||
"@chown"
|
||||
];
|
||||
}
|
||||
// (lib.optionalAttrs (usingDefaultDataDir) {
|
||||
// (lib.optionalAttrs usingDefaultDataDir {
|
||||
StateDirectory = "quickwit";
|
||||
StateDirectoryMode = "0700";
|
||||
});
|
||||
|
||||
@@ -42,10 +42,10 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
({
|
||||
{
|
||||
systemd.packages = [ cfg.package ];
|
||||
systemd.services."esdm-server".wantedBy = [ "basic.target" ];
|
||||
})
|
||||
}
|
||||
# It is necessary to set those options for these services to be started by systemd in NixOS
|
||||
(lib.mkIf cfg.enableLinuxCompatServices {
|
||||
systemd.targets."esdm-linux-compat".wantedBy = [ "basic.target" ];
|
||||
|
||||
@@ -295,7 +295,7 @@ in
|
||||
services.nginx.virtualHosts."${cfg.domain}" = mkIf (cfg.nginx != null) (
|
||||
lib.mkMerge [
|
||||
cfg.nginx
|
||||
({
|
||||
{
|
||||
root = lib.mkForce "${package}/htdocs";
|
||||
locations."/".index = "index.php";
|
||||
locations."~ [^/]\\.php(/|$)" = {
|
||||
@@ -304,7 +304,7 @@ in
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools.dolibarr.socket};
|
||||
'';
|
||||
};
|
||||
})
|
||||
}
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
@@ -131,10 +131,11 @@ let
|
||||
|
||||
envFile = pkgs.writeText "mastodon.env" (
|
||||
lib.concatMapStrings (s: s + "\n") (
|
||||
(lib.concatLists (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (name: value: lib.optional (value != null) ''${name}="${toString value}"'') env
|
||||
))
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
mastodonTootctl =
|
||||
|
||||
@@ -283,7 +283,7 @@ let
|
||||
'apps_paths' => [
|
||||
${lib.concatStrings (lib.mapAttrsToList mkAppStoreConfig appStores)}
|
||||
],
|
||||
${lib.optionalString (showAppStoreSetting) "'appstoreenabled' => ${renderedAppStoreSetting},"}
|
||||
${lib.optionalString showAppStoreSetting "'appstoreenabled' => ${renderedAppStoreSetting},"}
|
||||
${lib.optionalString cfg.caching.apcu "'memcache.local' => '\\OC\\Memcache\\APCu',"}
|
||||
${lib.optionalString (c.dbname != null) "'dbname' => '${c.dbname}',"}
|
||||
${lib.optionalString (c.dbhost != null) "'dbhost' => '${c.dbhost}',"}
|
||||
|
||||
@@ -19,10 +19,11 @@ let
|
||||
|
||||
envFile = pkgs.writeText "nifi.env" (
|
||||
lib.concatMapStrings (s: s + "\n") (
|
||||
(lib.concatLists (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (name: value: lib.optional (value != null) ''${name}="${toString value}"'') env
|
||||
))
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
nifiEnv = pkgs.writeShellScriptBin "nifi-env" ''
|
||||
|
||||
@@ -106,10 +106,10 @@ in
|
||||
|
||||
# Disable debug, only needed for development
|
||||
services.oncall.settings = lib.mkMerge [
|
||||
({
|
||||
{
|
||||
debug = lib.mkDefault false;
|
||||
auth.debug = lib.mkDefault false;
|
||||
})
|
||||
}
|
||||
];
|
||||
|
||||
services.uwsgi = {
|
||||
|
||||
@@ -70,10 +70,11 @@ let
|
||||
|
||||
envFile = pkgs.writeText "peertube.env" (
|
||||
lib.concatMapStrings (s: s + "\n") (
|
||||
(lib.concatLists (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (name: value: lib.optional (value != null) ''${name}="${toString value}"'') env
|
||||
))
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
peertubeEnv = pkgs.writeShellScriptBin "peertube-env" ''
|
||||
|
||||
@@ -243,7 +243,7 @@ in
|
||||
|
||||
services.redis.servers.pixelfed.enable = lib.mkIf cfg.redis.createLocally true;
|
||||
services.pixelfed.settings = mkMerge [
|
||||
({
|
||||
{
|
||||
APP_ENV = mkDefault "production";
|
||||
APP_DEBUG = mkDefault false;
|
||||
# https://github.com/pixelfed/pixelfed/blob/dev/app/Console/Commands/Installer.php#L312-L316
|
||||
@@ -270,7 +270,7 @@ in
|
||||
LOG_CHANNEL = mkDefault "stderr";
|
||||
# TODO: find out the correct syntax?
|
||||
# TRUST_PROXIES = mkDefault "127.0.0.1/8, ::1/128";
|
||||
})
|
||||
}
|
||||
(mkIf (cfg.redis.createLocally) {
|
||||
BROADCAST_DRIVER = mkDefault "redis";
|
||||
CACHE_DRIVER = mkDefault "redis";
|
||||
|
||||
@@ -358,7 +358,7 @@ in
|
||||
};
|
||||
|
||||
serviceConfig = mkMerge [
|
||||
({
|
||||
{
|
||||
Type = "simple";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
@@ -397,7 +397,7 @@ in
|
||||
"~@privileged"
|
||||
];
|
||||
UMask = "0077";
|
||||
})
|
||||
}
|
||||
(mkIf hasPrivilegedPorts {
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
})
|
||||
|
||||
@@ -37,7 +37,7 @@ in
|
||||
listen = mkOption {
|
||||
type =
|
||||
with types;
|
||||
listOf (submodule ({
|
||||
listOf (submodule {
|
||||
options = {
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
@@ -54,7 +54,7 @@ in
|
||||
description = "Whether to enable SSL (https) support.";
|
||||
};
|
||||
};
|
||||
}));
|
||||
});
|
||||
default = [ ];
|
||||
example = [
|
||||
{
|
||||
|
||||
@@ -11,11 +11,11 @@ let
|
||||
with lib;
|
||||
pkgs.writeText "hitch.conf" (
|
||||
concatStringsSep "\n" [
|
||||
("backend = \"${cfg.backend}\"")
|
||||
"backend = \"${cfg.backend}\""
|
||||
(concatMapStrings (s: "frontend = \"${s}\"\n") cfg.frontend)
|
||||
(concatMapStrings (s: "pem-file = \"${s}\"\n") cfg.pem-files)
|
||||
("ciphers = \"${cfg.ciphers}\"")
|
||||
("ocsp-dir = \"${ocspDir}\"")
|
||||
"ciphers = \"${cfg.ciphers}\""
|
||||
"ocsp-dir = \"${ocspDir}\""
|
||||
"user = \"${cfg.user}\""
|
||||
"group = \"${cfg.group}\""
|
||||
cfg.extraConfig
|
||||
|
||||
@@ -66,7 +66,7 @@ in
|
||||
cfgFile =
|
||||
if cfg.configFile != null then cfg.configFile else (format.generate "pomerium.yaml" cfg.settings);
|
||||
in
|
||||
mkIf cfg.enable ({
|
||||
mkIf cfg.enable {
|
||||
systemd.services.pomerium = {
|
||||
description = "Pomerium authenticating reverse proxy";
|
||||
wants = [
|
||||
@@ -148,5 +148,5 @@ in
|
||||
ExecStart = "/run/current-system/systemd/bin/systemctl --no-block restart pomerium.service";
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ in
|
||||
|
||||
options = {
|
||||
services.ttyd = {
|
||||
enable = lib.mkEnableOption ("ttyd daemon");
|
||||
enable = lib.mkEnableOption "ttyd daemon";
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
|
||||
@@ -770,7 +770,7 @@ in
|
||||
|| config.services.displayManager.lemurs.enable
|
||||
);
|
||||
in
|
||||
mkIf (default) (mkDefault true);
|
||||
mkIf default (mkDefault true);
|
||||
|
||||
services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ let
|
||||
# Ensure a consistent umask.
|
||||
umask 0022
|
||||
|
||||
${textClosureMap id (withDrySnippets) (attrNames withDrySnippets)}
|
||||
${textClosureMap id withDrySnippets (attrNames withDrySnippets)}
|
||||
|
||||
''
|
||||
+ optionalString (!onlyDry) ''
|
||||
@@ -220,7 +220,7 @@ in
|
||||
set' = mapAttrs (n: v: if isString v then noDepEntry v else v) set;
|
||||
withHeadlines = addAttributeName set';
|
||||
in
|
||||
textClosureMap id (withHeadlines) (attrNames withHeadlines)
|
||||
textClosureMap id withHeadlines (attrNames withHeadlines)
|
||||
}
|
||||
|
||||
exit $_status
|
||||
|
||||
@@ -403,14 +403,14 @@ in
|
||||
);
|
||||
|
||||
systemd = lib.mkMerge [
|
||||
({
|
||||
{
|
||||
tmpfiles.rules = [
|
||||
"d /run/binfmt 0755 -"
|
||||
]
|
||||
++ lib.mapAttrsToList (name: interpreter: "L+ /run/binfmt/${name} - - - - ${interpreter}") (
|
||||
lib.mapAttrs mkInterpreter config.boot.binfmt.registrations
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
(lib.mkIf (config.boot.binfmt.registrations != { }) {
|
||||
additionalUpstreamSystemUnits = [
|
||||
|
||||
@@ -28,12 +28,12 @@ in
|
||||
description = "Encrypted devices that need to be unlocked at boot using Clevis";
|
||||
default = { };
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule ({
|
||||
lib.types.submodule {
|
||||
options.secretFile = lib.mkOption {
|
||||
description = "Clevis JWE file used to decrypt the device at boot, in concert with the chosen pin (one of TPM2, Tang server, or SSS).";
|
||||
type = lib.types.path;
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1249,7 +1249,7 @@ in
|
||||
devicesWithClevis = filterAttrs (device: _: (hasAttr device clevis.devices)) luks.devices;
|
||||
in
|
||||
mkIf (clevis.enable && systemd.enable) (
|
||||
(mapAttrs' (
|
||||
mapAttrs' (
|
||||
name: _:
|
||||
nameValuePair "cryptsetup-clevis-${name}" {
|
||||
wantedBy = [ "systemd-cryptsetup@${utils.escapeSystemdPath name}.service" ];
|
||||
@@ -1281,7 +1281,7 @@ in
|
||||
ExecStop = "${config.boot.initrd.systemd.package.util-linux}/bin/umount /clevis-${name}";
|
||||
};
|
||||
}
|
||||
) devicesWithClevis)
|
||||
) devicesWithClevis
|
||||
);
|
||||
|
||||
environment.systemPackages = [ pkgs.cryptsetup ];
|
||||
|
||||
@@ -746,14 +746,14 @@ let
|
||||
"both"
|
||||
"any"
|
||||
])
|
||||
(assertValueOneOf "ActivationPolicy" ([
|
||||
(assertValueOneOf "ActivationPolicy" [
|
||||
"up"
|
||||
"always-up"
|
||||
"manual"
|
||||
"always-down"
|
||||
"down"
|
||||
"bound"
|
||||
]))
|
||||
])
|
||||
];
|
||||
|
||||
sectionNetwork = checkUnitConfig "Network" [
|
||||
|
||||
@@ -595,7 +595,7 @@ in
|
||||
enabledUnits = filterAttrs (n: v: !elem n cfg.suppressedSystemUnits) cfg.units;
|
||||
|
||||
in
|
||||
({
|
||||
{
|
||||
"systemd/system".source = generateUnits {
|
||||
type = "system";
|
||||
units = enabledUnits;
|
||||
@@ -631,7 +631,7 @@ in
|
||||
"systemd/user-preset/00-nixos.preset".text = ''
|
||||
ignore *
|
||||
'';
|
||||
});
|
||||
};
|
||||
|
||||
services.dbus.enable = true;
|
||||
|
||||
|
||||
@@ -183,9 +183,9 @@ in
|
||||
};
|
||||
|
||||
environment.etc = lib.mkMerge [
|
||||
({
|
||||
{
|
||||
"sysusers.d".source = sysusersConfig;
|
||||
})
|
||||
}
|
||||
|
||||
# Statically create the symlinks to immutablePasswordFilesLocation when
|
||||
# using an immutable /etc because we will not be able to do it at
|
||||
|
||||
@@ -235,7 +235,7 @@ let
|
||||
tries=3
|
||||
success=false
|
||||
while [[ $success != true ]] && [[ $tries -gt 0 ]]; do
|
||||
${systemd}/bin/systemd-ask-password ${lib.optionalString cfgZfs.useKeyringForCredentials ("--keyname=zfs-$ds")} --timeout=${toString cfgZfs.passwordTimeout} "Enter key for $ds:" | ${cfgZfs.package}/sbin/zfs load-key "$ds" \
|
||||
${systemd}/bin/systemd-ask-password ${lib.optionalString cfgZfs.useKeyringForCredentials "--keyname=zfs-$ds"} --timeout=${toString cfgZfs.passwordTimeout} "Enter key for $ds:" | ${cfgZfs.package}/sbin/zfs load-key "$ds" \
|
||||
&& success=true \
|
||||
|| tries=$((tries - 1))
|
||||
done
|
||||
|
||||
@@ -49,10 +49,10 @@ in
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
({
|
||||
{
|
||||
# minimal configuration file to make lvmconfig/lvm2-activation-generator happy
|
||||
environment.etc."lvm/lvm.conf".text = "config {}";
|
||||
})
|
||||
}
|
||||
(mkIf cfg.enable {
|
||||
systemd.tmpfiles.packages = [ cfg.package.out ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
@@ -476,10 +476,10 @@ let
|
||||
)
|
||||
)
|
||||
|
||||
({
|
||||
{
|
||||
options.warnings = options.warnings;
|
||||
options.assertions = options.assertions;
|
||||
})
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user