diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf21ade --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dotfiles +*.lock diff --git a/configuration.nix b/configuration.nix index cb1056d..8e8a14e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ nixos-hardware, config, pkgs, ... }: { imports = @@ -10,15 +10,75 @@ ./hardware-configuration.nix ]; - hardware.openrazer.enable = true; - hardware.openrazer.users = [ "emenel" ]; - hardware.opengl.enable = true; - # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.kernelPackages = pkgs.linuxPackages_zen; + boot = { + # TODO: confirm this works + # https://forums.developer.nvidia.com/t/550-54-14-cannot-create-sg-table-for-nvkmskapimemory-spammed-when-launching-chrome-on-wayland/284775/26 + initrd.kernelModules = [ "nvidia" "i915" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; + # extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ]; + kernelParams = [ "nvidia-drm.fbdev=1" ]; + }; + + hardware = { + openrazer.enable = true; + openrazer.users = [ "emenel" ]; + opengl.enable = true; + + nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.mkDriver { + version = "555.58.02"; + sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM="; + sha256_aarch64 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY="; + openSha256 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY="; + settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8="; + persistencedSha256 = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM="; + }; + + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = true; + + # 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+ + # Currently alpha-quality/buggy, so false is currently the recommended setting. + open = false; + + #forceFullCompositionPipeline = true; + + prime = { + amdgpuBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:41:0:0"; + offload = { + enable = true; + enableOffloadCmd = true; + }; + + #reverseSync.enable = true; + #sync.enable = true; + }; + nvidiaSettings = true; + }; + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + networking.hostName = "eddie"; # Enable networking @@ -38,10 +98,26 @@ # Enable the X11 windowing system services.xserver.enable = true; + #services.greetd = { + # enable = true; + # settings = rec { + # initial_session = { + # command = "${pkgs.greetd.tuigreet}/bin/tuigreet --sessions ${config.services.xserver.displayManager.sessionData.desktops}/share/xsessions:${config.services.xserver.displayManager.sessionData.desktops}/share/wayland-sessions --remember --remember-user-session"; + # user = "greeter"; + # }; + # default_session = initial_session; + # }; + #}; + + + #security.pam.services.greetd.enableGnomeKeyring = true; + # Enable the GNOME Desktop Environment. services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; + programs.dconf.enable = true; + # Configure keymap in X11 services.xserver.xkb = { layout = "us"; @@ -99,9 +175,7 @@ nixpkgs.config.allowUnfree = true; # List packages installed in system profile. To search, run: - # $ nix search wget environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget home-manager curl @@ -109,6 +183,8 @@ rsync ]; + programs.steam.enable = true; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/flake.nix b/flake.nix index 634a89b..a357559 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,8 @@ description = "My Home Manager configuration"; inputs = { + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; @@ -12,7 +14,7 @@ nix-flatpak.url = "github:gmodena/nix-flatpak"; # unstable branch. Use github:gmodena/nix-flatpak/?ref= to pin releases. }; - outputs = inputs@{ nixpkgs, home-manager, nix-flatpak, ... }: { + outputs = inputs@{self, nixpkgs, home-manager, nix-flatpak, nixos-hardware, ... }: { nixosConfigurations = { eddie = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -29,6 +31,7 @@ pkgs = nixpkgs.legacyPackages.x86_64-linux; modules = [ nix-flatpak.homeManagerModules.nix-flatpak + #nixos-hardware ./home.nix ]; }; diff --git a/home.nix b/home.nix index 7d7b55f..78543a5 100644 --- a/home.nix +++ b/home.nix @@ -3,39 +3,63 @@ nixpkgs.config.allowUnfree = true; home = { packages = with pkgs; [ - plexamp - audacity - supercollider-with-plugins - - python3 - sbcl - nodejs_22 - - kanata-with-cmd - wezterm + gnupg eza - fish - emacs just fd fzf bat jq - starship + yt-dlp + htop + ripgrep + erdtree + pciutils + util-linux + coreutils + libgcc + raylib + SDL2 + + ruby + janet + jpm + python3 + sbcl + nodejs_18 + platformio-core + + kanata-with-cmd + wezterm + emacs + fish + starship + lazygit + nnn + bitwarden-cli bitwarden-desktop tailscale - gnome.gnome-software - polychromatic - - discord - slack - gnomeExtensions.just-perfection gnomeExtensions.dash-to-dock + gnome.gnome-software + gnome.gnome-tweaks + vlc + polychromatic + discord + slack + signal-desktop + libreoffice + plexamp + audacity + supercollider-with-plugins + bitwig-studio + blender + davinci-resolve-studio + steam ]; username = "emenel"; @@ -52,6 +76,10 @@ nix-direnv.enable = true; }; fish.enable = true; + starship = { + enable = true; + enableFishIntegration = true; + }; }; services.flatpak.enable = true; @@ -67,5 +95,6 @@ "io.github.zen_browser.zen" ]; - xdg.configFile."wezterm".source = ./dotfiles/dot_config/wezterm/wezterm.lua; + xdg.configFile."wezterm".source = ./dotfiles/dot_config/wezterm; + #xdg.configFile."fish".source = ./ }