From 9046a92e89ca8a9251b918b1b5f788f89c0883c2 Mon Sep 17 00:00:00 2001 From: Jimbo Date: Sun, 20 Oct 2024 04:25:07 -0400 Subject: [PATCH] Add initial support for 'bomberman', my Oracle VM --- flake.nix | 10 +++- hosts/bomberman/home/default.nix | 18 +++++++ hosts/bomberman/id_ed25519.pub | 1 + hosts/bomberman/system/default.nix | 24 +++++++++ hosts/bomberman/system/hardware/default.nix | 56 +++++++++++++++++++++ 5 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 hosts/bomberman/home/default.nix create mode 100644 hosts/bomberman/id_ed25519.pub create mode 100644 hosts/bomberman/system/default.nix create mode 100644 hosts/bomberman/system/hardware/default.nix diff --git a/flake.nix b/flake.nix index a4a5f4d..647e05f 100644 --- a/flake.nix +++ b/flake.nix @@ -35,18 +35,24 @@ in { # nixos-rebuild switch --flake .#hostname nixosConfigurations = { + # PCs and Laptops firefly = mkNixos [ ./hosts/firefly/system ]; - cyberspark = mkNixos [ ./hosts/cyberspark/system ]; shuttleworth = mkNixos [ ./hosts/shuttleworth/system ]; lacros = mkNixos [ ./hosts/lacros/system ]; + + # Servers + cyberspark = mkNixos [ ./hosts/cyberspark/system ]; + bomberman = mkNixos [ ./hosts/bomberman/system ]; }; # home-manager switch --flake .#username@hostname homeConfigurations = { "jimbo@firefly" = mkHome [ ./hosts/firefly/home ] nixpkgs.legacyPackages.x86_64-linux; - "jimbo@cyberspark" = mkHome [ ./hosts/cyberspark/home ] nixpkgs.legacyPackages.x86_64-linux; "jimbo@shuttleworth" = mkHome [ ./hosts/shuttleworth/home ] nixpkgs.legacyPackages.aarch64-linux; "jimbo@lacros" = mkHome [ ./hosts/lacros/home ] nixpkgs.legacyPackages.x86_64-linux; + + "jimbo@cyberspark" = mkHome [ ./hosts/cyberspark/home ] nixpkgs.legacyPackages.x86_64-linux; + "jimbo@bomberman" = mkHome [ ./hosts/bomberman/home ] nixpkgs.legacyPackages.aarch64-linux; }; }; } diff --git a/hosts/bomberman/home/default.nix b/hosts/bomberman/home/default.nix new file mode 100644 index 0000000..6afa91a --- /dev/null +++ b/hosts/bomberman/home/default.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + imports = [ + # Programs and apps + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/programs/misc/headless + ../../../modules/home/programs/terminal/fastfetch + ../../../modules/home/programs/terminal/git + ../../../modules/home/programs/terminal/neovim + ../../../modules/home/programs/terminal/ranger + ../../../modules/home/programs/terminal/tmux + ../../../modules/home/utils/zsh + + # Misc + ../../../variables/look/colors/purple + ]; +} diff --git a/hosts/bomberman/id_ed25519.pub b/hosts/bomberman/id_ed25519.pub new file mode 100644 index 0000000..1c06662 --- /dev/null +++ b/hosts/bomberman/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKC8Uqxb09V3msBgDv6lD/nETMYr/X0OgtpDo8ldcMK diff --git a/hosts/bomberman/system/default.nix b/hosts/bomberman/system/default.nix new file mode 100644 index 0000000..e22e0b6 --- /dev/null +++ b/hosts/bomberman/system/default.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + imports = [ + ./hardware + + # Apps and programs + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/devices/filesystems + ../../../modules/system/devices/boot/systemd + ../../../modules/system/devices/networking + ../../../modules/system/devices/networking/firewall/pc + #../../../modules/system/devices/networking/wireguard/pc + ../../../modules/system/programs/git + ../../../modules/system/programs/security + ../../../modules/system/services/common + + # Misc + ../../../overlays + ../../../variables + ]; + + networking.hostName = "bomberman"; +} diff --git a/hosts/bomberman/system/hardware/default.nix b/hosts/bomberman/system/hardware/default.nix new file mode 100644 index 0000000..9bfa067 --- /dev/null +++ b/hosts/bomberman/system/hardware/default.nix @@ -0,0 +1,56 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd = { + availableKernelModules = [ + "xhci_pci" + "virtio_scsi" + ]; + kernelModules = [ + "dm-snapshot" + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/7C94-8C9A"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + "/home" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@home" ]; + }; + "/nix" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@nix" ]; + }; + "/var" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@var" ]; + }; + "/.snapshots" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@snapshots" ]; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/7e8c773d-c8f4-4dd8-a835-bde78e5b6760"; } + ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +}