diff --git a/externals/packages/dptx-dummy/.gitignore b/externals/packages/dptx-dummy/.gitignore new file mode 100644 index 0000000..e31b50d --- /dev/null +++ b/externals/packages/dptx-dummy/.gitignore @@ -0,0 +1 @@ +*.cmd diff --git a/externals/packages/dptx-dummy/default.nix b/externals/packages/dptx-dummy/default.nix new file mode 100644 index 0000000..f3dbe5c --- /dev/null +++ b/externals/packages/dptx-dummy/default.nix @@ -0,0 +1,26 @@ +{ stdenv, lib, kernel }: + +stdenv.mkDerivation rec { + pname = "dptx-dummy"; + version = "0.1"; + src = ./src; + nativeBuildInputs = kernel.moduleBuildDependencies; + setSourceRoot = '' + export sourceRoot=$(pwd)/src; + ''; + makeFlags = [ + "-C" + "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "M=$(sourceRoot)" + ]; + buildFlags = [ "modules" ]; + installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ]; + installTargets = [ "modules_install" ]; + meta = with lib; { + description = "Dummy module that requires rockchip/dptx.bin"; + homepage = "https://artem.ist"; + license = licenses.gpl2; + maintainers = [ maintainers.artemist ]; + platforms = platforms.linux; + }; +} diff --git a/externals/packages/dptx-dummy/src/Makefile b/externals/packages/dptx-dummy/src/Makefile new file mode 100644 index 0000000..f7d027e --- /dev/null +++ b/externals/packages/dptx-dummy/src/Makefile @@ -0,0 +1 @@ +obj-m := dptx-dummy.o diff --git a/externals/packages/dptx-dummy/src/dptx-dummy.c b/externals/packages/dptx-dummy/src/dptx-dummy.c new file mode 100644 index 0000000..bf319af --- /dev/null +++ b/externals/packages/dptx-dummy/src/dptx-dummy.c @@ -0,0 +1,6 @@ +#include + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Artemis Tosini "); +MODULE_DESCRIPTION("Dummy module that requires rockchip/dptx.bin"); +MODULE_FIRMWARE("rockchip/dptx.bin"); diff --git a/system/mistmane/default.nix b/system/mistmane/default.nix index d07c8c2..78d285e 100644 --- a/system/mistmane/default.nix +++ b/system/mistmane/default.nix @@ -55,5 +55,14 @@ extraConfig = lib.mkForce "HandlePowerKey=lock"; }; + swapDevices = [{ + device = "/dev/disk/by-partuuid/3f4fb4d3-1e13-f64a-a435-8f866833c2b1"; + randomEncryption = true; + }]; + + # rockchip/dptx.bin isn't in the initrd. Instead of fix nixpkgs let's do something incredibly cursed + boot.extraModulePackages = [ (pkgs.callPackage ../../externals/packages/dptx-dummy { kernel = config.boot.kernelPackages.kernel; }) ]; + boot.initrd.availableKernelModules = [ "dptx-dummy" ]; + system.stateVersion = "21.11"; }