Add nixos build script
This commit is contained in:
		
							parent
							
								
									06ac44e56d
								
							
						
					
					
						commit
						1160d96b06
					
				
					 2 changed files with 35 additions and 0 deletions
				
			
		
							
								
								
									
										28
									
								
								default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,28 @@
 | 
			
		|||
{ pkgs ? import <nixpkgs> {} }:
 | 
			
		||||
 | 
			
		||||
with pkgs;
 | 
			
		||||
 | 
			
		||||
# TODO: Once https://github.com/svanderburg/node2nix/issues/184 is
 | 
			
		||||
# fixed, use a proper nixos package instead of a tarball.
 | 
			
		||||
stdenv.mkDerivation {
 | 
			
		||||
  pname = "tlaternet-templates";
 | 
			
		||||
  version = "1.0";
 | 
			
		||||
  src = ./dist.tar.gz;
 | 
			
		||||
  installPhase = ''
 | 
			
		||||
    mkdir -p $out/srv/
 | 
			
		||||
    mv browser $out/srv/web
 | 
			
		||||
  '';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# let
 | 
			
		||||
#   nodePackages = import ./node-packages.nix {
 | 
			
		||||
#     inherit pkgs;
 | 
			
		||||
#   };
 | 
			
		||||
 | 
			
		||||
# in
 | 
			
		||||
# nodePackages.package.override {
 | 
			
		||||
#   buildInputs = [ pkgs.nodePackages.node-gyp-build ];
 | 
			
		||||
#   postInstall = ''
 | 
			
		||||
#     npm run build-dist
 | 
			
		||||
#   '';
 | 
			
		||||
# }
 | 
			
		||||
							
								
								
									
										7
									
								
								generate.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								generate.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
#!/usr/bin/env nix-shell
 | 
			
		||||
#! nix-shell -i bash -p nodePackages.node2nix
 | 
			
		||||
set -euo pipefail
 | 
			
		||||
 | 
			
		||||
node2nix --input package.json \
 | 
			
		||||
         --output node-packages-generated.nix \
 | 
			
		||||
         --composition node-packages.nix
 | 
			
		||||
		Reference in a new issue