schmittlauch.audio-sharing: init module
This commit is contained in:
parent
5251774f9d
commit
289bb07cc2
3 changed files with 35 additions and 0 deletions
32
common/audio-sharing.nix
Normal file
32
common/audio-sharing.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.schmittlauch.audio-sharing;
|
||||||
|
fwPort = 8554;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.schmittlauch.audio-sharing = {
|
||||||
|
enable = lib.mkEnableOption "enable Gnome audio-sharing application via rtsp";
|
||||||
|
openFirewall = lib.mkOption {
|
||||||
|
default = true;
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "Opens the port ${toString fwPort} to allow access to the rtsp stream";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ pkgs.audio-sharing ];
|
||||||
|
})
|
||||||
|
(lib.mkIf (cfg.enable && cfg.openFirewall) {
|
||||||
|
networking.firewall = {
|
||||||
|
allowedUDPPorts = [ fwPort ];
|
||||||
|
allowedTCPPorts = [ fwPort ];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -16,6 +16,7 @@ in
|
||||||
./nix-settings.nix
|
./nix-settings.nix
|
||||||
./upgrade-diff.nix
|
./upgrade-diff.nix
|
||||||
./guest.nix
|
./guest.nix
|
||||||
|
./audio-sharing.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.davfs2.enable = true;
|
services.davfs2.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -83,4 +83,6 @@ in
|
||||||
pkgs.framework-tool
|
pkgs.framework-tool
|
||||||
unstable.amd-debug-tools
|
unstable.amd-debug-tools
|
||||||
];
|
];
|
||||||
|
|
||||||
|
schmittlauch.audio-sharing.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue