01960837e0
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:05:05 up 7:22, 2 users, load average: 0.43, 0.37, 0.33
39 lines
1,004 B
Nix
39 lines
1,004 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
|
|
pkgs.libllvm
|
|
];
|
|
shellHook = ''
|
|
export PROJECT_ROOT=/home/xin/repo/ysyx-workbench
|
|
export AM_HOME=$PROJECT_ROOT/abstract-machine;
|
|
export NEMU_HOME=$PROJECT_ROOT/nemu;
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|