diff --git a/configuration.nix b/configuration.nix index 2cd0075..3780044 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,194 +1,119 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - imports = [ - ./hardware-configuration.nix - ]; +{ config, inputs, lib, pkgs, ... }: - nixpkgs = { - config.allowUnfree = true; - overlays = [ - (self: super: { - hyprland = inputs.hyprland-git.packages."x86_64-linux".hyprland; - }) +let + nvidiaPackage = config.hardware.nvidia.package; +in + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix ]; - }; - nix.settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - download-buffer-size = 524288000; # 500 MiB - }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; # Use the systemd-boot EFI boot loader. - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - - # Set your time zone. - time.timeZone = "America/Chicago"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "us"; - }; - - networking = { - hostName = "girlCore"; - networkmanager.enable = true; - - firewall = { - enable = true; - allowedTCPPorts = []; - allowedUDPPorts = []; - }; - }; - - users.users.ashley = { - isNormalUser = true; - extraGroups = ["wheel"]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - tree - ]; - }; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = {inherit inputs;}; - - users.ashley = import ./home.nix; - }; - - services = { - displayManager = { - sddm = { + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + programs.silentSDDM = { enable = true; - wayland.enable = ! config.services.xserver.enable; # experimental - }; - defaultSession = "hyprland"; - }; - - xserver.videoDrivers = lib.mkDefault ["nvidia"]; - - # Enable touchpad support (enabled default in most desktopManager). - libinput.enable = true; - - # Enable audio - # Multimedia Framework - # With backwards compatability for alsa/pulseaudio/jack - pipewire = { - enable = true; - wireplumber.enable = true; - - alsa.enable = true; - alsa.support32Bit = true; - - pulse.enable = true; - jack.enable = true; - }; - }; - security.rtkit.enable = true; # simplifies pipewire's life - - programs = { - hyprland = { - enable = true; - withUWSM = true; # Universal Wayland Session Manager - xwayland.enable = true; - }; - - gamemode.enable = true; - steam = { - enable = true; - gamescopeSession.enable = true; # .desktop entry for gamescope - - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - - # extraCompatPackages = with pkgs; [ - # proton-ge-bin - # ]; - }; - - silentSDDM = { - enable = true; - theme = "rei"; - settings = { + theme = "rei"; + settings = { "LoginScreen.LoginArea.Avatar" = { shape = "circle"; active-border-color = "#ffcfce"; }; "LoginScreen" = { - background = "hana.jpg"; + background = "hana.jpg"; }; "LockScreen" = { - background = "kokomi96024.png"; + background = "kokomi96024.png"; + }; }; - }; - }; }; - - hardware = { - bluetooth = { + networking.hostName = "girlCore"; # Define your hostname. + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + # Set your time zone. + time.timeZone = "America/Chicago"; + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + services.displayManager.sddm = { enable = true; - powerOnBoot = true; - }; + wayland.enable = true; +}; + services.displayManager.defaultSession = "hyprland"; + programs.hyprland.enable = true; + programs.hyprland.package = inputs.hyprland-git.packages."x86_64-linux".hyprland; - graphics = { + programs.steam = { enable = true; - enable32Bit = true; + remotePlay.openFirewall = true; # optional + dedicatedServer.openFirewall = true; # optional + localNetworkGameTransfers.openFirewall = true; # optional + gamescopeSession.enable = true; # optional }; # nvidia drivers - nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.stable; + hardware.graphics.enable = true; + hardware.graphics.enable32Bit = true; + services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; + hardware.nvidia = { + 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 = false; - # WARNING: whether to use open-source or proprietary kernel modules - # open = lib.mkOverride 990 (package ? open && package ? firmware); - open = true; - - nvidiaSettings = true; - 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 = false; - finegrained = false; - }; - }; - }; - - environment = { - # NOTE: loaded earlier than `environment.variables` - sessionVariables = { - # Hint Electrons apps to use Wayland - NIXOS_OZONE_WL = "1"; - }; - - variables = { - EDITOR = "nvim"; - }; - - # List packages installed in system profile. - # You can use https://search.nixos.org/ to find more packages (and options). - systemPackages = with pkgs; [ - git - neovim - wget - - steamcmd - ]; + powerManagement.finegrained = false; + # open = true; + open = lib.mkOverride 990 (nvidiaPackage ? open && nvidiaPackage ? firmware); + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; }; + services.pipewire = { + enable = true; + pulse.enable = true; + }; + # Enable touchpad support (enabled default in most desktopManager). + services.libinput.enable = true; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.ashley = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + tree + ]; + }; + # List packages installed in system profile. + # You can use https://search.nixos.org/ to find more packages (and options). + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + environment.systemPackages = with pkgs; [ + git + neovim + wget + ]; + environment.variables.EDITOR = "nvim"; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # List services that you want to enable: + # Enable the OpenSSH daemon. + # Open ports in the firewall. + networking.firewall.allowedTCPPorts = [ ]; + networking.firewall.allowedUDPPorts = [ ]; + networking.firewall.enable = true; # This option defines the first version of NixOS you have installed on this particular machine, # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # diff --git a/flake.lock b/flake.lock index 4b1ad8b..012d233 100644 --- a/flake.lock +++ b/flake.lock @@ -161,9 +161,7 @@ "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "hyprwire": "hyprwire", - "nixpkgs": [ - "nixpkgs" - ], + "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems", "xdph": "xdph" @@ -430,6 +428,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1766070988, + "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1771369470, "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", @@ -473,7 +487,7 @@ "home-manager": "home-manager", "hyprland-git": "hyprland-git", "nixcats": "nixcats", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "silentSDDM": "silentSDDM" } }, diff --git a/flake.nix b/flake.nix index 2177a33..1bb731b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,8 @@ { - description = "NixOS configuration"; +description = "NixOS configuration"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - # home-manager, used for managing user configuration home-manager = { url = "github:nix-community/home-manager/master"; @@ -13,35 +12,40 @@ # to avoid problems caused by different versions of nixpkgs. inputs.nixpkgs.follows = "nixpkgs"; }; - silentSDDM = { url = "github:uiriansan/SilentSDDM"; inputs.nixpkgs.follows = "nixpkgs"; - }; + }; nixcats.url = "github:BirdeeHub/nixCats-nvim"; - hyprland-git = { + hyprland-git = { url = "github:hyprwm/Hyprland/25250527793eb04bb60f103abe7f06370b9f6e1c"; - inputs.nixpkgs.follows = "nixpkgs"; }; + }; - outputs = inputs @ { - nixpkgs, - home-manager, - silentSDDM, - ... - }: { + outputs = inputs@{ nixpkgs, home-manager, nixcats, ... }: { nixosConfigurations = { girlCore = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; modules = [ ./configuration.nix + inputs.silentSDDM.nixosModules.default + # make home-manager as a module of nixos # so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch` home-manager.nixosModules.home-manager - silentSDDM.nixosModules.default + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + home-manager.extraSpecialArgs = { inherit inputs; }; + + home-manager.users.ashley = import ./home.nix; + + # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix + } ]; }; }; diff --git a/hardware-configuration.nix b/hardware-configuration.nix index a938f5c..1f129f7 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -1,34 +1,30 @@ # 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, ... }: + { - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci" "usbhid"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "ahci" "usbhid" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/10c61ccc-e175-4cfd-bd6a-08a57dbdb0b5"; - fsType = "btrfs"; - }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/10c61ccc-e175-4cfd-bd6a-08a57dbdb0b5"; + fsType = "btrfs"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/24E3-BA29"; - fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; - }; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/24E3-BA29"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; - swapDevices = []; + swapDevices = [ ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/home.nix b/home.nix index 9aff559..9a9067d 100644 --- a/home.nix +++ b/home.nix @@ -1,8 +1,5 @@ +{ inputs, pkgs, ... }: { - inputs, - pkgs, - ... -}: { imports = [ ./modules/neovim/nixcats.nix ./modules/waybar/default.nix @@ -39,30 +36,7 @@ }; }; }; - - services.kanshi = { - enable = true; - systemdTarget = "hyprland-session.target"; - - settings = [ - { - # laptop screen - output.criteria = "eDP-1"; # XXX: TODO - output.mode = "1920x1080@240.00Hz"; - output.scale = 1.0; - output.adaptiveSync = false; # Variable Refresh Rate - } - { - profile.name = "girlCore"; - profile.outputs = [ - { - criteria = "eDP-1"; # laptop screen - position = "0,0"; - } - ]; - } - ]; - }; - + home.stateVersion = "25.11"; } + diff --git a/modules/neovim/nixcats.nix b/modules/neovim/nixcats.nix index f9c2650..2a1aa78 100644 --- a/modules/neovim/nixcats.nix +++ b/modules/neovim/nixcats.nix @@ -1,10 +1,16 @@ -{inputs, ...}: let +{ + inputs, + config, + pkgs, + ... +}: let utils = inputs.nixcats.utils; in { + imports = [ inputs.nixcats.homeModule ]; - + config = { # this value, nixCats is the defaultPackageName you pass to mkNixosModules # it will be the namespace for your options.