diff --git a/README.md b/README.md index 3defb12..06d3afa 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,28 @@ Windows XP as your desktop background. This embeds a GTK-based webview to use https://winxp.vercel.app/ as your desktop background. Only works on Wayland with gtk-layer-shell. + +## Nix + +1. Import the repo as an overlay: + +```nix +let + nixpkgs = import nixpkgs { + inherit system; + overlays = [ + (import winxpbg) + ]; + }; +in +... +``` +2. Launch it with your desktop environment or window manager, for example with Niri: + +```nix +{ + programs.niri.settings.spawn-at-startup = [ + { command = [ (lib.getExe pkgs.winxpbg) ]; } + ]; +} +``` diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..f1d99d3 --- /dev/null +++ b/default.nix @@ -0,0 +1,4 @@ +# Overlay +final: _: { + winxpbg = final.callPackage ./package.nix { }; +} diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..a02dcda --- /dev/null +++ b/package.nix @@ -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"; + }; +}