-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsway-gui.nix
135 lines (119 loc) · 3.48 KB
/
sway-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
{
pkgs,
lib,
...
}:
{
# make udev rules for backlight
programs.light.enable = true;
# firefox integration
programs.firefox.enable = true;
# xdg-desktop-portal works by exposing a series of D-Bus interfaces
# known as portals under a well-known name
# (org.freedesktop.portal.Desktop) and object path
# (/org/freedesktop/portal/desktop).
# The portal interfaces include APIs for file access, opening URIs,
# printing and others.
xdg.portal = {
enable = true;
wlr.enable = true;
};
fonts = {
enableDefaultPackages = true;
packages = [
pkgs.source-code-pro
pkgs.source-sans-pro
pkgs.source-serif-pro
pkgs.noto-fonts-emoji
];
fontconfig = {
enable = true;
# some applications, notably alacritty, choose fonts according to
# fontconfigs internal ordering of fonts rather than specific font
# tags. To get the correct fonts to be rendered, we need to disable some
# fallback fonts which nixos includes by default and fontconfig prefers
# over user specified ones. To see this internal list, run fc-match -s
localConf =
let
# function to generate patterns for fontconfig font banning
fontBanPattern = s: ''
<pattern>
<patelt name="family">
<string>${s}</string>
</patelt>
</pattern>
'';
fontsToBan = [
"Noto Emoji"
"DejaVu Sans"
"FreeSans"
"FreeMono"
"FreeSerif"
"DejaVu Math TeX Gyre"
"DejaVu Sans Mono"
"DejaVu Serif"
"Liberation Mono"
"Liberation Serif"
"Liberation Sans"
"DejaVu Serif"
"DejaVu Serif"
"Liberation Serif"
"DejaVu Serif"
];
in
''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<selectfont>
<rejectfont>
${lib.strings.concatStringsSep "\n" (map fontBanPattern fontsToBan)}
</rejectfont>
</selectfont>
</fontconfig>
'';
defaultFonts = {
monospace = [ "Source Code Pro" ];
sansSerif = [ "Source Sans Pro" ];
serif = [ "Source Serif Pro" ];
emoji = [ "Noto Color Emoji" ];
};
};
};
environment.systemPackages = with pkgs; [
(callPackage ./status-command.nix {})
glib # gsettings
dracula-theme # gtk theme
adwaita-icon-theme # default gnome icons
nixos-icons
swaylock
swayidle
grim # screenshot functionality
slurp # screenshot functionality
wl-clipboard
mako # FreeDesktop notifications
libnotify # notify-send
kanshi # sway hotplug functionality
fuzzel
];
# enable sway window manager
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
# clearout default packages
extraPackages = [];
# extra session environment variables
# we need add gsettings-desktop-schemas to XDG_DATA_DIRS so gsettings works
# we need to set _JAVA_AWT_WM_NONREPARENTING=1 so java GUI apps aren't broken
extraSessionCommands =
let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in
''
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
export _JAVA_AWT_WM_NONREPARENTING=1
export BROWSER=firefox
'';
};
}