0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03: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, ... }: { config, lib, pkgs, ... }:
with lib;
let let
inherit (lib) mkIf mkOption;
inherit (lib.types) nullOr path bool listOf str;
keysPath = "/var/lib/yggdrasil/keys.json"; keysPath = "/var/lib/yggdrasil/keys.json";
cfg = config.services.yggdrasil; cfg = config.services.yggdrasil;
@ -11,14 +13,14 @@ let
in in
{ {
imports = [ imports = [
(mkRenamedOptionModule (lib.mkRenamedOptionModule
[ "services" "yggdrasil" "config" ] [ "services" "yggdrasil" "config" ]
[ "services" "yggdrasil" "settings" ]) [ "services" "yggdrasil" "settings" ])
]; ];
options = with types; { options = {
services.yggdrasil = { services.yggdrasil = {
enable = mkEnableOption "the yggdrasil system service"; enable = lib.mkEnableOption "the yggdrasil system service";
settings = mkOption { settings = mkOption {
type = format.type; type = format.type;
@ -73,7 +75,7 @@ in
}; };
group = mkOption { group = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = null; default = null;
example = "wheel"; example = "wheel";
description = "Group to grant access to the Yggdrasil control socket. If `null`, only root can access the socket."; 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 persistent keys. If enabled then keys will be generated once and Yggdrasil
will retain the same IPv6 address when the service is will retain the same IPv6 address when the service is
restarted. Keys are stored at ${keysPath} restarted. Keys are stored at ${keysPath}