2022-06-25 17:37:18 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
2022-07-13 08:48:06 +02:00
|
|
|
nixpkgs.url = "github:matthewcroughan/nixpkgs/mc/riscv-testing";
|
2023-02-16 11:57:52 +01:00
|
|
|
|
|
|
|
# VisionFive ("v1")
|
2022-07-09 05:28:56 +02:00
|
|
|
vendor-kernel = {
|
|
|
|
url = "github:starfive-tech/linux";
|
|
|
|
flake = false;
|
|
|
|
};
|
2022-06-25 17:37:18 +02:00
|
|
|
};
|
2023-11-29 10:48:59 +01:00
|
|
|
outputs = { self, nixpkgs, vendor-kernel, ... }:
|
2022-06-25 17:37:18 +02:00
|
|
|
let
|
2023-02-16 12:49:58 +01:00
|
|
|
inherit (nixpkgs) lib;
|
2022-07-09 05:24:16 +02:00
|
|
|
system = "x86_64-linux";
|
2022-07-09 05:28:56 +02:00
|
|
|
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
|
2022-06-25 17:37:18 +02:00
|
|
|
modules = [
|
2022-07-09 05:28:56 +02:00
|
|
|
{ nixpkgs.overlays = [ self.overlay ]; }
|
2022-06-25 17:37:18 +02:00
|
|
|
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-riscv64-visionfive-installer.nix"
|
|
|
|
./base.nix
|
|
|
|
./configuration.nix
|
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
2022-07-09 05:28:56 +02:00
|
|
|
overlay = final: prev: {
|
2023-11-29 10:48:59 +01:00
|
|
|
linuxPackages_visionfive = final.linuxPackagesFor (
|
|
|
|
(
|
|
|
|
final.callPackage ./kernel.nix { inherit vendor-kernel; }
|
|
|
|
).override {
|
|
|
|
patches = [];
|
|
|
|
}
|
|
|
|
);
|
2022-07-09 05:28:56 +02:00
|
|
|
};
|
2022-07-09 05:29:20 +02:00
|
|
|
legacyPackages.${system} =
|
|
|
|
{
|
|
|
|
inherit (pkgs.pkgsCross.riscv64.linux) linuxPackages_visionfive;
|
|
|
|
};
|
2022-06-25 17:37:18 +02:00
|
|
|
images = {
|
2022-07-09 05:24:16 +02:00
|
|
|
visionfive-cross = self.nixosConfigurations.visionfive-cross.config.system.build.sdImage;
|
|
|
|
visionfive-native = self.nixosConfigurations.visionfive-native.config.system.build.sdImage;
|
2023-02-16 12:49:58 +01:00
|
|
|
|
|
|
|
visionfive2-cross = self.nixosConfigurations.visionfive2-cross.config.system.build.sdImage;
|
|
|
|
visionfive2-native = self.nixosConfigurations.visionfive2-native.config.system.build.sdImage;
|
2022-06-25 17:37:18 +02:00
|
|
|
};
|
2023-11-27 11:41:05 +01:00
|
|
|
nixosConfigurations = {
|
2022-07-09 05:24:16 +02:00
|
|
|
visionfive-cross = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "${system}";
|
2022-06-25 17:37:18 +02:00
|
|
|
modules = modules ++ [
|
|
|
|
{
|
|
|
|
nixpkgs.crossSystem = {
|
|
|
|
system = "riscv64-linux";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
visionfive-native = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "riscv64-linux";
|
|
|
|
modules = modules;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|