new uptime-kuma service, new drive
This commit is contained in:
parent
7a9f880f6d
commit
4bf1b55911
4 changed files with 52 additions and 6 deletions
|
@ -46,7 +46,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
system.stateVersion = mkDefault "23.11";
|
||||
system.stateVersion = mkDefault "25.11";
|
||||
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
|
||||
|
||||
boot = {
|
||||
|
|
|
@ -4,9 +4,6 @@
|
|||
imports = [
|
||||
inputs.hardware.nixosModules.common-pc-ssd
|
||||
inputs.hardware.nixosModules.common-pc
|
||||
# uses mkDefault to set to a patched kernel,
|
||||
# but it conflicts with one of our mkDefault settings
|
||||
#inputs.hardware.nixosModules.raspberry-pi-4
|
||||
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
@ -14,7 +11,10 @@
|
|||
# use better power management for a device that's always on
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
# i have a couple others i don't noramlly include, such as:
|
||||
# uas (uasp, scsi over usb), usbcore (needed(???) for the drive at boot)
|
||||
# pcie_brcmstb (required for pcie), reset-raspberrypi (needed for vl805 firmware to load)
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "pcie_brcmstb" "reset-raspberrypi" "uas" "usbcore" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
@ -23,8 +23,16 @@
|
|||
boot.loader.grub.enable = false;
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
|
||||
# needed for initial framebuffer logs to appear on raspberry pi
|
||||
# i think. this fixes it but idk if they are all required
|
||||
boot.kernelParams = [
|
||||
"8250.nr_uarts=1"
|
||||
"cma=128M"
|
||||
"console=tty0"
|
||||
];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
|
||||
{ device = "/dev/disk/by-uuid/04542424-6899-4b94-9414-fffa569f2c03";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" "nodiratime" "discard" ];
|
||||
};
|
||||
|
|
|
@ -35,6 +35,11 @@ in {
|
|||
enable = true;
|
||||
domain = "amdl.reidlab.pink";
|
||||
};
|
||||
|
||||
uptime = {
|
||||
enable = true;
|
||||
domain = "status.reidlab.pink";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
33
modules/services/uptime.nix
Normal file
33
modules/services/uptime.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ config, lib, pkgs, options, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.services.uptime;
|
||||
in {
|
||||
options.modules.services.uptime = {
|
||||
enable = mkEnableOption "enable uptime kuma, a self-hosted uptime website";
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 3002;
|
||||
};
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
default = "status.reidlab.pink";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.uptime-kuma = {
|
||||
enable = true;
|
||||
settings.PORT = toString cfg.port;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."${cfg.domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue