TL;DR: - include a default.nix to allow users to build an named executable - emphasize in the README that the user needs Nix to build this project - pin nixpkgs to a specific commit and fetch it from GitHub
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			605 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			605 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| let
 | |
|   pkgs = import (builtins.fetchGit {
 | |
|     url = "https://github.com/NixOS/nixpkgs-channels";
 | |
|     ref = "nixos-20.03";
 | |
|     rev = "afa9ca61924f05aacfe495a7ad0fd84709d236cc";
 | |
|   }) {};
 | |
| 
 | |
|   ghc = pkgs.haskellPackages.ghcWithPackages (hpkgs: [
 | |
|     hpkgs.optparse-applicative
 | |
|     hpkgs.unordered-containers
 | |
|   ]);
 | |
| in pkgs.stdenv.mkDerivation {
 | |
|   name = "transform-keyboard";
 | |
|   buildInputs = [];
 | |
|   src = builtins.path {
 | |
|     path = ./.;
 | |
|     name = "transform-keyboard-src";
 | |
|   };
 | |
|   buildPhase = ''
 | |
|     ${ghc}/bin/ghc ./Main.hs
 | |
|   '';
 | |
|   installPhase = ''
 | |
|     mkdir -p $out && mv Main $out/transform-keyboard
 | |
|   '';
 | |
| }
 |