Add rust-src toolchain component
Provides sources of standard library, e.g. for rust-analyzer.
This commit is contained in:
		
							parent
							
								
									f381b8a291
								
							
						
					
					
						commit
						fbef9e0916
					
				
					 1 changed files with 10 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -22,13 +22,17 @@
 | 
			
		|||
          rustToolchain =
 | 
			
		||||
            let
 | 
			
		||||
              rust = super.rust-bin;
 | 
			
		||||
              toolchain =
 | 
			
		||||
                if builtins.pathExists ./rust-toolchain.toml then
 | 
			
		||||
                  rust.fromRustupToolchainFile ./rust-toolchain.toml
 | 
			
		||||
                else if builtins.pathExists ./rust-toolchain then
 | 
			
		||||
                  rust.fromRustupToolchainFile ./rust-toolchain
 | 
			
		||||
                else
 | 
			
		||||
                  rust.stable.latest.default;
 | 
			
		||||
            in
 | 
			
		||||
            if builtins.pathExists ./rust-toolchain.toml then
 | 
			
		||||
              rust.fromRustupToolchainFile ./rust-toolchain.toml
 | 
			
		||||
            else if builtins.pathExists ./rust-toolchain then
 | 
			
		||||
              rust.fromRustupToolchainFile ./rust-toolchain
 | 
			
		||||
            else
 | 
			
		||||
              rust.stable.latest.default;
 | 
			
		||||
            toolchain.override {
 | 
			
		||||
              extensions = [ "rust-src" ]; # https://github.com/the-nix-way/dev-templates/issues/4
 | 
			
		||||
            };
 | 
			
		||||
        })
 | 
			
		||||
      ];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue