add nix flake for development shell
It does not support cross compilation but requires x86_64-linux.
This commit is contained in:
35
nix/flake.nix
Normal file
35
nix/flake.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
let
|
||||
shell =
|
||||
{ pkgs }:
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
ncurses
|
||||
dialog
|
||||
perl
|
||||
bashInteractive
|
||||
flex
|
||||
bison
|
||||
buildPackages.qemu
|
||||
];
|
||||
shellHook = ''
|
||||
# Do not attempt cross compilation.
|
||||
export CROSS_COMPILE=
|
||||
# These are set by the compiler’s shellHook but mk refuses to work when these are set.
|
||||
unset CC CPP CXX AR AS LD
|
||||
'';
|
||||
};
|
||||
|
||||
lib = import "${nixpkgs}/lib";
|
||||
forAll = list: f: lib.genAttrs list f;
|
||||
in
|
||||
{
|
||||
devShells = forAll [ "x86_64-linux" ] (system: {
|
||||
default = shell {
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user