56 lines
1.3 KiB
Nix
56 lines
1.3 KiB
Nix
{
|
|
description = "Flake for building the MacGregor House website";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
utils.url = "github:numtide/flake-utils";
|
|
mkElmDerivation.url = "github:jeslie0/mkElmDerivation";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
utils,
|
|
mkElmDerivation,
|
|
}:
|
|
utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
overlays = [ mkElmDerivation.overlays.mkElmDerivation ];
|
|
inherit system;
|
|
};
|
|
in
|
|
{
|
|
devShells.default =
|
|
with pkgs;
|
|
mkShell {
|
|
buildInputs = [
|
|
elmPackages.elm
|
|
elmPackages.elm-test
|
|
elmPackages.elm-format
|
|
entr
|
|
];
|
|
};
|
|
|
|
packages = {
|
|
default = pkgs.mkElmDerivation {
|
|
name = "macgregor";
|
|
src = ./.;
|
|
elmJson = ./elm.json;
|
|
nativeBuildInputs = [ pkgs.elmPackages.elm ];
|
|
buildPhase = ''
|
|
elm make src/Main.elm --output Main.js --optimize
|
|
'';
|
|
installPhase = ''
|
|
mkdir $out
|
|
cp Main.js $out
|
|
'';
|
|
};
|
|
};
|
|
|
|
formatter = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
|
|
}
|
|
);
|
|
}
|