Add customized xone package

This commit is contained in:
Manuel Thalmann 2024-05-08 09:58:18 +02:00
parent 5406a24edc
commit 820ef6729d
3 changed files with 43 additions and 12 deletions

View file

@ -61,6 +61,17 @@
machineDefinitions;
tryFiles = import ./lib/utils/try-files.nix { inherit lib; };
xonePatcher = { fetchFromGitHub, xone }:
xone.overrideAttrs (
final: prev: {
src = fetchFromGitHub {
owner = "manuth";
repo = "xone";
rev = "954fc823fbaa429ad6e1c1a06a4a006598ef35ae";
sha256 = "lsfm7WDXTB6t05AI/pp17yZvkNvnM2WBMUHL1eVO6qw=";
};
});
in
flake-utils.lib.eachDefaultSystem (
system:
@ -73,17 +84,6 @@
sops-nix.overlays.default
];
};
xonePatcher =
xone: (xone.overrideAttrs (
final: prev: {
src = pkgs.fetchFromGitHub {
owner = "manuth";
repo = "xone";
rev = "954fc823fbaa429ad6e1c1a06a4a006598ef35ae";
sha256 = "lsfm7WDXTB6t05AI/pp17yZvkNvnM2WBMUHL1eVO6qw=";
};
}));
in {
packages = {
rcloneDocs =
@ -103,7 +103,10 @@
pkgs.runCommand "options-doc.md" {} ''
cat ${optionsDoc.optionsCommonMark} >> $out
'';
xone = xonePatcher pkgs.linuxPackages_latest.xone;
xone = xonePatcher {
inherit (pkgs) fetchFromGitHub;
inherit (pkgs.linuxPackages_latest) xone;
};
};
devShells.default = pkgs.mkShellNoCC (
@ -139,6 +142,8 @@
{ pkgs, ... }: {
config = {
_module.args = {
inherit xonePatcher;
machine = machine // {
name = hostname;
config = (pkgs.callPackage config { });

View file

@ -5,6 +5,7 @@
./modules/my-users.nix
./modules/sddm.nix
./modules/unfree.nix
./modules/xone.nix
];
config = {
@ -102,6 +103,9 @@
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Drivers
hardware.xone.enable = (lib.mkIf machine.config.xone true);
# Enable KDE Plasma
services.displayManager.sddm = {
enable = true;

22
lib/modules/xone.nix Normal file
View file

@ -0,0 +1,22 @@
{ lib, pkgs, xonePatcher, ... }: {
config = {
nixpkgs = {
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"xow_dongle-firmware"
];
overlays = [
(final: prev: {
linuxPackages = prev.linuxPackages.extend (
final: prev: {
xone = xonePatcher {
inherit (pkgs) fetchFromGitHub;
inherit (prev) xone;
};
}
);
})
];
};
};
}