this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

dev: switch flake to use flake-parts and nci

+243 -119
+186 -43
flake.lock
··· 1 1 { 2 2 "nodes": { 3 - "fenix": { 3 + "crane": { 4 + "flake": false, 5 + "locked": { 6 + "lastModified": 1681175776, 7 + "narHash": "sha256-7SsUy9114fryHAZ8p1L6G6YSu7jjz55FddEwa2U8XZc=", 8 + "owner": "ipetkov", 9 + "repo": "crane", 10 + "rev": "445a3d222947632b5593112bb817850e8a9cf737", 11 + "type": "github" 12 + }, 13 + "original": { 14 + "owner": "ipetkov", 15 + "ref": "v0.12.1", 16 + "repo": "crane", 17 + "type": "github" 18 + } 19 + }, 20 + "dream2nix": { 4 21 "inputs": { 22 + "all-cabal-json": [ 23 + "nci" 24 + ], 25 + "crane": "crane", 26 + "devshell": [ 27 + "nci" 28 + ], 29 + "drv-parts": "drv-parts", 30 + "flake-compat": "flake-compat", 31 + "flake-parts": [ 32 + "nci", 33 + "parts" 34 + ], 35 + "flake-utils-pre-commit": [ 36 + "nci" 37 + ], 38 + "ghc-utils": [ 39 + "nci" 40 + ], 41 + "gomod2nix": [ 42 + "nci" 43 + ], 44 + "mach-nix": [ 45 + "nci" 46 + ], 47 + "nix-pypi-fetcher": [ 48 + "nci" 49 + ], 5 50 "nixpkgs": [ 51 + "nci", 6 52 "nixpkgs" 7 53 ], 8 - "rust-analyzer-src": "rust-analyzer-src" 54 + "nixpkgsV1": "nixpkgsV1", 55 + "poetry2nix": [ 56 + "nci" 57 + ], 58 + "pre-commit-hooks": [ 59 + "nci" 60 + ], 61 + "pruned-racket-catalog": [ 62 + "nci" 63 + ] 9 64 }, 10 65 "locked": { 11 - "lastModified": 1687242195, 12 - "narHash": "sha256-UAmcSAe456dkgM37p5rAmoobnwSFASIjq0C/HYBY5OQ=", 66 + "lastModified": 1688815683, 67 + "narHash": "sha256-mGeQgTcAltpQlr3KUBA1WoGBQadq6OAhuF864ci4+vI=", 13 68 "owner": "nix-community", 14 - "repo": "fenix", 15 - "rev": "0ed0225cee3a10ae7bd9247aef9e9709db03e1d9", 69 + "repo": "dream2nix", 70 + "rev": "99373e29568de05287d391a745947154ddbf4e3e", 16 71 "type": "github" 17 72 }, 18 73 "original": { 19 74 "owner": "nix-community", 20 - "repo": "fenix", 75 + "ref": "legacy", 76 + "repo": "dream2nix", 77 + "type": "github" 78 + } 79 + }, 80 + "drv-parts": { 81 + "inputs": { 82 + "flake-compat": [ 83 + "nci", 84 + "dream2nix", 85 + "flake-compat" 86 + ], 87 + "flake-parts": [ 88 + "nci", 89 + "dream2nix", 90 + "flake-parts" 91 + ], 92 + "nixpkgs": [ 93 + "nci", 94 + "dream2nix", 95 + "nixpkgs" 96 + ] 97 + }, 98 + "locked": { 99 + "lastModified": 1680698112, 100 + "narHash": "sha256-FgnobN/DvCjEsc0UAZEAdPLkL4IZi2ZMnu2K2bUaElc=", 101 + "owner": "davhau", 102 + "repo": "drv-parts", 103 + "rev": "e8c2ec1157dc1edb002989669a0dbd935f430201", 104 + "type": "github" 105 + }, 106 + "original": { 107 + "owner": "davhau", 108 + "repo": "drv-parts", 21 109 "type": "github" 22 110 } 23 111 }, ··· 37 125 "type": "github" 38 126 } 39 127 }, 128 + "flake-compat_2": { 129 + "flake": false, 130 + "locked": { 131 + "lastModified": 1673956053, 132 + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", 133 + "owner": "edolstra", 134 + "repo": "flake-compat", 135 + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", 136 + "type": "github" 137 + }, 138 + "original": { 139 + "owner": "edolstra", 140 + "repo": "flake-compat", 141 + "type": "github" 142 + } 143 + }, 40 144 "flake-utils": { 41 145 "inputs": { 42 146 "systems": "systems" 43 147 }, 44 148 "locked": { 45 - "lastModified": 1687171271, 46 - "narHash": "sha256-BJlq+ozK2B1sJDQXS3tzJM5a+oVZmi1q0FlBK/Xqv7M=", 149 + "lastModified": 1689068808, 150 + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", 47 151 "owner": "numtide", 48 152 "repo": "flake-utils", 49 - "rev": "abfb11bd1aec8ced1c9bb9adfe68018230f4fb3c", 153 + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", 50 154 "type": "github" 51 155 }, 52 156 "original": { ··· 76 180 "type": "github" 77 181 } 78 182 }, 79 - "naersk": { 183 + "mk-naked-shell": { 184 + "flake": false, 185 + "locked": { 186 + "lastModified": 1681286841, 187 + "narHash": "sha256-3XlJrwlR0nBiREnuogoa5i1b4+w/XPe0z8bbrJASw0g=", 188 + "owner": "yusdacra", 189 + "repo": "mk-naked-shell", 190 + "rev": "7612f828dd6f22b7fb332cc69440e839d7ffe6bd", 191 + "type": "github" 192 + }, 193 + "original": { 194 + "owner": "yusdacra", 195 + "repo": "mk-naked-shell", 196 + "type": "github" 197 + } 198 + }, 199 + "nci": { 80 200 "inputs": { 201 + "dream2nix": "dream2nix", 202 + "mk-naked-shell": "mk-naked-shell", 81 203 "nixpkgs": [ 82 204 "nixpkgs" 83 - ] 205 + ], 206 + "parts": [ 207 + "parts" 208 + ], 209 + "rust-overlay": "rust-overlay" 84 210 }, 85 211 "locked": { 86 - "lastModified": 1686572087, 87 - "narHash": "sha256-jXTut7ZSYqLEgm/nTk7TuVL2ExahTip605bLINklAnQ=", 88 - "owner": "nix-community", 89 - "repo": "naersk", 90 - "rev": "8507af04eb40c5520bd35d9ce6f9d2342cea5ad1", 212 + "lastModified": 1690265492, 213 + "narHash": "sha256-Of8stm/ij0LKCQzJw2JcSGJuHJH/kzavTudoEomvOEg=", 214 + "owner": "yusdacra", 215 + "repo": "nix-cargo-integration", 216 + "rev": "d486db902946bcbada2853b7ef0c29bd46579411", 91 217 "type": "github" 92 218 }, 93 219 "original": { 94 - "owner": "nix-community", 95 - "repo": "naersk", 220 + "owner": "yusdacra", 221 + "repo": "nix-cargo-integration", 96 222 "type": "github" 97 223 } 98 224 }, ··· 112 238 "type": "github" 113 239 } 114 240 }, 115 - "nixpkgs-stable": { 241 + "nixpkgsV1": { 116 242 "locked": { 117 - "lastModified": 1685801374, 118 - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", 243 + "lastModified": 1686501370, 244 + "narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=", 119 245 "owner": "NixOS", 120 246 "repo": "nixpkgs", 121 - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", 247 + "rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519", 122 248 "type": "github" 123 249 }, 124 250 "original": { 125 - "owner": "NixOS", 126 - "ref": "nixos-23.05", 127 - "repo": "nixpkgs", 251 + "id": "nixpkgs", 252 + "ref": "nixos-unstable", 253 + "type": "indirect" 254 + } 255 + }, 256 + "parts": { 257 + "inputs": { 258 + "nixpkgs-lib": [ 259 + "nixpkgs" 260 + ] 261 + }, 262 + "locked": { 263 + "lastModified": 1688466019, 264 + "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", 265 + "owner": "hercules-ci", 266 + "repo": "flake-parts", 267 + "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", 268 + "type": "github" 269 + }, 270 + "original": { 271 + "owner": "hercules-ci", 272 + "repo": "flake-parts", 128 273 "type": "github" 129 274 } 130 275 }, 131 276 "pre-commit-hooks": { 132 277 "inputs": { 133 - "flake-compat": "flake-compat", 134 - "flake-utils": [ 135 - "flake-utils" 136 - ], 278 + "flake-compat": "flake-compat_2", 279 + "flake-utils": "flake-utils", 137 280 "gitignore": "gitignore", 138 281 "nixpkgs": [ 139 282 "nixpkgs" 140 283 ], 141 - "nixpkgs-stable": "nixpkgs-stable" 284 + "nixpkgs-stable": [ 285 + "nixpkgs" 286 + ] 142 287 }, 143 288 "locked": { 144 289 "lastModified": 1687251716, ··· 156 301 }, 157 302 "root": { 158 303 "inputs": { 159 - "fenix": "fenix", 160 - "flake-utils": "flake-utils", 161 - "naersk": "naersk", 304 + "nci": "nci", 162 305 "nixpkgs": "nixpkgs", 306 + "parts": "parts", 163 307 "pre-commit-hooks": "pre-commit-hooks" 164 308 } 165 309 }, 166 - "rust-analyzer-src": { 310 + "rust-overlay": { 167 311 "flake": false, 168 312 "locked": { 169 - "lastModified": 1687203733, 170 - "narHash": "sha256-7waTnMILpt2nf+dOqrrCmln/5vn8uE0cBuG0HjgrRaA=", 171 - "owner": "rust-lang", 172 - "repo": "rust-analyzer", 173 - "rev": "40ed61e8437801fca478281c35b2e77dc31a4b7a", 313 + "lastModified": 1690252178, 314 + "narHash": "sha256-9oEz822bvbHobfCUjJLDor2BqW3I5tycIauzDlzOALY=", 315 + "owner": "oxalica", 316 + "repo": "rust-overlay", 317 + "rev": "8d64353ca827002fb8459e44d49116c78d868eba", 174 318 "type": "github" 175 319 }, 176 320 "original": { 177 - "owner": "rust-lang", 178 - "ref": "nightly", 179 - "repo": "rust-analyzer", 321 + "owner": "oxalica", 322 + "repo": "rust-overlay", 180 323 "type": "github" 181 324 } 182 325 },
+57 -76
flake.nix
··· 3 3 4 4 inputs = { 5 5 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 - fenix = { 7 - url = "github:nix-community/fenix"; 8 - inputs.nixpkgs.follows = "nixpkgs"; 9 - }; 10 - flake-utils.url = "github:numtide/flake-utils"; 11 - naersk = { 12 - url = "github:nix-community/naersk"; 13 - inputs.nixpkgs.follows = "nixpkgs"; 14 - }; 15 6 pre-commit-hooks = { 16 7 url = "github:cachix/pre-commit-hooks.nix"; 17 - inputs.nixpkgs.follows = "nixpkgs"; 18 - inputs.flake-utils.follows = "flake-utils"; 8 + inputs = { 9 + nixpkgs.follows = "nixpkgs"; 10 + nixpkgs-stable.follows = "nixpkgs"; 11 + }; 12 + }; 13 + parts = { 14 + url = "github:hercules-ci/flake-parts"; 15 + inputs.nixpkgs-lib.follows = "nixpkgs"; 16 + }; 17 + nci = { 18 + url = "github:yusdacra/nix-cargo-integration"; 19 + inputs = { 20 + nixpkgs.follows = "nixpkgs"; 21 + parts.follows = "parts"; 22 + }; 19 23 }; 20 24 }; 21 25 22 - outputs = { self, fenix, flake-utils, naersk, nixpkgs, pre-commit-hooks, }: 23 - flake-utils.lib.eachDefaultSystem (system: 24 - let 25 - pkgs = nixpkgs.legacyPackages.${system}; 26 - 27 - mkToolchain = fenix.packages.${system}.combine; 28 - 29 - # Use stable rust releases by default 30 - toolchain = fenix.packages.${system}.stable; 31 - 32 - buildToolchain = mkToolchain (with toolchain; [ cargo rustc ]); 33 - 34 - devToolchain = mkToolchain (with toolchain; [ 35 - cargo 36 - clippy 37 - rust-src 38 - rustc 39 - rustfmt 40 - rust-analyzer 41 - ]); 42 - in { 43 - # Use naersk to create a default package from the src files 44 - packages.default = (pkgs.callPackage naersk { 45 - cargo = buildToolchain; 46 - rustc = buildToolchain; 47 - }).buildPackage { src = ./.; }; 48 - 49 - devShells.default = pkgs.mkShell { 50 - inherit (self.checks.${system}.pre-commit-check) shellHook; 51 - name = "cmprss"; 52 - 53 - # Rust Analyzer needs to be able to find the path to default crate 54 - # sources, and it can read this environment variable to do so. The 55 - # `rust-src` component is required in order for this to work. 56 - RUST_SRC_PATH = "${devToolchain}/lib/rustlib/src/rust/library"; 57 - 58 - nativeBuildInputs = with pkgs; [ 59 - act # For running Github Actions locally 60 - devToolchain 61 - nodePackages.prettier 62 - ]; 26 + outputs = inputs: 27 + inputs.parts.lib.mkFlake { inherit inputs; } { 28 + imports = [ inputs.nci.flakeModule inputs.pre-commit-hooks.flakeModule ]; 29 + systems = 30 + [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ]; 31 + perSystem = { config, pkgs, lib, ... }: { 32 + nci = { 33 + projects.cmprss.relPath = ""; 34 + crates.cmprss = { export = true; }; 63 35 }; 36 + packages.default = config.nci.outputs.cmprss.packages.release; 64 37 65 - checks = { 66 - packagesDefault = self.packages.${system}.default; 67 - devShellsDefault = self.devShells.${system}.default; 38 + pre-commit.settings = { 39 + hooks = { 40 + # Format rust files using rustfmt 41 + rustfmt.enable = true; 68 42 69 - pre-commit-check = pre-commit-hooks.lib.${system}.run { 70 - src = ./.; 71 - hooks = { 72 - # Format rust files using rustfmt 73 - rustfmt.enable = true; 74 - 75 - # Ensure no clippy warnings exist 76 - # FIXME: Re-enable. Fails due to mismatched compiler versions because of the devToolchain 77 - #clippy.enable = true; 43 + # Ensure no clippy warnings exist 44 + # FIXME: Re-enable. Fails due to mismatched compiler versions because of the devToolchain 45 + #clippy.enable = true; 78 46 79 - # Runs `cargo check` to look for errors 80 - # FIXME: Re-enable. Fails due to network errors in the sandbox. 81 - #cargo-check.enable = true; 47 + # Runs `cargo check` to look for errors 48 + # FIXME: Re-enable. Fails due to network errors in the sandbox. 49 + #cargo-check.enable = true; 82 50 83 - # Format nix files using nixfmt 84 - # This hook will format the files for you, so on a failure all 85 - # that's needed to fix is to re-run the commit. 86 - nixfmt.enable = true; 51 + # Format nix files using nixfmt 52 + # This hook will format the files for you, so on a failure all 53 + # that's needed to fix is to re-run the commit. 54 + nixfmt.enable = true; 87 55 88 - # Format Markdown/css/etc 89 - # The settings are contained in .prettierrc.yaml 90 - prettier.enable = true; 91 - }; 56 + # Format Markdown/css/etc 57 + # The settings are contained in .prettierrc.yaml 58 + prettier.enable = true; 92 59 }; 93 60 }; 94 - }); 61 + 62 + devShells.default = config.nci.outputs.cmprss.devShell.overrideAttrs 63 + (old: { 64 + name = "cmprss"; 65 + shellHook = '' 66 + ${config.pre-commit.installationScript} 67 + ''; 68 + nativeBuildInputs = with pkgs; [ 69 + act # For running Github Actions locally 70 + nodePackages.prettier 71 + rust-analyzer 72 + ]; 73 + }); 74 + }; 75 + }; 95 76 }