added diva support

This commit is contained in:
chloe 2025-05-07 19:51:44 +02:00
parent cf5af467fa
commit 2113e53b7e
8 changed files with 108 additions and 25 deletions

View file

@ -1,7 +1,16 @@
{ inputs, ... }:
{ inputs, username, ... }:
{
imports = [ ./features ];
imports = [
./hardware.nix
./networking.nix
./features
../../shared
];
networking.hostName = "diva"; # Define your hostname.
networking.domain = "rougebordeaux.xyz";
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
networking.firewall = {
enable = true;
@ -12,14 +21,19 @@
];
};
# reducing disk usage
boot.loader.systemd-boot.configurationLimit = 10;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
nix.settings.auto-optimise-store = true;
services.caddy.enable = true;
users.users.${username} = {
isNormalUser = true;
extraGroups = [
"wheel"
"dialout"
"docker"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA8sdToNavEQv7PTMJ97HIGM6UlChwGS3x9O8hFilzui harryh@ik.me"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHjz5MUSmc1ahtUJWuvzG7PHH432nx6a0Nj2zfxt3oTP geekcat@protonmail.com"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP9Yp7TbDhYJ27Sh+LcPXT569bMVwbFrkE4zksfU84l+ harry123@goober"
];
};
}

View file

@ -1,4 +1,24 @@
{ ... }:
{
services.borgmatic.enable = true;
services.borgmatic = {
enable = true;
configurations = {
storageBox = {
postgresql_databases = [
{ name = "nextcloud"; }
];
};
};
};
systemd.timers."borgmatic" = {
enable = true;
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "*-*-* 03:00:00";
Persistent = true;
WakeSystem = true;
Unit = "borgmatic.service";
};
};
}

View file

@ -3,7 +3,7 @@
imports = [
./backups.nix
./fail2ban.nix
./nextcloud.nix
# ./nextcloud.nix
./uptime-kuma.nix
];
}

View file

@ -1,4 +1,4 @@
{ config, ... }:
{
# ssh, https, nextcloud, uptime-kuma
}

View file

@ -11,7 +11,7 @@
reverse_proxy :4000
'';
services.caddy.virtualHosts."http://uptime.sisyphe.normandy.hypervirtual.world".extraConfig = ''
services.caddy.virtualHosts."http://uptime.diva.global.hypervirtual.world".extraConfig = ''
reverse_proxy :4000
'';
}

14
hosts/diva/hardware.nix Normal file
View file

@ -0,0 +1,14 @@
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
device = "nodev";
};
fileSystems."/boot" = { device = "/dev/disk/by-uuid/476E-933D"; fsType = "vfat"; };
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
}

35
hosts/diva/networking.nix Normal file
View file

@ -0,0 +1,35 @@
{ lib, ... }: {
# This file was populated at runtime with the networking
# details gathered from the active system.
networking = {
nameservers = [ "2a01:4ff:ff00::add:1"
"2a01:4ff:ff00::add:2"
"185.12.64.2"
];
defaultGateway = "172.31.1.1";
defaultGateway6 = {
address = "fe80::1";
interface = "eth0";
};
dhcpcd.enable = false;
usePredictableInterfaceNames = lib.mkForce false;
interfaces = {
eth0 = {
ipv4.addresses = [
{ address="95.216.145.45"; prefixLength=32; }
];
ipv6.addresses = [
{ address="2a01:4f9:c011:97d1::1"; prefixLength=64; }
{ address="fe80::9400:4ff:fe44:c3cd"; prefixLength=64; }
];
ipv4.routes = [ { address = "172.31.1.1"; prefixLength = 32; } ];
ipv6.routes = [ { address = "fe80::1"; prefixLength = 128; } ];
};
};
};
services.udev.extraRules = ''
ATTR{address}=="96:00:04:44:c3:cd", NAME="eth0"
'';
}

View file

@ -1,9 +1,13 @@
{ stdenv, fetchFromGitea }:
{
stdenv,
pkgs,
fetchFromGitea,
}:
stdenv.mkDerivation {
pname = "4get";
version = "1.2.6";
src = {
src = fetchFromGitea {
owner = "lolcat";
domain = "git.lolcat.ca";
repo = "4get";
@ -14,15 +18,11 @@ stdenv.mkDerivation {
installPhase = ''
runHook preInstall
cd lolcat
mkdir -p $out/share/icons/miku-cursor-linux
cp -r * $out/share/icons/miku-cursor-linux
install -m644 index.theme $out/share/icons/miku-cursor-linux/index.theme
mkdir -p $out/html
runHook postInstall
'';
buildInputs = [
pkgs.php84
];
}