move audio stuff to different profile from xsession

This commit is contained in:
Daniel Lovbrotte Olsen 2022-04-24 18:37:29 +02:00
parent 1f5c793d77
commit b372167736
7 changed files with 41 additions and 22 deletions

View File

@ -1,6 +1,6 @@
let
unstable = import <nixos-unstable> { };
stable = import <nixos> {};
unstable = import <unstable> { };
stable = import <nixpkgs> {};
nur = import <nur> { pkgs = unstable; };
in
{

View File

@ -13,6 +13,8 @@
profiles.xsession.enable = true;
profiles.zsh.enable = true;
profiles.audio.fancy = false;
services.gammastep = {
enable = true;
dawnTime = "7:00-8:15";

34
profiles/audio.nix Normal file
View File

@ -0,0 +1,34 @@
{pkgs, config, lib, ...}:
let
cfg = config.profiles.audio;
audio-plugins = pkgs.symlinkJoin { name = "audio-plugins"; paths = [ pkgs.lsp-plugins pkgs.speech-denoiser ];};
in
{
options.profiles.audio = {
enable = lib.mkOption {
default = config.profiles.xsession.enable;
defaultText = "xsession.enable";
};
fancy = lib.mkOption {
default = cfg.enable;
defaultText = "audio.enable";
};
};
config = lib.mkIf config.profiles.audio.enable {
home.packages = with pkgs; [
] ++ lib.optionals config.profiles.gui.enable (with pkgs; [
pavucontrol
spotify
]) ++ lib.optionals cfg.fancy (with pkgs; [
carla
]);
home.file."audio-plugins" = lib.mkIf cfg.fancy {
source = "${audio-plugins}/lib";
target = "audio-plugins";
};
};
}

View File

@ -62,8 +62,7 @@ in {
mpv
sxiv
spotify
mumble
#dan.rank_photos

View File

@ -2,6 +2,7 @@
imports = [
./base
./xsession
./audio.nix
./zsh
./gui.nix
./non-nixos.nix

View File

@ -1,17 +0,0 @@
{pkgs, config, lib, ...}:
let
audio-plugins = pkgs.symlinkJoin { name = "audio-plugins"; paths = [ pkgs.lsp-plugins pkgs.speech-denoiser ];};
in
{
config = lib.mkIf config.profiles.xsession.enable {
home.packages = [ ] ++ lib.optionals config.profiles.gui.enable [
pkgs.pavucontrol
pkgs.carla
];
home.file."audio-plugins" = {
source = "${audio-plugins}/lib";
target = "audio-plugins";
};
};
}

View File

@ -6,7 +6,7 @@ let
mkGL = program: "${lib.strings.optionalString non-nixos.enable "nixGL "}${program}";
in
{
imports = [ ./dunstrc.nix ./terminal.nix ./audio.nix ./polybar.nix ];
imports = [ ./dunstrc.nix ./terminal.nix ./polybar.nix ];
options.profiles.xsession = {
enable = lib.mkEnableOption "Whether or not to control the xsession";