about summary refs log tree commit diff
path: root/modules/nixos/common/nix.nix
blob: 997851307a79c962efdca86cceffbdf9d887d173 (plain) (blame)
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,
  inputs,
  lib,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.common.nix;
in {
  options.nixfiles.modules.common.nix.allowedUnfreePackages = mkOption {
    description = "A list of allowed unfree packages.";
    type = with types; listOf str;
    default = [];
  };

  config = {
    nixpkgs = {
      config.allowUnfreePredicate = p: elem (getName p) cfg.allowedUnfreePackages;

      overlays = with inputs; [
        nix-minecraft.overlay
        pollymc.overlays.default
        xmonad-ng.overlays.default
      ];
    };

    system.stateVersion = with builtins;
      head (split "\n" (readFile "${inputs.nixpkgs}/.version"));

    environment = {
      sessionVariables.NIX_SHELL_PRESERVE_PROMPT = "1";
      localBinInPath = true;
      defaultPackages = [];
    };
  };
}

Consider giving Nix/NixOS a try! <3