move home-manager components to their own sections; create new systemd service to sync rclone

This commit is contained in:
2024-12-27 15:35:18 +00:00
parent 5901535d77
commit 2c947ed70c
8 changed files with 273 additions and 214 deletions

View File

@@ -1,9 +1,15 @@
{ inputs, config, pkgs, ... }:
let
vs-extensions = inputs.nix-vscode-extensions.extensions.x86_64-linux.open-vsx;
in
{
imports = [
../../home-manager/terminal.nix
../../home-manager/firefox/firefox.nix
../../home-manager/vscode.nix
];
terminal.nixUpdateLocation = "/home/worble/Projects/nixos#tuxedo";
terminal.flakeUpdateLocation = "/home/worble/Projects/nixos";
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "worble";
@@ -37,7 +43,6 @@ in
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
blesh
nextcloud-client
ubuntu-sans
ubuntu-sans-mono
@@ -52,7 +57,10 @@ in
thunderbird
git-credential-manager
# dotnetCorePackages.sdk_8_0_4xx
dotnetCorePackages.dotnet_9.sdk
(with dotnetCorePackages; combinePackages [
sdk_8_0
sdk_9_0
])
gimp-with-plugins
ffmpeg-full
protonup-qt
@@ -69,6 +77,8 @@ in
jellyfin-media-player
haruna
azuredatastudio
inotify-tools
libnotify
];
fonts.fontconfig = {
@@ -119,45 +129,8 @@ in
programs = {
home-manager.enable = true;
bat = {
enable = true;
};
eza = {
enable = true;
enableBashIntegration = true;
git = true;
extraOptions = [
"--color=auto"
"--icons=always"
"--group-directories-first"
"--header"
];
};
git = {
enable = true;
delta.enable = true;
};
gitui = {
enable = true;
};
firefox = {
enable = true;
languagePacks = [
"en-GB"
];
policies = {
"DisplayMenuBar" = true;
};
profiles.default = import ./firefox-profile.nix // {
id = 0;
name = "default";
isDefault = true;
};
profiles.work = import ./firefox-profile.nix // {
profiles.work = import ../../home-manager/firefox/firefox-profile.nix // {
id = 1;
name = "work";
isDefault = false;
@@ -175,95 +148,6 @@ in
package = pkgs.brave;
};
bash = {
enable = true;
bashrcExtra = ''
source $(blesh-share)/ble.sh
bleopt canvas_winch_action=redraw-prev
'';
};
starship.enable = true;
atuin.enable = true;
zellij = {
enable = true;
enableBashIntegration = true;
settings = {
theme = "dracula";
};
};
helix.enable = true;
alacritty = {
enable = true;
settings = {
font = {
normal = {
family = "SpaceMono Nerd Font";
style = "Regular";
};
size = 14;
};
};
};
direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = false;
extensions = [
vs-extensions.biomejs.biome
vs-extensions.mkhl.direnv
vs-extensions.dracula-theme.theme-dracula
vs-extensions.dbaeumer.vscode-eslint
vs-extensions.eamodio.gitlens
vs-extensions.pkief.material-icon-theme
vs-extensions.jnoortheen.nix-ide
vs-extensions.esbenp.prettier-vscode
vs-extensions.bradlc.vscode-tailwindcss
];
userSettings = {
"workbench.iconTheme" = "material-icon-theme";
"window.titleBarStyle" = "custom";
"workbench.colorTheme" = "Dracula Theme";
"editor.fontFamily" = "'SpaceMono Nerd Font', 'monospace', monospace";
"editor.fontSize" = 16;
"files.autoSave" = "onWindowChange";
"editor.formatOnSave" = true;
"editor.codeActionsOnSave" = {
"source.organizeImports" = "always";
};
"typescript.preferences.preferTypeOnlyAutoImports" = true;
};
};
topgrade = {
enable = true;
settings = {
misc = {
assume_yes = true;
};
linux = {
nix_arguments = "--flake /home/worble/Projects/nixos#tuxedo";
};
pre_commands = {
nix-flake-update = "sudo nix flake update --flake /home/worble/Projects/nixos";
};
};
};
# install the shaders from anime4k directory for this to work
mpv = {
enable = true;
@@ -272,7 +156,7 @@ in
vo = "gpu-next";
gpu-api = "vulkan";
hwdec = "vulkan";
screenshot-directory = "/mnt/HDD1/Pictures/";
screenshot-directory = "~/Pictures/";
screenshot-template = "%F/%F_snapshot_%P";
glsl-shaders = "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl";
};
@@ -287,45 +171,61 @@ in
};
};
# systemd.user = {
# enable = true;
# paths = {
# rclone-media = {
# Unit = {
# Description = "rclone unit path for /mnt/HDD1/Videos/";
# After = [ "network.target" "mnt-HDD1.mount" ];
# };
systemd.user = {
# enable = true;
# paths = {
# rclone-media = {
# Unit = {
# Description = "rclone unit path for /mnt/HDD1/Videos/";
# After = [ "network.target" "mnt-HDD1.mount" ];
# };
# Path = {
# PathChanged = "/mnt/HDD1/Videos/";
# };
# Path = {
# PathChanged = "/mnt/HDD1/Videos/";
# };
# Install = {
# WantedBy = [ "default.target" ];
# };
# };
# };
# services = {
# rclone-media = {
# Unit = {
# Description = "rclone unit service for /mnt/HDD1/Videos/";
# };
# Install = {
# WantedBy = [ "default.target" ];
# };
# };
# };
services = {
rclone-media = {
Unit = {
Description = "rclone-media /mnt/HDD1/Videos/";
After = [ "network.target" "mnt-HDD1.mount" ];
};
# Service = {
# Type = "oneshot";
# ExecStart = "${pkgs.writeShellApplication {
# name = "rclone-media";
# runtimeInputs = [ pkgs.libnotify pkgs.rclone ];
# text = ''
# notify-send -a "rclone-media" "rclone for /mnt/HDD1/Videos/ triggered"
# rclone copy --max-age 24h --no-traverse "/mnt/HDD1/Videos/" media:"media-7gM2gcrxRjXqfj" -P --dry-run
# notify-send -a "rclone-media" "rclone for /mnt/HDD1/Videos/ complete"
# '';
# }}/bin/rclone-media";
# };
# };
# };
# };
Install = {
WantedBy = [ "default.target" ];
};
Service = {
Type = "exec";
ExecStart = "${pkgs.writeShellApplication {
name = "rclone-media";
runtimeInputs = [ pkgs.inotify-tools pkgs.libnotify pkgs.rclone ];
text = ''
inotifywait -mr \
--format '%w%f' \
-e close_write \
/mnt/HDD1/Videos/ |
while read -r file; do
changed_rel=''${file#"/mnt/HDD1/Videos"}
notify-send -a "rclone-media" "rclone for $file triggered"
if rclone copyto "$file" media:"media-7gM2gcrxRjXqfj$changed_rel" ; then
notify-send -a "rclone-media" "rclone for $file complete"
else
notify-send -a "rclone-media" "rclone for $file failed"
fi
done
'';
}}/bin/rclone-media";
};
};
};
};
}