Nix flake to build latest versions of various dev tools
1{
2 description = "Various dev tools I often want to install from source";
3
4 inputs = {
5 fish.url = "github:fish-shell/fish-shell/4.1.2";
6 fish.flake = false;
7 jj.url = "github:jj-vcs/jj/v0.34.0";
8 jj.inputs.nixpkgs.follows = "nixpkgs";
9 helix.url = "github:helix-editor/helix";
10 helix.inputs.nixpkgs.follows = "nixpkgs";
11 helix.inputs.rust-overlay.follows = "jj/rust-overlay";
12
13 ghostty.url = "github:ghostty-org/ghostty/v1.2.0";
14 ghostty.inputs.nixpkgs.follows = "nixpkgs";
15 ghostty.inputs.zon2nix.inputs.nixpkgs.follows = "nixpkgs";
16
17 gleam-nix.url = "github:vic/gleam-nix";
18 gleam-nix.inputs.gleam.url = "github:gleam-lang/gleam/v1.13.0-rc1";
19 gleam-nix.inputs.nixpkgs.follows = "nixpkgs";
20 gleam-nix.inputs.rust-manifest.url = "file+https://static.rust-lang.org/dist/channel-rust-1.88.0.toml";
21 janet.url = "github:janet-lang/janet/v1.39.1";
22 janet.flake = false;
23 };
24
25 outputs =
26 { nixpkgs, ... }@inputs:
27 let
28 forAllSystems =
29 mkOutputs:
30 nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
31 system: mkOutputs nixpkgs.legacyPackages.${system}
32 );
33 in
34 {
35 packages = forAllSystems (pkgs: {
36 fish = pkgs.fish.overrideAttrs (
37 finalAttrs: previousAttrs: {
38 src = inputs.fish;
39 version = pkgs.lib.pipe "${inputs.fish}/Cargo.toml" [
40 builtins.readFile
41 (builtins.match ''.+"fish".version = "([^"]+)".*'')
42 (ver: builtins.elemAt ver 0)
43 ];
44 cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
45 inherit (finalAttrs) src patches;
46 hash = "sha256-7mYWCHH6DBWTIJV8GPRjjf6QulwlYjwv0slablDvBF8=";
47 };
48 postPatch =
49 builtins.replaceStrings [ "src/tests/highlight.rs" ] [ "src/highlight/tests.rs" ]
50 previousAttrs.postPatch;
51 }
52 );
53
54 jj = inputs.jj.packages.${pkgs.system}.default;
55 helix = inputs.helix.packages.${pkgs.system}.default;
56 ghostty = inputs.ghostty.packages.${pkgs.system}.default;
57
58 gleam = inputs.gleam-nix.packages.${pkgs.system}.default;
59 janet = pkgs.janet.overrideAttrs {
60 src = inputs.janet;
61 version = inputs.janet.shortRev;
62 };
63
64 default = pkgs.buildEnv {
65 name = "pvsr-src-apps";
66 paths = with inputs.self.packages.${pkgs.system}; [
67 jj
68 helix
69 ghostty
70 gleam
71 janet
72 ];
73 };
74 });
75 };
76}