From 27ff8f4b33bf182b2daf7da327fe64094a94e36e Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Sun, 9 Apr 2023 00:14:00 +0200 Subject: [PATCH] feat: newton depreciation --- machines/newton/default.nix | 66 ------------------------------- machines/newton/hardware.nix | 70 --------------------------------- machines/newton/home-julien.nix | 31 --------------- 3 files changed, 167 deletions(-) delete mode 100644 machines/newton/default.nix delete mode 100644 machines/newton/hardware.nix delete mode 100644 machines/newton/home-julien.nix diff --git a/machines/newton/default.nix b/machines/newton/default.nix deleted file mode 100644 index 098ca8f..0000000 --- a/machines/newton/default.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ config, pkgs, lib, modulesPath, ... }: -let - hostName = "newton"; -in -{ - - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ./hardware.nix - ./home-julien.nix - ../../users/julien.nix - ../../users/default.nix - ]; - - luj = { - filerun = { - enable = true; - subdomain = "cloud"; - }; - paperless = { - enable = true; - nginx.enable = true; - nginx.subdomain = "papers"; - }; - zfs-mails.enable = true; - zfs-mails.name = hostName; - zfs-mails.smart.enable = true; - }; - - networking.hostName = hostName; - networking.hostId = "f7cdfbc9"; - networking.interfaces.enp2s0f0.useDHCP = true; - networking.interfaces.enp2s0f1.useDHCP = true; - - services.fail2ban.enable = true; - - services.zfs.autoSnapshot.enable = true; - services.zfs.autoScrub.enable = true; - - environment.systemPackages = [ pkgs.tailscale ]; - - # enable the tailscale service - services.tailscale.enable = true; - networking.nameservers = [ "100.127.245.71" "9.9.9.9" ]; - environment.etc."resolv.conf" = with lib; with pkgs; { - source = writeText "resolv.conf" '' - ${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)} - options edns0 - ''; - }; - - services.openssh.extraConfig = '' - HostCertificate /etc/ssh/ssh_host_ed25519_key-cert.pub - HostKey /etc/ssh/ssh_host_ed25519_key - TrustedUserCAKeys /etc/ssh/ssh_user_key.pub - MaxAuthTries 20 - ''; - - - - system.stateVersion = "21.05"; - - - -} diff --git a/machines/newton/hardware.nix b/machines/newton/hardware.nix deleted file mode 100644 index df59b8a..0000000 --- a/machines/newton/hardware.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ pkgs, config, lib, ... }: -{ - boot.loader.grub.enable = true; - boot.loader.grub.version = 2; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.requestEncryptionCredentials = true; - boot.loader.grub.copyKernels = true; - boot.loader.grub.efiSupport = false; - boot.kernelPackages = pkgs.linuxPackages_5_15; - - boot.loader.grub.mirroredBoots = [ - { path = "/boot-1"; devices = [ "/dev/disk/by-id/ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M1TVUVJV" ]; } - { path = "/boot-2"; devices = [ "/dev/disk/by-id/ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M7UDRLSK" ]; } - ]; - boot.initrd.network = { - enable = true; - ssh = { - enable = true; - port = 2222; - hostKeys = [ /boot-1/initrd-ssh-key /boot-2/initrd-ssh-key ]; - authorizedKeys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9Uzb7szWlux7HuxLZej9cBR5MhLz/vaAPPfSoozt2k" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDCKfPoMNrnyNWH6J1OvQ+n1rvSS9Sc2iZf6E1JQC+L4" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIESMWr29i3rhj32oLV3DKe57YI+jvNaKjZhhpq6dEjsn" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJOCKgHRHAJDSgKqYNfWboL04mnEOM0m0K3TGxBhBNDR" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOpGHx430EpJmbtJc8+lF1CpQ1gXeHT9OeZ08O8yzohF" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEaCGndojnmS5IoqHVMEPRfKuBZotMyqo7wNkAZJWigp" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINqqbb91oMRg0L5kcljMhuKi4l2TjE/JKJQwcFVahDJH" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILxfFq8wx5Bet5Q0gI28/lc9ryYYFQelpZdPPdzxGBbA" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGa+7n7kNzb86pTqaMn554KiPrkHRGeTJ0asY1NjSbpr" - ]; - }; - postCommands = '' - zpool import zroot - echo "zfs load-key -a; killall zfs" >> /root/.profile - ''; - }; - - - boot.initrd.availableKernelModules = [ "tg3" "xhci_pci" "ahci" "ehci_pci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { - device = "zroot/root"; - fsType = "zfs"; - options = [ "nofail" ]; - }; - - fileSystems."/boot-1" = - { - device = "/dev/disk/by-uuid/15AF-22DB"; - fsType = "vfat"; - options = [ "nofail" ]; - }; - - fileSystems."/boot-2" = - { - device = "/dev/disk/by-uuid/15EC-BC00"; - fsType = "vfat"; - options = [ "nofail" ]; - }; - - swapDevices = [ ]; - - - -} diff --git a/machines/newton/home-julien.nix b/machines/newton/home-julien.nix deleted file mode 100644 index 40c1366..0000000 --- a/machines/newton/home-julien.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, config, lib, ... }: -{ - - sops.secrets.ssh-newton-pub = { - owner = "julien"; - path = "/home/julien/.ssh/id_ed25519.pub"; - mode = "0644"; - format = "binary"; - sopsFile = ../../secrets/ssh-newton-pub; - }; - - sops.secrets.ssh-newton-priv = { - owner = "julien"; - path = "/home/julien/.ssh/id_ed25519"; - mode = "0600"; - format = "binary"; - sopsFile = ../../secrets/ssh-newton-priv; - }; - - - - luj.hmgr.julien = { - luj.programs.neovim.enable = true; - luj.programs.git.enable = true; - luj.programs.ssh-client.enable = true; - luj.emails = { - enable = true; - backend.enable = true; - }; - }; -}