Add wiki-push and wiki-pull scripts

This commit is contained in:
Oliver Davies 2025-04-03 17:15:53 +01:00
parent f0b37c1813
commit af3c7b2f2b

View file

@ -1,3 +1,10 @@
{
config,
lib,
pkgs,
...
}:
{ {
homeManagerModules = { homeManagerModules = {
direnv.enable = true; direnv.enable = true;
@ -12,7 +19,34 @@
tmux-sessionizer.enable = true; tmux-sessionizer.enable = true;
}; };
home.sessionVariables = { home =
WAYLAND_DISPLAY = ""; let
}; remoteIpAddress = "192.168.1.111";
wikiPath = "${config.xdg.userDirs.documents}/wiki";
in
{
packages = [
(pkgs.writeShellApplication {
name = "wiki-pull";
text = ''
${lib.getExe pkgs.rsync} -avz --update \
${remoteIpAddress}:${wikiPath}/ ${wikiPath} "$@"
'';
})
(pkgs.writeShellApplication {
name = "wiki-push";
text = ''
${lib.getExe pkgs.rsync} -avz --update \
${wikiPath}/ ${remoteIpAddress}:${wikiPath} "$@"
'';
})
];
sessionVariables = {
WAYLAND_DISPLAY = "";
};
};
} }