add hostname to ft config
This commit is contained in:
@ -13,6 +13,9 @@
|
||||
programs.firefox.enable = false;
|
||||
|
||||
mods.sync.homeFolder = "/sgoinfre/goinfre/Perso/tomoron";
|
||||
mods.sync.defaultSynced = false;
|
||||
mods.sync.syncedAdditions = [ "42_desktop" "downloads" ];
|
||||
mods.sync.customHostName = "pc42";
|
||||
|
||||
programs.bash.profileExtra =
|
||||
''
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
defPathLst = ["Desktop" "Downloads"];
|
||||
defPathLst = ["desktop" "42_desktop" "downloads"];
|
||||
in
|
||||
{
|
||||
options.mods.sync = {
|
||||
@ -34,6 +34,12 @@ in
|
||||
default = [];
|
||||
description = "list of path that will be synced";
|
||||
};
|
||||
|
||||
customHostName = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "hostname used by unison";
|
||||
};
|
||||
};
|
||||
|
||||
config.home.file.".unison/default.prf" = lib.mkIf config.mods.sync.enable {
|
||||
@ -43,7 +49,7 @@ in
|
||||
root=ssh://tom@tmoron.fr:1880/${config.mods.sync.destFolder}
|
||||
''
|
||||
(lib.strings.concatMapStrings (x: "\npath=" + x) (( if config.mods.sync.defaultSynced then defPathLst else [] ) ++ config.mods.sync.syncedAdditions ))
|
||||
]);
|
||||
executable = true;
|
||||
(if !(isNull config.mods.sync.customHostName) then "\nclientHostName=${config.mods.sync.customHostName}" else "")
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user