From 5bf105b94f3c63bc738b788b2b651985eed96c11 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Sat, 29 Mar 2025 12:54:20 +0100 Subject: dynamic nodes --- nodes/tarrel/configuration.nix | 55 +++++++++++++++++++++++++++++++++ nodes/tarrel/hardware-configuration.nix | 40 ++++++++++++++++++++++++ nodes/tarrel/home-manager.nix | 45 +++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 nodes/tarrel/configuration.nix create mode 100644 nodes/tarrel/hardware-configuration.nix create mode 100644 nodes/tarrel/home-manager.nix (limited to 'nodes/tarrel') diff --git a/nodes/tarrel/configuration.nix b/nodes/tarrel/configuration.nix new file mode 100644 index 0000000..04bc978 --- /dev/null +++ b/nodes/tarrel/configuration.nix @@ -0,0 +1,55 @@ +{ config, inputs, ... }: +{ + imports = [ + inputs.home-manager.nixosModules.home-manager + inputs.agenix.nixosModules.default + inputs.disko.nixosModules.disko + + ./hardware-configuration.nix + ./home-manager.nix + + ../../modules/core + ../../modules/hyprland.nix + ]; + + system.stateVersion = "24.05"; + + networking.hostName = "tarrel"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Amsterdam"; + + users.users.jras.extraGroups = [ "networkmanager" ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + hardware.graphics.enable = true; + services.xserver.videoDrivers = ["nvidia"]; + hardware.nvidia = { + modesetting.enable = true; + nvidiaSettings = true; + nvidiaPersistenced = true; + open = true; + + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + security.rtkit.enable = true; + + environment.sessionVariables = { + TERMINAL = "alacritty"; + EDITOR = "helix"; + }; + + environment.pathsToLink = [ "/libexec" ]; + + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + }; + + programs.steam.enable = true; +} diff --git a/nodes/tarrel/hardware-configuration.nix b/nodes/tarrel/hardware-configuration.nix new file mode 100644 index 0000000..4604fcd --- /dev/null +++ b/nodes/tarrel/hardware-configuration.nix @@ -0,0 +1,40 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "uas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/b73c41ec-fe01-4fa5-b50a-fd871e8c2710"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/BBB8-1AF8"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f0u9.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nodes/tarrel/home-manager.nix b/nodes/tarrel/home-manager.nix new file mode 100644 index 0000000..c40238b --- /dev/null +++ b/nodes/tarrel/home-manager.nix @@ -0,0 +1,45 @@ +{ lib, pkgs, inputs, ... }: +{ + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.jras = { + imports = [ + ../../modules/home-manager/core + ../../modules/home-manager/hyprland.nix + ../../modules/home-manager/python.nix + ]; + + home.username = "jras"; + home.homeDirectory = "/home/jras"; + home.stateVersion = "23.11"; + + programs.git = { + userName = "Jasper Ras"; + userEmail = "jaspert.ras@gmail.com"; + }; + + services.hypridle.enable = lib.mkForce false; + + home.file = { + gamestream-start = { + text = '' + #!${pkgs.zsh}/bin/zsh + ${pkgs.hyprland}/bin/hyprctl keyword monitor HDMI-A-1,1920x1080@59.94,auto,2 + ''; + target = "bin/gamestream-start"; + executable = true; + }; + gamestream-end = { + text = '' + #!${pkgs.zsh}/bin/zsh + ${pkgs.hyprland}/bin/hyprctl keyword monitor HDMI-A-1,preferred,auto,1 + ''; + target = "bin/gamestream-end"; + executable = true; + }; + }; + + programs.zsh.envExtra = "export PATH=$HOME/bin:$PATH"; + }; +} -- cgit v1.2.3