Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2511.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@

- [KMinion](https://github.com/redpanda-data/kminion), feature-rich Prometheus exporter for Apache Kafka. Available as [services.prometheus.exporters.kafka](options.html#opt-services.prometheus.exporters.kafka).

- [Spoolman](https://github.com/Donkie/Spoolman), a inventory management system for Filament spools. Available as [services.spoolman](#opt-services.spoolman.enable).

## Backward Incompatibilities {#sec-release-25.11-incompatibilities}

<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@
./services/misc/spice-autorandr.nix
./services/misc/spice-vdagentd.nix
./services/misc/spice-webdavd.nix
./services/misc/spoolman.nix
./services/misc/sssd.nix
./services/misc/subsonic.nix
./services/misc/sundtek.nix
Expand Down
75 changes: 75 additions & 0 deletions nixos/modules/services/misc/spoolman.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
lib,
pkgs,
config,
...
}:
let
cfg = config.services.spoolman;
in
{

options.services.spoolman = {

enable = lib.mkEnableOption "Spoolman, a filament spool inventory management system.";

environment = lib.mkOption {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more examples and a link to upstream documentation would be helpful here, otherwise it feels a bit redundant to using systemd.services.spoolman.environment directly

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more examples and a link to upstream documentation would be helpful here, otherwise it feels a bit redundant to using systemd.services.spoolman.environment directly

You got a point!
I've added an example as well as a link to the documentation.

If you still find it redundant, I will remove services.spoolman.environment.

Thank you!!

type = lib.types.attrs;
default = { };
description = ''
Environment variables to be passed to the spoolman service.
'';
};

openFirewall = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Open the appropriate ports in the firewall for spoolman.
'';
};

listen = lib.mkOption {
type = lib.types.str;
default = "127.0.0.1";
example = "0.0.0.0";
description = "The IP address to bind the spoolman server to.";
};

port = lib.mkOption {
type = lib.types.port;
default = 7912;
description = ''
TCP port where spoolman web-gui listens.
'';
};

};

config = lib.mkIf cfg.enable {

systemd.services.spoolman = {
description = "A self-hosted filament spool inventory management system";
wantedBy = [ "multi-user.target" ];
environment = {
SPOOLMAN_DIR_DATA = "/var/lib/spoolman";
}
// cfg.environment;
serviceConfig = lib.mkMerge [
{
DynamicUser = true;
ExecStart = "${pkgs.spoolman}/bin/spoolman --host ${cfg.listen} --port ${toString cfg.port}";
StateDirectory = "spoolman";
}
];
};

networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = lib.optional (cfg.listen != "127.0.0.1") cfg.port;
};

};
meta = {
maintainers = with lib.maintainers; [ MayNiklas ];
};
}
Loading