Skip to content
Closed
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
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,6 @@ c283f32d296564fd649ef3ed268c1f1f7b199c49 # !autorebase nix-shell --run treefmt

# treewide: clean up 'meta = with' pattern
cca3b04b44a5c57502fe2440cc3d2114779cc40c

# nixfmt 1.2.0
2066ff656fe3e7ab0f3102877bfe3e60509996ee # !autorebase nix-shell --run treefmt
30 changes: 19 additions & 11 deletions ci/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,30 @@ let
"pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml"
];

programs.nixf-diagnose.enable = true;
settings.formatter.nixf-diagnose = {
# Ensure nixfmt cleans up after nixf-diagnose.
priority = -1;
options = [
"--auto-fix"
programs.nixf-diagnose = {
enable = true;
ignore = [
# Rule names can currently be looked up here:
# https://github.com/nix-community/nixd/blob/main/libnixf/src/Basic/diagnostic.py
# TODO: Remove the following and fix things.
"--ignore=sema-unused-def-lambda-noarg-formal"
"--ignore=sema-unused-def-lambda-witharg-arg"
"--ignore=sema-unused-def-lambda-witharg-formal"
"--ignore=sema-unused-def-let"
"sema-unused-def-lambda-noarg-formal"
"sema-unused-def-lambda-witharg-arg"
"sema-unused-def-lambda-witharg-formal"
"sema-unused-def-let"
# Keep this rule, because we have `lib.or`.
"--ignore=or-identifier"
"or-identifier"
# TODO: remove after outstanding prelude diagnostics issues are fixed:
# https://github.com/nix-community/nixd/issues/761
# https://github.com/nix-community/nixd/issues/762
"sema-primop-removed-prefix"
"sema-primop-overridden"
"sema-constant-overridden"
"sema-primop-unknown"
];
};
settings.formatter.nixf-diagnose = {
# Ensure nixfmt cleans up after nixf-diagnose.
priority = -1;
excludes = [
# Auto-generated; violates sema-extra-with
# Can only sensibly be removed when --auto-fix supports multiple fixes at once:
Expand Down
12 changes: 6 additions & 6 deletions ci/pinned.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
},
"branch": "nixpkgs-unstable",
"submodules": false,
"revision": "ee09932cedcef15aaf476f9343d1dea2cb77e261",
"url": "https://github.com/NixOS/nixpkgs/archive/ee09932cedcef15aaf476f9343d1dea2cb77e261.tar.gz",
"hash": "1xz5pa6la2fyj5b1cfigmg3nmml11fyf9ah0rnr4zfgmnwimn2gn"
"revision": "bde09022887110deb780067364a0818e89258968",
"url": "https://github.com/NixOS/nixpkgs/archive/bde09022887110deb780067364a0818e89258968.tar.gz",
"hash": "13mi187zpa4rw680qbwp7pmykjia8cra3nwvjqmsjba3qhlzif5l"
},
"treefmt-nix": {
"type": "Git",
Expand All @@ -22,9 +22,9 @@
},
"branch": "main",
"submodules": false,
"revision": "5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4",
"url": "https://github.com/numtide/treefmt-nix/archive/5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4.tar.gz",
"hash": "0cr6aj9bk7n3y09lwmfjr7xg1f069332xf4q99z3kj1c1mp0wl82"
"revision": "e96d59dff5c0d7fddb9d113ba108f03c3ef99eca",
"url": "https://github.com/numtide/treefmt-nix/archive/e96d59dff5c0d7fddb9d113ba108f03c3ef99eca.tar.gz",
"hash": "02gqyxila3ghw8gifq3mns639x86jcq079kvfvjm42mibx7z5fzb"
}
},
"version": 5
Expand Down
2 changes: 1 addition & 1 deletion doc/hooks/udevCheckHook.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The hook runs in `installCheckPhase`, requiring `doInstallCheck` is enabled for
lib,
stdenv,
udevCheckHook,
# ...
# ...
}:

stdenv.mkDerivation (finalAttrs: {
Expand Down
2 changes: 1 addition & 1 deletion doc/hooks/versionCheckHook.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You use it like this:
lib,
stdenv,
versionCheckHook,
# ...
# ...
}:

stdenv.mkDerivation (finalAttrs: {
Expand Down
2 changes: 1 addition & 1 deletion doc/languages-frameworks/nim.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ For example, to propagate a dependency on SDL2 for lockfiles that select the Nim
lib,
# …
SDL2,
# …
# …
}:

{
Expand Down
18 changes: 9 additions & 9 deletions lib/fileset/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ in
if isStringLike path then
throw ''lib.fileset.maybeMissing: Argument ("${toString path}") is a string-like value, but it should be a path instead.''
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
_emptyWithoutBase
else
Expand Down Expand Up @@ -443,7 +443,7 @@ in
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.''
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.
# See also ../path/README.md
else if !fileset._internalIsEmptyWithoutBase && rootFilesystemRoot != filesetFilesystemRoot then
Expand All @@ -453,7 +453,7 @@ in
`fileset`: Filesystem root is "${toString filesetFilesystemRoot}"
Different filesystem roots are not supported.''
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
throw ''
lib.fileset.toSource: `root` (${toString root}) is a file, but it should be a directory instead. Potential solutions:
Expand Down Expand Up @@ -619,7 +619,7 @@ in
unions =
filesets:
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
pipe filesets [
# Annotate the elements with context, used by _coerceMany for better errors
Expand Down Expand Up @@ -808,16 +808,16 @@ in
fileFilter =
predicate: path:
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
if path._type or "" == "fileset" then
throw ''
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.''
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
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
_fileFilter predicate path;

Expand Down Expand Up @@ -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.
Sources created from paths in strings cannot be turned into file sets, use `lib.sources` or derivations instead.''
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
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
_fromSourceFilter path source.filter
else
Expand Down
2 changes: 1 addition & 1 deletion lib/fileset/internal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ rec {
${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.''
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
error ''
${context} (${toString value}) is a path that does not exist.
Expand Down
2 changes: 1 addition & 1 deletion lib/path/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ in
# The subpath string to append
subpath:
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) ''
lib.path.append: Second argument is not a valid subpath string:
${subpathInvalidReason subpath}'';
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/checkAndMergeCompat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ in
testAttrs = {
expectedError = {
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.*";
};
};
};
Expand Down
8 changes: 4 additions & 4 deletions lib/tests/misc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,7 @@ runTests {
sections = {
};
};
expected = '''';
expected = "";
};

testToINIWithGlobalSectionGlobalEmptyIsTheSameAsToINI =
Expand Down Expand Up @@ -2909,12 +2909,12 @@ runTests {

testToLuaEmptyAttrSet = {
expr = generators.toLua { } { };
expected = ''{}'';
expected = "{}";
};

testToLuaEmptyList = {
expr = generators.toLua { } [ ];
expected = ''{}'';
expected = "{}";
};

testToLuaListOfVariousTypes = {
Expand Down Expand Up @@ -2959,7 +2959,7 @@ runTests {
41
43
];
expected = ''{ 41, 43 }'';
expected = "{ 41, 43 }";
};

testToLuaEmptyBindings = {
Expand Down
2 changes: 1 addition & 1 deletion lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ let
else if builtins.isBool v then
boolToString v
else
''<${builtins.typeOf v}>'';
"<${builtins.typeOf v}>";
in
mkOptionType rec {
name = "enum";
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/meta-maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ in
maintainers = mkOption {
type = listOfMaintainers;
default = [ ];
example = lib.literalExpression ''[ lib.maintainers.alice lib.maintainers.bob ]'';
example = lib.literalExpression "[ lib.maintainers.alice lib.maintainers.bob ]";
description = ''
List of maintainers of each module.
This option should be defined at most once per module.
Expand Down
2 changes: 1 addition & 1 deletion nixos/README-modular-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Example:
{
stdenv,
nixosTests,
# ...
# ...
}:
stdenv.mkDerivation (finalAttrs: {
pname = "example";
Expand Down
2 changes: 1 addition & 1 deletion nixos/doc/manual/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
common = import ./common.nix;
inherit (common) outputPath indexPath;
devmode = pkgs.devmode.override {
buildArgs = ''${toString ../../release.nix} -A manualHTML.${builtins.currentSystem}'';
buildArgs = "${toString ../../release.nix} -A manualHTML.${builtins.currentSystem}";
open = "/${outputPath}/${indexPath}";
};
nixos-render-docs-redirects = pkgs.writeShellScriptBin "redirects" "${pkgs.lib.getExe pkgs.nixos-render-docs-redirects} --file ${toString ./redirects.json} $@";
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/make-multi-disk-zfs-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ let
--no-root-passwd \
--system ${config.system.build.toplevel} \
--substituters "" \
${lib.optionalString includeChannel ''--channel ${channelSources}''}
${lib.optionalString includeChannel "--channel ${channelSources}"}

df -h

Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/make-single-disk-zfs-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ let
--no-root-passwd \
--system ${config.system.build.toplevel} \
--substituters "" \
${lib.optionalString includeChannel ''--channel ${channelSources}''}
${lib.optionalString includeChannel "--channel ${channelSources}"}

df -h

Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/testing/nodes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ in
'';
type = types.bool;
default = config.node.pkgs != null;
defaultText = literalExpression ''node.pkgs != null'';
defaultText = literalExpression "node.pkgs != null";
};

node.specialArgs = mkOption {
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ let
stringOrDefault (concatStringsSep " | " (
imap1 (
index: name:
''${name} = ($ENV.secret${toString index}${optionalString (!secrets.${name}.quote) " | fromjson"})''
"${name} = ($ENV.secret${toString index}${optionalString (!secrets.${name}.quote) " | fromjson"})"
) (attrNames secrets)
)) "."
)
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/config/users-groups.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ let
"*" # 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: ''
If the option {option}`users.mutableUsers` is
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/xdg/portal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ in

options.xdg.portal = {
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;
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/hardware/inputmodule.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
environment.systemPackages = [ pkgs.inputmodule-control ];
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/misc/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ in
cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001
else
elaborated;
defaultText = lib.literalExpression ''config.nixpkgs.hostPlatform'';
defaultText = lib.literalExpression "config.nixpkgs.hostPlatform";
description = ''
Specifies the platform on which NixOS should be built.
By default, NixOS is built on the system where it runs, but you can
Expand All @@ -252,7 +252,7 @@ in
# 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.
apply = lib.systems.elaborate;
defaultText = lib.literalExpression ''config.nixpkgs.system'';
defaultText = lib.literalExpression "config.nixpkgs.system";
description = ''
Systems with a recently generated `hardware-configuration.nix`
do not need to specify this option, unless cross-compiling, in which case
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/misc/nixpkgs/read-only.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ in
nixpkgs = {
pkgs = mkOption {
type = lib.types.pkgs;
description = ''The pkgs module argument.'';
description = "The pkgs module argument.";
};
config = mkOption {
internal = true;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/misc/version.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let
escapeIfNecessary = s: if needsEscaping s then s else ''"${lib.escape [ "$" "\"" "\\" "`" ] s}"'';
attrsToText =
attrs:
concatStringsSep "\n" (mapAttrsToList (n: v: ''${n}=${escapeIfNecessary (toString v)}'') attrs)
concatStringsSep "\n" (mapAttrsToList (n: v: "${n}=${escapeIfNecessary (toString v)}") attrs)
+ "\n";

osReleaseContents =
Expand Down
14 changes: 7 additions & 7 deletions nixos/modules/programs/captive-browser.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ let
chromium:
concatStringsSep " " [
''env XDG_CONFIG_HOME="$PREV_CONFIG_HOME"''
''${chromium}/bin/chromium''
''--user-data-dir=''${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive''
"${chromium}/bin/chromium"
"--user-data-dir=\${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive"
''--proxy-server="socks5://$PROXY"''
''--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost"''
''--no-first-run''
''--new-window''
''--incognito''
''-no-default-browser-check''
''http://cache.nixos.org/''
"--no-first-run"
"--new-window"
"--incognito"
"-no-default-browser-check"
"http://cache.nixos.org/"
];

desktopItem = pkgs.makeDesktopItem {
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/nix-ld.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ in
{
meta.maintainers = [ lib.maintainers.mic92 ];
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" { };
libraries = lib.mkOption {
type = lib.types.listOf lib.types.package;
Expand Down
Loading
Loading