diff --git a/configuration.nix b/configuration.nix index e6f1443..07e0ed4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -9,7 +9,14 @@ ./hardware-configuration.nix ]; - nixpkgs.config.allowUnfree = true; + nixpkgs = { + config.allowUnfree = true; + overlays = [ + (self: super: { + hyprland = inputs.hyprland-git.packages."x86_64-linux".hyprland; + }) + ]; + }; nix.settings.experimental-features = ["nix-command" "flakes"]; # Use the systemd-boot EFI boot loader. @@ -45,11 +52,20 @@ tree ]; }; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = {inherit inputs;}; + + users.ashley = import ./home.nix; + }; services = { - displayManager.sddm = { - enable = true; - wayland.enable = true; + displayManager = { + sddm = { + enable = true; + wayland.enable = ! config.services.xserver.enable; # experimental + }; defaultSession = "hyprland"; }; @@ -68,15 +84,22 @@ programs = { hyprland = { enable = true; - package = inputs.hyprland-git.packages."x86_64-linux".hyprland; + withUWSM = true; # Universal Wayland Session Manager + xwayland.enable = true; }; + gamemode.enable = true; steam = { enable = true; - remotePlay.openFirewall = true; # optional - dedicatedServer.openFirewall = true; # optional - localNetworkGameTransfers.openFirewall = true; # optional - gamescopeSession.enable = true; # optional + gamescopeSession.enable = true; # .desktop entry for gamescope + + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + + # extraCompatPackages = with pkgs; [ + # proton-ge-bin + # ]; }; silentSDDM = { @@ -104,9 +127,12 @@ }; # nvidia drivers - nvidia = rec { + nvidia = { package = config.boot.kernelPackages.nvidiaPackages.stable; - open = lib.mkOverride 990 (package ? open && package ? firmware); + + # 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; @@ -122,6 +148,12 @@ }; environment = { + # NOTE: loaded earlier than `environment.variables` + sessionVariables = { + # Hint Electrons apps to use Wayland + NIXOS_OZONE_WL = "1"; + }; + variables = { EDITOR = "nvim"; }; @@ -132,6 +164,8 @@ git neovim wget + + steamcmd ]; }; diff --git a/flake.lock b/flake.lock index 012d233..4b1ad8b 100644 --- a/flake.lock +++ b/flake.lock @@ -161,7 +161,9 @@ "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "hyprwire": "hyprwire", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "pre-commit-hooks": "pre-commit-hooks", "systems": "systems", "xdph": "xdph" @@ -428,22 +430,6 @@ } }, "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=", @@ -487,7 +473,7 @@ "home-manager": "home-manager", "hyprland-git": "hyprland-git", "nixcats": "nixcats", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "silentSDDM": "silentSDDM" } }, diff --git a/flake.nix b/flake.nix index a5c86b2..2177a33 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + # home-manager, used for managing user configuration home-manager = { url = "github:nix-community/home-manager/master"; @@ -12,6 +13,7 @@ # to avoid problems caused by different versions of nixpkgs. inputs.nixpkgs.follows = "nixpkgs"; }; + silentSDDM = { url = "github:uiriansan/SilentSDDM"; inputs.nixpkgs.follows = "nixpkgs"; @@ -21,13 +23,14 @@ hyprland-git = { url = "github:hyprwm/Hyprland/25250527793eb04bb60f103abe7f06370b9f6e1c"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = inputs @ { nixpkgs, home-manager, - nixcats, + silentSDDM, ... }: { nixosConfigurations = { @@ -35,21 +38,10 @@ 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 - { - 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 - } + silentSDDM.nixosModules.default ]; }; }; diff --git a/home.nix b/home.nix index cff5e13..9aff559 100644 --- a/home.nix +++ b/home.nix @@ -40,5 +40,29 @@ }; }; + 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 2a1aa78..f9c2650 100644 --- a/modules/neovim/nixcats.nix +++ b/modules/neovim/nixcats.nix @@ -1,16 +1,10 @@ -{ - inputs, - config, - pkgs, - ... -}: let +{inputs, ...}: 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.