prgrammatically enable sioyek, vesktop, claude, etc.
This commit is contained in:
parent
43f68c58a2
commit
9aac8350a5
8 changed files with 198 additions and 223 deletions
|
|
@ -73,14 +73,3 @@ vim.api.nvim_create_autocmd('WinLeave', {
|
|||
vim.wo.cursorline = false
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('BufEnter', {
|
||||
group = aug,
|
||||
callback = function()
|
||||
local sw = vim.bo.shiftwidth
|
||||
if sw <= 0 then return end
|
||||
vim.opt_local.listchars:append({
|
||||
leadmultispace = '│' .. string.rep(' ', sw - 1),
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -17,3 +17,6 @@ user_pref("font.name.monospace.x-western", "Berkeley Mono");
|
|||
user_pref("font.name.serif.x-math", "STIX Two Math");
|
||||
user_pref("font.name-list.serif.x-math", "STIX Two Math, Latin Modern Math, Times New Roman");
|
||||
user_pref("font.default.x-western", "sans-serif");
|
||||
|
||||
user_pref("browser.tabs.insertAfterCurrent", true);
|
||||
user_pref("browser.tabs.insertRelatedAfterCurrent", true);
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@
|
|||
./modules/git.nix
|
||||
./modules/editor.nix
|
||||
./modules/hyprland.nix
|
||||
./modules/hyprlock.nix
|
||||
./modules/hypridle.nix
|
||||
./modules/hyprpaper.nix
|
||||
./modules/ui.nix
|
||||
./modules/packages.nix
|
||||
];
|
||||
|
|
@ -36,6 +33,10 @@
|
|||
home.sessionPath = [ "${config.home.homeDirectory}/.config/nix/scripts" ];
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
programs.zen.enable = true;
|
||||
programs.sioyek.enable = true;
|
||||
programs.vesktop.enable = true;
|
||||
programs.claude.enable = true;
|
||||
|
||||
systemd.user.services.nix-flake-update = {
|
||||
Unit.Description = "Update nix flake inputs";
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home.packages = [ pkgs.hypridle ];
|
||||
|
||||
xdg.configFile."hypr/hypridle.conf".text = ''
|
||||
general {
|
||||
lock_cmd = wp lock && hyprlock
|
||||
after_sleep_cmd = hyprctl dispatch dpms on
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 300
|
||||
on-timeout = wp lock && hyprlock
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 600
|
||||
on-timeout = hyprctl dispatch dpms off
|
||||
on-resume = hyprctl dispatch dpms on
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 1800
|
||||
on-timeout = systemctl suspend
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
@ -26,8 +26,64 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
home.packages = lib.mkIf isNixOS [ pkgs.xdg-desktop-portal-gtk ];
|
||||
home.packages =
|
||||
lib.optionals isNixOS [
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
pkgs.hyprpaper
|
||||
]
|
||||
++ [
|
||||
pkgs.hyprlock
|
||||
pkgs.hypridle
|
||||
];
|
||||
|
||||
xdg.configFile."hypr/themes/midnight.conf".text = mkHyprTheme config.palettes.midnight;
|
||||
xdg.configFile."hypr/themes/daylight.conf".text = mkHyprTheme config.palettes.daylight;
|
||||
|
||||
xdg.configFile."hypr/hyprpaper.conf".text = ''
|
||||
wallpaper {
|
||||
monitor =
|
||||
path = ${config.home.homeDirectory}/img/screen/wallpaper.jpg
|
||||
}
|
||||
|
||||
splash = false
|
||||
'';
|
||||
|
||||
xdg.configFile."hypr/hyprlock.conf".text = ''
|
||||
general {
|
||||
hide_cursor = true
|
||||
grace = 0
|
||||
}
|
||||
|
||||
background {
|
||||
monitor =
|
||||
path = ${config.home.homeDirectory}/img/screen/lock.jpg
|
||||
}
|
||||
|
||||
animations {
|
||||
enabled = false
|
||||
}
|
||||
'';
|
||||
|
||||
xdg.configFile."hypr/hypridle.conf".text = ''
|
||||
general {
|
||||
lock_cmd = wp lock && hyprlock
|
||||
after_sleep_cmd = hyprctl dispatch dpms on
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 300
|
||||
on-timeout = wp lock && hyprlock
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 600
|
||||
on-timeout = hyprctl dispatch dpms off
|
||||
on-resume = hyprctl dispatch dpms on
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 1800
|
||||
on-timeout = systemctl suspend
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
isNixOS,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home.packages = [ pkgs.hyprlock ];
|
||||
|
||||
xdg.configFile."hypr/hyprlock.conf".text = ''
|
||||
general {
|
||||
hide_cursor = true
|
||||
grace = 0
|
||||
}
|
||||
|
||||
background {
|
||||
monitor =
|
||||
path = ${config.home.homeDirectory}/img/screen/lock.jpg
|
||||
}
|
||||
|
||||
animations {
|
||||
enabled = false
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
isNixOS,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home.packages = lib.mkIf isNixOS [ pkgs.hyprpaper ];
|
||||
|
||||
xdg.configFile."hypr/hyprpaper.conf".text = ''
|
||||
wallpaper {
|
||||
monitor =
|
||||
path = ${config.home.homeDirectory}/img/screen/wallpaper.jpg
|
||||
}
|
||||
|
||||
splash = false
|
||||
'';
|
||||
}
|
||||
|
|
@ -8,11 +8,8 @@
|
|||
}:
|
||||
|
||||
let
|
||||
enableClaude = true;
|
||||
enableZen = true;
|
||||
enableSioyek = true;
|
||||
enableVesktop = true;
|
||||
enableNeovim = config.programs.neovim.enable;
|
||||
cfg = config.programs;
|
||||
repoDir = "${config.home.homeDirectory}/.config/nix";
|
||||
|
||||
sioyek-wrapped = pkgs.symlinkJoin {
|
||||
name = "sioyek";
|
||||
|
|
@ -23,138 +20,144 @@ let
|
|||
--set QT_QPA_PLATFORM xcb
|
||||
'';
|
||||
};
|
||||
|
||||
repoDir = "${config.home.homeDirectory}/.config/nix";
|
||||
in
|
||||
{
|
||||
home.sessionVariables = lib.mkMerge [
|
||||
(lib.mkIf enableZen { BROWSER = "zen"; })
|
||||
(lib.mkIf enableClaude { CLAUDE_CONFIG_DIR = "${config.xdg.configHome}/claude"; })
|
||||
];
|
||||
options.programs = {
|
||||
zen.enable = lib.mkEnableOption "zen browser";
|
||||
sioyek.enable = lib.mkEnableOption "sioyek PDF viewer";
|
||||
vesktop.enable = lib.mkEnableOption "vesktop Discord client";
|
||||
claude.enable = lib.mkEnableOption "claude code";
|
||||
};
|
||||
|
||||
programs.mpv.enable = true;
|
||||
config = {
|
||||
home.sessionVariables = lib.mkMerge [
|
||||
(lib.mkIf cfg.zen.enable { BROWSER = "zen"; })
|
||||
(lib.mkIf cfg.claude.enable { CLAUDE_CONFIG_DIR = "${config.xdg.configHome}/claude"; })
|
||||
];
|
||||
|
||||
home.packages = lib.mkMerge [
|
||||
(with pkgs; [
|
||||
# signal-desktop
|
||||
slack
|
||||
bitwarden-desktop
|
||||
gemini-cli
|
||||
typst
|
||||
])
|
||||
(lib.mkIf enableClaude [ pkgs.claude-code ])
|
||||
(lib.mkIf enableZen [ zen-browser.packages.${hostPlatform}.default ])
|
||||
(lib.mkIf enableSioyek [ sioyek-wrapped ])
|
||||
(lib.mkIf enableVesktop [ pkgs.vesktop ])
|
||||
];
|
||||
programs.mpv.enable = true;
|
||||
|
||||
xdg.configFile."claude/settings.json" = lib.mkIf enableClaude {
|
||||
text = builtins.toJSON {
|
||||
permissions.defaultMode = "acceptEdits";
|
||||
network_access = true;
|
||||
allowed_domains = [
|
||||
"github.com"
|
||||
"raw.githubusercontent.com"
|
||||
"api.github.com"
|
||||
home.packages = lib.mkMerge [
|
||||
(with pkgs; [
|
||||
slack
|
||||
bitwarden-desktop
|
||||
gemini-cli
|
||||
typst
|
||||
])
|
||||
(lib.mkIf cfg.claude.enable [ pkgs.claude-code ])
|
||||
(lib.mkIf cfg.zen.enable [ zen-browser.packages.${hostPlatform}.default ])
|
||||
(lib.mkIf cfg.sioyek.enable [ sioyek-wrapped ])
|
||||
(lib.mkIf cfg.vesktop.enable [ pkgs.vesktop ])
|
||||
];
|
||||
|
||||
xdg.configFile."claude/settings.json" = lib.mkIf cfg.claude.enable {
|
||||
text = builtins.toJSON {
|
||||
permissions.defaultMode = "acceptEdits";
|
||||
network_access = true;
|
||||
allowed_domains = [
|
||||
"github.com"
|
||||
"raw.githubusercontent.com"
|
||||
"api.github.com"
|
||||
];
|
||||
tools.web_fetch = true;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."claude/CLAUDE.md" = lib.mkIf cfg.claude.enable {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/claude/CLAUDE.md";
|
||||
};
|
||||
|
||||
xdg.configFile."claude/rules" = lib.mkIf cfg.claude.enable {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/claude/rules";
|
||||
};
|
||||
|
||||
xdg.configFile."claude/skills" = lib.mkIf cfg.claude.enable {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/claude/skills";
|
||||
};
|
||||
|
||||
xdg.configFile."sioyek/keys_user.config" = lib.mkIf cfg.sioyek.enable {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/sioyek/keys_user.config";
|
||||
};
|
||||
|
||||
xdg.configFile."sioyek/prefs_user.config" = lib.mkIf cfg.sioyek.enable {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/sioyek/prefs_user.config";
|
||||
};
|
||||
|
||||
xdg.configFile."sioyek/themes/midnight.config" = lib.mkIf cfg.sioyek.enable {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/sioyek/themes/midnight.config";
|
||||
};
|
||||
|
||||
xdg.configFile."sioyek/themes/daylight.config" = lib.mkIf cfg.sioyek.enable {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/sioyek/themes/daylight.config";
|
||||
};
|
||||
|
||||
home.activation.linkZenProfile = lib.mkIf cfg.zen.enable (
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
zen_config="$HOME/.zen"
|
||||
repo_zen="${repoDir}/config/zen"
|
||||
|
||||
if [ ! -d "$zen_config" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
profile=""
|
||||
for d in "$zen_config"/*.Default\ Profile; do
|
||||
[ -d "$d" ] && profile="$d" && break
|
||||
done
|
||||
|
||||
if [ -z "$profile" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "$profile/chrome"
|
||||
|
||||
for f in userChrome.css user.js containers.json handlers.json zen-keyboard-shortcuts.json; do
|
||||
src="$repo_zen/$f"
|
||||
if [ "$f" = "userChrome.css" ]; then
|
||||
dest="$profile/chrome/$f"
|
||||
else
|
||||
dest="$profile/$f"
|
||||
fi
|
||||
|
||||
[ -f "$src" ] || continue
|
||||
|
||||
if [ -L "$dest" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -f "$dest" ]; then
|
||||
rm "$dest"
|
||||
fi
|
||||
|
||||
ln -s "$src" "$dest"
|
||||
done
|
||||
''
|
||||
);
|
||||
|
||||
xdg.configFile."electron-flags.conf".text = ''
|
||||
--enable-features=WaylandWindowDecorations
|
||||
--ozone-platform-hint=auto
|
||||
'';
|
||||
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = lib.mkMerge [
|
||||
(lib.mkIf cfg.zen.enable {
|
||||
"x-scheme-handler/http" = "zen.desktop";
|
||||
"x-scheme-handler/https" = "zen.desktop";
|
||||
"text/html" = "zen.desktop";
|
||||
})
|
||||
(lib.mkIf cfg.neovim.enable {
|
||||
"text/plain" = "nvim.desktop";
|
||||
})
|
||||
(lib.mkIf cfg.sioyek.enable {
|
||||
"application/pdf" = "sioyek.desktop";
|
||||
"application/epub+zip" = "sioyek.desktop";
|
||||
})
|
||||
(lib.mkIf cfg.vesktop.enable {
|
||||
"x-scheme-handler/discord" = "vesktop.desktop";
|
||||
})
|
||||
];
|
||||
tools.web_fetch = true;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."claude/CLAUDE.md" = lib.mkIf enableClaude {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/claude/CLAUDE.md";
|
||||
};
|
||||
|
||||
xdg.configFile."claude/rules" = lib.mkIf enableClaude {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/claude/rules";
|
||||
};
|
||||
|
||||
xdg.configFile."claude/skills" = lib.mkIf enableClaude {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/claude/skills";
|
||||
};
|
||||
|
||||
xdg.configFile."sioyek/keys_user.config" = lib.mkIf enableSioyek {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/sioyek/keys_user.config";
|
||||
};
|
||||
|
||||
xdg.configFile."sioyek/prefs_user.config" = lib.mkIf enableSioyek {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/sioyek/prefs_user.config";
|
||||
};
|
||||
|
||||
xdg.configFile."sioyek/themes/midnight.config" = lib.mkIf enableSioyek {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/sioyek/themes/midnight.config";
|
||||
};
|
||||
|
||||
xdg.configFile."sioyek/themes/daylight.config" = lib.mkIf enableSioyek {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${repoDir}/config/sioyek/themes/daylight.config";
|
||||
};
|
||||
|
||||
home.activation.linkZenProfile = lib.mkIf enableZen (
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
zen_config="$HOME/.zen"
|
||||
repo_zen="${repoDir}/config/zen"
|
||||
|
||||
if [ ! -d "$zen_config" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
profile=""
|
||||
for d in "$zen_config"/*.Default\ Profile; do
|
||||
[ -d "$d" ] && profile="$d" && break
|
||||
done
|
||||
|
||||
if [ -z "$profile" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "$profile/chrome"
|
||||
|
||||
for f in userChrome.css user.js containers.json handlers.json zen-keyboard-shortcuts.json; do
|
||||
src="$repo_zen/$f"
|
||||
if [ "$f" = "userChrome.css" ]; then
|
||||
dest="$profile/chrome/$f"
|
||||
else
|
||||
dest="$profile/$f"
|
||||
fi
|
||||
|
||||
[ -f "$src" ] || continue
|
||||
|
||||
if [ -L "$dest" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -f "$dest" ]; then
|
||||
rm "$dest"
|
||||
fi
|
||||
|
||||
ln -s "$src" "$dest"
|
||||
done
|
||||
''
|
||||
);
|
||||
|
||||
xdg.configFile."electron-flags.conf".text = ''
|
||||
--enable-features=WaylandWindowDecorations
|
||||
--ozone-platform-hint=auto
|
||||
'';
|
||||
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = lib.mkMerge [
|
||||
(lib.mkIf enableZen {
|
||||
"x-scheme-handler/http" = "zen.desktop";
|
||||
"x-scheme-handler/https" = "zen.desktop";
|
||||
"text/html" = "zen.desktop";
|
||||
})
|
||||
(lib.mkIf enableNeovim {
|
||||
"text/plain" = "nvim.desktop";
|
||||
})
|
||||
(lib.mkIf enableSioyek {
|
||||
"application/pdf" = "sioyek.desktop";
|
||||
"application/epub+zip" = "sioyek.desktop";
|
||||
})
|
||||
(lib.mkIf enableVesktop {
|
||||
"x-scheme-handler/discord" = "vesktop.desktop";
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue