2024-04-08 21:06:24 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.soundmodem;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
programs.soundmodem = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2024-04-17 21:45:01 +02:00
|
|
|
description = ''
|
2024-04-08 21:06:24 +02:00
|
|
|
Whether to add Soundmodem to the global environment and configure a
|
|
|
|
wrapper for 'soundmodemconfig' for users in the 'soundmodem' group.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
package = mkPackageOption pkgs "soundmodem" { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-04-17 21:45:01 +02:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2024-04-08 21:06:24 +02:00
|
|
|
users.groups.soundmodem = { };
|
|
|
|
|
|
|
|
security.wrappers.soundmodemconfig = {
|
|
|
|
source = "${cfg.package}/bin/soundmodemconfig";
|
|
|
|
owner = "root";
|
|
|
|
group = "soundmodem";
|
|
|
|
permissions = "u+rx,g+x";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|