Skip to content

Commit 39b18d3

Browse files
committed
nixos-modules/microvm/store-disk: fallback to squashfs when the nixos hardened profile is imported
Fixes Github issue #202
1 parent 4de244c commit 39b18d3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

checks/default.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ let
100100
boot.initrd.systemd.enable = true;
101101
} ];
102102
} ]
103+
# hardened profile
104+
[ {
105+
# no
106+
id = null;
107+
} {
108+
id = "hardened";
109+
modules = [ ({ modulesPath, ... }: {
110+
imports = [ "${modulesPath}/profiles/hardened.nix" ];
111+
}) ];
112+
} ]
103113
];
104114

105115
allVariants =

nixos-modules/microvm/store-disk.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ in
2424
options.microvm = with lib; {
2525
storeDiskType = mkOption {
2626
type = types.enum [ "squashfs" "erofs" ];
27-
default = "erofs";
27+
# nixos/modules/profiles/hardened.nix forbids erofs
28+
default =
29+
if builtins.elem "erofs" config.boot.blacklistedKernelModules
30+
then "squashfs"
31+
else "erofs";
2832
description = ''
2933
Boot disk file system type: squashfs is smaller, erofs is supposed to be faster.
3034
'';

0 commit comments

Comments
 (0)