this repo has no description
0
fork

Configure Feed

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

feat: adding flake for dependency management

+271
+183
flake.lock
··· 1 + { 2 + "nodes": { 3 + "fenix": { 4 + "inputs": { 5 + "nixpkgs": [ 6 + "nixpkgs" 7 + ], 8 + "rust-analyzer-src": "rust-analyzer-src" 9 + }, 10 + "locked": { 11 + "lastModified": 1670566996, 12 + "narHash": "sha256-M+KsSE2D8ByDf3HZhnvLRpytg8aXScoWhg+NrdHjeeE=", 13 + "owner": "nix-community", 14 + "repo": "fenix", 15 + "rev": "ab24d0ad17a733624b99f5d6466e71b8c239a001", 16 + "type": "github" 17 + }, 18 + "original": { 19 + "owner": "nix-community", 20 + "repo": "fenix", 21 + "type": "github" 22 + } 23 + }, 24 + "flake-compat": { 25 + "flake": false, 26 + "locked": { 27 + "lastModified": 1668681692, 28 + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", 29 + "owner": "edolstra", 30 + "repo": "flake-compat", 31 + "rev": "009399224d5e398d03b22badca40a37ac85412a1", 32 + "type": "github" 33 + }, 34 + "original": { 35 + "owner": "edolstra", 36 + "repo": "flake-compat", 37 + "type": "github" 38 + } 39 + }, 40 + "flake-utils": { 41 + "locked": { 42 + "lastModified": 1667395993, 43 + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", 44 + "owner": "numtide", 45 + "repo": "flake-utils", 46 + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", 47 + "type": "github" 48 + }, 49 + "original": { 50 + "owner": "numtide", 51 + "repo": "flake-utils", 52 + "type": "github" 53 + } 54 + }, 55 + "gitignore": { 56 + "inputs": { 57 + "nixpkgs": [ 58 + "pre-commit-hooks", 59 + "nixpkgs" 60 + ] 61 + }, 62 + "locked": { 63 + "lastModified": 1660459072, 64 + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", 65 + "owner": "hercules-ci", 66 + "repo": "gitignore.nix", 67 + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", 68 + "type": "github" 69 + }, 70 + "original": { 71 + "owner": "hercules-ci", 72 + "repo": "gitignore.nix", 73 + "type": "github" 74 + } 75 + }, 76 + "naersk": { 77 + "inputs": { 78 + "nixpkgs": [ 79 + "nixpkgs" 80 + ] 81 + }, 82 + "locked": { 83 + "lastModified": 1662220400, 84 + "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", 85 + "owner": "nix-community", 86 + "repo": "naersk", 87 + "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", 88 + "type": "github" 89 + }, 90 + "original": { 91 + "owner": "nix-community", 92 + "repo": "naersk", 93 + "type": "github" 94 + } 95 + }, 96 + "nixpkgs": { 97 + "locked": { 98 + "lastModified": 1670507980, 99 + "narHash": "sha256-riNZa0xzM1it3pzxciwALeMs+0CsBMWIW2FqulzK8vM=", 100 + "owner": "nixos", 101 + "repo": "nixpkgs", 102 + "rev": "2787fc7d1e51404678614bf0fe92fc296746eec0", 103 + "type": "github" 104 + }, 105 + "original": { 106 + "owner": "nixos", 107 + "ref": "nixos-unstable", 108 + "repo": "nixpkgs", 109 + "type": "github" 110 + } 111 + }, 112 + "nixpkgs-stable": { 113 + "locked": { 114 + "lastModified": 1668984258, 115 + "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", 116 + "owner": "NixOS", 117 + "repo": "nixpkgs", 118 + "rev": "cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a", 119 + "type": "github" 120 + }, 121 + "original": { 122 + "owner": "NixOS", 123 + "ref": "nixos-22.05", 124 + "repo": "nixpkgs", 125 + "type": "github" 126 + } 127 + }, 128 + "pre-commit-hooks": { 129 + "inputs": { 130 + "flake-compat": "flake-compat", 131 + "flake-utils": [ 132 + "flake-utils" 133 + ], 134 + "gitignore": "gitignore", 135 + "nixpkgs": [ 136 + "nixpkgs" 137 + ], 138 + "nixpkgs-stable": "nixpkgs-stable" 139 + }, 140 + "locked": { 141 + "lastModified": 1670413394, 142 + "narHash": "sha256-M7sWqrKtOqUv9euX1t3HCxis8cPy9MNiZxQmUf0KF1o=", 143 + "owner": "cachix", 144 + "repo": "pre-commit-hooks.nix", 145 + "rev": "1303a1a76e9eb074075bfe566518c413f6fc104e", 146 + "type": "github" 147 + }, 148 + "original": { 149 + "owner": "cachix", 150 + "repo": "pre-commit-hooks.nix", 151 + "type": "github" 152 + } 153 + }, 154 + "root": { 155 + "inputs": { 156 + "fenix": "fenix", 157 + "flake-utils": "flake-utils", 158 + "naersk": "naersk", 159 + "nixpkgs": "nixpkgs", 160 + "pre-commit-hooks": "pre-commit-hooks" 161 + } 162 + }, 163 + "rust-analyzer-src": { 164 + "flake": false, 165 + "locked": { 166 + "lastModified": 1670426523, 167 + "narHash": "sha256-Zh+pAuj4PmBmISXCz+54yVSwSXZwbn+ZELgM85xVUE0=", 168 + "owner": "rust-lang", 169 + "repo": "rust-analyzer", 170 + "rev": "6e8a54d0f68702cf7981c8299357838eb0f4d5b2", 171 + "type": "github" 172 + }, 173 + "original": { 174 + "owner": "rust-lang", 175 + "ref": "nightly", 176 + "repo": "rust-analyzer", 177 + "type": "github" 178 + } 179 + } 180 + }, 181 + "root": "root", 182 + "version": 7 183 + }
+88
flake.nix
··· 1 + { 2 + description = "cmprss: a compression client for the CLI"; 3 + 4 + inputs = { 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 + pre-commit-hooks = { 16 + url = "github:cachix/pre-commit-hooks.nix"; 17 + inputs.nixpkgs.follows = "nixpkgs"; 18 + inputs.flake-utils.follows = "flake-utils"; 19 + }; 20 + }; 21 + 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 + 52 + # Rust Analyzer needs to be able to find the path to default crate 53 + # sources, and it can read this environment variable to do so. The 54 + # `rust-src` component is required in order for this to work. 55 + RUST_SRC_PATH = "${devToolchain}/lib/rustlib/src/rust/library"; 56 + 57 + nativeBuildInputs = [ devToolchain ]; 58 + }; 59 + 60 + checks = { 61 + packagesDefault = self.packages.${system}.default; 62 + devShellsDefault = self.devShells.${system}.default; 63 + 64 + pre-commit-check = pre-commit-hooks.lib.${system}.run { 65 + src = ./.; 66 + hooks = { 67 + # Format rust files using rustfmt 68 + rustfmt.enable = true; 69 + 70 + # Ensure no clippy warnings exist 71 + clippy.enable = true; 72 + 73 + # Runs `cargo check` to look for errors 74 + cargo-check.enable = true; 75 + 76 + # Format nix files using nixfmt 77 + # This hook will format the files for you, so on a failure all 78 + # that's needed to fix is to re-run the commit. 79 + nixfmt.enable = true; 80 + 81 + # Format Markdown/css/etc 82 + # The settings are contained in .prettierrc.yaml 83 + prettier.enable = true; 84 + }; 85 + }; 86 + }; 87 + }); 88 + }