ark/hosts/lungmen/default.nix

174 lines
3.7 KiB
Nix
Raw Normal View History

2022-02-18 20:31:01 +03:00
{
config,
lib,
pkgs,
2022-04-09 21:33:13 +03:00
inputs,
2022-02-18 20:31:01 +03:00
...
2022-03-09 23:55:02 +03:00
}: let
2020-11-22 18:34:10 +03:00
btrfsPartPath = "/dev/disk/by-label/NIXOS";
2022-02-18 20:31:01 +03:00
btrfsOptions = ["compress-force=zstd" "noatime"];
in {
2022-04-09 21:33:13 +03:00
imports = with inputs;
with nixos-hardware.nixosModules; [
2022-04-17 19:20:06 +03:00
nixpkgs.nixosModules.notDetected
2022-04-09 21:33:13 +03:00
nixos-persistence.nixosModule
common-pc-ssd
common-pc
common-gpu-amd
common-cpu-amd
2022-05-21 18:52:13 +03:00
../../modules/network
2022-06-16 21:38:12 +03:00
#../../modules/develop/nixbuild
2022-04-09 21:33:13 +03:00
../../users/root
../../users/patriot
];
2020-11-21 23:54:07 +03:00
boot = {
2022-04-09 21:33:13 +03:00
tmpOnTmpfs = true;
2020-11-21 23:54:07 +03:00
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
2022-04-09 21:33:13 +03:00
systemd-boot.configurationLimit = 10;
2020-11-21 23:54:07 +03:00
};
kernelPackages = pkgs.linuxPackages_latest;
2022-02-18 20:31:01 +03:00
supportedFilesystems = ["btrfs"];
2020-11-21 23:54:07 +03:00
initrd = {
2022-02-18 20:31:01 +03:00
availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
kernelModules = ["amdgpu"];
2021-01-02 16:21:55 +03:00
};
2022-02-18 20:31:01 +03:00
kernelModules = ["kvm-amd"];
extraModulePackages = [];
2022-03-09 23:55:02 +03:00
kernel.sysctl = {"fs.inotify.max_user_watches" = 524288;};
2020-11-21 23:54:07 +03:00
};
2022-04-09 21:33:13 +03:00
2020-11-21 23:54:07 +03:00
fileSystems."/" = {
2022-06-10 21:36:34 +03:00
device = "none";
fsType = "tmpfs";
options = ["defaults" "size=2G" "mode=755"];
2020-11-22 18:34:10 +03:00
};
2020-11-21 23:54:07 +03:00
fileSystems."/nix" = {
device = btrfsPartPath;
fsType = "btrfs";
2022-02-18 20:31:01 +03:00
options = ["subvol=nix"] ++ btrfsOptions;
2020-11-21 23:54:07 +03:00
};
fileSystems."/persist" = {
device = btrfsPartPath;
fsType = "btrfs";
2022-02-18 20:31:01 +03:00
options = ["subvol=persist"] ++ btrfsOptions;
2020-11-21 23:54:07 +03:00
neededForBoot = true;
};
fileSystems."/boot" = {
2022-06-10 21:36:34 +03:00
device = "/dev/disk/by-label/BOOT";
2020-11-21 23:54:07 +03:00
fsType = "vfat";
};
2022-06-10 21:36:34 +03:00
/*
fileSystems."/media/archive" = {
device = "/dev/disk/by-uuid/f9b5f7f3-51e8-4357-8518-986b16311c71";
fsType = "btrfs";
options = btrfsOptions;
};
*/
2022-04-09 21:33:13 +03:00
2022-02-18 20:31:01 +03:00
swapDevices = [];
2020-11-21 23:54:07 +03:00
zramSwap = {
enable = true;
algorithm = "zstd";
};
2022-04-09 21:33:13 +03:00
nix.maxJobs = lib.mkDefault 4;
2020-11-21 23:54:07 +03:00
security = {
2022-04-09 21:33:13 +03:00
pam.loginLimits = [
{
domain = "*";
type = "soft";
item = "nofile";
value = "524288";
}
{
domain = "*";
type = "hard";
item = "nofile";
value = "524288";
}
];
2020-11-21 23:54:07 +03:00
allowSimultaneousMultithreading = false;
# Deleting root subvolume makes sudo show lecture every boot
2022-03-09 23:55:02 +03:00
sudo.extraConfig = ''
Defaults lecture = never
'';
2021-05-14 22:10:53 +03:00
rtkit.enable = true;
2020-11-21 23:54:07 +03:00
};
2022-04-09 21:33:13 +03:00
2021-05-14 22:10:53 +03:00
sound.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
2020-11-21 23:54:07 +03:00
hardware = {
opengl = {
driSupport = true;
driSupport32Bit = true;
enable = true;
2022-06-29 03:31:55 +03:00
extraPackages = with pkgs; [
libvdpau-va-gl
vaapiVdpau
libva
vulkan-loader
amdvlk
];
2022-06-11 18:53:17 +03:00
extraPackages32 = with pkgs.pkgsi686Linux;
2022-06-29 03:31:55 +03:00
[
libvdpau-va-gl
vaapiVdpau
libva
vulkan-loader
]
++ [
pkgs.driversi686Linux.amdvlk
];
2020-11-21 23:54:07 +03:00
};
pulseaudio = {
2021-05-14 22:10:53 +03:00
enable = false;
2020-11-21 23:54:07 +03:00
support32Bit = true;
};
};
2022-04-09 21:33:13 +03:00
2021-07-24 16:37:53 +03:00
fonts = {
enableDefaultFonts = true;
2021-07-24 16:51:53 +03:00
fontconfig.enable = true;
2022-02-18 20:31:01 +03:00
fonts = [pkgs.dejavu_fonts];
2021-07-24 16:37:53 +03:00
};
2022-04-09 21:33:13 +03:00
2020-11-21 23:54:07 +03:00
environment = {
2022-06-10 21:36:34 +03:00
systemPackages = [pkgs.ntfs3g];
2022-02-18 20:31:01 +03:00
pathsToLink = ["/share/zsh"];
2020-11-21 23:54:07 +03:00
persistence."/persist" = {
2022-02-18 20:31:01 +03:00
directories = ["/etc/nixos"];
files = ["/etc/machine-id"];
2020-11-21 23:54:07 +03:00
};
};
2022-04-09 21:33:13 +03:00
2022-05-21 14:17:48 +03:00
networking.firewall.checkReversePath = "loose";
2020-11-21 23:54:07 +03:00
networking.interfaces.enp6s0.useDHCP = true;
2021-02-13 20:30:31 +03:00
services = {
2022-04-09 21:33:13 +03:00
earlyoom.enable = true;
2022-06-10 21:36:34 +03:00
tailscale.enable = false;
2021-04-03 11:25:07 +03:00
ipfs = {
2021-04-15 16:54:00 +03:00
enable = false;
2021-04-03 11:25:07 +03:00
enableGC = true;
autoMount = true;
};
2022-05-21 14:17:48 +03:00
flatpak.enable = false;
2022-04-09 21:33:13 +03:00
xserver.videoDrivers = ["amdgpu"];
2020-12-23 19:54:51 +03:00
};
2022-04-09 21:33:13 +03:00
2021-03-26 21:03:40 +03:00
virtualisation = {
2022-05-28 14:44:46 +03:00
waydroid.enable = false;
2022-06-10 21:36:34 +03:00
podman.enable = false;
2021-05-25 03:24:39 +03:00
libvirtd.enable = false;
2021-03-26 21:03:40 +03:00
};
2022-04-09 21:33:13 +03:00
2022-06-10 21:36:34 +03:00
system.stateVersion = "22.05";
2020-11-21 23:54:07 +03:00
}