-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesktop.nix
160 lines (153 loc) · 4.23 KB
/
desktop.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
{
pkgs,
lib,
nur,
config,
...
}: let
bg = let
convert = "${pkgs.imagemagick}/bin/convert";
font = "${pkgs.iosevka}/share/fonts/truetype/Iosevka-ExtendedMediumItalic.ttf";
drv = pkgs.runCommand "desktop-bg.png" {} ''
${convert} -font ${font} \
-background black \
-fill white \
-pointsize 24 \
-gravity center \
-size 1920x1080 \
label:"oh no, not you again!" $out
'';
in
drv.outPath;
# could this be refactored using xdg terminal?
terminal = assert config.programs.kitty.enable; "kitty";
in {
imports = [
./sway.nix
];
_module.args = {
inherit bg terminal;
};
home.packages = with pkgs; [
wl-clipboard
(
pkgs.writeShellApplication {
name = "whatsapp";
runtimeInputs = with pkgs; [chromium];
text = ''chromium --ozone-platform-hint=auto --app="https://web.whatsapp.com/"'';
}
)
];
i18n.inputMethod = {
enabled = null;
fcitx5.addons = with pkgs; [
fcitx5-gtk
kdePackages.fcitx5-qt
kdePackages.fcitx5-chinese-addons
];
};
programs.firefox = {
enable = true;
profiles.default = {
id = 0;
name = "default";
isDefault = true;
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"layers.acceleration.force-enabled" = true;
"gfx.webrender.all" = true;
"gfx.webrender.enabled" = true;
"layout.css.backdrop-filter.enabled" = true;
"svg.context-properties.content.enabled" = true;
"network.protocol-handler.external.mailto" = false;
"browser.tabs.unloadOnLowMemory" = true;
};
userChrome = builtins.readFile ./assets/userChrome.css;
extensions.packages = [
nur.repos.rycee.firefox-addons.ublock-origin
nur.repos.rycee.firefox-addons.youtube-nonstop
];
};
};
programs.zathura.enable = true;
programs.kitty = {
enable = true;
settings = {
scrollback_pager = ''nvim -c "silent write! /tmp/kitty_scrollback_buffer | te cat /tmp/kitty_scrollback_buffer - "'';
};
keybindings = {
# "f1" = "show_scrollback";
};
font.name = "Iosevka Term NFM";
font.size = 16;
};
systemd.user.startServices = true;
systemd.user.sessionVariables = {
GTK_IM_MODULE = "fcitx5";
QT_IM_MODULE = "fcitx5";
};
services.udiskie.enable = true;
xdg = {
enable = true;
configFile = {
"pipewire/pipewire-pulse.conf.d/switch-on-connect.conf".text = ''
pulse.cmd = [
{ cmd = "load-module" args = "module-switch-on-connect" }
]
'';
};
desktopEntries.whatsapp = {
type = "Application";
name = "WhatsApp";
comment = "Launch WhatsApp";
icon = pkgs.fetchurl {
url = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/240px-WhatsApp.svg.png";
hash = "sha256-ZbTuq5taAsRvdfJqvqw8cqR5z4/Ogpt/nEb1npp/l4U=";
};
exec = ''whatsapp'';
terminal = false;
};
desktopEntries.feh = {
type = "Application";
name = "Feh";
comment = "Launch Feh";
exec = "${lib.getExe pkgs.feh} %U";
terminal = false;
};
desktopEntries.yazi = {
type = "Application";
name = "Yazi";
comment = "Launch Yazi";
exec = assert config.programs.yazi.enable; assert config.programs.kitty.enable; "kitty --hold yazi %U";
terminal = false;
};
mimeApps = {
enable = true;
defaultApplications = let
constVals = ks: v: lib.attrsets.genAttrs ks (lib.trivial.const v);
in
{
"application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop";
"inode/directory" = "yazi.desktop";
}
// (constVals [
"x-scheme-handler/http"
"x-scheme-handler/https"
"text/html"
"application/x-extension-htm"
"application/x-extension-html"
"application/x-extension-shtml"
"application/xhtml+xml"
"application/x-extension-xhtml"
"application/x-extension-xht"
] "firefox.desktop")
// (constVals (map (s: "image/" + s) [
"jpeg"
"png"
"gif"
"tiff"
"bmp"
]) "feh.desktop");
};
};
}