Add Nix env
This commit is contained in:
		
							parent
							
								
									ac533001c5
								
							
						
					
					
						commit
						055d5ea784
					
				
					 12 changed files with 101 additions and 24 deletions
				
			
		
							
								
								
									
										1
									
								
								nix/.envrc
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								nix/.envrc
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
use flake .
 | 
			
		||||
							
								
								
									
										42
									
								
								nix/flake.lock
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								nix/flake.lock
									
										
									
										generated
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,42 @@
 | 
			
		|||
{
 | 
			
		||||
  "nodes": {
 | 
			
		||||
    "flake-utils": {
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1656928814,
 | 
			
		||||
        "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
 | 
			
		||||
        "owner": "numtide",
 | 
			
		||||
        "repo": "flake-utils",
 | 
			
		||||
        "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
        "owner": "numtide",
 | 
			
		||||
        "repo": "flake-utils",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nixpkgs": {
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1659045899,
 | 
			
		||||
        "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=",
 | 
			
		||||
        "owner": "NixOS",
 | 
			
		||||
        "repo": "nixpkgs",
 | 
			
		||||
        "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
        "owner": "NixOS",
 | 
			
		||||
        "repo": "nixpkgs",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "root": {
 | 
			
		||||
      "inputs": {
 | 
			
		||||
        "flake-utils": "flake-utils",
 | 
			
		||||
        "nixpkgs": "nixpkgs"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "root": "root",
 | 
			
		||||
  "version": 7
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										31
									
								
								nix/flake.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								nix/flake.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,31 @@
 | 
			
		|||
{
 | 
			
		||||
  description = "A Nix-flake-based Zig development environment";
 | 
			
		||||
 | 
			
		||||
  inputs = {
 | 
			
		||||
    nixpkgs.url = "github:NixOS/nixpkgs";
 | 
			
		||||
    flake-utils.url = "github:numtide/flake-utils";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  outputs = { self, nixpkgs, flake-utils }:
 | 
			
		||||
    flake-utils.lib.eachDefaultSystem (system:
 | 
			
		||||
      let
 | 
			
		||||
        pkgs = import nixpkgs { inherit system; };
 | 
			
		||||
 | 
			
		||||
        nix = pkgs.nixUnstable;
 | 
			
		||||
 | 
			
		||||
        helpers = with pkgs; [ nixpkgs-fmt statix ];
 | 
			
		||||
 | 
			
		||||
        inherit (pkgs) mkShell;
 | 
			
		||||
      in {
 | 
			
		||||
        devShells = {
 | 
			
		||||
          default = pkgs.mkShell {
 | 
			
		||||
            buildInputs = [ nix ] ++ helpers;
 | 
			
		||||
 | 
			
		||||
            shellHook = ''
 | 
			
		||||
              ${nix}/bin/nix --version
 | 
			
		||||
            '';
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue