summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 00000000..f0f6389a
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,35 @@
+{
+  description = "Spacebar server, written in Typescript.";
+
+  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+  inputs.flake-utils.url = "github:numtide/flake-utils";
+
+  outputs = { self, nixpkgs, flake-utils }:
+    flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
+	let
+		pkgs = import nixpkgs {
+			inherit system;
+		};
+	in rec {
+		packages.default = pkgs.buildNpmPackage {
+			pname = "spacebar-server-ts";
+			src = ./.;
+			name = "spacebar-server-ts";
+			meta.mainProgram = "start-bundle";
+
+			#nativeBuildInputs = with pkgs; [ python3 ];
+			npmDepsHash = "sha256-9yyOPogFi71Dcm7DKe4FJJz9d6uDtJsliDR+b32KKvA=";
+			#makeCacheWritable = true;
+			postPatch = ''
+				substituteInPlace package.json --replace 'npx patch-package' '${pkgs.nodePackages.patch-package}/bin/patch-package'
+			'';
+		};
+		devShell = pkgs.mkShell {
+			buildInputs = with pkgs; [
+				nodejs
+				nodePackages.typescript
+			];
+		};
+	}
+    );
+}