feat(machines): add sanji
This commit is contained in:
parent
c7c35e2773
commit
4176ee3f56
3 changed files with 133 additions and 0 deletions
83
config/sanji/configuration.nix
Normal file
83
config/sanji/configuration.nix
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../modules/nixin-base.nix
|
||||||
|
../modules/wireguard-client.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
"net.ipv4.ip_forward" = 1;
|
||||||
|
"net.ipv6.conf.all.forwarding" = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixin.wg.client = {
|
||||||
|
ipv4 = "192.168.12.5/32";
|
||||||
|
ipv6 = "2a01:4f9:1a:9a05::5/128";
|
||||||
|
allowedIPs = [
|
||||||
|
"192.168.12.0/24"
|
||||||
|
"2a01:4f9:1a:9a05::/64"
|
||||||
|
];
|
||||||
|
endpoint = "vpn.lab12.fr:51812";
|
||||||
|
endpointKey = "cUmp55I20JEhxr+RMmOsX+6U9kcDiAq3grnvzjQ642w=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
neovim
|
||||||
|
magic-wormhole
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
ports = [ 4222 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostName = "sanji";
|
||||||
|
firewall.enable = false;
|
||||||
|
firewall.allowedUDPPortRanges = [
|
||||||
|
{
|
||||||
|
from = 60000;
|
||||||
|
to = 61000;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
nat = {
|
||||||
|
enable = true;
|
||||||
|
internalIPs = [ "10.10.5.0/24" ];
|
||||||
|
externalInterface = "enp0s31f6";
|
||||||
|
};
|
||||||
|
bridges = {
|
||||||
|
"br0" = {
|
||||||
|
interfaces = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
interfaces = {
|
||||||
|
enp0s31f6 = {
|
||||||
|
useDHCP = true;
|
||||||
|
};
|
||||||
|
# interface for containers virtual network
|
||||||
|
br0 = {
|
||||||
|
useDHCP = false;
|
||||||
|
ipv4.addresses = [
|
||||||
|
{
|
||||||
|
address = "10.10.5.1";
|
||||||
|
prefixLength = 24;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
system.copySystemConfiguration = true;
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
}
|
40
config/sanji/hardware-configuration.nix
Normal file
40
config/sanji/hardware-configuration.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "uas" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/e163e5d3-5488-4ed5-9eed-40f2dc758823";
|
||||||
|
fsType = "btrfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/8A69-72B3";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices =
|
||||||
|
[ { device = "/dev/disk/by-uuid/60230e2b-6284-43d5-af39-67978001a938"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
10
krops.nix
10
krops.nix
|
@ -49,6 +49,14 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sanji = pkgs.krops.writeDeploy "deploy-server-sanji" {
|
||||||
|
source = source "sanji";
|
||||||
|
target = lib.mkTarget "mrflos@192.168.12.5" // {
|
||||||
|
port = "4222";
|
||||||
|
sudo = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
dromadaire = pkgs.krops.writeDeploy "deploy-server-dromadaire" {
|
dromadaire = pkgs.krops.writeDeploy "deploy-server-dromadaire" {
|
||||||
source = source "dromadaire";
|
source = source "dromadaire";
|
||||||
target = lib.mkTarget "operator@192.168.12.11" // {
|
target = lib.mkTarget "operator@192.168.12.11" // {
|
||||||
|
@ -87,11 +95,13 @@ in
|
||||||
framboise = framboise;
|
framboise = framboise;
|
||||||
grille-pain = grille-pain;
|
grille-pain = grille-pain;
|
||||||
dromadaire = dromadaire;
|
dromadaire = dromadaire;
|
||||||
|
sanji = sanji;
|
||||||
all = pkgs.writeScript "deploy-all-servers" (
|
all = pkgs.writeScript "deploy-all-servers" (
|
||||||
lib.concatStringsSep "\n" [
|
lib.concatStringsSep "\n" [
|
||||||
arachnide
|
arachnide
|
||||||
framboise
|
framboise
|
||||||
grille-pain
|
grille-pain
|
||||||
|
sanji
|
||||||
dromadaire
|
dromadaire
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue