1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

nixos/yggdrasil: remove with lib;

This commit is contained in:
Daniel Nagy 2024-09-20 17:15:00 +02:00 committed by Emery Hemingway
parent 9dbfe42052
commit cb7635612e

View file

@ -1,6 +1,8 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (lib) mkIf mkOption;
inherit (lib.types) nullOr path bool listOf str;
keysPath = "/var/lib/yggdrasil/keys.json";
cfg = config.services.yggdrasil;
@ -11,14 +13,14 @@ let
in
{
imports = [
(mkRenamedOptionModule
(lib.mkRenamedOptionModule
[ "services" "yggdrasil" "config" ]
[ "services" "yggdrasil" "settings" ])
];
options = with types; {
options = {
services.yggdrasil = {
enable = mkEnableOption "the yggdrasil system service";
enable = lib.mkEnableOption "the yggdrasil system service";
settings = mkOption {
type = format.type;
@ -73,7 +75,7 @@ in
};
group = mkOption {
type = types.nullOr types.str;
type = nullOr str;
default = null;
example = "wheel";
description = "Group to grant access to the Yggdrasil control socket. If `null`, only root can access the socket.";
@ -108,9 +110,9 @@ in
'';
};
package = mkPackageOption pkgs "yggdrasil" { };
package = lib.mkPackageOption pkgs "yggdrasil" { };
persistentKeys = mkEnableOption ''
persistentKeys = lib.mkEnableOption ''
persistent keys. If enabled then keys will be generated once and Yggdrasil
will retain the same IPv6 address when the service is
restarted. Keys are stored at ${keysPath}