diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 9512e28fd..882ab0f7e 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -105,6 +105,8 @@
/tests/modules/programs/ncmpcpp @olmokramer
/tests/modules/programs/ncmpcpp-linux @olmokramer
+/modules/programs/ncspot.nix @marsam
+
/modules/programs/ne.nix @cwyc
/tests/modules/programs/ne @cwyc
diff --git a/modules/misc/news.nix b/modules/misc/news.nix
index 4b39a22c7..5c570db0c 100644
--- a/modules/misc/news.nix
+++ b/modules/misc/news.nix
@@ -1946,6 +1946,14 @@ in
A new module is available: 'programs.lazygit'.
'';
}
+
+ {
+ time = "2021-04-27T00:00:00+00:00";
+ message = ''
+ A new module is available: 'programs.ncspot'.
+ '';
+ }
+
];
};
}
diff --git a/modules/modules.nix b/modules/modules.nix
index 0fac1f65d..f3c29c86d 100644
--- a/modules/modules.nix
+++ b/modules/modules.nix
@@ -98,6 +98,7 @@ let
(loadModule ./programs/msmtp.nix { })
(loadModule ./programs/mu.nix { })
(loadModule ./programs/ncmpcpp.nix { })
+ (loadModule ./programs/ncspot.nix { })
(loadModule ./programs/ne.nix { })
(loadModule ./programs/neomutt.nix { })
(loadModule ./programs/neovim.nix { })
diff --git a/modules/programs/ncspot.nix b/modules/programs/ncspot.nix
new file mode 100644
index 000000000..ea46c9fc2
--- /dev/null
+++ b/modules/programs/ncspot.nix
@@ -0,0 +1,50 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.programs.ncspot;
+
+ tomlFormat = pkgs.formats.toml { };
+
+in {
+ meta.maintainers = [ maintainers.marsam ];
+
+ options.programs.ncspot = {
+ enable = mkEnableOption "ncspot";
+
+ package = mkOption {
+ type = types.package;
+ default = pkgs.ncspot;
+ defaultText = literalExample "pkgs.ncspot";
+ description = "The package to use for ncspot.";
+ };
+
+ settings = mkOption {
+ type = tomlFormat.type;
+ default = { };
+ example = literalExample ''
+ {
+ shuffle = true;
+ gapless = true;
+ }
+ '';
+ description = ''
+ Configuration written to
+ ~/.config/ncspot/config.toml.
+
+ See
+ for the full list of options.
+ '';
+ };
+ };
+
+ config = mkIf cfg.enable {
+ home.packages = [ cfg.package ];
+
+ xdg.configFile."ncspot/config.toml" = mkIf (cfg.settings != { }) {
+ source = tomlFormat.generate "ncspot-config" cfg.settings;
+ };
+ };
+}