nixos/services.yandex-disk: remove with lib;
This commit is contained in:
parent
bc58f67812
commit
76831f7a1b
@ -1,7 +1,4 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.services.yandex-disk;
|
cfg = config.services.yandex-disk;
|
||||||
@ -20,47 +17,47 @@ in
|
|||||||
|
|
||||||
services.yandex-disk = {
|
services.yandex-disk = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = lib.mkOption {
|
||||||
type = types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable Yandex-disk client. See https://disk.yandex.ru/
|
Whether to enable Yandex-disk client. See https://disk.yandex.ru/
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
username = mkOption {
|
username = lib.mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.str;
|
type = lib.types.str;
|
||||||
description = ''
|
description = ''
|
||||||
Your yandex.com login name.
|
Your yandex.com login name.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
password = mkOption {
|
password = lib.mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.str;
|
type = lib.types.str;
|
||||||
description = ''
|
description = ''
|
||||||
Your yandex.com password. Warning: it will be world-readable in /nix/store.
|
Your yandex.com password. Warning: it will be world-readable in /nix/store.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
user = mkOption {
|
user = lib.mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = types.nullOr types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
description = ''
|
description = ''
|
||||||
The user the yandex-disk daemon should run as.
|
The user the yandex-disk daemon should run as.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
directory = mkOption {
|
directory = lib.mkOption {
|
||||||
type = types.path;
|
type = lib.types.path;
|
||||||
default = "/home/Yandex.Disk";
|
default = "/home/Yandex.Disk";
|
||||||
description = "The directory to use for Yandex.Disk storage";
|
description = "The directory to use for Yandex.Disk storage";
|
||||||
};
|
};
|
||||||
|
|
||||||
excludes = mkOption {
|
excludes = lib.mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.commas;
|
type = lib.types.commas;
|
||||||
example = "data,backup";
|
example = "data,backup";
|
||||||
description = ''
|
description = ''
|
||||||
Comma-separated list of directories which are excluded from synchronization.
|
Comma-separated list of directories which are excluded from synchronization.
|
||||||
@ -74,9 +71,9 @@ in
|
|||||||
|
|
||||||
###### implementation
|
###### 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;
|
name = u;
|
||||||
uid = config.ids.uids.yandexdisk;
|
uid = config.ids.uids.yandexdisk;
|
||||||
group = "nogroup";
|
group = "nogroup";
|
||||||
|
Loading…
Reference in New Issue
Block a user