add nix system graphics

This commit is contained in:
Steam Deck User
2025-02-23 18:02:24 +00:00
parent 3bda156ab4
commit 9bc902cb90
8 changed files with 122 additions and 98 deletions

View File

@@ -1,5 +1,8 @@
{ pkgs, inputs, config, ... }:
{ pkgs, ... }:
let
homeUpdateLocation = "/home/deck/Projects/nixos#deck";
in
{
imports = [
../../home-manager/base.nix
@@ -7,19 +10,23 @@
../../home-manager/development/vscode.nix
];
terminal.homeUpdateLocation = "/home/deck/Projects/nixos#deck";
terminal.homeUpdateLocation = homeUpdateLocation;
terminal.flakeUpdateLocation = "/home/deck/Projects/nixos";
nixpkgs.config = {
allowUnfree = true;
};
nix.gc.automatic = true;
home.username = "deck";
home.homeDirectory = "/home/deck";
home.stateVersion = "24.05";
home.packages = with pkgs;[ (config.lib.nixGL.wrap nextcloud-client) ];
home.packages = with pkgs;[
system-manager
nextcloud-client
];
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
@@ -32,21 +39,29 @@
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
"nix-steam-run.sh" = {
text = ''
unset LD_PRELOAD
# shellcheck source=/dev/null
source /etc/profile.d/nix.sh
exec "$@"
'';
executable = true;
};
};
nixGL = {
packages = inputs.nixgl.packages;
# vulkan.enable = true;
programs = {
topgrade = {
settings = {
post_commands = {
nix-system-manager = "sudo system-manager switch --flake ${homeUpdateLocation}";
};
};
};
programs.kodi = {
kodi = {
enable = true;
package = config.lib.nixGL.wrap (pkgs.kodi.withPackages (exts: [ exts.jellycon exts.joystick ]));
};
systemd.user.services.nextcloud-client = {
Unit = {
After = pkgs.lib.mkForce "graphical-session.target";
package = pkgs.kodi.withPackages (exts: [ exts.jellycon exts.joystick ]);
};
};
}

114
flake.lock generated
View File

@@ -54,21 +54,6 @@
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -90,6 +75,26 @@
"type": "github"
}
},
"nix-system-graphics": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1737457219,
"narHash": "sha256-nX9dxoATDCSQgWw/iv6BngXDJEyHVYYEvHEVQ7Ig3fI=",
"owner": "soupglasses",
"repo": "nix-system-graphics",
"rev": "9c875e0c56cf2eb272b9102a4f3e24e4e31629fd",
"type": "github"
},
"original": {
"owner": "soupglasses",
"repo": "nix-system-graphics",
"type": "github"
}
},
"nix-vscode-extensions": {
"inputs": {
"flake-compat": "flake-compat",
@@ -111,32 +116,13 @@
"type": "github"
}
},
"nixgl": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixGL",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1739798439,
"narHash": "sha256-GyipmjbbQEaosel/+wq1xihCKbv0/e1LU00x/8b/fP4=",
"lastModified": 1740089251,
"narHash": "sha256-Y78mDBWoO8CLLTjQfPfII+KXFb6lAmF9GrLbyVBsIMM=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "3e2ea8a49d4d76276b0f4e2041df8ca5c0771371",
"rev": "18e9f9753e9ae261bcc7d3abe15745686991fd30",
"type": "github"
},
"original": {
@@ -164,11 +150,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1739866667,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
"lastModified": 1740126099,
"narHash": "sha256-ozoOtE2hGsqh4XkTJFsrTkNxkRgShxpQxDynaPZUGxk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
"rev": "32fb99ba93fea2798be0e997ea331dd78167f814",
"type": "github"
},
"original": {
@@ -180,26 +166,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
"lastModified": 1740162160,
"narHash": "sha256-SSYxFhqCOb3aiPb6MmN68yEzBIltfom8IgRz7phHscM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1739758141,
"narHash": "sha256-uq6A2L7o1/tR6VfmYhZWoVAwb3gTy7j4Jx30MIrH0rE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c618e28f70257593de75a7044438efc1c1fc0791",
"rev": "11415c7ae8539d6292f2928317ee7a8410b28bb9",
"type": "github"
},
"original": {
@@ -213,11 +184,32 @@
"inputs": {
"disko": "disko",
"home-manager": "home-manager",
"nix-system-graphics": "nix-system-graphics",
"nix-vscode-extensions": "nix-vscode-extensions",
"nixgl": "nixgl",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable"
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable",
"system-manager": "system-manager"
}
},
"system-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1739316420,
"narHash": "sha256-FZBKtR8mqbcEazdpI1SoID43FeldQPhjnvluUO9HAaI=",
"owner": "numtide",
"repo": "system-manager",
"rev": "82d5a9ecd15ec48bcbfbacf5462066ee267d6aae",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "system-manager",
"type": "github"
}
},
"systems": {

View File

@@ -3,6 +3,7 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions?rev=a81daa13ca23440d8ae219d765140769c4d2f117";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
@@ -11,14 +12,23 @@
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions?rev=a81daa13ca23440d8ae219d765140769c4d2f117";
nixgl.url = "github:nix-community/nixGL";
system-manager = {
url = "github:numtide/system-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-system-graphics = {
url = "github:soupglasses/nix-system-graphics";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-hardware, home-manager, ... }@inputs:
outputs = { self, nixpkgs, nixos-hardware, home-manager, system-manager, nix-system-graphics, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
overlays = [ system-manager.overlays.default ];
};
in
{
nixosConfigurations.tuxedo = nixpkgs.lib.nixosSystem {
@@ -39,5 +49,17 @@
extraSpecialArgs = { inherit inputs; };
modules = [ ./devices/deck/home.nix ];
};
systemConfigs.deck = system-manager.lib.makeSystemConfig {
modules = [
nix-system-graphics.systemModules.default
{
config = {
nixpkgs.hostPlatform = "x86_64-linux";
system-manager.allowAnyDistro = true;
system-graphics.enable = true;
};
}
];
};
};
}

View File

@@ -9,15 +9,15 @@
home.packages = with pkgs;[
# general
(config.lib.nixGL.wrap thunderbird)
(config.lib.nixGL.wrap keepassxc)
(config.lib.nixGL.wrap qbittorrent)
(config.lib.nixGL.wrap libreoffice-qt)
(config.lib.nixGL.wrap joplin-desktop)
thunderbird
keepassxc
qbittorrent
libreoffice-qt
joplin-desktop
# comms
(config.lib.nixGL.wrap teamspeak_client)
(config.lib.nixGL.wrap vesktop)
teamspeak_client
vesktop
];
home.sessionVariables = {
@@ -26,7 +26,7 @@
services.nextcloud-client = {
enable = true;
package = config.lib.nixGL.wrap pkgs.nextcloud-client;
package = pkgs.nextcloud-client;
startInBackground = true;
};
@@ -35,7 +35,7 @@
chromium = {
enable = true;
package = config.lib.nixGL.wrap pkgs.brave;
package = pkgs.brave;
};
mpv = lib.mkDefault {

View File

@@ -170,7 +170,7 @@ with lib;
alacritty = {
enable = true;
package = config.lib.nixGL.wrap pkgs.alacritty;
package = pkgs.alacritty;
settings = {
font = {
normal = {

View File

@@ -4,7 +4,7 @@
programs = {
firefox = {
enable = true;
package = config.lib.nixGL.wrap pkgs.firefox;
package = pkgs.firefox;
languagePacks = [
"en-GB"
];

View File

@@ -3,7 +3,7 @@
{
home.packages = with pkgs;[
steamguard-cli
(config.lib.nixGL.wrap bottles)
(config.lib.nixGL.wrap inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".ryujinx-greemdev)
bottles
inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".ryujinx-greemdev
];
}

View File

@@ -1,5 +0,0 @@
#!/bin/bash
echo "unset LD_PRELOAD"
unset LD_PRELOAD
source /etc/profile.d/nix.sh
exec "$@"