Manage the user Flatpak through nix-flatpak and enable printer discovery through the host firewall.
37 lines
918 B
Nix
37 lines
918 B
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
util,
|
|
...
|
|
}:
|
|
# Bambu Studio for preparing and monitoring Bambu Lab prints.
|
|
let
|
|
user = config.user.name;
|
|
in
|
|
{
|
|
options.modules.desktop.apps.bambu-studio.enable =
|
|
lib.mkEnableOption "Bambu Studio for preparing and monitoring Bambu Lab prints";
|
|
|
|
config = lib.mkIf config.modules.desktop.apps.bambu-studio.enable {
|
|
services.flatpak.enable = true;
|
|
|
|
home-manager.sharedModules = [ inputs.nix-flatpak.homeManagerModules.nix-flatpak ];
|
|
home-manager.users.${user}.services.flatpak = {
|
|
enable = true;
|
|
packages = [ "com.bambulab.BambuStudio" ];
|
|
};
|
|
|
|
# Bambu printers announce themselves with SSDP multicast or broadcast traffic.
|
|
networking.firewall.allowedUDPPorts = [
|
|
1990
|
|
2021
|
|
];
|
|
|
|
registry.window-icon.${config.networking.hostName}.bambu-studio = {
|
|
class = "[Bb]ambu[Ss]tudio";
|
|
icon = util.glyph "f1b2";
|
|
};
|
|
};
|
|
}
|