ops/nixos: split most of blade-janeway into lib/blade.nix
This commit is contained in:
parent
b0e58ab198
commit
f55f861e17
2 changed files with 56 additions and 37 deletions
|
@ -7,51 +7,19 @@ let
|
||||||
inherit (depot.ops) secrets;
|
inherit (depot.ops) secrets;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
../lib/zfs.nix
|
../lib/blade.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "pata_atiixp" "uhci_hcd" "be2iscsi" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
|
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
|
||||||
boot.kernelParams = [ "mitigations=off" ];
|
|
||||||
|
|
||||||
fileSystems = let
|
|
||||||
zfs = device: {
|
|
||||||
device = device;
|
|
||||||
fsType = "zfs";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
"/" = zfs "tank/local/root";
|
|
||||||
"/tmp" = zfs "tank/local/tmp";
|
|
||||||
"/nix" = zfs "tank/local/nix";
|
|
||||||
"/var" = zfs "tank/safe/var";
|
|
||||||
"/home" = zfs "tank/safe/home";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.loader.grub.enable = true;
|
|
||||||
boot.loader.grub.version = 2;
|
|
||||||
boot.loader.grub.device = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_0401c0556e165beb5c1df7b9f438e6ba98af3caa816d88e69b2bf7ec2909f6ca293a000000000000000000009c7343f0ff88671891558107c52824c1-0:0";
|
boot.loader.grub.device = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_0401c0556e165beb5c1df7b9f438e6ba98af3caa816d88e69b2bf7ec2909f6ca293a000000000000000000009c7343f0ff88671891558107c52824c1-0:0";
|
||||||
|
|
||||||
# Networking!
|
# Networking!
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "blade-janeway";
|
hostName = "blade-janeway";
|
||||||
hostId = "3a62390f";
|
hostId = "3a62390f";
|
||||||
domain = "house.as205479.net";
|
bonds.bond0.interfaces = [
|
||||||
nameservers = ["8.8.8.8" "8.8.4.4"];
|
"enp4s0f0" "enp4s0f1"
|
||||||
useDHCP = false;
|
"enp5s0f0" "enp5s0f1"
|
||||||
interfaces.bond0.useDHCP = true;
|
];
|
||||||
bonds.bond0 = {
|
|
||||||
interfaces = [
|
|
||||||
"enp4s0f0" "enp4s0f1"
|
|
||||||
"enp5s0f0" "enp5s0f1"
|
|
||||||
];
|
|
||||||
driverOptions = {
|
|
||||||
mode = "802.3ad";
|
|
||||||
miimon = "1000";
|
|
||||||
lacp_rate = "fast";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
my.ip.tailscale = "100.121.116.85";
|
my.ip.tailscale = "100.121.116.85";
|
||||||
|
|
||||||
system.stateVersion = "21.05";
|
|
||||||
}
|
}
|
||||||
|
|
51
ops/nixos/lib/blade.nix
Normal file
51
ops/nixos/lib/blade.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
{ depot, lib, pkgs, rebuilder, config, ... }:
|
||||||
|
let
|
||||||
|
inherit (depot.ops) secrets;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
../lib/zfs.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "pata_atiixp" "uhci_hcd" "be2iscsi" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.kernelParams = [ "mitigations=off" ];
|
||||||
|
|
||||||
|
fileSystems = let
|
||||||
|
zfs = device: {
|
||||||
|
device = device;
|
||||||
|
fsType = "zfs";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
"/" = zfs "tank/local/root";
|
||||||
|
"/tmp" = zfs "tank/local/tmp";
|
||||||
|
"/nix" = zfs "tank/local/nix";
|
||||||
|
"/var" = zfs "tank/safe/var";
|
||||||
|
"/home" = zfs "tank/safe/home";
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.loader.grub.enable = true;
|
||||||
|
boot.loader.grub.version = 2;
|
||||||
|
|
||||||
|
# Networking!
|
||||||
|
networking = {
|
||||||
|
domain = "house.as205479.net";
|
||||||
|
nameservers = ["8.8.8.8" "8.8.4.4"];
|
||||||
|
useDHCP = false;
|
||||||
|
interfaces.bond0.useDHCP = true;
|
||||||
|
bonds.bond0 = {
|
||||||
|
driverOptions = {
|
||||||
|
mode = "802.3ad";
|
||||||
|
miimon = "1000";
|
||||||
|
lacp_rate = "fast";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualisation.podman.enable = true;
|
||||||
|
|
||||||
|
system.stateVersion = "21.05";
|
||||||
|
}
|
Loading…
Reference in a new issue