nixos-config/lambda/configuration.nix

206 lines
4.8 KiB
Nix
Raw Normal View History

2023-07-25 11:40:05 +02:00
{ config, pkgs, ... }:
2023-07-31 14:18:02 +02:00
{
2023-07-25 11:40:05 +02:00
# [HARDWARE]
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
2023-08-25 14:10:48 +02:00
extraPackages = with pkgs; [
intel-ocl
intel-compute-runtime
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
2023-07-25 11:40:05 +02:00
};
2023-07-31 14:18:02 +02:00
hardware.bluetooth.enable = true;
2023-07-25 11:40:05 +02:00
services.logind = {
lidSwitch = "hibernate";
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "hibernate";
};
# [BOOT / DISK ENCRYPTION]
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub = {
enable = true;
device = "nodev";
efiSupport = true;
enableCryptodisk = true;
2023-08-01 15:37:40 +02:00
theme = ../shared/sayonara;
2023-07-31 14:40:59 +02:00
};
2023-07-25 11:40:05 +02:00
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.initrd = {
availableKernelModules = [ "aesni_intel" "cryptd" ];
secrets = { "/boot/key" = "/boot/key"; };
luks.mitigateDMAAttacks = true;
luks.devices = {
root = {
device = "/dev/disk/by-uuid/91114176-b6cc-4454-89df-e2bf5c1fac0a";
keyFile = "/boot/key";
preLVM = true;
};
};
};
# [NETWORKING]
networking.hostName = "lambda";
networking.networkmanager = {
enable = true;
wifi.powersave = true;
wifi.scanRandMacAddress = true;
wifi.macAddress = "random";
};
# Xenia's router sucks
networking.resolvconf.enable = true;
networking.nameservers = [ "8.8.8.8" ];
networking.resolvconf.dnsExtensionMechanism = false;
2023-10-18 18:56:29 +02:00
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = true;
2023-10-18 23:25:59 +02:00
PermitRootLogin = "no";
2023-10-18 18:56:29 +02:00
};
};
2023-07-25 11:40:05 +02:00
# [NFS]
fileSystems."/home/rachel/music" = {
device = "rachel.cafe:/srv/music";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=60" ];
};
# [LOCALE]
time.timeZone = "Europe/Stockholm";
i18n.defaultLocale = "en_GB.UTF-8";
2023-08-02 17:13:06 +02:00
i18n.supportedLocales = [ "sv_SE.UTF-8/UTF-8" "en_GB.UTF-8/UTF-8" ];
2023-07-25 11:40:05 +02:00
console = {
font = "LatGrkCyr-12x22";
keyMap = "us";
};
# [NIX]
nix = {
settings = {
2023-08-13 10:57:20 +02:00
bash-prompt = "\\033[1m\\u\\033[0m@\\033[1m\\h\\033[0m: \\w\\n\\040";
2023-07-25 11:40:05 +02:00
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
gc = {
automatic = true;
dates = "monthly";
options = "--delete-older-than 30d";
};
};
2023-10-12 23:24:36 +02:00
2023-07-25 11:40:05 +02:00
nixpkgs.config.allowUnfree = true;
# [DESKTOP / XORG / WAYLAND]
services.xserver = {
enable = true;
desktopManager.plasma5.enable = true;
displayManager.startx.enable = true;
2023-10-19 00:55:27 +02:00
layout = "sus,fox";
2023-10-18 23:26:21 +02:00
extraLayouts.sus = {
description = "Swedish US";
languages = [ "se" ];
symbolsFile = ../shared/sus.xkb;
};
2023-10-19 00:55:27 +02:00
extraLayouts.fox = {
description = "Layout suitable to be used by a fox";
languages = [ "se" ];
symbolsFile = ../shared/fox.xkb;
};
2023-07-25 11:40:05 +02:00
libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
accelProfile = "flat" ;
tapping = false;
};
};
};
# [SOUND]
sound.enable = false;
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
wireplumber.enable = true;
};
# [PACKAGES / PROGRAMS]
2023-07-25 11:40:05 +02:00
environment.systemPackages = with pkgs; [
git
neovim
];
2023-08-31 20:17:59 +02:00
programs.gamemode = {
enable = true;
settings.general.renice = 20;
};
programs.steam.enable = true;
2023-07-25 11:40:05 +02:00
# [SERVICES]
services.printing.enable = true;
# [SECURITY / FIREWALL]
networking.firewall.enable = true;
2023-10-18 18:56:29 +02:00
networking.firewall.allowedTCPPorts = [ 22 ];
2023-07-25 11:40:05 +02:00
networking.firewall.allowedUDPPorts = [ ];
2023-07-31 15:20:06 +02:00
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "qt";
};
2023-07-25 11:40:05 +02:00
security.doas = {
enable = true;
extraRules = [{
runAs = "root";
groups = [ "wheel" ];
noPass = false;
keepEnv = true;
}];
};
# [USER / HOME MANAGER]
users.users.rachel = {
isNormalUser = true;
2023-07-31 14:18:02 +02:00
extraGroups = [
"wheel"
"networkmanager"
"video"
"input"
"audio"
];
2023-07-25 11:40:05 +02:00
};
# Done for gamemoderun
security.pam.loginLimits = [
{ domain = "rachel"; item = "nice"; "type" = "soft"; value = "-20"; }
{ domain = "rachel"; item = "nice"; "type" = "hard"; value = "-20"; }
];
2023-07-25 11:40:05 +02: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. It's 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 = "23.05"; # Did you read the comment?
}