From 386df39c9866a4d945de46ef0dcab2363c674e0e Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Sun, 1 Sep 2024 19:59:44 -0500 Subject: Move almost all the kernel into crates/. --- flake.nix | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 5850e79..aecb62c 100644 --- a/flake.nix +++ b/flake.nix @@ -23,18 +23,16 @@ pkgs = nixpkgs.legacyPackages.${system}; fenix = fenix-flake.packages.${system}; - rust-toolchain = fenix.combine [ - fenix.stable.cargo - fenix.stable.rustc - fenix.stable.clippy - # fenix.targets.riscv64gc-unknown-none-elf.stable.rust-std - ]; - rust = pkgs.makeRustPlatform { - cargo = rust-toolchain; - rustc = rust-toolchain; - }; - - packages = { }; + rust-toolchain = fenix.combine ( + [ + fenix.stable.cargo + fenix.stable.rustc + fenix.stable.clippy + ] + ++ (builtins.map ({ rust-target, ... }: fenix.targets.${rust-target}.stable.rust-std) ( + builtins.attrValues (import ./crates/arches.nix) + )) + ); in /* pkgsHost = import nixpkgs { @@ -117,7 +115,7 @@ */ devShells.default = pkgs.mkShell { - inputsFrom = builtins.attrValues (flake-utils.lib.flattenTree packages); + # inputsFrom = builtins.attrValues (flake-utils.lib.flattenTree packages); nativeBuildInputs = [ (pkgs.callPackage ./nix/miri.nix { inherit fenix; }) pkgs.cargo-watch @@ -128,7 +126,10 @@ # CARGO_BUILD_TARGET = "riscv64gc-unknown-none-elf"; }; - packages = flake-utils.lib.flattenTree packages; + lib = import ./crates { inherit fenix nixpkgs system; }; + packages = flake-utils.lib.flattenTree { + libkernel = import ./crates { inherit fenix nixpkgs system; }; + }; } ); } -- cgit v1.2.3