From 60c0c5e888adc68cab024a5319e5ff7a6f735773 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Sat, 24 Aug 2024 23:45:08 +0200 Subject: [PATCH] Modularize ncspot --- modules/programs/default.nix | 1 + modules/programs/ncspot.nix | 51 ++++++++++++++++++++++++++ programs/individual_configs/ncspot.nix | 39 -------------------- 3 files changed, 52 insertions(+), 39 deletions(-) create mode 100644 modules/programs/ncspot.nix delete mode 100644 programs/individual_configs/ncspot.nix diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 44e60ab..70a3712 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -19,6 +19,7 @@ ./keepassxc.nix ./layout.nix ./media.nix + ./ncspot.nix ./nextcloud.nix ./piper.nix ./printing.nix diff --git a/modules/programs/ncspot.nix b/modules/programs/ncspot.nix new file mode 100644 index 0000000..a7a62fc --- /dev/null +++ b/modules/programs/ncspot.nix @@ -0,0 +1,51 @@ +{ lib, config, options, pkgs, ... }: { + options.mods.ncspot = { + enable = lib.mkOption { + default = false; + example = true; + type = lib.types.bool; + description = "Enables ncspot with a config"; + }; + }; + config = lib.mkIf config.mods.ncspot.enable + (lib.optionalAttrs (options ? home.packages) { + home.packages = with pkgs; [ ncspot ]; + xdg.configFile."ncspot/config.toml".source = + (pkgs.formats.toml { }).generate "ncspot" { + notify = true; + shuffle = true; + cover_max_scale = 2; + initial_screen = "library"; + library_tabs = [ "playlists" ]; + theme = { + background = "#1a1b26"; + primary = "#9aa5ce"; + secondary = "#414868"; + title = "#9ece6a"; + playing = "#7aa2f7"; + playing_selected = "#bb9af7"; + playing_bg = "#24283b"; + highlight = "#c0caf5"; + highlight_bg = "#24283b"; + error = "#414868"; + error_bg = "#f7768e"; + statusbar = "#ff9e64"; + statusbar_progress = "#7aa2f7"; + statusbar_bg = "#1a1b26"; + cmdline = "#c0caf5"; + cmdline_bg = "#24283b"; + search_match = "#f7768e"; + }; + keybindings = { + "j" = "move left 1"; + "k" = "move down 1"; + "l" = "move up 1"; + ";" = "move right 1"; + }; + notification_format = { + title = "%artists"; + body = "%title"; + }; + }; + }); +} diff --git a/programs/individual_configs/ncspot.nix b/programs/individual_configs/ncspot.nix deleted file mode 100644 index ccafe45..0000000 --- a/programs/individual_configs/ncspot.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ pkgs, ... }: { - xdg.configFile."ncspot/config.toml".source = - (pkgs.formats.toml { }).generate "ncspot" { - notify = true; - shuffle = true; - cover_max_scale = 2; - initial_screen = "library"; - library_tabs = [ "playlists" ]; - theme = { - background = "#1a1b26"; - primary = "#9aa5ce"; - secondary = "#414868"; - title = "#9ece6a"; - playing = "#7aa2f7"; - playing_selected = "#bb9af7"; - playing_bg = "#24283b"; - highlight = "#c0caf5"; - highlight_bg = "#24283b"; - error = "#414868"; - error_bg = "#f7768e"; - statusbar = "#ff9e64"; - statusbar_progress = "#7aa2f7"; - statusbar_bg = "#1a1b26"; - cmdline = "#c0caf5"; - cmdline_bg = "#24283b"; - search_match = "#f7768e"; - }; - keybindings = { - "j" = "move left 1"; - "k" = "move down 1"; - "l" = "move up 1"; - ";" = "move right 1"; - }; - notification_format = { - title = "%artists"; - body = "%title"; - }; - }; -}