Skip to content

Commit 8c744a2

Browse files
SuperSandro2000astro
authored andcommitted
optimization: disable tpm2, swraid
1 parent fc613c8 commit 8c744a2

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

nixos-modules/microvm/optimization.nix

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@ lib.mkIf (cfg.guest.enable && cfg.optimize.enable) {
1717
# The docs are pretty chonky
1818
documentation.enable = lib.mkDefault false;
1919

20-
# Use systemd initrd for startup speed.
21-
# TODO: error mounting /nix/store on crosvm, kvmtool
22-
boot.initrd.systemd.enable = lib.mkDefault (
23-
builtins.elem cfg.hypervisor [
24-
"qemu"
25-
"cloud-hypervisor"
26-
"firecracker"
27-
"stratovirt"
28-
]);
20+
boot = {
21+
initrd.systemd = {
22+
# Use systemd initrd for startup speed.
23+
# TODO: error mounting /nix/store on crosvm, kvmtool
24+
enable = lib.mkDefault (
25+
builtins.elem cfg.hypervisor [
26+
"qemu"
27+
"cloud-hypervisor"
28+
"firecracker"
29+
"stratovirt"
30+
]);
31+
tpm2.enable = lib.mkDefault false;
32+
};
33+
swraid.enable = false;
34+
};
2935

3036
nixpkgs.overlays = [
3137
(final: prev: {
@@ -36,9 +42,13 @@ lib.mkIf (cfg.guest.enable && cfg.optimize.enable) {
3642
# networkd is used due to some strange startup time issues with nixos's
3743
# homegrown dhcp implementation
3844
networking.useNetworkd = lib.mkDefault true;
39-
# Due to a bug in systemd-networkd: https://github.com/systemd/systemd/issues/29388
40-
# we cannot use systemd-networkd-wait-online.
41-
systemd.network.wait-online.enable = lib.mkDefault false;
45+
46+
systemd = {
47+
# Due to a bug in systemd-networkd: https://github.com/systemd/systemd/issues/29388
48+
# we cannot use systemd-networkd-wait-online.
49+
network.wait-online.enable = lib.mkDefault false;
50+
tpm2.enable = lib.mkDefault false;
51+
};
4252

4353
# Exclude switch-to-configuration.pl from toplevel.
4454
system = lib.optionalAttrs (options.system ? switch && !canSwitchViaSsh) {

0 commit comments

Comments
 (0)