homeserver: added mount config for loki and grafana

This commit is contained in:
Tigor Hutasuhut 2024-09-02 14:10:05 +07:00
parent 3728caaa3f
commit a54dcef036

View file

@ -8,103 +8,127 @@
[ [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
config = {
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; fileSystems."/" =
boot.initrd.kernelModules = [ ]; {
boot.kernelModules = [ "kvm-amd" ]; device = "/dev/disk/by-uuid/439a1beb-1443-495b-9891-012605819803";
boot.extraModulePackages = [ ]; fsType = "ext4";
};
fileSystems."/" = fileSystems."/boot" =
{ {
device = "/dev/disk/by-uuid/439a1beb-1443-495b-9891-012605819803"; device = "/dev/disk/by-uuid/47A1-0296";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/nas" = {
device = "/dev/disk/by-label/WD_RED_4T_1";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/nas/public/Music" = {
device = "/nas/Syncthing/Sync/Music";
fsType = "auto";
options = [
"defaults"
"nofail"
"nobootwait"
"bind"
];
};
fileSystems."/nas/public/Public" = {
device = "/nas/Syncthing/Sync/Public";
fsType = "auto";
options = [
"defaults"
"nofail"
"nobootwait"
"bind"
];
};
fileSystems = {
"/nas/telemetry/grafana" = lib.mkIf config.profile.services.telemetry.grafana.enable {
device = "/var/lib/grafana";
fsType = "auto";
options = [
"defaults"
"nofail"
"nobootwait"
"bind"
];
};
fileSystems."/boot" = "/nas/telemetry/loki" = lib.mkIf config.profile.services.telemetry.loki.enable {
{ device = "/var/lib/loki";
device = "/dev/disk/by-uuid/47A1-0296"; fsType = "auto";
fsType = "vfat"; options = [
options = [ "fmask=0022" "dmask=0022" ]; "defaults"
"nofail"
"nobootwait"
"bind"
];
};
}; };
fileSystems."/nas" = { swapDevices = [ ];
device = "/dev/disk/by-label/WD_RED_4T_1";
fsType = "ext4";
};
fileSystems."/nas/public/Music" = {
device = "/nas/Syncthing/Sync/Music";
fsType = "auto";
options = [
"defaults"
"nofail"
"nobootwait"
"bind"
];
};
fileSystems."/nas/public/Public" = {
device = "/nas/Syncthing/Sync/Public";
fsType = "auto";
options = [
"defaults"
"nofail"
"nobootwait"
"bind"
];
};
swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
networking.defaultGateway = "192.168.100.1";
networking.interfaces.enp9s0 = {
useDHCP = false;
ipv4.addresses = [
{
address = "192.168.100.3";
prefixLength = 24;
}
{
address = "192.168.100.4";
prefixLength = 24;
}
{
address = "192.168.100.5";
prefixLength = 24;
}
];
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking services.caddy.virtualHosts."public.tigor.web.id".extraConfig = /*caddy*/ ''
# (the default) this is the recommended approach. When using systemd-networkd it's file_server browse
# still possible to use this option, but it's recommended to use it in conjunction root * /nas/public
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. '';
networking.useDHCP = lib.mkDefault true;
networking.defaultGateway = "192.168.100.1";
networking.interfaces.enp9s0 = {
useDHCP = false;
ipv4.addresses = [
{
address = "192.168.100.3";
prefixLength = 24;
}
{
address = "192.168.100.4";
prefixLength = 24;
}
{
address = "192.168.100.5";
prefixLength = 24;
}
];
};
services.caddy.virtualHosts."public.tigor.web.id".extraConfig = /*caddy*/ '' systemd.tmpfiles.settings = {
file_server browse "100-nas-public-dir" = {
root * /nas/public "/nas/public" = {
''; d = {
group = config.profile.user.name;
systemd.tmpfiles.settings = { mode = "0777";
"100-nas-public-dir" = { user = config.profile.user.name;
"/nas/public" = { };
d = {
group = config.profile.user.name;
mode = "0777";
user = config.profile.user.name;
}; };
}; };
}; };
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.enableAllFirmware = true; hardware.enableAllFirmware = true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
intel-media-driver intel-media-driver
intel-vaapi-driver intel-vaapi-driver
libvdpau-va-gl libvdpau-va-gl
]; ];
};
environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; # Force intel-media-driver
}; };
environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; # Force intel-media-driver
} }