mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-06 00:51:04 +01:00
parent
6695b1d477
commit
82ee14ff60
124 changed files with 1848 additions and 1891 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue