nixos/hosts/gunter/configuration.nix

176 lines
4.3 KiB
Nix
Raw Normal View History

2024-07-17 20:22:04 +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
2024-08-06 22:52:14 +00:00
# Enable microcode updates
hardware.enableRedistributableFirmware = true;
2024-03-01 09:00:40 +00:00
# Bootloader stuff
2024-04-12 19:10:36 +00:00
boot = {
# Kernel stuff
2024-06-14 20:15:48 +00:00
# kernelPackages = pkgs.linuxPackages_xanmod_latest;
kernelPackages = pkgs.linuxPackages_latest;
# kernelPackages = lib.warn "Pinned to kernel 6.10 due to nvidia fbdev trouble!" pkgs.linuxPackages_6_10;
2024-04-12 19:10:36 +00:00
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 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;
};
2024-07-17 20:22:04 +00:00
loader.efi = {
canTouchEfiVariables = true;
};
2024-04-12 19:10:36 +00:00
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";
2024-06-21 14:25:53 +00:00
# Enable graphics
hardware.graphics = {
2024-03-02 20:16:23 +00:00
enable = true;
extraPackages = with pkgs; [
vaapiVdpau
nvidia-vaapi-driver
];
};
# Nvidia stuff
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
2024-07-25 10:08:36 +00:00
open = true;
nvidiaSettings = false;
2024-03-02 20:16:23 +00:00
package = config.boot.kernelPackages.nvidiaPackages.latest;
2024-08-04 14:46:32 +00:00
# package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
# version = "560.28.03";
# sha256_64bit = "sha256-martv18vngYBJw1IFUCAaYr+uc65KtlHAMdLMdtQJ+Y=";
# sha256_aarch64 = lib.fakeHash;
# openSha256 = "sha256-asGpqOpU0tIO9QqceA8XRn5L27OiBFuI9RZ1NjSVwaM=";
# settingsSha256 = lib.fakeHash;
# 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;
2024-05-26 22:59:29 +00:00
portalPackage = pkgs.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;
2024-07-17 20:22:04 +00:00
extraPortals = (
with pkgs;
[
# unstable.xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
]
);
2024-03-01 09:00:40 +00:00
};
# Enable flakes
2024-07-11 11:21:54 +00:00
nix.settings = {
2024-07-17 20:22:04 +00:00
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [
"root"
"torjus"
2024-07-11 11:21:54 +00:00
];
2024-07-17 20:22:04 +00:00
substituters = [ "https://cuda-maintainers.cachix.org" ];
2024-07-11 11:21:54 +00:00
trusted-public-keys = [
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
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?
}