mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +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_json = pkgs.runCommand "versions.json"
|
||||
{
|
||||
buildInputs = [ pkgs.jq ];
|
||||
passAsFile = [ "json" ];
|
||||
json = builtins.toJSON closures;
|
||||
} ''
|
||||
cat "$jsonPath" | jq . > $out
|
||||
'';
|
||||
|
||||
closures_nix = pkgs.runCommand "versions.nix"
|
||||
{
|
||||
buildInputs = [ pkgs.jq ];
|
||||
passAsFile = [ "template" ];
|
||||
jsonPath = closures_json;
|
||||
template = ''
|
||||
builtins.fromJSON('''@closures@''')
|
||||
closures_json =
|
||||
pkgs.runCommand "versions.json"
|
||||
{
|
||||
buildInputs = [ pkgs.jq ];
|
||||
passAsFile = [ "json" ];
|
||||
json = builtins.toJSON closures;
|
||||
}
|
||||
''
|
||||
cat "$jsonPath" | jq . > $out
|
||||
'';
|
||||
|
||||
closures_nix =
|
||||
pkgs.runCommand "versions.nix"
|
||||
{
|
||||
buildInputs = [ pkgs.jq ];
|
||||
passAsFile = [ "template" ];
|
||||
jsonPath = closures_json;
|
||||
template = ''
|
||||
builtins.fromJSON('''@closures@''')
|
||||
'';
|
||||
}
|
||||
''
|
||||
export closures=$(cat "$jsonPath");
|
||||
substituteAll "$templatePath" "$out"
|
||||
'';
|
||||
} ''
|
||||
export closures=$(cat "$jsonPath");
|
||||
substituteAll "$templatePath" "$out"
|
||||
'';
|
||||
in
|
||||
closures_nix;
|
||||
}
|
||||
|
|
|
@ -50,17 +50,6 @@ let
|
|||
exts: userFn: stdenv.mkDerivation (lib.extends (lib.composeManyExtensions exts) userFn);
|
||||
|
||||
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 =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue