Add lindberg

This commit is contained in:
qo.is sysadmin 2021-04-10 18:14:17 +02:00
parent 1a0d7946fb
commit de3db0d159
4 changed files with 94 additions and 0 deletions

10
hardware/asrock.nix Normal file
View file

@ -0,0 +1,10 @@
{ config, lib, pkgs, modulesPath, ... }: {
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
}

25
host/lindberg/default.nix Normal file
View file

@ -0,0 +1,25 @@
{ config, pkgs, ... }:
{
imports = [
./networking.nix
./filesystems.nix
../../hardware/asrock.nix
../../defaults/base
];
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "20.09"; # Did you read the comment?
}

View file

@ -0,0 +1,49 @@
{ config, pkgs, ... }: {
boot.initrd.luks.devices = {
"system".device = "/dev/disk/by-uuid/ba646016-2618-4d9b-acf2-41986ab76f7e";
"data".device = "/dev/disk/by-uuid/6cfe504d-992f-4b11-be3e-31d00c3e108d";
"backup".device = "/dev/disk/by-uuid/772017c5-f176-4473-9db6-4aa3769cf056";
"swap".device = "/dev/disk/by-uuid/c2f2bf21-51a8-4404-944c-ba83a9d7cf21";
};
fileSystems = {
"/" = {
device = "/dev/mapper/system";
fsType = "btrfs";
};
"/mnt/data" = {
device = "/dev/mapper/data";
fsType = "btrfs";
};
"/mnt/backup" = {
device = "/dev/mapper/backup";
fsType = "btrfs";
};
"/boot-primary" = {
device = "/dev/disk/by-uuid/7D11-F31D";
fsType = "vfat";
};
"/boot-secondary" = {
device = "/dev/disk/by-uuid/ED1A-59BF";
fsType = "vfat";
};
};
swapDevices = [{ device = "/dev/mapper/swap"; }];
# TODO: RAID Monitoring
# TODO: Set spin-down time of physical disks
# Use the systemd-boot EFI boot loader.
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub = {
enable = true;
efiSupport = true;
mirroredBoots = [
{ devices = [ "nodev" ]; path = "/boot-primary"; efiBootloaderId = "NixOS primary"; }
{ devices = [ "nodev" ]; path = "/boot-secondary"; efiBootloaderId = "NixOS secondary";}
];
};
}

View file

@ -0,0 +1,10 @@
{ config, pkgs, ... }:
let
meta = import ../../meta;
in {
networking.hostName = "lindberg"; # TODO: Extract into meta
networking.useDHCP = false;
networking.interfaces.enp5s0.useDHCP = true;
}