pyradio: add module

This commit is contained in:
magicquark 2026-01-19 03:43:54 +00:00 committed by Robert Helgesson
parent fdafcac367
commit 2a08ab21ab
8 changed files with 193 additions and 0 deletions

View file

@ -0,0 +1,11 @@
{
programs.pyradio = {
enable = true;
settings.enable_clock = true;
};
nmt.script = ''
assertFileExists "home-files/.config/pyradio/config"
assertFileContent "home-files/.config/pyradio/config" ${./expected-config}
'';
}

View file

@ -0,0 +1,28 @@
{
programs.pyradio = {
enable = true;
stations = [
{
name = "DEF CON Radio (SomaFM)";
url = "https://somafm.com/defcon256.pls";
}
# The stations below test the csv escaping functionality.
{
name = "DEF CON Radio, SomaFM";
url = "https://somafm.com/defcon256.pls";
}
{
name = "DEF CON Radio on \"SomaFM\"";
url = "https://somafm.com/defcon256.pls";
}
{
name = ''DEF CON Radio on "SomaFM"'';
url = "https://somafm.com/defcon256.pls";
}
];
};
nmt.script = ''
assertFileContent "home-files/.config/pyradio/stations.csv" ${./expected-stations.csv}
'';
}

View file

@ -0,0 +1,5 @@
{
pyradio-basic-configuration = ./basic-configuration.nix;
pyradio-custom-stations = ./custom-stations.nix;
pyradio-empty-settings = ./empty-settings.nix;
}

View file

@ -0,0 +1,11 @@
{
programs.pyradio = {
enable = true;
settings = { };
};
nmt.script = ''
assertPathNotExists "home-files/.config/pyradio/config"
assertPathNotExists "home-files/.config/pyradio/stations.csv"
'';
}

View file

@ -0,0 +1,3 @@
# Generated by Home Manager.
enable_clock=true

View file

@ -0,0 +1,4 @@
DEF CON Radio (SomaFM),https://somafm.com/defcon256.pls
"DEF CON Radio, SomaFM",https://somafm.com/defcon256.pls
"DEF CON Radio on ""SomaFM""",https://somafm.com/defcon256.pls
"DEF CON Radio on ""SomaFM""",https://somafm.com/defcon256.pls
1 DEF CON Radio (SomaFM) https://somafm.com/defcon256.pls
2 DEF CON Radio, SomaFM https://somafm.com/defcon256.pls
3 DEF CON Radio on "SomaFM" https://somafm.com/defcon256.pls
4 DEF CON Radio on "SomaFM" https://somafm.com/defcon256.pls