ysyx-workbench/flake.nix
tracer-ysyx 3238a7d4e7 > compile NEMU
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:09:32  up   7:26,  2 users,  load average: 0.29, 0.29, 0.29
2024-03-03 23:09:32 +08:00

38 lines
979 B
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
];
shellHook = ''
export PROJECT_ROOT=/home/xin/repo/ysyx-workbench
export AM_HOME=$PROJECT_ROOT/abstract-machine;
export NEMU_HOME=$PROJECT_ROOT/nemu;
'';
};
}
);
}