build(nix): import flake template

This commit is contained in:
Ananth Venkatesh 2025-01-24 22:07:53 -05:00
parent 7b8dc33f14
commit 96c2705531
Signed by: ananthv
GPG key ID: 4BB578E748CFE4FF
4 changed files with 264 additions and 0 deletions

24
elm.json Normal file
View file

@ -0,0 +1,24 @@
{
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/html": "1.0.0"
},
"indirect": {
"elm/json": "1.1.3",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}

180
flake.lock Normal file
View file

@ -0,0 +1,180 @@
{
"nodes": {
"elm-spa": {
"inputs": {
"nixpkgs": [
"mkElmDerivation",
"nixpkgs"
]
},
"locked": {
"lastModified": 1706301604,
"narHash": "sha256-n6LDjnPCTLbKTrRgeZhlLTfY6V45xNYcb4NYEMuO4jg=",
"owner": "jeslie0",
"repo": "elm-spa",
"rev": "4c82e18d5fcf9d4c027f0ef0e89204dd87584f7f",
"type": "github"
},
"original": {
"owner": "jeslie0",
"repo": "elm-spa",
"type": "github"
}
},
"elm-watch": {
"inputs": {
"nixpkgs": [
"mkElmDerivation",
"nixpkgs"
],
"npm-fix": "npm-fix",
"npmlock2nix": "npmlock2nix"
},
"locked": {
"lastModified": 1706304401,
"narHash": "sha256-992cypnhoRbsGkDc5/X241rafBML4EP0EuT6cBcaY/8=",
"owner": "jeslie0",
"repo": "elm-watch",
"rev": "2f1c6c0e69b163c15e2ce66f543c38021b2a0ea3",
"type": "github"
},
"original": {
"owner": "jeslie0",
"repo": "elm-watch",
"type": "github"
}
},
"mkElmDerivation": {
"inputs": {
"elm-spa": "elm-spa",
"elm-watch": "elm-watch",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1737249952,
"narHash": "sha256-bWOrcJUIW5q9BEmdeaE5XPnHiWuhujeFM23EweNMuO0=",
"owner": "jeslie0",
"repo": "mkElmDerivation",
"rev": "dd8538d8bcddcb7245cfdffffdf8118b0013dc64",
"type": "github"
},
"original": {
"owner": "jeslie0",
"repo": "mkElmDerivation",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1696757521,
"narHash": "sha256-cfgtLNCBLFx2qOzRLI6DHfqTdfWI+UbvsKYa3b3fvaA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2646b294a146df2781b1ca49092450e8a32814e1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1737632463,
"narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0aa475546ed21629c4f5bbf90e38c846a99ec9e9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"npm-fix": {
"inputs": {
"nixpkgs": [
"mkElmDerivation",
"elm-watch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1706304213,
"narHash": "sha256-XN9ESRSOANR0iFbEMMY1C1jvgZlYJsXQYVAHxxRmn+c=",
"owner": "jeslie0",
"repo": "npm-lockfile-fix",
"rev": "e9851274afa12b04d98e694ed089aa9cde8d7349",
"type": "github"
},
"original": {
"owner": "jeslie0",
"repo": "npm-lockfile-fix",
"type": "github"
}
},
"npmlock2nix": {
"flake": false,
"locked": {
"lastModified": 1673447413,
"narHash": "sha256-sJM82Sj8yfQYs9axEmGZ9Evzdv/kDcI9sddqJ45frrU=",
"owner": "nix-community",
"repo": "npmlock2nix",
"rev": "9197bbf397d76059a76310523d45df10d2e4ca81",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "npmlock2nix",
"type": "github"
}
},
"root": {
"inputs": {
"mkElmDerivation": "mkElmDerivation",
"nixpkgs": "nixpkgs_2",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

55
flake.nix Normal file
View file

@ -0,0 +1,55 @@
{
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;
}
);
}

5
src/Main.elm Normal file
View file

@ -0,0 +1,5 @@
module Main exposing (main)
import Html exposing (text)
main = text "Hello, world!"