From a1d73748094e810947177cca4b5edafb0a6019d4 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 2 Feb 2022 18:11:17 +0700 Subject: [PATCH] hosts/{apricot,fondue}: decommission --- README.md | 18 ++++++++++++------ flake.nix | 2 -- hosts/apricot/default.nix | 32 -------------------------------- hosts/apricot/filesystem.nix | 29 ----------------------------- hosts/apricot/kernel.nix | 18 ------------------ hosts/apricot/networking.nix | 35 ----------------------------------- hosts/blossom/filesystem.nix | 12 ------------ hosts/fondue/default.nix | 32 -------------------------------- hosts/fondue/filesystem.nix | 28 ---------------------------- hosts/fondue/firewall.nix | 3 --- hosts/fondue/kernel.nix | 18 ------------------ hosts/fondue/networking.nix | 20 -------------------- 12 files changed, 12 insertions(+), 235 deletions(-) delete mode 100644 hosts/apricot/default.nix delete mode 100644 hosts/apricot/filesystem.nix delete mode 100644 hosts/apricot/kernel.nix delete mode 100644 hosts/apricot/networking.nix delete mode 100644 hosts/fondue/default.nix delete mode 100644 hosts/fondue/filesystem.nix delete mode 100644 hosts/fondue/firewall.nix delete mode 100644 hosts/fondue/kernel.nix delete mode 100644 hosts/fondue/networking.nix diff --git a/README.md b/README.md index 479faf9..c932782 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,18 @@ may or may not work on your machine if copied directly (but theoretically they s But if you insist, just copy-paste one of the hosts in `hosts/`, one of the users in `users/`, and modify them to your liking. Open up `flake.nix`, add your new host config at the bottom, and then build it! -## Host naming -| Name | Description | -| ------- | ----------- | -| apricot | Homeserver | -| blossom | Laptop and main PC | -| fondue | VM lent by [a friend](https://github.com/Aiamded) in Australia | +## Hosts +| Name | Description | +| ------- | ----------- | +| blossom | Laptop and main PC | +| caramel | Raspberry Pi 400, stateless | +| sugarcane | OVHCloud VPS, stateless | + +## Users +| Name | Description | +| ---- | ----------- | +| rin | Main user for usage | +| hana | Lightweight user intended for inspecting stateless hosts | ## License Licensed under CC0; basically you can fork, modify, redistribute, or do whatever you want I don't really care. diff --git a/flake.nix b/flake.nix index e68ea2d..a8804b4 100644 --- a/flake.nix +++ b/flake.nix @@ -81,9 +81,7 @@ }; in { - #nixosConfigurations."apricot" = mkSystem nixpkgs "apricot" "x86_64-linux" false; nixosConfigurations."blossom" = mkSystem nixpkgs "blossom" "x86_64-linux" true; - #nixosConfigurations."fondue" = mkSystem nixpkgs "fondue" "x86_64-linux" false; nixosConfigurations."caramel" = mkSystem nixpkgs-porcupine "caramel" "aarch64-linux" false; nixosConfigurations."sugarcane" = mkSystem nixpkgs-porcupine "sugarcane" "x86_64-linux" false; diff --git a/hosts/apricot/default.nix b/hosts/apricot/default.nix deleted file mode 100644 index 4b68e46..0000000 --- a/hosts/apricot/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, inputs, modules, overlays, pkgs, ... }: { - networking.hostName = "apricot"; - system.stateVersion = "21.05"; - time.timeZone = "Asia/Phnom_Penh"; - - age.secrets = { - passwd.file = ../../secrets/passwd.age; - wg_apricot.file = ../../secrets/wg_apricot.age; - wpa_conf.file = ../../secrets/wpa_conf.age; - }; - imports = with modules.system; [ - inputs.home-manager.nixosModule - home-manager - - base - input - kernel - nix - packages - security - snapper - transmission - wireguard - - ./filesystem.nix - ./kernel.nix - ./networking.nix - - ../../users/rin - ]; -} - diff --git a/hosts/apricot/filesystem.nix b/hosts/apricot/filesystem.nix deleted file mode 100644 index 6c44ae6..0000000 --- a/hosts/apricot/filesystem.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, ... }: -let - mkMount = uuid: type: { - device = "/dev/disk/by-uuid/${uuid}"; - fsType = type; - options = [ "defaults" "relatime" ]; - }; - mkBtrfsMount = subvolid: atime: mkMount "c79ebe18-2d2b-4f0f-9940-afd9378afa09" "btrfs" // { - options = [ "autodefrag" "compress=zstd:3" "defaults" "nossd" "nossd_spread" "subvolid=${builtins.toString subvolid}" (if atime then "relatime" else "noatime")]; - }; -in -{ - fileSystems = { - "/" = { - device = "rootfs"; - fsType = "tmpfs"; - options = [ "defaults" "size=4G" "mode=755" ]; - }; - "/boot" = mkMount "2818-A529" "vfat"; - "/mnt/hdd" = mkMount "436ad832-8dcc-4813-b663-4d0b7b773ff2" "ext4"; - - "/mnt/butter" = mkBtrfsMount 5 true; - "/nix" = mkBtrfsMount 258 false; - "/home" = mkBtrfsMount 260 true; - "/home/.snapshots" = mkBtrfsMount 263 false; - "/root" = mkBtrfsMount 261 false; - "/var" = mkBtrfsMount 259 false; - }; -} diff --git a/hosts/apricot/kernel.nix b/hosts/apricot/kernel.nix deleted file mode 100644 index 7e7ff0d..0000000 --- a/hosts/apricot/kernel.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, ... }: { - boot = { - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - }; - }; - initrd.kernelModules = [ "i915" ]; - kernelParams = [ - "intel_pstate=passive" - ]; - kernelPackages = pkgs.linuxPackages_latest; - }; -} diff --git a/hosts/apricot/networking.nix b/hosts/apricot/networking.nix deleted file mode 100644 index f1a2f9f..0000000 --- a/hosts/apricot/networking.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, ... }: { - environment.etc."wpa_supplicant.conf".source = config.age.secrets.wpa_conf.path; - networking = { - wireless = { - enable = true; - interfaces = [ "wlp1s0" ]; - }; - - useDHCP = false; - interfaces.enp2s0.useDHCP = false; - interfaces.wlp1s0.useDHCP = false; - - interfaces.enp2s0.ipv4.addresses = [{ - address = "10.0.0.1"; - prefixLength = 24; - }]; - interfaces.wlp1s0.ipv4.addresses = [{ - address = "192.168.100.14"; - prefixLength = 24; - }]; - defaultGateway = "192.168.100.1"; - nameservers = [ "8.8.8.8" ]; - - extraHosts = '' - 192.168.100.10 strawberry - 192.168.100.11 peach - 192.168.100.12 butterfly - 192.168.100.13 winter - 192.168.100.13 blossom - 192.168.100.14 apricot - - 10.100.0.1 fondue - ''; - }; -} diff --git a/hosts/blossom/filesystem.nix b/hosts/blossom/filesystem.nix index c971324..890b7fd 100644 --- a/hosts/blossom/filesystem.nix +++ b/hosts/blossom/filesystem.nix @@ -34,17 +34,5 @@ in # fsType = "nfs"; # options = [ "defaults" ]; # }; - "/mnt/apricot" = { - device = "rin@apricot:/"; - fsType = "fuse.sshfs"; - options = [ - "noauto" - "x-systemd.automount" - "_netdev" - "IdentityFile=/home/rin/.ssh/id_rsa" - "allow_other" - "reconnect" - ]; - }; }; } diff --git a/hosts/fondue/default.nix b/hosts/fondue/default.nix deleted file mode 100644 index e19089d..0000000 --- a/hosts/fondue/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, inputs, modules, modulesPath, overlays, pkgs, ... }: { - networking.hostName = "fondue"; - system.stateVersion = "21.05"; - time.timeZone = "Australia/Melbourne"; - - age.secrets = { - passwd.file = ../../secrets/passwd.age; - wg_fondue.file = ../../secrets/wg_fondue.age; - }; - imports = with modules.system; [ - (modulesPath + "/profiles/qemu-guest.nix") - inputs.home-manager.nixosModule - home-manager - - base - input - kernel - nix - packages - security - snapper - wireguard - - ./filesystem.nix - ./firewall.nix - ./kernel.nix - ./networking.nix - - ../../users/rin - ]; -} - diff --git a/hosts/fondue/filesystem.nix b/hosts/fondue/filesystem.nix deleted file mode 100644 index 8dba16d..0000000 --- a/hosts/fondue/filesystem.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, ... }: -let - mkMount = uuid: type: { - device = "/dev/disk/by-uuid/${uuid}"; - fsType = type; - options = [ "defaults" "relatime" ]; - }; - mkBtrfsMount = subvolid: atime: mkMount "8253d2ea-0813-4f71-9968-553965f0054b" "btrfs" // { - options = [ "autodefrag" "compress=zstd:3" "defaults" "ssd" "ssd_spread" "subvolid=${builtins.toString subvolid}" (if atime then "relatime" else "noatime")]; - }; -in -{ - fileSystems = { - "/" = { - device = "rootfs"; - fsType = "tmpfs"; - options = [ "defaults" "size=2G" "mode=755" ]; - }; - "/boot" = mkMount "0F35-9054" "vfat"; - - "/mnt/butter" = mkBtrfsMount 5 true; - "/nix" = mkBtrfsMount 258 false; - "/home" = mkBtrfsMount 260 true; - "/home/.snapshots" = mkBtrfsMount 262 false; - "/root" = mkBtrfsMount 261 false; - "/var" = mkBtrfsMount 259 false; - }; -} diff --git a/hosts/fondue/firewall.nix b/hosts/fondue/firewall.nix deleted file mode 100644 index 8c96e41..0000000 --- a/hosts/fondue/firewall.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ ... }: { - networking.firewall.allowedTCPPorts = [ 22 80 ]; -} diff --git a/hosts/fondue/kernel.nix b/hosts/fondue/kernel.nix deleted file mode 100644 index 780ace8..0000000 --- a/hosts/fondue/kernel.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, ... }: { - boot = { - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - }; - }; - initrd = { - availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ]; - kernelModules = [ "kvm-amd" ]; - }; - kernelPackages = pkgs.linuxPackages_latest; - }; -} diff --git a/hosts/fondue/networking.nix b/hosts/fondue/networking.nix deleted file mode 100644 index 4a574cb..0000000 --- a/hosts/fondue/networking.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, ... }: { - networking = { - useDHCP = false; - interfaces.enp2s1.useDHCP = false; - - interfaces.enp2s1.ipv4.addresses = [{ - address = "192.168.100.101"; - prefixLength = 24; - }]; - defaultGateway = "192.168.100.1"; - nameservers = [ "8.8.8.8" ]; - - extraHosts = '' - 10.100.0.2 apricot - 10.100.0.3 winter - 10.100.0.3 blossom - 10.100.0.4 strawberry - ''; - }; -}