diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-10-10 19:12:22 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-11-26 15:18:10 +0000 |
commit | 123c81b179b0a3437d3aa578e1a75e3c233ad3d6 (patch) | |
tree | a01c0ba565651cfa1c31d7a586aecccf2c6d5380 /default.nix | |
parent | 9fd0ad4f088fba759c9f9cfe4438199de75e95ba (diff) | |
download | spectrum-123c81b179b0a3437d3aa578e1a75e3c233ad3d6.tar spectrum-123c81b179b0a3437d3aa578e1a75e3c233ad3d6.tar.gz spectrum-123c81b179b0a3437d3aa578e1a75e3c233ad3d6.tar.bz2 spectrum-123c81b179b0a3437d3aa578e1a75e3c233ad3d6.tar.lz spectrum-123c81b179b0a3437d3aa578e1a75e3c233ad3d6.tar.xz spectrum-123c81b179b0a3437d3aa578e1a75e3c233ad3d6.tar.zst spectrum-123c81b179b0a3437d3aa578e1a75e3c233ad3d6.zip |
Switch to a modular kernel
The kernel we had before was technically modular, but the modules weren't installed into the VM. Now they are, and they're loaded automatically by mdevd.
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/default.nix b/default.nix index b1d1dcd..cc99660 100644 --- a/default.nix +++ b/default.nix @@ -15,9 +15,19 @@ let busybox execline mdevd s6 s6-linux-utils s6-portable-utils s6-rc screen ]; - packagesBin = runCommand "packages-bin" {} '' + kernel = pkgs.linux.override { + structuredExtraConfig = with lib.kernel; { + VIRTIO = yes; + VIRTIO_PCI = yes; + VIRTIO_BLK = yes; + EXT4_FS = yes; + }; + }; + + packagesSysroot = runCommand "packages-sysroot" {} '' mkdir -p $out/bin ln -s ${concatMapStringsSep " " (p: "${p}/bin/*") packages} $out/bin + ln -s ${kernel}/lib $out/lib # TODO: this is a hack and we should just build the util-linux # programs we want. @@ -26,9 +36,9 @@ let ''; packagesTar = runCommand "packages.tar" {} '' - cd ${packagesBin} + cd ${packagesSysroot} tar -cvf $out --verbatim-files-from \ - -T ${writeReferencesToFile packagesBin} bin + -T ${writeReferencesToFile packagesSysroot} . ''; extTar = runCommand "ext.tar" { @@ -72,6 +82,8 @@ stdenv.mkDerivation { enableParallelBuilding = true; + passthru = { inherit kernel; }; + meta = with lib; { license = licenses.eupl12; platforms = platforms.linux; |