Compare commits

...

2 commits

Author SHA1 Message Date
90ceed85d8 Create backuphost Bragi 2023-12-21 12:25:04 +01:00
45d0ef262f Differentiate hardware and vms in roles 2023-12-21 12:11:20 +01:00
7 changed files with 73 additions and 2 deletions

View file

@ -0,0 +1,12 @@
{
imports = [
./hardware-configuration.nix
../../roles
../../roles/hardware.nix
./network.nix
];
# System configuration here
networking.hostName = "bragi";
system.stateVersion = "23.11";
}

View file

@ -0,0 +1,30 @@
{lib, ...}: {
imports = [];
fileSystems."/" = {
device = "gha-root";
fsType = "tmpfs";
options = ["size=1G" "mode=755"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/"; #TODO
fsType = "btrfs";
options = ["subvol=persist"];
neededForBoot = true;
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/"; #TODO
fsType = "ext4";
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/"; #TODO
fsType = "btrfs";
options = ["subvol=nix"];
};
swapDevices = [{device = "/dev/disk/by-uuid/";}]; #TODO
nix.settings.max-jobs = lib.mkDefault 4;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -0,0 +1,16 @@
# We sohuld put that config somewhere in roles and give it a parameter or something,
# everyone gets the same nameserver and the same prefixLength and address vs defaultGateway alsways
# depend on the same thing
{
imports = [];
networking = {
interfaces.enp4s0f1.ipv4.addresses = [
{
address = "192.168.1.11";
prefixLength = 24;
}
];
defaultGateway = "192.168.1.137";
nameservers = ["130.83.2.22" "130.83.56.60" "130.83.22.60" "130.82.22.63"];
};
}

View file

@ -3,6 +3,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/jitsi.nix ../../modules/jitsi.nix
../../roles ../../roles
../../roles/vm.nix
./network.nix ./network.nix
]; ];

View file

@ -1,16 +1,15 @@
{ {
pkgs, pkgs,
lib, lib,
modulesPath,
... ...
}: { }: {
imports = [ imports = [
./admins.nix ./admins.nix
./nix_keys.nix ./nix_keys.nix
./prometheusNodeExporter.nix ./prometheusNodeExporter.nix
(modulesPath + "/virtualisation/xen-domU.nix")
../modules/impermanence.nix ../modules/impermanence.nix
]; ];
nix = { nix = {
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes

5
nixos/roles/hardware.nix Normal file
View file

@ -0,0 +1,5 @@
{
# Bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
}

8
nixos/roles/vm.nix Normal file
View file

@ -0,0 +1,8 @@
{
modulesPath,
...
}: {
imports = [
(modulesPath + "/virtualisation/xen-domU.nix")
];
}