summaryrefslogtreecommitdiff
path: root/sys/boot/namespaced.nix
blob: db01d5501d79904ce3e7980b18697f5546e604d4 (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
{ 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));
  };
}