|
2 | 2 | description = "fuzon"; |
3 | 3 |
|
4 | 4 | nixConfig = { |
5 | | - substituters = [ |
6 | | - # Add here some other mirror if needed. |
7 | | - "https://cache.nixos.org/" |
8 | | - ]; |
9 | 5 | extra-substituters = [ |
10 | 6 | # Nix community's cache server |
11 | 7 | "https://nix-community.cachix.org" |
|
35 | 31 | }; |
36 | 32 | }; |
37 | 33 |
|
38 | | - outputs = { |
39 | | - self, |
40 | | - nixpkgs, |
41 | | - flake-utils, |
42 | | - rust-overlay, |
43 | | - ... |
44 | | - }: |
| 34 | + outputs = |
| 35 | + { |
| 36 | + self, |
| 37 | + nixpkgs, |
| 38 | + flake-utils, |
| 39 | + rust-overlay, |
| 40 | + ... |
| 41 | + }: |
45 | 42 | flake-utils.lib.eachDefaultSystem |
46 | | - # Creates an attribute map `{ devShells.<system>.default = ...}` |
47 | | - # by calling this function: |
48 | | - ( |
49 | | - system: let |
50 | | - rootSrc = ./../..; |
51 | | - |
52 | | - overlays = [(import rust-overlay)]; |
53 | | - |
54 | | - # Import nixpkgs and load it into pkgs. |
55 | | - # Overlay the rust toolchain |
56 | | - pkgs = import nixpkgs { |
57 | | - inherit system overlays; |
58 | | - }; |
59 | | - |
60 | | - # Set the rust toolchain from the `rust-toolchain.toml`. |
61 | | - rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ../../rust-toolchain.toml; |
62 | | - |
63 | | - # Things needed only at compile-time. |
64 | | - basic-deps = with pkgs; [ |
65 | | - maturin |
66 | | - findutils |
67 | | - coreutils |
68 | | - bash |
69 | | - zsh |
70 | | - curl |
71 | | - git |
72 | | - jq |
73 | | - ]; |
74 | | - |
75 | | - # Things needed only at compile-time. |
76 | | - general-deps = [ |
77 | | - rustToolchain |
78 | | - pkgs.cargo-watch |
79 | | - pkgs.just |
80 | | - |
81 | | - pkgs.skopeo |
82 | | - pkgs.dasel |
83 | | - pkgs.python313 |
84 | | - ]; |
85 | | - |
86 | | - benchmark-deps = with pkgs; [ |
87 | | - hyperfine |
88 | | - heaptrack |
89 | | - ]; |
90 | | - |
91 | | - # The package of this CLI tool. |
92 | | - # The global version for fuzon. |
93 | | - # This is gonna get tooled later. |
94 | | - fuzon = pkgs.callPackage ./pkgs/fuzon { |
95 | | - inherit rootSrc; |
96 | | - inherit rustToolchain; |
97 | | - }; |
98 | | - in rec { |
99 | | - devShells = { |
100 | | - default = pkgs.mkShell { |
101 | | - packages = basic-deps ++ general-deps; |
| 43 | + # Creates an attribute map `{ devShells.<system>.default = ...}` |
| 44 | + # by calling this function: |
| 45 | + ( |
| 46 | + system: |
| 47 | + let |
| 48 | + rootSrc = ./../..; |
| 49 | + |
| 50 | + overlays = [ (import rust-overlay) ]; |
| 51 | + |
| 52 | + # Import nixpkgs and load it into pkgs. |
| 53 | + # Overlay the rust toolchain |
| 54 | + pkgs = import nixpkgs { |
| 55 | + inherit system overlays; |
| 56 | + }; |
| 57 | + |
| 58 | + # Set the rust toolchain from the `rust-toolchain.toml`. |
| 59 | + rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ../../rust-toolchain.toml; |
| 60 | + |
| 61 | + # Things needed only at compile-time. |
| 62 | + basic-deps = with pkgs; [ |
| 63 | + maturin |
| 64 | + findutils |
| 65 | + coreutils |
| 66 | + bash |
| 67 | + zsh |
| 68 | + curl |
| 69 | + git |
| 70 | + jq |
| 71 | + ]; |
| 72 | + |
| 73 | + # Things needed only at compile-time. |
| 74 | + general-deps = [ |
| 75 | + rustToolchain |
| 76 | + pkgs.cargo-watch |
| 77 | + pkgs.just |
| 78 | + |
| 79 | + pkgs.skopeo |
| 80 | + pkgs.dasel |
| 81 | + pkgs.python313 |
| 82 | + ]; |
| 83 | + |
| 84 | + benchmark-deps = with pkgs; [ |
| 85 | + hyperfine |
| 86 | + heaptrack |
| 87 | + ]; |
| 88 | + |
| 89 | + # The package of this CLI tool. |
| 90 | + # The global version for fuzon. |
| 91 | + # This is gonna get tooled later. |
| 92 | + fuzon = pkgs.callPackage ./pkgs/fuzon { |
| 93 | + inherit rootSrc; |
| 94 | + inherit rustToolchain; |
102 | 95 | }; |
103 | | - bench = pkgs.mkShell { |
104 | | - packages = |
105 | | - basic-deps |
106 | | - ++ general-deps |
107 | | - ++ benchmark-deps; |
| 96 | + in |
| 97 | + rec { |
| 98 | + devShells = { |
| 99 | + default = pkgs.mkShell { |
| 100 | + packages = basic-deps ++ general-deps; |
| 101 | + }; |
| 102 | + bench = pkgs.mkShell { |
| 103 | + packages = basic-deps ++ general-deps ++ benchmark-deps; |
| 104 | + }; |
108 | 105 | }; |
109 | | - }; |
110 | 106 |
|
111 | | - packages = { |
112 | | - fuzon = fuzon; |
| 107 | + packages = { |
| 108 | + fuzon = fuzon; |
113 | 109 |
|
114 | | - images = { |
115 | | - dev = (import ./images/dev.nix) { |
116 | | - inherit pkgs; |
117 | | - devShellDrv = devShells.default; |
118 | | - }; |
| 110 | + images = { |
| 111 | + dev = (import ./images/dev.nix) { |
| 112 | + inherit pkgs; |
| 113 | + devShellDrv = devShells.default; |
| 114 | + }; |
119 | 115 |
|
120 | | - fuzon = (import ./images/fuzon.nix) { |
121 | | - inherit pkgs fuzon; |
| 116 | + fuzon = (import ./images/fuzon.nix) { |
| 117 | + inherit pkgs fuzon; |
| 118 | + }; |
122 | 119 | }; |
123 | 120 | }; |
124 | | - }; |
125 | | - } |
126 | | - ); |
| 121 | + } |
| 122 | + ); |
127 | 123 | } |
0 commit comments