server7: add preparations
This commit is contained in:
parent
6138287a6e
commit
6e7c0edda4
|
@ -0,0 +1,68 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
c3d2 = {
|
||||
# deployment.microvmBaseZfsDataset = "tank/storage";
|
||||
hq.statistics.enable = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader.grub = {
|
||||
enable = true;
|
||||
version = 2;
|
||||
# Define on which hard drive you want to install Grub.
|
||||
device = "/dev/disk/by-id/scsi-3600300570140a6102b0acad9825149f2"; # or "nodev" for efi only
|
||||
};
|
||||
kernelParams = [
|
||||
"preempt=none"
|
||||
# No server/router runs any untrusted user code
|
||||
"mitigations=off"
|
||||
];
|
||||
tmpOnTmpfs = true;
|
||||
tmpOnTmpfsSize = "80%";
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "server7";
|
||||
hostId = "07070707";
|
||||
};
|
||||
|
||||
services = {
|
||||
openssh.enable = true;
|
||||
smartd.enable = true;
|
||||
};
|
||||
|
||||
# TODO:
|
||||
# simd.arch = "westmere";
|
||||
|
||||
sops = {
|
||||
# defaultSopsFile = ./secrets.yaml;
|
||||
# secrets."machine-id" = {
|
||||
# mode = "444";
|
||||
# path = "/etc/machine-id";
|
||||
# };
|
||||
# secrets."ceph/osd.1/keyfile" = {};
|
||||
# secrets."ceph/osd.2/keyfile" = {};
|
||||
};
|
||||
|
||||
skyflake.nomad.client.meta."c3d2.cpuSpeed" = "5";
|
||||
# skyflake.storage.ceph.osds = [ {
|
||||
# id = 1;
|
||||
# fsid = "4b196252-efb6-4ad2-9e9b-cc3fcd664a3a";
|
||||
# path = "/dev/zvol/server7_root/ceph-osd.1";
|
||||
# keyfile = config.sops.secrets."ceph/osd.1/keyfile".path;
|
||||
# deviceClass = "ssd";
|
||||
# } {
|
||||
# id = 2;
|
||||
# fsid = "b860ec59-3314-4fd1-be45-35a46fd8c059";
|
||||
# path = "/dev/zvol/server7_hdd/ceph-osd.2";
|
||||
# keyfile = config.sops.secrets."ceph/osd.2/keyfile".path;
|
||||
# deviceClass = "hdd";
|
||||
# } ];
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
# 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 = [ "uhci_hcd" "ehci_pci" "ahci" "megaraid_sas" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "server7_root/nixos";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
fileSystems."/var" =
|
||||
{ device = "server7_root/nixos/var";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
fileSystems."/var/lib/resitc" =
|
||||
{ device = "server7_hdd/restic";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix" =
|
||||
{ device = "server7_root/nixos/nix";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix/store" =
|
||||
{ device = "server7_root/nixos/nix/store";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix/var" =
|
||||
{ device = "server7_root/nixos/nix/var";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/984ea997-9591-4efb-8212-8381ad829d0b";
|
||||
fsType = "ext2";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# 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.enp5s0f0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp5s0f1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp5s0f2.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp5s0f3.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp8s0f0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp8s0f1.useDHCP = lib.mkDefault true;
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
Loading…
Reference in New Issue