mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 06:19:00 +00:00
hosts/ni/setups/music: init module
This commit is contained in:
parent
8e42fa92d0
commit
c6cd57d5bc
@ -30,6 +30,7 @@
|
|||||||
networking.enable = true;
|
networking.enable = true;
|
||||||
networking.setup = "networkmanager";
|
networking.setup = "networkmanager";
|
||||||
networking.wireguard.enable = true;
|
networking.wireguard.enable = true;
|
||||||
|
setups.music.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
disko.devices = import ./disko.nix {
|
disko.devices = import ./disko.nix {
|
||||||
@ -47,24 +48,6 @@
|
|||||||
"time.facebook.com"
|
"time.facebook.com"
|
||||||
];
|
];
|
||||||
|
|
||||||
# My portable music streaming server.
|
|
||||||
services.gonic = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
listen-addr = "127.0.0.1:4747";
|
|
||||||
cache-path = "/var/cache/gonic";
|
|
||||||
music-path = [
|
|
||||||
"/srv/music"
|
|
||||||
];
|
|
||||||
podcast-path = "/var/cache/gonic/podcasts";
|
|
||||||
|
|
||||||
jukebox-enabled = true;
|
|
||||||
|
|
||||||
scan-interval = 1;
|
|
||||||
scan-at-start-enabled = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
sops.secrets = lib.getSecrets ./secrets/secrets.yaml {
|
sops.secrets = lib.getSecrets ./secrets/secrets.yaml {
|
||||||
"ssh-key" = { };
|
"ssh-key" = { };
|
||||||
};
|
};
|
||||||
|
@ -4,5 +4,6 @@
|
|||||||
./hardware/qol.nix
|
./hardware/qol.nix
|
||||||
./networking/setup.nix
|
./networking/setup.nix
|
||||||
./networking/wireguard.nix
|
./networking/wireguard.nix
|
||||||
|
./setups/music.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
29
hosts/ni/modules/setups/music.nix
Normal file
29
hosts/ni/modules/setups/music.nix
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
hostCfg = config.hosts.ni;
|
||||||
|
cfg = hostCfg.setups.music;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.hosts.ni.setups.music.enable = lib.mkEnableOption "music streaming and organizing setup";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
# My portable music streaming server.
|
||||||
|
services.gonic = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
listen-addr = "localhost:4747";
|
||||||
|
cache-path = "/var/cache/gonic";
|
||||||
|
music-path = [
|
||||||
|
"/srv/music"
|
||||||
|
];
|
||||||
|
podcast-path = "/var/cache/gonic/podcasts";
|
||||||
|
|
||||||
|
jukebox-enabled = true;
|
||||||
|
|
||||||
|
scan-interval = 1;
|
||||||
|
scan-at-start-enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -5,7 +5,7 @@ let
|
|||||||
cfg = userCfg.music;
|
cfg = userCfg.music;
|
||||||
|
|
||||||
ytdlpAudio = pkgs.writeScriptBin "yt-dlp-audio" ''
|
ytdlpAudio = pkgs.writeScriptBin "yt-dlp-audio" ''
|
||||||
${pkgs.yt-dlp}/bin/yt-dlp --config-location "${../config/yt-dlp-audio.conf}" $@
|
${pkgs.yt-dlp}/bin/yt-dlp --config-location "${../../config/yt-dlp-audio.conf}" $@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
musicDir = config.xdg.userDirs.music;
|
musicDir = config.xdg.userDirs.music;
|
||||||
|
Loading…
Reference in New Issue
Block a user