1

reformat using alejandra

This commit is contained in:
2023-01-18 14:00:02 +01:00
parent 3ad68f24d6
commit eb44696de3
43 changed files with 1283 additions and 1095 deletions

View File

@ -1,9 +1,13 @@
{ config, nixosConfig, lib, mylib, pkgs, ... }:
{
config,
nixosConfig,
lib,
mylib,
pkgs,
...
}:
with lib;
with mylib.modules;
let
with mylib.modules; let
cfg = config.modules.audio;
cfgfp = config.modules.flatpak;
in {
@ -64,35 +68,35 @@ in {
# Use builtins.concatLists instead of mkMerge as this is more safe as the type is specified,
# also mkMerge doesn't work in every case as it yields a set
home.packages = with pkgs; builtins.concatLists [
home.packages = with pkgs;
builtins.concatLists [
# lib.optional is preferred over mkIf or if...then...else by nix coding standards
# lib.optional wraps its argument in a list, lib.optionals doesn't
# This means that lib.optional can be used for single packages/arguments
# and lib.optionals has to be used when the argument is itself a list
# I use lib.optionals everywhere as I think this is more clear
# lib.optional is preferred over mkIf or if...then...else by nix coding standards
# lib.optional wraps its argument in a list, lib.optionals doesn't
# This means that lib.optional can be used for single packages/arguments
# and lib.optionals has to be used when the argument is itself a list
# I use lib.optionals everywhere as I think this is more clear
# Some of these include gamemode as I use that to enable performance governors for CPU/GPU and other stuff
# Some of these include gamemode as I use that to enable performance governors for CPU/GPU and other stuff
# Enable some default pipewire stuff if pipewire is enabled
(optionals nixosConfig.services.pipewire.enable [helvum])
# Enable some default pipewire stuff if pipewire is enabled
(optionals nixosConfig.services.pipewire.enable [ helvum ])
(optionals cfg.carla.enable [carla gamemode])
(optionals cfg.bitwig.enable [
bitwig-studio
gamemode
])
(optionals cfg.tenacity.enable [tenacity])
(optionals cfg.carla.enable [ carla gamemode ])
(optionals cfg.bitwig.enable [
bitwig-studio
gamemode
])
(optionals cfg.tenacity.enable [ tenacity ])
(optionals cfg.faust.enable [faust])
(optionals cfg.yabridge.enable [yabridge yabridgectl])
(optionals cfg.noisesuppression.noisetorch.enable [noisetorch])
(optionals cfg.faust.enable [ faust ])
(optionals cfg.yabridge.enable [ yabridge yabridgectl ])
(optionals cfg.noisesuppression.noisetorch.enable [ noisetorch ])
# (optionals cfg.vcvrack.enable [ vcv-rack ]) # Replaced by cardinal
(optionals cfg.cardinal.enable [ cardinal ])
# (optionals cfg.vital.enable [ vital-synth ]) # Replaced by distrho
(optionals cfg.distrho.enable [ distrho ])
];
# (optionals cfg.vcvrack.enable [ vcv-rack ]) # Replaced by cardinal
(optionals cfg.cardinal.enable [cardinal])
# (optionals cfg.vital.enable [ vital-synth ]) # Replaced by distrho
(optionals cfg.distrho.enable [distrho])
];
services.easyeffects = mkIf cfg.noisesuppression.easyeffects.enable {
enable = true;
@ -107,7 +111,7 @@ in {
icon = "carla";
exec = "env PIPEWIRE_LATENCY=256/48000 gamemoderun carla ${config.home.homeDirectory}/.config/carla/GuitarDefault.carxp";
terminal = false;
categories = [ "Music" "Audio" ];
categories = ["Music" "Audio"];
};
xdg.desktopEntries.bitwig-low-latency = mkIf cfg.bitwig.enable {
@ -116,7 +120,7 @@ in {
icon = "bitwig-studio";
exec = "env PIPEWIRE_LATENCY=256/48000 gamemoderun bitwig-studio";
terminal = false;
categories = [ "Music" "Audio" ];
categories = ["Music" "Audio"];
};
# TODO: Disable only for plasma
@ -147,12 +151,14 @@ in {
home.activation = mkMerge [
# The module includes the default carla project with ArchetypePetrucci + ArchetypeGojira
(mkIf cfg.carla.enable {
linkCarlaConfig = hm.dag.entryAfter [ "writeBoundary" ]
(mkLink "${config.home.homeDirectory}/NixFlake/config/carla" "${config.home.homeDirectory}/.config/carla");
linkCarlaConfig =
hm.dag.entryAfter ["writeBoundary"]
(mkLink "${config.home.homeDirectory}/NixFlake/config/carla" "${config.home.homeDirectory}/.config/carla");
})
(mkElse cfg.carla.enable {
unlinkCarlaConfig = hm.dag.entryAfter [ "writeBoundary" ]
(mkUnlink "${config.home.homeDirectory}/.config/carla");
unlinkCarlaConfig =
hm.dag.entryAfter ["writeBoundary"]
(mkUnlink "${config.home.homeDirectory}/.config/carla");
})
# Replaced by distrho
@ -166,24 +172,30 @@ in {
# })
(mkIf cfg.distrho.enable {
linkDistrhoLV2 = hm.dag.entryAfter [ "writeBoundary" ]
(mkLink "${pkgs.distrho}/lib/lv2" "${config.home.homeDirectory}/.lv2/distrho");
linkDistrhoVST = hm.dag.entryAfter [ "writeBoundary" ]
(mkLink "${pkgs.distrho}/lib/vst" "${config.home.homeDirectory}/.vst/distrho");
linkDistrhoVST3 = hm.dag.entryAfter [ "writeBoundary" ]
(mkLink "${pkgs.distrho}/lib/vst3" "${config.home.homeDirectory}/.vst3/distrho");
linkDistrhoLV2 =
hm.dag.entryAfter ["writeBoundary"]
(mkLink "${pkgs.distrho}/lib/lv2" "${config.home.homeDirectory}/.lv2/distrho");
linkDistrhoVST =
hm.dag.entryAfter ["writeBoundary"]
(mkLink "${pkgs.distrho}/lib/vst" "${config.home.homeDirectory}/.vst/distrho");
linkDistrhoVST3 =
hm.dag.entryAfter ["writeBoundary"]
(mkLink "${pkgs.distrho}/lib/vst3" "${config.home.homeDirectory}/.vst3/distrho");
})
(mkElse cfg.distrho.enable {
unlinkDistrhoLV2 = hm.dag.entryAfter [ "writeBoundary" ]
(mkUnlink "${config.home.homeDirectory}/.lv2/distrho");
unlinkDistrhoVST = hm.dag.entryAfter [ "writeBoundary" ]
(mkUnlink "${config.home.homeDirectory}/.vst/distrho");
unlinkDistrhoVST3 = hm.dag.entryAfter [ "writeBoundary" ]
(mkUnlink "${config.home.homeDirectory}/.vst3/distrho");
unlinkDistrhoLV2 =
hm.dag.entryAfter ["writeBoundary"]
(mkUnlink "${config.home.homeDirectory}/.lv2/distrho");
unlinkDistrhoVST =
hm.dag.entryAfter ["writeBoundary"]
(mkUnlink "${config.home.homeDirectory}/.vst/distrho");
unlinkDistrhoVST3 =
hm.dag.entryAfter ["writeBoundary"]
(mkUnlink "${config.home.homeDirectory}/.vst3/distrho");
})
(mkIf (cfg.yabridge.enable && cfg.yabridge.autoSync) {
syncYabridge = hm.dag.entryAfter [ "writeBoundary" ] ''
syncYabridge = hm.dag.entryAfter ["writeBoundary"] ''
yabridgectl sync
'';
})