forked from wimpysworld/nix-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
123 lines (118 loc) · 3.82 KB
/
Copy pathdefault.nix
File metadata and controls
123 lines (118 loc) · 3.82 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
{
catppuccinPalette,
config,
lib,
pkgs,
...
}:
let
inherit (config.noughty) host;
mkHiddenWaylandSession =
name:
pkgs.writeTextDir "share/wayland-sessions/${name}.desktop" ''
[Desktop Entry]
Name="Hidden-${name}"
NoDisplay=true
'';
# Create a Wayland session that starts Wayfire and cleans up after itself
wayfireShim = pkgs.symlinkJoin {
name = "wayfireShim";
paths = [
(pkgs.writeShellScriptBin "WayfireShim" ''
# Ensure log directory exists
LOG_DIR="$HOME/.local/log"
LOG_FILE="$LOG_DIR/wayfire.log"
mkdir -p "$LOG_DIR"
# Rotate logs before starting new session
if [ -f "$LOG_FILE" ]; then
# Remove oldest log (10)
[ -f "$LOG_FILE.10" ] && rm "$LOG_FILE.10"
# Rotate existing logs
for i in $(seq 9 -1 1); do
[ -f "$LOG_FILE.$i" ] && mv "$LOG_FILE.$i" "$LOG_FILE.$((i+1))"
done
# Move current log to .1
mv "$LOG_FILE" "$LOG_FILE.1"
fi
# Run Wayfire and log output
${pkgs.expect}/bin/unbuffer /run/current-system/sw/bin/wayfire $@ 2>&1 | ${pkgs.coreutils}/bin/tee -a "$LOG_FILE" &>/dev/null
# Log the exit code here
echo "[$(${pkgs.coreutils}/bin/date '+%Y-%m-%d %H:%M:%S')] Wayfire exited with code $?" | ${pkgs.coreutils}/bin/tee -a "$LOG_FILE"
'')
(pkgs.writeTextFile {
name = "wayfireShim-desktop";
destination = "/share/wayland-sessions/WayfireShim.desktop";
text = ''
[Desktop Entry]
Name=Wayfire
Comment=A modular and extensible wayland compositor
Exec=WayfireShim
Type=Application
DesktopNames=Wayfire
Keywords=tiling;wayland;compositor;
'';
})
];
# Add passthru metadata to specify session names
passthru.providedSessions = [ "WayfireShim" ];
};
in
{
imports = [ ../greeters/greetd.nix ];
config = lib.mkIf (host.desktop == "wayfire") {
environment = {
sessionVariables = {
# Make sure the cursor size is the same in all environments
XCURSOR_SIZE = 32;
XCURSOR_THEME = "catppuccin-${catppuccinPalette.flavor}-${catppuccinPalette.accent}-cursors";
NIXOS_OZONE_WL = 1;
# Hide the default wayfire session provided by the Wayfire package
XDG_DATA_DIRS = [
"${mkHiddenWaylandSession "wayfire"}/share"
];
};
systemPackages = with pkgs; [
wayfireShim
wayfire
];
};
programs = {
dconf.profiles.user.databases = [
{
settings = with lib.gvariant; {
"org/gnome/desktop/interface" = {
clock-format = "24h";
color-scheme = "${catppuccinPalette.preferShade}";
cursor-size = mkInt32 32;
cursor-theme = "catppuccin-${catppuccinPalette.flavor}-${catppuccinPalette.accent}-cursors";
document-font-name = "Work Sans 12";
font-name = "Work Sans 12";
gtk-theme = "catppuccin-${catppuccinPalette.flavor}-${catppuccinPalette.accent}-standard";
gtk-enable-primary-paste = true;
icon-theme = "Papirus${catppuccinPalette.themeShade}";
monospace-font-name = "FiraCode Nerd Font Mono Medium 13";
text-scaling-factor = mkDouble 1.0;
};
"org/gnome/desktop/sound" = {
theme-name = "freedesktop";
};
"org/gtk/gtk4/Settings/FileChooser" = {
clock-format = "24h";
};
"org/gtk/Settings/FileChooser" = {
clock-format = "24h";
};
};
}
];
wayfire = {
enable = true;
};
};
services = {
displayManager = {
sessionPackages = [ wayfireShim ];
};
};
};
}