nixos/services.yandex-disk: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-28 21:19:00 +02:00 committed by Jörg Thalheim
parent bc58f67812
commit 76831f7a1b

View File

@ -1,7 +1,4 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.services.yandex-disk;
@ -20,47 +17,47 @@ in
services.yandex-disk = {
enable = mkOption {
type = types.bool;
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable Yandex-disk client. See https://disk.yandex.ru/
'';
};
username = mkOption {
username = lib.mkOption {
default = "";
type = types.str;
type = lib.types.str;
description = ''
Your yandex.com login name.
'';
};
password = mkOption {
password = lib.mkOption {
default = "";
type = types.str;
type = lib.types.str;
description = ''
Your yandex.com password. Warning: it will be world-readable in /nix/store.
'';
};
user = mkOption {
user = lib.mkOption {
default = null;
type = types.nullOr types.str;
type = lib.types.nullOr lib.types.str;
description = ''
The user the yandex-disk daemon should run as.
'';
};
directory = mkOption {
type = types.path;
directory = lib.mkOption {
type = lib.types.path;
default = "/home/Yandex.Disk";
description = "The directory to use for Yandex.Disk storage";
};
excludes = mkOption {
excludes = lib.mkOption {
default = "";
type = types.commas;
type = lib.types.commas;
example = "data,backup";
description = ''
Comma-separated list of directories which are excluded from synchronization.
@ -74,9 +71,9 @@ in
###### implementation
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
users.users = mkIf (cfg.user == null) [ {
users.users = lib.mkIf (cfg.user == null) [ {
name = u;
uid = config.ids.uids.yandexdisk;
group = "nogroup";