init: dev
This commit is contained in:
57
flake.nix
Normal file
57
flake.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
description = "Cross-Kmod-Nix development environment";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }:
|
||||
let
|
||||
mkKernelEnv = import ./kernel.nix { inherit pkgs; };
|
||||
nabu-kernel-src = mkKernelEnv {
|
||||
url = "https://github.com/neokoni/android_kernel_xiaomi_nabu.git";
|
||||
rev = "4546bbf09f49dd91d8c4cf09f4f5f0b9043d2b8e";
|
||||
hash = "sha256-xSBQsmaO4UY33QlYrYxU8kPhLNcW2AKUb1AGOrMd5kU=";
|
||||
configGz = ./kernel_config/mipad5/config.gz;
|
||||
};
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
config = {
|
||||
permittedInsecurePackages = [
|
||||
"python-2.7.18.12"
|
||||
];
|
||||
};
|
||||
};
|
||||
kernel = pkgs.linuxPackages_latest.kernel;
|
||||
in
|
||||
{
|
||||
packages."x86_64-linux".default = pkgs.callPackage ./default.nix { };
|
||||
devShells."x86_64-linux".default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
bear
|
||||
clang-tools
|
||||
clang
|
||||
cmake
|
||||
gcc
|
||||
kmod
|
||||
nil
|
||||
|
||||
python312
|
||||
python27
|
||||
|
||||
bc
|
||||
openssl
|
||||
pkgsCross.aarch64-multiplatform.gcc
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export KDIR=${nabu-kernel-src}
|
||||
bear -- make -C $KDIR M=$(pwd) ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- modules > /dev/null 2>&1
|
||||
|
||||
make clean
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user