mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-08 14:40:19 +02:00
added diva support
This commit is contained in:
parent
cf5af467fa
commit
2113e53b7e
8 changed files with 108 additions and 25 deletions
|
@ -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"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
imports = [
|
||||
./backups.nix
|
||||
./fail2ban.nix
|
||||
./nextcloud.nix
|
||||
# ./nextcloud.nix
|
||||
./uptime-kuma.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
|
||||
# ssh, https, nextcloud, uptime-kuma
|
||||
}
|
||||
|
|
|
@ -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
14
hosts/diva/hardware.nix
Normal 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
35
hosts/diva/networking.nix
Normal 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"
|
||||
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue