add audio module
This commit is contained in:
@ -11,26 +11,29 @@ rec {
|
|||||||
# Feel free to split up your configuration and import pieces of it here.
|
# Feel free to split up your configuration and import pieces of it here.
|
||||||
|
|
||||||
./modules/emacs.nix
|
./modules/emacs.nix
|
||||||
|
./modules/audio.nix
|
||||||
|
|
||||||
# inputs.nixvim.homeManagerModules.nixvim
|
# inputs.nixvim.homeManagerModules.nixvim
|
||||||
];
|
];
|
||||||
|
|
||||||
# Config my modules
|
# Config my modules
|
||||||
modules = {
|
modules.emacs = {
|
||||||
emacs.enable = true;
|
enable = true;
|
||||||
emacs.useDoom = true;
|
useDoom = true;
|
||||||
emacs.autosync = true;
|
autosync = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules.audio = {
|
||||||
|
enable = true;
|
||||||
|
carla = true;
|
||||||
|
yabridge.enable = true;
|
||||||
|
yabridge.autosync = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Email
|
# TODO: Email
|
||||||
# TODO: Run noisetorch as login script
|
# TODO: Run noisetorch as login script
|
||||||
# TODO: Gnome terminal config
|
# TODO: Gnome terminal config
|
||||||
|
|
||||||
# TODO: Update flatpak on rebuild? Make a setting/module for this, emacs update and yabridgectl update... Use home.activation...
|
|
||||||
home.activation.syncYabridge = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
||||||
yabridgectl sync
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Disabled since HomeManager should use global pkgs
|
# Disabled since HomeManager should use global pkgs
|
||||||
# https://github.com/nix-community/home-manager/issues/2942
|
# https://github.com/nix-community/home-manager/issues/2942
|
||||||
# nixpkgs.config.allowUnfreePredicate = (pkg: true);
|
# nixpkgs.config.allowUnfreePredicate = (pkg: true);
|
||||||
@ -49,6 +52,8 @@ rec {
|
|||||||
# NOTE: I don't think I need this anymore as all fonts are installed through the system config but let's keep this just in case
|
# NOTE: I don't think I need this anymore as all fonts are installed through the system config but let's keep this just in case
|
||||||
fonts.fontconfig.enable = true; # Also updates the font-cache
|
fonts.fontconfig.enable = true; # Also updates the font-cache
|
||||||
|
|
||||||
|
# TODO: Add to flatpak module
|
||||||
|
# TODO: Update flatpak on rebuild?
|
||||||
# We link like this to be able to address the absolute location, also the fonts won't get copied to store
|
# We link like this to be able to address the absolute location, also the fonts won't get copied to store
|
||||||
# NOTE: This path contains all the fonts because fonts.fontDir.enable is true
|
# NOTE: This path contains all the fonts because fonts.fontDir.enable is true
|
||||||
home.activation.linkFontDir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.linkFontDir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
@ -63,7 +68,6 @@ rec {
|
|||||||
ln -sf /etc/profiles/per-user/christoph/share/icons ${home.homeDirectory}/.local/share/icons
|
ln -sf /etc/profiles/per-user/christoph/share/icons ${home.homeDirectory}/.local/share/icons
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Allow access to linked fonts/icons
|
# Allow access to linked fonts/icons
|
||||||
home.file.".local/share/flatpak/overrides/global".text = ''
|
home.file.".local/share/flatpak/overrides/global".text = ''
|
||||||
[Context]
|
[Context]
|
||||||
@ -89,19 +93,7 @@ rec {
|
|||||||
in
|
in
|
||||||
formatted;
|
formatted;
|
||||||
|
|
||||||
# TODO: Music module
|
# NOTE: Is set by flatpak.enable
|
||||||
# NOTE: This desktop entry is created in /etc/profiles/per-user/christoph/share/applications
|
|
||||||
# This location is part of XDG_DATA_DIRS
|
|
||||||
xdg.desktopEntries.guitar = {
|
|
||||||
name = "Guitar Amp (Carla)";
|
|
||||||
genericName = "Guitar Amp Simulation";
|
|
||||||
icon = "carla";
|
|
||||||
exec = "env PIPEWIRE_LATENCY=256/48000 gamemoderun carla ${home.homeDirectory}/Documents/Carla/GuitarDefault.carxp";
|
|
||||||
terminal = false;
|
|
||||||
categories = [ "Music" "Audio" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: Does this has to be set manually or is it set by flatpak.enable?
|
|
||||||
# xdg.systemDirs.data = [
|
# xdg.systemDirs.data = [
|
||||||
# "/var/lib/flatpak/exports/share"
|
# "/var/lib/flatpak/exports/share"
|
||||||
# "${home.homeDirectory}/.local/share/flatpak/exports/share"
|
# "${home.homeDirectory}/.local/share/flatpak/exports/share"
|
||||||
@ -273,13 +265,12 @@ rec {
|
|||||||
# godot
|
# godot
|
||||||
|
|
||||||
# Audio
|
# Audio
|
||||||
# TODO: Make a module, autosync yabridge on rebuild?
|
|
||||||
# vcv-rack
|
# vcv-rack
|
||||||
bitwig-studio
|
bitwig-studio
|
||||||
# audacity
|
# audacity
|
||||||
carla
|
# Module carla
|
||||||
yabridge
|
# Module yabridge
|
||||||
yabridgectl
|
# Module yabridgectl
|
||||||
|
|
||||||
# Use NixCommunity binary cache
|
# Use NixCommunity binary cache
|
||||||
cachix
|
cachix
|
||||||
|
78
home/modules/audio.nix
Normal file
78
home/modules/audio.nix
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.audio;
|
||||||
|
in {
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.modules.audio = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Configure for realtime audio and enable a bunch of music production tools";
|
||||||
|
};
|
||||||
|
|
||||||
|
carla = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable Carla + guitar-specific stuff";
|
||||||
|
};
|
||||||
|
|
||||||
|
yabridge = {
|
||||||
|
enable = {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable yabridge + yabridgectl";
|
||||||
|
};
|
||||||
|
|
||||||
|
autosync = {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Sync yabridge plugins on nixos-rebuild";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.packages = with pkgs; (mkMerge [
|
||||||
|
(mkIf cfg.carla [ carla ])
|
||||||
|
|
||||||
|
(mkIf cfg.yabridge.enable [ yabridge yabridgectl ])
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE: This desktop entry is created in /etc/profiles/per-user/christoph/share/applications
|
||||||
|
# This location is part of XDG_DATA_DIRS
|
||||||
|
xdg.desktopEntries.guitar = mkIf cfg.carla {
|
||||||
|
name = "Guitar Amp (Carla)";
|
||||||
|
genericName = "Guitar Amp Simulation";
|
||||||
|
icon = "carla";
|
||||||
|
exec = "env PIPEWIRE_LATENCY=256/48000 gamemoderun carla ${home.homeDirectory}/.config/carla/GuitarDefault.carxp";
|
||||||
|
terminal = false;
|
||||||
|
categories = [ "Music" "Audio" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
home.activation = (mkMerge [
|
||||||
|
(mkIf cfg.carla {
|
||||||
|
|
||||||
|
# The module includes the default carla project with ArchetypePetrucci + ArchetypeGojira
|
||||||
|
# TODO: I don't know if I should keep this
|
||||||
|
linkCarlaConfig = hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
if [ ! -L "${config.home.homeDirectory}/.config/carla" ]; then
|
||||||
|
ln -sf ${config.home.homeDirectory}/NixFlake/config/carla ${config.home.homeDirectory}/.config/carla
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.yabridge.autosync {
|
||||||
|
syncYabridge = hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
yabridgectl sync
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user