mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: add nixGL module
This commit is contained in:
parent
9c1df052a2
commit
faff8d9ee6
5 changed files with 62 additions and 3 deletions
|
|
@ -3985,6 +3985,12 @@ Laptops are not always plugged in, so they should show a battery icon in Waybar.
|
||||||
|
|
||||||
This section is mostly used to deliver the correct information to Waybar. AMD systems have changing hwmon paths that can be specifically set here. Also the cpu count can be set here for Waybars cpu module, but 8 is usually a good setting to show
|
This section is mostly used to deliver the correct information to Waybar. AMD systems have changing hwmon paths that can be specifically set here. Also the cpu count can be set here for Waybars cpu module, but 8 is usually a good setting to show
|
||||||
|
|
||||||
|
to get the info for the secondary gpu, use `lspci -nn | grep VGA`
|
||||||
|
It can be set to either:
|
||||||
|
- a number, selecting the n-th non-default GPU
|
||||||
|
- a PCI bus id in the form =pci-XXX_YY_ZZ_U=
|
||||||
|
- a PCI id in the form =vendor_id:device_id=
|
||||||
|
|
||||||
#+begin_src nix :tangle modules/home/hardware.nix
|
#+begin_src nix :tangle modules/home/hardware.nix
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
|
|
@ -3993,6 +3999,11 @@ This section is mostly used to deliver the correct information to Waybar. AMD sy
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
default = 8;
|
default = 8;
|
||||||
};
|
};
|
||||||
|
isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU";
|
||||||
|
SecondaryGpuCard = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
temperatureHwmon = {
|
temperatureHwmon = {
|
||||||
isAbsolutePath = lib.mkEnableOption "absolute temperature path";
|
isAbsolutePath = lib.mkEnableOption "absolute temperature path";
|
||||||
path = lib.mkOption {
|
path = lib.mkOption {
|
||||||
|
|
@ -4962,7 +4973,7 @@ This sets up the =nix-secrets= extraSpeciaArgs. This should not be present on th
|
||||||
{ inputs, config, lib, ... }:
|
{ inputs, config, lib, ... }:
|
||||||
{
|
{
|
||||||
home-manager = lib.mkIf config.swarselsystems.withHomeManager {
|
home-manager = lib.mkIf config.swarselsystems.withHomeManager {
|
||||||
extraSpecialArgs = { inherit (inputs) nix-secrets; };
|
extraSpecialArgs = { inherit (inputs) nix-secrets nixgl; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -8585,6 +8596,33 @@ Again, we adapt =nix= to our needs, enable the home-manager command for non-NixO
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
**** nixGL
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: h:90af1862-90b3-4c93-8730-2443bc62986a
|
||||||
|
:END:
|
||||||
|
|
||||||
|
This integrates nixGL into home-manager. NixGL provies OpenGL and Vulkan APIs to nix installed utilities. This is needed for graphical applications on non-NixOS systems.
|
||||||
|
|
||||||
|
#+begin_src nix :tangle profiles/home/common/nixgl.nix
|
||||||
|
{ lib, config, nixgl, ... }:
|
||||||
|
{
|
||||||
|
nixGL = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||||
|
inherit (nixgl) packages;
|
||||||
|
defaultWrapper = lib.mkDefault "mesa";
|
||||||
|
vulkan.enable = lib.mkDefault false;
|
||||||
|
prime = lib.mkIf config.swarselsystem.isSecondaryGpu {
|
||||||
|
card = config.swarselsystem.secondaryGpuCard;
|
||||||
|
installScript = "mesa";
|
||||||
|
};
|
||||||
|
offloadWrapper = lib.mkIf config.swarselsystem.isSecondaryGpu "mesaPrime";
|
||||||
|
installScripts = [
|
||||||
|
"mesa"
|
||||||
|
"mesaPrime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#+end_src
|
||||||
|
|
||||||
**** Installed packages
|
**** Installed packages
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: h:893a7f33-7715-415b-a895-2687ded31c18
|
:CUSTOM_ID: h:893a7f33-7715-415b-a895-2687ded31c18
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,6 @@
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
inherit lib;
|
inherit lib;
|
||||||
|
|
||||||
nixosModules = import ./modules/nixos { inherit lib; };
|
nixosModules = import ./modules/nixos { inherit lib; };
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,11 @@
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
default = 8;
|
default = 8;
|
||||||
};
|
};
|
||||||
|
isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU";
|
||||||
|
SecondaryGpuCard = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
temperatureHwmon = {
|
temperatureHwmon = {
|
||||||
isAbsolutePath = lib.mkEnableOption "absolute temperature path";
|
isAbsolutePath = lib.mkEnableOption "absolute temperature path";
|
||||||
path = lib.mkOption {
|
path = lib.mkOption {
|
||||||
|
|
|
||||||
17
profiles/home/common/nixgl.nix
Normal file
17
profiles/home/common/nixgl.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{ lib, config, nixgl, ... }:
|
||||||
|
{
|
||||||
|
nixGL = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||||
|
inherit (nixgl) packages;
|
||||||
|
defaultWrapper = lib.mkDefault "mesa";
|
||||||
|
vulkan.enable = lib.mkDefault false;
|
||||||
|
prime = lib.mkIf config.swarselsystem.isSecondaryGpu {
|
||||||
|
card = config.swarselsystem.secondaryGpuCard;
|
||||||
|
installScript = "mesa";
|
||||||
|
};
|
||||||
|
offloadWrapper = lib.mkIf config.swarselsystem.isSecondaryGpu "mesaPrime";
|
||||||
|
installScripts = [
|
||||||
|
"mesa"
|
||||||
|
"mesaPrime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{ inputs, config, lib, ... }:
|
{ inputs, config, lib, ... }:
|
||||||
{
|
{
|
||||||
home-manager = lib.mkIf config.swarselsystems.withHomeManager {
|
home-manager = lib.mkIf config.swarselsystems.withHomeManager {
|
||||||
extraSpecialArgs = { inherit (inputs) nix-secrets; };
|
extraSpecialArgs = { inherit (inputs) nix-secrets nixgl; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue