nixos-config/config/hosts/thelio76/default.nix

135 lines
4.6 KiB
Nix
Raw Permalink 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.

# This file merged the original configuration.nix and hardware-configuration.nix files, refactoring common system config out
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
../../modules/system76-pc.nix
];
networking.hostName = "thelio76"; # Define your hostname.
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.kernelParams = [
"video=DP-2:1920x1080@60"
"video=HDMI-1:1920x1080@60"
];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices."luks-b748a776-5e2c-4809-927e-1f4c051b9460".device = "/dev/disk/by-uuid/b748a776-5e2c-4809-927e-1f4c051b9460";
boot.initrd.luks.devices."luks-7d758c82-9079-46a6-8bb2-05d5016ed623".device = "/dev/disk/by-uuid/7d758c82-9079-46a6-8bb2-05d5016ed623";
# Virtualization
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
environment.etc.crypttab = {
enable = true;
text = ''
# /etc/crypttab: mappings for encrypted partitions.
#
# Each mapped device will be created in /dev/mapper, so your /etc/fstab
# should use the /dev/mapper/<name> paths for encrypted devices.
#
# See crypttab(5) for the supported syntax.
#
# NOTE: Do not list your root (/) partition here, it must be set up
# beforehand by the initramfs (/etc/mkinitcpio.conf). The same applies
# to encrypted swap, which should be set up with mkinitcpio-openswap
# for resume support.
#
# <name> <device> <password> <options>
luks-9870176e-53f3-493e-94d8-560994fa8f35 UUID=9870176e-53f3-493e-94d8-560994fa8f35 /luks-9870176e-53f3-493e-94d8-560994fa8f35 nofail
'';
};
fileSystems =
let
externalPrefix = "/media/external";
homePrefix = "/home/alex";
in
{
"/" = {
device = "/dev/disk/by-uuid/5b17c208-6c1b-4317-b59c-6596b1857f1f";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/EB52-074B";
fsType = "vfat";
};
"/media/external" = {
device = "/dev/mapper/luks-9870176e-53f3-493e-94d8-560994fa8f35";
options = [ "x-gvfs-show" ];
};
"${homePrefix}/Documents" = {
device = "${externalPrefix}/Documents";
options = [ "bind" "x-gvfs-hide" ];
};
"${homePrefix}/Games" = {
device = "${externalPrefix}/Games";
options = [ "bind" "x-gvfs-hide" ];
};
"${homePrefix}/Git" = {
device = "${externalPrefix}/Git";
options = [ "bind" "x-gvfs-hide" ];
};
"${homePrefix}/Lutris" = {
device = "${externalPrefix}/Lutris";
options = [ "bind" "x-gvfs-hide" ];
};
## Keep pictures on local disk for space
# "${homePrefix}/Pictures" = {
# device = "${externalPrefix}/Pictures";
# options = [ "bind" "x-gvfs-hide" ];
# };
"${homePrefix}/Videos" = {
device = "${externalPrefix}/Videos";
options = [ "bind" "x-gvfs-hide" ];
};
};
swapDevices =
[{ device = "/dev/disk/by-uuid/19de8142-e695-4425-a8cc-27e062204882"; }];
networking.firewall = {
enable = true;
allowedTCPPorts = [
8081 # for expo android
];
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
};
# 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;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}