Add nix derivation and overlay

This commit is contained in:
Ross Smyth 2025-12-26 18:32:39 -05:00
parent 39be4753e4
commit 59fc159b33
2 changed files with 49 additions and 0 deletions

4
default.nix Normal file
View file

@ -0,0 +1,4 @@
# Overlay
final: _: {
winxpbg = final.callPackage ./package.nix { };
}

45
package.nix Normal file
View file

@ -0,0 +1,45 @@
{
lib,
rustPlatform,
pkg-config,
wrapGAppsHook4,
glib,
gtk4,
webkitgtk_6_0,
gtk4-layer-shell,
}:
let
fs = lib.fileset;
files = fs.unions [
./view
];
in
rustPlatform.buildRustPackage {
pname = "winxpbg";
inherit ((builtins.fromTOML (builtins.readFile ./view/Cargo.toml)).package) version;
src = fs.toSource {
root = ./view;
fileset = files;
};
cargoLock.lockFile = ./view/Cargo.lock;
nativeBuildInputs = [
pkg-config
wrapGAppsHook4
];
buildInputs = [
glib
gtk4
webkitgtk_6_0
gtk4-layer-shell
];
meta = {
description = "Windows XP as your desktop background";
mainProgram = "minxpbg";
};
}