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

135 lines
4.6 KiB
Nix
Raw Normal View History

2024-07-26 23:59:54 +00:00
# This file merged the original configuration.nix and hardware-configuration.nix files, refactoring common system config out
{ config, lib, pkgs, modulesPath, ... }:
2024-07-18 00:24:32 +00:00
{
imports =
2024-07-19 15:03:21 +00:00
[
2024-07-26 23:59:54 +00:00
(modulesPath + "/installer/scan/not-detected.nix")
2024-07-26 23:28:52 +00:00
../../modules/system76-pc.nix
2024-07-18 00:24:32 +00:00
];
networking.hostName = "thelio76"; # Define your hostname.
2024-07-26 23:59:54 +00:00
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
2024-07-30 22:01:36 +00:00
boot.kernelParams = [
"video=DP-2:1920x1080@60"
"video=HDMI-1:1920x1080@60"
];
2024-07-26 23:59:54 +00:00
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";
2024-08-02 17:27:19 +00:00
# Virtualization
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
2024-07-27 00:35:51 +00:00
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
'';
};
2024-07-26 23:59:54 +00:00
2024-07-30 02:06:38 +00:00
fileSystems =
let
externalPrefix = "/media/external";
homePrefix = "/home/alex";
in
{
"/" = {
device = "/dev/disk/by-uuid/5b17c208-6c1b-4317-b59c-6596b1857f1f";
fsType = "ext4";
};
2024-07-18 00:24:32 +00:00
2024-07-30 02:06:38 +00:00
"/boot" = {
device = "/dev/disk/by-uuid/EB52-074B";
fsType = "vfat";
};
2024-07-18 00:24:32 +00:00
2024-07-30 02:06:38 +00:00
"/media/external" = {
device = "/dev/mapper/luks-9870176e-53f3-493e-94d8-560994fa8f35";
2024-07-30 15:11:06 +00:00
options = [ "x-gvfs-show" ];
2024-07-30 02:06:38 +00:00
};
"${homePrefix}/Documents" = {
device = "${externalPrefix}/Documents";
options = [ "bind" "x-gvfs-hide" ];
};
2024-07-30 15:11:06 +00:00
"${homePrefix}/Games" = {
2024-07-30 02:06:38 +00:00
device = "${externalPrefix}/Games";
options = [ "bind" "x-gvfs-hide" ];
};
2024-07-18 00:24:32 +00:00
2024-07-30 15:11:06 +00:00
"${homePrefix}/Git" = {
device = "${externalPrefix}/Git";
options = [ "bind" "x-gvfs-hide" ];
};
2024-07-30 02:06:38 +00:00
"${homePrefix}/Lutris" = {
device = "${externalPrefix}/Lutris";
options = [ "bind" "x-gvfs-hide" ];
};
2024-08-25 16:31:22 +00:00
## Keep pictures on local disk for space
# "${homePrefix}/Pictures" = {
# device = "${externalPrefix}/Pictures";
# options = [ "bind" "x-gvfs-hide" ];
# };
2024-07-30 02:06:38 +00:00
"${homePrefix}/Videos" = {
device = "${externalPrefix}/Videos";
options = [ "bind" "x-gvfs-hide" ];
};
2024-07-26 23:59:54 +00:00
};
swapDevices =
[{ device = "/dev/disk/by-uuid/19de8142-e695-4425-a8cc-27e062204882"; }];
2024-08-04 17:11:11 +00:00
networking.firewall = {
enable = true;
allowedTCPPorts = [
8081 # for expo android
];
2024-08-15 18:48:50 +00:00
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
2024-08-04 17:11:11 +00:00
};
2024-07-26 23:59:54 +00:00
# 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;
2024-07-18 00:24:32 +00:00
# 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?
}