From aa6694e9ff82c9c51e5c681209bf8a987ca61e96 Mon Sep 17 00:00:00 2001 From: Lander Van den Bulcke Date: Wed, 2 Jul 2025 00:00:26 +0200 Subject: [PATCH] feat: add base hosting-01 Signed-off-by: Lander Van den Bulcke --- flake.nix | 7 +++++ hosts/hosting-01/default.nix | 21 +++++++++++++ hosts/hosting-01/disk-config.nix | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 hosts/hosting-01/default.nix create mode 100644 hosts/hosting-01/disk-config.nix diff --git a/flake.nix b/flake.nix index 39602f4..58becf3 100644 --- a/flake.nix +++ b/flake.nix @@ -60,6 +60,13 @@ }; # servers + hosting-01 = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + specialArgs = { inherit inputs outputs; }; + modules = [ + ./hosts/hosting-01 + ]; + }; mail-01 = nixpkgs.lib.nixosSystem { system = "aarch64-linux"; specialArgs = { inherit inputs outputs; }; diff --git a/hosts/hosting-01/default.nix b/hosts/hosting-01/default.nix new file mode 100644 index 0000000..8fc26e3 --- /dev/null +++ b/hosts/hosting-01/default.nix @@ -0,0 +1,21 @@ +{ ... }: +{ + imports = [ + ./disk-config.nix + { + _module.args.disks = [ "/dev/sda" ]; + } + + ../common/servers + ]; + + time.timeZone = "Europe/Berlin"; + + networking.hostName = "hosting-01"; + networking.nameservers = [ "8.8.8.8" ]; + + security.acme.defaults.email = "landervandenbulcke@gmail.com"; + security.acme.acceptTerms = true; + + system.stateVersion = "25.05"; +} diff --git a/hosts/hosting-01/disk-config.nix b/hosts/hosting-01/disk-config.nix new file mode 100644 index 0000000..aa2e1fa --- /dev/null +++ b/hosts/hosting-01/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"; + }; + }; + }; + }; + }; + }; + }); + }; +}