diff --git a/flake.nix b/flake.nix index 6667579..4d2b84d 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,8 @@ home-manager, flake-utils, chaotic, - }: + ... + }@inputs: flake-utils.lib.eachDefaultSystem ( system: let @@ -46,16 +47,21 @@ } ) // { - homeManagerModules.play = import ./modules/home; - nixosModules.play = { - imports = [ - (import ./modules/nixos { inherit chaotic; }) - ]; - }; + homeManagerModules.play = import ./modules/home inputs; + nixosModules.play = import ./modules/nixos inputs; # Default module (home-manager) homeManagerModules.default = self.homeManagerModules.play; + # Test configuration + nixosConfigurations.test = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + self.nixosModules.play + ./test-config.nix + ]; + }; + # Overlay for packages overlays.default = final: prev: { proton-cachyos = final.callPackage ./pkgs/proton-cachyos { }; diff --git a/modules/home/default.nix b/modules/home/default.nix index f2218ab..b426bcc 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,7 +1,10 @@ -{ +inputs: { imports = [ ./monitors.nix ./gamescoperun.nix ./wrappers.nix ]; + + # Pass inputs to all modules via _module.args + _module.args = { inherit inputs; }; } diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 7a4e6b7..1ec7fa2 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,10 +1,12 @@ -{ chaotic }: -{ +inputs: { imports = [ ./amd.nix ./ananicy.nix ./gamemode.nix ./lutris.nix - (import ./steam.nix { inherit chaotic; }) + ./steam.nix ]; + + # Pass inputs to all modules via _module.args + _module.args = { inherit inputs; }; } diff --git a/modules/nixos/steam.nix b/modules/nixos/steam.nix index c6c7087..7c0850a 100644 --- a/modules/nixos/steam.nix +++ b/modules/nixos/steam.nix @@ -4,7 +4,7 @@ pkgs, lib, config, - chaotic, + inputs, ... }: @@ -13,7 +13,7 @@ let # Import proton packages directly, some users wont chaotics overlay proton-cachyos = pkgs.callPackage ../../pkgs/proton-cachyos { }; - proton-ge-custom = chaotic.legacyPackages.${pkgs.system}.proton-ge-custom; + proton-ge-custom = inputs.chaotic.legacyPackages.${pkgs.system}.proton-ge-custom; defaultCompatPackages = [ proton-cachyos diff --git a/test-config.nix b/test-config.nix new file mode 100644 index 0000000..7f581a0 --- /dev/null +++ b/test-config.nix @@ -0,0 +1,30 @@ +{ pkgs, lib, ... }: +{ + # Minimal system config + system.stateVersion = "25.05"; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Minimal filesystem config + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + + # Modules + play = { + amd.enable = true; # AMD GPU optimization + steam.enable = true; # Steam with Proton-CachyOS + lutris.enable = true; # Lutris game manager + gamemode.enable = true; # Performance optimization + ananicy.enable = true; # Process scheduling + }; + + nixpkgs.config.allowUnfreePredicate = + pkg: + builtins.elem (lib.getName pkg) [ + "steam" + "steam-unwrapped" + "steam-run" + ]; +}