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