nixos/fluidd: init fluidd service at 1.16.2
This commit is contained in:
parent
77506e4f25
commit
c8e3441961
@ -182,6 +182,16 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://docs.fluidd.xyz/">fluidd</link>, a
|
||||
Klipper web interface for managing 3d printers using
|
||||
moonraker. Available as
|
||||
<link linkend="opt-services.fluidd.enable">fluidd</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="sec-release-21.11-incompatibilities">
|
||||
<title>Backward Incompatibilities</title>
|
||||
|
@ -56,6 +56,8 @@ pt-services.clipcat.enable).
|
||||
* [navidrome](https://www.navidrome.org/), a personal music streaming server with
|
||||
subsonic-compatible api. Available as [navidrome](#opt-services.navidrome.enable).
|
||||
|
||||
- [fluidd](https://docs.fluidd.xyz/), a Klipper web interface for managing 3d printers using moonraker. Available as [fluidd](#opt-services.fluidd.enable).
|
||||
|
||||
## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
|
||||
|
||||
- The `paperless` module and package have been removed. All users should migrate to the
|
||||
|
@ -953,6 +953,7 @@
|
||||
./services/web-apps/documize.nix
|
||||
./services/web-apps/dokuwiki.nix
|
||||
./services/web-apps/engelsystem.nix
|
||||
./services/web-apps/fluidd.nix
|
||||
./services/web-apps/galene.nix
|
||||
./services/web-apps/gerrit.nix
|
||||
./services/web-apps/gotify-server.nix
|
||||
|
64
nixos/modules/services/web-apps/fluidd.nix
Normal file
64
nixos/modules/services/web-apps/fluidd.nix
Normal file
@ -0,0 +1,64 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.fluidd;
|
||||
moonraker = config.services.moonraker;
|
||||
in
|
||||
{
|
||||
options.services.fluidd = {
|
||||
enable = mkEnableOption "Fluidd, a Klipper web interface for managing your 3d printer";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = "Fluidd package to be used in the module";
|
||||
default = pkgs.fluidd;
|
||||
defaultText = "pkgs.fluidd";
|
||||
};
|
||||
|
||||
hostName = mkOption {
|
||||
type = types.str;
|
||||
default = "localhost";
|
||||
description = "Hostname to serve fluidd on";
|
||||
};
|
||||
|
||||
nginx = mkOption {
|
||||
type = types.submodule
|
||||
(import ../web-servers/nginx/vhost-options.nix { inherit config lib; });
|
||||
default = { };
|
||||
example = {
|
||||
serverAliases = [ "fluidd.\${config.networking.domain}" ];
|
||||
};
|
||||
description = "Extra configuration for the nginx virtual host of fluidd.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
upstreams.fluidd-apiserver.servers."${moonraker.address}:${toString moonraker.port}" = { };
|
||||
virtualHosts."${cfg.hostName}" = mkMerge [
|
||||
cfg.nginx
|
||||
{
|
||||
root = mkForce "${cfg.package}/share/fluidd/htdocs";
|
||||
locations = {
|
||||
"/" = {
|
||||
index = "index.html";
|
||||
tryFiles = "$uri $uri/ /index.html";
|
||||
};
|
||||
"/index.html".extraConfig = ''
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||
'';
|
||||
"/websocket" = {
|
||||
proxyWebsockets = true;
|
||||
proxyPass = "http://fluidd-apiserver/websocket";
|
||||
};
|
||||
"~ ^/(printer|api|access|machine|server)/" = {
|
||||
proxyWebsockets = true;
|
||||
proxyPass = "http://fluidd-apiserver$request_uri";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -136,6 +136,7 @@ in
|
||||
fish = handleTest ./fish.nix {};
|
||||
flannel = handleTestOn ["x86_64-linux"] ./flannel.nix {};
|
||||
fluentd = handleTest ./fluentd.nix {};
|
||||
fluidd = handleTest ./fluidd.nix {};
|
||||
fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
|
||||
freeswitch = handleTest ./freeswitch.nix {};
|
||||
fsck = handleTest ./fsck.nix {};
|
||||
|
21
nixos/tests/fluidd.nix
Normal file
21
nixos/tests/fluidd.nix
Normal file
@ -0,0 +1,21 @@
|
||||
import ./make-test-python.nix ({ lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
name = "fluidd";
|
||||
meta.maintainers = with maintainers; [ vtuan10 ];
|
||||
|
||||
nodes.machine = { pkgs, ... }: {
|
||||
services.fluidd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.start()
|
||||
machine.wait_for_unit("nginx.service")
|
||||
machine.wait_for_open_port(80)
|
||||
machine.succeed("curl -sSfL http://localhost/ | grep 'fluidd'")
|
||||
'';
|
||||
})
|
Loading…
Reference in New Issue
Block a user