mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 12:19:07 +00:00
home-manager/programs/pipewire: init
This commit is contained in:
parent
4d44190cc4
commit
6d1cb78564
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./files/mutable-files.nix
|
./files/mutable-files.nix
|
||||||
|
./programs/pipewire.nix
|
||||||
./programs/pop-launcher.nix
|
./programs/pop-launcher.nix
|
||||||
./services/archivebox.nix
|
./services/archivebox.nix
|
||||||
./services/activitywatch.nix
|
./services/activitywatch.nix
|
||||||
|
46
modules/home-manager/programs/pipewire.nix
Normal file
46
modules/home-manager/programs/pipewire.nix
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.pipewire;
|
||||||
|
settingsFormat = pkgs.formats.json { };
|
||||||
|
|
||||||
|
generatePipewireConfig = name: settings: {
|
||||||
|
"pipewire/pipewire.conf.d/${name}.conf" = settingsFormat.generate "hm-pipewire-override-settings-${name}" settings;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.programs.pipewire = {
|
||||||
|
enable = lib.mkEnableOption "Pipewire configuration";
|
||||||
|
settings = {
|
||||||
|
type = settingsFormat.type;
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
The configuration file to be generated at
|
||||||
|
{file}`$XDG_CONFIG_HOME/pipewire/pipewire.conf`. For more details,
|
||||||
|
please see {manpage}`pipewire.conf(5)`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
overrides = {
|
||||||
|
type = with lib.types; attrsOf settingsFormat.type;
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
A set of user overrides to be generated in
|
||||||
|
{file}`$XDG_CONFIG_HOME/pipewire/pipewire.conf.d/$OVERRIDE.conf`.
|
||||||
|
|
||||||
|
::: {.note}
|
||||||
|
Both the `settings` and `overrides` can be used at the same time but
|
||||||
|
they will be merged in some order. You can see more details about it in
|
||||||
|
{manpage}`pipewire.conf(5)`.
|
||||||
|
:::
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
xdg.configFile =
|
||||||
|
lib.optionalAttrs (cfg.settings != { }) {
|
||||||
|
"pipewire/pipewire.conf" = settingsFormat.generate "hm-pipewire-settings" cfg.settings;
|
||||||
|
}
|
||||||
|
// lib.mapAttrs generatePipewireConfig cfg.overrides;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user