mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
Formatting
This commit is contained in:
parent
117d671923
commit
9d0c3dd6a7
2 changed files with 24 additions and 31 deletions
44
flake.nix
44
flake.nix
|
@ -310,27 +310,31 @@
|
||||||
|
|
||||||
closures = forAllSystems (system: self.packages.${system}.default.outPath);
|
closures = forAllSystems (system: self.packages.${system}.default.outPath);
|
||||||
|
|
||||||
closures_json = pkgs.runCommand "versions.json"
|
closures_json =
|
||||||
{
|
pkgs.runCommand "versions.json"
|
||||||
buildInputs = [ pkgs.jq ];
|
{
|
||||||
passAsFile = [ "json" ];
|
buildInputs = [ pkgs.jq ];
|
||||||
json = builtins.toJSON closures;
|
passAsFile = [ "json" ];
|
||||||
} ''
|
json = builtins.toJSON closures;
|
||||||
cat "$jsonPath" | jq . > $out
|
}
|
||||||
'';
|
''
|
||||||
|
cat "$jsonPath" | jq . > $out
|
||||||
closures_nix = pkgs.runCommand "versions.nix"
|
'';
|
||||||
{
|
|
||||||
buildInputs = [ pkgs.jq ];
|
closures_nix =
|
||||||
passAsFile = [ "template" ];
|
pkgs.runCommand "versions.nix"
|
||||||
jsonPath = closures_json;
|
{
|
||||||
template = ''
|
buildInputs = [ pkgs.jq ];
|
||||||
builtins.fromJSON('''@closures@''')
|
passAsFile = [ "template" ];
|
||||||
|
jsonPath = closures_json;
|
||||||
|
template = ''
|
||||||
|
builtins.fromJSON('''@closures@''')
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
''
|
||||||
|
export closures=$(cat "$jsonPath");
|
||||||
|
substituteAll "$templatePath" "$out"
|
||||||
'';
|
'';
|
||||||
} ''
|
|
||||||
export closures=$(cat "$jsonPath");
|
|
||||||
substituteAll "$templatePath" "$out"
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
closures_nix;
|
closures_nix;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,17 +50,6 @@ let
|
||||||
exts: userFn: stdenv.mkDerivation (lib.extends (lib.composeManyExtensions exts) userFn);
|
exts: userFn: stdenv.mkDerivation (lib.extends (lib.composeManyExtensions exts) userFn);
|
||||||
|
|
||||||
setVersionLayer = finalAttrs: prevAttrs: {
|
setVersionLayer = finalAttrs: prevAttrs: {
|
||||||
/*
|
|
||||||
preConfigure =
|
|
||||||
prevAttrs.preConfigure or ""
|
|
||||||
+
|
|
||||||
# Update the repo-global .version file.
|
|
||||||
# Symlink ./.version points there, but by default only workDir is writable.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${finalAttrs.version} > ./.version
|
|
||||||
'';
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
localSourceLayer =
|
localSourceLayer =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue