flake.nix Add support of other distro with interpreted shell
This commit is contained in:
parent
ca2332a6c9
commit
9d9b5d8985
2 changed files with 14 additions and 3 deletions
|
@ -9,7 +9,9 @@ Otherwise, change linux_dev variable with you kernel variant and change flake.lo
|
||||||
|
|
||||||
On other distros:
|
On other distros:
|
||||||
|
|
||||||
- You need to setup LINUX_MODULES_FOLDER to linux modules folder of your distro (ex: `/lib/modules/$(uname -r)/build`) in flake.nix
|
1. With Nix env, .envrc, change line by `use flake .#other`
|
||||||
|
|
||||||
|
2. Without Nix env, you need to setup LINUX_MODULES_FOLDER to linux modules folder of your distro (ex: `/lib/modules/$(uname -r)`) in your shell (bashrc)
|
||||||
|
|
||||||
## make : targets list
|
## make : targets list
|
||||||
|
|
||||||
|
|
13
flake.nix
13
flake.nix
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
linux = pkgs.linuxKernel.kernels.linux_zen;
|
linux = pkgs.linuxKernel.kernels.linux_zen;
|
||||||
in {
|
in {
|
||||||
devShells = {
|
devShells = rec {
|
||||||
default = pkgs.mkShell {
|
default = nixos;
|
||||||
|
|
||||||
|
nixos = pkgs.mkShell {
|
||||||
packages = [ linux.moduleBuildDependencies ];
|
packages = [ linux.moduleBuildDependencies ];
|
||||||
|
|
||||||
LINUX_MODULES_FOLDER = "${linux.dev}/lib/modules/${linux.modDirVersion}";
|
LINUX_MODULES_FOLDER = "${linux.dev}/lib/modules/${linux.modDirVersion}";
|
||||||
|
@ -26,6 +28,13 @@
|
||||||
echo "Current Linux Kernel used : ${linux.version}"
|
echo "Current Linux Kernel used : ${linux.version}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
other = pkgs.mkShell {
|
||||||
|
shellHook = ''
|
||||||
|
export LINUX_MODULES_FOLDER=/lib/modules/$(uname -r)
|
||||||
|
echo "Current Linux Kernel used : $(uname -r)"
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue