From ada5f338f290b2e8d929f341ff163f36639e9fe2 Mon Sep 17 00:00:00 2001 From: Lander Van den Bulcke Date: Tue, 9 Sep 2025 22:34:34 +0200 Subject: [PATCH] feat: add base hosting-02 Signed-off-by: Lander Van den Bulcke --- flake.nix | 7 +++++ hosts/hosting-02/default.nix | 27 +++++++++++++++++ hosts/hosting-02/disk-config.nix | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 hosts/hosting-02/default.nix create mode 100644 hosts/hosting-02/disk-config.nix diff --git a/flake.nix b/flake.nix index 3984512..e2cc3e1 100644 --- a/flake.nix +++ b/flake.nix @@ -98,6 +98,13 @@ ./hosts/hosting-01 ]; }; + hosting-02 = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + specialArgs = { inherit inputs outputs; }; + modules = [ + ./hosts/hosting-02 + ]; + }; mail-01 = nixpkgs.lib.nixosSystem { system = "aarch64-linux"; specialArgs = { inherit inputs outputs; }; diff --git a/hosts/hosting-02/default.nix b/hosts/hosting-02/default.nix new file mode 100644 index 0000000..980679b --- /dev/null +++ b/hosts/hosting-02/default.nix @@ -0,0 +1,27 @@ +{ ... }: +{ + imports = [ + ./disk-config.nix + { + _module.args.disks = [ "/dev/sda" ]; + } + + ../common/servers + ]; + + time.timeZone = "Europe/Berlin"; + + networking.hostName = "hosting-02"; + networking.firewall = { + enable = true; + allowedTCPPorts = [ + 80 + 443 + ]; + }; + + security.acme.defaults.email = "landervandenbulcke@gmail.com"; + security.acme.acceptTerms = true; + + system.stateVersion = "25.05"; +} diff --git a/hosts/hosting-02/disk-config.nix b/hosts/hosting-02/disk-config.nix new file mode 100644 index 0000000..aa2e1fa --- /dev/null +++ b/hosts/hosting-02/disk-config.nix @@ -0,0 +1,52 @@ +{ + lib, + disks ? [ "/dev/sda" ], + ... +}: +{ + disko.devices = { + disk = lib.genAttrs disks (disk: { + device = disk; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + name = "boot"; + size = "256M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + main = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # override existing partition + subvolumes = { + "/" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/"; + }; + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + }; + }; + }; + }; + }; + }); + }; +}