1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-06 00:51:04 +01:00

treewide: remove with lib (#6871)

Remove from services.
This commit is contained in:
Austin Horstman 2025-04-21 09:00:59 -07:00 committed by GitHub
parent 6695b1d477
commit 82ee14ff60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
124 changed files with 1848 additions and 1891 deletions

View file

@ -4,9 +4,6 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.dropbox;
@ -16,23 +13,23 @@ let
in
{
meta.maintainers = [ maintainers.eyjhb ];
meta.maintainers = [ lib.maintainers.eyjhb ];
options = {
services.dropbox = {
enable = mkEnableOption "Dropbox daemon";
enable = lib.mkEnableOption "Dropbox daemon";
path = mkOption {
type = types.path;
path = lib.mkOption {
type = lib.types.path;
default = "${config.home.homeDirectory}/Dropbox";
defaultText = literalExpression ''"''${config.home.homeDirectory}/Dropbox"'';
defaultText = lib.literalExpression ''"''${config.home.homeDirectory}/Dropbox"'';
apply = toString; # Prevent copies to Nix store.
description = "Where to put the Dropbox directory.";
};
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.dropbox" pkgs lib.platforms.linux)
];
@ -76,9 +73,9 @@ in
${homeBaseDir}/.dropbox ${config.home.homeDirectory}/.dropbox
fi
if [[ ! -d ${escapeShellArg cfg.path} ]]; then
if [[ ! -d ${lib.escapeShellArg cfg.path} ]]; then
run ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
${homeBaseDir}/Dropbox ${escapeShellArg cfg.path}
${homeBaseDir}/Dropbox ${lib.escapeShellArg cfg.path}
fi
# get the dropbox bins if needed