From a6cd1d46590f3d1effa0a4c13288581a5f0651a8 Mon Sep 17 00:00:00 2001 From: tomoron Date: Wed, 5 Mar 2025 20:53:15 +0100 Subject: [PATCH] repair sync command module --- homeConfigs/modules/sync.nix | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/homeConfigs/modules/sync.nix b/homeConfigs/modules/sync.nix index c3e57a0..1e7fbf6 100644 --- a/homeConfigs/modules/sync.nix +++ b/homeConfigs/modules/sync.nix @@ -1,17 +1,31 @@ -{ lib, config, pkgs, ... }: +{ lib, config, ... }: { -/* - options.mods.sync.enable = lib.mkOption { - type = lib.types.bool; - default = true; - description = "enable desk_sync command"; + options.mods.sync = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "enable usr_sync command"; + }; + + homeFolder = lib.mkOption { + type = lib.types.str; + default = "/home/tom/"; + description = "folder that will be synced with the server"; + }; + + destFolder = lib.mkOption { + type = lib.types.str; + default = "/raid/pc_sync"; + description = "where on the server"; + }; }; - home.file.".local/bin/desk_sync" = pkgs.writeShellScriptBin "desk_sync" '' - ${pkgs.unison}/ - config = lib.mkIf config.mods.sync.enable { - ''; + config.home.file.".local/bin/usr_sync" = lib.mkIf config.mods.sync.enable { + text = '' + #!/bin/env + unison "${config.mods.sync.homeFolder}" "ssh://tom@tmoron.fr:1880/${config.mods.sync.destFolder}" $@ + ''; + executable = true; }; - */ }