flakes/machines/trench/hardware.nix
Chinmay D. Pai f32772e7f2
feat: add latest nixos configuration
Signed-off-by: Chinmay D. Pai <chinmay.pai@zerodha.com>
2023-10-12 00:27:24 +05:30

116 lines
3.7 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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 = ["xhci_pci" "ahci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "r8169"];
kernelModules = [];
luks.devices."root".device = "/dev/disk/by-uuid/e70bfc3c-1147-4af7-9bae-69f70146953f";
network = {
enable = true;
ssh = {
enable = true;
port = 22;
shell = "/bin/cryptsetup-askpass";
hostKeys = ["/etc/ssh/ssh_host_ed25519_key"];
authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJQWA+bAwpm9ca5IhC6q2BsxeQH4WAiKyaht48b7/xkN cc@predator"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKJnFvU6nBXEuZF08zRLFfPpxYjV3o0UayX0zTPbDb7C cc@eden"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG3PeMbehJBkmv8Ee7xJimTzXoSdmAnxhBatHSdS+saM chnmy@bastion"
];
};
};
};
extraModulePackages = [];
kernelModules = ["kvm-amd"];
kernelParams = ["ip=dhcp"];
# Use the systemd-boot EFI boot loader.
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/5cabc339-898c-4604-9bfc-0a2cf17e44ca";
fsType = "btrfs";
options = ["defaults" "compress-force=zstd" "noatime" "ssd" "subvol=@"];
neededForBoot = true; # required
};
"/home" = {
device = "/dev/disk/by-uuid/5cabc339-898c-4604-9bfc-0a2cf17e44ca";
fsType = "btrfs";
options = ["defaults" "compress-force=zstd" "noatime" "ssd" "subvol=@home"];
};
"/.snapshots" = {
device = "/dev/disk/by-uuid/5cabc339-898c-4604-9bfc-0a2cf17e44ca";
fsType = "btrfs";
options = ["defaults" "compress-force=zstd" "noatime" "ssd" "subvol=@snapshots"];
};
"/var/log" = {
device = "/dev/disk/by-uuid/5cabc339-898c-4604-9bfc-0a2cf17e44ca";
fsType = "btrfs";
options = ["defaults" "compress-force=zstd" "noatime" "ssd" "subvol=@log"];
};
"/etc/nixos" = {
device = "/dev/disk/by-uuid/5cabc339-898c-4604-9bfc-0a2cf17e44ca";
fsType = "btrfs";
options = ["defaults" "compress-force=zstd" "noatime" "ssd" "subvol=@nixos-config"];
};
"/var/cache" = {
device = "/dev/disk/by-uuid/5cabc339-898c-4604-9bfc-0a2cf17e44ca";
fsType = "btrfs";
options = ["defaults" "compress-force=zstd" "noatime" "ssd" "subvol=@cache"];
};
"/boot" = {
device = "/dev/disk/by-uuid/1C6C-122C";
fsType = "vfat";
};
};
swapDevices = [];
networking = {
hostName = "trench";
nameservers = ["1.1.1.1"];
# 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`.
useDHCP = lib.mkDefault false;
interfaces.enp6s0 = {
useDHCP = lib.mkDefault true;
wakeOnLan.enable = true;
};
networkmanager.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
firewall.enable = false;
};
hardware = {
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}