add media module

This commit is contained in:
Sakooooo 2023-07-09 01:37:18 +03:00
parent 5b6b430b05
commit 35f70798e1
Signed by: sako
GPG key ID: 3FD715D87D7725E0
4 changed files with 51 additions and 0 deletions

View file

@ -12,6 +12,7 @@
outputs.nixosModules.shell
outputs.nixosModules.hardware
outputs.nixosModules.dev
outputs.nixosModules.media
];
# flakes

View file

@ -0,0 +1,6 @@
{
imports = [
./mpd
./ncmpcpp
];
}

View file

@ -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";
};
};
}

View file

@ -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;
};
};
}