Skip to content

Commit

Permalink
refactor(nix): use pkg.formats.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Nov 27, 2023
1 parent 9a04df0 commit 697428c
Showing 1 changed file with 63 additions and 40 deletions.
103 changes: 63 additions & 40 deletions packages/homer.nix
Original file line number Diff line number Diff line change
@@ -1,45 +1,68 @@
{ writeText, stdenv, fetchzip, ... }:
{ writeText, stdenv, fetchzip, pkgs, ... }:
let
config = writeText "config.yml" ''
title: "Media"
header: true
services:
- name: "Watch"
items:
- name: "Series"
url: "http://media.local:8096/"
type: "Emby"
apikey: "f972a063155049baa6080533886ccdd8"
libraryType: "series"
- name: "Movies"
url: "http://media.local:8096/"
type: "Emby"
apikey: "f972a063155049baa6080533886ccdd8"
libraryType: "movies"
- name: "Download"
items:
- name: "Series"
type: "Radarr"
url: "http://media.local:8989/"
apikey: "71c261a86baf491784a60fa7489620fc"
target: "_blank"
- name: "Movies"
type: "Radarr"
url: "http://media.local:7878/"
apikey: "0042dc1c54444388b0ed680187f11b37"
target: "_blank"
- name: "Subtitles"
url: "http://media.local:6767/"
target: "_blank"
- name: "Torrents"
url: "http://media.local:9091/"
target: "_blank"
- name: "Indexer"
url: "http://media.local:9117/"
target: "_blank"
'';
formatYaml = pkgs.formats.yaml { };
config = formatYaml.generate "config.yml" {
title = "Media";
header = true;
services = [
{
name = "Watch";
items = [
{
name = "Series";
url = "http://media.local:8096/";
type = "Emby";
apikey = "f972a063155049baa6080533886ccdd8";
libraryType = "series";
}
{
name = "Movies";
url = "http://media.local:8096/";
type = "Emby";
apikey = "f972a063155049baa6080533886ccdd8";
libraryType = "movies";
}
];
}
{
name = "Download";
items = [
{
name = "Series";
type = "Radarr";
url = "http://media.local:8989/";
apikey = "71c261a86baf491784a60fa7489620fc";
target = "_blank";
}
{
name = "Movies";
type = "Radarr";
url = "http://media.local:7878/";
apikey = "0042dc1c54444388b0ed680187f11b37";
target = "_blank";
}
{
name = "Subtitles";
url = "http://media.local:6767/";
target = "_blank";
}
{
name = "Torrents";
url = "http://media.local:9091/";
target = "_blank";
}
{
name = "Indexer";
url = "http://media.local:9117/";
target = "_blank";
}
];
}
];
};
in
stdenv.mkDerivation rec {
stdenv.mkDerivation
rec {
name = "homer";
version = "23.10.1";
src = fetchzip {
Expand Down

0 comments on commit 697428c

Please sign in to comment.