diff --git a/elm.nix b/elm.nix index 4bfadda..fc33d9d 100644 --- a/elm.nix +++ b/elm.nix @@ -1,6 +1,4 @@ -{ pkgs }: - -with pkgs; +{ lib, stdenv, elm, fetchElmDeps, uglify-js, }: let mkDerivation = @@ -15,10 +13,10 @@ let stdenv.mkDerivation { inherit name src; - buildInputs = [ elmPackages.elm ] - ++ lib.optional outputJavaScript nodePackages.uglify-js; + buildInputs = [ elm ] + ++ lib.optional outputJavaScript uglify-js; - buildPhase = pkgs.elmPackages.fetchElmDeps { + buildPhase = fetchElmDeps { elmPackages = import srcs; elmVersion = "0.19.1"; inherit registryDat; diff --git a/flake.nix b/flake.nix index 62b4d99..e823bea 100644 --- a/flake.nix +++ b/flake.nix @@ -6,13 +6,17 @@ outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem ( system: - let - pkgs = import nixpkgs { inherit system; }; - bergamot-elm = import ./elm.nix { inherit pkgs; }; - in - { - packages = { inherit bergamot-elm; }; - defaultPackage = bergamot-elm; - } + let + pkgs = import nixpkgs { inherit system; }; + bergamot-elm = import ./elm.nix { + inherit (pkgs) lib stdenv; + inherit (pkgs.elmPackages) fetchElmDeps elm; + inherit (pkgs.nodePackages) uglify-js; + }; + in + { + packages = { inherit bergamot-elm; }; + defaultPackage = bergamot-elm; + } ); }