diff --git a/flake.nix b/flake.nix index 9c0cd67..5afee07 100644 --- a/flake.nix +++ b/flake.nix @@ -132,6 +132,15 @@ path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.thor; }; }; + + odin = { + hostname = "odin"; + profiles.system = { + sshUser = "root"; + user = "root"; + path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.odin; + }; + }; }; nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { @@ -201,6 +210,17 @@ ]; }; + odin = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = [ + disko.nixosModules.disko + agenix.nixosModules.default + ./hosts/odin/configuration.nix + ./modules/servers/general + ./modules/servers/odin + ]; + }; + nixos = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; modules = [ diff --git a/hosts/odin/configuration.nix b/hosts/odin/configuration.nix new file mode 100644 index 0000000..f486088 --- /dev/null +++ b/hosts/odin/configuration.nix @@ -0,0 +1,41 @@ +{ + modulesPath, + lib, + pkgs, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + (modulesPath + "/profiles/qemu-guest.nix") + ./disk-config.nix + ]; + + networking.hostName = "odin"; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + }; + + environment.systemPackages = map lib.lowPrio [ + pkgs.curl + pkgs.neovim + pkgs.gitMinimal + ]; + + networking.useNetworkd = true; + systemd.network.enable = true; + systemd.network.networks."10-wan" = { + matchConfig.Name = "enp1s0"; # either ens3 or enp1s0 depending on system, check 'ip addr' + networkConfig.DHCP = "ipv4"; + address = [ + # replace this address with the one assigned to your instance + "2a01:4f9:c012:f6df::1/64" + ]; + routes = [ + {Gateway = "fe80::1";} + ]; + }; + + system.stateVersion = "24.05"; +} diff --git a/hosts/odin/disk-config.nix b/hosts/odin/disk-config.nix new file mode 100644 index 0000000..8f36ed4 --- /dev/null +++ b/hosts/odin/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/modules/servers/odin/default.nix b/modules/servers/odin/default.nix new file mode 100644 index 0000000..ea8f50d --- /dev/null +++ b/modules/servers/odin/default.nix @@ -0,0 +1,2 @@ +{...}: { +} diff --git a/secrets/forgejo-db.age b/secrets/forgejo-db.age index 5e5a3bc..0ef4a69 100644 Binary files a/secrets/forgejo-db.age and b/secrets/forgejo-db.age differ diff --git a/secrets/navidrome.age b/secrets/navidrome.age index 723c0ae..fd909a1 100644 Binary files a/secrets/navidrome.age and b/secrets/navidrome.age differ diff --git a/secrets/plausible.age b/secrets/plausible.age index eee1c05..35e9665 100644 Binary files a/secrets/plausible.age and b/secrets/plausible.age differ diff --git a/secrets/rclone.age b/secrets/rclone.age index 62ae867..ce532ab 100644 Binary files a/secrets/rclone.age and b/secrets/rclone.age differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 51f4a65..55eff04 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -5,6 +5,7 @@ let baldur = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOvZ7Z8GS4+1+9D6u/BDit4Eij5Ubbii2dzJ/+ecT8iR"; bragi = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBKMV2vqlDvIkUefl5oEuVjVtjgFLEXyDKX2LWhVQsWT"; thor = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHZGQLUhyLwmkTYhSccqO8umQJN0QHk6YaD863x7lcGv"; + odin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBGfwv4CzZlPGsBukfoq5wBTlVfWJo7UHH7DP3ILP6/Z"; # USERS root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBJLduAXHWJiglmfRfkBGKffzVWkJP6porxIzw6+Zz3W crony@cronyakatsuki.xyz"; @@ -12,7 +13,7 @@ let users = [ root ]; - systems = [heimdall loki baldur bragi thor]; + systems = [heimdall loki baldur bragi thor odin]; in { "traefik.age".publicKeys = systems ++ users; "wg-heimdall.age".publicKeys = systems ++ users; diff --git a/secrets/traefik.age b/secrets/traefik.age index 9b740bb..630babf 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 a415364..6e6ac16 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 f9e195e..1bfc423 100644 Binary files a/secrets/wg-heimdall.age and b/secrets/wg-heimdall.age differ