mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-09-11 14:35:30 +03:00
dix dream-lock formatting in makeTranslateScript
This commit is contained in:
parent
dac0e8dba9
commit
058bc6cf9b
@ -152,11 +152,13 @@ let
|
||||
coreutils
|
||||
jq
|
||||
nix
|
||||
python3
|
||||
]
|
||||
''
|
||||
jsonInputFile=$(realpath $1)
|
||||
outputFile=$WORKDIR/$(jq '.outputFile' -c -r $jsonInputFile)
|
||||
|
||||
cd $WORKDIR
|
||||
mkdir -p $(dirname $outputFile)
|
||||
|
||||
nix eval \
|
||||
@ -180,7 +182,7 @@ let
|
||||
(dreamLock // {
|
||||
_generic = builtins.removeAttrs dreamLock._generic [ \"cyclicDependencies\" ];
|
||||
})
|
||||
" | jq > $outputFile
|
||||
" | python3 ${../apps/cli2/format-dream-lock.py} > $outputFile
|
||||
'';
|
||||
in
|
||||
bin.overrideAttrs (old: {
|
||||
|
@ -3,9 +3,12 @@
|
||||
coreutils,
|
||||
dlib,
|
||||
fetchzip,
|
||||
gitMinimal,
|
||||
jq,
|
||||
lib,
|
||||
nix,
|
||||
pkgs,
|
||||
python3,
|
||||
runCommand,
|
||||
stdenv,
|
||||
writeScript,
|
||||
@ -185,21 +188,29 @@ overrideUtils
|
||||
in
|
||||
writePureShellScriptBin "resolve"
|
||||
[
|
||||
pkgs.coreutils
|
||||
pkgs.jq
|
||||
pkgs.gitMinimal
|
||||
pkgs.nix
|
||||
coreutils
|
||||
jq
|
||||
gitMinimal
|
||||
nix
|
||||
python3
|
||||
]
|
||||
''
|
||||
dreamLockPath=${project.dreamLockPath}
|
||||
|
||||
cd $WORKDIR
|
||||
${translator.translateBin} ${argsJsonFile}
|
||||
|
||||
# add invalidationHash to dream-lock.json
|
||||
cp ${project.dreamLockPath} ${project.dreamLockPath}.tmp
|
||||
cat ${project.dreamLockPath}.tmp \
|
||||
cp $dreamLockPath $dreamLockPath.tmp
|
||||
cat $dreamLockPath \
|
||||
| jq '._generic.invalidationHash = "${invalidationHash}"' \
|
||||
> ${project.dreamLockPath}
|
||||
rm ${project.dreamLockPath}.tmp
|
||||
> $dreamLockPath.tmp
|
||||
|
||||
cat $dreamLockPath.tmp \
|
||||
| python3 ${../apps/cli2/format-dream-lock.py} \
|
||||
> $dreamLockPath
|
||||
|
||||
rm $dreamLockPath.tmp
|
||||
|
||||
# add dream-lock.json to git
|
||||
if git rev-parse --show-toplevel &>/dev/null; then
|
||||
|
Loading…
Reference in New Issue
Block a user