mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-16 05:51:08 +01:00
syncthing: remove deprecated code
Specifically, in 2021 the use of `services.syncthing.tray` as a Boolean was deprecated. This removes the associated code.
This commit is contained in:
parent
74a78aacb7
commit
ade850153b
3 changed files with 22 additions and 76 deletions
|
|
@ -738,38 +738,28 @@ in
|
||||||
|
|
||||||
package = lib.mkPackageOption pkgs "syncthing" { };
|
package = lib.mkPackageOption pkgs "syncthing" { };
|
||||||
|
|
||||||
tray = mkOption {
|
tray = {
|
||||||
type =
|
enable = mkOption {
|
||||||
with types;
|
type = types.bool;
|
||||||
either bool (submodule {
|
default = false;
|
||||||
options = {
|
description = "Whether to enable a syncthing tray service.";
|
||||||
enable = mkOption {
|
};
|
||||||
type = bool;
|
|
||||||
default = false;
|
command = mkOption {
|
||||||
description = "Whether to enable a syncthing tray service.";
|
type = types.str;
|
||||||
};
|
default = "syncthingtray --wait";
|
||||||
|
defaultText = literalExpression "syncthingtray --wait";
|
||||||
command = mkOption {
|
example = literalExpression "qsyncthingtray";
|
||||||
type = str;
|
description = "Syncthing tray command to use.";
|
||||||
default = "syncthingtray --wait";
|
};
|
||||||
defaultText = literalExpression "syncthingtray --wait";
|
|
||||||
example = literalExpression "qsyncthingtray";
|
package = mkOption {
|
||||||
description = "Syncthing tray command to use.";
|
type = types.package;
|
||||||
};
|
default = pkgs.syncthingtray-minimal;
|
||||||
|
defaultText = literalExpression "pkgs.syncthingtray-minimal";
|
||||||
package = mkOption {
|
example = literalExpression "pkgs.qsyncthingtray";
|
||||||
type = package;
|
description = "Syncthing tray package to use.";
|
||||||
default = pkgs.syncthingtray-minimal;
|
|
||||||
defaultText = literalExpression "pkgs.syncthingtray-minimal";
|
|
||||||
example = literalExpression "pkgs.qsyncthingtray";
|
|
||||||
description = "Syncthing tray package to use.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
});
|
|
||||||
default = {
|
|
||||||
enable = false;
|
|
||||||
};
|
};
|
||||||
description = "Syncthing tray service configuration.";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -871,7 +861,7 @@ in
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(lib.mkIf (lib.isAttrs cfg.tray && cfg.tray.enable) {
|
(lib.mkIf cfg.tray.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
(lib.hm.assertions.assertPlatform "services.syncthing.tray" pkgs lib.platforms.linux)
|
(lib.hm.assertions.assertPlatform "services.syncthing.tray" pkgs lib.platforms.linux)
|
||||||
];
|
];
|
||||||
|
|
@ -898,37 +888,5 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
# deprecated
|
|
||||||
(lib.mkIf (lib.isBool cfg.tray && cfg.tray) {
|
|
||||||
assertions = [
|
|
||||||
(lib.hm.assertions.assertPlatform "services.syncthing.tray" pkgs lib.platforms.linux)
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.user.services = {
|
|
||||||
"syncthingtray" = {
|
|
||||||
Unit = {
|
|
||||||
Description = "syncthingtray";
|
|
||||||
Requires = [ "tray.target" ];
|
|
||||||
After = [
|
|
||||||
"graphical-session.target"
|
|
||||||
"tray.target"
|
|
||||||
];
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
Service = {
|
|
||||||
ExecStart = "${pkgs.syncthingtray-minimal}/bin/syncthingtray --wait";
|
|
||||||
};
|
|
||||||
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
warnings = [
|
|
||||||
"Specifying 'services.syncthing.tray' as a boolean is deprecated, set 'services.syncthing.tray.enable' instead. See https://github.com/nix-community/home-manager/pull/1257."
|
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
{
|
{
|
||||||
syncthing-tray = ./tray.nix;
|
syncthing-tray = ./tray.nix;
|
||||||
syncthing-tray-as-bool-triggers-warning = ./tray-as-bool-triggers-warning.nix;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
services.syncthing.tray = true;
|
|
||||||
|
|
||||||
test.asserts.warnings.expected = [
|
|
||||||
"Specifying 'services.syncthing.tray' as a boolean is deprecated, set 'services.syncthing.tray.enable' instead. See https://github.com/nix-community/home-manager/pull/1257."
|
|
||||||
];
|
|
||||||
|
|
||||||
nmt.script = ''
|
|
||||||
assertFileExists home-files/.config/systemd/user/syncthingtray.service
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue