mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-10-26 23:28:55 +03:00
modules: fixups nodejs modules to render docs
This commit is contained in:
parent
164b965b44
commit
e6800060c9
@ -27,13 +27,17 @@ in {
|
||||
fetchFromGitHub = nixpkgs.fetchFromGitHub;
|
||||
};
|
||||
|
||||
mkDerivation = {
|
||||
src = config.deps.fetchFromGitHub {
|
||||
nodejs-package-lock = {
|
||||
source = config.deps.fetchFromGitHub {
|
||||
owner = "posativ";
|
||||
repo = config.name;
|
||||
rev = "refs/tags/${config.version}";
|
||||
sha256 = "sha256-kZNf7Rlb1DZtQe4dK1B283OkzQQcCX+pbvZzfL65gsA=";
|
||||
};
|
||||
};
|
||||
|
||||
mkDerivation = {
|
||||
src = config.nodejs-package-lock.source;
|
||||
|
||||
propagatedBuildInputs = [
|
||||
# isso implicitly assumes that pkg_resources, which is
|
||||
|
@ -6,17 +6,16 @@
|
||||
}: {
|
||||
imports = [
|
||||
dream2nix.modules.dream2nix.nodejs-devshell
|
||||
dream2nix.modules.dream2nix.nodejs-package-lock
|
||||
];
|
||||
|
||||
mkDerivation = {
|
||||
src = config.deps.fetchFromGitHub {
|
||||
nodejs-package-lock = {
|
||||
source = config.deps.fetchFromGitHub {
|
||||
owner = "piuccio";
|
||||
repo = "cowsay";
|
||||
rev = "v1.5.0";
|
||||
sha256 = "sha256-TZ3EQGzVptNqK3cNrkLnyP1FzBd81XaszVucEnmBy4Y=";
|
||||
};
|
||||
# allow devshell to be built -> CI pipeline happy
|
||||
buildPhase = "mkdir $out";
|
||||
};
|
||||
|
||||
deps = {nixpkgs, ...}: {
|
||||
@ -31,4 +30,10 @@
|
||||
|
||||
name = "cowsay";
|
||||
version = "1.5.0";
|
||||
|
||||
mkDerivation = {
|
||||
src = config.nodejs-package-lock.source;
|
||||
# allow devshell to be built -> CI pipeline happy
|
||||
buildPhase = "mkdir $out";
|
||||
};
|
||||
}
|
||||
|
@ -6,10 +6,11 @@
|
||||
}: {
|
||||
imports = [
|
||||
dream2nix.modules.dream2nix.nodejs-node-modules
|
||||
dream2nix.modules.dream2nix.nodejs-package-lock
|
||||
];
|
||||
|
||||
mkDerivation = {
|
||||
src = config.deps.fetchFromGitHub {
|
||||
nodejs-package-lock = {
|
||||
source = config.deps.fetchFromGitHub {
|
||||
owner = "piuccio";
|
||||
repo = "cowsay";
|
||||
rev = "v1.5.0";
|
||||
@ -28,4 +29,7 @@
|
||||
|
||||
name = "cowsay";
|
||||
version = "1.5.0";
|
||||
mkDerivation = {
|
||||
src = config.nodejs-package-lock.source;
|
||||
};
|
||||
}
|
||||
|
@ -9,8 +9,8 @@
|
||||
dream2nix.modules.dream2nix.nodejs-granular
|
||||
];
|
||||
|
||||
mkDerivation = {
|
||||
src = config.deps.fetchFromGitHub {
|
||||
nodejs-package-lock = {
|
||||
source = config.deps.fetchFromGitHub {
|
||||
owner = "piuccio";
|
||||
repo = "cowsay";
|
||||
rev = "v1.5.0";
|
||||
@ -28,4 +28,8 @@
|
||||
|
||||
name = "cowsay";
|
||||
version = "1.5.0";
|
||||
|
||||
mkDerivation = {
|
||||
src = config.nodejs-package-lock.source;
|
||||
};
|
||||
}
|
||||
|
@ -8,15 +8,20 @@
|
||||
in {
|
||||
imports = [
|
||||
dream2nix.modules.dream2nix.nodejs-package-json
|
||||
dream2nix.modules.dream2nix.nodejs-package-lock
|
||||
dream2nix.modules.dream2nix.nodejs-granular
|
||||
];
|
||||
|
||||
mkDerivation = {
|
||||
src = lib.cleanSource ./.;
|
||||
checkPhase = ''
|
||||
./app.js | ${config.deps.gnugrep}/bin/grep -q "Hello, World!"
|
||||
'';
|
||||
doCheck = true;
|
||||
deps = {nixpkgs, ...}: {
|
||||
inherit
|
||||
(nixpkgs)
|
||||
gnugrep
|
||||
stdenv
|
||||
;
|
||||
};
|
||||
|
||||
nodejs-package-lock = {
|
||||
source = lib.cleanSource ./.;
|
||||
};
|
||||
|
||||
nodejs-granular = {
|
||||
@ -30,17 +35,17 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
deps = {nixpkgs, ...}: {
|
||||
inherit
|
||||
(nixpkgs)
|
||||
gnugrep
|
||||
stdenv
|
||||
;
|
||||
};
|
||||
|
||||
name = lib.mkForce "app";
|
||||
version = lib.mkForce "1.0.0";
|
||||
|
||||
lock.lockFileRel =
|
||||
lib.mkForce "/locks/example-package-nodejs-no-lock/lock-${system}.json";
|
||||
|
||||
mkDerivation = {
|
||||
src = config.nodejs-package-lock.source;
|
||||
checkPhase = ''
|
||||
./app.js | ${config.deps.gnugrep}/bin/grep -q "Hello, World!"
|
||||
'';
|
||||
doCheck = true;
|
||||
};
|
||||
}
|
||||
|
@ -9,15 +9,6 @@
|
||||
dream2nix.modules.dream2nix.php-granular
|
||||
];
|
||||
|
||||
mkDerivation = {
|
||||
src = config.deps.fetchFromGitHub {
|
||||
owner = "Gipetto";
|
||||
repo = "CowSay";
|
||||
rev = config.version;
|
||||
sha256 = "sha256-jriyCzmvT2pPeNQskibBg0Bsh+h64cAEO+yOOfX2wbA=";
|
||||
};
|
||||
};
|
||||
|
||||
deps = {nixpkgs, ...}: {
|
||||
inherit
|
||||
(nixpkgs)
|
||||
@ -28,4 +19,17 @@
|
||||
|
||||
name = "cowsay";
|
||||
version = "1.2.0";
|
||||
|
||||
php-composer-lock = {
|
||||
source = config.deps.fetchFromGitHub {
|
||||
owner = "Gipetto";
|
||||
repo = "CowSay";
|
||||
rev = config.version;
|
||||
sha256 = "sha256-jriyCzmvT2pPeNQskibBg0Bsh+h64cAEO+yOOfX2wbA=";
|
||||
};
|
||||
};
|
||||
|
||||
mkDerivation = {
|
||||
src = config.php-composer-lock.source;
|
||||
};
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
config,
|
||||
dream2nix,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
@ -29,6 +30,7 @@
|
||||
in {
|
||||
imports = [
|
||||
./interface.nix
|
||||
dream2nix.modules.dream2nix.mkDerivation
|
||||
];
|
||||
|
||||
# declare external dependencies
|
||||
|
@ -20,6 +20,7 @@ in {
|
||||
The package.json file to use.
|
||||
'';
|
||||
default = cfg.source + "/package.json";
|
||||
defaultText = "\${cfg.source}/package.json";
|
||||
};
|
||||
packageJson = {
|
||||
type = t.attrs;
|
||||
@ -31,6 +32,7 @@ in {
|
||||
The package.json file to use.
|
||||
'';
|
||||
default = cfg.source + "/package-lock.json";
|
||||
defaultText = "\${cfg.source}/package-lock.json";
|
||||
};
|
||||
packageLock = {
|
||||
type = t.attrs;
|
||||
@ -39,7 +41,6 @@ in {
|
||||
source = {
|
||||
type = t.either t.path t.package;
|
||||
description = "Source of the package";
|
||||
default = config.mkDerivation.src;
|
||||
};
|
||||
withDevDependencies = {
|
||||
type = t.bool;
|
||||
|
@ -49,6 +49,5 @@ in {
|
||||
if cfg.composerLockFile != null
|
||||
then l.fromJSON (l.readFile cfg.composerLockFile)
|
||||
else lib.mkDefault {};
|
||||
source = lib.mkOptionDefault config.mkDerivation.src;
|
||||
};
|
||||
}
|
||||
|
@ -26,9 +26,9 @@
|
||||
# "nodejs-granular"
|
||||
# "nodejs-granular-v3"
|
||||
# "nodejs-node-modules"
|
||||
# "nodejs-package-json"
|
||||
# "nodejs-package-lock"
|
||||
# "nodejs-package-lock-v3"
|
||||
"nodejs-package-json"
|
||||
"nodejs-package-lock"
|
||||
"nodejs-package-lock-v3"
|
||||
"package-func"
|
||||
"php-composer-lock"
|
||||
"php-granular"
|
||||
|
Loading…
Reference in New Issue
Block a user