tsuki: move hardware config to configuration file

This commit is contained in:
2023-03-08 15:26:07 +01:00
parent 7a0fcf7805
commit a82a3f95c0
4 changed files with 65 additions and 63 deletions

View File

@@ -1,8 +1,7 @@
{ secrets, ... }:
{ config, lib, secrets, modulesPath, ... }:
{
imports = [
./hardware-configuration.nix
./extra-hardware-configuration.nix
(modulesPath + "/profiles/qemu-guest.nix")
# ./services/calibre.nix
./services/gitea
@@ -51,19 +50,6 @@
# security.pam.services.login.unixAuth = true;
boot.loader = {
grub = {
enable = true;
version = 2;
efiSupport = true;
fsIdentifier = "label";
device = "nodev";
efiInstallAsRemovable = true;
};
# efi.efiSysMountPoint = "/boot/efi";
# efi.canTouchEfiVariables = true;
};
networking = {
hostName = "Tsuki";
networkmanager.enable = true;
@@ -98,11 +84,68 @@
};
groups = {
media = {};
nix-builder = {};
};
};
sops.secrets."drives/cirno/credentials" = {};
fileSystems = let
nfsDrive = drivename: {
device = "10.0.0.36:/mnt/PoolsClosed/${drivename}";
fsType = "nfs";
options = [ "vers=3" "local_lock=all" ];
};
in {
"/" = {
device = "/dev/disk/by-uuid/54b9fd58-0df5-410c-ab87-766860967653";
fsType = "btrfs";
};
"/boot" = {
device = "/dev/disk/by-uuid/0A60-2885";
fsType = "vfat";
};
"/data2/backup" = nfsDrive "backup";
"/data2/momiji" = nfsDrive "momiji";
"/data2/media" = nfsDrive "media";
"/data2/postgres" = nfsDrive "postgres";
"/data2/home" = nfsDrive "home";
"/data2/cirno" = {
device = "//10.0.0.36/cirno";
fsType = "cifs";
options = [
"vers=3.0"
"cred=${config.sops.secrets."drives/cirno/credentials".path}"
"rw"
"uid=1000"
];
};
};
swapDevices = [{ device = "/dev/disk/by-uuid/92a1a33f-89a8-45de-a45e-6c303172cd7f"; }];
virtualisation = {
docker.enable = true;
};
boot = {
initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
initrd.kernelModules = [ ];
kernelModules = [ ];
extraModulePackages = [ ];
loader = {
grub = {
enable = true;
version = 2;
efiSupport = true;
fsIdentifier = "label";
device = "nodev";
efiInstallAsRemovable = true;
};
# efi.efiSysMountPoint = "/boot/efi";
# efi.canTouchEfiVariables = true;
};
};
}

View File

@@ -1,13 +0,0 @@
{ ... }: let
nfsDrive = drivename: {
device = "10.0.0.36:/mnt/PoolsClosed/${drivename}";
fsType = "nfs";
options = [ "nfsvers=3" ];
};
in {
fileSystems."/data2/backup" = nfsDrive "backup";
fileSystems."/data2/momiji" = nfsDrive "momiji";
fileSystems."/data2/media" = nfsDrive "media";
fileSystems."/data2/postgres" = nfsDrive "postgres";
fileSystems."/data2/home" = nfsDrive "home";
}

View File

@@ -1,31 +0,0 @@
# 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, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/54b9fd58-0df5-410c-ab87-766860967653";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/0A60-2885";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/92a1a33f-89a8-45de-a45e-6c303172cd7f"; }
];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}