Skip to content

Commit 78454ad

Browse files
committed
guard linux-specific home modules and register stylix on mac
1 parent d7b1540 commit 78454ad

3 files changed

Lines changed: 64 additions & 58 deletions

File tree

home/rclone-gdrive.nix

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
11
{
22
pkgs,
33
config,
4+
lib,
45
...
56
}: let
67
mountPoint = "${config.home.homeDirectory}/PrivateGDrive";
78
in {
8-
systemd.user.services.rclone-gdrive = {
9-
Unit = {
10-
Description = "RClone Mount for Encrypted Google Drive (Zero-Knowledge)";
11-
After = ["network-online.target" "graphical-session.target"];
12-
Wants = ["network-online.target"];
13-
};
9+
config = lib.mkIf pkgs.stdenv.isLinux {
10+
systemd.user.services.rclone-gdrive = {
11+
Unit = {
12+
Description = "RClone Mount for Encrypted Google Drive (Zero-Knowledge)";
13+
After = ["network-online.target" "graphical-session.target"];
14+
Wants = ["network-online.target"];
15+
};
1416

15-
Service = {
16-
Type = "exec";
17-
# Create the directory right before mounting
18-
ExecStartPre = "/run/current-system/sw/bin/mkdir -p ${mountPoint}";
19-
# Optimized for desktop usage:
20-
# - vfs-cache-mode full: Essential for opening files (Office, PDF, etc) directly from the mount
21-
# - vfs-cache-max-size: Limits local SSD usage to 10GB
22-
ExecStart = ''
23-
${pkgs.rclone}/bin/rclone mount gd-crypt: ${mountPoint} \
24-
--vfs-cache-mode full \
25-
--vfs-cache-max-size 10G \
26-
--vfs-cache-max-age 24h \
27-
--dir-cache-time 72h \
28-
--vfs-read-chunk-size 32M \
29-
--vfs-read-chunk-size-limit 1G \
30-
--buffer-size 32M \
31-
--no-modtime
32-
'';
33-
ExecStop = "${pkgs.fuse}/bin/fusermount -uz ${mountPoint}";
34-
Restart = "on-failure";
35-
RestartSec = "10";
36-
};
17+
Service = {
18+
Type = "exec";
19+
# Create the directory right before mounting
20+
ExecStartPre = "/run/current-system/sw/bin/mkdir -p ${mountPoint}";
21+
# Optimized for desktop usage:
22+
# - vfs-cache-mode full: Essential for opening files (Office, PDF, etc) directly from the mount
23+
# - vfs-cache-max-size: Limits local SSD usage to 10GB
24+
ExecStart = ''
25+
${pkgs.rclone}/bin/rclone mount gd-crypt: ${mountPoint} \
26+
--vfs-cache-mode full \
27+
--vfs-cache-max-size 10G \
28+
--vfs-cache-max-age 24h \
29+
--dir-cache-time 72h \
30+
--vfs-read-chunk-size 32M \
31+
--vfs-read-chunk-size-limit 1G \
32+
--buffer-size 32M \
33+
--no-modtime
34+
'';
35+
ExecStop = "${pkgs.fuse}/bin/fusermount -uz ${mountPoint}";
36+
Restart = "on-failure";
37+
RestartSec = "10";
38+
};
3739

38-
Install = {
39-
WantedBy = ["default.target"];
40+
Install = {
41+
WantedBy = ["default.target"];
42+
};
4043
};
4144
};
4245
}

home/theme.nix

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,40 @@
77
# Stylix handles standard theming now.
88
# Manual overrides go here.
99

10-
home = {
11-
# Set custom icon for Games folder
12-
activation.setGamesIcon = lib.hm.dag.entryAfter ["writeBoundary"] ''
13-
$DRY_RUN_CMD ${pkgs.glib}/bin/gio set -t string /home/${userConfig.username}/Games metadata::gvfs.extra-icon folder-cat-mocha-blue-games || true
14-
'';
10+
config = lib.mkIf pkgs.stdenv.isLinux {
11+
home = {
12+
# Set custom icon for Games folder
13+
activation.setGamesIcon = lib.hm.dag.entryAfter ["writeBoundary"] ''
14+
$DRY_RUN_CMD ${pkgs.glib}/bin/gio set -t string /home/${userConfig.username}/Games metadata::gvfs.extra-icon folder-cat-mocha-blue-games || true
15+
'';
1516

16-
sessionVariables.GTK_THEME = "catppuccin-mocha-blue-standard";
17-
};
17+
sessionVariables.GTK_THEME = "catppuccin-mocha-blue-standard";
18+
};
1819

19-
gtk = {
20-
enable = true;
21-
gtk4.theme = null; # Stylix handles GTK4 theming
22-
gtk3.bookmarks = [
23-
"file:///home/${userConfig.username}/Documents Documents"
24-
"file:///home/${userConfig.username}/Downloads Downloads"
25-
"file:///home/${userConfig.username}/Music Music"
26-
"file:///home/${userConfig.username}/Pictures Pictures"
27-
"file:///home/${userConfig.username}/Videos Videos"
28-
"file:///home/${userConfig.username}/repos repos"
29-
"file:///home/${userConfig.username}/Games Games"
30-
"file:///mnt/storage storage"
31-
"file:///mnt/data data"
32-
];
33-
};
20+
gtk = {
21+
enable = true;
22+
gtk4.theme = null; # Stylix handles GTK4 theming
23+
gtk3.bookmarks = [
24+
"file:///home/${userConfig.username}/Documents Documents"
25+
"file:///home/${userConfig.username}/Downloads Downloads"
26+
"file:///home/${userConfig.username}/Music Music"
27+
"file:///home/${userConfig.username}/Pictures Pictures"
28+
"file:///home/${userConfig.username}/Videos Videos"
29+
"file:///home/${userConfig.username}/repos repos"
30+
"file:///home/${userConfig.username}/Games Games"
31+
"file:///mnt/storage storage"
32+
"file:///mnt/data data"
33+
];
34+
};
3435

35-
dconf.settings = {
36-
"org/gnome/desktop/interface" = {
37-
color-scheme = "prefer-dark";
36+
dconf.settings = {
37+
"org/gnome/desktop/interface" = {
38+
color-scheme = "prefer-dark";
39+
};
3840
};
39-
};
4041

41-
stylix.targets = {
42-
qt.enable = false; # Handled by kvantum manually
42+
stylix.targets = {
43+
qt.enable = false; # Handled by kvantum manually
44+
};
4345
};
4446
}

hosts/Mac/configuration.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
users.${userConfig.username} = {
9292
imports = [
9393
../../home/core.nix
94+
inputs.stylix.homeModules.stylix
9495
];
9596
home = {
9697
homeDirectory = pkgs.lib.mkForce "/Users/${userConfig.username}";

0 commit comments

Comments
 (0)