simplify flake
This commit is contained in:
		
							parent
							
								
									e6a7a8e163
								
							
						
					
					
						commit
						073d982d57
					
				
					 1 changed files with 28 additions and 38 deletions
				
			
		
							
								
								
									
										60
									
								
								flake.nix
									
										
									
									
									
								
							
							
						
						
									
										60
									
								
								flake.nix
									
										
									
									
									
								
							|  | @ -23,28 +23,21 @@ | |||
|         "aarch64-darwin" | ||||
|         "x86_64-darwin" | ||||
|       ]; | ||||
|       forAllSystems = lib.genAttrs supported-systems; | ||||
|       make-rust-toolchain-core = | ||||
|         pkgs: | ||||
|         pkgs.symlinkJoin { | ||||
|           name = "rust-toolchain-core"; | ||||
|           paths = with pkgs; [ | ||||
|             rustc | ||||
|             cargo | ||||
|             rustPlatform.rustcSrc | ||||
|           ]; | ||||
|         }; | ||||
|       forAllSystems = | ||||
|         f: | ||||
|         lib.genAttrs supported-systems ( | ||||
|           system: | ||||
|           f rec { | ||||
|             pkgs = nixpkgs.legacyPackages.${system}; | ||||
|             inherit system; | ||||
|           } | ||||
|         ); | ||||
|     in | ||||
|     rec { | ||||
|       packages = forAllSystems ( | ||||
|         system: | ||||
|         { pkgs, ... }: | ||||
|         let | ||||
|           pkgs = nixpkgs.legacyPackages."${system}"; | ||||
|           rust-toolchain-core = make-rust-toolchain-core pkgs; | ||||
|           naersk' = pkgs.callPackage naersk { | ||||
|             cargo = rust-toolchain-core; | ||||
|             rustc = rust-toolchain-core; | ||||
|           }; | ||||
|           naersk' = pkgs.callPackage naersk { }; | ||||
|           nativeBuildInputs = with pkgs; [ | ||||
|             pkg-config | ||||
|             makeWrapper | ||||
|  | @ -69,9 +62,8 @@ | |||
|                   package | ||||
|                 ]; | ||||
|               src = ./.; | ||||
|               nativeBuildInputs = nativeBuildInputs; | ||||
|               inherit nativeBuildInputs buildInputs; | ||||
|               strictDeps = true; | ||||
|               buildInputs = buildInputs; | ||||
|               gitSubmodules = true; | ||||
|               overrideMain = old: { | ||||
|                 preConfigure = '' | ||||
|  | @ -95,9 +87,8 @@ | |||
|               cargoTestOptions = x: x ++ package-param; | ||||
|               src = ./.; | ||||
|               doCheck = true; | ||||
|               nativeBuildInputs = nativeBuildInputs; | ||||
|               strictDeps = true; | ||||
|               buildInputs = buildInputs; | ||||
|               inherit nativeBuildInputs buildInputs; | ||||
|             }; | ||||
|         in | ||||
|         rec { | ||||
|  | @ -130,25 +121,24 @@ | |||
|       legacyPackages = packages; | ||||
| 
 | ||||
|       devShells = forAllSystems ( | ||||
|         system: | ||||
|         let | ||||
|           pkgs = nixpkgs.legacyPackages."${system}"; | ||||
|           rust-toolchain = pkgs.symlinkJoin { | ||||
|         { pkgs, system }: | ||||
|         { | ||||
|           default = pkgs.mkShell rec { | ||||
|             inputsFrom = [ self.packages.${system}.servicepoint ]; | ||||
|             packages = with pkgs; [ | ||||
|               (pkgs.symlinkJoin | ||||
|               { | ||||
|                 name = "rust-toolchain"; | ||||
|                 paths = with pkgs; [ | ||||
|               (make-rust-toolchain-core pkgs) | ||||
|                   rustc | ||||
|                   cargo | ||||
|                   rustPlatform.rustcSrc | ||||
|                   rustfmt | ||||
|                   clippy | ||||
|                   cargo-expand | ||||
|                   cargo-tarpaulin | ||||
|                 ]; | ||||
|           }; | ||||
|         in | ||||
|         { | ||||
|           default = pkgs.mkShell rec { | ||||
|             inputsFrom = [ self.packages.${system}.servicepoint ]; | ||||
|             packages = with pkgs; [ | ||||
|               rust-toolchain | ||||
|               }) | ||||
|               ruby | ||||
|               dotnet-sdk_8 | ||||
|               gcc | ||||
|  | @ -160,6 +150,6 @@ | |||
|         } | ||||
|       ); | ||||
| 
 | ||||
|       formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixfmt-rfc-style); | ||||
|       formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-rfc-style); | ||||
|     }; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vinzenz Schroeter
						Vinzenz Schroeter