diff --git a/nix/steam_deck/configuration/flake.lock b/nix/steam_deck/configuration/flake.lock index c67dbab..4320425 100644 --- a/nix/steam_deck/configuration/flake.lock +++ b/nix/steam_deck/configuration/flake.lock @@ -15,10 +15,32 @@ "type": "github" } }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1739314552, + "narHash": "sha256-ggVf2BclyIW3jexc/uvgsgJH4e2cuG6Nyg54NeXgbFI=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "83bd3a26ac0526ae04fa74df46738bb44b89dcdd", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixgl": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1713543440, @@ -36,26 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1660551188, - "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", + "lastModified": 1739138025, + "narHash": "sha256-M4ilIfGxzbBZuURokv24aqJTbdjPA9K+DtKUzrJaES4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1739019272, - "narHash": "sha256-7Fu7oazPoYCbDzb9k8D/DdbKrC3aU1zlnc39Y8jy/s8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "fa35a3c8e17a3de613240fea68f876e5b4896aec", + "rev": "b2243f41e860ac85c0b446eadc6930359b294e79", "type": "github" }, "original": { @@ -67,8 +74,9 @@ }, "root": { "inputs": { + "home-manager": "home-manager", "nixgl": "nixgl", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" } } }, diff --git a/nix/steam_deck/configuration/flake.nix b/nix/steam_deck/configuration/flake.nix index f4f8fe9..6d87f5d 100644 --- a/nix/steam_deck/configuration/flake.nix +++ b/nix/steam_deck/configuration/flake.nix @@ -3,7 +3,8 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - # nixgl.url = "github:nix-community/nixGL"; + nixgl.url = "github:nix-community/nixGL"; + nixgl.inputs.nixpkgs.follows = "nixpkgs"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -12,20 +13,29 @@ outputs = { nixpkgs, - # nixgl, + nixgl, home-manager, ... }: let system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; + pkgs = import nixpkgs { + inherit system; + overlays = [ nixgl.overlay ]; + }; in + # pkgs = nixpkgs.legacyPackages.${system}; { defaultPackage.${system} = home-manager.defaultPackage.${system}; homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = [ ./home.nix ]; + extraSpecialArgs = { inherit nixgl; }; + + modules = [ + ./home.nix + { nixpkgs.overlays = [ nixgl.overlay ]; } + ]; }; }; diff --git a/nix/steam_deck/configuration/home.nix b/nix/steam_deck/configuration/home.nix new file mode 100644 index 0000000..7232bff --- /dev/null +++ b/nix/steam_deck/configuration/home.nix @@ -0,0 +1,36 @@ +# TODO: Optimize for znver2 +{ + config, + pkgs, + nixgl, + ... +}: +{ + home.username = "deck"; + home.homeDirectory = "/home/deck"; + home.stateVersion = "24.11"; + + programs.home-manager.enable = true; + + # enable flakes + nix = { + package = pkgs.nix; + settings.experimental-features = [ + "nix-command" + "flakes" + ]; + }; + + home.packages = with pkgs; [ + steam-rom-manager + pkgs.nixgl.nixGLIntel + (pkgs.nixgl.nixGLCommon pkgs.nixgl.nixGLIntel) + pkgs.nixgl.nixVulkanIntel + ]; + + # This would keep build-time dependencies so I can rebuild while offline. + # nix.settings = { + # keep-outputs = true; + # keep-derivations = true; + # }; +}