mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-19 19:34:06 +00:00
nixos/services.amule: remove with lib;
This commit is contained in:
parent
46dc82d477
commit
d63146859b
@ -1,7 +1,4 @@
|
||||
{ config, lib, options, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.amule;
|
||||
opt = options.services.amule;
|
||||
@ -16,18 +13,18 @@ in
|
||||
|
||||
services.amule = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to run the AMule daemon. You need to manually run "amuled --ec-config" to configure the service for the first time.
|
||||
'';
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
type = types.str;
|
||||
dataDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/${user}/";
|
||||
defaultText = literalExpression ''
|
||||
defaultText = lib.literalExpression ''
|
||||
"/home/''${config.${opt.user}}/"
|
||||
'';
|
||||
description = ''
|
||||
@ -35,8 +32,8 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
user = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
The user the AMule daemon should run as.
|
||||
@ -50,16 +47,16 @@ 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 = "amule";
|
||||
description = "AMule daemon";
|
||||
group = "amule";
|
||||
uid = config.ids.uids.amule;
|
||||
} ];
|
||||
|
||||
users.groups = mkIf (cfg.user == null) [
|
||||
users.groups = lib.mkIf (cfg.user == null) [
|
||||
{ name = "amule";
|
||||
gid = config.ids.gids.amule;
|
||||
} ];
|
||||
|
Loading…
Reference in New Issue
Block a user