-
Notifications
You must be signed in to change notification settings - Fork 0
/
laptop.nix
203 lines (165 loc) · 4.26 KB
/
laptop.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
199
200
201
202
203
{
lib,
inputs,
pkgs,
username,
appimageTools,
...
}: {
imports = [
./machine.nix
./kanata/mod.nix
./wezterm/mod.nix
./sway/mod.nix
./nix-bitcoin/mod.nix
./monero/mod.nix
./cosmic/mod.nix
];
boot.supportedFilesystems = ["ntfs"];
services = {
mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
udev.packages = with pkgs; [
# bazecor
android-udev-rules
];
udev.extraRules = ''
KERNEL=="hidraw*", ATTRS{idVendor}=="d13e", ATTRS{idProduct}=="cc10", GROUP="plugdev", MODE="0666", SYMLINK+="coldcard"
'';
blueman.enable = true;
};
programs = {
steam.enable = true;
virt-manager.enable = true;
};
security.polkit.enable = true;
systemd.services."user@".serviceConfig.Delegate = ["cpu" "cpuset" "io" "memory" "pids"];
systemd.user.services."stalker" = {
after = ["network.target"];
serviceConfig = {
ExecStart = "/home/${username}/.cargo/bin/stalker-bin";
};
environment = {
RUST_LOG = "info,sqlx=warn";
DATA_DIR = "/home/${username}/stalker-data";
};
};
networking.wireless = {
enable = false; # Enables wireless support via wpa_supplicant.
iwd.enable = true;
};
networking.firewall = {
enable = true;
allowedTCPPorts = [6666];
allowedUDPPorts = [3000 3010];
};
networking.nftables.enable = true;
services.xserver = {
xkb.layout = "us,ru";
xkb.variant = "";
xkb.options = "grp:win_space_toggle";
videoDrivers = ["nvidia"];
};
services.gnome = {
gnome-keyring.enable = true;
tracker-miners.enable = true;
};
users.users.${username} = {
isNormalUser = true;
extraGroups = ["docker" "libvirtd"];
};
users.users.docker = {
isNormalUser = true;
extraGroups = ["docker"];
};
environment.systemPackages = with pkgs; [
rust-analyzer
rustup
brightnessctl
zoxide
keepassxc
firefox
mullvad-browser
mullvad-vpn
chromium
tor-browser-bundle-bin
session-desktop
pulsemixer
# termusic
mako
sway
swaybg
swaylock
swayidle
grim # screenshot functionality
slurp # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
swww
logseq
mpv
qbittorrent
electrum
flameshot
kanata
# (bazecor.overrideAttrs {
# src = pkgs.appimageTools.extract {
# pname = "bazecor";
# version = "1.4.0-rc.3";
# src = fetchurl {
# url = "https://github.com/Dygmalab/Bazecor/releases/download/v1.4.0-rc.3/Bazecor-1.4.0-rc.3-x64.AppImage";
# hash = "sha256-ojAVBNSknOvh8L4dqkoxHw3aYoWr0Wb81kVptNVCC3o=";
# };
# # Workaround for https://github.com/Dygmalab/Bazecor/issues/370
# postExtract = ''
# substituteInPlace \
# $out/usr/lib/bazecor/resources/app/.webpack/main/index.js \
# --replace \
# 'checkUdev=()=>{try{if(c.default.existsSync(f))return c.default.readFileSync(f,"utf-8").trim()===l.trim()}catch(e){console.error(e)}return!1}' \
# 'checkUdev=()=>{return 1}'
# '';
# };
# })
# (looking-glass-client.overrideAttrs {
# src = fetchFromGitHub {
# owner = "gnif";
# repo = "LookingGlass";
# rev = "B6-rc1";
# sha256 = "sha256-FZjwLY2XtPGhwc/GyAAH2jvFOp61lSqXqXjz0UBr7uw=";
# fetchSubmodules = true;
# };
# })
# virt manager is broken without this
# gnome3.adwaita-icon-theme # default gnome cursors
glib
];
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
services.dbus.enable = true;
virtualisation.docker = {
enable = true;
};
virtualisation.libvirtd = {
enable = true;
qemu.verbatimConfig = ''
cgroup_device_acl = [
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc","/dev/hpet", "/dev/vfio/vfio",
"/dev/kvmfr0"
]
'';
};
fonts.packages = with pkgs; [
fira-code
];
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
hardware.bluetooth.enable = true;
hardware.pulseaudio.enable = false;
}