macgregor/flake.nix

56 lines
1.3 KiB
Nix
Raw Normal View History

2025-01-25 03:07:53 +00:00
{
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
];
};
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;
}
);
}