summaryrefslogtreecommitdiff
path: root/nix_archive/nix/user.nix
blob: 7dd53cc39d09b639561bd332e21085464e5ca951 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
{ config, lib, pkgs, ... }: let
  loc = config.local;
  colo = loc.scheme;
in {
  users.users.andrew = {
    isNormalUser = true;
    uid = 1000;
    extraGroups = [ "wheel" "input" "audio" "video" "render" "disk" "cdrom" ];
  };
  nix.settings.trusted-users = [ "andrew" ];

  documentation = {
    enable = true;
    man.enable = true;
    dev.enable = true;
  };

  fonts = {
    fontDir.enable = true;
    packages = with pkgs; [
      local-fonts
      vista-fonts
      noto-fonts
      noto-fonts-cjk-sans
      noto-fonts-cjk-serif
      noto-fonts-emoji-blob-bin
      mplus-outline-fonts.osdnRelease
      intel-one-mono
      nanum-gothic-coding
      iosevka-comfy.comfy
      dina-font
      freefont_ttf # FreeMono
    ];
    fontconfig = {
      enable = true;
      includeUserConf = false;
      allowBitmaps = true;
      cache32Bit = true;
      antialias = true;
      hinting = {
        enable = false;
        style = "slight";
      };
      subpixel = {
        rgba = "rgb";
        lcdfilter = "light";
      };
      defaultFonts = {
        serif = [ loc.ui-font.name ];
        sansSerif = [ loc.ui-font.name ];
        monospace = [ loc.font.name ];
        emoji = [ loc.emoji-font.name ];
      };
    };
  };

  environment.systemPackages = with pkgs; lib.lists.flatten [
    man-pages
    man-pages-posix
    home-manager
    mercurial
    file
    bc
    screen
    loccount
    (aspellWithDicts (dicts: with dicts; [ en en-computers en-science ]))
    rsync
    (python3.withPackages (python-pkgs: [ python-pkgs.requests python-pkgs.beautifulsoup4 ]))
    htop
    ufetch
    (asNeeded "cmatrix" ["cmatrix"])
    hdparm
    #dcfldd
    ddrescue
    cdrtools
    usbutils
    cryptsetup
    (asNeeded "nix-index" ["nix-channel-index" "nix-index" "nix-locate"])
    imagemagick
    pngcheck
    (asNeeded "optipng" ["optipng"])
    (asNeeded "dmtx-utils" ["dmtxquery" "dmtxread" "dmtxwrite"])
    (asNeeded "zbar" ["zbarcam" "zbarcam-gtk" "zbarcam-qt" "zbarimg"])
    perlPackages.ArchiveZip # For crc32.
    b3sum
    libfaketime
    cpulimit
    dos2unix
    socat
    curl
    (asNeeded "httrack" ["htsserver" "httrack" "proxytrack" "webhttrack"])
    libuchardet
    (unzip.override { enableNLS = true; })
    rar
    unrar
    p7zip
    rclone
    ffmpeg-headless
    xdg-utils
    jq
    when
    evtest
    linuxConsoleTools
    wev
    gcr
    pass
    zenity
  ];

  local.scripts.imports = [
    "install-as-needed"
    "cpu-vulns"
    "sp" # spell
    "ts-date"
    "term-font-size"
    "shift-jis-zip"
    "7z-password"
    "moonrune-charset-utf8"
    "gpg-pubkey"
    "img-fstype"
    "mount-nfs"
    "rewrite-git"
    "xbox360-ffmpeg-enc"
  ];

  programs.screen = {
    enable = true;
    screenrc = ''
      termcapinfo xterm* ti@:te@
      defscrollback 10000
      startup_message off
    '';
  };

  programs.mtr.enable = true;
  services.gnome.gnome-keyring.enable = false;
  programs.gnupg.agent = {
    enable = true;
    pinentryPackage = pkgs.pinentry-gnome3;
    enableSSHSupport = true;
    settings = {
      default-cache-ttl = 28800;
      max-cache-ttl = 28800;
    };
  };
  programs.ssh = {
    extraConfig = "AddKeysToAgent yes";
  };

  home-manager.users.andrew = let
    homeDir = "${config.users.users.andrew.home}";
  in {
    home.username = "andrew";
    xdg.userDirs = {
      enable = true;
      setSessionVariables = true;
      desktop = "${homeDir}/tmp";
      documents = "${homeDir}/docs";
      download = "${homeDir}/dl";
      music = "${homeDir}/tmp";
      pictures = "${homeDir}/pics";
      publicShare = "${homeDir}/tmp";
      templates = "${homeDir}/tmp";
      videos = "${homeDir}/dl/mp4";
    };
    home.sessionVariables = {
      GOPATH = "${homeDir}/tmp/go";
    };
    programs.git = {
      enable = true;
      settings = {
        user = {
          email = "andrew@akon.city";
          name = "Andrew Opalach";
        };
        format.signOff = true;
        init.defaultBranch = "master";
      };
      signing = {
        key = "99659CB58598BDDB"; # The last digits of the key.
        signByDefault = true;
        format = "openpgp";
      };
    };
    home.file.".config/gdb/gdbinit".source = ../../files/gdbinit;
    home.file.".config/colors.json".text = ''
      {
        "special": {
          "background": "${colo.background}",
          "foreground": "${colo.foreground}"
        },
        "colors": {
          "color0": "${colo.color0}",
          "color1": "${colo.color1}",
          "color2": "${colo.color2}",
          "color3": "${colo.color3}",
          "color4": "${colo.color4}",
          "color5": "${colo.color5}",
          "color6": "${colo.color6}",
          "color7": "${colo.color7}",
          "color8": "${colo.color8}",
          "color9": "${colo.color9}",
          "color10": "${colo.color10}",
          "color11": "${colo.color11}",
          "color12": "${colo.color12}",
          "color13": "${colo.color13}",
          "color14": "${colo.color14}",
          "color15": "${colo.color15}"
        }
      }
    '';
  };
}