treewide: apply nixfmt 1.2.0

This commit is contained in:
Dyego Aurélio 2026-01-22 18:37:56 -03:00
parent cd60f55468
commit 28096cc5e3
198 changed files with 351 additions and 351 deletions

View file

@ -10,7 +10,7 @@ The hook runs in `installCheckPhase`, requiring `doInstallCheck` is enabled for
lib, lib,
stdenv, stdenv,
udevCheckHook, udevCheckHook,
# ... # ...
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {

View file

@ -9,7 +9,7 @@ You use it like this:
lib, lib,
stdenv, stdenv,
versionCheckHook, versionCheckHook,
# ... # ...
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {

View file

@ -112,7 +112,7 @@ For example, to propagate a dependency on SDL2 for lockfiles that select the Nim
lib, lib,
# … # …
SDL2, SDL2,
# … # …
}: }:
{ {

View file

@ -191,7 +191,7 @@ in
if isStringLike path then if isStringLike path then
throw ''lib.fileset.maybeMissing: Argument ("${toString path}") is a string-like value, but it should be a path instead.'' throw ''lib.fileset.maybeMissing: Argument ("${toString path}") is a string-like value, but it should be a path instead.''
else else
throw ''lib.fileset.maybeMissing: Argument is of type ${typeOf path}, but it should be a path instead.'' throw "lib.fileset.maybeMissing: Argument is of type ${typeOf path}, but it should be a path instead."
else if !pathExists path then else if !pathExists path then
_emptyWithoutBase _emptyWithoutBase
else else
@ -443,7 +443,7 @@ in
lib.fileset.toSource: `root` (${toString root}) is a string-like value, but it should be a path instead. lib.fileset.toSource: `root` (${toString root}) is a string-like value, but it should be a path instead.
Paths in strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.'' Paths in strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.''
else else
throw ''lib.fileset.toSource: `root` is of type ${typeOf root}, but it should be a path instead.'' throw "lib.fileset.toSource: `root` is of type ${typeOf root}, but it should be a path instead."
# Currently all Nix paths have the same filesystem root, but this could change in the future. # Currently all Nix paths have the same filesystem root, but this could change in the future.
# See also ../path/README.md # See also ../path/README.md
else if !fileset._internalIsEmptyWithoutBase && rootFilesystemRoot != filesetFilesystemRoot then else if !fileset._internalIsEmptyWithoutBase && rootFilesystemRoot != filesetFilesystemRoot then
@ -453,7 +453,7 @@ in
`fileset`: Filesystem root is "${toString filesetFilesystemRoot}" `fileset`: Filesystem root is "${toString filesetFilesystemRoot}"
Different filesystem roots are not supported.'' Different filesystem roots are not supported.''
else if !pathExists root then else if !pathExists root then
throw ''lib.fileset.toSource: `root` (${toString root}) is a path that does not exist.'' throw "lib.fileset.toSource: `root` (${toString root}) is a path that does not exist."
else if pathType root != "directory" then else if pathType root != "directory" then
throw '' throw ''
lib.fileset.toSource: `root` (${toString root}) is a file, but it should be a directory instead. Potential solutions: lib.fileset.toSource: `root` (${toString root}) is a file, but it should be a directory instead. Potential solutions:
@ -619,7 +619,7 @@ in
unions = unions =
filesets: filesets:
if !isList filesets then if !isList filesets then
throw ''lib.fileset.unions: Argument is of type ${typeOf filesets}, but it should be a list instead.'' throw "lib.fileset.unions: Argument is of type ${typeOf filesets}, but it should be a list instead."
else else
pipe filesets [ pipe filesets [
# Annotate the elements with context, used by _coerceMany for better errors # Annotate the elements with context, used by _coerceMany for better errors
@ -808,16 +808,16 @@ in
fileFilter = fileFilter =
predicate: path: predicate: path:
if !isFunction predicate then if !isFunction predicate then
throw ''lib.fileset.fileFilter: First argument is of type ${typeOf predicate}, but it should be a function instead.'' throw "lib.fileset.fileFilter: First argument is of type ${typeOf predicate}, but it should be a function instead."
else if !isPath path then else if !isPath path then
if path._type or "" == "fileset" then if path._type or "" == "fileset" then
throw '' throw ''
lib.fileset.fileFilter: Second argument is a file set, but it should be a path instead. lib.fileset.fileFilter: Second argument is a file set, but it should be a path instead.
If you need to filter files in a file set, use `intersection fileset (fileFilter pred ./.)` instead.'' If you need to filter files in a file set, use `intersection fileset (fileFilter pred ./.)` instead.''
else else
throw ''lib.fileset.fileFilter: Second argument is of type ${typeOf path}, but it should be a path instead.'' throw "lib.fileset.fileFilter: Second argument is of type ${typeOf path}, but it should be a path instead."
else if !pathExists path then else if !pathExists path then
throw ''lib.fileset.fileFilter: Second argument (${toString path}) is a path that does not exist.'' throw "lib.fileset.fileFilter: Second argument (${toString path}) is a path that does not exist."
else else
_fileFilter predicate path; _fileFilter predicate path;
@ -896,9 +896,9 @@ in
lib.fileset.fromSource: The source origin of the argument is a string-like value ("${toString path}"), but it should be a path instead. lib.fileset.fromSource: The source origin of the argument is a string-like value ("${toString path}"), but it should be a path instead.
Sources created from paths in strings cannot be turned into file sets, use `lib.sources` or derivations instead.'' Sources created from paths in strings cannot be turned into file sets, use `lib.sources` or derivations instead.''
else else
throw ''lib.fileset.fromSource: The source origin of the argument is of type ${typeOf path}, but it should be a path instead.'' throw "lib.fileset.fromSource: The source origin of the argument is of type ${typeOf path}, but it should be a path instead."
else if !pathExists path then else if !pathExists path then
throw ''lib.fileset.fromSource: The source origin (${toString path}) of the argument is a path that does not exist.'' throw "lib.fileset.fromSource: The source origin (${toString path}) of the argument is a path that does not exist."
else if isFiltered then else if isFiltered then
_fromSourceFilter path source.filter _fromSourceFilter path source.filter
else else

View file

@ -211,7 +211,7 @@ rec {
${context} ("${toString value}") is a string-like value, but it should be a file set or a path instead. ${context} ("${toString value}") is a string-like value, but it should be a file set or a path instead.
Paths represented as strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.'' Paths represented as strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.''
else else
error ''${context} is of type ${typeOf value}, but it should be a file set or a path instead.'' error "${context} is of type ${typeOf value}, but it should be a file set or a path instead."
else if !pathExists value then else if !pathExists value then
error '' error ''
${context} (${toString value}) is a path that does not exist. ${context} (${toString value}) is a path that does not exist.

View file

@ -239,7 +239,7 @@ in
# The subpath string to append # The subpath string to append
subpath: subpath:
assert assertMsg (isPath path) assert assertMsg (isPath path)
''lib.path.append: The first argument is of type ${builtins.typeOf path}, but a path was expected''; "lib.path.append: The first argument is of type ${builtins.typeOf path}, but a path was expected";
assert assertMsg (isValid subpath) '' assert assertMsg (isValid subpath) ''
lib.path.append: Second argument is not a valid subpath string: lib.path.append: Second argument is not a valid subpath string:
${subpathInvalidReason subpath}''; ${subpathInvalidReason subpath}'';

View file

@ -331,7 +331,7 @@ in
testAttrs = { testAttrs = {
expectedError = { expectedError = {
type = "ThrownError"; type = "ThrownError";
msg = ''A definition for option `foo' is not of type `string or signed integer convertible to it.*''; msg = "A definition for option `foo' is not of type `string or signed integer convertible to it.*";
}; };
}; };
}; };

View file

@ -867,7 +867,7 @@ runTests {
testEscapeNixIdentifierNoQuote = { testEscapeNixIdentifierNoQuote = {
expr = strings.escapeNixIdentifier "foo"; expr = strings.escapeNixIdentifier "foo";
expected = ''foo''; expected = "foo";
}; };
testEscapeNixIdentifierNumber = { testEscapeNixIdentifierNumber = {
@ -2634,7 +2634,7 @@ runTests {
sections = { sections = {
}; };
}; };
expected = ''''; expected = "";
}; };
testToINIWithGlobalSectionGlobalEmptyIsTheSameAsToINI = testToINIWithGlobalSectionGlobalEmptyIsTheSameAsToINI =
@ -3002,12 +3002,12 @@ runTests {
testToLuaEmptyAttrSet = { testToLuaEmptyAttrSet = {
expr = generators.toLua { } { }; expr = generators.toLua { } { };
expected = ''{}''; expected = "{}";
}; };
testToLuaEmptyList = { testToLuaEmptyList = {
expr = generators.toLua { } [ ]; expr = generators.toLua { } [ ];
expected = ''{}''; expected = "{}";
}; };
testToLuaListOfVariousTypes = { testToLuaListOfVariousTypes = {
@ -3052,7 +3052,7 @@ runTests {
41 41
43 43
]; ];
expected = ''{ 41, 43 }''; expected = "{ 41, 43 }";
}; };
testToLuaEmptyBindings = { testToLuaEmptyBindings = {

View file

@ -1412,7 +1412,7 @@ rec {
else if builtins.isBool v then else if builtins.isBool v then
boolToString v boolToString v
else else
''<${builtins.typeOf v}>''; "<${builtins.typeOf v}>";
in in
mkOptionType rec { mkOptionType rec {
name = "enum"; name = "enum";

View file

@ -46,7 +46,7 @@ in
maintainers = mkOption { maintainers = mkOption {
type = listOfMaintainers; type = listOfMaintainers;
default = [ ]; default = [ ];
example = lib.literalExpression ''[ lib.maintainers.alice lib.maintainers.bob ]''; example = lib.literalExpression "[ lib.maintainers.alice lib.maintainers.bob ]";
description = '' description = ''
List of maintainers of each module. List of maintainers of each module.
This option should be defined at most once per module. This option should be defined at most once per module.

View file

@ -82,7 +82,7 @@ Example:
{ {
stdenv, stdenv,
nixosTests, nixosTests,
# ... # ...
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "example"; pname = "example";

View file

@ -7,7 +7,7 @@ let
common = import ./common.nix; common = import ./common.nix;
inherit (common) outputPath indexPath; inherit (common) outputPath indexPath;
devmode = pkgs.devmode.override { devmode = pkgs.devmode.override {
buildArgs = ''${toString ../../release.nix} -A manualHTML.${builtins.currentSystem}''; buildArgs = "${toString ../../release.nix} -A manualHTML.${builtins.currentSystem}";
open = "/${outputPath}/${indexPath}"; open = "/${outputPath}/${indexPath}";
}; };
nixos-render-docs-redirects = pkgs.writeShellScriptBin "redirects" ''${pkgs.lib.getExe pkgs.nixos-render-docs-redirects} --file '${toString ./redirects.json}' "$@"''; nixos-render-docs-redirects = pkgs.writeShellScriptBin "redirects" ''${pkgs.lib.getExe pkgs.nixos-render-docs-redirects} --file '${toString ./redirects.json}' "$@"'';

View file

@ -347,7 +347,7 @@ let
--no-root-passwd \ --no-root-passwd \
--system ${config.system.build.toplevel} \ --system ${config.system.build.toplevel} \
--substituters "" \ --substituters "" \
${lib.optionalString includeChannel ''--channel ${channelSources}''} ${lib.optionalString includeChannel "--channel ${channelSources}"}
df -h df -h

View file

@ -330,7 +330,7 @@ let
--no-root-passwd \ --no-root-passwd \
--system ${config.system.build.toplevel} \ --system ${config.system.build.toplevel} \
--substituters "" \ --substituters "" \
${lib.optionalString includeChannel ''--channel ${channelSources}''} ${lib.optionalString includeChannel "--channel ${channelSources}"}
df -h df -h

View file

@ -164,7 +164,7 @@ in
''; '';
type = types.bool; type = types.bool;
default = config.node.pkgs != null; default = config.node.pkgs != null;
defaultText = literalExpression ''node.pkgs != null''; defaultText = literalExpression "node.pkgs != null";
}; };
node.specialArgs = mkOption { node.specialArgs = mkOption {

View file

@ -410,7 +410,7 @@ let
stringOrDefault (concatStringsSep " | " ( stringOrDefault (concatStringsSep " | " (
imap1 ( imap1 (
index: name: index: name:
''${name} = ($ENV.secret${toString index}${optionalString (!secrets.${name}.quote) " | fromjson"})'' "${name} = ($ENV.secret${toString index}${optionalString (!secrets.${name}.quote) " | fromjson"})"
) (attrNames secrets) ) (attrNames secrets)
)) "." )) "."
) )

View file

@ -62,9 +62,9 @@ let
"*" # password unset "*" # password unset
]); ]);
overrideOrderMutable = ''{option}`initialHashedPassword` -> {option}`initialPassword` -> {option}`hashedPassword` -> {option}`password` -> {option}`hashedPasswordFile`''; overrideOrderMutable = "{option}`initialHashedPassword` -> {option}`initialPassword` -> {option}`hashedPassword` -> {option}`password` -> {option}`hashedPasswordFile`";
overrideOrderImmutable = ''{option}`initialHashedPassword` -> {option}`hashedPassword` -> {option}`initialPassword` -> {option}`password` -> {option}`hashedPasswordFile`''; overrideOrderImmutable = "{option}`initialHashedPassword` -> {option}`hashedPassword` -> {option}`initialPassword` -> {option}`password` -> {option}`hashedPasswordFile`";
overrideOrderText = isMutable: '' overrideOrderText = isMutable: ''
If the option {option}`users.mutableUsers` is If the option {option}`users.mutableUsers` is

View file

@ -37,7 +37,7 @@ in
options.xdg.portal = { options.xdg.portal = {
enable = enable =
mkEnableOption ''[xdg desktop integration](https://github.com/flatpak/xdg-desktop-portal)'' mkEnableOption "[xdg desktop integration](https://github.com/flatpak/xdg-desktop-portal)"
// { // {
default = false; default = false;
}; };

View file

@ -6,7 +6,7 @@
}: }:
{ {
options.hardware.inputmodule.enable = lib.mkEnableOption ''Support for Framework input modules''; options.hardware.inputmodule.enable = lib.mkEnableOption "Support for Framework input modules";
config = lib.mkIf config.hardware.inputmodule.enable { config = lib.mkIf config.hardware.inputmodule.enable {
environment.systemPackages = [ pkgs.inputmodule-control ]; environment.systemPackages = [ pkgs.inputmodule-control ];

View file

@ -228,7 +228,7 @@ in
cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001 cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001
else else
elaborated; elaborated;
defaultText = lib.literalExpression ''config.nixpkgs.hostPlatform''; defaultText = lib.literalExpression "config.nixpkgs.hostPlatform";
description = '' description = ''
Specifies the platform on which NixOS should be built. Specifies the platform on which NixOS should be built.
By default, NixOS is built on the system where it runs, but you can By default, NixOS is built on the system where it runs, but you can
@ -252,7 +252,7 @@ in
# Make sure that the final value has all fields for sake of other modules # Make sure that the final value has all fields for sake of other modules
# referring to this. TODO make `lib.systems` itself use the module system. # referring to this. TODO make `lib.systems` itself use the module system.
apply = lib.systems.elaborate; apply = lib.systems.elaborate;
defaultText = lib.literalExpression ''config.nixpkgs.system''; defaultText = lib.literalExpression "config.nixpkgs.system";
description = '' description = ''
Systems with a recently generated `hardware-configuration.nix` Systems with a recently generated `hardware-configuration.nix`
do not need to specify this option, unless cross-compiling, in which case do not need to specify this option, unless cross-compiling, in which case

View file

@ -24,7 +24,7 @@ in
nixpkgs = { nixpkgs = {
pkgs = mkOption { pkgs = mkOption {
type = lib.types.pkgs; type = lib.types.pkgs;
description = ''The pkgs module argument.''; description = "The pkgs module argument.";
}; };
config = mkOption { config = mkOption {
internal = true; internal = true;

View file

@ -28,7 +28,7 @@ let
escapeIfNecessary = s: if needsEscaping s then s else ''"${lib.escape [ "$" "\"" "\\" "`" ] s}"''; escapeIfNecessary = s: if needsEscaping s then s else ''"${lib.escape [ "$" "\"" "\\" "`" ] s}"'';
attrsToText = attrsToText =
attrs: attrs:
concatStringsSep "\n" (mapAttrsToList (n: v: ''${n}=${escapeIfNecessary (toString v)}'') attrs) concatStringsSep "\n" (mapAttrsToList (n: v: "${n}=${escapeIfNecessary (toString v)}") attrs)
+ "\n"; + "\n";
osReleaseContents = osReleaseContents =

View file

@ -27,15 +27,15 @@ let
chromium: chromium:
concatStringsSep " " [ concatStringsSep " " [
''env XDG_CONFIG_HOME="$PREV_CONFIG_HOME"'' ''env XDG_CONFIG_HOME="$PREV_CONFIG_HOME"''
''${chromium}/bin/chromium'' "${chromium}/bin/chromium"
''--user-data-dir=''${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive'' "--user-data-dir=\${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive"
''--proxy-server="socks5://$PROXY"'' ''--proxy-server="socks5://$PROXY"''
''--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost"'' ''--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost"''
''--no-first-run'' "--no-first-run"
''--new-window'' "--new-window"
''--incognito'' "--incognito"
''-no-default-browser-check'' "-no-default-browser-check"
''http://cache.nixos.org/'' "http://cache.nixos.org/"
]; ];
desktopItem = pkgs.makeDesktopItem { desktopItem = pkgs.makeDesktopItem {

View file

@ -22,7 +22,7 @@ in
{ {
meta.maintainers = [ lib.maintainers.mic92 ]; meta.maintainers = [ lib.maintainers.mic92 ];
options.programs.nix-ld = { options.programs.nix-ld = {
enable = lib.mkEnableOption ''nix-ld, Documentation: <https://github.com/nix-community/nix-ld>''; enable = lib.mkEnableOption "nix-ld, Documentation: <https://github.com/nix-community/nix-ld>";
package = lib.mkPackageOption pkgs "nix-ld" { }; package = lib.mkPackageOption pkgs "nix-ld" { };
libraries = lib.mkOption { libraries = lib.mkOption {
type = lib.types.listOf lib.types.package; type = lib.types.listOf lib.types.package;

View file

@ -154,7 +154,7 @@ in
'' ''
+ lib.concatMapStrings (p: "Include ${p}/etc/apparmor.d\n") cfg.packages; + lib.concatMapStrings (p: "Include ${p}/etc/apparmor.d\n") cfg.packages;
# For aa-logprof # For aa-logprof
environment.etc."apparmor/apparmor.conf".text = ''''; environment.etc."apparmor/apparmor.conf".text = "";
# For aa-logprof # For aa-logprof
environment.etc."apparmor/severity.db".source = pkgs.apparmor-utils + "/etc/apparmor/severity.db"; environment.etc."apparmor/severity.db".source = pkgs.apparmor-utils + "/etc/apparmor/severity.db";
environment.etc."apparmor/logprof.conf".source = environment.etc."apparmor/logprof.conf".source =

View file

@ -290,12 +290,12 @@ in
] ]
( (
_: _:
''${cfg.tctiEnvironment.interface}:${ "${cfg.tctiEnvironment.interface}:${
if cfg.tctiEnvironment.interface == "tabrmd" then if cfg.tctiEnvironment.interface == "tabrmd" then
cfg.tctiEnvironment.tabrmdConf cfg.tctiEnvironment.tabrmdConf
else else
cfg.tctiEnvironment.deviceConf cfg.tctiEnvironment.deviceConf
}'' }"
) )
); );
} }

View file

@ -411,7 +411,7 @@ in
lib.concatStringsSep "\n" ( lib.concatStringsSep "\n" (
lib.imap0 ( lib.imap0 (
i: c: i: c:
''${pkgs.replace-secret}/bin/replace-secret '{{password-${toString i}}}' '${c.passwordFile}' /run/mpd/mpd.conf'' "${pkgs.replace-secret}/bin/replace-secret '{{password-${toString i}}}' '${c.passwordFile}' /run/mpd/mpd.conf"
) cfg.credentials ) cfg.credentials
) )
); );

View file

@ -64,7 +64,7 @@ let
secretFile: placeholder: targetFile: secretFile: placeholder: targetFile:
lib.optionalString ( lib.optionalString (
secretFile != null secretFile != null
) ''${pkgs.replace-secret}/bin/replace-secret '${placeholder}' '${secretFile}' '${targetFile}' ''; ) "${pkgs.replace-secret}/bin/replace-secret '${placeholder}' '${secretFile}' '${targetFile}' ";
preStart = pkgs.writeShellScript "mpdscribble-pre-start" '' preStart = pkgs.writeShellScript "mpdscribble-pre-start" ''
cp -f "${cfgTemplate}" "${cfgFile}" cp -f "${cfgTemplate}" "${cfgFile}"

View file

@ -35,7 +35,7 @@ let
let let
a = cfg.tcp.anonymousClients.allowedIpRanges; a = cfg.tcp.anonymousClients.allowedIpRanges;
in in
lib.optional (a != [ ]) ''auth-ip-acl=${lib.concatStringsSep ";" a}''; lib.optional (a != [ ]) "auth-ip-acl=${lib.concatStringsSep ";" a}";
port = lib.optional (!(isNull cfg.tcp.port)) "port=${toString cfg.tcp.port}"; port = lib.optional (!(isNull cfg.tcp.port)) "port=${toString cfg.tcp.port}";
in in
pkgs.writeTextFile { pkgs.writeTextFile {

View file

@ -255,7 +255,7 @@ in
runCheck = lib.mkOption { runCheck = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = builtins.length config.services.restic.backups.${name}.checkOpts > 0; default = builtins.length config.services.restic.backups.${name}.checkOpts > 0;
defaultText = lib.literalExpression ''builtins.length config.services.backups.${name}.checkOpts > 0''; defaultText = lib.literalExpression "builtins.length config.services.backups.${name}.checkOpts > 0";
description = "Whether to run the `check` command with the provided `checkOpts` options."; description = "Whether to run the `check` command with the provided `checkOpts` options.";
example = true; example = true;
}; };

View file

@ -240,7 +240,7 @@ in
''; '';
}; };
recursive = lib.mkEnableOption ''the transfer of child datasets''; recursive = lib.mkEnableOption "the transfer of child datasets";
sshKey = lib.mkOption { sshKey = lib.mkOption {
type = with lib.types; nullOr (coercedTo path toString str); type = with lib.types; nullOr (coercedTo path toString str);

View file

@ -246,8 +246,8 @@ in
--datadir ${cfg.beacon.dataDir}/${cfg.network} \ --datadir ${cfg.beacon.dataDir}/${cfg.network} \
--execution-endpoint http://${cfg.beacon.execution.address}:${toString cfg.beacon.execution.port} \ --execution-endpoint http://${cfg.beacon.execution.address}:${toString cfg.beacon.execution.port} \
--execution-jwt ''${CREDENTIALS_DIRECTORY}/LIGHTHOUSE_JWT \ --execution-jwt ''${CREDENTIALS_DIRECTORY}/LIGHTHOUSE_JWT \
${lib.optionalString cfg.beacon.http.enable ''--http --http-address ${cfg.beacon.http.address} --http-port ${toString cfg.beacon.http.port}''} \ ${lib.optionalString cfg.beacon.http.enable "--http --http-address ${cfg.beacon.http.address} --http-port ${toString cfg.beacon.http.port}"} \
${lib.optionalString cfg.beacon.metrics.enable ''--metrics --metrics-address ${cfg.beacon.metrics.address} --metrics-port ${toString cfg.beacon.metrics.port}''} \ ${lib.optionalString cfg.beacon.metrics.enable "--metrics --metrics-address ${cfg.beacon.metrics.address} --metrics-port ${toString cfg.beacon.metrics.port}"} \
${cfg.extraArgs} ${cfg.beacon.extraArgs} ${cfg.extraArgs} ${cfg.beacon.extraArgs}
''; '';
serviceConfig = { serviceConfig = {
@ -292,7 +292,7 @@ in
--network ${cfg.network} \ --network ${cfg.network} \
--beacon-nodes ${lib.concatStringsSep "," cfg.validator.beaconNodes} \ --beacon-nodes ${lib.concatStringsSep "," cfg.validator.beaconNodes} \
--datadir ${cfg.validator.dataDir}/${cfg.network} \ --datadir ${cfg.validator.dataDir}/${cfg.network} \
${lib.optionalString cfg.validator.metrics.enable ''--metrics --metrics-address ${cfg.validator.metrics.address} --metrics-port ${toString cfg.validator.metrics.port}''} \ ${lib.optionalString cfg.validator.metrics.enable "--metrics --metrics-address ${cfg.validator.metrics.address} --metrics-port ${toString cfg.validator.metrics.port}"} \
${cfg.extraArgs} ${cfg.validator.extraArgs} ${cfg.extraArgs} ${cfg.validator.extraArgs}
''; '';

View file

@ -17,7 +17,7 @@ in
enable = lib.mkEnableOption "flannel networking"; enable = lib.mkEnableOption "flannel networking";
openFirewallPorts = lib.mkOption { openFirewallPorts = lib.mkOption {
description = ''Whether to open the Flannel UDP ports in the firewall on all interfaces.''; description = "Whether to open the Flannel UDP ports in the firewall on all interfaces.";
type = lib.types.bool; type = lib.types.bool;
default = true; default = true;
}; };

View file

@ -116,7 +116,7 @@ in
type = lib.types.path; type = lib.types.path;
description = "Optionally pass master.cfg path. Other options in this configuration will be ignored."; description = "Optionally pass master.cfg path. Other options in this configuration will be ignored.";
default = defaultMasterCfg; default = defaultMasterCfg;
defaultText = lib.literalMD ''generated configuration file''; defaultText = lib.literalMD "generated configuration file";
example = "/etc/nixos/buildbot/master.cfg"; example = "/etc/nixos/buildbot/master.cfg";
}; };

View file

@ -728,7 +728,7 @@ in
mapAttrsToList mapAttrsToList
( (
name: serviceConfig: name: serviceConfig:
''`services.gitlab-runner.services.${name}.protected` with runner authentication tokens has no effect and will be ignored. Please remove it from your configuration.'' "`services.gitlab-runner.services.${name}.protected` with runner authentication tokens has no effect and will be ignored. Please remove it from your configuration."
) )
( (
filterAttrs ( filterAttrs (
@ -740,7 +740,7 @@ in
mapAttrsToList mapAttrsToList
( (
name: serviceConfig: name: serviceConfig:
''`services.gitlab-runner.services.${name}.runUntagged` with runner authentication tokens has no effect and will be ignored. Please remove it from your configuration.'' "`services.gitlab-runner.services.${name}.runUntagged` with runner authentication tokens has no effect and will be ignored. Please remove it from your configuration."
) )
( (
filterAttrs ( filterAttrs (
@ -752,7 +752,7 @@ in
mapAttrsToList mapAttrsToList
( (
name: v: name: v:
''`services.gitlab-runner.services.${name}.maximumTimeout` with runner authentication tokens has no effect and will be ignored. Please remove it from your configuration.'' "`services.gitlab-runner.services.${name}.maximumTimeout` with runner authentication tokens has no effect and will be ignored. Please remove it from your configuration."
) )
( (
filterAttrs ( filterAttrs (
@ -764,7 +764,7 @@ in
mapAttrsToList mapAttrsToList
( (
name: v: name: v:
''`services.gitlab-runner.services.${name}.tagList` with runner authentication tokens has no effect and will be ignored. Please remove it from your configuration.'' "`services.gitlab-runner.services.${name}.tagList` with runner authentication tokens has no effect and will be ignored. Please remove it from your configuration."
) )
( (
filterAttrs ( filterAttrs (

View file

@ -191,7 +191,7 @@ in
// { // {
NIX_REMOTE = "daemon"; NIX_REMOTE = "daemon";
AGENT_WORK_DIR = cfg.workDir; AGENT_WORK_DIR = cfg.workDir;
AGENT_STARTUP_ARGS = ''${lib.concatStringsSep " " cfg.startupOptions}''; AGENT_STARTUP_ARGS = "${lib.concatStringsSep " " cfg.startupOptions}";
LOG_DIR = cfg.workDir; LOG_DIR = cfg.workDir;
LOG_FILE = "${cfg.workDir}/go-agent-start.log"; LOG_FILE = "${cfg.workDir}/go-agent-start.log";
} }

View file

@ -205,10 +205,10 @@ in
''; '';
environment = { environment = {
ERL_FLAGS = ''-couch_ini ${lib.concatStringsSep " " configFiles}''; ERL_FLAGS = "-couch_ini ${lib.concatStringsSep " " configFiles}";
# 5. the vm.args file # 5. the vm.args file
COUCHDB_ARGS_FILE = ''${cfg.argsFile}''; COUCHDB_ARGS_FILE = "${cfg.argsFile}";
HOME = ''${cfg.databaseDir}''; HOME = "${cfg.databaseDir}";
}; };
serviceConfig = { serviceConfig = {

View file

@ -312,7 +312,7 @@ in
settings = mkOption { settings = mkOption {
default = { }; default = { };
description = ''configuration options for influxdb2, see <https://docs.influxdata.com/influxdb/v2.0/reference/config-options> for details.''; description = "configuration options for influxdb2, see <https://docs.influxdata.com/influxdb/v2.0/reference/config-options> for details.";
type = format.type; type = format.type;
}; };

View file

@ -272,7 +272,7 @@ in
filterFile = lib.mkOption { filterFile = lib.mkOption {
type = lib.types.nullOr lib.types.path; type = lib.types.nullOr lib.types.path;
description = ''Filename for the include exclude filter.''; description = "Filename for the include exclude filter.";
default = null; default = null;
example = lib.literalExpression '' example = lib.literalExpression ''
pkgs.writeText "filterFile" ''' pkgs.writeText "filterFile" '''
@ -285,7 +285,7 @@ in
robotsFile = lib.mkOption { robotsFile = lib.mkOption {
type = lib.types.nullOr lib.types.path; type = lib.types.nullOr lib.types.path;
description = ''Provides /robots.txt for net crawlers.''; description = "Provides /robots.txt for net crawlers.";
default = null; default = null;
example = lib.literalExpression ''pkgs.writeText "robots.txt" "# my custom robots.txt ..."''; example = lib.literalExpression ''pkgs.writeText "robots.txt" "# my custom robots.txt ..."'';
}; };
@ -956,7 +956,7 @@ in
serviceConfig = { serviceConfig = {
Restart = "on-abnormal"; Restart = "on-abnormal";
Nice = 5; Nice = 5;
ExecStart = ''${cfg.package}/bin/athens -config_file=${configFile}''; ExecStart = "${cfg.package}/bin/athens -config_file=${configFile}";
KillMode = "mixed"; KillMode = "mixed";
KillSignal = "SIGINT"; KillSignal = "SIGINT";

View file

@ -47,7 +47,7 @@ in
{ {
options = { options = {
services.freeciv = { services.freeciv = {
enable = lib.mkEnableOption ''freeciv''; enable = lib.mkEnableOption "freeciv";
settings = lib.mkOption { settings = lib.mkOption {
description = '' description = ''
Parameters of freeciv-server. Parameters of freeciv-server.

View file

@ -17,9 +17,9 @@ let
command, command,
... ...
}: }:
''${ "${
lib.concatMapStringsSep "+" toString keys lib.concatMapStringsSep "+" toString keys
}:${lib.concatStringsSep "," events}:${lib.concatStringsSep "," attributes}:${command}'' }:${lib.concatStringsSep "," events}:${lib.concatStringsSep "," attributes}:${command}"
) cfg.bindings} ) cfg.bindings}
${cfg.extraConfig} ${cfg.extraConfig}
''; '';

View file

@ -23,7 +23,7 @@ in
''; '';
overdrive = { overdrive = {
enable = lib.mkEnableOption ''`amdgpu` overdrive mode for overclocking''; enable = lib.mkEnableOption "`amdgpu` overdrive mode for overclocking";
ppfeaturemask = lib.mkOption { ppfeaturemask = lib.mkOption {
type = lib.types.str; type = lib.types.str;
@ -39,7 +39,7 @@ in
}; };
}; };
opencl.enable = lib.mkEnableOption ''OpenCL support using ROCM runtime library''; opencl.enable = lib.mkEnableOption "OpenCL support using ROCM runtime library";
}; };
config = { config = {

View file

@ -65,10 +65,10 @@ in
{ {
imports = [ imports = [
(lib.mkRemovedOptionModule [ "services" "keyd" "ids" ] (lib.mkRemovedOptionModule [ "services" "keyd" "ids" ]
''Use keyboards.<filename>.ids instead. If you don't need a multi-file configuration, just add keyboards.default before the ids. See https://github.com/NixOS/nixpkgs/pull/243271.'' "Use keyboards.<filename>.ids instead. If you don't need a multi-file configuration, just add keyboards.default before the ids. See https://github.com/NixOS/nixpkgs/pull/243271."
) )
(lib.mkRemovedOptionModule [ "services" "keyd" "settings" ] (lib.mkRemovedOptionModule [ "services" "keyd" "settings" ]
''Use keyboards.<filename>.settings instead. If you don't need a multi-file configuration, just add keyboards.default before the settings. See https://github.com/NixOS/nixpkgs/pull/243271.'' "Use keyboards.<filename>.settings instead. If you don't need a multi-file configuration, just add keyboards.default before the settings. See https://github.com/NixOS/nixpkgs/pull/243271."
) )
]; ];

View file

@ -198,7 +198,7 @@
assertion = assertion =
((builtins.length config.hardware.nvidia-container-toolkit.csv-files) > 0) ((builtins.length config.hardware.nvidia-container-toolkit.csv-files) > 0)
-> config.hardware.nvidia-container-toolkit.discovery-mode == "csv"; -> config.hardware.nvidia-container-toolkit.discovery-mode == "csv";
message = ''When CSV files are provided, `config.hardware.nvidia-container-toolkit.discovery-mode` has to be set to `csv`.''; message = "When CSV files are provided, `config.hardware.nvidia-container-toolkit.discovery-mode` has to be set to `csv`.";
} }
]; ];

View file

@ -18,7 +18,7 @@ let
cmd, cmd,
... ...
}: }:
''${lib.concatMapStringsSep "+" (x: "KEY_" + x) keys} ${ "${lib.concatMapStringsSep "+" (x: "KEY_" + x) keys} ${
toString toString
{ {
press = 1; press = 1;
@ -26,7 +26,7 @@ let
release = 0; release = 0;
} }
.${event} .${event}
} ${cmd}'' } ${cmd}"
) cfg.bindings} ) cfg.bindings}
${cfg.extraConfig} ${cfg.extraConfig}
''; '';

View file

@ -134,7 +134,7 @@ let
ssl_cert = <${cfg.sslServerCert} ssl_cert = <${cfg.sslServerCert}
ssl_key = <${cfg.sslServerKey} ssl_key = <${cfg.sslServerKey}
${optionalString (cfg.sslCACert != null) ("ssl_ca = <" + cfg.sslCACert)} ${optionalString (cfg.sslCACert != null) ("ssl_ca = <" + cfg.sslCACert)}
${optionalString cfg.enableDHE ''ssl_dh = <${config.security.dhparams.params.dovecot2.path}''} ${optionalString cfg.enableDHE "ssl_dh = <${config.security.dhparams.params.dovecot2.path}"}
disable_plaintext_auth = yes disable_plaintext_auth = yes
'' ''
) )

View file

@ -176,7 +176,7 @@ in
hostname = lib.mkOption { hostname = lib.mkOption {
default = "localhost"; default = "localhost";
type = with lib.types; uniq str; type = with lib.types; uniq str;
example = ''example.com''; example = "example.com";
description = '' description = ''
Hostname to use. It should be FQDN. Hostname to use. It should be FQDN.
''; '';
@ -185,7 +185,7 @@ in
primaryDomain = lib.mkOption { primaryDomain = lib.mkOption {
default = "localhost"; default = "localhost";
type = with lib.types; uniq str; type = with lib.types; uniq str;
example = ''mail.example.com''; example = "mail.example.com";
description = '' description = ''
Primary MX domain to use. It should be FQDN. Primary MX domain to use. It should be FQDN.
''; '';

View file

@ -202,9 +202,9 @@ in
if cfg.socket ? path then if cfg.socket ? path then
"--unix=${cfg.socket.path} --socketmode=${cfg.socket.mode}" "--unix=${cfg.socket.path} --socketmode=${cfg.socket.mode}"
else else
''--inet=${ "--inet=${
optionalString (cfg.socket.addr != null) (cfg.socket.addr + ":") optionalString (cfg.socket.addr != null) (cfg.socket.addr + ":")
}${toString cfg.socket.port}''; }${toString cfg.socket.port}";
in in
{ {
description = "Postfix Greylisting Service"; description = "Postfix Greylisting Service";

View file

@ -223,7 +223,7 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
ExecStart = ''${pkgs.mjolnir}/bin/mjolnir --mjolnir-config ./config/default.yaml''; ExecStart = "${pkgs.mjolnir}/bin/mjolnir --mjolnir-config ./config/default.yaml";
ExecStartPre = [ generateConfig ]; ExecStartPre = [ generateConfig ];
WorkingDirectory = cfg.dataPath; WorkingDirectory = cfg.dataPath;
StateDirectory = "mjolnir"; StateDirectory = "mjolnir";

View file

@ -40,7 +40,7 @@ let
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
ExecStart = ''${pkgs.pantalaimon-headless}/bin/pantalaimon --config ${mkConfigFile name instanceConfig} --data-path ${instanceConfig.dataPath}''; ExecStart = "${pkgs.pantalaimon-headless}/bin/pantalaimon --config ${mkConfigFile name instanceConfig} --data-path ${instanceConfig.dataPath}";
Restart = "on-failure"; Restart = "on-failure";
DynamicUser = true; DynamicUser = true;
NoNewPrivileges = true; NoNewPrivileges = true;

View file

@ -37,9 +37,9 @@ in
args = synapseConfig.settings.database.args; args = synapseConfig.settings.database.args;
in in
if synapseConfig.enable then if synapseConfig.enable then
''postgresql://${args.user}${lib.optionalString (args ? password) (":" + args.password)}@${ "postgresql://${args.user}${lib.optionalString (args ? password) (":" + args.password)}@${
lib.escapeURL (if (args ? host) then args.host else "/run/postgresql") lib.escapeURL (if (args ? host) then args.host else "/run/postgresql")
}${lib.optionalString (args ? port) (":" + args.port)}/${args.database}'' }${lib.optionalString (args ? port) (":" + args.port)}/${args.database}"
else else
null; null;
defaultText = lib.literalExpression '' defaultText = lib.literalExpression ''

View file

@ -31,7 +31,7 @@ let
# export passwords in environment variables in plaintext. # export passwords in environment variables in plaintext.
${concatMapStringsSep "\n" ( ${concatMapStringsSep "\n" (
x: x:
''export SYNC_USER${toString x.i}=${escapeShellArg x.user.username}:${escapeShellArg x.user.password}'' "export SYNC_USER${toString x.i}=${escapeShellArg x.user.username}:${escapeShellArg x.user.password}"
) usersWithIndexesNoFile} ) usersWithIndexesNoFile}
exec ${lib.getExe cfg.package} exec ${lib.getExe cfg.package}
''; '';

View file

@ -166,15 +166,15 @@ in
imports = [ imports = [
(lib.mkRenamedOptionModule (lib.mkRenamedOptionModule
[ "services" "apache-kafka" "brokerId" ] [ "services" "apache-kafka" "brokerId" ]
[ "services" "apache-kafka" "settings" ''broker.id'' ] [ "services" "apache-kafka" "settings" "broker.id" ]
) )
(lib.mkRenamedOptionModule (lib.mkRenamedOptionModule
[ "services" "apache-kafka" "logDirs" ] [ "services" "apache-kafka" "logDirs" ]
[ "services" "apache-kafka" "settings" ''log.dirs'' ] [ "services" "apache-kafka" "settings" "log.dirs" ]
) )
(lib.mkRenamedOptionModule (lib.mkRenamedOptionModule
[ "services" "apache-kafka" "zookeeper" ] [ "services" "apache-kafka" "zookeeper" ]
[ "services" "apache-kafka" "settings" ''zookeeper.connect'' ] [ "services" "apache-kafka" "settings" "zookeeper.connect" ]
) )
(lib.mkRemovedOptionModule [ (lib.mkRemovedOptionModule [

View file

@ -136,7 +136,7 @@ in
''; '';
}; };
wakeup_cmd = mkOption { wakeup_cmd = mkOption {
default = ''sh -c 'echo 0 > /sys/class/rtc/rtc0/wakealarm && echo {timestamp:.0f} > /sys/class/rtc/rtc0/wakealarm' ''; default = "sh -c 'echo 0 > /sys/class/rtc/rtc0/wakealarm && echo {timestamp:.0f} > /sys/class/rtc/rtc0/wakealarm' ";
type = with types; str; type = with types; str;
description = '' description = ''
The command to execute for scheduling a wake up of the system. The given string is The command to execute for scheduling a wake up of the system. The given string is
@ -232,7 +232,7 @@ in
after = [ "network.target" ]; after = [ "network.target" ];
path = flatten (attrValues (filterAttrs (n: _: hasCheck n) dependenciesForChecks)); path = flatten (attrValues (filterAttrs (n: _: hasCheck n) dependenciesForChecks));
serviceConfig = { serviceConfig = {
ExecStart = ''${autosuspend}/bin/autosuspend -l ${autosuspend}/etc/autosuspend-logging.conf -c ${autosuspend-conf} daemon''; ExecStart = "${autosuspend}/bin/autosuspend -l ${autosuspend}/etc/autosuspend-logging.conf -c ${autosuspend-conf} daemon";
}; };
}; };
@ -242,7 +242,7 @@ in
wantedBy = [ "sleep.target" ]; wantedBy = [ "sleep.target" ];
after = [ "sleep.target" ]; after = [ "sleep.target" ];
serviceConfig = { serviceConfig = {
ExecStart = ''${autosuspend}/bin/autosuspend -l ${autosuspend}/etc/autosuspend-logging.conf -c ${autosuspend-conf} presuspend''; ExecStart = "${autosuspend}/bin/autosuspend -l ${autosuspend}/etc/autosuspend-logging.conf -c ${autosuspend-conf} presuspend";
}; };
}; };
}; };

View file

@ -11,7 +11,7 @@ let
in in
{ {
options.services.evdevremapkeys = { options.services.evdevremapkeys = {
enable = lib.mkEnableOption ''evdevremapkeys, a daemon to remap events on linux input devices''; enable = lib.mkEnableOption "evdevremapkeys, a daemon to remap events on linux input devices";
settings = lib.mkOption { settings = lib.mkOption {
type = format.type; type = format.type;

View file

@ -11,19 +11,19 @@ in
meta.maintainers = [ lib.maintainers.camillemndn ]; meta.maintainers = [ lib.maintainers.camillemndn ];
options.services.jellyseerr = { options.services.jellyseerr = {
enable = lib.mkEnableOption ''Jellyseerr, a requests manager for Jellyfin''; enable = lib.mkEnableOption "Jellyseerr, a requests manager for Jellyfin";
package = lib.mkPackageOption pkgs "jellyseerr" { }; package = lib.mkPackageOption pkgs "jellyseerr" { };
openFirewall = lib.mkOption { openFirewall = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;
description = ''Open port in the firewall for the Jellyseerr web interface.''; description = "Open port in the firewall for the Jellyseerr web interface.";
}; };
port = lib.mkOption { port = lib.mkOption {
type = lib.types.port; type = lib.types.port;
default = 5055; default = 5055;
description = ''The port which the Jellyseerr web UI should listen to.''; description = "The port which the Jellyseerr web UI should listen to.";
}; };
configDir = lib.mkOption { configDir = lib.mkOption {

View file

@ -79,7 +79,7 @@ in
assertions = [ assertions = [
{ {
assertion = cfg.automatic -> config.nix.enable; assertion = cfg.automatic -> config.nix.enable;
message = ''nix.gc.automatic requires nix.enable''; message = "nix.gc.automatic requires nix.enable";
} }
]; ];

View file

@ -58,7 +58,7 @@ in
assertions = [ assertions = [
{ {
assertion = cfg.automatic -> config.nix.enable; assertion = cfg.automatic -> config.nix.enable;
message = ''nix.optimise.automatic requires nix.enable''; message = "nix.optimise.automatic requires nix.enable";
} }
]; ];

View file

@ -109,9 +109,9 @@ in
description = "Synergy client"; description = "Synergy client";
wantedBy = lib.optional cfgC.autoStart "graphical-session.target"; wantedBy = lib.optional cfgC.autoStart "graphical-session.target";
path = [ pkgs.synergy ]; path = [ pkgs.synergy ];
serviceConfig.ExecStart = ''${pkgs.synergy}/bin/synergyc -f ${ serviceConfig.ExecStart = "${pkgs.synergy}/bin/synergyc -f ${
lib.optionalString (cfgC.screenName != "") "-n ${cfgC.screenName}" lib.optionalString (cfgC.screenName != "") "-n ${cfgC.screenName}"
} ${cfgC.serverAddress}''; } ${cfgC.serverAddress}";
serviceConfig.Restart = "on-failure"; serviceConfig.Restart = "on-failure";
}; };
}) })
@ -124,13 +124,13 @@ in
description = "Synergy server"; description = "Synergy server";
wantedBy = lib.optional cfgS.autoStart "graphical-session.target"; wantedBy = lib.optional cfgS.autoStart "graphical-session.target";
path = [ pkgs.synergy ]; path = [ pkgs.synergy ];
serviceConfig.ExecStart = ''${pkgs.synergy}/bin/synergys -c ${cfgS.configFile} -f${ serviceConfig.ExecStart = "${pkgs.synergy}/bin/synergys -c ${cfgS.configFile} -f${
lib.optionalString (cfgS.address != "") " -a ${cfgS.address}" lib.optionalString (cfgS.address != "") " -a ${cfgS.address}"
}${ }${
lib.optionalString (cfgS.screenName != "") " -n ${cfgS.screenName}" lib.optionalString (cfgS.screenName != "") " -n ${cfgS.screenName}"
}${lib.optionalString cfgS.tls.enable " --enable-crypto"}${ }${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"; serviceConfig.Restart = "on-failure";
}; };
}) })

View file

@ -93,7 +93,7 @@ in
options = { options = {
services.nagios = { services.nagios = {
enable = lib.mkEnableOption ''[Nagios](https://www.nagios.org/) to monitor your system or network''; enable = lib.mkEnableOption "[Nagios](https://www.nagios.org/) to monitor your system or network";
objectDefs = lib.mkOption { objectDefs = lib.mkOption {
description = '' description = ''

View file

@ -63,7 +63,7 @@ in
"${pkgs.prometheus-mysqld-exporter}/bin/mysqld_exporter" "${pkgs.prometheus-mysqld-exporter}/bin/mysqld_exporter"
"--web.listen-address=${cfg.listenAddress}:${toString cfg.port}" "--web.listen-address=${cfg.listenAddress}:${toString cfg.port}"
"--web.telemetry-path=${cfg.telemetryPath}" "--web.telemetry-path=${cfg.telemetryPath}"
(optionalString (cfg.configFile != null) ''--config.my-cnf=''${CREDENTIALS_DIRECTORY}/config'') (optionalString (cfg.configFile != null) "--config.my-cnf=\${CREDENTIALS_DIRECTORY}/config")
(escapeShellArgs cfg.extraFlags) (escapeShellArgs cfg.extraFlags)
]; ];
RestrictAddressFamilies = [ RestrictAddressFamilies = [

View file

@ -30,12 +30,12 @@ let
sedExpr = '':x /^>\(${localCellsRegex}\) / { n; :y /^>/! { n; by }; bx }; p''; sedExpr = '':x /^>\(${localCellsRegex}\) / { n; :y /^>/! { n; by }; bx }; p'';
globalCommand = globalCommand =
if cfg.cellServDB != { } then if cfg.cellServDB != { } then
''sed -n -e ${lib.escapeShellArg sedExpr} ${cfg.globalCellServDBFile}'' "sed -n -e ${lib.escapeShellArg sedExpr} ${cfg.globalCellServDBFile}"
else else
''cat ${cfg.globalCellServDBFile}''; "cat ${cfg.globalCellServDBFile}";
in in
pkgs.runCommand "CellServDB" { preferLocalBuild = true; } '' pkgs.runCommand "CellServDB" { preferLocalBuild = true; } ''
${lib.optionalString (cfg.globalCellServDBFile != null) ''${globalCommand} > $out''} ${lib.optionalString (cfg.globalCellServDBFile != null) "${globalCommand} > $out"}
cat ${clientServDB} >> $out cat ${clientServDB} >> $out
''; '';

View file

@ -395,7 +395,7 @@ in
}; };
environment = { environment = {
TUNNEL_ORIGIN_CERT = lib.mkIf (certFile != null) ''%d/cert.pem''; TUNNEL_ORIGIN_CERT = lib.mkIf (certFile != null) "%d/cert.pem";
TUNNEL_EDGE_IP_VERSION = tunnel.edgeIPVersion; TUNNEL_EDGE_IP_VERSION = tunnel.edgeIPVersion;
}; };
} }

View file

@ -110,12 +110,12 @@ let
concatLines ( concatLines (
forEach relevantSecrets ( forEach relevantSecrets (
secret: secret:
''export ${secret}=$(< ${ "export ${secret}=$(< ${
if cfg.settingsSecret.${secret} == null then if cfg.settingsSecret.${secret} == null then
"secrets/${secret}" "secrets/${secret}"
else else
"\"$CREDENTIALS_DIRECTORY/${secret}\"" "\"$CREDENTIALS_DIRECTORY/${secret}\""
})'' })"
) )
); );

View file

@ -31,7 +31,7 @@ in
type = lib.types.nullOr lib.types.str; type = lib.types.nullOr lib.types.str;
default = null; default = null;
example = "gns3"; example = "gns3";
description = ''Username used to access the GNS3 Server.''; description = "Username used to access the GNS3 Server.";
}; };
passwordFile = lib.mkOption { passwordFile = lib.mkOption {
@ -68,7 +68,7 @@ in
file = lib.mkOption { file = lib.mkOption {
type = lib.types.nullOr lib.types.path; type = lib.types.nullOr lib.types.path;
default = "/var/log/gns3/server.log"; default = "/var/log/gns3/server.log";
description = ''Path of the file GNS3 Server should log to.''; description = "Path of the file GNS3 Server should log to.";
}; };
debug = lib.mkEnableOption "debug logging"; debug = lib.mkEnableOption "debug logging";
@ -96,17 +96,17 @@ in
}; };
dynamips = { dynamips = {
enable = lib.mkEnableOption ''Dynamips support''; enable = lib.mkEnableOption "Dynamips support";
package = lib.mkPackageOption pkgs "dynamips" { }; package = lib.mkPackageOption pkgs "dynamips" { };
}; };
ubridge = { ubridge = {
enable = lib.mkEnableOption ''uBridge support''; enable = lib.mkEnableOption "uBridge support";
package = lib.mkPackageOption pkgs "ubridge" { }; package = lib.mkPackageOption pkgs "ubridge" { };
}; };
vpcs = { vpcs = {
enable = lib.mkEnableOption ''VPCS support''; enable = lib.mkEnableOption "VPCS support";
package = lib.mkPackageOption pkgs "vpcs" { }; package = lib.mkPackageOption pkgs "vpcs" { };
}; };
}; };

View file

@ -56,7 +56,7 @@ in
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.go-autoconfig}/bin/go-autoconfig -config ${configFile}"; ExecStart = "${pkgs.go-autoconfig}/bin/go-autoconfig -config ${configFile}";
Restart = "on-failure"; Restart = "on-failure";
WorkingDirectory = ''${pkgs.go-autoconfig}/''; WorkingDirectory = "${pkgs.go-autoconfig}/";
DynamicUser = true; DynamicUser = true;
}; };
}; };

View file

@ -1363,13 +1363,13 @@ in
# see https://github.com/openwrt/openwrt/blob/539cb5389d9514c99ec1f87bd4465f77c7ed9b93/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh#L158 # see https://github.com/openwrt/openwrt/blob/539cb5389d9514c99ec1f87bd4465f77c7ed9b93/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh#L158
{ {
assertion = length (filter (bss: bss == radio) (attrNames radioCfg.networks)) == 1; assertion = length (filter (bss: bss == radio) (attrNames radioCfg.networks)) == 1;
message = ''hostapd radio ${radio}: Exactly one network must be named like the radio, for reasons internal to hostapd.''; message = "hostapd radio ${radio}: Exactly one network must be named like the radio, for reasons internal to hostapd.";
} }
{ {
assertion = assertion =
(radioCfg.wifi4.enable && builtins.elem "HT40-" radioCfg.wifi4.capabilities) (radioCfg.wifi4.enable && builtins.elem "HT40-" radioCfg.wifi4.capabilities)
-> radioCfg.channel != 0; -> radioCfg.channel != 0;
message = ''hostapd radio ${radio}: using ACS (channel = 0) together with HT40- (wifi4.capabilities) is unsupported by hostapd''; message = "hostapd radio ${radio}: using ACS (channel = 0) together with HT40- (wifi4.capabilities) is unsupported by hostapd";
} }
] ]
# BSS warnings # BSS warnings
@ -1391,42 +1391,42 @@ in
} }
{ {
assertion = (length (attrNames radioCfg.networks) > 1) -> (bssCfg.bssid != null); assertion = (length (attrNames radioCfg.networks) > 1) -> (bssCfg.bssid != null);
message = ''hostapd radio ${radio} bss ${bss}: bssid must be specified manually (for now) since this radio uses multiple BSS.''; message = "hostapd radio ${radio} bss ${bss}: bssid must be specified manually (for now) since this radio uses multiple BSS.";
} }
{ {
assertion = countWpaPasswordDefinitions <= 1; assertion = countWpaPasswordDefinitions <= 1;
message = ''hostapd radio ${radio} bss ${bss}: must use at most one WPA password option (wpaPassword, wpaPasswordFile, wpaPskFile)''; message = "hostapd radio ${radio} bss ${bss}: must use at most one WPA password option (wpaPassword, wpaPasswordFile, wpaPskFile)";
} }
{ {
assertion = assertion =
auth.wpaPassword != null auth.wpaPassword != null
-> (stringLength auth.wpaPassword >= 8 && stringLength auth.wpaPassword <= 63); -> (stringLength auth.wpaPassword >= 8 && stringLength auth.wpaPassword <= 63);
message = ''hostapd radio ${radio} bss ${bss}: uses a wpaPassword of invalid length (must be in [8,63]).''; message = "hostapd radio ${radio} bss ${bss}: uses a wpaPassword of invalid length (must be in [8,63]).";
} }
{ {
assertion = auth.saePasswords == [ ] || auth.saePasswordsFile == null; assertion = auth.saePasswords == [ ] || auth.saePasswordsFile == null;
message = ''hostapd radio ${radio} bss ${bss}: must use only one SAE password option (saePasswords or saePasswordsFile)''; message = "hostapd radio ${radio} bss ${bss}: must use only one SAE password option (saePasswords or saePasswordsFile)";
} }
{ {
assertion = auth.mode == "wpa3-sae" -> (auth.saePasswords != [ ] || auth.saePasswordsFile != null); assertion = auth.mode == "wpa3-sae" -> (auth.saePasswords != [ ] || auth.saePasswordsFile != null);
message = ''hostapd radio ${radio} bss ${bss}: uses WPA3-SAE which requires defining a sae password option''; message = "hostapd radio ${radio} bss ${bss}: uses WPA3-SAE which requires defining a sae password option";
} }
{ {
assertion = assertion =
auth.mode == "wpa3-sae-transition" auth.mode == "wpa3-sae-transition"
-> (auth.saePasswords != [ ] || auth.saePasswordsFile != null) && countWpaPasswordDefinitions == 1; -> (auth.saePasswords != [ ] || auth.saePasswordsFile != null) && countWpaPasswordDefinitions == 1;
message = ''hostapd radio ${radio} bss ${bss}: uses WPA3-SAE in transition mode requires defining both a wpa password option and a sae password option''; message = "hostapd radio ${radio} bss ${bss}: uses WPA3-SAE in transition mode requires defining both a wpa password option and a sae password option";
} }
{ {
assertion = assertion =
(auth.mode == "wpa2-sha1" || auth.mode == "wpa2-sha256") -> countWpaPasswordDefinitions == 1; (auth.mode == "wpa2-sha1" || auth.mode == "wpa2-sha256") -> countWpaPasswordDefinitions == 1;
message = ''hostapd radio ${radio} bss ${bss}: uses WPA2-PSK which requires defining a wpa password option''; message = "hostapd radio ${radio} bss ${bss}: uses WPA2-PSK which requires defining a wpa password option";
} }
] ]
++ optionals (auth.saePasswords != [ ]) ( ++ optionals (auth.saePasswords != [ ]) (
imap1 (i: entry: { imap1 (i: entry: {
assertion = (entry.password == null) != (entry.passwordFile == null); assertion = (entry.password == null) != (entry.passwordFile == null);
message = ''hostapd radio ${radio} bss ${bss} saePassword entry ${i}: must set exactly one of `password` or `passwordFile`''; message = "hostapd radio ${radio} bss ${bss} saePassword entry ${i}: must set exactly one of `password` or `passwordFile`";
}) auth.saePasswords }) auth.saePasswords
) )
) radioCfg.networks ) radioCfg.networks

View file

@ -221,7 +221,7 @@ in
startAt = cfg.interval; startAt = cfg.interval;
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = ''${lib.getExe pkgs.inadyn} -f ${configFile} --cache-dir ''${CACHE_DIRECTORY} -1 --foreground -l ${cfg.logLevel}''; ExecStart = "${lib.getExe pkgs.inadyn} -f ${configFile} --cache-dir \${CACHE_DIRECTORY} -1 --foreground -l ${cfg.logLevel}";
LoadCredential = "config:${configFile}"; LoadCredential = "config:${configFile}";
CacheDirectory = "inadyn"; CacheDirectory = "inadyn";

View file

@ -301,7 +301,7 @@ in
ui.enable = mkOption { ui.enable = mkOption {
type = bool; type = bool;
default = nixosConfig.services.netbird.ui.enable; default = nixosConfig.services.netbird.ui.enable;
defaultText = literalExpression ''client.ui.enable''; defaultText = literalExpression "client.ui.enable";
description = '' description = ''
Controls presence of `netbird-ui` wrapper for this NetBird client. Controls presence of `netbird-ui` wrapper for this NetBird client.
''; '';

View file

@ -148,7 +148,7 @@ let
''; '';
maybeString = prefix: x: optionalString (x != null) ''${prefix} "${x}"''; maybeString = prefix: x: optionalString (x != null) ''${prefix} "${x}"'';
maybeToString = prefix: x: optionalString (x != null) ''${prefix} ${toString x}''; maybeToString = prefix: x: optionalString (x != null) "${prefix} ${toString x}";
forEach = pre: l: concatMapStrings (x: pre + x + "\n") l; forEach = pre: l: concatMapStrings (x: pre + x + "\n") l;
keyConfigFile = concatStrings ( keyConfigFile = concatStrings (

View file

@ -18,7 +18,7 @@ in
extraFlags = mkOption { extraFlags = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ ]; default = [ ];
description = ''Extra flags passed to the {command}`robustirc-bridge` command. See [RobustIRC Documentation](https://robustirc.net/docs/adminguide.html#_bridge) or {manpage}`robustirc-bridge(1)` for details.''; description = "Extra flags passed to the {command}`robustirc-bridge` command. See [RobustIRC Documentation](https://robustirc.net/docs/adminguide.html#_bridge) or {manpage}`robustirc-bridge(1)` for details.";
example = [ example = [
"-network robustirc.net" "-network robustirc.net"
]; ];

View file

@ -826,13 +826,13 @@ in
"Banner ${if cfg.banner == null then "none" else pkgs.writeText "ssh_banner" cfg.banner}" "Banner ${if cfg.banner == null then "none" else pkgs.writeText "ssh_banner" cfg.banner}"
"AddressFamily ${if config.networking.enableIPv6 then "any" else "inet"}" "AddressFamily ${if config.networking.enableIPv6 then "any" else "inet"}"
] ]
++ lib.map (port: ''Port ${toString port}'') cfg.ports ++ lib.map (port: "Port ${toString port}") cfg.ports
++ lib.map ( ++ lib.map (
{ port, addr, ... }: { port, addr, ... }:
''ListenAddress ${addr}${lib.optionalString (port != null) (":" + toString port)}'' "ListenAddress ${addr}${lib.optionalString (port != null) (":" + toString port)}"
) cfg.listenAddresses ) cfg.listenAddresses
++ lib.optional cfgc.setXAuthLocation "XAuthLocation ${lib.getExe pkgs.xorg.xauth}" ++ lib.optional cfgc.setXAuthLocation "XAuthLocation ${lib.getExe pkgs.xorg.xauth}"
++ lib.optional cfg.allowSFTP ''Subsystem sftp ${cfg.sftpServerExecutable} ${lib.concatStringsSep " " cfg.sftpFlags}'' ++ lib.optional cfg.allowSFTP "Subsystem sftp ${cfg.sftpServerExecutable} ${lib.concatStringsSep " " cfg.sftpFlags}"
++ [ ++ [
"AuthorizedKeysFile ${toString cfg.authorizedKeysFiles}" "AuthorizedKeysFile ${toString cfg.authorizedKeysFiles}"
] ]
@ -901,7 +901,7 @@ in
in in
{ {
assertion = lib.length duplicates == 0; assertion = lib.length duplicates == 0;
message = ''Duplicate sshd config key; does your capitalization match the option's? Duplicate keys: ${formattedDuplicates}''; message = "Duplicate sshd config key; does your capitalization match the option's? Duplicate keys: ${formattedDuplicates}";
} }
) )
] ]

View file

@ -90,7 +90,7 @@ let
type = with lib.types; nullOr path; type = with lib.types; nullOr path;
default = lib.getExe pkgs.ghostscript; default = lib.getExe pkgs.ghostscript;
defaultText = lib.literalExpression "lib.getExe pkgs.ghostscript"; defaultText = lib.literalExpression "lib.getExe pkgs.ghostscript";
example = lib.literalExpression ''''${pkgs.ghostscript}/bin/ps2pdf''; example = lib.literalExpression "\${pkgs.ghostscript}/bin/ps2pdf";
description = "location of GhostScript binary"; description = "location of GhostScript binary";
}; };
}; };

View file

@ -26,7 +26,7 @@ let
${sectName} { ${sectName} {
'' ''
+ lib.generators.toKeyValue { inherit mkKeyValue listsAsDuplicateKeys; } sectValues + lib.generators.toKeyValue { inherit mkKeyValue listsAsDuplicateKeys; } sectValues
+ ''}''; + "}";
in in
# map input to ini sections # map input to ini sections
mapAttrsToStringsSep "\n" mkSection attrsOfAttrs; mapAttrsToStringsSep "\n" mkSection attrsOfAttrs;

View file

@ -45,7 +45,7 @@ in
instead. instead.
''; '';
default = config.services.crowdsec.enable; default = config.services.crowdsec.enable;
defaultText = lib.literalExpression ''config.services.crowdsec.enable''; defaultText = lib.literalExpression "config.services.crowdsec.enable";
}; };
bouncerName = mkOption { bouncerName = mkOption {
type = types.nonEmptyStr; type = types.nonEmptyStr;

View file

@ -442,7 +442,7 @@ in
// { // {
# Miscellaneous options # Miscellaneous options
inherit (cfg) banaction maxretry bantime; inherit (cfg) banaction maxretry bantime;
ignoreip = ''127.0.0.1/8 ${lib.optionalString config.networking.enableIPv6 "::1"} ${lib.concatStringsSep " " cfg.ignoreIP}''; ignoreip = "127.0.0.1/8 ${lib.optionalString config.networking.enableIPv6 "::1"} ${lib.concatStringsSep " " cfg.ignoreIP}";
backend = "systemd"; backend = "systemd";
# Actions # Actions
banaction_allports = cfg.banaction-allports; banaction_allports = cfg.banaction-allports;

View file

@ -107,7 +107,7 @@ in
outputDir = mkOption { outputDir = mkOption {
type = types.path; type = types.path;
default = "${cfg.configDir}/output"; default = "${cfg.configDir}/output";
defaultText = ''''${cfg.configDir}/output''; defaultText = "\${cfg.configDir}/output";
description = "Directory where cross-seed will place torrent files it finds."; description = "Directory where cross-seed will place torrent files it finds.";
}; };

View file

@ -300,7 +300,7 @@ in
type = lib.types.str; type = lib.types.str;
default = default =
if cfg.hostname == "localhost" then "http://${cfg.hostname}" else "https://${cfg.hostname}"; if cfg.hostname == "localhost" then "http://${cfg.hostname}" else "https://${cfg.hostname}";
defaultText = ''http(s)://''${config.services.bookstack.hostname}''; defaultText = "http(s)://\${config.services.bookstack.hostname}";
description = '' description = ''
The root URL that you want to host BookStack on. All URLs in BookStack The root URL that you want to host BookStack on. All URLs in BookStack
will be generated using this value. It is used to validate specific will be generated using this value. It is used to validate specific

View file

@ -134,8 +134,8 @@ in
); );
default = { }; default = { };
example = ''''; example = "";
description = ''''; description = "";
}; };
adminLogin = lib.mkOption { adminLogin = lib.mkOption {

View file

@ -556,7 +556,7 @@ in
"/" = { "/" = {
priority = 1; priority = 1;
index = "doku.php"; index = "doku.php";
extraConfig = ''try_files $uri $uri/ @dokuwiki;''; extraConfig = "try_files $uri $uri/ @dokuwiki;";
}; };
"@dokuwiki" = { "@dokuwiki" = {

View file

@ -359,10 +359,10 @@ in
let let
isUserAuth = cfg.authType == "form" || cfg.authType == "none"; isUserAuth = cfg.authType == "form" || cfg.authType == "none";
userScriptArgs = ''--user ${cfg.defaultUser} ${ userScriptArgs = "--user ${cfg.defaultUser} ${
optionalString (cfg.authType == "form") ''--password "$(cat ${cfg.passwordFile})"'' optionalString (cfg.authType == "form") ''--password "$(cat ${cfg.passwordFile})"''
}''; }";
mkUserScript = name: optionalString isUserAuth ''./cli/${name}.php ${userScriptArgs}''; mkUserScript = name: optionalString isUserAuth "./cli/${name}.php ${userScriptArgs}";
updateUserScript = mkUserScript "update-user"; updateUserScript = mkUserScript "update-user";
createUserScript = mkUserScript "create-user"; createUserScript = mkUserScript "create-user";

View file

@ -217,7 +217,7 @@ in
excalidraw.port = mkOption { excalidraw.port = mkOption {
type = types.port; type = types.port;
default = 3002; default = 3002;
description = ''The port which the Excalidraw backend for Jitsi should listen to.''; description = "The port which the Excalidraw backend for Jitsi should listen to.";
}; };
secureDomain = { secureDomain = {
@ -225,7 +225,7 @@ in
authentication = mkOption { authentication = mkOption {
type = types.str; type = types.str;
default = "internal_hashed"; default = "internal_hashed";
description = ''The authentication type to be used by jitsi''; description = "The authentication type to be used by jitsi";
}; };
}; };
}; };

View file

@ -88,7 +88,7 @@ in
{ {
redis_address => "127.0.0.1:${toString cfg.redis.port}", redis_address => "127.0.0.1:${toString cfg.redis.port}",
redis_password => "${ redis_password => "${
lib.optionalString (cfg.redis.passwordFile != null) ''$(head -n1 ${cfg.redis.passwordFile})'' lib.optionalString (cfg.redis.passwordFile != null) "$(head -n1 ${cfg.redis.passwordFile})"
}", }",
redis_database => "0", redis_database => "0",
redis_database_minion => "1", redis_database_minion => "1",

View file

@ -411,7 +411,7 @@ in
path = mkOption { path = mkOption {
type = types.path; type = types.path;
default = "${cfg.dataDir}/mattermost.sock"; default = "${cfg.dataDir}/mattermost.sock";
defaultText = ''''${config.mattermost.dataDir}/mattermost.sock''; defaultText = "\${config.mattermost.dataDir}/mattermost.sock";
description = '' description = ''
Default location for the Mattermost control socket used by `mmctl`. Default location for the Mattermost control socket used by `mmctl`.
''; '';

View file

@ -473,7 +473,7 @@ in
nginx.hostName = mkOption { nginx.hostName = mkOption {
type = types.str; type = types.str;
example = literalExpression ''wiki.example.com''; example = literalExpression "wiki.example.com";
default = "localhost"; default = "localhost";
description = '' description = ''
The hostname to use for the nginx virtual host. The hostname to use for the nginx virtual host.

View file

@ -188,7 +188,7 @@ in
--runner-name ${lib.escapeShellArg instance.runnerName} \ --runner-name ${lib.escapeShellArg instance.runnerName} \
${lib.optionalString ( ${lib.optionalString (
instance.runnerDescription != null instance.runnerDescription != null
) ''--runner-description ${lib.escapeShellArg instance.runnerDescription}''} ) "--runner-description ${lib.escapeShellArg instance.runnerDescription}"}
# Kill the server # Kill the server
kill $! kill $!

View file

@ -13,11 +13,11 @@ let
mkValueString = mkValueString =
v: v:
if v == true then if v == true then
''true'' "true"
else if v == false then else if v == false then
''false'' "false"
else if builtins.isInt v then else if builtins.isInt v then
''${toString v}'' "${toString v}"
else if builtins.isPath v then else if builtins.isPath v then
''"${toString v}"'' ''"${toString v}"''
else if builtins.isString v then else if builtins.isString v then

View file

@ -248,9 +248,9 @@ in
cp -r ${pkgs.rutorrent}/php ${cfg.dataDir}/ cp -r ${pkgs.rutorrent}/php ${cfg.dataDir}/
${optionalString (cfg.plugins != [ ]) ${optionalString (cfg.plugins != [ ])
''cp -r ${ "cp -r ${
concatMapStringsSep " " (p: "${pkgs.rutorrent}/plugins/${p}") cfg.plugins concatMapStringsSep " " (p: "${pkgs.rutorrent}/plugins/${p}") cfg.plugins
} ${cfg.dataDir}/plugins/'' } ${cfg.dataDir}/plugins/"
} }
chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}/{conf,share,logs,plugins} chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}/{conf,share,logs,plugins}

View file

@ -403,7 +403,7 @@ in
locations = { locations = {
"/" = { "/" = {
index = "index.php"; index = "index.php";
extraConfig = ''try_files $uri $uri/ /index.php?$query_string;''; extraConfig = "try_files $uri $uri/ /index.php?$query_string;";
}; };
"~ \\.php$" = { "~ \\.php$" = {
extraConfig = '' extraConfig = ''

View file

@ -126,7 +126,7 @@ let
stash_boxes = mkOption { stash_boxes = mkOption {
type = types.listOf stashBoxType; type = types.listOf stashBoxType;
default = [ ]; default = [ ];
description = ''Stash-box facilitates automated tagging of scenes and performers based on fingerprints and filenames''; description = "Stash-box facilitates automated tagging of scenes and performers based on fingerprints and filenames";
example = literalExpression '' example = literalExpression ''
{ {
stash_boxes = [ stash_boxes = [

View file

@ -83,7 +83,7 @@ in
type = types.int; type = types.int;
default = 4; default = 4;
example = 6; example = 6;
description = ''Number of waitress threads to start.''; description = "Number of waitress threads to start.";
}; };
settings = mkOption { settings = mkOption {
@ -94,13 +94,13 @@ in
type = types.str; type = types.str;
default = "szurubooru"; default = "szurubooru";
example = "Szuru"; example = "Szuru";
description = ''Name shown in the website title and on the front page.''; description = "Name shown in the website title and on the front page.";
}; };
domain = mkOption { domain = mkOption {
type = types.str; type = types.str;
example = "http://example.com"; example = "http://example.com";
description = ''Full URL to the homepage of this szurubooru site (with no trailing slash).''; description = "Full URL to the homepage of this szurubooru site (with no trailing slash).";
}; };
# NOTE: this is not a real upstream option # NOTE: this is not a real upstream option
@ -119,7 +119,7 @@ in
]; ];
default = "no"; default = "no";
example = "yes"; example = "yes";
description = ''Whether to delete thumbnails and source files on post delete.''; description = "Whether to delete thumbnails and source files on post delete.";
}; };
smtp = { smtp = {
@ -127,21 +127,21 @@ in
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
example = "localhost"; example = "localhost";
description = ''Host of the SMTP server used to send reset password.''; description = "Host of the SMTP server used to send reset password.";
}; };
port = mkOption { port = mkOption {
type = types.nullOr types.port; type = types.nullOr types.port;
default = null; default = null;
example = 25; example = 25;
description = ''Port of the SMTP server.''; description = "Port of the SMTP server.";
}; };
user = mkOption { user = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
example = "bot"; example = "bot";
description = ''User to connect to the SMTP server.''; description = "User to connect to the SMTP server.";
}; };
# NOTE: this is not a real upstream option # NOTE: this is not a real upstream option
@ -149,7 +149,7 @@ in
type = types.nullOr types.path; type = types.nullOr types.path;
default = null; default = null;
example = "/run/secrets/szurubooru-smtp-pass"; example = "/run/secrets/szurubooru-smtp-pass";
description = ''File containing the password associated to the given user for the SMTP server.''; description = "File containing the password associated to the given user for the SMTP server.";
}; };
}; };
@ -158,7 +158,7 @@ in
default = "${cfg.server.settings.domain}/data/"; default = "${cfg.server.settings.domain}/data/";
defaultText = lib.literalExpression ''"''${services.szurubooru.server.settings.domain}/data/"''; defaultText = lib.literalExpression ''"''${services.szurubooru.server.settings.domain}/data/"'';
example = "http://example.com/content/"; example = "http://example.com/content/";
description = ''Full URL to the data endpoint.''; description = "Full URL to the data endpoint.";
}; };
data_dir = mkOption { data_dir = mkOption {
@ -166,21 +166,21 @@ in
default = "${cfg.dataDir}/data"; default = "${cfg.dataDir}/data";
defaultText = lib.literalExpression ''"''${services.szurubooru.dataDir}/data"''; defaultText = lib.literalExpression ''"''${services.szurubooru.dataDir}/data"'';
example = "/srv/szurubooru/data"; example = "/srv/szurubooru/data";
description = ''Path to the static files.''; description = "Path to the static files.";
}; };
debug = mkOption { debug = mkOption {
type = types.int; type = types.int;
default = 0; default = 0;
example = 1; example = 1;
description = ''Whether to generate server logs.''; description = "Whether to generate server logs.";
}; };
show_sql = mkOption { show_sql = mkOption {
type = types.int; type = types.int;
default = 0; default = 0;
example = 1; example = 1;
description = ''Whether to show SQL in server logs.''; description = "Whether to show SQL in server logs.";
}; };
}; };
}; };
@ -203,13 +203,13 @@ in
type = types.str; type = types.str;
default = "localhost"; default = "localhost";
example = "192.168.1.2"; example = "192.168.1.2";
description = ''Host on which the PostgreSQL database runs.''; description = "Host on which the PostgreSQL database runs.";
}; };
port = mkOption { port = mkOption {
type = types.port; type = types.port;
default = 5432; default = 5432;
description = ''The port under which PostgreSQL listens to.''; description = "The port under which PostgreSQL listens to.";
}; };
name = mkOption { name = mkOption {
@ -217,20 +217,20 @@ in
default = cfg.database.user; default = cfg.database.user;
defaultText = lib.literalExpression "szurubooru.database.name"; defaultText = lib.literalExpression "szurubooru.database.name";
example = "szuru"; example = "szuru";
description = ''Name of the PostgreSQL database.''; description = "Name of the PostgreSQL database.";
}; };
user = mkOption { user = mkOption {
type = types.str; type = types.str;
default = "szurubooru"; default = "szurubooru";
example = "szuru"; example = "szuru";
description = ''PostgreSQL user.''; description = "PostgreSQL user.";
}; };
passwordFile = mkOption { passwordFile = mkOption {
type = types.path; type = types.path;
example = "/run/secrets/szurubooru-db-password"; example = "/run/secrets/szurubooru-db-password";
description = ''A file containing the password for the PostgreSQL user.''; description = "A file containing the password for the PostgreSQL user.";
}; };
}; };
}; };

View file

@ -114,7 +114,7 @@ in
}; };
MONGO_ENDPOINT = mkOption { MONGO_ENDPOINT = mkOption {
type = str; type = str;
description = ''The endpoint of the Mongo database.''; description = "The endpoint of the Mongo database.";
default = "mongodb://localhost:27017/your_spotify"; default = "mongodb://localhost:27017/your_spotify";
}; };
PORT = mkOption { PORT = mkOption {

View file

@ -421,9 +421,9 @@ in
serviceConfig = serviceConfig =
let let
runOptions = ''--config ${configPath} ${ runOptions = "--config ${configPath} ${
optionalString (cfg.adapter != null) "--adapter ${cfg.adapter}" optionalString (cfg.adapter != null) "--adapter ${cfg.adapter}"
}''; }";
in in
{ {
# Override the `ExecStart` line from upstream's systemd unit file by our own: # Override the `ExecStart` line from upstream's systemd unit file by our own:
@ -431,7 +431,7 @@ in
# If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect. # If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect.
ExecStart = [ ExecStart = [
"" ""
''${lib.getExe cfg.package} run ${runOptions} ${optionalString cfg.resume "--resume"}'' "${lib.getExe cfg.package} run ${runOptions} ${optionalString cfg.resume "--resume"}"
]; ];
# Validating the configuration before applying it ensures well get a proper error that will be reported when switching to the configuration # Validating the configuration before applying it ensures well get a proper error that will be reported when switching to the configuration
ExecReload = [ ExecReload = [

View file

@ -262,12 +262,12 @@ let
); );
# Executing H2O with our generated configuration; `mode` added as needed # Executing H2O with our generated configuration; `mode` added as needed
h2oExe = ''${lib.getExe cfg.package} ${ h2oExe = "${lib.getExe cfg.package} ${
lib.strings.escapeShellArgs [ lib.strings.escapeShellArgs [
"--conf" "--conf"
"${h2oConfig}" "${h2oConfig}"
] ]
}''; }";
in in
{ {
options = { options = {

View file

@ -13,7 +13,7 @@ in
{ {
options = { options = {
services.static-web-server = { services.static-web-server = {
enable = lib.mkEnableOption ''Static Web Server''; enable = lib.mkEnableOption "Static Web Server";
listen = lib.mkOption { listen = lib.mkOption {
default = "[::]:8787"; default = "[::]:8787";
type = lib.types.str; type = lib.types.str;

View file

@ -59,7 +59,7 @@ in
|| (fs.fsType == "zfs" && lib.hasPrefix "${device}/" fs.device) || (fs.fsType == "zfs" && lib.hasPrefix "${device}/" fs.device)
) config.system.build.fileSystems) ) config.system.build.fileSystems)
|| (lib.hasAttr device config.boot.initrd.luks.devices); || (lib.hasAttr device config.boot.initrd.luks.devices);
message = ''No filesystem or LUKS device with the name ${device} is declared in your configuration.''; message = "No filesystem or LUKS device with the name ${device} is declared in your configuration.";
}) cfg.devices }) cfg.devices
) )
); );

View file

@ -12,7 +12,7 @@ in
options.boot.kexec = { options.boot.kexec = {
enable = lib.mkEnableOption "kexec" // { enable = lib.mkEnableOption "kexec" // {
default = lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kexec-tools; default = lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kexec-tools;
defaultText = lib.literalExpression ''lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kexec-tools''; defaultText = lib.literalExpression "lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kexec-tools";
}; };
}; };

View file

@ -244,7 +244,7 @@ in
installDeviceTree = mkOption { installDeviceTree = mkOption {
default = with config.hardware.deviceTree; enable && name != null; default = with config.hardware.deviceTree; enable && name != null;
defaultText = ''with config.hardware.deviceTree; enable && name != null''; defaultText = "with config.hardware.deviceTree; enable && name != null";
description = '' description = ''
Install the devicetree blob specified by `config.hardware.deviceTree.name` Install the devicetree blob specified by `config.hardware.deviceTree.name`
to the ESP and instruct systemd-boot to pass this DTB to linux. to the ESP and instruct systemd-boot to pass this DTB to linux.

View file

@ -31,9 +31,9 @@ let
${lib.concatLines ( ${lib.concatLines (
lib.mapAttrsToList ( lib.mapAttrsToList (
groupname: opts: groupname: opts:
''g ${groupname} ${ "g ${groupname} ${
if opts.gid == null then "/var/lib/nixos/gid/${groupname}" else toString opts.gid if opts.gid == null then "/var/lib/nixos/gid/${groupname}" else toString opts.gid
}'' }"
) userCfg.groups ) userCfg.groups
)} )}

View file

@ -12,13 +12,13 @@ in
{ {
options.boot.initrd.unl0kr = { options.boot.initrd.unl0kr = {
enable = lib.mkEnableOption "unl0kr in initrd" // { enable = lib.mkEnableOption "unl0kr in initrd" // {
description = ''Whether to enable the unl0kr on-screen keyboard in initrd to unlock LUKS.''; description = "Whether to enable the unl0kr on-screen keyboard in initrd to unlock LUKS.";
}; };
package = lib.mkPackageOption pkgs "buffybox" { }; package = lib.mkPackageOption pkgs "buffybox" { };
allowVendorDrivers = lib.mkEnableOption "load optional drivers" // { allowVendorDrivers = lib.mkEnableOption "load optional drivers" // {
description = ''Whether to load additional drivers for certain vendors (I.E: Wacom, Intel, etc.)''; description = "Whether to load additional drivers for certain vendors (I.E: Wacom, Intel, etc.)";
}; };
settings = lib.mkOption { settings = lib.mkOption {
@ -56,10 +56,10 @@ in
warnings = lib.mkMerge [ warnings = lib.mkMerge [
(lib.mkIf (config.hardware.amdgpu.initrd.enable) [ (lib.mkIf (config.hardware.amdgpu.initrd.enable) [
''Use early video loading at your risk. It's not guaranteed to work with unl0kr.'' "Use early video loading at your risk. It's not guaranteed to work with unl0kr."
]) ])
(lib.mkIf (config.boot.plymouth.enable) [ (lib.mkIf (config.boot.plymouth.enable) [
''Upstream clearly intends unl0kr to not run with Plymouth. Good luck'' "Upstream clearly intends unl0kr to not run with Plymouth. Good luck"
]) ])
]; ];

Some files were not shown because too many files have changed in this diff Show more