-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon-gui.nix
215 lines (187 loc) · 5.19 KB
/
common-gui.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
206
207
208
209
210
211
212
213
214
215
{ config, pkgs, nix-gaming, unstable-nixpkgs, ... }:
let
secrets = import ./secrets;
audio_env = {
LADSPA_PATH = "/run/current-system/sw/lib/ladspa";
};
libshoutSsl = pkgs.libshout.overrideAttrs (a : { propagatedBuildInputs = a.propagatedBuildInputs ++ [pkgs.openssl ]; });
in {
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
boot.kernelModules = [ "v4l2loopback" ];
boot.supportedFilesystems = [ "ntfs" ];
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
extraPackages = with pkgs; [
xdg-utils
nautilus
evince
# basic sway stuff
swaylock
waybar
sway-contrib.grimshot
pulseaudio # pipewire is still heavily controlled via pulseaudio apps.
grim
slurp
swayidle
wl-clipboard
brightnessctl
dmenu
xdotool
];
extraSessionCommands = let
gsettings = "${pkgs.glib}/bin/gsettings";
schema = pkgs.gsettings-desktop-schemas;
gschema = "org.gnome.desktop.interface";
in ''
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export _JAVA_AWT_WM_NONREPARENTING=1
export MOZ_ENABLE_WAYLAND=1
export OBS_USE_EGL=1
export XDG_DATA_DIRS=${schema}/share/gsettings-schemas/${schema.name}:$XDG_DATA_DIRS
export GTK_USE_PORTAL=1
${gsettings} set ${gschema} icon-theme 'Papirus'
${gsettings} set ${gschema} gtk-theme 'Materia-Dark'
'';
};
security.wrappers.sway = {
owner = "root";
group = "root";
source = "${pkgs.sway}/bin/sway";
capabilities = "cap_sys_nice+ep";
};
nixpkgs.overlays = [ (self: super : {
sway-unwrapped = super.sway-unwrapped.overrideAttrs (attrs :{
patches = attrs.patches ++ [ ./0001-Lower-CAP_SYS_NICE-from-ambient-set.patch ];
});
})];
xdg = {
portal = {
enable = true;
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
};
programs.waybar.enable = true;
#services.packagekit.enable = false;
# Configure wacom tablet
services.udev.packages = [ pkgs.libwacom ];
services.xserver.wacom.enable = true;
# Configure keymap in X11
services.xserver.xkb.layout = "us";
services.xserver.xkb.variant = "dvorak";
services.libinput.mouse.middleEmulation = false;
services.ratbagd = {
enable = true;
package = let
v = { owner = "libratbag";
repo = "libratbag";
rev = "1c9662043f4a11af26537e394bbd90e38994066a";
hash = "sha256-IpN97PPn9p1y+cAh9qJAi5f4zzOlm6bjCxRrUTSXNqM=";};
in pkgs.libratbag.overrideAttrs (a: {
version = "unstable-git-${builtins.substring 0 7 (v.rev)}";
src = pkgs.fetchFromGitHub v;
});
};
hardware.bluetooth.enable = true;
hardware.onlykey.enable = true;
# Enable sound.
hardware.pulseaudio.enable = false;
systemd.user.services.pipewire.environment = audio_env;
systemd.services.pipewire.environment = audio_env;
services.pipewire = {
enable = true;
wireplumber = {
enable = true;
};
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
extraLv2Packages = with pkgs; [
lsp-plugins
];
};
# help pulse audio use realtime scheduling
security.rtkit.enable = true;
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
rocmPackages.clr.icd
];
};
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
# TODO, migrate to home-manager, not needed system wide.
xsel
alacritty
keepassxc
firefox
discord
mpv
#anki-bin
# These are needed system-wide for editing root files with doom emacs
nil
ripgrep
fd
nixfmt
onlykey
onlykey-cli
mpd
cantata
pavucontrol
vlc
spotify
qjackctl
signal-desktop
papirus-icon-theme
adwaita-icon-theme
# Fails to build check in a few weeks
#materia-theme
libwacom
krita
xournalpp
inkscape
yquake2
(nix-gaming.wine-ge) #.override { supportFlags.waylandSupport = false; })
# nix-gaming.wine-discord-ipc-bridge
heroic #.override { heroic-unwrapped = heroic-unwrapped.override { electron = electron_24 ;};})
rnnoise-plugin
lsp-plugins
# TODO move to home manager
(pkgs.writeShellScriptBin "runWithDiscordBridge" ''
export PROTON_REMOTE_DEBUG_CMD="${nix-gaming.wine-discord-ipc-bridge}/bin/winediscordipcbridge.exe"
export PRESSURE_VESSEL_FILESYSTEMS_RW="/run/user/$UID/discord-ipc-0"
"$@"
'')
];
programs.steam.enable = true;
programs.gamescope.enable = true;
#programs.gamemode.enable = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
fira-code
corefonts
vistafonts
(google-fonts.override {
fonts = [ "Kode Mono"
"EB Garamond"
"Titillium Web"
"Cutive Mono"
"Orbit"
"Varela Round"
"Zilla Slab"
];
})
] ++ builtins.attrValues {
inherit (pkgs.nerd-fonts)
monoid
fira-code
caskaydia-cove
symbols-only
;
};
}