diff --git a/hive.nix b/hive.nix index 8628512..c7d2e03 100644 --- a/hive.nix +++ b/hive.nix @@ -143,6 +143,16 @@ in ]; }; + kat-son = + { name, nodes, ... }: + { + deployment.targetHost = "son.kat"; + imports = [ + ./machines/kat-son + (users.root { ssh = true; }) + ]; + }; + kat-iso = { name, diff --git a/machines/kat-r86s/configuration.nix b/machines/kat-r86s/configuration.nix index 4fca8af..c48d553 100644 --- a/machines/kat-r86s/configuration.nix +++ b/machines/kat-r86s/configuration.nix @@ -130,6 +130,10 @@ vm = "192.168.122.4"; sshport = null; }; + "son.katvayor.net" = { + vm = "192.168.122.5"; + sshport = null; + }; }; in { diff --git a/machines/kat-son/default.nix b/machines/kat-son/default.nix new file mode 100644 index 0000000..31ab59b --- /dev/null +++ b/machines/kat-son/default.nix @@ -0,0 +1,97 @@ +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ./disks.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.supportedFilesystems = [ "bcachefs" ]; + boot.kernelPackages = pkgs.linuxPackages_latest; + + time.timeZone = "Europe/Paris"; + + networking = { + interfaces."enp1s0" = { + useDHCP = false; + ipv4.addresses = [ + { + address = "192.168.122.5"; + prefixLength = 24; + } + ]; + ipv6.addresses = [ + { + address = "fe80::5"; + prefixLength = 64; + } + ]; + }; + defaultGateway = "192.168.122.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "enp1s0"; + }; + nameservers = [ + "192.168.122.1" + "fe80::1%enp1s0" + ]; + }; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "fr"; + }; + + services.dbus.packages = with pkgs; [ dconf ]; + + nixpkgs.config.allowUnfree = true; + + programs.zsh.enable = true; + + environment.systemPackages = with pkgs; [ + wget + nix-search-cli + git + btop + ranger + screen + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + services.openssh.enable = true; + + networking.firewall.enable = false; + + security.acme = { + acceptTerms = true; + defaults.email = "root@katvayor.net"; + }; + services.nginx = { + enable = true; + virtualHosts = { + "son.katvayor.net" = { + enableACME = true; + addSSL = true; + }; + }; + }; + + system.stateVersion = "23.11"; # Did you read the comment? +} diff --git a/machines/kat-son/disks.nix b/machines/kat-son/disks.nix new file mode 100644 index 0000000..ed9ef70 --- /dev/null +++ b/machines/kat-son/disks.nix @@ -0,0 +1,32 @@ +{ + disko.devices = { + disk = { + vda = { + device = "/dev/vda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + type = "EF00"; + size = "100M"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "bcachefs"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/machines/kat-son/hardware-configuration.nix b/machines/kat-son/hardware-configuration.nix new file mode 100644 index 0000000..e8da702 --- /dev/null +++ b/machines/kat-son/hardware-configuration.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + boot.initrd.availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/machines/kat-watcher/default.nix b/machines/kat-watcher/default.nix index 51b25c7..ec8b553 100644 --- a/machines/kat-watcher/default.nix +++ b/machines/kat-watcher/default.nix @@ -66,6 +66,7 @@ "traque.katvayor.net" = 22001; "betamail.katvayor.net" = 22002; "test.traque.katvayor.net" = null; + "son.katvayor.net" = null; }; in { diff --git a/modules/ssh.nix b/modules/ssh.nix index b9db095..c2155cb 100644 --- a/modules/ssh.nix +++ b/modules/ssh.nix @@ -37,6 +37,11 @@ hostname = "fe80::4%%virbr0"; proxyJump = "r86s.kat"; }; + "son.kat" = { + user = "root"; + hostname = "fe80::5%%virbr0"; + proxyJump = "r86s.kat"; + }; "sas.ens" = { user = "lbailly";