commit c5acd887a0c3b7e8bdbfac27e790925d90cd276e Author: pleb Date: Mon May 11 22:46:07 2026 -0700 init nix flake for running arrowvortex via wine diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4495868 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +result +AGENTS.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c2f97ed --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# ArrowVortex (Nix flake) + +This flake packages [ArrowVortex](https://github.com/uvcat7/ArrowVortex) from the upstream Windows release zip and runs it with Wine. The default Wine prefix is `$XDG_DATA_HOME/arrowvortex/wine` (or `~/.local/share/arrowvortex/wine` when `XDG_DATA_HOME` is unset). Override with `WINEPREFIX` if you want a different prefix. + +## Run from a local checkout + +```bash +nix run . +``` + +```bash +nix build . +./result/bin/arrowvortex +``` + +## Run directly from Git + +This flake lives at [https://git.plebsaber.stream/arrowvortex-wine](https://git.plebsaber.stream/arrowvortex-wine). Use a `git+https` flake reference (not the `github:` shorthand): + +```bash +nix run git+https://git.plebsaber.stream/arrowvortex-wine +``` + +Optional: install into your user profile: + +```bash +nix profile install git+https://git.plebsaber.stream/arrowvortex-wine +``` + +Pin a branch or revision for reproducibility: + +```bash +nix run 'git+https://git.plebsaber.stream/arrowvortex-wine?ref=main' +nix run 'git+https://git.plebsaber.stream/arrowvortex-wine?rev=' +``` + +## Requirements + +- Nix with flakes enabled (`experimental-features = nix-command flakes`). + +Wine and GUI dependencies come from nixpkgs; you need a working display (X11 or Wayland) for the editor window. diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..8d4479d --- /dev/null +++ b/default.nix @@ -0,0 +1,75 @@ +{ + lib, + stdenvNoCC, + fetchzip, + copyDesktopItems, + makeDesktopItem, + makeWrapper, + wineWow64Packages, +}: + +let + winePkg = wineWow64Packages.stableFull; +in +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "arrowvortex"; + version = "1.0.1"; + + src = fetchzip { + url = "https://github.com/uvcat7/ArrowVortex/releases/download/v${finalAttrs.version}/ArrowVortex-${finalAttrs.version}-Windows.zip"; + hash = "sha256-gVhP2O4GHLii1K9Jr2GKyp+FJYP8eoL1s1qmAec6x0w="; + }; + + nativeBuildInputs = [ + makeWrapper + copyDesktopItems + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/arrowvortex + # fetchzip normalizes the zip root; files land directly under $src + cp -r $src/. $out/share/arrowvortex/ + + install -Dm644 "$out/share/arrowvortex/assets/arrow vortex icon.png" \ + $out/share/icons/hicolor/128x128/apps/arrowvortex.png + + makeWrapper ${lib.getExe winePkg} $out/bin/arrowvortex \ + --set WINEDEBUG "-all" \ + --set WINEARCH "win64" \ + --run 'export WINEPREFIX="''${WINEPREFIX:-''${XDG_DATA_HOME:-''$HOME/.local/share}/arrowvortex/wine}"' \ + --run 'mkdir -p "''$WINEPREFIX"' \ + --chdir "$out/share/arrowvortex" \ + --add-flags "ArrowVortex.exe" + + runHook postInstall + ''; + + desktopItems = [ + (makeDesktopItem { + name = "arrowvortex"; + desktopName = "ArrowVortex"; + comment = "Simfile editor for StepMania, ITG, osu!, and similar rhythm games"; + exec = "arrowvortex"; + icon = "arrowvortex"; + categories = [ + "AudioVideo" + "Utility" + ]; + startupWMClass = "arrowvortex.exe"; + }) + ]; + + meta = { + description = "Simfile editor for StepMania, ITG, osu!, and similar rhythm games"; + homepage = "https://github.com/uvcat7/ArrowVortex"; + changelog = "https://github.com/uvcat7/ArrowVortex/releases"; + downloadPage = "https://github.com/uvcat7/ArrowVortex/releases"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.gpl3Plus; + mainProgram = "arrowvortex"; + maintainers = [ ]; + platforms = winePkg.meta.platforms; + }; +}) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4fe7997 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1777954456, + "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0c2595f --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "ArrowVortex (Windows release) wrapped with Wine"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = + { nixpkgs, ... }: + let + lib = nixpkgs.lib; + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + forAllSystems = f: lib.genAttrs systems (system: f system); + in + { + packages = forAllSystems ( + system: + let + pkgs = import nixpkgs { + inherit system; + config = { }; + }; + in + { + default = pkgs.callPackage ./default.nix { }; + arrowvortex = pkgs.callPackage ./default.nix { }; + } + ); + + apps = forAllSystems ( + system: + let + pkgs = import nixpkgs { + inherit system; + config = { }; + }; + arrowvortex = pkgs.callPackage ./default.nix { }; + in + { + default = { + type = "app"; + program = "${lib.getExe arrowvortex}"; + meta = { + inherit (arrowvortex.meta) description homepage license; + }; + }; + } + ); + }; +}