fork/helix
git clone https://git.julia.blue/fork/helix
bfd2c727
25.07.1
1{ 2description = "A post-modern text editor." ; 3 4inputs = { 5nixpkgs . url = "github:nixos/nixpkgs/nixos-unstable" ; 6rust-overlay = { 7url = "github:oxalica/rust-overlay" ; 8inputs . nixpkgs . follows = "nixpkgs" ; 9}; 10}; 11 12outputs = { 13self , 14nixpkgs , 15rust-overlay , 16 ... 17} :let 18inherit ( nixpkgs ) lib ; 19systems = [ 20"x86_64-linux" 21"aarch64-linux" 22"x86_64-darwin" 23"aarch64-darwin" 24]; 25eachSystem = lib . genAttrs systems ; 26pkgsFor = eachSystem ( system : 27import nixpkgs { 28localSystem . system = system ; 29overlays = [( import rust-overlay ) self . overlays . helix ]; 30}); 31gitRev = self . rev or self . dirtyRev or null ; 32in { 33packages = eachSystem ( system :{ 34inherit ( pkgsFor .${ system }) helix ; 35/* 36The default Helix build. Uses the latest stable Rust toolchain, and unstable 37nixpkgs. 38 39The build inputs can be overridden with the following: 40 41packages.${system}.default.override { rustPlatform = newPlatform; }; 42 43Overriding a derivation attribute can be done as well: 44 45packages.${system}.default.overrideAttrs { buildType = "debug"; }; 46*/ 47default = self . packages .${ system }. helix ; 48}); 49checks = 50lib . mapAttrs ( system :pkgs :let 51# Get Helix's MSRV toolchain to build with by default. 52msrvToolchain = pkgs . pkgsBuildHost . rust-bin . fromRustupToolchainFile ./rust-toolchain.toml ; 53msrvPlatform = pkgs . makeRustPlatform { 54cargo = msrvToolchain ; 55rustc = msrvToolchain ; 56}; 57in { 58helix = self . packages .${ system }. helix . override { 59rustPlatform = msrvPlatform ; 60}; 61}) 62pkgsFor ; 63 64# Devshell behavior is preserved. 65devShells = 66lib . mapAttrs ( system :pkgs :{ 67default = let 68commonRustFlagsEnv = "-C link-arg=-fuse-ld=lld -C target-cpu=native --cfg tokio_unstable" ; 69platformRustFlagsEnv = lib . optionalString pkgs . stdenv . isLinux "-Clink-arg=-Wl,--no-rosegment" ; 70in 71pkgs . mkShell { 72inputsFrom = [ self . checks .${ system }. helix ]; 73nativeBuildInputs = with pkgs ; 74[ 75lld 76cargo-flamegraph 77rust-bin . nightly . latest . rust-analyzer 78] 79++ ( lib . optional ( stdenv . isx86_64 && stdenv . isLinux ) cargo-tarpaulin ) 80++ ( lib . optional stdenv . isLinux lldb ) 81++ ( lib . optional stdenv . isDarwin darwin . apple_sdk . frameworks . CoreFoundation ); 82shellHook = '' 83export RUST_BACKTRACE ="1" 84export RUSTFLAGS ="'' $ { RUSTFLAGS:- "" } ${ commonRustFlagsEnv } ${ platformRustFlagsEnv } " 85'' ; 86}; 87}) 88pkgsFor ; 89 90overlays = { 91helix = final :prev :{ 92helix = final . callPackage ./default.nix { inherit gitRev ;}; 93}; 94 95default = self . overlays . helix ; 96}; 97}; 98nixConfig = { 99extra-substituters = [ "https://helix.cachix.org" ]; 100extra-trusted-public-keys = [ "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" ]; 101}; 102}