From f5286b8a8f9cbdbd548b0039a225606773685224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Wed, 27 Nov 2024 08:32:54 +0100 Subject: [PATCH] add riscv-overlay to riscv builds --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 39 +++++++++++++++++++++++++++------------ 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 39286ef..a5f1c4f 100644 --- a/flake.lock +++ b/flake.lock @@ -91,12 +91,33 @@ "type": "github" } }, + "riscv-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1732691666, + "narHash": "sha256-IjLKI/ifm5AolDMGuUUugFIdYYy+MP5q3HMa169gfCU=", + "owner": "DarkKirb", + "repo": "riscv-overlay", + "rev": "ac6bf799c2d2b1f281444b528841659f84492028", + "type": "github" + }, + "original": { + "owner": "DarkKirb", + "repo": "riscv-overlay", + "type": "github" + } + }, "root": { "inputs": { "cargo2nix": "cargo2nix", "flake-compat": "flake-compat_2", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", + "riscv-overlay": "riscv-overlay", "rust-overlay": "rust-overlay" } }, diff --git a/flake.nix b/flake.nix index c9a83e5..5a72477 100644 --- a/flake.nix +++ b/flake.nix @@ -2,21 +2,26 @@ description = "rust-template"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; - - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - cargo2nix = { url = "github:DarkKirb/cargo2nix/master"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; inputs.rust-overlay.follows = "rust-overlay"; }; + flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; + flake-utils.url = "github:numtide/flake-utils"; + + nixpkgs.url = "github:NixOS/nixpkgs"; + + riscv-overlay = { + url = "github:DarkKirb/riscv-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -26,6 +31,7 @@ flake-utils, rust-overlay, cargo2nix, + riscv-overlay, ... }@inputs: flake-utils.lib.eachSystem @@ -37,10 +43,19 @@ ( system: let - overlays = [ - cargo2nix.overlays.default - (import rust-overlay) - ]; + overlays = + [ + cargo2nix.overlays.default + (import rust-overlay) + ] + ++ ( + if system == "riscv64-linux" then + [ + riscv-overlay.overlays.default + ] + else + [ ] + ); pkgs = import nixpkgs { inherit system overlays; };