summaryrefslogtreecommitdiff
path: root/flake.nix
blob: cbbef9b9f7d965a1579161debef421e93ab71aaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  description = "Celeste key overlay";
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  outputs = { self, nixpkgs }: let
    systems = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"];
    forEachSystem = fn: lib.genAttrs systems (system: fn (import nixpkgs {inherit system;}));
    inherit (nixpkgs) lib;
  in {
    devShells = forEachSystem (pkgs: {
      default = pkgs.mkShell {
        name = "key-overlay";
        packages = with pkgs; [
          bun
          typescript
          assemblyscript
          esbuild
        ];
      };
    });
    packages = forEachSystem (pkgs: rec {
      default = pkgs.buildNpmPackage {
        pname = "webnodes";
        version = "0.1.0";
        src = ./.;
        #forceEmptyCache = true;
        npmDepsHash = "sha256-hiGb2+LpdxNs36aiB/aEX3MarEFidMezrmxzutulmVw=";
      };
      image = pkgs.dockerTools.buildLayeredImage {
	name = "webnodes";
	tag = "latest";
	config.Cmd = [
	  "${pkgs.pkgsStatic.pocketbase}/bin/pocketbase"
	  "--http" "0.0.0.0:8000"
	  #"--publicDir" "${default}/lib/node_modules/webnodes"
	];
      };
    });
  };
}