about summary refs log tree commit diff
path: root/modules/common/profiles/default.nix
blob: 06ddaf4ef1c8f9c1c0289e0a0d765e0a2fd45af5 (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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
  config,
  lib,
  pkgs,
  this,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.profiles.default;
in {
  imports = [
    ./dev
    ./headful.nix
    ./headless.nix
    (mkAliasOptionModule ["colourScheme"] [
      "nixfiles"
      "modules"
      "profiles"
      "default"
      "colourScheme"
    ])
  ];

  options.nixfiles.modules.profiles.default = {
    enable =
      mkEnableOption "The most default profile of them all."
      // {
        default = true;
      };

    colourScheme = let
      mkColour = default:
        mkOption {
          type = types.str;
          inherit default;
          description = "Colour in a standard hexadecimal notation.";
          example = "#000000";
        };
    in rec {
      black = mkColour "#161719";
      red = mkColour "#cc6666";
      green = mkColour "#b5bd68";
      yellow = mkColour "#f0c674";
      blue = mkColour "#81a2be";
      magenta = mkColour "#b294bb";
      cyan = mkColour "#8abeb7";
      white = mkColour "#c5c8c6";

      brightBlack = mkColour "#969896";
      brightRed = mkColour "#cc6666";
      brightGreen = mkColour "#b5bd68";
      brightYellow = mkColour "#f0c674";
      brightBlue = mkColour "#81a2be";
      brightMagenta = mkColour "#b294bb";
      brightCyan = mkColour "#8abeb7";
      brightWhite = mkColour "#ffffff";

      background = black;
      foreground = white;
    };
  };

  config = mkIf cfg.enable {
    assertions = [
      {
        assertion = !(with this; isHeadless && isHeadful);
        message = ''
          The configuration cannot be both "headful" and "headless" at the same
          time.
        '';
      }
    ];

    nixfiles.modules = {
      htop.enable = true;
      tmux.enable = true;
      vim.enable = true;
    };

    time.timeZone = "Europe/Moscow";

    environment.systemPackages = with pkgs; [
      ddrescue
      file
      git
      gnupg
      tree
    ];
  };
}

Consider giving Nix/NixOS a try! <3