flake

Francesco Saccone's Nix flake.
git clone git://git.francescosaccone.com/flake
Log | Files | Refs | README | LICENSE

commit dd5f868078b46d0bc95b99247b7e854c6f88799f
parent d625f0754f9c7f53c0a6fa7acacbf0b94db13dae
Author: Francesco Saccone <francesco@francescosaccone.com>
Date:   Thu, 27 Mar 2025 15:37:53 +0100

feat: add git-server host

This will be the configuration of the Git server.

Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>

Diffstat:
Mflake.nix | 5+++++
Ahosts/git-server/default.nix | 28++++++++++++++++++++++++++++
Ahosts/git-server/disk-config.nix | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 92 insertions(+), 0 deletions(-)

diff --git a/flake.nix b/flake.nix @@ -96,6 +96,11 @@ "laptop" = lib.makeHost "laptop" { additionalModules = lib.makeHomeModules "francesco"; }; + "git-server" = lib.makeHost "git-server" { + additionalModules = [ + inputs.disko.nixosModules.disko + ]; + }; "server" = lib.makeHost "server" { additionalModules = [ inputs.disko.nixosModules.disko diff --git a/hosts/git-server/default.nix b/hosts/git-server/default.nix @@ -0,0 +1,28 @@ +{ + config, + ... +}: +{ + imports = [ + ./disk-config.nix + ]; + + modules = { + openssh.listen = { + enable = true; + port = 22; + authorizedKeyFiles = rec { + root = [ + ../server/ssh/francescosaccone.pub + ]; + }; + }; + }; + + networking.domain = "git.francescosaccone.com"; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + }; +} diff --git a/hosts/git-server/disk-config.nix b/hosts/git-server/disk-config.nix @@ -0,0 +1,59 @@ +{ + config, + 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" + ]; + }; + }; + }; + }; + }; + }; +}