feat(spotify_player): add service/program module
This commit is contained in:
parent
2e4ac37bc6
commit
b6b76a0e7d
3 changed files with 123 additions and 1 deletions
33
modules/programs/spotify_player.nix
Normal file
33
modules/programs/spotify_player.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.spotify-player;
|
||||
toml = pkgs.formats.toml { };
|
||||
in
|
||||
{
|
||||
options.my.programs.spotify-player = {
|
||||
enable = mkEnableOption "spotify-player";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.spotify-player;
|
||||
};
|
||||
config = mkOption {
|
||||
inherit (toml) type;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz = {
|
||||
xdg.configFile."spotify-player/app.toml" = {
|
||||
source = toml.generate "app.toml" cfg.config;
|
||||
};
|
||||
home.packages = [ cfg.package ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue