Merge pull request #217 from wmertens/some-fixes

Some fixes
This commit is contained in:
DavHau 2022-08-04 14:34:26 +02:00 committed by GitHub
commit 7a6fb28770
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 29 additions and 61 deletions

View File

@ -153,22 +153,6 @@
"type": "indirect"
}
},
"node2nix": {
"flake": false,
"locked": {
"lastModified": 1634916276,
"narHash": "sha256-lov2b/8ydYjq+MhKQugmWV2lFnq35AU5RTRBTfLq7B4=",
"owner": "svanderburg",
"repo": "node2nix",
"rev": "644e90c0304038a446ed53efc97e9eb1e2831e71",
"type": "github"
},
"original": {
"owner": "svanderburg",
"repo": "node2nix",
"type": "github"
}
},
"poetry2nix": {
"flake": false,
"locked": {
@ -218,7 +202,6 @@
"gomod2nix": "gomod2nix",
"mach-nix": "mach-nix",
"nixpkgs": "nixpkgs",
"node2nix": "node2nix",
"poetry2nix": "poetry2nix",
"pre-commit-hooks": "pre-commit-hooks"
}

View File

@ -37,12 +37,6 @@
flake = false;
};
# required for builder nodejs/node2nix
node2nix = {
url = "github:svanderburg/node2nix";
flake = false;
};
# required for utils.satisfiesSemver
poetry2nix = {
url = "github:nix-community/poetry2nix/1.21.0";
@ -63,7 +57,6 @@
gomod2nix,
mach-nix,
nixpkgs,
node2nix,
poetry2nix,
pre-commit-hooks,
crane,
@ -94,10 +87,6 @@
"lib/extractor/setuptools.patch"
"LICENSE"
];
node2nix = [
"nix/node-env.nix"
"LICENSE"
];
poetry2nix = [
"semver.nix"
"LICENSE"

View File

@ -90,10 +90,6 @@ in let
subsystems = callPackageDream ./subsystems {};
externals = {
node2nix = nodejs:
pkgs.callPackage "${externalSources.node2nix}/nix/node-env.nix" {
inherit nodejs;
};
crane = let
importLibFile = name: import "${externalSources.crane}/lib/${name}.nix";
@ -107,16 +103,19 @@ in let
cargoHostTarget,
cargoBuildBuild,
}: rec {
otherHooks = genHooks [
"configureCargoCommonVarsHook"
"configureCargoVendoredDepsHook"
"remapSourcePathPrefixHook"
] {};
otherHooks =
genHooks [
"configureCargoCommonVarsHook"
"configureCargoVendoredDepsHook"
"remapSourcePathPrefixHook"
]
{};
installHooks =
genHooks [
"inheritCargoArtifactsHook"
"installCargoArtifactsHook"
] {
]
{
substitutions = {
zstd = "${pkgs.pkgsBuildBuild.zstd}/bin/zstd";
};
@ -188,7 +187,7 @@ in let
if b.pathExists (./. + "/external")
then ./.
else
pkgs.runCommand "dream2nix-full-src" {} ''
pkgs.runCommandLocal "dream2nix-full-src" {} ''
cp -r ${./.} $out
chmod +w $out
mkdir $out/external
@ -611,11 +610,7 @@ in let
impureDiscoveredProjects =
l.filter
(proj:
subsystems
."${proj.subsystem}"
.translators
."${proj.translator}"
.type
subsystems."${proj.subsystem}".translators."${proj.translator}".type
== "impure")
discoveredProjects;

View File

@ -5,7 +5,7 @@
outputs = {
fetchurl,
runCommand,
runCommandLocal,
utils,
...
}: {
@ -29,7 +29,7 @@
name = "download-${pname}-${version}";
};
in
runCommand "unpack-${pname}-${version}" {}
runCommandLocal "unpack-${pname}-${version}" {}
''
mkdir -p $out
tar --strip-components 1 -xzf ${fetched} -C $out

View File

@ -39,7 +39,7 @@ in {
} @ args: let
b = builtins;
all-cabal-hashes = pkgs.runCommand "all-cabal-hashes" {} ''
all-cabal-hashes = pkgs.runCommandLocal "all-cabal-hashes" {} ''
mkdir $out
cd $out
tar --strip-components 1 -xf ${pkgs.all-cabal-hashes}

View File

@ -79,7 +79,7 @@ in {
}: let
haskellUtils = import ./utils.nix {inherit dlib lib pkgs;};
all-cabal-hashes = let
all-cabal-hashes' = pkgs.runCommand "all-cabal-hashes" {} ''
all-cabal-hashes' = pkgs.runCommandLocal "all-cabal-hashes" {} ''
mkdir $out
cd $out
tar --strip-components 1 -xf ${pkgs.all-cabal-hashes}

View File

@ -10,7 +10,7 @@
sha256 = "1qc703yg0babixi6wshn5wm2kgl5y1drcswgszh4xxzbrwkk9sv7";
});
in rec {
all-cabal-hashes = pkgs.runCommand "all-cabal-hashes" {} ''
all-cabal-hashes = pkgs.runCommandLocal "all-cabal-hashes" {} ''
mkdir $out
cd $out
tar --strip-components 1 -xf ${pkgs.all-cabal-hashes}
@ -22,7 +22,7 @@ in rec {
# parse cabal file via IFD
fromCabal = file: name: let
file' = l.path {path = file;};
jsonFile = pkgs.runCommand "${name}.cabal.json" {} ''
jsonFile = pkgs.runCommandLocal "${name}.cabal.json" {} ''
${cabal2json}/bin/cabal2json ${file'} > $out
'';
in
@ -31,7 +31,7 @@ in rec {
# fromYaml IFD implementation
fromYaml = file: let
file' = l.path {path = file;};
jsonFile = pkgs.runCommand "yaml.json" {} ''
jsonFile = pkgs.runCommandLocal "yaml.json" {} ''
${pkgs.yaml2json}/bin/yaml2json < ${file'} > $out
'';
in
@ -54,7 +54,7 @@ in rec {
fi
'';
in
pkgs.runCommand "cabal-json-files" {}
pkgs.runCommandLocal "cabal-json-files" {}
(l.concatStringsSep "\n"
(l.map (c: convertOne c.name c.version) candidates));

View File

@ -8,7 +8,7 @@
mkShell,
pkgs,
python3,
runCommand,
runCommandLocal,
stdenv,
writeText,
...
@ -49,7 +49,7 @@
pkgs."nodejs-${builtins.toString nodejsVersion}_x"
or (throw "Could not find nodejs version '${nodejsVersion}' in pkgs");
nodeSources = runCommand "node-sources" {} ''
nodeSources = runCommandLocal "node-sources" {} ''
tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
mv node-* $out
'';
@ -171,7 +171,7 @@
# Derivation building the ./node_modules directory in isolation.
# This is used for the devShell of the current package.
# We do not want to build the full package for the devShell.
nodeModulesDir = pkgs.runCommand "node_modules-${pname}" {} ''
nodeModulesDir = pkgs.runCommandLocal "node_modules-${pname}" {} ''
# symlink direct dependencies to ./node_modules
mkdir $out
${l.concatStringsSep "\n" (

View File

@ -85,7 +85,7 @@ in rec {
${l.optionalString isGit "printf '{\"files\":{},\"package\":null}' > \"$out/${source.name}/.cargo-checksum.json\""}
'';
in
pkgs.runCommand "vendor" {} ''
pkgs.runCommandLocal "vendor" {} ''
mkdir -p $out
${

View File

@ -10,7 +10,7 @@
nix,
pkgs,
python3,
runCommand,
runCommandLocal,
stdenv,
writeScript,
writeScriptBin,
@ -72,13 +72,13 @@ in
inherit (dreamLockUtils) readDreamLock;
toDrv = path: runCommand "some-drv" {} "cp -r ${path} $out";
toDrv = path: runCommandLocal "some-drv" {} "cp -r ${path} $out";
toTOML = import ./toTOML.nix {inherit lib;};
# hash the contents of a path via `nix hash path`
hashPath = algo: path: let
hashPath = runCommand "hash-${algo}" {} ''
hashPath = runCommandLocal "hash-${algo}" {} ''
${nix}/bin/nix --option experimental-features nix-command hash path ${path} | tr --delete '\n' > $out
'';
in
@ -86,7 +86,7 @@ in
# hash a file via `nix hash file`
hashFile = algo: path: let
hashFile = runCommand "hash-${algo}" {} ''
hashFile = runCommandLocal "hash-${algo}" {} ''
${nix}/bin/nix --option experimental-features nix-command hash file ${path} | tr --delete '\n' > $out
'';
in
@ -130,6 +130,7 @@ in
${coreutils}/bin/rm -rf $TMPDIR
'';
# TODO is this really needed? Seems to make builds slower, why not unpack + build?
extractSource = {
source,
dir ? "",

View File

@ -4,7 +4,7 @@
externalSources,
externalPaths,
}:
pkgs.runCommand "dream2nix-external-dir" {}
pkgs.runCommandLocal "dream2nix-external-dir" {}
(lib.concatStringsSep "\n"
(lib.mapAttrsToList
(inputName: paths: