/
default.nix
152 lines (145 loc) · 3.57 KB
/
default.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
{ lib, pkgs, ... }: {
imports = [
./alacritty.nix
./firefox.nix
./mako.nix
./mpv.nix
./termite.nix
./sway.nix
./swaylock.nix
./waybar.nix
];
home = {
file.".icons/default".source = "${pkgs.gnome3.adwaita-icon-theme}/share/icons/Adwaita";
packages = with pkgs; [
grim
libnotify
pavucontrol
pinentry-gnome
slurp
speedcrunch
wl-clipboard
xdg_utils
] ++ lib.optionals (pkgs.hostPlatform.system == "x86_64-linux") [
discord
gnome3.evince
gnome3.shotwell
imv
mbk
prusa-slicer
slack
spotify
thunderbird
zoom-us
];
};
gtk = {
enable = true;
gtk2.extraConfig = "gtk-application-prefer-dark-theme = true";
gtk3.extraConfig.gtk-application-prefer-dark-theme = true;
};
qt = {
enable = true;
platformTheme = "gnome";
style = {
name = "adwaita";
package = pkgs.adwaita-qt;
};
};
programs.zsh.profileExtra = ''
# If running from tty1 start sway
if [ "$(tty)" = "/dev/tty1" ]; then
systemctl --user unset-environment \
SWAYSOCK \
I3SOCK \
WAYLAND_DISPLAY \
DISPLAY \
IN_NIX_SHELL \
__HM_SESS_VARS_SOURCED \
GPG_TTY \
NIX_PATH \
SHLVL
exec env --unset=SHLVL systemd-cat -t sway -- sway
fi
'';
services.gpg-agent.pinentryFlavor = "gnome3";
xsession.pointerCursor = {
package = pkgs.gnome3.adwaita-icon-theme;
name = "Adwaita";
size = 24;
};
# NB: UGH why do these have a different syntax the the system
# systemd.user.services?!
systemd.user.services = {
mako = {
Unit = {
Description = "mako";
Documentation = [ "man:mako(1)" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.mako}/bin/mako";
RestartSec = 3;
Restart = "always";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
polkit = {
Unit = {
Description = "polkit-gnome";
Documentation = [ "man:polkit(8)" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
RestartSec = 3;
Restart = "always";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
redshift = lib.mkIf (pkgs.hostPlatform.system == "x86_64-linux") {
Unit = {
Description = "redshift";
Documentation = [ "man:redshift(1)" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.redshift-wlr}/bin/redshift -l geoclue2";
RestartSec = 3;
Restart = "always";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
swayidle = {
Unit = {
Description = "swayidle";
Documentation = [ "man:swayidle(1)" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = ''
${pkgs.swayidle}/bin/swayidle -w \
timeout 300 '${pkgs.swaylock}/bin/swaylock' \
timeout 600 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep '${pkgs.swaylock}/bin/swaylock'
'';
RestartSec = 3;
Restart = "always";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
};
}