mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixos/services.lxd-image-server: remove with lib;
This commit is contained in:
parent
2e30f07cc0
commit
252e9bb1e7
1 changed files with 11 additions and 14 deletions
|
@ -1,7 +1,4 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.lxd-image-server;
|
cfg = config.services.lxd-image-server;
|
||||||
format = pkgs.formats.toml {};
|
format = pkgs.formats.toml {};
|
||||||
|
@ -11,16 +8,16 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
services.lxd-image-server = {
|
services.lxd-image-server = {
|
||||||
enable = mkEnableOption "lxd-image-server";
|
enable = lib.mkEnableOption "lxd-image-server";
|
||||||
|
|
||||||
group = mkOption {
|
group = lib.mkOption {
|
||||||
type = types.str;
|
type = lib.types.str;
|
||||||
description = "Group assigned to the user and the webroot directory.";
|
description = "Group assigned to the user and the webroot directory.";
|
||||||
default = "nginx";
|
default = "nginx";
|
||||||
example = "www-data";
|
example = "www-data";
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = lib.mkOption {
|
||||||
type = format.type;
|
type = format.type;
|
||||||
description = ''
|
description = ''
|
||||||
Configuration for lxd-image-server.
|
Configuration for lxd-image-server.
|
||||||
|
@ -31,9 +28,9 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
nginx = {
|
nginx = {
|
||||||
enable = mkEnableOption "nginx";
|
enable = lib.mkEnableOption "nginx";
|
||||||
domain = mkOption {
|
domain = lib.mkOption {
|
||||||
type = types.str;
|
type = lib.types.str;
|
||||||
description = "Domain to use for nginx virtual host.";
|
description = "Domain to use for nginx virtual host.";
|
||||||
example = "images.example.org";
|
example = "images.example.org";
|
||||||
};
|
};
|
||||||
|
@ -41,8 +38,8 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkMerge [
|
config = lib.mkMerge [
|
||||||
(mkIf (cfg.enable) {
|
(lib.mkIf (cfg.enable) {
|
||||||
users.users.lxd-image-server = {
|
users.users.lxd-image-server = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = cfg.group;
|
group = cfg.group;
|
||||||
|
@ -88,12 +85,12 @@ in
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
# this is separate so it can be enabled on mirrored hosts
|
# this is separate so it can be enabled on mirrored hosts
|
||||||
(mkIf (cfg.nginx.enable) {
|
(lib.mkIf (cfg.nginx.enable) {
|
||||||
# https://github.com/Avature/lxd-image-server/blob/master/resources/nginx/includes/lxd-image-server.pkg.conf
|
# https://github.com/Avature/lxd-image-server/blob/master/resources/nginx/includes/lxd-image-server.pkg.conf
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
"${cfg.nginx.domain}" = {
|
"${cfg.nginx.domain}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = mkDefault true;
|
enableACME = lib.mkDefault true;
|
||||||
|
|
||||||
root = location;
|
root = location;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue