Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
5be4192143
Opened Firewall, Added Dashboard-stuff
Some checks failed
/ Check NixOS Configuration (push) Has been cancelled
2024-11-30 02:34:20 +01:00
e8e469f2a9
Trying to Connect to VMs 8080 Port 2024-11-30 02:19:06 +01:00
ec7839fa36
Added SSH Public Key 2024-11-30 02:18:21 +01:00
e77200dcd0
Added Run Instructions 2024-11-30 00:59:13 +01:00
bd8e133730
Fixed Module Enable 2024-11-30 00:58:59 +01:00
57a2d11ae6
Added Configuration for Audiobookshelf (does not evaluate yet)
Some checks are pending
/ Check NixOS Configuration (push) Waiting to run
2024-11-29 03:15:56 +01:00
5 changed files with 108 additions and 0 deletions

View file

@ -92,6 +92,12 @@ Ram: 3GB of Host
Build: `nixos-rebuild build-vm --flake .#U3ncSovm` Build: `nixos-rebuild build-vm --flake .#U3ncSovm`
Run VM:
```bash
export QEMU_NET_OPTS="hostfwd=tcp::443-:443"
/nix/store/00your00hash00of00build999999999-nixos-vm/bin/run-U3ncSovm-vm
```
## License ## License
[MIT © kB01](../LICENSE) [MIT © kB01](../LICENSE)

View file

@ -0,0 +1,29 @@
{
inputs,
config,
lib,
pkgs,
system,
...
}:
let
cfg = config.services.nas;
in
{
config = lib.mkIf (cfg.enable && cfg.servers.audiobookshelf.enable) {
services.audiobookshelf = {
enable = true;
port = 63001;
};
services.traefik.dynamicConfigOptions = {
http.routers.audiobookshelf.entrypoints = "websecure";
http.routers.audiobookshelf.tls = true;
http.routers.audiobookshelf.rule = "Host(`audiobookshelf.localhost`)";
http.routers.audiobookshelf.service = "audiobookshelf";
services.audiobookshelf.loadBalancer.servers = [ { url = "http://localhost:63001/"; } ];
};
};
}

View file

@ -0,0 +1,29 @@
{ inputs, config, lib, pkgs, ... }:
let
cfg = config.services.nas;
in
{
imports = [
./traefik-proxy.nix
./audiobookshelf.nix
];
options.services.nas = {
enable = lib.mkOption {
type = with lib.types; uniq bool;
default = false;
description = "Enable NAS Server Configuration";
};
useTraefik.enable = lib.mkOption {
type = with lib.types; uniq bool;
default = true;
description = "Enables Traefik Reverese Proxy";
};
servers.audiobookshelf.enable = lib.mkOption {
type = with lib.types; uniq bool;
default = false;
description = "Audiobookshelf Server";
};
};
}

View file

@ -0,0 +1,37 @@
{
inputs,
config,
lib,
pkgs,
system,
...
}:
let
cfg = config.services.nas;
in
{
config = lib.mkIf (cfg.enable && cfg.useTraefik.enable) {
# Default Config
services.traefik = {
enable = true;
staticConfigOptions = {
entryPoints.web.address = ":80";
entryPoints.websecure.address = ":443";
};
};
networking.firewall.interfaces.eth0.allowedTCPPorts = [ 80 443 ];
# Enable Secure Dashboard
services.traefik.staticConfigOptions.api = {};
services.traefik.dynamicConfigOptions = {
http.routers.dashboard.entrypoints = "websecure";
http.routers.dashboard.tls = true;
http.routers.dashboard.rule = "Host(`traefik.localhost`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))";
http.routers.dashboard.service = "api@internal";
http.routers.dashboard.middlewares = "auth";
http.middlewares.auth.basicauth.users = "master:\$\$2y\$\$05\$\$JwzsNHz7CMJh0RU1eMe3AOfY5H30Qr1Q/glS1r/qEHCNpo5LvWnRW";
};
};
}

View file

@ -28,6 +28,7 @@
users.users.master = { users.users.master = {
initialPassword = "test"; initialPassword = "test";
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF82e+j7y8qsSvLn/DZuosvsH0S2EsHpqDkvZ8jiONm3 kb@LoyAdjo"
]; ];
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user. extraGroups = [ "wheel" ]; # Enable sudo for the user.
@ -45,6 +46,12 @@
git git
]; ];
# Enable NAS Functionality
services.nas = {
enable = true;
servers.audiobookshelf.enable = true;
};
# SSH and Mosh # SSH and Mosh
services.openssh = { services.openssh = {
enable = true; enable = true;