summaryrefslogtreecommitdiff
path: root/modules/default.nix
blob: d2bbaf8078e5e50e0160bea94f405becdf1b4063 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ nixpkgs, hostname, lib, config, ... }:

{
  imports = [
    ./gui.nix
    ./laptop.nix
    ./thinkpad.nix
    ./locales.nix
    ./envfs.nix
    ./pc.nix
    ./main.nix
    ./sets.nix
    ./syslog.nix
    ./hosts.nix
    ./bluetooth.nix
    ./unfree.nix
    ./build-machines.nix
    ./apache
    ./overlays
  ];

  options = {
    this.defaults.enable = lib.mkEnableOption "default settings" // {
      default = true;
    };
  };

  config = lib.mkIf config.this.defaults.enable {
    networking.hostName = hostname;

    security.sudo.enable = false;

    services.logind.lidSwitch = "ignore";
    services.logind.powerKey = "suspend";

    documentation.man.generateCaches = true;

    environment.pathsToLink = [ "/include" ];
    environment.variables = {
      "PKG_CONFIG_PATH" = "/run/current-system/sw/lib/pkgconfig";
      "C_INCLUDE_PATH" = "/run/current-system/sw/include";
      "LIBRARY_PATH" = "/run/current-system/sw/lib";
    }

    services.udev.extraRules = ''
      KERNEL=="uinput", MODE="0660", GROUP="input"
    '';

    programs.bash.shellInit = ''
      HISTIGNORE="*INSIDE_EMACS*:$HISTIGNORE"
    '';

    environment.variables = {
      SASL_PATH = "/run/current-system/sw/lib/sasl2";
    };

    nix = {
      channel.enable = false;
      #registry.nixpkgs.flake = nixpkgs;
      nixPath = lib.mkOrder 1000 ["nixpkgs=flake:nixpkgs"];
      settings = {
        experimental-features = [ "nix-command" "flakes" ];
        trusted-users = ["simon"];
      };
    };
  };
}