diff --git a/default.nix b/default.nix index 900efeb9..9b9c2589 100644 --- a/default.nix +++ b/default.nix @@ -12,6 +12,7 @@ outputs.nixosModules.shell outputs.nixosModules.hardware outputs.nixosModules.dev + outputs.nixosModules.media ]; # flakes diff --git a/modules/media/default.nix b/modules/media/default.nix new file mode 100644 index 00000000..f5aae6a2 --- /dev/null +++ b/modules/media/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./mpd + ./ncmpcpp + ]; +} diff --git a/modules/media/mpd/default.nix b/modules/media/mpd/default.nix new file mode 100644 index 00000000..00468811 --- /dev/null +++ b/modules/media/mpd/default.nix @@ -0,0 +1,23 @@ +{ outputs, options, config, lib, pkgs, ...}: +with lib; +let + cfg = config.modules.media.mpd; +in +{ + options.modules.media.mpd = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + services.mpd = { + enable = true; + user = "sako"; + musicDirectory = "/home/sako/music"; + extraConfig = builtins.readFile ../../../config/mpd/mpd.conf; + startWhenNeeded = true; + }; + systemd.services.mpd.environment = { + XDG_RUNTIME_DIR = "/run/user/1000"; + }; + }; +} diff --git a/modules/media/ncmpcpp/default.nix b/modules/media/ncmpcpp/default.nix new file mode 100644 index 00000000..6fa2058a --- /dev/null +++ b/modules/media/ncmpcpp/default.nix @@ -0,0 +1,21 @@ +{ outputs, options, config, lib, pkgs, ...}: +with lib; +let + cfg = config.modules.media.ncmpcpp; +in +{ + options.modules.media.ncmpcpp = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + users.users.sako.packages = with pkgs; [ + ncmpcpp + ]; + + home-manager.users.sako.xdg.configFile.ncmpcpp = { + source = ../../../config/ncmpcpp; + recursive = true; + }; + }; +}