uhh yes
This commit is contained in:
parent
8226f5b933
commit
371db9222f
4 changed files with 59 additions and 17 deletions
37
flake.nix
37
flake.nix
|
|
@ -15,29 +15,32 @@
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
username = "xory";
|
username = "xory";
|
||||||
|
|
||||||
|
opentrack-overlay = import ./overlays/opentrack.nix;
|
||||||
|
|
||||||
mkNixosHost = hostName:
|
mkNixosHost = hostName:
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
impermanence.nixosModules.impermanence
|
{ nixpkgs.overlays = [ opentrack-overlay ]; }
|
||||||
./hosts/${hostName}/configuration.nix
|
impermanence.nixosModules.impermanence
|
||||||
./hosts/${hostName}/hardware-configuration.nix
|
./hosts/${hostName}/configuration.nix
|
||||||
|
./hosts/${hostName}/hardware-configuration.nix
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager {
|
home-manager.nixosModules.home-manager {
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.users.${username} = import ./hosts/${hostName}/home.nix;
|
home-manager.users.${username} = import ./hosts/${hostName}/home.nix;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = nixpkgs.lib.mapAttrs'
|
nixosConfigurations = nixpkgs.lib.mapAttrs'
|
||||||
(name: value: {
|
(name: value: {
|
||||||
name = name;
|
name = name;
|
||||||
value = mkNixosHost name;
|
value = mkNixosHost name;
|
||||||
})
|
})
|
||||||
(nixpkgs.lib.filterAttrs (name: value: value == "directory")
|
(nixpkgs.lib.filterAttrs (name: value: value == "directory")
|
||||||
(builtins.readDir ./hosts));
|
(builtins.readDir ./hosts));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,8 @@
|
||||||
variant = "";
|
variant = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
# services.printing.enable = true;
|
# services.printing.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@
|
||||||
input-leap
|
input-leap
|
||||||
viber
|
viber
|
||||||
hyprpolkitagent
|
hyprpolkitagent
|
||||||
|
pulsemixer
|
||||||
|
feh
|
||||||
|
opentrack
|
||||||
|
aitrack
|
||||||
];
|
];
|
||||||
|
|
||||||
home.file = {
|
home.file = {
|
||||||
|
|
|
||||||
33
overlays/opentrack.nix
Normal file
33
overlays/opentrack.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
# ./overlays/opentrack.nix
|
||||||
|
self: super: {
|
||||||
|
opentrack = super.opentrack.overrideAttrs (oldAttrs: {
|
||||||
|
# 1. Add dependencies for building (onnxruntime) and wrapping (makeWrapper)
|
||||||
|
nativeBuildInputs = oldAttrs.nativeBuildInputs or [] ++ [ super.makeWrapper ];
|
||||||
|
buildInputs = oldAttrs.buildInputs or [] ++ [ self.onnxruntime ];
|
||||||
|
|
||||||
|
# 2. Enable the neuralnet tracker feature during compile time
|
||||||
|
cmakeFlags = oldAttrs.cmakeFlags or [] ++ [ "-DSDK_NEURALNET=ON" ];
|
||||||
|
|
||||||
|
# 3. After installation, create a wrapper around the main binary
|
||||||
|
postInstall = (oldAttrs.postInstall or "") + ''
|
||||||
|
# Construct the full library path from all runtime dependencies
|
||||||
|
lib_path="${super.lib.makeLibraryPath [
|
||||||
|
super.qt5.qtbase
|
||||||
|
super.qt5.qtwayland
|
||||||
|
super.opencv
|
||||||
|
self.onnxruntime
|
||||||
|
super.procps
|
||||||
|
super.libevdev
|
||||||
|
]}"
|
||||||
|
|
||||||
|
# Construct the full Qt plugin path
|
||||||
|
qt_plugin_path="${super.qt5.qtbase.bin}/lib/qt-${super.qt5.qtbase.version}/plugins:${super.qt5.qtwayland}/lib/qt-${super.qt5.qtwayland.version}/plugins"
|
||||||
|
|
||||||
|
# Use makeWrapper to prepend the environment variables to the executable
|
||||||
|
# This modifies the binary at $out/bin/opentrack so it ALWAYS runs with this environment
|
||||||
|
wrapProgram $out/bin/opentrack \
|
||||||
|
--prefix LD_LIBRARY_PATH : "$lib_path" \
|
||||||
|
--prefix QT_PLUGIN_PATH : "$qt_plugin_path"
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue