summaryrefslogtreecommitdiff
path: root/modules/pc.nix
blob: 65ad60cdd32d2d41ed349c97d8ce7ff1e8d614bb (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
{ lib, config, pkgs, ... }:

let cfg = config.this.pc;
in
{
  imports = [
    ./locales.nix
    ./syslog.nix
    ./overlays
  ];

  options = {
    this.pc.enable = lib.mkEnableOption "PC-specific settings";
    this.pc.minimal = lib.mkEnableOption "limited set of features";
  };

  config = lib.mkIf cfg.enable {
    networking.networkmanager.enable = true;
    networking.firewall.enable = false;

    services.openssh.enable = true;

    services.chrony.enable = !cfg.minimal;
    services.atd.enable = !cfg.minimal;
    this.syslog.enable = !cfg.minimal;
    this.envfs.enable = !cfg.minimal;

    services.locate = {
      enable = !cfg.minimal;
      pruneBindMounts = true;
    };

    this.overlays.emacs.enable = !cfg.minimal;

    this.locales.dictionaries.enable = !cfg.minimal;
  };
}