/
common_configuration.nix
198 lines (181 loc) · 5.22 KB
/
common_configuration.nix
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
# Edit this configuration file to define what should be installed on
# the system. Help is available in the configuration.nix(5) man page
# or the NixOS manual available on virtual console 8 (Alt+F8).
{ config, pkgs, ... }:
let
literals = import ./literals.nix {pkgs = pkgs;
ca = pkgs.writeText "ca.crt" (builtins.readFile /root/.vpn/ca.crt);
cert = pkgs.writeText "alice" (builtins.readFile /root/.vpn/alice.crt);
key = pkgs.writeText "alice.key" (builtins.readFile /root/.vpn/alice.key);
};
in
{
require = [
./private.nix
];
boot = {
kernelPackages = pkgs.linuxPackages_latest;
extraModprobeConfig = ''
options snd slots=snd_usb_audio,snd-hda-intel
options kvm-amd nested=1
options kvm-intel nested=1
'';
cleanTmpDir = true;
loader.grub = {
timeout = 1;
enable = true;
version = 2;
};
};
/*https://hydra.nixos.org */
nix = {
/*package = pkgs.nixUnstable;*/
binaryCaches = [ https://cache.nixos.org ];
trustedBinaryCaches = [ https://cache.nixos.org http://hydra.cryp.to https://hydra.serokell.io ];
binaryCachePublicKeys = [
"hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hydra.serokell.io-1:he7AKwJKKiOiy8Sau9sPcso9T/PmlVNxcnNpRgcFsps="
];
useSandbox = true;
gc = {
automatic = true;
dates = "00:00";
};
};
nixpkgs.config = {
allowUnfree = true;
};
networking = {
extraHosts = literals.extraHosts;
networkmanager.enable = true;
firewall.enable = false;
};
i18n = {
consoleFont = "lat9w-16";
consoleKeyMap = "ruwin_cplk-UTF-8";
defaultLocale = "en_US.UTF-8";
};
hardware = {
cpu.intel.updateMicrocode = true;
opengl = {
driSupport32Bit = true;
};
pulseaudio = {
enable = true;
};
};
security.sudo.configFile = literals.sudoConf;
services = {
cron.systemCronJobs = [
"20 * * * * jaga rsync --remove-source-files -rauz ${config.users.extraUsers.jaga.home}/{Dropbox/\"Camera Uploads\",yandex-disk/}"
#"22 * * * * root systemctl restart yandex-disk.service"
];
dbus.enable = true;
pcscd.enable = true;
nixosManual.showManual = true;
nix-serve.enable = true;
journald.extraConfig = "SystemMaxUse=50M";
locate.enable = true;
udisks2.enable = true;
openssh.enable = true;
openntpd.enable = true;
openvpn = {
servers.JJ = literals.openVPNConf.configJJ;
};
};
services.xserver = {
exportConfiguration = true;
enable = true;
layout = "us,ru";
xkbOptions = "grp:caps_toggle";
xkbVariant = "colemak";
displayManager.slim = {
enable = true;
autoLogin = false;
defaultUser = "jaga";
};
displayManager.lightdm = {
enable = false;
};
desktopManager = {
xterm.enable = false;
};
windowManager = {
default = "xmonad";
xmonad = {
enable = true;
enableContribAndExtras = true;
};
};
displayManager.sessionCommands = with pkgs; lib.mkAfter ''
gpg-connect-agent /bye
GPG_TTY=$(tty)
export GPG_TTY
unset SSH_AGENT_PID
export SSH_AUTH_SOCK="${config.users.extraUsers.jaga.home}/.gnupg/S.gpg-agent.ssh"
${xlibs.xsetroot}/bin/xsetroot -cursor_name left_ptr;
${coreutils}/bin/sleep 30 && ${dropbox}/bin/dropbox &
${networkmanagerapplet}/bin/nm-applet &
${feh}/bin/feh --bg-scale ${config.users.extraUsers.jaga.home}/yandex-disk/Camera\ Uploads/etc/fairy_forest_by_arsenixc-d6pqaej.jpg;
exec ${haskellPackages.xmonad}/bin/xmonad
'';
config = literals.trackBallConf;
};
systemd.services.lastfmsubmitd = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "forking";
ExecStart = ''${pkgs.screen}/bin/screen -dmS lastfsubmit ${pkgs.lastfmsubmitd}/bin/lastfmsubmitd --no-daemon'';
ExecReload = ''${pkgs.screen}/bin/screen -S lastfsubmit -X quit'';
};
};
programs = {
ssh.startAgent = true;
zsh.enable = true;
};
users.extraUsers.jaga = {
description = "Arseniy Seroka";
createHome = true;
home = "/home/jaga";
group = "users";
extraGroups = [ "wheel" "networkmanager" "adb" "video" "power" "vboxusers" "cdrom" ];
shell = "${pkgs.zsh}/bin/zsh";
uid = 1000;
};
time.timeZone = "Europe/Moscow";
environment.systemPackages = with pkgs; [
bash
dropbox
exfat-utils
fuse_exfat
git
htop
iotop
mc
networkmanager
networkmanagerapplet
shared_mime_info
pmutils
stdenv
wget
xsel
zsh
];
fonts = {
fontconfig.enable = true;
enableFontDir = true;
enableGhostscriptFonts = true;
fontconfig.defaultFonts.monospace = ["Terminus"];
fonts = [
pkgs.corefonts
pkgs.clearlyU
pkgs.cm_unicode
pkgs.dejavu_fonts
pkgs.freefont_ttf
pkgs.terminus_font
pkgs.ttf_bitstream_vera
];
};
}