From 91d9643bd54f77f14b096246c390ef3b2f40bc27 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 5 Apr 2025 23:02:01 +0100 Subject: [PATCH] Move wiki configuration --- home/opdavies/hosts/PW05CH3L.nix | 36 +------------------------------- hosts/PW05CH3L/configuration.nix | 3 +++ hosts/PW05CH3L/modules/wiki.nix | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 hosts/PW05CH3L/modules/wiki.nix diff --git a/home/opdavies/hosts/PW05CH3L.nix b/home/opdavies/hosts/PW05CH3L.nix index 206967e1..ffcd4415 100644 --- a/home/opdavies/hosts/PW05CH3L.nix +++ b/home/opdavies/hosts/PW05CH3L.nix @@ -1,35 +1 @@ -{ - config, - lib, - pkgs, - ... -}: - -{ - home = - 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} "$@" - ''; - }) - ]; - }; -} +{ } diff --git a/hosts/PW05CH3L/configuration.nix b/hosts/PW05CH3L/configuration.nix index de1975b7..b3de6491 100644 --- a/hosts/PW05CH3L/configuration.nix +++ b/hosts/PW05CH3L/configuration.nix @@ -12,6 +12,9 @@ ../../modules/mixins/tmux.nix ../../modules/mixins/zsh + ./modules/notes.nix + ./modules/wiki.nix + ../common ../../users/opdavies ]; diff --git a/hosts/PW05CH3L/modules/wiki.nix b/hosts/PW05CH3L/modules/wiki.nix new file mode 100644 index 00000000..2e54e104 --- /dev/null +++ b/hosts/PW05CH3L/modules/wiki.nix @@ -0,0 +1,36 @@ +{ lib, ... }: + +with lib; + +{ + home-manager.users.opdavies = + { config, pkgs, ... }: + { + home = + let + remoteIpAddress = "192.168.1.111"; + wikiPath = "${config.xdg.userDirs.documents}/wiki"; + in + { + packages = [ + (pkgs.writeShellApplication { + name = "wiki-pull"; + + text = '' + ${getExe pkgs.rsync} -avz --update \ + ${remoteIpAddress}:${wikiPath}/ ${wikiPath} "$@" + ''; + }) + + (pkgs.writeShellApplication { + name = "wiki-push"; + + text = '' + ${getExe pkgs.rsync} -avz --update \ + ${wikiPath}/ ${remoteIpAddress}:${wikiPath} "$@" + ''; + }) + ]; + }; + }; +}