push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
# To update Elm:
Modify revision in ./update.sh and run it
# Notes about the build process:
The elm binary embeds a piece of pre-compiled elm code, used by 'elm
reactor'. This means that the build process for 'elm' effectively
executes 'elm make'. that in turn expects to retrieve the elm
dependencies of that code (elm/core, etc.) from
package.elm-lang.org, as well as a cached bit of metadata
(versions.dat).
The makeDotElm function lets us retrieve these dependencies in the
standard nix way. We have to copy them in (rather than symlink) and
make them writable because the elm compiler writes other .dat files
alongside the source code. versions.dat was produced during an
impure build of this same code; the build complains that it can't
update this cache, but continues past that warning.
Finally, we set ELM_HOME to point to these pre-fetched artifacts so
that the default of ~/.elm isn't used.
More: https://blog.hercules-ci.com/elm/2019/01/03/elm2nix-0.1/

View File

@@ -0,0 +1,69 @@
{
pkgs,
lib,
makeWrapper,
nodejs ? pkgs.nodejs_20,
}:
let
fetchElmDeps = pkgs.callPackage ./lib/fetchElmDeps.nix { };
# Haskell packages that require ghc 9.8
hs98Pkgs = import ./packages/ghc9_8 { inherit pkgs lib; };
# Haskell packages that require ghc 9.6
hs96Pkgs = import ./packages/ghc9_6 {
inherit
pkgs
lib
makeWrapper
nodejs
fetchElmDeps
;
};
# Patched, originally npm-downloaded, packages
patchedNodePkgs = import ./packages/node {
inherit
pkgs
lib
nodejs
makeWrapper
;
};
assembleScope =
self: basics:
(hs98Pkgs self).elmPkgs // (hs96Pkgs self).elmPkgs // (patchedNodePkgs self) // basics;
in
lib.makeScope pkgs.newScope (
self:
assembleScope self (
with self;
{
inherit fetchElmDeps nodejs;
/*
Node/NPM based dependencies can be upgraded using script `packages/generate-node-packages.sh`.
* Packages which depend on npm installation of elm can be patched using
`patchNpmElm` function defined in `packages/lib.nix`.
*/
elmLib = import ./lib {
inherit lib;
inherit (pkgs) writeScriptBin stdenv;
inherit (self) elm;
};
elm-json = callPackage ./packages/elm-json { };
elm-review = callPackage ./packages/elm-review { };
elm-test-rs = callPackage ./packages/elm-test-rs { };
elm-test = callPackage ./packages/elm-test { };
lamdera = callPackage ./packages/lamdera { };
}
)
)

View File

@@ -0,0 +1,22 @@
{
writeScriptBin,
stdenv,
lib,
elm,
}:
let
patchNpmElm =
pkg:
pkg.override (old: {
preRebuild = (old.preRebuild or "") + ''
rm node_modules/elm/install.js
echo "console.log('Nixpkgs\' version of Elm will be used');" > node_modules/elm/install.js
'';
postInstall = (old.postInstall or "") + ''
ln -sf ${elm}/bin/elm node_modules/elm/bin/elm
'';
});
in
{
inherit patchNpmElm;
}

View File

@@ -0,0 +1,26 @@
{
stdenv,
lib,
fetchurl,
}:
{
elmPackages,
registryDat,
elmVersion,
}:
let
makeDotElm = import ./makeDotElm.nix {
inherit
stdenv
lib
fetchurl
registryDat
;
};
in
''
export ELM_HOME=`pwd`/.elm
''
+ (makeDotElm elmVersion elmPackages)

View File

@@ -0,0 +1,42 @@
{
stdenv,
lib,
fetchurl,
registryDat,
}:
ver: deps:
let
cmds = lib.mapAttrsToList (
name: info:
let
pkg = stdenv.mkDerivation {
name = lib.replaceStrings [ "/" ] [ "-" ] name + "-${info.version}";
src = fetchurl {
url = "https://github.com/${name}/archive/${info.version}.tar.gz";
meta.homepage = "https://github.com/${name}/";
inherit (info) sha256;
};
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out
cp -r * $out
'';
};
in
''
mkdir -p .elm/${ver}/packages/${name}
cp -R ${pkg} .elm/${ver}/packages/${name}/${info.version}
''
) deps;
in
(lib.concatStrings cmds)
+ ''
mkdir -p .elm/${ver}/packages;
cp ${registryDat} .elm/${ver}/packages/registry.dat;
chmod -R +w .elm
''

View File

@@ -0,0 +1,14 @@
# Elm packages
Mixtures of useful Elm lang tooling containing both Haskell and Node.js based utilities.
## Upgrades
Haskell parts of the ecosystem are using [cabal2nix](https://github.com/NixOS/cabal2nix).
Please refer to [nix documentation](https://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages)
and [cabal2nix readme](https://github.com/NixOS/cabal2nix#readme) for more information. Elm-format [update scripts](https://github.com/avh4/elm-format/tree/master/package/nix)
is part of its repository.
Node dependencies are defined in [node-packages.json](node/node-packages.json).
[Node2nix](https://github.com/svanderburg/node2nix) is used for generating nix expression
from this file. Use [generate-node-packages.sh](node/generate-node-packages.sh) for updates of nix expressions.

View File

@@ -0,0 +1,42 @@
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
curl,
openssl,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "elm-json";
version = "0.2.13";
src = fetchFromGitHub {
owner = "zwilias";
repo = "elm-json";
tag = "v${finalAttrs.version}";
hash = "sha256-pSt4ugP8r7s0ABT3Y9ZbWAG/ShsARtame2lTxXiCuws=";
};
cargoPatches = [ ./use-system-ssl.patch ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
curl
openssl
];
cargoHash = "sha256-BnL//AHaSnsugtMEnSTynpMyeNt5N7L6PG2wdWDw1y4=";
# Tests perform networking and therefore can't work in sandbox
doCheck = false;
meta = {
description = "Install, upgrade and uninstall Elm dependencies";
mainProgram = "elm-json";
homepage = "https://github.com/zwilias/elm-json";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.turbomack ];
};
})

View File

@@ -0,0 +1,43 @@
diff --git a/Cargo.lock b/Cargo.lock
index b9bf434..58cfe81 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -677,15 +677,6 @@
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
-name = "openssl-src"
-version = "111.22.0+1.1.1q"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f31f0d509d1c1ae9cada2f9539ff8f37933831fd5098879e482aa687d659853"
-dependencies = [
- "cc",
-]
-
-[[package]]
name = "openssl-sys"
version = "0.9.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -694,7 +685,6 @@
"autocfg",
"cc",
"libc",
- "openssl-src",
"pkg-config",
"vcpkg",
]
diff --git a/Cargo.toml b/Cargo.toml
index bc97f20..54d3b14 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,8 +17,8 @@
dialoguer = "0.6"
dirs = "3.0"
fs2 = "0.4"
-isahc = { version = "1.6.0", default-features = false, features = ["static-ssl", "static-curl"] }
-curl = {version = "0.4.42", default-features = false, features = ["ssl", "static-curl", "static-ssl", "force-system-lib-on-osx"]}
+isahc = { version = "1.6.0", default-features = false }
+curl = {version = "0.4.42", default-features = false, features = ["ssl", "force-system-lib-on-osx"]}
ctrlc = "3.1"
console = "0.12"
anyhow = "1.0"

View File

@@ -0,0 +1,45 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
testers,
elm-review,
}:
buildNpmPackage rec {
pname = "elm-review";
version = "2.13.4";
src = fetchFromGitHub {
owner = "jfmengels";
repo = "node-elm-review";
rev = "v${version}";
hash = "sha256-rhNLIShZERxrzdTdrPcthTQ+gHUikgR0jchBfcBDGTo=";
};
npmDepsHash = "sha256-mI94fYNKZ9Jx1Iyo/VjZqaXQ64tZA2S8mtn5l6TtCSc=";
postPatch = ''
sed -i "s/elm-tooling install/echo 'skipping elm-tooling install'/g" package.json
'';
dontNpmBuild = true;
passthru.tests.version = testers.testVersion {
version = "${version}";
package = elm-review;
command = "elm-review --version";
};
meta = {
changelog = "https://github.com/jfmengels/node-elm-review/blob/v${src.rev}/CHANGELOG.md";
description = "Analyzes Elm projects, to help find mistakes before your users find them";
mainProgram = "elm-review";
homepage = "https://github.com/jfmengels/node-elm-review";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
turbomack
zupo
];
};
}

View File

@@ -0,0 +1,72 @@
{
"elm-explorations/markdown" = {
sha256 = "0k3110ixa4wwf3vkkdplagwah9ypr965qxr1y147rnsc1xsxmr6y";
version = "1.0.0";
};
"elm/browser" = {
sha256 = "1zlmx672glg7fdgkvh5jm47y85pv7pdfr5mkhg6x7ar6k000vyka";
version = "1.0.1";
};
"elm/core" = {
sha256 = "1l0qdbczw91kzz8sx5d5zwz9x662bspy7p21dsr3f2rigxiix2as";
version = "1.0.2";
};
"elm/html" = {
sha256 = "1n3gpzmpqqdsldys4ipgyl1zacn0kbpc3g4v3hdpiyfjlgh8bf3k";
version = "1.0.0";
};
"elm/http" = {
sha256 = "008bs76mnp48b4dw8qwjj4fyvzbxvlrl4xpa2qh1gg2kfwyw56v1";
version = "2.0.0";
};
"elm/json" = {
sha256 = "1a107nmm905dih4w4mjjkkpdcjbgaf5qjvr7fl30kkpkckfjjnrw";
version = "1.1.2";
};
"elm/project-metadata-utils" = {
sha256 = "1d4rd4grrnbdvj9gf00h7dr6hbkjzawgkzpizfrkp1z1pyr3mvq9";
version = "1.0.0";
};
"elm/svg" = {
sha256 = "1cwcj73p61q45wqwgqvrvz3aypjyy3fw732xyxdyj6s256hwkn0k";
version = "1.0.1";
};
"elm/bytes" = {
sha256 = "040d7irrawcbnq9jxhzx8p9qacdlw5bncy6lgndd6inm53rvvwbp";
version = "1.0.7";
};
"elm/file" = {
sha256 = "15vw1ilbg0msimq2k9magwigp8lwqrgvz3vk6qia6b3ldahvw8jr";
version = "1.0.1";
};
"elm/parser" = {
sha256 = "0a3cxrvbm7mwg9ykynhp7vjid58zsw03r63qxipxp3z09qks7512";
version = "1.1.0";
};
"elm/time" = {
sha256 = "0vch7i86vn0x8b850w1p69vplll1bnbkp8s383z7pinyg94cm2z1";
version = "1.0.0";
};
"elm/url" = {
sha256 = "0av8x5syid40sgpl5vd7pry2rq0q4pga28b4yykn9gd9v12rs3l4";
version = "1.0.0";
};
"elm/virtual-dom" = {
sha256 = "0q1v5gi4g336bzz1lgwpn5b1639lrn63d8y6k6pimcyismp2i1yg";
version = "1.0.2";
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
rustPlatform,
fetchFromGitHub,
openssl,
stdenv,
}:
rustPlatform.buildRustPackage rec {
pname = "elm-test-rs";
version = "3.0.1";
src = fetchFromGitHub {
owner = "mpizenberg";
repo = "elm-test-rs";
tag = "v${version}";
hash = "sha256-NGonWCOLxON1lxsgRlWgY67TtIJYsLPXi96NcxF4Tso=";
};
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ openssl ];
cargoHash = "sha256-qs6ujXl4j9gCEDQV5i47oa0eaqWZf4NqsVbNDsao5fI=";
# Tests perform networking and therefore can't work in sandbox
doCheck = false;
meta = {
description = "Fast and portable executable to run your Elm tests";
mainProgram = "elm-test-rs";
homepage = "https://github.com/mpizenberg/elm-test-rs";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
jpagex
zupo
];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
}:
buildNpmPackage rec {
pname = "elm-test";
version = "0.19.1-revision16";
src = fetchFromGitHub {
owner = "rtfeldman";
repo = "node-test-runner";
rev = version;
hash = "sha256-5XV5AxLJ3YdtlB3Px5tmFzP8H2BP8lkq9M01iUbbmPU=";
};
npmDepsHash = "sha256-+e21gMBiRQo1uUIvlIs5fzkyWW6+zWEi2HGdDsXxgaA=";
postPatch = ''
sed -i '/elm-tooling install/d' package.json
'';
dontNpmBuild = true;
postInstall = ''
# clean up broken symlinks to build tool binaries
find $out/lib/node_modules/elm-test/node_modules/.bin \
-xtype l \
-delete
'';
meta = {
changelog = "https://github.com/rtfeldman/node-test-runner/blob/${src.rev}/CHANGELOG.md";
description = "Runs elm-test suites from Node.js";
mainProgram = "elm-test";
homepage = "https://github.com/rtfeldman/node-test-runner";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ turbomack ];
};
}

View File

@@ -0,0 +1,26 @@
{
mkDerivation,
ansi-terminal,
base,
fetchgit,
lib,
}:
mkDerivation {
pname = "ansi-wl-pprint";
version = "0.6.8.1";
src = fetchgit {
url = "https://github.com/ekmett/ansi-wl-pprint";
sha256 = "00pgxgkramz6y1bgdlm00rsh6gd6mdaqllh6riax2rc2sa35kip4";
rev = "d16e2f6896d76b87b72af7220c2e93ba15c53280";
fetchSubmodules = true;
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
ansi-terminal
base
];
homepage = "http://github.com/ekmett/ansi-wl-pprint";
description = "The Wadler/Leijen Pretty Printer for colored ANSI terminal output";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,50 @@
{
pkgs,
lib,
makeWrapper,
nodejs,
fetchElmDeps,
}:
self:
pkgs.haskell.packages.ghc96.override {
overrides =
self: super:
let
inherit (pkgs.haskell.lib.compose) overrideCabal;
elmPkgs = rec {
elm = overrideCabal (drv: {
# sadly with parallelism most of the time breaks compilation
enableParallelBuilding = false;
preConfigure = fetchElmDeps {
elmPackages = (import ../elm-srcs.nix);
elmVersion = drv.version;
registryDat = ../../registry.dat;
};
buildTools = drv.buildTools or [ ] ++ [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/elm \
--prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
'';
description = "Delightful language for reliable webapps";
homepage = "https://elm-lang.org/";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
turbomack
];
}) (self.callPackage ./elm { });
inherit fetchElmDeps;
elmVersion = elmPkgs.elm.version;
};
in
elmPkgs
// {
inherit elmPkgs;
ansi-wl-pprint = overrideCabal (drv: {
jailbreak = true;
}) (self.callPackage ./ansi-wl-pprint { });
};
}

View File

@@ -0,0 +1,89 @@
{
mkDerivation,
ansi-terminal,
ansi-wl-pprint,
base,
binary,
bytestring,
containers,
directory,
edit-distance,
fetchgit,
file-embed,
filelock,
filepath,
ghc-prim,
haskeline,
HTTP,
http-client,
http-client-tls,
http-types,
language-glsl,
lib,
mtl,
network,
parsec,
process,
raw-strings-qq,
scientific,
SHA,
snap-core,
snap-server,
template-haskell,
time,
unordered-containers,
utf8-string,
vector,
zip-archive,
}:
mkDerivation {
pname = "elm";
version = "0.19.1";
src = fetchgit {
url = "https://github.com/elm/compiler";
sha256 = "1h9jhwlv1pqqna5s09vd72arwhhjn0dlhv0w9xx5771x0xryxxg8";
rev = "2f6dd29258e880dbb7effd57a829a0470d8da48b";
fetchSubmodules = true;
};
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
ansi-terminal
ansi-wl-pprint
base
binary
bytestring
containers
directory
edit-distance
file-embed
filelock
filepath
ghc-prim
haskeline
HTTP
http-client
http-client-tls
http-types
language-glsl
mtl
network
parsec
process
raw-strings-qq
scientific
SHA
snap-core
snap-server
template-haskell
time
unordered-containers
utf8-string
vector
zip-archive
];
homepage = "https://elm-lang.org";
description = "The `elm` command line interface";
license = lib.licenses.bsd3;
mainProgram = "elm";
}

View File

@@ -0,0 +1,43 @@
{ pkgs, lib }:
self:
pkgs.haskell.packages.ghc98.override {
overrides =
self: super:
let
inherit (pkgs.haskell.lib.compose) justStaticExecutables overrideCabal;
elmPkgs = {
# Post-patch override taken from the upstream repository:
# https://github.com/avh4/elm-format/blob/e7e5da37716acbfb4954a88128b5cc72b2c911d9/package/nix/generate_derivation.sh
elm-format = justStaticExecutables (
overrideCabal (drv: {
postPatch = ''
mkdir -p ./generated
cat <<EOHS > ./generated/Build_elm_format.hs
module Build_elm_format where
gitDescribe :: String
gitDescribe = "${drv.version}"
EOHS
'';
homepage = "https://github.com/avh4/elm-format";
maintainers = with lib.maintainers; [
avh4
turbomack
];
}) (self.callPackage ./elm-format/elm-format.nix { })
);
};
in
elmPkgs
// {
inherit elmPkgs;
# Needed for elm-format
avh4-lib = self.callPackage ./elm-format/avh4-lib.nix { };
elm-format-lib = self.callPackage ./elm-format/elm-format-lib.nix { };
elm-format-test-lib = self.callPackage ./elm-format/elm-format-test-lib.nix { };
elm-format-markdown = self.callPackage ./elm-format/elm-format-markdown.nix { };
};
}

View File

@@ -0,0 +1,59 @@
{
mkDerivation,
array,
base,
bytestring,
directory,
fetchgit,
filepath,
lib,
mtl,
pooled-io,
process,
relude,
tasty,
tasty-discover,
tasty-hunit,
text,
}:
mkDerivation {
pname = "avh4-lib";
version = "0.0.0.1";
src = fetchgit {
url = "https://github.com/avh4/elm-format";
sha256 = "13i1wgva6p9zsx1a7sfb3skc0rv187isb920chkhljyh48c12k8l";
rev = "d07fddc8c0eef412dba07be4ab8768d6abcca796";
fetchSubmodules = true;
};
postUnpack = "sourceRoot+=/avh4-lib; echo source root reset to $sourceRoot";
libraryHaskellDepends = [
array
base
bytestring
directory
filepath
mtl
pooled-io
process
relude
text
];
testHaskellDepends = [
array
base
bytestring
directory
filepath
mtl
pooled-io
process
relude
tasty
tasty-hunit
text
];
testToolDepends = [ tasty-discover ];
doHaddock = false;
description = "Common code for haskell projects";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,73 @@
{
mkDerivation,
aeson,
avh4-lib,
base,
bimap,
binary,
bytestring,
containers,
elm-format-markdown,
elm-format-test-lib,
fetchgit,
hspec,
lib,
mtl,
optparse-applicative,
relude,
split,
tasty,
tasty-discover,
tasty-hspec,
tasty-hunit,
text,
}:
mkDerivation {
pname = "elm-format-lib";
version = "0.0.0.1";
src = fetchgit {
url = "https://github.com/avh4/elm-format";
sha256 = "13i1wgva6p9zsx1a7sfb3skc0rv187isb920chkhljyh48c12k8l";
rev = "d07fddc8c0eef412dba07be4ab8768d6abcca796";
fetchSubmodules = true;
};
postUnpack = "sourceRoot+=/elm-format-lib; echo source root reset to $sourceRoot";
libraryHaskellDepends = [
aeson
avh4-lib
base
bimap
binary
bytestring
containers
elm-format-markdown
mtl
optparse-applicative
relude
text
];
testHaskellDepends = [
aeson
avh4-lib
base
bimap
binary
bytestring
containers
elm-format-markdown
elm-format-test-lib
hspec
mtl
optparse-applicative
relude
split
tasty
tasty-hspec
tasty-hunit
text
];
testToolDepends = [ tasty-discover ];
doHaddock = false;
description = "Common code used by elm-format and elm-refactor";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,29 @@
{
mkDerivation,
base,
containers,
fetchgit,
lib,
mtl,
text,
}:
mkDerivation {
pname = "elm-format-markdown";
version = "0.0.0.1";
src = fetchgit {
url = "https://github.com/avh4/elm-format";
sha256 = "13i1wgva6p9zsx1a7sfb3skc0rv187isb920chkhljyh48c12k8l";
rev = "d07fddc8c0eef412dba07be4ab8768d6abcca796";
fetchSubmodules = true;
};
postUnpack = "sourceRoot+=/elm-format-markdown; echo source root reset to $sourceRoot";
libraryHaskellDepends = [
base
containers
mtl
text
];
doHaddock = false;
description = "Markdown parsing for Elm documentation comments";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,62 @@
{
mkDerivation,
avh4-lib,
base,
containers,
fetchgit,
filepath,
hspec,
hspec-core,
hspec-golden,
lib,
mtl,
split,
tasty,
tasty-discover,
tasty-hspec,
tasty-hunit,
text,
}:
mkDerivation {
pname = "elm-format-test-lib";
version = "0.0.0.1";
src = fetchgit {
url = "https://github.com/avh4/elm-format";
sha256 = "13i1wgva6p9zsx1a7sfb3skc0rv187isb920chkhljyh48c12k8l";
rev = "d07fddc8c0eef412dba07be4ab8768d6abcca796";
fetchSubmodules = true;
};
postUnpack = "sourceRoot+=/elm-format-test-lib; echo source root reset to $sourceRoot";
libraryHaskellDepends = [
avh4-lib
base
containers
filepath
hspec
hspec-core
hspec-golden
mtl
split
tasty-hunit
text
];
testHaskellDepends = [
avh4-lib
base
containers
filepath
hspec
hspec-core
hspec-golden
mtl
split
tasty
tasty-hspec
tasty-hunit
text
];
testToolDepends = [ tasty-discover ];
doHaddock = false;
description = "Test helpers used by elm-format-tests and elm-refactor-tests";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,69 @@
{
mkDerivation,
aeson,
ansi-wl-pprint,
avh4-lib,
base,
bytestring,
elm-format-lib,
elm-format-test-lib,
fetchgit,
hspec,
lib,
optparse-applicative,
QuickCheck,
quickcheck-io,
relude,
tasty,
tasty-hspec,
tasty-hunit,
tasty-quickcheck,
text,
}:
mkDerivation {
pname = "elm-format";
version = "0.8.8";
src = fetchgit {
url = "https://github.com/avh4/elm-format";
sha256 = "13i1wgva6p9zsx1a7sfb3skc0rv187isb920chkhljyh48c12k8l";
rev = "d07fddc8c0eef412dba07be4ab8768d6abcca796";
fetchSubmodules = true;
};
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
aeson
ansi-wl-pprint
avh4-lib
base
bytestring
elm-format-lib
optparse-applicative
relude
text
];
testHaskellDepends = [
aeson
ansi-wl-pprint
avh4-lib
base
bytestring
elm-format-lib
elm-format-test-lib
hspec
optparse-applicative
QuickCheck
quickcheck-io
relude
tasty
tasty-hspec
tasty-hunit
tasty-quickcheck
text
];
doHaddock = false;
homepage = "https://elm-lang.org";
description = "A source code formatter for Elm";
license = lib.licenses.bsd3;
mainProgram = "elm-format";
}

View File

@@ -0,0 +1,45 @@
{
stdenv,
lib,
fetchurl,
}:
let
os = if stdenv.hostPlatform.isDarwin then "macos" else "linux";
arch = if stdenv.hostPlatform.isAarch64 then "arm64" else "x86_64";
hashes = {
"x86_64-linux" = "15a69bfa98155651749e31c68d05a04fcf48bdccb86bce77b7c8872f545cecfa";
"aarch64-linux" = "68a16bbbd2ed0ee19c36112a4c2d0abca66cf17465747e55adf2596b0921f8d7";
"x86_64-darwin" = "af2c63a60a689091a01bfd212e0ce141a6d7ba61d34a585d8f83159d0ed39c6f";
"aarch64-darwin" = "06f9f7fdcbb392a0a8a5034baf915d2b95b2876255aa8df8397ddafd1e540b7a";
};
in
stdenv.mkDerivation rec {
pname = "lamdera";
version = "1.3.2";
src = fetchurl {
url = "https://static.lamdera.com/bin/lamdera-${version}-${os}-${arch}";
sha256 = hashes.${stdenv.system};
};
dontUnpack = true;
installPhase = ''
install -m755 -D $src $out/bin/lamdera
'';
meta = with lib; {
homepage = "https://lamdera.com";
license = licenses.unfree;
description = "Delightful platform for full-stack web apps";
platforms = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
maintainers = with maintainers; [ Zimmi48 ];
};
}

View File

@@ -0,0 +1,117 @@
{
pkgs,
lib,
nodejs,
makeWrapper,
}:
self:
let
# Untouched npm-downloaded packages
nodePkgs = pkgs.callPackage ./node-composition.nix {
inherit pkgs nodejs;
inherit (pkgs.stdenv.hostPlatform) system;
};
in
with self;
with elmLib;
{
inherit (nodePkgs)
elm-live
elm-upgrade
elm-xref
elm-analyse
elm-git-install
;
elm-verify-examples = nodePkgs.elm-verify-examples // {
meta =
with lib;
nodePkgs.elm-verify-examples.meta
// {
description = "Verify examples in your docs";
homepage = "https://github.com/stoeffel/elm-verify-examples";
license = licenses.bsd3;
maintainers = [ maintainers.turbomack ];
};
};
create-elm-app = patchNpmElm nodePkgs.create-elm-app // {
meta =
with lib;
nodePkgs.create-elm-app.meta
// {
description = "Create Elm apps with no build configuration";
homepage = "https://github.com/halfzebra/create-elm-app";
license = licenses.mit;
maintainers = [ maintainers.turbomack ];
};
};
elm-graphql = nodePkgs."@dillonkearns/elm-graphql" // {
meta =
with lib;
nodePkgs."@dillonkearns/elm-graphql".meta
// {
description = "Autogenerate type-safe GraphQL queries in Elm";
license = licenses.bsd3;
maintainers = [ maintainers.pedrohlc ];
};
};
elm-language-server = nodePkgs."@elm-tooling/elm-language-server" // {
meta =
with lib;
nodePkgs."@elm-tooling/elm-language-server".meta
// {
description = "Language server implementation for Elm";
homepage = "https://github.com/elm-tooling/elm-language-server";
license = licenses.mit;
maintainers = [ maintainers.turbomack ];
};
};
elm-spa = nodePkgs."elm-spa".overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
makeWrapper
old.nodejs.pkgs.node-gyp-build
];
meta =
with lib;
nodePkgs."elm-spa".meta
// {
description = "Tool for building single page apps in Elm";
homepage = "https://www.elm-spa.dev/";
license = licenses.bsd3;
maintainers = [ maintainers.ilyakooo0 ];
};
});
elm-optimize-level-2 = nodePkgs."elm-optimize-level-2" // {
meta =
with lib;
nodePkgs."elm-optimize-level-2".meta
// {
description = "Second level of optimization for the Javascript that the Elm Compiler produces";
homepage = "https://github.com/mdgriffith/elm-optimize-level-2";
license = licenses.bsd3;
maintainers = [ maintainers.turbomack ];
};
};
elm-pages = import ./elm-pages {
inherit
nodePkgs
pkgs
lib
makeWrapper
;
};
elm-land = pkgs.elm-land; # Alias
elm-doc-preview = nodePkgs."elm-doc-preview".overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ old.nodejs.pkgs.node-gyp-build ];
});
}

View File

@@ -0,0 +1,67 @@
{
nodePkgs,
pkgs,
lib,
makeWrapper,
}:
let
ESBUILD_BINARY_PATH = lib.getExe (
pkgs.esbuild.override {
buildGoModule =
args:
pkgs.buildGoModule (
args
// rec {
version = "0.25.5";
src = pkgs.fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
hash = "sha256-jemGZkWmN1x2+ZzJ5cLp3MoXO0oDKjtZTmZS9Be/TDw=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
}
);
}
);
in
nodePkgs."elm-pages".overrideAttrs (old: {
inherit ESBUILD_BINARY_PATH;
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
makeWrapper
old.nodejs.pkgs.node-gyp-build
];
# 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 ${./fix-read-only.patch}
patch $out/lib/node_modules/elm-pages/generator/src/init.js ${./fix-init-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 = "Statically typed site generator for Elm";
homepage = "https://github.com/dillonkearns/elm-pages";
license = licenses.bsd3;
maintainers = [
maintainers.turbomack
maintainers.jali-clarke
];
};
})

View File

@@ -0,0 +1,39 @@
diff --git a/generator/src/init.js b/generator/src/init.js
index 06386ff..7127dae 100644
--- a/generator/src/init.js
+++ b/generator/src/init.js
@@ -6,6 +6,20 @@ import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
+let walknDo = function(somePath, doStuff) {
+ doStuff(somePath, true);
+ const dir = fs.readdirSync(somePath)
+ dir.forEach((i) => {
+ let p = path.join(somePath, i);
+ const s = fs.statSync(p)
+ if (s.isDirectory()) {
+ walknDo(p, doStuff)
+ } else {
+ doStuff(p);
+ }
+ });
+}
+
/**
* @param {string} name
*/
@@ -18,6 +32,13 @@ export async function run(name) {
if (!fs.existsSync(name)) {
try {
await fsExtra.copy(template, appRoot);
+ walknDo(appRoot, (file, isDir) => {
+ if (isDir) {
+ fs.chmodSync(file, 0o755);
+ } else {
+ fs.chmodSync(file, 0o644);
+ }
+ });
fs.renameSync(
path.resolve(appRoot, "gitignore"),
path.resolve(appRoot, ".gitignore")

View File

@@ -0,0 +1,39 @@
diff --git a/generator/src/codegen.js b/generator/src/codegen.js
index baf5368..e5edf4d 100644
--- a/generator/src/codegen.js
+++ b/generator/src/codegen.js
@@ -37,9 +37,9 @@ export async function generate(basePath) {
copyToBoth("SiteConfig.elm"),
fs.promises.writeFile("./.elm-pages/Pages.elm", uiFileContent),
- 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`))
),
// write `Pages.elm` with cli interface
fs.promises.writeFile(
@@ -82,9 +82,9 @@ function writeFetcherModules(basePath, fetcherData) {
}
async function newCopyBoth(modulePath) {
- await fs.promises.copyFile(
- path.join(__dirname, modulePath),
- path.join(`./elm-stuff/elm-pages/client/.elm-pages/`, modulePath)
+ await fs.promises.writeFile(
+ path.join(`./elm-stuff/elm-pages/client/.elm-pages/`, modulePath),
+ fs.readFileSync(path.join(__dirname, modulePath))
);
}
@@ -197,7 +197,7 @@ async function copyFileEnsureDir(from, to) {
await fs.promises.mkdir(path.dirname(to), {
recursive: true,
});
- await fs.promises.copyFile(from, to);
+ await fs.promises.writeFile(to, fs.readFileSync(from));
}
/**

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
ROOT="$(realpath "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"/../../../../../..)"
set -eu -o pipefail
$(nix-build $ROOT -A nodePackages.node2nix --no-out-link)/bin/node2nix \
--nodejs-18 \
-i node-packages.json \
-o node-packages.nix \
-c node-composition.nix \
--no-copy-node-env -e ../../../../node-packages/node-env.nix

View File

@@ -0,0 +1,33 @@
# This file has been generated by node2nix 1.11.1. Do not edit!
{
pkgs ? import <nixpkgs> {
inherit system;
},
system ? builtins.currentSystem,
nodejs ? pkgs."nodejs_20",
}:
let
nodeEnv = import ../../../../node-packages/node-env.nix {
inherit (pkgs)
stdenv
lib
runCommand
writeTextFile
writeShellScript
;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.hostPlatform.isDarwin then pkgs.cctools or pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs)
fetchurl
nix-gitignore
stdenv
lib
fetchgit
;
inherit nodeEnv;
}

View File

@@ -0,0 +1,16 @@
[
"elm-analyse",
"elm-doc-preview",
"@elm-tooling/elm-language-server",
"elm-live",
"elm-spa",
"elm-test",
"elm-upgrade",
"elm-verify-examples",
"elm-xref",
"create-elm-app",
"elm-optimize-level-2",
"elm-pages",
"elm-git-install",
"@dillonkearns/elm-graphql"
]

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env nix-shell
#!nix-shell -p cabal2nix elm2nix -i bash ../../..
# Update all cabal packages.
for subpath in 'avh4-lib' 'elm-format-lib' 'elm-format-markdown' 'elm-format-test-lib'; do
cabal2nix --no-haddock 'https://github.com/avh4/elm-format' --revision '0.8.8' \
--subpath $subpath > packages/ghc9_8/elm-format/${subpath}.nix
done
cabal2nix --no-haddock 'https://github.com/avh4/elm-format' --revision '0.8.8' > packages/ghc9_8/elm-format/elm-format.nix
cabal2nix 'https://github.com/ekmett/ansi-wl-pprint' --revision 'v0.6.8.1' > packages/ghc9_6/ansi-wl-pprint/default.nix
# We're building binaries from commit that npm installer is using since
# November 1st release called 0.19.1-6 in npm registry.
# These binaries are built with newer ghc version and also support Aarch64 for Linux and Darwin.
# Upstream git tag for 0.19.1 is still pointing to original commit from 2019.
cabal2nix https://github.com/elm/compiler --revision 2f6dd29258e880dbb7effd57a829a0470d8da48b > packages/ghc9_6/elm/default.nix
echo "need to manually copy registry.dat from an existing elm project"
#elm2nix snapshot > registry.dat
pushd "$(nix-build -A elmPackages.elm.src --no-out-link ../../../..)/reactor"
elm2nix convert > $OLDPWD/packages/elm-srcs.nix
popd