From 98c8c5ded88e4836f590db298cf53a5ec30eb353 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Mon, 3 Feb 2025 22:07:43 +0100 Subject: move tarrel into new structure --- configuration/tarrel/default.nix | 82 +++++++++++++++++++++++++ configuration/tarrel/hardware-configuration.nix | 40 ++++++++++++ flake.nix | 3 +- hosts/hardware-configuration/tarrel.nix | 40 ------------ hosts/tarrel.nix | 82 ------------------------- 5 files changed, 124 insertions(+), 123 deletions(-) create mode 100644 configuration/tarrel/default.nix create mode 100644 configuration/tarrel/hardware-configuration.nix delete mode 100644 hosts/hardware-configuration/tarrel.nix delete mode 100644 hosts/tarrel.nix diff --git a/configuration/tarrel/default.nix b/configuration/tarrel/default.nix new file mode 100644 index 0000000..ca573fa --- /dev/null +++ b/configuration/tarrel/default.nix @@ -0,0 +1,82 @@ +{ pkgs, inputs, config, ... }: +{ + imports = [ + ./hardware-configuration.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + environment.systemPackages = with pkgs; [ + zola + discord + ]; + + 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; + + time.timeZone = "Europe/Amsterdam"; + + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "nl_NL.UTF-8"; + LC_IDENTIFICATION = "nl_NL.UTF-8"; + LC_MEASUREMENT = "nl_NL.UTF-8"; + LC_MONETARY = "nl_NL.UTF-8"; + LC_NAME = "nl_NL.UTF-8"; + LC_NUMERIC = "nl_NL.UTF-8"; + LC_PAPER = "nl_NL.UTF-8"; + LC_TELEPHONE = "nl_NL.UTF-8"; + LC_TIME = "nl_NL.UTF-8"; + }; + + console.keyMap = "us-acentos"; + + programs.zsh.enable = true; + + users.users.jras = { + isNormalUser = true; + description = "Jasper"; + extraGroups = [ "networkmanager" "wheel" "audio" ]; + shell = pkgs.zsh; + }; + + security.sudo.execWheelOnly = true; + security.sudo.wheelNeedsPassword = false; + + environment.sessionVariables = { + TERMINAL = "alacritty"; + EDITOR = "helix"; + }; + + environment.pathsToLink = [ "/libexec" ]; + + networking.hostName = "tarrel"; + networking.networkmanager.enable = true; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.jras = import ../../home-manager/entrypoints/personal.nix; + extraSpecialArgs = { inherit inputs; monitor-names = ["DP-2" "HDMI-A-1"]; }; + }; + + system.stateVersion = "24.05"; # Did you read the comment? + + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + }; +} diff --git a/configuration/tarrel/hardware-configuration.nix b/configuration/tarrel/hardware-configuration.nix new file mode 100644 index 0000000..4604fcd --- /dev/null +++ b/configuration/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/flake.nix b/flake.nix index f2245d1..53b78d7 100644 --- a/flake.nix +++ b/flake.nix @@ -67,12 +67,13 @@ system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ - ./hosts/tarrel.nix { environment.systemPackages = [ agenix.packages."x86_64-linux".default ]; } home-manager.nixosModules.home-manager agenix.nixosModules.default + + ./configuration/tarrel ./config/shared.nix { diff --git a/hosts/hardware-configuration/tarrel.nix b/hosts/hardware-configuration/tarrel.nix deleted file mode 100644 index 4604fcd..0000000 --- a/hosts/hardware-configuration/tarrel.nix +++ /dev/null @@ -1,40 +0,0 @@ -# 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/hosts/tarrel.nix b/hosts/tarrel.nix deleted file mode 100644 index 71b70af..0000000 --- a/hosts/tarrel.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ pkgs, inputs, config, ... }: -{ - imports = [ - ./hardware-configuration/tarrel.nix - ]; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - environment.systemPackages = with pkgs; [ - zola - discord - ]; - - 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; - - time.timeZone = "Europe/Amsterdam"; - - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "nl_NL.UTF-8"; - LC_IDENTIFICATION = "nl_NL.UTF-8"; - LC_MEASUREMENT = "nl_NL.UTF-8"; - LC_MONETARY = "nl_NL.UTF-8"; - LC_NAME = "nl_NL.UTF-8"; - LC_NUMERIC = "nl_NL.UTF-8"; - LC_PAPER = "nl_NL.UTF-8"; - LC_TELEPHONE = "nl_NL.UTF-8"; - LC_TIME = "nl_NL.UTF-8"; - }; - - console.keyMap = "us-acentos"; - - programs.zsh.enable = true; - - users.users.jras = { - isNormalUser = true; - description = "Jasper"; - extraGroups = [ "networkmanager" "wheel" "audio" ]; - shell = pkgs.zsh; - }; - - security.sudo.execWheelOnly = true; - security.sudo.wheelNeedsPassword = false; - - environment.sessionVariables = { - TERMINAL = "alacritty"; - EDITOR = "helix"; - }; - - environment.pathsToLink = [ "/libexec" ]; - - networking.hostName = "tarrel"; - networking.networkmanager.enable = true; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.jras = import ../home-manager/entrypoints/personal.nix; - extraSpecialArgs = { inherit inputs; monitor-names = ["DP-2" "HDMI-A-1"]; }; - }; - - system.stateVersion = "24.05"; # Did you read the comment? - - services.sunshine = { - enable = true; - autoStart = true; - capSysAdmin = true; - openFirewall = true; - }; -} -- cgit v1.2.3