This commit is contained in:
2024-05-28 18:12:14 +02:00
parent f69e04ccbe
commit f554a154b7
10 changed files with 341 additions and 38 deletions

View File

@@ -1,19 +1,33 @@
{
inputs.nixpkgs.url = "github:rodarima/nixpkgs/fix-pkgs-static-gcc-march";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/e4ad989506ec7d71f7302cc3067abd82730a4beb";
#inputs.bscpkgs.url = "path:/home/Computational/rarias/bscpkgs";
inputs.bscpkgs.url = "/home/Computational/rarias/bscpkgs";
outputs = { self, nixpkgs, bscpkgs, ... }:
outputs = {self,...}@inputs:
let
system = "x86_64-linux";
#overlay = import ./overlay.nix;
#pkgs = import nixpkgs { inherit system; };
remoteNixpkgsPatches = [
{
meta.description = "sha256-ZCDQ7SpGhH8JvAwWzdcyrc68RFEWHxxAj0M2+AvEzIg=";
url = "https://github.com/NixOS/nixpkgs/pull/283460.diff";
sha256 = "sha256-g6o4rqkOOYZ6OJTzv9kTPq9Zsu5Z1QXZmPLC3Q7Sq6w=";
}
];
originPkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
nixpkgs = originPkgs.applyPatches {
name = "nixpkgs-patched";
src = inputs.nixpkgs;
patches = map originPkgs.fetchpatch remoteNixpkgsPatches;
};
nixosSystem = import (nixpkgs + "/nixos/lib/eval-config.nix");
in {
#overlay = import ./overlay.nix;
nixosConfigurations = {
# The qemu configuration defines a system that runs in the RISC-V
# architecture, but is build from an x86 host machine.
qemu = nixpkgs.lib.nixosSystem {
qemu = nixosSystem {
specialArgs = { inherit self; };
system = "${system}";
modules = [
@@ -23,7 +37,7 @@
};
# Same, but disable compressed instructions
qemu-nc = nixpkgs.lib.nixosSystem {
qemu-nc = nixosSystem {
specialArgs = { inherit self; };
system = "${system}";
modules = [
@@ -34,7 +48,7 @@
};
# FPGA Lagarto Hun CPU
lagarto-hun = nixpkgs.lib.nixosSystem {
lagarto-hun = nixosSystem {
specialArgs = { inherit self; };
system = "${system}";
modules = [
@@ -54,7 +68,7 @@
toplevel = nixosconf.config.system.build.toplevel;
in syspkgs.mkShell {
pname = "qemu-shell";
buildInputs = with syspkgs; [ qemu e2fsprogs ];
nativeBuildInputs = with syspkgs; [ qemu e2fsprogs ];
# Here we tell the run script where to find the system
NIXOS_SYSTEM_TOPLEVEL = toplevel;
OPENSBI = syspkgs.opensbi-uboot;