31618716e9
ysyx_22040000 李心杨 Linux calcite 6.6.18 #1-NixOS SMP PREEMPT_DYNAMIC Fri Feb 23 08:25:28 UTC 2024 x86_64 GNU/Linux 23:08:11 up 7:25, 2 users, load average: 0.15, 0.26, 0.29
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, ... }@inputs: with inputs;
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
crossPkgs = import nixpkgs {
|
|
localSystem = system;
|
|
crossSystem = {
|
|
config = "riscv32-none-elf";
|
|
abi = "ilp32";
|
|
};
|
|
};
|
|
in
|
|
{
|
|
packages.nemu = pkgs.callPackage ./nemu {};
|
|
|
|
devShells.am-kernels = crossPkgs.mkShell {
|
|
inputsFrom = [
|
|
self.packages.${system}.nemu
|
|
];
|
|
packages = [
|
|
pkgs.stdenv.cc
|
|
self.packages.${system}.nemu.buildInputs
|
|
self.packages.${system}.nemu.nativeBuildInputs
|
|
];
|
|
shellHook = ''
|
|
export PROJECT_ROOT=/home/xin/repo/ysyx-workbench
|
|
export AM_HOME=$PROJECT_ROOT/abstract-machine;
|
|
export NEMU_HOME=$PROJECT_ROOT/nemu;
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|