summaryrefslogtreecommitdiff
path: root/home/isolation/default.nix
blob: aff006c56cb43a8ffa06308c380121a192d3cb02 (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
34
35
36
37
{
  config,
  lib,
  ...
}:
with lib; let
  cfg = config.local.shenvs;
in {
  options.local.shenvs = {
    enable = mkEnableOption "hm-isolation shenvs";
  };

  config = mkIf cfg.enable {
    home.isolation = {
      enable = true;
      btrfsSupport = true;

      defaults = {
        static = false;
        bindHome = "home";

        persist = {
          base = "shenvs";
          btrfs = true;
        };
      };

      modulesUnder = ../shenvs;
    };

    local = mkIf config.home.isolation.active {
      desktop.enable = mkForce false;
      environ.enable = mkForce false;
      mail.enable = mkForce false;
    };
  };
}