From d9ab6c7ea59d29af3ae8c29c7367fe0e8808f5db Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 25 Dec 2024 18:25:51 +0100 Subject: refactor(hosts): Use a `by-name` structure and construct all host depended values This allows us to outsource the host-handling from the `flake.nix` file. --- hosts/by-name/server1/configuration.nix | 46 +++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 hosts/by-name/server1/configuration.nix (limited to 'hosts/by-name/server1/configuration.nix') diff --git a/hosts/by-name/server1/configuration.nix b/hosts/by-name/server1/configuration.nix new file mode 100644 index 0000000..6bb1067 --- /dev/null +++ b/hosts/by-name/server1/configuration.nix @@ -0,0 +1,46 @@ +{config, ...}: { + imports = [ + ./networking.nix # network configuration that just works + ./hardware.nix + + ../../../system + ]; + + vhack = { + back = { + enable = true; + repositories = { + "${config.services.gitolite.dataDir}/vhack.eu/nixos-config.git" = { + domain = "issues.vhack.eu"; + port = 9220; + }; + }; + }; + etesync.enable = true; + git-server.enable = true; + nginx.enable = true; + nix-sync.enable = true; + openssh.enable = true; + peertube.enable = true; + postgresql.enable = true; + redlib.enable = true; + users.enable = true; + persist = { + enable = true; + directories = [ + "/var/log" + + # TODO(@bpeetz): Instead of persisting that, encode each uid/gid directly in the + # config. <2024-12-24> + "/var/lib/nixos" + ]; + }; + }; + + boot.tmp.cleanOnBoot = true; + zramSwap.enable = true; + networking.hostName = "server1"; + networking.domain = "vhack.eu"; + + system.stateVersion = "22.11"; +} -- cgit 1.4.1