Install nixGL to support running graphical programs on non-nixos.

This commit is contained in:
Tom Alexander 2025-02-13 17:57:33 -05:00
parent 197b8fcced
commit fea86b00b4
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 78 additions and 24 deletions

View File

@ -15,10 +15,32 @@
"type": "github" "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": { "nixgl": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1713543440, "lastModified": 1713543440,
@ -36,26 +58,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1660551188, "lastModified": 1739138025,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", "narHash": "sha256-M4ilIfGxzbBZuURokv24aqJTbdjPA9K+DtKUzrJaES4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", "rev": "b2243f41e860ac85c0b446eadc6930359b294e79",
"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",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -67,8 +74,9 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs"
} }
} }
}, },

View File

@ -3,7 +3,8 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 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 = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -12,20 +13,29 @@
outputs = outputs =
{ {
nixpkgs, nixpkgs,
# nixgl, nixgl,
home-manager, home-manager,
... ...
}: }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = import nixpkgs {
inherit system;
overlays = [ nixgl.overlay ];
};
in in
# pkgs = nixpkgs.legacyPackages.${system};
{ {
defaultPackage.${system} = home-manager.defaultPackage.${system}; defaultPackage.${system} = home-manager.defaultPackage.${system};
homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration { homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ ./home.nix ]; extraSpecialArgs = { inherit nixgl; };
modules = [
./home.nix
{ nixpkgs.overlays = [ nixgl.overlay ]; }
];
}; };
}; };

View File

@ -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;
# };
}