Add Gandalf.
This commit is contained in:
parent
e00ea5c226
commit
715239373d
3 changed files with 103 additions and 1 deletions
17
flake.nix
17
flake.nix
|
@ -225,6 +225,23 @@
|
|||
{ home-manager.users.jahanson = ./nixos/home/jahanson/server.nix; }
|
||||
];
|
||||
};
|
||||
|
||||
"gandalf" = mkNixosConfig {
|
||||
# X9DRi-LN4+/X9DR3-LN4+ - Intel(R) Xeon(R) CPU E5-2650 v2
|
||||
# NAS
|
||||
hostname = "telperion";
|
||||
system = "x86_64-linux";
|
||||
hardwareModules = [
|
||||
./nixos/profiles/hw-supermicro.nix
|
||||
disko.nixosModules.disko
|
||||
(import ./nixos/profiles/disko-nixos.nix { disks = [ "/dev/sda/dev/disk/by-id/ata-Seagate_IronWolfPro_ZA240NX10001-2ZH100_7TF002RA" ]; })
|
||||
lix-module.nixosModules.default
|
||||
];
|
||||
profileModules = [
|
||||
./nixos/profiles/role-server.nix
|
||||
{ home-manager.users.jahanson = ./nixos/home/jahanson/server.nix; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Convenience output that aggregates the outputs for home, nixos.
|
||||
|
|
70
nixos/hosts/gandalf/default.nix
Normal file
70
nixos/hosts/gandalf/default.nix
Normal file
|
@ -0,0 +1,70 @@
|
|||
# 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, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [ "ehci_pci" "ahci" "mpt3sas" "isci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
initrd.kernelModules = [ ];
|
||||
kernelModules = [ "kvm-intel" "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ];
|
||||
extraModulePackages = [ ];
|
||||
kernelParams = [ "iommu=pt" "intel_iommu=on" ];
|
||||
};
|
||||
|
||||
# Network settings
|
||||
networking = {
|
||||
hostName = "gandalf";
|
||||
hostId = "e2fc95cd";
|
||||
useDHCP = false; # needed for bridge
|
||||
networkmanager.enable = true;
|
||||
# TODO: Add ports specifically.
|
||||
firewall.enable = false;
|
||||
interfaces = {
|
||||
"enp130s0f0".useDHCP = true;
|
||||
"enp130s0f1".useDHCP = true;
|
||||
};
|
||||
|
||||
# For VMs
|
||||
bridges = {
|
||||
"br0" = {
|
||||
interfaces = [ "enp130s0f1" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "zroot/root";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "zroot/nix";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/var" = {
|
||||
device = "zroot/var";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "zroot/home";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
# System settings and services.
|
||||
mySystem = {
|
||||
purpose = "Production";
|
||||
system.motd.networkInterfaces = [ "enp130s0f0" "enp130s0f1" ];
|
||||
};
|
||||
}
|
15
nixos/profiles/hw-supermicro.nix
Normal file
15
nixos/profiles/hw-supermicro.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ lib, pkgs, ... }:
|
||||
with lib;
|
||||
{
|
||||
boot = {
|
||||
# for managing/mounting nfs
|
||||
supportedFilesystems = [ "nfs" ];
|
||||
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
Loading…
Reference in a new issue