From 42bc49d716919c8311ac70a7808156494eb5de42 Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 4 Oct 2023 23:14:58 +0200 Subject: Improvements --- build.sh | 7 +++- flake.nix | 16 ++++++++ hardware-configuration.nix | 74 ------------------------------------- host/Rory-desktop/configuration.nix | 63 +++++++++++++++++++++++++++++-- modules/base-client.nix | 2 + modules/environments/home.nix | 2 +- 6 files changed, 84 insertions(+), 80 deletions(-) delete mode 100644 hardware-configuration.nix diff --git a/build.sh b/build.sh index 070b847..dcf7787 100755 --- a/build.sh +++ b/build.sh @@ -1,15 +1,17 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p git nixos-install-tools if [ $# -ne 2 ]; then echo "Usage: $0 " echo "NOTE: hardware config will be generated from root!" echo "Defined configs:" - cat flake.nix | grep 'nixpkgs.lib.nixosSystem' | sed 's/ =.*//' | sed 's/^[ \t]*//;s/[ \t]*$//' | while read cfg; do echo " - $cfg"; done + cat flake.nix | grep '.lib.nixosSystem' | sed 's/ =.*//' | sed 's/^[ \t]*//;s/[ \t]*$//' | while read cfg; do echo " - $cfg"; done exit 1 fi if [ "$1" = "/" ]; then [ -f "host/${2}/pre-rebuild.sh" ] && host/$2/pre-rebuild.sh nixos-generate-config --show-hardware-config > hardware-configuration.nix git add -f hardware-configuration.nix + nom build .#nixosConfigurations.${2}.config.system.build.toplevel && sudo nixos-rebuild switch --flake .#${HOSTNAME} || exit 1 nixos-rebuild switch --flake ".#${2}" -j`nproc` --upgrade-all -L || exit 1 [ -f "host/${2}/post-rebuild.sh" ] && host/$2/post-rebuild.sh git rm --cached hardware-configuration.nix @@ -17,6 +19,7 @@ if [ "$1" = "/" ]; then else nixos-generate-config --show-hardware-config --root "${1}" > hardware-configuration.nix git add -f hardware-configuration.nix + nom build .#nixosConfigurations.${2}.config.system.build.toplevel || exit 1 nixos-install --root "${1}" --flake ".#${2}" git rm --cached hardware-configuration.nix cp . "${1}/Rory-Open-Architecture" -r diff --git a/flake.nix b/flake.nix index 833d949..07e9dce 100755 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,7 @@ outputs = { self, nixpkgs, nixpkgs-RoryNix, nixpkgs-rory, home-manager, botcore-v4, conduit, nixos-wsl }: { nixosConfigurations = { + #NIXPKGS FORK Rory-nginx = nixpkgs-rory.lib.nixosSystem { system = "x86_64-linux"; modules = [ @@ -45,6 +46,8 @@ inherit conduit; }; }; + + #UNSTABLE Rory-devenv = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ @@ -57,6 +60,19 @@ }; }; + Rory-desktop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./host/Rory-desktop/configuration.nix + ./hardware-configuration.nix + home-manager.nixosModules.home-manager + ({...}: { nix.registry.nixpkgs.flake = nixpkgs; }) + ]; + specialArgs = { + inherit home-manager; + }; + }; + #STABLE RoryNix = nixpkgs-RoryNix.lib.nixosSystem { system = "i686-linux"; diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index 1332e7a..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,74 +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 = [ ]; - - boot.initrd.availableKernelModules = [ "virtio_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/111f8fcb-03cc-4804-98bd-e8c41567dd09"; - fsType = "ext4"; - }; - - fileSystems."/usr/lib/wsl/drivers" = - { device = "none"; - fsType = "9p"; - }; - - fileSystems."/usr/lib/wsl/lib" = - { device = "none"; - fsType = "overlay"; - }; - - fileSystems."/mnt/wsl" = - { device = "none"; - fsType = "tmpfs"; - }; - - fileSystems."/mnt/wslg" = - { device = "none"; - fsType = "tmpfs"; - }; - - fileSystems."/mnt/wslg/distro" = - { device = ""; - fsType = "none"; - options = [ "bind" ]; - }; - - fileSystems."/mnt/wslg/doc" = - { device = "none"; - fsType = "overlay"; - }; - - fileSystems."/tmp/.X11-unix" = - { device = "/mnt/wslg/.X11-unix"; - fsType = "none"; - options = [ "bind" ]; - }; - - fileSystems."/mnt/c" = - { device = "drvfs"; - fsType = "9p"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/c3f339c1-3c4d-48a3-991a-1c370c276e49"; } - ]; - - # 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.bonding_masters.useDHCP = lib.mkDefault true; - # networking.interfaces.eth0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/host/Rory-desktop/configuration.nix b/host/Rory-desktop/configuration.nix index 55ee3a8..6d7f3d0 100644 --- a/host/Rory-desktop/configuration.nix +++ b/host/Rory-desktop/configuration.nix @@ -37,7 +37,7 @@ prefixLength = 24; } ]; - useDHCP = true; + # useDHCP = true; }; time.timeZone = "Europe/Brussels"; @@ -46,11 +46,11 @@ services = { xserver = { enable = true; - videoDrivers = [ "intel" ]; + #videoDrivers = [ "intel" ]; desktopManager.gnome.enable = true; libinput.enable = true; layout = "us"; - modules = [ pkgs.xorg.xf86videointel ]; + #modules = [ pkgs.xorg.xf86videointel ]; }; gnome = { core-developer-tools.enable = false; @@ -147,8 +147,28 @@ zsh-you-should-use zsh-syntax-highlighting zsh-completions + + # - IDEs + jetbrains-toolbox + dbeaver + insomnia + + #games + osu-lazer-bin + #steam + steam-run + steam-acf ]; + programs.steam.enable = true; + programs.steam.gamescopeSession.enable = true; + + environment.gnome.excludePackages = [ + pkgs.orca + pkgs.gnome-tour + pkgs.gnome-user-docs + ]; + fonts.fonts = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ]; @@ -166,6 +186,43 @@ sudo.wheelNeedsPassword = false; }; + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + + # Load nvidia driver for Xorg and Wayland + services.xserver.videoDrivers = ["nvidia"]; + + hardware.nvidia = { + + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + powerManagement.enable = false; + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + # Do not disable this unless your GPU is unsupported or if you have a good reason to. + open = true; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + system.stateVersion = "22.11"; # DO NOT EDIT! } diff --git a/modules/base-client.nix b/modules/base-client.nix index 78988b9..c5ebd22 100755 --- a/modules/base-client.nix +++ b/modules/base-client.nix @@ -34,6 +34,8 @@ feh udisks gparted + arandr + discord-development ]; fonts.fonts = with pkgs; [ diff --git a/modules/environments/home.nix b/modules/environments/home.nix index 9408644..9bfb80e 100755 --- a/modules/environments/home.nix +++ b/modules/environments/home.nix @@ -24,7 +24,7 @@ nixPath = [ "nixpkgs=flake:nixpkgs" ]; settings = { builders-use-substitutes = true; - builders + #builders trusted-substituters = [ "https://nix-community.cachix.org" "https://cache.garnix.io" -- cgit 1.4.1