-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesktop.nix
More file actions
215 lines (178 loc) · 5.43 KB
/
desktop.nix
File metadata and controls
215 lines (178 loc) · 5.43 KB
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
{ pkgs, ... }: {
imports = [
./apps/desktop.nix
./desktop/scripts.nix
];
fonts.packages = with pkgs; [
nerd-fonts._0xproto
];
hardware.graphics.enable = true;
# Disable IPv6 because it does not go through the VPN
networking.enableIPv6 = false;
services = {
gnome.gnome-keyring.enable = true;
libinput.enable = true;
# Sound server
pipewire = {
enable = true;
pulse.enable = true;
};
# Enable CUPS to print documents.
printing.enable = true;
# Give Vial access to all keyboard devices
udev.extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
'';
udisks2.enable = true;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment = {
etc = {
"gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Adwaita:dark
gtk-application-prefer-dark-theme=1
'';
"ruff.toml".text = ''
# Exclude a variety of commonly ignored directories.
exclude = [
".direnv",
".eggs",
".git",
".pyenv",
".ruff_cache",
".svn",
".venv",
".vscode",
"__pypackages__",
]
# Same as Black.
line-length = 88
indent-width = 4
# Assume Python 3.13
target-version = "py313"
[lint]
# Enable Pyflakes (`F`) and the pycodestyle (`E`) codes.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E", "F", "I", "N", "W"]
ignore = []
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[lint.per-file-ignores]
# Ruff shows F401 warnings in __init__.py, which doesn't make sense
"__init__.py" = ["F401"]
[format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
'';
};
pathsToLink = [
"share/thumbnailers"
];
sessionVariables = with pkgs; rec {
BROWSER = "${librewolf}/bin/librewolf";
DEFAULT_BROWSER = BROWSER; # Electron based apps use this variable
EDITOR = "${neovim}/bin/nvim";
GTK_THEME = "Adwaita:dark";
NIXOS_OZONE_WL = "1";
TERMINAL = "${alacritty}/bin/alacritty";
VISUAL = EDITOR;
};
shellAliases = {
g = "git";
gb = "git branch";
gd = "git diff";
gs = "git status";
};
systemPackages = with pkgs; [
alacritty
direnv
# The regular dmenu is buggy (probably only on wayland), and dmenu-rs uses no absolute paths
# in it's shell file dmenu_run. So I need to install it globally rather than keeping it's
# installation implied.
dmenu-rs
file-roller
gimp
libheif # For nautilus image preview
mako
nautilus
pavucontrol
protonmail-bridge-gui
session-desktop
signal-desktop
todo-txt-cli
tor-browser
totem
transmission_4-gtk
vial
wl-clipboard-rs
# Install a bunch of python development tools as the fallback tools for when no virtual
# environment is used.
(python3.withPackages (python-pkgs: with python-pkgs; [
black
debugpy
python-lsp-server
flake8
jedi
pydocstyle
pylint-odoo
pyflakes
pylint
]))
];
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs = {
dconf.profiles.user.databases = [{
lockAll = true;
settings = {
"org/gnome/desktop/interface" = {
accent-color = "blue";
color-scheme = "prefer-dark";
text-scaling-factor = 1.1;
};
};
}];
};
services.gvfs.enable = true;
virtualisation.docker.enable = true;
xdg.mime = {
enable = true;
defaultApplications = {
"text/html" = "librewolf.desktop";
"text/plain" = "neovim.desktop";
"video/mp4" = "totem.desktop";
"video/x-matroska" = "totem.desktop";
"image/jpeg" = "loupe.desktop";
"x-scheme-handler/http" = "librewolf.desktop";
"x-scheme-handler/https" = "librewolf.desktop";
"x-scheme-handler/about" = "librewolf.desktop";
"x-scheme-handler/unknown" = "librewolf.desktop";
};
};
}