diff --git a/hosts/diva/configuration.nix b/hosts/diva/configuration.nix index 4d1235d..30f3426 100644 --- a/hosts/diva/configuration.nix +++ b/hosts/diva/configuration.nix @@ -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" + ]; + }; } diff --git a/hosts/diva/features/backups.nix b/hosts/diva/features/backups.nix index 101c0e6..d965d5d 100644 --- a/hosts/diva/features/backups.nix +++ b/hosts/diva/features/backups.nix @@ -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"; + }; + }; } diff --git a/hosts/diva/features/default.nix b/hosts/diva/features/default.nix index 398d8f8..77eac92 100644 --- a/hosts/diva/features/default.nix +++ b/hosts/diva/features/default.nix @@ -3,7 +3,7 @@ imports = [ ./backups.nix ./fail2ban.nix - ./nextcloud.nix + # ./nextcloud.nix ./uptime-kuma.nix ]; } diff --git a/hosts/diva/features/fail2ban.nix b/hosts/diva/features/fail2ban.nix index 367633f..19ba039 100644 --- a/hosts/diva/features/fail2ban.nix +++ b/hosts/diva/features/fail2ban.nix @@ -1,4 +1,4 @@ { config, ... }: { - + # ssh, https, nextcloud, uptime-kuma } diff --git a/hosts/diva/features/uptime-kuma.nix b/hosts/diva/features/uptime-kuma.nix index c3726d6..a029a66 100644 --- a/hosts/diva/features/uptime-kuma.nix +++ b/hosts/diva/features/uptime-kuma.nix @@ -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 ''; } diff --git a/hosts/diva/hardware.nix b/hosts/diva/hardware.nix new file mode 100644 index 0000000..871796c --- /dev/null +++ b/hosts/diva/hardware.nix @@ -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"; }; + +} diff --git a/hosts/diva/networking.nix b/hosts/diva/networking.nix new file mode 100644 index 0000000..b745b77 --- /dev/null +++ b/hosts/diva/networking.nix @@ -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" + + ''; +} diff --git a/packages/4get.nix b/packages/4get.nix index 9a167d3..62e2130 100644 --- a/packages/4get.nix +++ b/packages/4get.nix @@ -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 + ]; }