aboutsummaryrefslogtreecommitdiff
path: root/front.nix
diff options
context:
space:
mode:
authorStanisław Zagórowski <hasohasacz@gmail.com>2024-01-02 01:04:54 +0100
committerStanisław Zagórowski <hasohasacz@gmail.com>2024-01-02 01:04:54 +0100
commit05dbebd651abf96b9785d43c75b32ca3b3ccfe13 (patch)
tree533e066a761fa3057050131a308d2d429dc571ad /front.nix
parent6fd24189446386b5df8846a35fd108a91c7257a5 (diff)
nix: add flake and front derivation
Diffstat (limited to 'front.nix')
-rw-r--r--front.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/front.nix b/front.nix
new file mode 100644
index 0000000..f3cb562
--- /dev/null
+++ b/front.nix
@@ -0,0 +1,22 @@
+{ pkgs ? import <nixpkgs> {} }:
+ let
+ nodeDependencies = (pkgs.callPackage ./front/default.nix {}).nodeDependencies;
+ stdenv = pkgs.stdenv;
+ nodejs = pkgs.nodejs;
+ tsc = pkgs.typescript;
+ in
+
+ stdenv.mkDerivation {
+ name = "duckonaut.dev-front";
+ src = ./front;
+ buildInputs = [nodejs tsc];
+ buildPhase = ''
+ ln -s ${nodeDependencies}/lib/node_modules ./node_modules
+ export PATH="${nodeDependencies}/bin:$PATH"
+ echo "PATH: $PATH"
+
+ # Build the distribution bundle in "dist"
+ npm run build
+ cp -r dist $out/
+ '';
+ }