-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui.nix
executable file
·298 lines (273 loc) · 8.13 KB
/
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
{ config, lib, pkgs, inputs, ... }:
{
# imports = [ inputs.hyprland.nixosModules.default ];
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
portalPackage =
inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
};
environment.systemPackages = with pkgs; [
gnome3.file-roller # provides all archive formats
pavucontrol
ffmpeg
xdg-utils
glib
# desktop environment
# gnome3.gtk
polkit_gnome
# rofi-menugen
#wpgtk
gsettings-desktop-schemas
# farge # color picker
# gcolor3
# gtk themes
# arc-theme
# paper-icon-theme
bibata-cursors
# system tools
libnotify
# xdg-desktop-portal
imagemagick
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
];
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-extra
google-fonts
merriweather
liberation_ttf
ubuntu_font_family
migu
dejavu_fonts
# Multilingual and IPA fonts
charis-sil
doulos-sil
andika
# symbols
symbola
emacs-all-the-icons-fonts
font-awesome
# programming fonts
fira-code
ibm-plex
jetbrains-mono
source-code-pro
mononoki
cascadia-code
hack-font
maple-mono-NF
# Add user fonts to ~/.local/share/fonts
];
fonts.fontconfig = {
defaultFonts = {
monospace = [
"Hack Nerd Font" # Main preference, changes often.
"Source Code Pro" # Provides almost all of the IPA symbols.
"Noto Sans Mono CJK SC"
"Noto Emoji"
# "Material Design Icons"
];
sansSerif = [
"Ubuntu Nerd Font"
"Noto Sans"
"FreeSans"
# "Material Design Icons"
];
serif = [ "Merriweather" "Liberation Serif" ];
};
# hinting.style = "slight";
# hinting.enable = false;
};
nixpkgs.overlays = [
(self: super: {
pywal = super.unstable.pywal16;
# Latest has some fixes I need!! In particular, a fix for OrcaSlicer dropdowns.
# hyprland = super.unstable.hyprland;
# Add extra dependencies for ranger to have improved file previews.
ranger-plus = super.ranger.overrideAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs
++ (with super; [ ueberzugpp mediainfo poppler_utils bat ]);
});
# Patch libnotify to support replacing existing notifications.
# libnotify = super.libnotify.overrideAttrs (old: {
# src = builtins.fetchGit {
# url = "https://gitlab.gnome.org/matthias.sweertvaegher/libnotify.git";
# ref = "replace";
# rev = "190576778ceec9d30f516bcad83846de5c1a6306";
# };
# });
# Build notify-send.sh, a libnotify alternative supporting more options.
notify-send-sh = self.stdenv.mkDerivation {
pname = "notify-send.sh";
version = "1.2";
src = builtins.fetchGit {
url = "https://github.com/vlevit/notify-send.sh";
ref = "master";
rev = "684a754daafdbc3d4fdf815989104208d2bdac6c";
};
propagatedBuildInputs = with self; [ bash glib ];
installPhase = ''
mkdir -p $out/bin
cp *.sh $out/bin/
'';
};
# Support pulseaudio in bar programs.
# TODO Maybe remove this now that I use pipewire? Alsa should be fine.
# polybar = super.polybar.override { pulseSupport = true; };
# Remove google tracking from chromium.
# chromium = super.ungoogled-chromium.override {
# enableWideVine = true;
# proprietaryCodecs = true;
# };
swhkd = pkgs.rustPlatform.buildRustPackage rec {
pname = "swhkd";
version = "1.3.0";
src = pkgs.fetchFromGitHub {
owner = "waycrate";
repo = pname;
rev = "3b19fc33b32efde88311579152a1078a8004397c";
sha256 = "245Y3UicW33hrQ6Mtf07I9vsWSpuijIEoEhxIKtjVQE=";
};
cargoLock = { lockFile = "${src}/Cargo.lock"; };
nativeBuildInputs = with pkgs; [ pkg-config makeWrapper ];
buildInputs = with pkgs; [ gnumake polkit ];
postInstall = ''
mkdir -p $out/share/polkit-1/actions
./scripts/build-polkit-policy.sh --policy-path=com.github.swhkd.pkexec.policy --swhkd-path=$out/bin/swhkd
install -Dm 644 ./com.github.swhkd.pkexec.policy -t $out/share/polkit-1/actions
'';
postFixup = ''
wrapProgram $out/bin/swhkd --prefix PATH : ${
lib.makeBinPath [ pkgs.polkit ]
}
wrapProgram $out/bin/swhks --prefix PATH : ${
lib.makeBinPath [ pkgs.polkit ]
}
'';
doCheck = false;
};
})
];
# Run swhkd system daemon to manage keybindings across all environments!
# systemd.services.swhkd = {
# # Launches ASAP
# wantedBy = [ "default.target" ];
# serviceConfig.ExecStart = "${pkgs.swhkd}/bin/swhkd";
# serviceConfig.Type = "forking";
# };
programs.xwayland.enable = true;
# Configure sway if I happen to want it in my setup.
programs.sway = {
package = pkgs.swayfx;
# package = pkgs.unstable.sway;
# enable = true;
extraPackages = with pkgs; [
swaylock
swayidle
xwayland
mako
kanshi
qt5.qtwayland
grim
wl-clipboard
# wf-recorder
];
extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export MOZ_ENABLE_WAYLAND=1
export MOZ_DBUS_REMOTE=1
export GDK_BACKEND=wayland
'';
wrapperFeatures = {
base = true;
gtk = true;
};
};
environment.sessionVariables = {
XDG_DATA_DIRS = with pkgs; [
"${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
"${gtk3}/share/gsettings-schemas/${gtk3.name}"
];
};
environment.pathsToLink = [ "/share" ];
# Provide default settings for any X11 sessions.
services.xserver = {
enable = lib.mkDefault true;
xkb.layout = "us";
xkb.options = "compose:ralt, terminate:ctrl_alt_bksp";
enableCtrlAltBackspace = true;
autoRepeatDelay = 250;
autoRepeatInterval = 30; # ms between key repeats
# I don't use caps lock enough, swap it with escape!
};
services.libinput = {
enable = true;
touchpad = {
scrollMethod = "twofinger";
naturalScrolling = true;
tapping = false;
clickMethod = "clickfinger";
};
};
# I type in other languages often enough.
i18n.inputMethod = {
enabled = null;
# ibus.engines = with pkgs.ibus-engines; [
# libpinyin
# anthy
# table
# table-others
# ];
};
# Give Firefox precise touchpad scrolling and wayland support.
environment.variables = {
MOZ_USE_XINPUT2 = "1";
MOZ_ENABLE_WAYLAND = "1";
};
# Enable better XDG integration.
xdg.portal.enable = true;
xdg.portal.extraPortals = with pkgs; [
xdg-desktop-portal-gtk
xdg-desktop-portal-xapp
];
xdg.portal.wlr = { enable = true; };
# xdg.portal.xdgOpenUsePortal = true;
# xdg.portal.config = {
# common = {
# default = [ "wlr" "gtk" ];
# "org.freedesktop.impl.portal.Settings" = [ "xapp" "gtk" ];
# };
# };
# Enable full OpenGL support.
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
nixpkgs.config.chromium.enableWideVine = true;
nixpkgs.config.chromium.proprietaryCodecs = true;
nixpkgs.config.ungoogled-chromium.enableWideVine = true;
nixpkgs.config.ungoogled-chromium.proprietaryCodecs = true;
hardware.opengl = {
enable = true;
# driSupport = true;
extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
intel-compute-runtime
];
};
# Support pinentry-gnome3 on non-Gnome DEs.
services.dbus.packages = [ pkgs.gcr ];
# Send media control events to the most recently active media.
systemd.user.services.playerctld = {
wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${pkgs.playerctl}/bin/playerctld daemon";
serviceConfig.Type = "forking";
};
security.polkit.enable = true;
}