From 3e70fa7efbe4b1dc23d70cd9a3bcf3a42dd573d9 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Sun, 5 Jan 2025 20:25:46 +0530 Subject: [PATCH] feat: Replace disk configuration --- modules/default.nix | 2 +- nixos/mirai/disk-config.nix | 44 ++++++++++++++++++------------------- nixos/mirai/services.nix | 22 ++++++++++++++----- overlays.nix | 16 ++++++++++++++ server/disk-config.nix | 44 ++++++++++++++++++------------------- 5 files changed, 75 insertions(+), 53 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 125c63d1..3ace540c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,7 +7,7 @@ ./goread.nix ./hyprpaper.nix ./aichat.nix - ./ghostty.nix + #./ghostty.nix # ./sketchybar.nix ]; } diff --git a/nixos/mirai/disk-config.nix b/nixos/mirai/disk-config.nix index c4e68413..4ce69c34 100644 --- a/nixos/mirai/disk-config.nix +++ b/nixos/mirai/disk-config.nix @@ -1,4 +1,4 @@ -{lib, ...}: { +{...}: { disko.devices = { disk = { one = { @@ -35,14 +35,6 @@ content = { type = "gpt"; partitions = { - # esp = { - # size = "1G"; - # type = "EF00"; - # content = { - # type = "mdraid"; - # name = "boot"; - # }; - # }; primary = { size = "100%"; content = { @@ -54,24 +46,12 @@ }; }; }; - # mdadm = { - # esp = { - # type = "mdadm"; - # level = 1; - # metadata = "1.0"; - # content = { - # type = "filesystem"; - # format = "vfat"; - # mountpoint = "/boot"; - # }; - # }; - # }; lvm_vg = { pool = { type = "lvm_vg"; lvs = { root = { - size = "128G"; + size = "64G"; lvm_type = "mirror"; content = { type = "filesystem"; @@ -82,8 +62,17 @@ ]; }; }; + nix = { + size = "256G"; + lvm_type = "raid0"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/nix"; + }; + }; home = { - size = "512G"; + size = "256G"; lvm_type = "raid0"; content = { type = "filesystem"; @@ -91,6 +80,15 @@ mountpoint = "/home"; }; }; + media = { + size = "100%"; + lvm_type = "raid0"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/media"; + }; + }; }; }; }; diff --git a/nixos/mirai/services.nix b/nixos/mirai/services.nix index d93e0bf4..6ec0d304 100644 --- a/nixos/mirai/services.nix +++ b/nixos/mirai/services.nix @@ -41,7 +41,8 @@ }; }; jellyfin = { - enable = false; + enable = true; + openFirewall = true; }; authelia = { instances.darksailor = { @@ -69,6 +70,10 @@ domain = "darksailor.dev"; policy = "one_factor"; } + { + domain = "media.darksailor.dev"; + policy = "one_factor"; + } { domain = "music.darksailor.dev"; policy = "one_factor"; @@ -92,8 +97,13 @@ notifier.filesystem.filename = "/var/lib/authelia-darksailor/authelia-notifier.log"; server = { address = "127.0.0.1:5555"; - endpoints.authz.forward-auth = { - implementation = "ForwardAuth"; + endpoints.authz = { + forward-auth = { + implementation = "ForwardAuth"; + }; + auth-request = { + implementation = "AuthRequest"; + }; }; }; # log = { @@ -193,6 +203,9 @@ } reverse_proxy localhost:4533 ''; + virtualHosts."media.darksailor.dev".extraConfig = '' + reverse_proxy localhost:8096 + ''; virtualHosts."atuin.darksailor.dev".extraConfig = '' reverse_proxy localhost:8888 ''; @@ -263,9 +276,6 @@ reverse_proxy localhost:8123 ''; - virtualHosts."media.darksailor.dev".extraConfig = '' - reverse_proxy localhost:8096 - ''; }; }; systemd.services.caddy = { diff --git a/overlays.nix b/overlays.nix index 55f88082..caf25abd 100644 --- a/overlays.nix +++ b/overlays.nix @@ -184,6 +184,21 @@ csshacks = final: prev: { csshacks = inputs.csshacks; }; + jellyfin = final: prev: { + jellyfin-web = prev.jellyfin-web.overrideAttrs (finalAttrs: previousAttrs: { + installPhase = '' + runHook preInstall + + # this is the important line + sed -i "s###" dist/index.html + + mkdir -p $out/share + cp -a dist $out/share/jellyfin-web + + runHook postInstall + ''; + }); + }; in [ libfprint @@ -197,5 +212,6 @@ in inputs.nur.overlays.default inputs.rust-overlay.overlays.default csshacks + jellyfin ] ++ (import ./neovim/overlays.nix self) diff --git a/server/disk-config.nix b/server/disk-config.nix index c4e68413..4ce69c34 100644 --- a/server/disk-config.nix +++ b/server/disk-config.nix @@ -1,4 +1,4 @@ -{lib, ...}: { +{...}: { disko.devices = { disk = { one = { @@ -35,14 +35,6 @@ content = { type = "gpt"; partitions = { - # esp = { - # size = "1G"; - # type = "EF00"; - # content = { - # type = "mdraid"; - # name = "boot"; - # }; - # }; primary = { size = "100%"; content = { @@ -54,24 +46,12 @@ }; }; }; - # mdadm = { - # esp = { - # type = "mdadm"; - # level = 1; - # metadata = "1.0"; - # content = { - # type = "filesystem"; - # format = "vfat"; - # mountpoint = "/boot"; - # }; - # }; - # }; lvm_vg = { pool = { type = "lvm_vg"; lvs = { root = { - size = "128G"; + size = "64G"; lvm_type = "mirror"; content = { type = "filesystem"; @@ -82,8 +62,17 @@ ]; }; }; + nix = { + size = "256G"; + lvm_type = "raid0"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/nix"; + }; + }; home = { - size = "512G"; + size = "256G"; lvm_type = "raid0"; content = { type = "filesystem"; @@ -91,6 +80,15 @@ mountpoint = "/home"; }; }; + media = { + size = "100%"; + lvm_type = "raid0"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/media"; + }; + }; }; }; };