NixOS-Config/nixos/hosts/GLaDOS/configuration.nix

125 lines
3.2 KiB
Nix
Raw Normal View History

2023-10-26 16:48:06 +02:00
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
outputs,
pkgs,
config,
2023-10-26 16:48:06 +02:00
...
}: {
# You can import other NixOS modules here
imports = [
# Import home-manager's NixOS module
inputs.home-manager.nixosModules.home-manager
2023-10-26 16:48:06 +02:00
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
2024-02-07 13:50:03 +01:00
../../desktop
2024-02-15 19:37:06 +01:00
../../../disko/GLaDOS
2023-10-26 16:48:06 +02:00
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
];
2024-12-22 22:48:13 +01:00
sops = {
defaultSopsFile = ./secrets/sops.yaml;
2023-10-26 16:48:06 +02:00
2024-12-22 22:48:13 +01:00
secrets."wg-private-key".mode = "0440";
secrets."wg-private-key".owner = config.users.users.root.name;
secrets."ssh-private-key" = {
mode = "0600";
owner = config.users.users.lillian.name;
path = "/home/lillian/.ssh/id_ed25519";
};
};
2024-02-15 22:26:20 +01:00
environment.systemPackages = with pkgs; [
];
2024-02-16 12:59:11 +01:00
services.xserver.videoDrivers = ["amdgpu"];
2024-12-22 22:48:13 +01:00
hardware = {
# Add vulkan support to GPU
graphics.extraPackages = with pkgs; [
amdvlk
];
# For 32 bit applications
graphics.extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
};
programs = {
gamemode.enable = true;
gamemode.settings = {
2024-03-03 16:36:41 +01:00
general = {
renice = 10;
};
# Warning: GPU optimisations have the potential to damage hardware
# gpu = {
# apply_gpu_optimisations = "accept-responsibility";
# gpu_device = 0;
# amd_performance_level = "high";
# };
2024-03-03 16:36:41 +01:00
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
2024-12-22 22:48:13 +01:00
boot = {
loader.systemd-boot.enable = true;
binfmt.emulatedSystems = ["aarch64-linux"];
};
2024-05-20 13:18:35 +02:00
# boot.lanzaboote = {
# enable = true;
# pkiBundle = "/etc/secureboot";
# };
2024-03-03 16:45:39 +01:00
users.users.lillian.extraGroups = ["gamemode"];
home-manager = {
extraSpecialArgs = {inherit inputs outputs;};
users = {
# Import your home-manager configuration
lillian = import ../../../home-manager/hosts/GLaDOS;
};
};
2024-12-22 22:48:13 +01:00
networking = {
# virtualisation.waydroid.enable = false;
hostName = "GLaDOS";
wireguard.enable = true;
wg-quick.interfaces = {
wg0 = {
autostart = true;
address = ["10.0.0.2/24" "fdc9:281f:04d7:9ee9::2/64"];
dns = ["10.0.0.1" "fdc9:281f:04d7:9ee9::1"];
listenPort = 51821;
privateKeyFile = config.sops.secrets."wg-private-key".path;
peers = [
{
publicKey = "A02sO7uLdgflhPIRd0cbJONIaPP4z8HTxDkmX4NegFg=";
endpoint = "84.87.146.85:51821";
allowedIPs = ["0.0.0.0/0" "::/0"];
persistentKeepalive = 25;
}
];
};
};
};
2023-10-26 16:48:06 +02:00
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.11";
2023-10-26 16:48:06 +02:00
}