elmPackages.elm-pages: init at 2.1.11
`node-packages.nix` was regenerated after having run `generate-node-packages.sh` in order to pick up dependencies for `elm-pages`. In addition, we add `elm`, `elm-review`, and `elm-optimize-level-2` to the `PATH` for `elm-pages` since those are needed at runtime. A patch is also included to fix an issue where files are copied from the `nix-store` as read-only (credit to @bcardiff for that fix). An upstream issue https://github.com/dillonkearns/elm-pages/issues/305 has been opened to track this.
This commit is contained in:
parent
631fb48f81
commit
d29cd82bfb
|
@ -212,6 +212,32 @@ in lib.makeScope pkgs.newScope (self: with self; {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
elm-pages = nodePkgs."elm-pages".overrideAttrs (
|
||||||
|
old: {
|
||||||
|
buildInputs = old.buildInputs ++ [ pkgs.makeWrapper ];
|
||||||
|
|
||||||
|
# can't use `patches = [ <patch_file> ]` with a nodePkgs derivation;
|
||||||
|
# need to patch in one of the build phases instead.
|
||||||
|
# see upstream issue https://github.com/dillonkearns/elm-pages/issues/305 for dealing with the read-only problem
|
||||||
|
preFixup = ''
|
||||||
|
patch $out/lib/node_modules/elm-pages/generator/src/codegen.js ${./packages/elm-pages-fix-read-only.patch}
|
||||||
|
'';
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
|
wrapProgram $out/bin/elm-pages --prefix PATH : ${
|
||||||
|
with pkgs.elmPackages; lib.makeBinPath [ elm elm-review elm-optimize-level-2 ]
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; nodePkgs."elm-pages".meta // {
|
||||||
|
description = "A statically typed site generator for Elm.";
|
||||||
|
homepage = "https://github.com/dillonkearns/elm-pages";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [ maintainers.turbomack maintainers.jali-clarke ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
inherit (nodePkgs) elm-doc-preview elm-live elm-upgrade elm-xref elm-analyse elm-git-install;
|
inherit (nodePkgs) elm-doc-preview elm-live elm-upgrade elm-xref elm-analyse elm-git-install;
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
diff --git a/generator/src/codegen.js b/generator/src/codegen.js
|
||||||
|
index a0ef8806e..fe00ac904 100644
|
||||||
|
--- a/generator/src/codegen.js
|
||||||
|
+++ b/generator/src/codegen.js
|
||||||
|
@@ -20,33 +20,33 @@ async function generate(basePath) {
|
||||||
|
|
||||||
|
const uiFileContent = elmPagesUiFile();
|
||||||
|
await Promise.all([
|
||||||
|
- fs.promises.copyFile(
|
||||||
|
- path.join(__dirname, `./Page.elm`),
|
||||||
|
- `./.elm-pages/Page.elm`
|
||||||
|
+ fs.promises.writeFile(
|
||||||
|
+ `./.elm-pages/Page.elm`,
|
||||||
|
+ fs.readFileSync(path.join(__dirname, `./Page.elm`))
|
||||||
|
),
|
||||||
|
- fs.promises.copyFile(
|
||||||
|
- path.join(__dirname, `./elm-application.json`),
|
||||||
|
- `./elm-stuff/elm-pages/elm-application.json`
|
||||||
|
+ fs.promises.writeFile(
|
||||||
|
+ `./elm-stuff/elm-pages/elm-application.json`,
|
||||||
|
+ fs.readFileSync(path.join(__dirname, `./elm-application.json`))
|
||||||
|
),
|
||||||
|
- fs.promises.copyFile(
|
||||||
|
- path.join(__dirname, `./Page.elm`),
|
||||||
|
- `./elm-stuff/elm-pages/.elm-pages/Page.elm`
|
||||||
|
+ fs.promises.writeFile(
|
||||||
|
+ `./elm-stuff/elm-pages/.elm-pages/Page.elm`,
|
||||||
|
+ fs.readFileSync(path.join(__dirname, `./Page.elm`))
|
||||||
|
),
|
||||||
|
- fs.promises.copyFile(
|
||||||
|
- path.join(__dirname, `./SharedTemplate.elm`),
|
||||||
|
- `./.elm-pages/SharedTemplate.elm`
|
||||||
|
+ fs.promises.writeFile(
|
||||||
|
+ `./.elm-pages/SharedTemplate.elm`,
|
||||||
|
+ fs.readFileSync(path.join(__dirname, `./SharedTemplate.elm`))
|
||||||
|
),
|
||||||
|
- fs.promises.copyFile(
|
||||||
|
- path.join(__dirname, `./SharedTemplate.elm`),
|
||||||
|
- `./elm-stuff/elm-pages/.elm-pages/SharedTemplate.elm`
|
||||||
|
+ fs.promises.writeFile(
|
||||||
|
+ `./elm-stuff/elm-pages/.elm-pages/SharedTemplate.elm`,
|
||||||
|
+ fs.readFileSync(path.join(__dirname, `./SharedTemplate.elm`))
|
||||||
|
),
|
||||||
|
- fs.promises.copyFile(
|
||||||
|
- path.join(__dirname, `./SiteConfig.elm`),
|
||||||
|
- `./.elm-pages/SiteConfig.elm`
|
||||||
|
+ fs.promises.writeFile(
|
||||||
|
+ `./.elm-pages/SiteConfig.elm`,
|
||||||
|
+ fs.readFileSync(path.join(__dirname, `./SiteConfig.elm`))
|
||||||
|
),
|
||||||
|
- fs.promises.copyFile(
|
||||||
|
- path.join(__dirname, `./SiteConfig.elm`),
|
||||||
|
- `./elm-stuff/elm-pages/.elm-pages/SiteConfig.elm`
|
||||||
|
+ fs.promises.writeFile(
|
||||||
|
+ `./elm-stuff/elm-pages/.elm-pages/SiteConfig.elm`,
|
||||||
|
+ fs.readFileSync(path.join(__dirname, `./SiteConfig.elm`))
|
||||||
|
),
|
||||||
|
fs.promises.writeFile("./.elm-pages/Pages.elm", uiFileContent),
|
||||||
|
// write `Pages.elm` with cli interface
|
|
@ -1,4 +1,4 @@
|
||||||
# This file has been generated by node2nix 1.9.0. Do not edit!
|
# This file has been generated by node2nix 1.11.1. Do not edit!
|
||||||
|
|
||||||
{pkgs ? import <nixpkgs> {
|
{pkgs ? import <nixpkgs> {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
"elm-xref",
|
"elm-xref",
|
||||||
"create-elm-app",
|
"create-elm-app",
|
||||||
"elm-optimize-level-2",
|
"elm-optimize-level-2",
|
||||||
|
"elm-pages",
|
||||||
"elm-review",
|
"elm-review",
|
||||||
"elm-git-install"
|
"elm-git-install"
|
||||||
]
|
]
|
||||||
|
|
1480
pkgs/development/compilers/elm/packages/node-packages.nix
generated
1480
pkgs/development/compilers/elm/packages/node-packages.nix
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue