diff --git a/flake.nix b/flake.nix index 94e40f8..8ef310a 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,15 @@ path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.loki; }; }; + + baldur = { + hostname = "baldur"; + profiles.system = { + sshUser = "root"; + user = "root"; + path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.baldur; + }; + }; }; nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { @@ -141,6 +150,17 @@ ]; }; + baldur = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = [ + disko.nixosModules.disko + agenix.nixosModules.default + ./hosts/baldur/configuration.nix + ./modules/servers/general + ./modules/servers/baldur + ]; + }; + nixos = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; modules = [ diff --git a/hosts/baldur/configuration.nix b/hosts/baldur/configuration.nix new file mode 100644 index 0000000..c89c1a3 --- /dev/null +++ b/hosts/baldur/configuration.nix @@ -0,0 +1,27 @@ +{ + modulesPath, + lib, + pkgs, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + (modulesPath + "/profiles/qemu-guest.nix") + ./disk-config.nix + ]; + + networking.hostName = "baldur"; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + }; + + environment.systemPackages = map lib.lowPrio [ + pkgs.curl + pkgs.neovim + pkgs.gitMinimal + ]; + + system.stateVersion = "24.05"; +} diff --git a/hosts/baldur/disk-config.nix b/hosts/baldur/disk-config.nix new file mode 100644 index 0000000..8f36ed4 --- /dev/null +++ b/hosts/baldur/disk-config.nix @@ -0,0 +1,54 @@ +{lib, ...}: { + disko.devices = { + disk.disk1 = { + device = lib.mkDefault "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + esp = { + name = "ESP"; + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + name = "root"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + }; + }; + }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 9aeaa29..f93b0c5 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -25,6 +25,9 @@ # Enable flakes nix.settings.experimental-features = ["nix-command" "flakes"]; + # Enable trusted users + nix.trustedUsers = ["root" "@wheel"]; + # Setup gpu hardware.graphics = { enable = true; diff --git a/modules/servers/baldur/default.nix b/modules/servers/baldur/default.nix new file mode 100644 index 0000000..6462967 --- /dev/null +++ b/modules/servers/baldur/default.nix @@ -0,0 +1 @@ +{...}: {} diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 16ceaf6..c7811ad 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -2,6 +2,7 @@ let # SYSTEMS heimdall = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBs+qYjpeAEHPFUQeatNkhKbXz8+A1VAl21jgifDYJK8"; loki = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF+xpWCoBEO/pzAwS1ZZEsiLSarvSVkdxQEo49xma2PV"; + baldur = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOvZ7Z8GS4+1+9D6u/BDit4Eij5Ubbii2dzJ/+ecT8iR"; # USERS root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBJLduAXHWJiglmfRfkBGKffzVWkJP6porxIzw6+Zz3W crony@cronyakatsuki.xyz"; @@ -9,7 +10,7 @@ let users = [ root ]; - systems = [heimdall loki]; + systems = [heimdall loki baldur]; in { "traefik.age".publicKeys = systems ++ users; "wg-heimdall.age".publicKeys = systems ++ users; diff --git a/secrets/traefik.age b/secrets/traefik.age index adffe36..92a86c2 100644 Binary files a/secrets/traefik.age and b/secrets/traefik.age differ diff --git a/secrets/wg-desktop.age b/secrets/wg-desktop.age index a1cadec..5d2e451 100644 Binary files a/secrets/wg-desktop.age and b/secrets/wg-desktop.age differ diff --git a/secrets/wg-heimdall.age b/secrets/wg-heimdall.age index 3af4512..1d48447 100644 Binary files a/secrets/wg-heimdall.age and b/secrets/wg-heimdall.age differ