nixos/hosts/gunter/configuration.nix

151 lines
4.0 KiB
Nix
Raw Normal View History

2024-04-22 20:34:14 +00:00
{ config, lib, inputs, pkgs, ... }:
2024-03-01 09:00:40 +00:00
{
2024-03-06 19:17:04 +00:00
imports = [
./hardware-configuration.nix
2024-03-17 23:18:17 +00:00
../../system/monitoring.nix
2024-03-06 19:17:04 +00:00
];
# Sops stuff
sops.defaultSopsFile = ../../secrets/gunter/secrets.yaml;
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.generateKey = true;
sops.secrets."gotify_tokens/backup-home" = { };
2024-03-01 09:00:40 +00:00
# Bootloader stuff
2024-04-12 19:10:36 +00:00
boot = {
# Kernel stuff
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [
"quiet"
"splash"
"rd.systemd.show_status=false"
];
2024-03-03 07:59:21 +00:00
2024-04-12 19:10:36 +00:00
extraModprobeConfig = ''
options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
'';
2024-03-01 09:00:40 +00:00
2024-04-12 19:10:36 +00:00
# Bootloader stuff
loader.systemd-boot = {
enable = true;
configurationLimit = 10;
};
loader.efi = { canTouchEfiVariables = true; };
supportedFilesystems = [ "nfs" ];
};
2024-03-02 22:25:58 +00:00
2024-03-01 09:00:40 +00:00
# Networking stuff
networking.hostName = "gunter"; # Define your hostname.
networking.networkmanager.enable = true;
2024-03-10 17:59:45 +00:00
networking.nftables.enable = true;
networking.firewall = {
enable = true;
};
2024-03-01 09:00:40 +00:00
# Set time stuff
time.timeZone = "Europe/Oslo";
# Enable opengl
2024-03-02 20:16:23 +00:00
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiVdpau
nvidia-vaapi-driver
];
};
# Nvidia stuff
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
2024-05-26 22:58:09 +00:00
package = config.boot.kernelPackages.nvidiaPackages.beta;
# package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
# version = "555.42.02";
# sha256_64bit = "sha256-k7cI3ZDlKp4mT46jMkLaIrc2YUx1lh1wj/J4SVSHWyk=";
# sha256_aarch64 = lib.fakeSha256;
# openSha256 = "sha256-rtDxQjClJ+gyrCLvdZlT56YyHQ4sbaL+d5tL4L4VfkA=";
# settingsSha256 = "sha256-rtDxQjClJ+gyrCLvdZlT56YyHQ4sbaL+d5tL4L4VfkA=";
# persistencedSha256 = lib.fakeSha256;
# };
2024-03-02 20:16:23 +00:00
};
2024-03-01 09:00:40 +00:00
# Setup hyprland
2024-03-02 20:16:23 +00:00
# nixpkgs.overlays = [
# (self: super: {
# hyprland = super.hyprland.override {
# debug = true;
# };
# })
# ];
2024-03-01 09:00:40 +00:00
services.xserver.enable = true;
2024-03-02 20:16:23 +00:00
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.displayManager.gdm.wayland = true;
2024-03-02 22:25:58 +00:00
services.xserver.displayManager.lightdm.enable = false;
2024-03-03 09:14:09 +00:00
services.xserver.displayManager.startx.enable = true;
services.xserver.windowManager.i3.enable = true;
2024-03-01 09:00:40 +00:00
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.unstable.xdg-desktop-portal-hyprland;
2024-03-01 09:00:40 +00:00
};
# Setup common XDG env vars
environment.sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
XDG_BIN_HOME = "$HOME/.local/bin";
PATH = [ "${XDG_BIN_HOME}" ];
};
# Setup xdg portal
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
extraPortals = (with pkgs; [
2024-03-05 21:14:24 +00:00
# unstable.xdg-desktop-portal-hyprland
2024-03-01 09:00:40 +00:00
xdg-desktop-portal-gtk
]);
};
# Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];
2024-04-15 07:50:57 +00:00
nix.settings.trusted-users = [ "root" "torjus" ];
2024-03-01 09:00:40 +00:00
nixpkgs.config.allowUnfree = true;
# Install system-wide packages
environment.systemPackages = with pkgs; [
curl
git
2024-03-02 20:16:23 +00:00
libnotify
usbutils
vim
wget
2024-03-05 00:22:53 +00:00
v4l-utils
2024-03-07 14:01:55 +00:00
nmap
2024-04-22 20:34:14 +00:00
(lib.mkIf (config.system.name == "gunter") pciutils)
2024-03-03 09:14:09 +00:00
# X shit
2024-03-03 11:57:27 +00:00
# xorg.xorgserver
# xorg.xinit
# xorg.xf86inputevdev
# xorg.xf86inputlibinput
# xorg.xinit
2024-03-01 09:00:40 +00:00
];
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment?
}