website/flake.nix
2024-12-08 18:34:16 -08:00

45 lines
1.2 KiB
Nix

{
description = "reidlab.pink";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
package = builtins.fromJSON (builtins.readFile ./package.json);
in
rec {
packages = flake-utils.lib.flattenTree rec {
default = reidlab-pink;
reidlab-pink = pkgs.buildNpmPackage {
pname = package.name;
inherit (package) version;
# uncomment this and let the build fail, then get the current hash
# very scuffed but endorsed!
#npmDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
npmDepsHash = "sha256-aPRFARC1WJsH1NIrm9OmBv/bH9ME1K4apfWqbA+VPf4=";
installPhase = ''
mkdir -p $out
mv ./dist/* $out/
'';
src = ./.;
};
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
nodejs
nodePackages.npm
];
};
});
}