summaryrefslogtreecommitdiff
path: root/sys/boot/namespaced.nix
blob: 3f95960050390782dee24155dffac8a5620e4896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  config,
  lib,
  options,
  ...
}:
with lib; let
  cfg = config.local.boot.namespaced;
in {
  options.local.boot.namespaced = {
    enable = mkEnableOption "system containerization";
  };

  config = mkIf cfg.enable {
    boot.isContainer = true;

    local.boot = mkMerge ([
        {
          loader = mkForce "none";

          efi.enable = mkForce false;
          firmware.mode = mkForce "none";
          secureBoot.enable = mkForce false;
          impermanence.enable = mkForce false;
        }
      ]
      ++ map
      (name: {
        stack.${name}.enable = mkForce false;
      })
      (attrNames options.local.boot.stack));
  };
}