File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ description = "A simple web application" ;
3
+
4
+ inputs = {
5
+ nixpkgs . url = "github:NixOS/nixpkgs/nixos-unstable" ;
6
+ flake-utils . url = "github:numtide/flake-utils" ;
7
+ } ;
8
+
9
+ outputs = { self , nixpkgs , flake-utils } :
10
+ flake-utils . lib . eachDefaultSystem ( system :
11
+ let
12
+ pkgs = nixpkgs . legacyPackages . ${ system } ;
13
+ in
14
+ {
15
+ # Development environment
16
+ devShells . default = pkgs . mkShell {
17
+ buildInputs = with pkgs ; [
18
+ nodejs_20
19
+ yarn
20
+ ] ;
21
+ } ;
22
+
23
+ # Build the application
24
+ packages . default = pkgs . stdenv . mkDerivation {
25
+ name = "my-web-app" ;
26
+ version = "1.0.0" ;
27
+ src = ./src ;
28
+
29
+ buildInputs = with pkgs ; [
30
+ nodejs_20
31
+ yarn
32
+ ] ;
33
+
34
+ buildPhase = ''
35
+ yarn install
36
+ yarn build
37
+ '' ;
38
+
39
+ installPhase = ''
40
+ mkdir -p $out/bin
41
+ cp -r dist/* $out/bin/
42
+ '' ;
43
+ } ;
44
+ }
45
+ ) ;
46
+ }
You can’t perform that action at this time.
0 commit comments