Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/lib/eval-config-minimal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let
inherit prefix modules;
class = "nixos";
specialArgs = {
modulesPath = builtins.toString ../modules;
modulesPath = toString ../modules;
}
// specialArgs;
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/make-btrfs-fs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pkgs.stdenv.mkDerivation {
return 1
fi

if [ ${builtins.toString compressImage} ]; then
if [ ${toString compressImage} ]; then
echo "Compressing image"
zstd -v --no-progress ./$img -o $out
fi
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/make-ext4-fs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pkgs.stdenv.mkDerivation {

resize2fs $img $new_size

if [ ${builtins.toString compressImage} ]; then
if [ ${toString compressImage} ]; then
echo "Compressing image"
zstd -T$NIX_BUILD_CORES -v --no-progress ./$img -o $out
fi
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/systemd-lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ rec {
toIntBaseDetected =
value:
assert (match "[0-9]+|0x[0-9a-fA-F]+" value) != null;
(builtins.fromTOML "v=${value}").v;
(fromTOML "v=${value}").v;

hexChars = stringToCharacters "0123456789abcdefABCDEF";

Expand Down
4 changes: 2 additions & 2 deletions nixos/lib/testing/driver.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ let
${lib.optionalString (!config.skipTypeCheck) ''
# prepend type hints so the test script can be type checked with mypy
cat "${../test-script-prepend.py}" >> testScriptWithTypes
echo "${builtins.toString machineNames}" >> testScriptWithTypes
echo "${builtins.toString vlanNames}" >> testScriptWithTypes
echo "${toString machineNames}" >> testScriptWithTypes
echo "${toString vlanNames}" >> testScriptWithTypes
echo -n "$testScript" >> testScriptWithTypes

echo "Running type check (enable/disable: config.skipTypeCheck)"
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/config/fanout.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
cfg = config.services.fanout;
mknodCmds =
n:
lib.lists.imap0 (i: s: "mknod /dev/fanout${builtins.toString i} c $MAJOR ${builtins.toString i}") (
lib.lists.imap0 (i: s: "mknod /dev/fanout${toString i} c $MAJOR ${toString i}") (
lib.lists.replicate n ""
);
in
Expand All @@ -33,7 +33,7 @@ in
boot.kernelModules = [ "fanout" ];

boot.extraModprobeConfig = ''
options fanout buffersize=${builtins.toString cfg.bufferSize}
options fanout buffersize=${toString cfg.bufferSize}
'';

systemd.services.fanout = {
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/i18n.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let
(lib.mapAttrs (n: v: (sanitizeUTF8Capitalization v)))
(lib.mapAttrsToList (LCRole: lang: lang + "/" + (config.i18n.localeCharsets.${LCRole} or "UTF-8")))
]
++ (builtins.map sanitizeUTF8Capitalization (
++ (map sanitizeUTF8Capitalization (
lib.optionals (builtins.isList config.i18n.extraLocales) config.i18n.extraLocales
))
++ (lib.optional (builtins.isString config.i18n.extraLocales) config.i18n.extraLocales);
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/zram.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ in
services.zram-generator.enable = true;

services.zram-generator.settings = lib.listToAttrs (
builtins.map (dev: {
map (dev: {
name = dev;
value =
let
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/hardware/ckb-next.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ in
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/ckb-next-daemon ${
lib.optionalString (cfg.gid != null) "--gid=${builtins.toString cfg.gid}"
lib.optionalString (cfg.gid != null) "--gid=${toString cfg.gid}"
}";
Restart = "on-failure";
};
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/hardware/openrazer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ let
sync_effects_enabled = ${toPyBoolStr cfg.syncEffectsEnabled}
devices_off_on_screensaver = ${toPyBoolStr cfg.devicesOffOnScreensaver}
battery_notifier = ${toPyBoolStr cfg.batteryNotifier.enable}
battery_notifier_freq = ${builtins.toString cfg.batteryNotifier.frequency}
battery_notifier_percent = ${builtins.toString cfg.batteryNotifier.percentage}
battery_notifier_freq = ${toString cfg.batteryNotifier.frequency}
battery_notifier_percent = ${toString cfg.batteryNotifier.percentage}

[Statistics]
key_statistics = ${toPyBoolStr cfg.keyStatistics}
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/installer/cd-dvd/iso-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ let

baseIsolinuxCfg = ''
SERIAL 0 115200
TIMEOUT ${builtins.toString syslinuxTimeout}
TIMEOUT ${toString syslinuxTimeout}
UI vesamenu.c32
MENU BACKGROUND /isolinux/background.png

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/misc/mandoc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let
if lib.isString value || lib.isPath value then
"output ${name} ${value}"
else if lib.isInt value then
"output ${name} ${builtins.toString value}"
"output ${name} ${toString value}"
else if lib.isBool value then
lib.optionalString value "output ${name}"
else if value == null then
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/misc/nixpkgs-flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in
default = null;
defaultText = "if (using nixpkgsFlake.lib.nixosSystem) then self.outPath else null";

example = ''builtins.fetchTarball { name = "source"; sha256 = "${lib.fakeHash}"; url = "https://github.com/nixos/nixpkgs/archive/somecommit.tar.gz"; }'';
example = ''fetchTarball { name = "source"; sha256 = "${lib.fakeHash}"; url = "https://github.com/nixos/nixpkgs/archive/somecommit.tar.gz"; }'';

description = ''
The path to the nixpkgs sources used to build the system. This is automatically set up to be
Expand All @@ -30,7 +30,7 @@ in

This can also be optionally set if the NixOS system is not built with a flake but still uses
pinned sources: set this to the store path for the nixpkgs sources used to build the system,
as may be obtained by `builtins.fetchTarball`, for example.
as may be obtained by `fetchTarball`, for example.

Note: the name of the store path must be "source" due to
<https://github.com/NixOS/nix/issues/7075>.
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/atop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ in
environment.etc = lib.mkIf (cfg.settings != { }) {
atoprc.text = lib.concatStrings (
lib.mapAttrsToList (n: v: ''
${n} ${builtins.toString v}
${n} ${toString v}
'') cfg.settings
);
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/bash/undistract-me.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ in

config = lib.mkIf cfg.enable {
programs.bash.promptPluginInit = ''
export LONG_RUNNING_COMMAND_TIMEOUT=${builtins.toString cfg.timeout}
export LONG_RUNNING_COMMAND_TIMEOUT=${toString cfg.timeout}
export UDM_PLAY_SOUND=${if cfg.playSound then "1" else "0"}
. "${pkgs.undistract-me}/etc/profile.d/undistract-me.sh"
'';
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/benchexec.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ in
# See <https://github.com/sosy-lab/benchexec/blob/3.18/doc/INSTALL.md#setting-up-cgroups>.
systemd.services = builtins.listToAttrs (
map (user: {
name = "user@${builtins.toString (uid user)}";
name = "user@${toString (uid user)}";
value = {
serviceConfig.Delegate = "yes";
overrideStrategy = "asDropin";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/firefox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ in
}) cfg.preferences
);
ExtensionSettings = builtins.listToAttrs (
builtins.map (
map (
lang:
lib.attrsets.nameValuePair "langpack-${lang}@firefox.mozilla.org" {
installation_mode = "normal_installed";
Expand Down
5 changes: 2 additions & 3 deletions nixos/modules/programs/firejail.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ let
extraArgs = [ ];
};
args = lib.escapeShellArgs (
opts.extraArgs
++ (lib.optional (opts.profile != null) "--profile=${builtins.toString opts.profile}")
opts.extraArgs ++ (lib.optional (opts.profile != null) "--profile=${toString opts.profile}")
);
in
''
cat <<_EOF >$out/bin/${command}
#! ${pkgs.runtimeShell} -e
exec /run/wrappers/bin/firejail ${args} -- ${builtins.toString opts.executable} "\$@"
exec /run/wrappers/bin/firejail ${args} -- ${toString opts.executable} "\$@"
_EOF
chmod 0755 $out/bin/${command}

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ in
pkgs.buildEnv {
name = "system_fish-completions";
ignoreCollisions = true;
paths = builtins.map generateCompletions config.environment.systemPackages;
paths = map generateCompletions config.environment.systemPackages;
};
})

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/fuse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ in

environment.etc."fuse.conf".text = ''
${lib.optionalString (!cfg.userAllowOther) "#"}user_allow_other
mount_max = ${builtins.toString cfg.mountMax}
mount_max = ${toString cfg.mountMax}
'';

};
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/programs/gamescope.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ let
gamescope =
let
wrapperArgs =
lib.optional (cfg.args != [ ]) ''--add-flags "${builtins.toString cfg.args}"''
lib.optional (cfg.args != [ ]) ''--add-flags "${toString cfg.args}"''
++ builtins.attrValues (builtins.mapAttrs (var: val: "--set-default ${var} ${val}") cfg.env);
in
pkgs.runCommand "gamescope" { nativeBuildInputs = [ pkgs.makeBinaryWrapper ]; } ''
mkdir -p $out/bin
makeWrapper ${cfg.package}/bin/gamescope $out/bin/gamescope --inherit-argv0 \
${builtins.toString wrapperArgs}
${toString wrapperArgs}
ln -s ${cfg.package}/bin/gamescopectl $out/bin/gamescopectl
'';
in
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/programs/htop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ let
fmt =
value:
if builtins.isList value then
builtins.concatStringsSep " " (builtins.map fmt value)
builtins.concatStringsSep " " (map fmt value)
else if builtins.isString value then
value
else if builtins.isBool value then
if value then "1" else "0"
else if builtins.isInt value then
builtins.toString value
toString value
else
throw "Unrecognized type ${builtins.typeOf value} in htop settings";

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/less.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ in
environment.systemPackages = [ cfg.package ];

environment.variables = {
LESSKEYIN_SYSTEM = builtins.toString lessKey;
LESSKEYIN_SYSTEM = toString lessKey;
}
// lib.optionalAttrs (cfg.lessopen != null) {
LESSOPEN = cfg.lessopen;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/liboping.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ liboping ];
security.wrappers = lib.mkMerge (
builtins.map
map
(exec: {
"${exec}" = {
owner = "root";
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/programs/light.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ in
bindings =
let
light = "${pkgs.light}/bin/light";
step = builtins.toString cfg.brightnessKeys.step;
minBrightness = builtins.toString cfg.brightnessKeys.minBrightness;
step = toString cfg.brightnessKeys.step;
minBrightness = toString cfg.brightnessKeys.minBrightness;
in
[
{
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/programs/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ in
builtins.attrValues (
builtins.mapAttrs (name: value: {
name = "xdg/nvim/${name}";
value = builtins.removeAttrs (
value = removeAttrs (
value
// {
target = "xdg/nvim/${value.target}";
}
) (lib.optionals (builtins.isNull value.source) [ "source" ]);
) (lib.optionals (isNull value.source) [ "source" ]);
}) cfg.runtime
)
);
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/nncp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ in
script = ''
umask 127
rm -f ${nncpCfgFile}
for f in ${jsonCfgFile} ${builtins.toString config.programs.nncp.secrets}
for f in ${jsonCfgFile} ${toString config.programs.nncp.secrets}
do
${lib.getExe pkgs.hjson-go} -c <"$f"
done |${lib.getExe pkgs.jq} --slurp 'reduce .[] as $x ({}; . * $x)' >${nncpCfgFile}
Expand Down
12 changes: 5 additions & 7 deletions nixos/modules/programs/proxychains.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ let

configFile = ''
${cfg.chain.type}_chain
${lib.optionalString (
cfg.chain.type == "random"
) "chain_len = ${builtins.toString cfg.chain.length}"}
${lib.optionalString (cfg.chain.type == "random") "chain_len = ${toString cfg.chain.length}"}
${lib.optionalString cfg.proxyDNS "proxy_dns"}
${lib.optionalString cfg.quietMode "quiet_mode"}
remote_dns_subnet ${builtins.toString cfg.remoteDNSSubnet}
tcp_read_time_out ${builtins.toString cfg.tcpReadTimeOut}
tcp_connect_time_out ${builtins.toString cfg.tcpConnectTimeOut}
remote_dns_subnet ${toString cfg.remoteDNSSubnet}
tcp_read_time_out ${toString cfg.tcpReadTimeOut}
tcp_connect_time_out ${toString cfg.tcpConnectTimeOut}
localnet ${cfg.localnet}
[ProxyList]
${builtins.concatStringsSep "\n" (
lib.mapAttrsToList (k: v: "${v.type} ${v.host} ${builtins.toString v.port}") (
lib.mapAttrsToList (k: v: "${v.type} ${v.host} ${toString v.port}") (
lib.filterAttrs (k: v: v.enable) cfg.proxies
)
)}
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/spacefm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ in
environment.systemPackages = [ pkgs.spaceFM ];

environment.etc."spacefm/spacefm.conf".text = lib.concatStrings (
lib.mapAttrsToList (n: v: "${n}=${builtins.toString v}\n") cfg.settings
lib.mapAttrsToList (n: v: "${n}=${toString v}\n") cfg.settings
);
};
}
2 changes: 1 addition & 1 deletion nixos/modules/programs/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let
knownHostsFiles = [
"/etc/ssh/ssh_known_hosts"
]
++ builtins.map pkgs.copyPathToStore cfg.knownHostsFiles;
++ map pkgs.copyPathToStore cfg.knownHostsFiles;

in
{
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/steam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let
in
pkgs.writeShellScriptBin "steam-gamescope" ''
${builtins.concatStringsSep "\n" exports}
gamescope --steam ${builtins.toString cfg.gamescopeSession.args} -- steam ${builtins.toString cfg.gamescopeSession.steamArgs}
gamescope --steam ${toString cfg.gamescopeSession.args} -- steam ${toString cfg.gamescopeSession.steamArgs}
'';

gamescopeSessionFile =
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/tsm-client.nix
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ let
""
# just output key if value is `true`
else if isInt value then
" ${builtins.toString value}"
" ${toString value}"
else if path.check value then
" \"${value}\""
# enclose path in ".."
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/programs/xfs_quota.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ in

environment.etc.projects.source = pkgs.writeText "etc-project" (
builtins.concatStringsSep "\n" (
lib.mapAttrsToList (name: opts: "${builtins.toString opts.id}:${opts.path}") cfg.projects
lib.mapAttrsToList (name: opts: "${toString opts.id}:${opts.path}") cfg.projects
)
);

environment.etc.projid.source = pkgs.writeText "etc-projid" (
builtins.concatStringsSep "\n" (
lib.mapAttrsToList (name: opts: "${name}:${builtins.toString opts.id}") cfg.projects
lib.mapAttrsToList (name: opts: "${name}:${toString opts.id}") cfg.projects
)
);

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/xss-lock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ in
"${pkgs.xss-lock}/bin/xss-lock"
"--session \${XDG_SESSION_ID}"
]
++ (builtins.map lib.escapeShellArg cfg.extraOptions)
++ (map lib.escapeShellArg cfg.extraOptions)
++ [
"--"
cfg.lockerCommand
Expand Down
6 changes: 3 additions & 3 deletions nixos/modules/programs/yubikey-touch-detector.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ in
path = [ pkgs.gnupg ];

environment = {
YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = builtins.toString cfg.libnotify;
YUBIKEY_TOUCH_DETECTOR_NOSOCKET = builtins.toString (!cfg.unixSocket);
YUBIKEY_TOUCH_DETECTOR_VERBOSE = builtins.toString cfg.verbose;
YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = toString cfg.libnotify;
YUBIKEY_TOUCH_DETECTOR_NOSOCKET = toString (!cfg.unixSocket);
YUBIKEY_TOUCH_DETECTOR_VERBOSE = toString cfg.verbose;
};

wantedBy = [ "graphical-session.target" ];
Expand Down
Loading
Loading