Skip to content

Commit

Permalink
nixos-modules/microvm/store-disk: fallback to squashfs when the nixos…
Browse files Browse the repository at this point in the history
… hardened profile is imported

Fixes Github issue #202
  • Loading branch information
astro committed Feb 14, 2024
1 parent 4de244c commit 39b18d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions checks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ let
boot.initrd.systemd.enable = true;
} ];
} ]
# hardened profile
[ {
# no
id = null;
} {
id = "hardened";
modules = [ ({ modulesPath, ... }: {
imports = [ "${modulesPath}/profiles/hardened.nix" ];
}) ];
} ]
];

allVariants =
Expand Down
6 changes: 5 additions & 1 deletion nixos-modules/microvm/store-disk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ in
options.microvm = with lib; {
storeDiskType = mkOption {
type = types.enum [ "squashfs" "erofs" ];
default = "erofs";
# nixos/modules/profiles/hardened.nix forbids erofs
default =
if builtins.elem "erofs" config.boot.blacklistedKernelModules
then "squashfs"
else "erofs";
description = ''
Boot disk file system type: squashfs is smaller, erofs is supposed to be faster.
'';
Expand Down

0 comments on commit 39b18d3

Please sign in to comment.