feat: add sound nixos and home modules
This commit is contained in:
parent
0442bf82ad
commit
2e3e941ac2
26
modules/home/hardware/sound.nix
Normal file
26
modules/home/hardware/sound.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf;
|
||||||
|
|
||||||
|
cfg = config.ataraxia.defaults.sound;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.ataraxia.defaults.sound = {
|
||||||
|
enable = mkEnableOption "Default sound settings";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
pavucontrol
|
||||||
|
pulseaudio
|
||||||
|
];
|
||||||
|
services.easyeffects.enable = true;
|
||||||
|
|
||||||
|
persist.state.directories = [ ".local/state/wireplumber" ];
|
||||||
|
};
|
||||||
|
}
|
40
modules/home/roles/default.nix
Normal file
40
modules/home/roles/default.nix
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkDefault
|
||||||
|
mkIf
|
||||||
|
mkMerge
|
||||||
|
mkOption
|
||||||
|
recursiveUpdate
|
||||||
|
types
|
||||||
|
;
|
||||||
|
|
||||||
|
role = config.ataraxia.defaults.role;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.ataraxia.defaults = {
|
||||||
|
role = mkOption {
|
||||||
|
type = types.enum [
|
||||||
|
"none"
|
||||||
|
"base"
|
||||||
|
"server"
|
||||||
|
"desktop"
|
||||||
|
];
|
||||||
|
default = "none";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config =
|
||||||
|
let
|
||||||
|
baseRole = { };
|
||||||
|
serverRole = recursiveUpdate baseRole { };
|
||||||
|
desktopRole = recursiveUpdate baseRole {
|
||||||
|
ataraxia.defaults.sound.enable = mkDefault true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mkMerge [
|
||||||
|
(mkIf (role == "base") baseRole)
|
||||||
|
(mkIf (role == "server") serverRole)
|
||||||
|
(mkIf (role == "desktop") desktopRole)
|
||||||
|
];
|
||||||
|
}
|
44
modules/nixos/hardware/sound.nix
Normal file
44
modules/nixos/hardware/sound.nix
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf;
|
||||||
|
|
||||||
|
cfg = config.ataraxia.defaults.sound;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.ataraxia.defaults.sound = {
|
||||||
|
enable = mkEnableOption "Default sound settings";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pulseaudio.enable = false;
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
wireplumber.enable = true;
|
||||||
|
wireplumber.extraConfig = {
|
||||||
|
"monitor.bluez.properties" = {
|
||||||
|
"bluez5.enable-sbc-xq" = true;
|
||||||
|
"bluez5.enable-msbc" = true;
|
||||||
|
"bluez5.enable-hw-volume" = true;
|
||||||
|
"bluez5.roles" = [
|
||||||
|
"hsp_hs"
|
||||||
|
"hsp_ag"
|
||||||
|
"hfp_hf"
|
||||||
|
"hfp_ag"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
extraConfig.client = {
|
||||||
|
"10-no-resample" = {
|
||||||
|
"stream.properties" = {
|
||||||
|
"resample.disable" = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -13,7 +13,6 @@ let
|
|||||||
types
|
types
|
||||||
;
|
;
|
||||||
|
|
||||||
defaultUser = config.ataraxia.defaults.users.defaultUser;
|
|
||||||
fs = config.ataraxia.filesystems;
|
fs = config.ataraxia.filesystems;
|
||||||
fsCompression = fs.zfs.enable || fs.btrfs.enable;
|
fsCompression = fs.zfs.enable || fs.btrfs.enable;
|
||||||
role = config.ataraxia.defaults.role;
|
role = config.ataraxia.defaults.role;
|
||||||
@ -66,7 +65,8 @@ in
|
|||||||
time.timeZone = "Etc/UTC";
|
time.timeZone = "Etc/UTC";
|
||||||
};
|
};
|
||||||
desktopRole = recursiveUpdate baseRole {
|
desktopRole = recursiveUpdate baseRole {
|
||||||
services.getty.autologinUser = defaultUser;
|
ataraxia.defaults.sound.enable = mkDefault true;
|
||||||
|
|
||||||
location = {
|
location = {
|
||||||
provider = "manual";
|
provider = "manual";
|
||||||
latitude = 48;
|
latitude = 48;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user