summaryrefslogtreecommitdiff
path: root/os/srv/nix-helper.nix
blob: 973404352c93c7cfc46627329c6bf847363f24a1 (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
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.os.srv.nix-helper;
in
{
  options.os.srv.nix-helper.enable = lib.mkEnableOption "enables nix-helper";
  config = lib.mkIf cfg.enable {
    nix.settings = {
      allowed-users = [ "@users" ];
      experimental-features = [
        "nix-command"
        "flakes"
      ];
    };

    programs.nh = {
      enable = true;
      flake = "/etc/nixos";
      clean.extraArgs = "--keep 5";
    };

    environment.sessionVariables = {
      NH_OS_FLAKE = "/etc/nixos";
    };

    environment.systemPackages = with pkgs; [
      nix-output-monitor
      nvd
    ];
  };
}