Revert "WIP: Split Syncthing out into separate module"
This reverts commit 52be766f61
.
This commit is contained in:
parent
52be766f61
commit
770b5c0850
|
@ -139,16 +139,30 @@ with lib;
|
|||
|
||||
# Enable Syncthing
|
||||
(mkIf cfg.services.syncthing.enable {
|
||||
imports = [
|
||||
(import ../common/home-manager/syncthing.nix {
|
||||
username = users.users.aires.name;
|
||||
configDir = "${config.users.users.aires.home}/.config/syncthing";
|
||||
port = 8080;
|
||||
autostart = cfg.services.syncthing.autostart;
|
||||
enableTray = cfg.services.syncthing.autostart;
|
||||
inherit lib pkgs;
|
||||
})
|
||||
users.users.aires.packages = [
|
||||
pkgs.syncthing
|
||||
(mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray)
|
||||
];
|
||||
|
||||
# Open port 8080
|
||||
networking.firewall.allowedTCPPorts = [ 8080 ];
|
||||
|
||||
home-manager.users.aires = {
|
||||
# Syncthing options
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
extraOptions = [
|
||||
"--gui-address=0.0.0.0:8080"
|
||||
"--home=${config.users.users.aires.home}/.config/syncthing"
|
||||
"--no-default-folder"
|
||||
];
|
||||
};
|
||||
|
||||
# Override the default Syncthing settings so it doesn't start on boot
|
||||
systemd.user.services."syncthing" = mkIf (!cfg.services.syncthing.autostart) {
|
||||
Install = lib.mkForce { };
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
{
|
||||
username,
|
||||
configDir,
|
||||
port ? 8080,
|
||||
autostart ? false,
|
||||
enableTray ? false,
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = {
|
||||
users.users.${username}.packages = [
|
||||
pkgs.syncthing
|
||||
(lib.mkIf enableTray pkgs.syncthingtray)
|
||||
];
|
||||
|
||||
# Open port 8080
|
||||
networking.firewall.allowedTCPPorts = [ port ];
|
||||
|
||||
home-manager.users.${username} = {
|
||||
# Syncthing options
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
extraOptions = [
|
||||
"--gui-address=0.0.0.0:${port}"
|
||||
"--home=${configDir}/.config/syncthing"
|
||||
"--no-default-folder"
|
||||
];
|
||||
};
|
||||
|
||||
# Override the default Syncthing settings so it doesn't start on boot
|
||||
systemd.user.services."syncthing" = lib.mkIf (!autostart) { Install = lib.mkForce { }; };
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue