flake.nix (1835B)
1 { 2 description = "Radroots Core Libraries"; 3 4 inputs = { 5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; 6 flake-parts.url = "github:hercules-ci/flake-parts"; 7 crane.url = "github:ipetkov/crane"; 8 rust-overlay = { 9 url = "github:oxalica/rust-overlay"; 10 inputs.nixpkgs.follows = "nixpkgs"; 11 }; 12 treefmt-nix = { 13 url = "github:numtide/treefmt-nix"; 14 inputs.nixpkgs.follows = "nixpkgs"; 15 }; 16 }; 17 18 outputs = 19 inputs@{ flake-parts, ... }: 20 flake-parts.lib.mkFlake { inherit inputs; } { 21 imports = [ inputs.treefmt-nix.flakeModule ]; 22 systems = [ 23 "aarch64-darwin" 24 "aarch64-linux" 25 "x86_64-darwin" 26 "x86_64-linux" 27 ]; 28 29 perSystem = 30 { 31 config, 32 lib, 33 system, 34 ... 35 }: 36 let 37 pkgs = import inputs.nixpkgs { 38 inherit system; 39 overlays = [ inputs.rust-overlay.overlays.default ]; 40 }; 41 toolchains = import ./build/nix/toolchains.nix { inherit pkgs; }; 42 common = import ./build/nix/common.nix { 43 crane = inputs.crane; 44 inherit lib pkgs toolchains; 45 }; 46 in 47 { 48 treefmt = import ./treefmt.nix; 49 50 apps = import ./build/nix/apps.nix { 51 inherit 52 common 53 config 54 lib 55 pkgs 56 toolchains 57 ; 58 }; 59 60 checks = lib.filterAttrs (_: value: value != null) ( 61 import ./build/nix/checks.nix { 62 inherit common pkgs; 63 } 64 ); 65 66 devShells = import ./build/nix/devshells.nix { 67 inherit common pkgs toolchains; 68 }; 69 70 packages = { 71 xtask = common.xtaskPackage; 72 }; 73 }; 74 }; 75 }