-
Notifications
You must be signed in to change notification settings - Fork 0
/
sakuya.nix
206 lines (193 loc) · 4.94 KB
/
sakuya.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
204
205
{ config, pkgs, inputs, ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.kernel.sysctl = {
"net.ipv4.tcp_congestion_control" = "reno";
};
# Don't let ethernet card DHCP
networking.useDHCP = false;
networking.hostName = "sakuya";
networking.hostId = "d028bb22";
systemd.network = {
enable = true;
netdevs = {
"20-br0".netdevConfig = {
Kind = "bridge";
Name = "br0";
MACAddress = "de:ad:be:ef:42:13";
};
"20-tap0".netdevConfig = {
Kind = "tap";
Name = "tap0";
};
};
networks = {
"30-enp7s0" = {
matchConfig.Name = "enp7s0";
networkConfig.Bridge = "br0";
linkConfig.RequiredForOnline = "enslaved";
};
"30-tap0" = {
matchConfig.Name = "tap0";
networkConfig.Bridge = "br0";
linkConfig.RequiredForOnline = "enslaved";
};
"40-br0" = {
matchConfig.Name = "br0";
networkConfig.DHCP = "ipv4";
dhcpV4Config.UseDomains = true;
bridgeConfig = { };
linkConfig.RequiredForOnline = "carrier";
};
};
};
systemd.services."systemd-networkd-wait-online".serviceConfig.ExecStart = [
""
"${config.systemd.package}/lib/systemd/systemd-networkd-wait-online --any"
];
services.resolved = {
enable = true;
extraConfig = ''
DNSOverTLS=opportunistic
'';
};
security.pam.dp9ik = {
enable = true;
authserver = "flan.genso";
};
system.fsPackages = [ pkgs._9ptls ];
boot.supportedFilesystems = [ "zfs" ];
fileSystems = {
"/media" = {
device = "/dev/disk/by-uuid/9dd50c72-23a0-42dd-9648-b41e938ad98c";
options = [ "nofail" ];
};
};
hardware.opengl.enable = true;
users.users.moody = {
isNormalUser = true;
extraGroups = [ "wheel" "video" ];
};
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
curl
wayland
grim
slurp
wl-clipboard
mako
xdg-utils
bemenu
wdisplays
wget
(firefox.override { extraNativeMessagingHosts = [ inputs.pipewire-screenaudio.packages.${pkgs.system}.default ]; })
sway
telegram-desktop
pavucontrol
zfs
passage
gnumake
gcc
pipewire
git
hexchat
thunderbird
gnome3.adwaita-icon-theme
nawk
xfce.thunar
transmission-gtk
mpv
jq
htop
wlclock
rc-9front
drawterm-wayland
tlsclient
libnotify
go
gopls
nil
nixpkgs-fmt
imv
qemu_kvm
ffmpeg
vlc
man-pages
man-pages-posix
games.pokecrystal
games.pokered
shipwright
games.pokeemerald
games.zelda3
games.pokefirered
games.pokeyellow
games.pokegold
pc
hunspell
hunspellDicts.en_US
plan9port
ed
file
nixpkgs-review
unzrip
dolphin-emu
pinentry-curses
chromium
qemu
gamescope
radare2
screen
ioquake3
(pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [ obs-pipewire-audio-capture ];
})
# YUCK!
discord
(writeScriptBin "mutemic"
''
#!/usr/bin/env bash
# wpctl is the pactl we have at home
mic="alsa_input.usb-0c76_USB_PnP_Audio_Device-00.mono-fallback"
id="$(pw-dump -N | jq '.[] | select(.info.props."node.name"=="'$mic'")| .id')"
if test "$#" -gt 0; then
wpctl set-mute $id $*
else
wpctl set-mute $id toggle
fi
''
)
(writeScriptBin "auxtoggle"
''
#!/usr/bin/env bash
# everything uses id's except pw-metadata because no one thought this out
speakers="alsa_output.pci-0000_0c_00.4.analog-stereo"
cans="alsa_output.usb-JDS_Labs_JDS_Labs_Atom_DAC-00.analog-stereo"
canid="$(pw-dump -N | jq '.[] | select(.info.props."node.name"=="'$cans'")| .id')"
speakerid="$(pw-dump -N | jq '.[] | select(.info.props."node.name"=="'$speakers'")| .id')"
if pw-metadata 0 default.audio.sink | grep -q $cans; then
wpctl set-default $speakerid
else
wpctl set-default $canid
fi
''
)
];
services.udev.packages = [ pkgs.dolphin-emu ];
services.jellyfin.enable = true;
programs.steam.enable = true;
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
};
services.avahi.enable = true;
networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}