From b372167736f943fab7a963d8b67037c43deba42b Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 24 Apr 2022 18:37:29 +0200 Subject: [PATCH] move audio stuff to different profile from xsession --- config.nix | 4 ++-- machines/pvv-terminal.nix | 2 ++ profiles/audio.nix | 34 ++++++++++++++++++++++++++++++++++ profiles/base/default.nix | 3 +-- profiles/default.nix | 1 + profiles/xsession/audio.nix | 17 ----------------- profiles/xsession/default.nix | 2 +- 7 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 profiles/audio.nix delete mode 100644 profiles/xsession/audio.nix diff --git a/config.nix b/config.nix index 73ea624..9904243 100644 --- a/config.nix +++ b/config.nix @@ -1,6 +1,6 @@ let - unstable = import { }; - stable = import {}; + unstable = import { }; + stable = import {}; nur = import { pkgs = unstable; }; in { diff --git a/machines/pvv-terminal.nix b/machines/pvv-terminal.nix index ae55f2a..db61f84 100644 --- a/machines/pvv-terminal.nix +++ b/machines/pvv-terminal.nix @@ -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"; diff --git a/profiles/audio.nix b/profiles/audio.nix new file mode 100644 index 0000000..6b4572a --- /dev/null +++ b/profiles/audio.nix @@ -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"; + }; + }; +} diff --git a/profiles/base/default.nix b/profiles/base/default.nix index 2383a30..fed0a0f 100644 --- a/profiles/base/default.nix +++ b/profiles/base/default.nix @@ -62,8 +62,7 @@ in { mpv sxiv - spotify - + mumble #dan.rank_photos diff --git a/profiles/default.nix b/profiles/default.nix index bea498a..be6a75f 100644 --- a/profiles/default.nix +++ b/profiles/default.nix @@ -2,6 +2,7 @@ imports = [ ./base ./xsession + ./audio.nix ./zsh ./gui.nix ./non-nixos.nix diff --git a/profiles/xsession/audio.nix b/profiles/xsession/audio.nix deleted file mode 100644 index b6c7577..0000000 --- a/profiles/xsession/audio.nix +++ /dev/null @@ -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"; - }; - }; -} diff --git a/profiles/xsession/default.nix b/profiles/xsession/default.nix index 0ea5995..e61cdf0 100644 --- a/profiles/xsession/default.nix +++ b/profiles/xsession/default.nix @@ -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";