ee68e27f15
Hi, I tried adding [Audiobookshelf](https://www.audiobookshelf.org/) as a new service to SHB. Not sure whether you want this service in SHB at all, but thought I'd create a PR just in case. The service runs, but seemingly fails to add an entry to the nginx config, so it is not reachable. I created the service by basically just copying deluge and then adapting. Any idea why the nginx subdomain isn't being created? The config I used to add this to my SHB server is: ```nix shb.audiobookshelf = { enable = true; domain = "sliper.xyz"; subdomain = "abs"; dataDir = "audiobookshelf"; #turns out this is actually the working dir of the service (/var/lib/<dataDir>) authEndpoint = "https://auth.sliper.xyz"; }; // ... in shb.authelia.oidcClients redirect_uris = [ "https://deluge.sliper.xyz" "https://abs.sliper.xyz" ]; ``` ps. I also need to fix tabs->spaces. Forgot to set up nvim. --------- Co-authored-by: sivert <nei@nei.nei> Co-authored-by: ibizaman <ibizapeanut@gmail.com> Co-authored-by: Pierre Penninckx <github@pierre.tiserbox.com>
115 lines
3.5 KiB
Nix
115 lines
3.5 KiB
Nix
{
|
|
description = "SelfHostBlocks module";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
|
nix-flake-tests.url = "github:antifuchs/nix-flake-tests";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nmdsrc = {
|
|
url = "git+https://git.sr.ht/~rycee/nmd";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = { nixpkgs, nix-flake-tests, flake-utils, nmdsrc, ... }: flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
patches = [
|
|
];
|
|
originPkgs = nixpkgs.legacyPackages.${system};
|
|
patchedNixpkgs = originPkgs.applyPatches {
|
|
name = "nixpkgs-patched";
|
|
src = nixpkgs;
|
|
patches = map (p: originPkgs.writeText "patch" p) patches;
|
|
};
|
|
|
|
pkgs = import patchedNixpkgs {
|
|
inherit system;
|
|
};
|
|
|
|
allModules = [
|
|
modules/blocks/authelia.nix
|
|
modules/blocks/backup.nix
|
|
modules/blocks/davfs.nix
|
|
modules/blocks/ldap.nix
|
|
modules/blocks/monitoring.nix
|
|
modules/blocks/nginx.nix
|
|
modules/blocks/postgresql.nix
|
|
modules/blocks/ssl.nix
|
|
modules/blocks/tinyproxy.nix
|
|
modules/blocks/vpn.nix
|
|
|
|
modules/services/arr.nix
|
|
modules/services/deluge.nix
|
|
modules/services/hledger.nix
|
|
modules/services/home-assistant.nix
|
|
modules/services/jellyfin.nix
|
|
modules/services/nextcloud-server.nix
|
|
modules/services/vaultwarden.nix
|
|
modules/services/audiobookshelf.nix
|
|
];
|
|
in
|
|
{
|
|
nixosModules.default = { config, ... }: {
|
|
imports = allModules;
|
|
};
|
|
|
|
packages.manualHtml = pkgs.callPackage ./docs {
|
|
inherit allModules nmdsrc;
|
|
release = "0.0.1";
|
|
};
|
|
|
|
lib.contracts = pkgs.callPackage ./modules/contracts {};
|
|
|
|
checks =
|
|
let
|
|
importFiles = files:
|
|
map (m: pkgs.callPackage m {}) files;
|
|
|
|
mergeTests = pkgs.lib.lists.foldl pkgs.lib.trivial.mergeAttrs {};
|
|
|
|
flattenAttrs = root: attrset: pkgs.lib.attrsets.foldlAttrs (acc: name: value: acc // {
|
|
"${root}_${name}" = value;
|
|
}) {} attrset;
|
|
|
|
vm_test = name: path: flattenAttrs "vm_${name}" (
|
|
import path {
|
|
inherit pkgs;
|
|
inherit (pkgs) lib;
|
|
}
|
|
);
|
|
in (rec {
|
|
all = mergeTests [
|
|
modules
|
|
];
|
|
|
|
modules = nix-flake-tests.lib.check {
|
|
inherit pkgs;
|
|
tests =
|
|
mergeTests (importFiles [
|
|
./test/modules/arr.nix
|
|
./test/modules/davfs.nix
|
|
./test/modules/lib.nix
|
|
./test/modules/nginx.nix
|
|
./test/modules/postgresql.nix
|
|
]);
|
|
};
|
|
|
|
lib = nix-flake-tests.lib.check {
|
|
inherit pkgs;
|
|
tests = pkgs.callPackage ./test/modules/lib.nix {};
|
|
};
|
|
}
|
|
// (vm_test "audiobookshelf" ./test/vm/audiobookshelf.nix)
|
|
// (vm_test "authelia" ./test/vm/authelia.nix)
|
|
// (vm_test "jellyfin" ./test/vm/jellyfin.nix)
|
|
// (vm_test "ldap" ./test/vm/ldap.nix)
|
|
// (vm_test "lib" ./test/vm/lib.nix)
|
|
// (vm_test "postgresql" ./test/vm/postgresql.nix)
|
|
// (vm_test "monitoring" ./test/vm/monitoring.nix)
|
|
// (vm_test "nextcloud" ./test/vm/nextcloud.nix)
|
|
// (vm_test "ssl" ./test/vm/ssl.nix)
|
|
);
|
|
}
|
|
);
|
|
}
|