[durutti] expose nixosModule for configuring host of durruti
This commit is contained in:
42
machines/durruti/host_config.nix
Normal file
42
machines/durruti/host_config.nix
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{ config, lib, options, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.malobeo;
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
services.malobeo = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
description = lib.mdDoc "Enable malobeo infrastructure.";
|
||||||
|
};
|
||||||
|
|
||||||
|
host_ip = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = lib.mdDoc "ip of nix container provided for malo";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable
|
||||||
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = cfg.host_ip == "";
|
||||||
|
message = ''
|
||||||
|
You need to specify host_ip of the nix container
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."tasklist.malobeo.org" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME= true;
|
||||||
|
locations."/".proxyPass = "http://10.233.1.2:8080"
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -23,6 +23,8 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
inherit inputs;
|
inherit inputs;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
nixosModules.malobeo = import ./machines/durruti/host_config.nix;
|
||||||
|
|
||||||
images.rpi1_base_image = nixosConfigurations.rpi1_base_image.config.system.build.sdImage;
|
images.rpi1_base_image = nixosConfigurations.rpi1_base_image.config.system.build.sdImage;
|
||||||
packages.x86_64-linux = {
|
packages.x86_64-linux = {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user