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
|
# Module containing a bunch of things that make up a `desktop environment` built
# off of hyprland. I install this on all my desktop/laptop machines.
# IMPORTANT: this module requires the system to already have `programs.hyprland`
# enabled. You can enable it by importing `share/system/hyprland.nix`
{ pkgs, config, inputs, ... }: {
imports = [
# Custom home manager modules
../hm-modules/wpaperd.nix
../hm-modules/tofi.nix
# Config
./minimal.nix
./wpaperd.nix
./tofi.nix
./eww
./git.nix
./mpv.nix
./kitty.nix
./offpunk.nix
./firefox
./emacs
];
wayland.windowManager.hyprland =
let
commands = {
audio = {
increase = "wpctl set-volume @DEFAULT_AUDIO_SINK@ --limit 1.0 5%+";
decrease = "wpctl set-volume @DEFAULT_AUDIO_SINK@ --limit 1.0 5%-";
toggle-mute = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
};
screenshot = ''grim -g "$(slurp)" -t png - | wl-copy --type image/png'';
cmd = {
run = "tofi-run";
drun = "tofi-drun";
};
brightness = {
increase = "brightnessctl set +5%";
decrease = "brightnessctl set 5%-";
};
terminal = "kitty";
};
in
{
enable = true;
extraConfig = ''
$mod = SUPER
bind = $mod SHIFT, Return, exec, ${commands.terminal}
general {
layout = master
}
misc {
force_hypr_chan = true
}
master {
mfact = 0.5
new_is_master = false
}
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
${builtins.concatStringsSep "\n" (builtins.genList (x:
let ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
in ''
bind = $mod, ${ws}, workspace, ${toString (x + 1)}
bind = $mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}
'') 10)}
bind = $mod SHIFT, C, killactive
bind = $mod SHIFT, F, togglefloating
bind = $mod SHIFT, Q, exit
bind = $mod, P, exec, ${commands.cmd.drun}
bind = $mod SHIFT, P, exec, ${commands.cmd.run}
bind = $mod, H, cyclenext, prev
bind = $mod, L, cyclenext
bind = $mod SHIFT, H, swapnext, prev
bind = $mod SHIFT, L, swapnext
# audio control
binde =, XF86AudioRaiseVolume, exec, ${commands.audio.increase}
binde =, XF86AudioLowerVolume, exec, ${commands.audio.decrease}
bind =, XF86AudioMute, exec, ${commands.audio.toggle-mute}
# monitor brightness control
binde =, XF86MonBrightnessUp, exec, ${commands.brightness.increase}
binde =, XF86MonBrightnessDown, exec, ${commands.brightness.decrease}
# Screenshotting
# My stupid laptop outputs these three key codes when the PrtSc key is
# pressed instead of using just one code like any sane device would
bind = SUPER SHIFT, S, exec, ${commands.screenshot}
input {
# focus change on cursor move
follow_mouse = 1
accel_profile = flat
}
monitor=,preferred,auto,1
# set opacity to 0.9 active and 0.5 inactive for kitty
windowrule = opacity 0.9 override 0.5 override,^(kitty)$
# Move windows to their designated workspaces
windowrulev2 = workspace 3,class:(firefox)
windowrulev2 = workspace 4,class:(fluffychat)
windowrulev2 = workspace 4,class:(org.telegram.desktop)
windowrulev2 = workspace 4,class:(Signal)
windowrulev2 = workspace 5,class:(Bitwarden)
exec-once = eww --config ${config.programs.eww.configDir} open bar
'';
};
home.packages = with pkgs; [
xh # Nice to use HTTP client
bc # CLI calculator
amfora # Gemini CLI browser
trashy # Trash CLI
tokei # counts lines of code
btop # modern top
brightnessctl
wineWowPackages.full
winetricks
inputs.scripts.packages.${pkgs.system}.image-move
inputs.scripts.packages.${pkgs.system}.image-remove
qemu_kvm
wireplumber # session & policy manager for pipewire
grim # screenshot utility for wayland
slurp # region selection UI for wayland
wl-clipboard # clipboard utility
nushell # next-generation shell
# TUI/GUI programs
cmus # music player
calibre # Document organisation/reading program
libreoffice-qt
beekeeper-studio # SQL database client
thunderbird # email client
nsxiv # image viewer
discord
signal-desktop
tdesktop # Telegram desktop
fluffychat # matrix client
qbittorrent # bittorrent client
zathura # document reader
okular # document reader
bitwarden # password manager
bitwarden-cli
# Gaming
jdk17_headless
superTuxKart
];
services.dunst.enable = true;
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
xdg = {
systemDirs.data =
let
gds = pkgs.gsettings-desktop-schemas;
gtk3 = pkgs.gtk3;
in
[
"${gds}/share/gsettings-schemas/${gds.name}"
"${gtk3}/share/gsettings-schemas/${gtk3.name}"
];
userDirs =
let
home = config.home.homeDirectory;
in
{
enable = true;
createDirectories = true;
pictures = "${home}/Annex/Pictures";
music = "${home}/Annex/Music";
};
};
}
|