diff --git a/default.nix b/default.nix index 6806be1..0d50eae 100644 --- a/default.nix +++ b/default.nix @@ -9,8 +9,8 @@ in let pkgs = import nixpkgs { inherit system; - config = {}; - overlays = []; + config = { }; + overlays = [ ]; }; inherit (pkgs) lib; @@ -40,6 +40,7 @@ let projectRootFile = ".git/config"; programs.rustfmt.enable = true; + programs.nixfmt-rfc-style.enable = true; }; results = { @@ -47,7 +48,13 @@ let # internal attributes, which is very messy. We prevent this using lib.lazyDerivation build = lib.lazyDerivation { derivation = pkgs.callPackage ./package.nix { - inherit nixpkgsLibPath initNix runtimeExprPath testNixpkgsPath version; + inherit + nixpkgsLibPath + initNix + runtimeExprPath + testNixpkgsPath + version + ; }; }; @@ -76,9 +83,7 @@ let updateScripts = { npins = pkgs.writeShellApplication { name = "update-npins"; - runtimeInputs = with pkgs; [ - npins - ]; + runtimeInputs = with pkgs; [ npins ]; text = '' echo "
npins changes" # Needed because GitHub's rendering of the first body line breaks down otherwise @@ -91,9 +96,7 @@ let }; cargo = pkgs.writeShellApplication { name = "update-cargo"; - runtimeInputs = with pkgs; [ - cargo - ]; + runtimeInputs = with pkgs; [ cargo ]; text = '' echo "
cargo changes" # Needed because GitHub's rendering of the first body line breaks down otherwise @@ -129,21 +132,25 @@ let }; # Tests the tool on the pinned Nixpkgs tree, this is a good sanity check - nixpkgsCheck = pkgs.runCommand "test-nixpkgs-check-by-name" { - nativeBuildInputs = [ - results.build - pkgs.nix - ]; - nixpkgsPath = nixpkgs; - } '' - ${initNix} - nixpkgs-check-by-name --base "$nixpkgsPath" "$nixpkgsPath" - touch $out - ''; + nixpkgsCheck = + pkgs.runCommand "test-nixpkgs-check-by-name" + { + nativeBuildInputs = [ + results.build + pkgs.nix + ]; + nixpkgsPath = nixpkgs; + } + '' + ${initNix} + nixpkgs-check-by-name --base "$nixpkgsPath" "$nixpkgsPath" + touch $out + ''; }; - in -results.build // results // { +results.build +// results +// { # Good for debugging inherit pkgs; diff --git a/npins/default.nix b/npins/default.nix index 4a7c372..ae29155 100644 --- a/npins/default.nix +++ b/npins/default.nix @@ -3,18 +3,32 @@ let data = builtins.fromJSON (builtins.readFile ./sources.json); version = data.version; - mkSource = spec: - assert spec ? type; let + mkSource = + spec: + assert spec ? type; + let path = - if spec.type == "Git" then mkGitSource spec - else if spec.type == "GitRelease" then mkGitSource spec - else if spec.type == "PyPi" then mkPyPiSource spec - else if spec.type == "Channel" then mkChannelSource spec - else builtins.throw "Unknown source type ${spec.type}"; + if spec.type == "Git" then + mkGitSource spec + else if spec.type == "GitRelease" then + mkGitSource spec + else if spec.type == "PyPi" then + mkPyPiSource spec + else if spec.type == "Channel" then + mkChannelSource spec + else + builtins.throw "Unknown source type ${spec.type}"; in spec // { outPath = path; }; - mkGitSource = { repository, revision, url ? null, hash, ... }: + mkGitSource = + { + repository, + revision, + url ? null, + hash, + ... + }: assert repository ? type; # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository # In the latter case, there we will always be an url to the tarball @@ -23,19 +37,23 @@ let inherit url; sha256 = hash; # FIXME: check nix version & use SRI hashes }) - else assert repository.type == "Git"; builtins.fetchGit { - url = repository.url; - rev = revision; - # hash = hash; - }; + else + assert repository.type == "Git"; + builtins.fetchGit { + url = repository.url; + rev = revision; + # hash = hash; + }; - mkPyPiSource = { url, hash, ... }: + mkPyPiSource = + { url, hash, ... }: builtins.fetchurl { inherit url; sha256 = hash; }; - mkChannelSource = { url, hash, ... }: + mkChannelSource = + { url, hash, ... }: builtins.fetchTarball { inherit url; sha256 = hash; diff --git a/package.nix b/package.nix index 84ca53d..479d99b 100644 --- a/package.nix +++ b/package.nix @@ -43,5 +43,4 @@ rustPlatform.buildRustPackage { wrapProgram $out/bin/nixpkgs-check-by-name \ --set NIX_CHECK_BY_NAME_EXPR_PATH "$NIX_CHECK_BY_NAME_EXPR_PATH" ''; - } diff --git a/src/eval.nix b/src/eval.nix index ab1c41e..5165c8c 100644 --- a/src/eval.nix +++ b/src/eval.nix @@ -2,10 +2,7 @@ # Returns a value containing information on all Nixpkgs attributes # which is decoded on the Rust side. # See ./eval.rs for the meaning of the returned values -{ - attrsPath, - nixpkgsPath, -}: +{ attrsPath, nixpkgsPath }: let attrs = builtins.fromJSON (builtins.readFile attrsPath); @@ -17,7 +14,8 @@ let overlay = final: prev: { # Adds information to each attribute about whether it's manually defined using `callPackage` - callPackage = fn: args: + callPackage = + fn: args: addVariantInfo (prev.callPackage fn args) { # This is a manual definition of the attribute, and it's a callPackage, specifically a semantic callPackage ManualDefinition.is_semantic_call_package = true; @@ -28,20 +26,16 @@ let # used by that overlay. # This overrides the above `callPackage` information (we don't need that # one, since `pkgs/by-name` always uses `callPackage` underneath. - _internalCallByNamePackageFile = file: - addVariantInfo (prev._internalCallByNamePackageFile file) { - AutoDefinition = null; - }; - + _internalCallByNamePackageFile = + file: addVariantInfo (prev._internalCallByNamePackageFile file) { AutoDefinition = null; }; }; # We can't just replace attribute values with their info in the overlay, # because attributes can depend on other attributes, so this would break evaluation. - addVariantInfo = value: variant: + addVariantInfo = + value: variant: if builtins.isAttrs value then - value // { - _callPackageVariant = variant; - } + value // { _callPackageVariant = variant; } else # It's very rare that callPackage doesn't return an attribute set, but it can occur. # In such a case we can't really return anything sensible that would include the info, @@ -61,14 +55,14 @@ let attrInfo = name: value: { location = builtins.unsafeGetAttrPos name pkgs; attribute_variant = - if ! builtins.isAttrs value then + if !builtins.isAttrs value then { NonAttributeSet = null; } else { AttributeSet = { is_derivation = pkgs.lib.isDerivation value; definition_variant = - if ! value ? _callPackageVariant then + if !value ? _callPackageVariant then { ManualDefinition.is_semantic_call_package = false; } else value._callPackageVariant; @@ -77,19 +71,22 @@ let }; # Information on all attributes that are in pkgs/by-name. - byNameAttrs = builtins.listToAttrs (map (name: { - inherit name; - value.ByName = - if ! pkgs ? ${name} then - { Missing = null; } - else - # Evaluation failures are not allowed, so don't try to catch them - { Existing = attrInfo name pkgs.${name}; }; - }) attrs); + byNameAttrs = builtins.listToAttrs ( + map (name: { + inherit name; + value.ByName = + if !pkgs ? ${name} then + { Missing = null; } + else + # Evaluation failures are not allowed, so don't try to catch them + { Existing = attrInfo name pkgs.${name}; }; + }) attrs + ); # Information on all attributes that exist but are not in pkgs/by-name. # We need this to enforce pkgs/by-name for new packages - nonByNameAttrs = builtins.mapAttrs (name: value: + nonByNameAttrs = builtins.mapAttrs ( + name: value: let # Packages outside `pkgs/by-name` often fail evaluation, # so we need to handle that @@ -97,11 +94,7 @@ let result = builtins.tryEval (builtins.deepSeq output null); in { - NonByName = - if result.success then - { EvalSuccess = output; } - else - { EvalFailure = null; }; + NonByName = if result.success then { EvalSuccess = output; } else { EvalFailure = null; }; } ) (builtins.removeAttrs pkgs attrs); diff --git a/tests/aliases/aliases.nix b/tests/aliases/aliases.nix index c70ec23..fd9a09c 100644 --- a/tests/aliases/aliases.nix +++ b/tests/aliases/aliases.nix @@ -1,3 +1 @@ -self: super: { - baz = self.foo; -} +self: super: { baz = self.foo; } diff --git a/tests/aliases/pkgs/top-level/all-packages.nix b/tests/aliases/pkgs/top-level/all-packages.nix index 2cdfcef..c16f435 100644 --- a/tests/aliases/pkgs/top-level/all-packages.nix +++ b/tests/aliases/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - bar = self.foo; -} +self: super: { bar = self.foo; } diff --git a/tests/alt-callPackage/pkgs/top-level/all-packages.nix b/tests/alt-callPackage/pkgs/top-level/all-packages.nix index 399f8ee..a763d3b 100644 --- a/tests/alt-callPackage/pkgs/top-level/all-packages.nix +++ b/tests/alt-callPackage/pkgs/top-level/all-packages.nix @@ -1,7 +1,6 @@ self: super: { - alt.callPackage = self.lib.callPackageWith {}; + alt.callPackage = self.lib.callPackageWith { }; foo = self.alt.callPackage ({ }: self.someDrv) { }; - } diff --git a/tests/broken-autocall/default.nix b/tests/broken-autocall/default.nix index bd4825f..840ae1e 100644 --- a/tests/broken-autocall/default.nix +++ b/tests/broken-autocall/default.nix @@ -1,4 +1 @@ -args: -builtins.removeAttrs - (import { root = ./.; } args) - [ "foo" ] +args: builtins.removeAttrs (import { root = ./.; } args) [ "foo" ] diff --git a/tests/by-name-failure/pkgs/by-name/fo/foo/package.nix b/tests/by-name-failure/pkgs/by-name/fo/foo/package.nix index 8a1fd7a..51081b0 100644 --- a/tests/by-name-failure/pkgs/by-name/fo/foo/package.nix +++ b/tests/by-name-failure/pkgs/by-name/fo/foo/package.nix @@ -1,4 +1,3 @@ { }: # If we caused an actual Nix failure -builtins.trace "This should be on stderr!" -throw "This is an error!" +builtins.trace "This should be on stderr!" throw "This is an error!" diff --git a/tests/callPackage-syntax/pkgs/top-level/all-packages.nix b/tests/callPackage-syntax/pkgs/top-level/all-packages.nix index 306d719..2651346 100644 --- a/tests/callPackage-syntax/pkgs/top-level/all-packages.nix +++ b/tests/callPackage-syntax/pkgs/top-level/all-packages.nix @@ -1,7 +1,10 @@ self: super: { - set = self.callPackages ({ callPackage }: { - foo = callPackage ({ someDrv }: someDrv) { }; - }) { }; + set = self.callPackages ( + { callPackage }: + { + foo = callPackage ({ someDrv }: someDrv) { }; + } + ) { }; inherit (self.set) foo; } diff --git a/tests/mock-nixpkgs.nix b/tests/mock-nixpkgs.nix index bba84db..d67846d 100644 --- a/tests/mock-nixpkgs.nix +++ b/tests/mock-nixpkgs.nix @@ -1,24 +1,22 @@ /* -This file returns a mocked version of Nixpkgs' default.nix for testing purposes. -It does not depend on Nixpkgs itself for the sake of simplicity. + This file returns a mocked version of Nixpkgs' default.nix for testing purposes. + It does not depend on Nixpkgs itself for the sake of simplicity. -It takes one attribute as an argument: -- `root`: The root of Nixpkgs to read other files from, including: - - `./pkgs/by-name`: The `pkgs/by-name` directory to test - - `./all-packages.nix`: A file containing an overlay to mirror the real `pkgs/top-level/all-packages.nix`. - This allows adding overrides on top of the auto-called packages in `pkgs/by-name`. + It takes one attribute as an argument: + - `root`: The root of Nixpkgs to read other files from, including: + - `./pkgs/by-name`: The `pkgs/by-name` directory to test + - `./all-packages.nix`: A file containing an overlay to mirror the real `pkgs/top-level/all-packages.nix`. + This allows adding overrides on top of the auto-called packages in `pkgs/by-name`. -It returns a Nixpkgs-like function that can be auto-called and evaluates to an attribute set. + It returns a Nixpkgs-like function that can be auto-called and evaluates to an attribute set. */ -{ - root, -}: +{ root }: # The arguments for the Nixpkgs function { # Passed by the checker to modify `callPackage` - overlays ? [], + overlays ? [ ], # Passed by the checker to make sure a real Nixpkgs isn't influenced by impurities - config ? {}, + config ? { }, # Passed by the checker to make sure a real Nixpkgs isn't influenced by impurities system ? null, }: @@ -29,7 +27,8 @@ let # The base fixed-point function to populate the resulting attribute set pkgsFun = - self: { + self: + { inherit lib; newScope = extra: lib.callPackageWith (self // extra); callPackage = self.newScope { }; @@ -42,7 +41,9 @@ let # By using `mapAttrs`, `builtins.unsafeGetAttrPos` just returns `null`, # which then doesn't trigger this check // lib.mapAttrs (name: value: value) { - someDrv = { type = "derivation"; }; + someDrv = { + type = "derivation"; + }; }; baseDirectory = root + "/pkgs/by-name"; @@ -53,31 +54,27 @@ let let entries = builtins.readDir baseDirectory; - namesForShard = shard: + namesForShard = + shard: if entries.${shard} != "directory" then # Only README.md is allowed to be a file, but it's not this code's job to check for that { } else - builtins.mapAttrs - (name: _: baseDirectory + "/${shard}/${name}/package.nix") - (builtins.readDir (baseDirectory + "/${shard}")); - + builtins.mapAttrs (name: _: baseDirectory + "/${shard}/${name}/package.nix") ( + builtins.readDir (baseDirectory + "/${shard}") + ); in - builtins.foldl' - (acc: el: acc // el) - { } - (map namesForShard (builtins.attrNames entries)); + builtins.foldl' (acc: el: acc // el) { } (map namesForShard (builtins.attrNames entries)); # Turns autoCalledPackageFiles into an overlay that `callPackage`'s all of them - autoCalledPackages = self: super: + autoCalledPackages = + self: super: { # Needed to be able to detect empty arguments in all-packages.nix # See a more detailed description in pkgs/top-level/by-name-overlay.nix _internalCallByNamePackageFile = file: self.callPackage file { }; } - // builtins.mapAttrs - (name: self._internalCallByNamePackageFile) - autoCalledPackageFiles; + // builtins.mapAttrs (name: self._internalCallByNamePackageFile) autoCalledPackageFiles; # A list optionally containing the `all-packages.nix` file from the test case as an overlay optionalAllPackagesOverlay = @@ -95,13 +92,9 @@ let [ ]; # All the overlays in the right order, including the user-supplied ones - allOverlays = - [ - autoCalledPackages - ] - ++ optionalAllPackagesOverlay - ++ optionalAliasesOverlay - ++ overlays; + allOverlays = [ + autoCalledPackages + ] ++ optionalAllPackagesOverlay ++ optionalAliasesOverlay ++ overlays; # Apply all the overlays in order to the base fixed-point function pkgsFun f = builtins.foldl' (f: overlay: lib.extends overlay f) pkgsFun allOverlays; diff --git a/tests/move-to-non-by-name/pkgs/top-level/all-packages.nix b/tests/move-to-non-by-name/pkgs/top-level/all-packages.nix index cc25378..e01073a 100644 --- a/tests/move-to-non-by-name/pkgs/top-level/all-packages.nix +++ b/tests/move-to-non-by-name/pkgs/top-level/all-packages.nix @@ -1,10 +1,6 @@ self: super: { foo1 = self.callPackage ({ someDrv }: someDrv) { }; foo2 = self.callPackage ./../../without-config.nix { }; - foo3 = self.callPackage ({ someDrv, enableFoo }: someDrv) { - enableFoo = null; - }; - foo4 = self.callPackage ./../../with-config.nix { - enableFoo = null; - }; + foo3 = self.callPackage ({ someDrv, enableFoo }: someDrv) { enableFoo = null; }; + foo4 = self.callPackage ./../../with-config.nix { enableFoo = null; }; } diff --git a/tests/multiple-failures/pkgs/by-name/ba/foo/package.nix b/tests/multiple-failures/pkgs/by-name/ba/foo/package.nix index 31b4742..90352b2 100644 --- a/tests/multiple-failures/pkgs/by-name/ba/foo/package.nix +++ b/tests/multiple-failures/pkgs/by-name/ba/foo/package.nix @@ -1,4 +1,6 @@ -{ someDrv }: someDrv // { +{ someDrv }: +someDrv +// { escapeAbsolute = /bar; escapeRelative = ../.; nixPath = ; diff --git a/tests/new-package-non-by-name/base/pkgs/top-level/all-packages.nix b/tests/new-package-non-by-name/base/pkgs/top-level/all-packages.nix index c2665d0..ca0b783 100644 --- a/tests/new-package-non-by-name/base/pkgs/top-level/all-packages.nix +++ b/tests/new-package-non-by-name/base/pkgs/top-level/all-packages.nix @@ -1,5 +1,4 @@ self: super: { before = self.callPackage ({ someDrv }: someDrv) { }; - } diff --git a/tests/new-package-non-by-name/pkgs/top-level/all-packages.nix b/tests/new-package-non-by-name/pkgs/top-level/all-packages.nix index 2e5be38..ecae9e1 100644 --- a/tests/new-package-non-by-name/pkgs/top-level/all-packages.nix +++ b/tests/new-package-non-by-name/pkgs/top-level/all-packages.nix @@ -2,10 +2,6 @@ self: super: { before = self.callPackage ({ someDrv }: someDrv) { }; new1 = self.callPackage ({ someDrv }: someDrv) { }; new2 = self.callPackage ./../../without-config.nix { }; - new3 = self.callPackage ({ someDrv, enableNew }: someDrv) { - enableNew = null; - }; - new4 = self.callPackage ./../../with-config.nix { - enableNew = null; - }; + new3 = self.callPackage ({ someDrv, enableNew }: someDrv) { enableNew = null; }; + new4 = self.callPackage ./../../with-config.nix { enableNew = null; }; } diff --git a/tests/no-eval/base/pkgs/top-level/all-packages.nix b/tests/no-eval/base/pkgs/top-level/all-packages.nix index ac763b4..934d1e6 100644 --- a/tests/no-eval/base/pkgs/top-level/all-packages.nix +++ b/tests/no-eval/base/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - futureEval = throw "foo"; -} +self: super: { futureEval = throw "foo"; } diff --git a/tests/non-by-name-trace/pkgs/top-level/all-packages.nix b/tests/non-by-name-trace/pkgs/top-level/all-packages.nix index e293a33..998451e 100644 --- a/tests/non-by-name-trace/pkgs/top-level/all-packages.nix +++ b/tests/non-by-name-trace/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - foo = self.lib.warn "foo should not be used anymore" null; -} +self: super: { foo = self.lib.warn "foo should not be used anymore" null; } diff --git a/tests/non-syntactical-callPackage-by-name/pkgs/top-level/all-packages.nix b/tests/non-syntactical-callPackage-by-name/pkgs/top-level/all-packages.nix index 7c0e55f..0a55d9c 100644 --- a/tests/non-syntactical-callPackage-by-name/pkgs/top-level/all-packages.nix +++ b/tests/non-syntactical-callPackage-by-name/pkgs/top-level/all-packages.nix @@ -2,5 +2,4 @@ self: super: { bar = (x: x) self.callPackage ./../by-name/fo/foo/package.nix { someFlag = true; }; foo = self.bar; - } diff --git a/tests/only-callPackage-derivations/pkgs/top-level/all-packages.nix b/tests/only-callPackage-derivations/pkgs/top-level/all-packages.nix index 5b1ed9d..ce3842d 100644 --- a/tests/only-callPackage-derivations/pkgs/top-level/all-packages.nix +++ b/tests/only-callPackage-derivations/pkgs/top-level/all-packages.nix @@ -1,5 +1,6 @@ self: super: { - alternateCallPackage = self.myScope.callPackage ({ myScopeValue, someDrv }: + alternateCallPackage = self.myScope.callPackage ( + { myScopeValue, someDrv }: assert myScopeValue; someDrv ) { }; @@ -8,9 +9,12 @@ self: super: { myScopeValue = true; }); - myPackages = self.callPackages ({ someDrv }: { - a = someDrv; - b = someDrv; - }) { }; + myPackages = self.callPackages ( + { someDrv }: + { + a = someDrv; + b = someDrv; + } + ) { }; inherit (self.myPackages) a b; } diff --git a/tests/override-different-file/pkgs/top-level/all-packages.nix b/tests/override-different-file/pkgs/top-level/all-packages.nix index e196d26..da92b68 100644 --- a/tests/override-different-file/pkgs/top-level/all-packages.nix +++ b/tests/override-different-file/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - nonDerivation = self.callPackage ./../../someDrv.nix { }; -} +self: super: { nonDerivation = self.callPackage ./../../someDrv.nix { }; } diff --git a/tests/override-empty-arg-gradual/base/pkgs/top-level/all-packages.nix b/tests/override-empty-arg-gradual/base/pkgs/top-level/all-packages.nix index eaf7e92..ebe25d3 100644 --- a/tests/override-empty-arg-gradual/base/pkgs/top-level/all-packages.nix +++ b/tests/override-empty-arg-gradual/base/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - nonDerivation = self.callPackage ./../by-name/no/nonDerivation/package.nix { }; -} +self: super: { nonDerivation = self.callPackage ./../by-name/no/nonDerivation/package.nix { }; } diff --git a/tests/override-empty-arg-gradual/pkgs/top-level/all-packages.nix b/tests/override-empty-arg-gradual/pkgs/top-level/all-packages.nix index eaf7e92..ebe25d3 100644 --- a/tests/override-empty-arg-gradual/pkgs/top-level/all-packages.nix +++ b/tests/override-empty-arg-gradual/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - nonDerivation = self.callPackage ./../by-name/no/nonDerivation/package.nix { }; -} +self: super: { nonDerivation = self.callPackage ./../by-name/no/nonDerivation/package.nix { }; } diff --git a/tests/override-empty-arg/pkgs/top-level/all-packages.nix b/tests/override-empty-arg/pkgs/top-level/all-packages.nix index eaf7e92..ebe25d3 100644 --- a/tests/override-empty-arg/pkgs/top-level/all-packages.nix +++ b/tests/override-empty-arg/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - nonDerivation = self.callPackage ./../by-name/no/nonDerivation/package.nix { }; -} +self: super: { nonDerivation = self.callPackage ./../by-name/no/nonDerivation/package.nix { }; } diff --git a/tests/override-no-call-package/pkgs/top-level/all-packages.nix b/tests/override-no-call-package/pkgs/top-level/all-packages.nix index 853c3a8..4c4a39b 100644 --- a/tests/override-no-call-package/pkgs/top-level/all-packages.nix +++ b/tests/override-no-call-package/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - nonDerivation = self.someDrv; -} +self: super: { nonDerivation = self.someDrv; } diff --git a/tests/override-no-file/pkgs/top-level/all-packages.nix b/tests/override-no-file/pkgs/top-level/all-packages.nix index dc07f69..cec4a2b 100644 --- a/tests/override-no-file/pkgs/top-level/all-packages.nix +++ b/tests/override-no-file/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - nonDerivation = self.callPackage ({ someDrv }: someDrv) { }; -} +self: super: { nonDerivation = self.callPackage ({ someDrv }: someDrv) { }; } diff --git a/tests/override-non-path/pkgs/top-level/all-packages.nix b/tests/override-non-path/pkgs/top-level/all-packages.nix index f07e7a4..992ffb3 100644 --- a/tests/override-non-path/pkgs/top-level/all-packages.nix +++ b/tests/override-non-path/pkgs/top-level/all-packages.nix @@ -1,5 +1,4 @@ self: super: { foo = self.callPackage ({ someDrv, someFlag }: someDrv) { someFlag = true; }; - } diff --git a/tests/override-success/pkgs/by-name/fo/foo/package.nix b/tests/override-success/pkgs/by-name/fo/foo/package.nix index c811a72..72cbf0a 100644 --- a/tests/override-success/pkgs/by-name/fo/foo/package.nix +++ b/tests/override-success/pkgs/by-name/fo/foo/package.nix @@ -2,7 +2,4 @@ someDrv, enableBar ? false, }: -if enableBar then - someDrv -else - {} +if enableBar then someDrv else { } diff --git a/tests/override-success/pkgs/top-level/all-packages.nix b/tests/override-success/pkgs/top-level/all-packages.nix index bf01a4b..7777132 100644 --- a/tests/override-success/pkgs/top-level/all-packages.nix +++ b/tests/override-success/pkgs/top-level/all-packages.nix @@ -1,5 +1 @@ -self: super: { - foo = self.callPackage ./../by-name/fo/foo/package.nix { - enableBar = true; - }; -} +self: super: { foo = self.callPackage ./../by-name/fo/foo/package.nix { enableBar = true; }; } diff --git a/tests/package-variants/base/pkgs/top-level/all-packages.nix b/tests/package-variants/base/pkgs/top-level/all-packages.nix index d786f73..c187f10 100644 --- a/tests/package-variants/base/pkgs/top-level/all-packages.nix +++ b/tests/package-variants/base/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: { - foo-variant-unvarianted = self.callPackage ./../by-name/fo/foo/package.nix { }; -} +self: super: { foo-variant-unvarianted = self.callPackage ./../by-name/fo/foo/package.nix { }; } diff --git a/tests/ref-absolute/pkgs/by-name/aa/aa/package.nix b/tests/ref-absolute/pkgs/by-name/aa/aa/package.nix index 7a51ba1..ae97501 100644 --- a/tests/ref-absolute/pkgs/by-name/aa/aa/package.nix +++ b/tests/ref-absolute/pkgs/by-name/aa/aa/package.nix @@ -1,3 +1 @@ -{ someDrv }: someDrv // { - escape = /foo; -} +{ someDrv }: someDrv // { escape = /foo; } diff --git a/tests/ref-escape/pkgs/by-name/aa/aa/package.nix b/tests/ref-escape/pkgs/by-name/aa/aa/package.nix index 5989f52..7a7927a 100644 --- a/tests/ref-escape/pkgs/by-name/aa/aa/package.nix +++ b/tests/ref-escape/pkgs/by-name/aa/aa/package.nix @@ -1,3 +1 @@ -{ someDrv }: someDrv // { - escape = ../.; -} +{ someDrv }: someDrv // { escape = ../.; } diff --git a/tests/ref-nix-path/pkgs/by-name/aa/aa/package.nix b/tests/ref-nix-path/pkgs/by-name/aa/aa/package.nix index 864fdce..1205c5b 100644 --- a/tests/ref-nix-path/pkgs/by-name/aa/aa/package.nix +++ b/tests/ref-nix-path/pkgs/by-name/aa/aa/package.nix @@ -1,3 +1 @@ -{ someDrv }: someDrv // { - nixPath = ; -} +{ someDrv }: someDrv // { nixPath = ; } diff --git a/tests/ref-path-subexpr/pkgs/by-name/aa/aa/package.nix b/tests/ref-path-subexpr/pkgs/by-name/aa/aa/package.nix index a94ba75..8af0f3b 100644 --- a/tests/ref-path-subexpr/pkgs/by-name/aa/aa/package.nix +++ b/tests/ref-path-subexpr/pkgs/by-name/aa/aa/package.nix @@ -1,3 +1 @@ -{ someDrv }: someDrv // { - pathWithSubexpr = ./${"test"}; -} +{ someDrv }: someDrv // { pathWithSubexpr = ./${"test"}; } diff --git a/tests/ref-success/pkgs/by-name/aa/aa/package.nix b/tests/ref-success/pkgs/by-name/aa/aa/package.nix index 474db5b..2660f9a 100644 --- a/tests/ref-success/pkgs/by-name/aa/aa/package.nix +++ b/tests/ref-success/pkgs/by-name/aa/aa/package.nix @@ -1,4 +1,6 @@ -{ someDrv }: someDrv // { +{ someDrv }: +someDrv +// { nixFile = ./file.nix; nonNixFile = ./file; directory = ./dir; diff --git a/tests/unknown-location/pkgs/top-level/all-packages.nix b/tests/unknown-location/pkgs/top-level/all-packages.nix index 3398e97..7349781 100644 --- a/tests/unknown-location/pkgs/top-level/all-packages.nix +++ b/tests/unknown-location/pkgs/top-level/all-packages.nix @@ -1,3 +1 @@ -self: super: builtins.mapAttrs (name: value: value) { - foo = self.someDrv; -} +self: super: builtins.mapAttrs (name: value: value) { foo = self.someDrv; }