mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-09-11 14:35:30 +03:00
commit
730d42598e
@ -53,7 +53,7 @@
|
||||
// {
|
||||
isOriginal = false;
|
||||
outPath = let
|
||||
sanitizedName = utils.sanitizeDerivationName name;
|
||||
sanitizedName = l.strings.sanitizeDerivationName name;
|
||||
in "${sanitizedName}/${version}/${fetched.name}";
|
||||
}
|
||||
# handle already extracted sources
|
||||
@ -63,7 +63,7 @@
|
||||
// {
|
||||
isOriginal = true;
|
||||
outPath = let
|
||||
sanitizedName = utils.sanitizeDerivationName name;
|
||||
sanitizedName = l.strings.sanitizeDerivationName name;
|
||||
in "${sanitizedName}/${version}/${fetched.original.name}";
|
||||
}
|
||||
# handle path sources
|
||||
@ -219,7 +219,7 @@ in {
|
||||
then
|
||||
utils.extractSource {
|
||||
source = "${FODAllSources}/${FODArgsAll."${name}"."${version}".outPath}";
|
||||
name = dlib.sanitizeDerivationName name;
|
||||
name = l.strings.sanitizeDerivationName name;
|
||||
}
|
||||
else "${FODAllSources}/${FODArgsAll."${name}"."${version}".outPath}"
|
||||
else defaultFetched."${name}"."${version}")
|
||||
|
@ -26,7 +26,6 @@
|
||||
recursiveUpdateUntilDepth
|
||||
simpleTranslate2
|
||||
translators
|
||||
sanitizeDerivationName
|
||||
sanitizePath
|
||||
sanitizeRelativePath
|
||||
subsystems
|
||||
@ -280,9 +279,6 @@
|
||||
recursiveUpdateUntilDepth = depth: lhs: rhs:
|
||||
lib.recursiveUpdateUntil (path: _: _: (l.length path) > depth) lhs rhs;
|
||||
|
||||
sanitizeDerivationName = name:
|
||||
lib.replaceStrings ["@" "/"] ["__at__" "__slash__"] name;
|
||||
|
||||
sanitizeRelativePath = path:
|
||||
l.removePrefix "/" (l.toString (l.toPath "/${path}"));
|
||||
|
||||
|
@ -21,7 +21,7 @@ in {
|
||||
translateBin = {
|
||||
# dream2nix utils
|
||||
utils,
|
||||
# nixpkgs dependenies
|
||||
# nixpkgs dependencies
|
||||
bash,
|
||||
coreutils,
|
||||
jq,
|
||||
|
@ -64,16 +64,14 @@ in {
|
||||
})
|
||||
subsystemAttrs.cabalHashes or {};
|
||||
|
||||
# the main package
|
||||
defaultPackage = allPackages."${defaultPackageName}"."${defaultPackageVersion}";
|
||||
|
||||
# packages to export
|
||||
packages =
|
||||
lib.mapAttrs
|
||||
(name: version: {
|
||||
"${version}" = allPackages.${name}.${version};
|
||||
})
|
||||
args.packages;
|
||||
{default = packages.${defaultPackageName};}
|
||||
// (
|
||||
lib.mapAttrs
|
||||
(name: version: {"${version}" = allPackages.${name}.${version};})
|
||||
args.packages
|
||||
);
|
||||
|
||||
# manage packages in attrset to prevent duplicated evaluation
|
||||
allPackages =
|
||||
@ -119,7 +117,7 @@ in {
|
||||
# Generates a derivation for a specific package name + version
|
||||
makeOnePackage = name: version: let
|
||||
pkg = compiler.mkDerivation (rec {
|
||||
pname = utils.sanitizeDerivationName name;
|
||||
pname = l.strings.sanitizeDerivationName name;
|
||||
inherit version;
|
||||
license = null;
|
||||
|
||||
@ -173,6 +171,6 @@ in {
|
||||
# apply packageOverrides to current derivation
|
||||
produceDerivation name pkg;
|
||||
in {
|
||||
inherit defaultPackage packages;
|
||||
inherit packages;
|
||||
};
|
||||
}
|
||||
|
@ -75,8 +75,6 @@
|
||||
})
|
||||
args.packages);
|
||||
|
||||
devShell = devShells.default;
|
||||
|
||||
devShells =
|
||||
{default = devShells.${defaultPackageName};}
|
||||
// (
|
||||
|
@ -35,9 +35,8 @@
|
||||
in
|
||||
childrenRemoved;
|
||||
|
||||
getTranslatorNames = path: let
|
||||
nodes = l.readDir path;
|
||||
packageJson = l.fromJSON (l.readFile "${path}/package.json");
|
||||
getTranslatorNames = tree: let
|
||||
packageJson = tree.files."package.json".jsonContent;
|
||||
translators =
|
||||
# if the package has no dependencies we use the
|
||||
# package-lock translator with `packageLock = null`
|
||||
@ -47,8 +46,8 @@
|
||||
&& (packageJson.workspaces or [] == [])
|
||||
then ["package-lock"]
|
||||
else
|
||||
l.optionals (nodes ? "package-lock.json") ["package-lock"]
|
||||
++ l.optionals (nodes ? "yarn.lock") ["yarn-lock"]
|
||||
l.optionals (tree.files ? "package-lock.json") ["package-lock"]
|
||||
++ l.optionals (tree.files ? "yarn.lock") ["yarn-lock"]
|
||||
++ ["package-json"];
|
||||
in
|
||||
translators;
|
||||
@ -166,7 +165,7 @@
|
||||
inherit subsystem;
|
||||
inherit (tree) relPath;
|
||||
name = tree.files."package.json".jsonContent.name or tree.relPath;
|
||||
translators = getTranslatorNames tree.fullPath;
|
||||
translators = getTranslatorNames tree;
|
||||
subsystemInfo = l.optionalAttrs (workspaces != []) {
|
||||
workspaces =
|
||||
l.map
|
||||
|
@ -12,7 +12,7 @@
|
||||
apps,
|
||||
subsystems,
|
||||
utils,
|
||||
# nixpkgs dependenies
|
||||
# nixpkgs dependencies
|
||||
bash,
|
||||
coreutils,
|
||||
git,
|
||||
|
@ -11,7 +11,7 @@
|
||||
# dream2nix utils
|
||||
subsystems,
|
||||
utils,
|
||||
# nixpkgs dependenies
|
||||
# nixpkgs dependencies
|
||||
bash,
|
||||
coreutils,
|
||||
git,
|
||||
|
@ -20,7 +20,7 @@
|
||||
# dream2nix utils
|
||||
subsystems,
|
||||
utils,
|
||||
# nixpkgs dependenies
|
||||
# nixpkgs dependencies
|
||||
bash,
|
||||
coreutils,
|
||||
moreutils,
|
||||
|
@ -12,7 +12,7 @@
|
||||
apps,
|
||||
subsystems,
|
||||
utils,
|
||||
# nixpkgs dependenies
|
||||
# nixpkgs dependencies
|
||||
coreutils,
|
||||
curl,
|
||||
jq,
|
||||
|
@ -80,6 +80,5 @@
|
||||
in {
|
||||
packages.${defaultPackageName}.${defaultPackageVersion} = package;
|
||||
devShells.${defaultPackageName} = devShell;
|
||||
inherit devShell;
|
||||
};
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
# dream2nix utils
|
||||
subsystems,
|
||||
utils,
|
||||
# nixpkgs dependenies
|
||||
# nixpkgs dependencies
|
||||
coreutils,
|
||||
jq,
|
||||
rustPlatform,
|
||||
|
@ -12,7 +12,7 @@
|
||||
apps,
|
||||
subsystems,
|
||||
utils,
|
||||
# nixpkgs dependenies
|
||||
# nixpkgs dependencies
|
||||
coreutils,
|
||||
curl,
|
||||
gnutar,
|
||||
|
@ -43,7 +43,7 @@ in {
|
||||
translateBin = {
|
||||
# dream2nix utils
|
||||
utils,
|
||||
# nixpkgs dependenies
|
||||
# nixpkgs dependencies
|
||||
bash,
|
||||
coreutils,
|
||||
jq,
|
||||
|
@ -56,26 +56,24 @@ in
|
||||
/*
|
||||
A list of projects returned by `discoverProjects`
|
||||
Example:
|
||||
[
|
||||
{
|
||||
"dreamLockPath": "packages/optimism/dream-lock.json",
|
||||
"name": "optimism",
|
||||
"relPath": "",
|
||||
"subsystem": "nodejs",
|
||||
"subsystemInfo": {
|
||||
"workspaces": [
|
||||
"packages/common-ts",
|
||||
"packages/contracts",
|
||||
"packages/core-utils",
|
||||
]
|
||||
},
|
||||
"translator": "yarn-lock",
|
||||
"translators": [
|
||||
"yarn-lock",
|
||||
"package-json"
|
||||
{
|
||||
"dreamLockPath": "packages/optimism/dream-lock.json",
|
||||
"name": "optimism",
|
||||
"relPath": "",
|
||||
"subsystem": "nodejs",
|
||||
"subsystemInfo": {
|
||||
"workspaces": [
|
||||
"packages/common-ts",
|
||||
"packages/contracts",
|
||||
"packages/core-utils",
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"translator": "yarn-lock",
|
||||
"translators": [
|
||||
"yarn-lock",
|
||||
"package-json"
|
||||
]
|
||||
}
|
||||
*/
|
||||
project,
|
||||
|
||||
|
@ -65,7 +65,6 @@ in
|
||||
parseGitUrl
|
||||
readTextFile
|
||||
recursiveUpdateUntilDepth
|
||||
sanitizeDerivationName
|
||||
traceJ
|
||||
;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user