erratic-gate/flake.nix

64 lines
1.7 KiB
Nix
Raw Normal View History

{
2023-10-29 04:54:24 +01:00
description = "Logic gate simulator";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { nixpkgs, flake-utils, ... }:
2023-10-29 05:46:53 +01:00
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in
rec {
packages.erratic-gate = pkgs.buildNpmPackage {
name = "erratic-gate";
buildInputs = [ pkgs.nodejs_18 ];
src = pkgs.lib.cleanSource ./.;
npmDepsHash = "sha256-f5mw6IjkhZgsIuzCz9d7DvoAdceY1y+yWXn1BOonsVI=";
2023-10-29 06:28:40 +01:00
ESBUILD_BASEURL = "";
2023-10-29 05:46:53 +01:00
installPhase = ''
mkdir $out
cp -r dist $out/www
'';
};
2023-10-29 06:28:40 +01:00
packages.erratic-gate-github-pages = packages.erratic-gate.overrideAttrs {
ESBUILD_BASEURL = "/erratic-gate";
};
2023-10-29 05:46:53 +01:00
packages.default = packages.erratic-gate;
devShells.default =
pkgs.mkShell {
buildInputs = with pkgs;
with nodePackages_latest; [
2023-10-29 04:54:24 +01:00
nodejs
];
2023-10-29 05:46:53 +01:00
};
apps.compute-npm-dep-hash = {
type = "app";
program = pkgs.lib.getExe (pkgs.writeShellApplication {
name = "generate-layout-previes";
runtimeInputs = [ pkgs.prefetch-npm-deps ];
text = "prefetch-npm-deps ./package-lock.json";
});
};
}
);
2023-10-29 03:14:12 +01:00
# {{{ Caching and whatnot
nixConfig = {
# extra-substituters = [
# "erratic-gate.cachix.org-1:Ijiu/v//aVpKO4xBqV+2AM2s2uQYOnGCfoj9fYRXxtk" # I think I need this for neovim-nightly?
# ];
#
# extra-trusted-public-keys = [
# "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
# ];
};
# }}}
}
2023-10-29 05:46:53 +01:00