Skip to content

Add NixOS support - #215

Open
UMCEKO wants to merge 3 commits into
eklonofficial:mainfrom
UMCEKO:nix-support
Open

UMCEKO wants to merge 3 commits into
eklonofficial:mainfrom
UMCEKO:nix-support

Conversation

@UMCEKO

@UMCEKO UMCEKO commented Sep 21, 2026

Copy link
Copy Markdown

Adds NixOS support: a flake, nix/package.nix and a services.vice NixOS module that installs the package, the udev rule and the user daemon.

inputs.vice.url = "github:eklonofficial/Vice";
# modules = [ vice.nixosModules.default { services.vice.enable = true; } ];

Both entry points are wrapped with ffmpeg, gpu-screen-recorder, wf-recorder, the clipboard/window tools and cloudflared on PATH, and PyQt6 WebEngine is included so the Qt backend is used. vice doctor/uninstall also recognise a store install instead of suggesting yay.

Tested on NixOS unstable: daemon runs, hotkeys work, clips save.

@eklonofficial

Copy link
Copy Markdown
Owner

Are there any compromises or is there full feature parity?

@UMCEKO

UMCEKO commented Sep 22, 2026 •

Copy link
Copy Markdown
Author

Are there any compromises or is there full feature parity?

Well, I haven't noticed any compromises since I've been actively using it since yesterday.

@UMCEKO

UMCEKO commented Sep 22, 2026

Copy link
Copy Markdown
Author

@idle-river idle-river left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use Nix on the daily and this looks fine to me. Just wondering if this is specific to X11 or compatible with Wayland as well?

@UMCEKO

UMCEKO commented Sep 23, 2026 •

Copy link
Copy Markdown
Author

I use Nix on the daily and this looks fine to me. Just wondering if this is specific to X11 or compatible with Wayland as well?

I am using this on wayland, so yeah.

@idle-river idle-river left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been using it for a bit, works fine.

@eklonofficial

Copy link
Copy Markdown
Owner

Thanks for this. I went through it properly:

  • Merged it into current main locally and the suite is clean (693 tests).
  • Checked it changes nothing for everyone else: on an Arch install _installed_via_nix() is false and the update hint stays on yay, same as before.
  • I do not have Nix here, so I evaluated the flake in a nixos/nix container. The package and the default module both evaluate. I did not build it, since that pulls all of QtWebEngine, so your NixOS test is still the only real build.

One thing I would want changed before this goes in. version = "2.13.0" is hardcoded, and the flake already evaluates to vice-clipper-2.13.0 while main is on 2.13.1. It will drift every release, and nobody here will notice because none of us run Nix. Reading it from the source fixes that for good. I tested this in the same container and it returns 2.13.1:

version = builtins.head (builtins.match
  .*__version__ = "([^"]+)".*
  (builtins.readFile ../vice/__init__.py));

And a small one: the doCheck = false comment says the suite needs a real compositor and GPU. It does not, it runs headless in CI on every push, so please either turn the checks on or just say they are off to keep the build quick.

@eklonofficial

Copy link
Copy Markdown
Owner

Heads up: main now has a packaging workflow, and it includes a Nix job that switches on whenever a flake.nix exists. So your next push will run it: it checks the flake's version against vice/__init__.py, then does a full nix build.

As things stand the version check will fail. On the merge result the flake says 2.13.0 and main says 2.14.0, which is exactly the drift from my last comment. With the builtins.match change it passes: I ran the same check against your branch both ways. The build step hasn't run anywhere yet, so its first run on your PR will be the first real test, and CI there will need approving since it's from a fork. I'll keep an eye out for it.

NixOS cannot use the PKGBUILD or install.sh: there is no /usr to install
into and a venv of wheels will not link against the store's Python.

nix/package.nix builds the wheel with buildPythonApplication and wraps both
entry points with ffmpeg, gpu-screen-recorder, wf-recorder, the clipboard and
window tools and cloudflared on PATH, so shutil.which finds them without the
user installing anything. It pulls in PyQt6 WebEngine and qtpy by default, so
the app gets the Chromium backend rather than falling back to WebKitGTK.

nix/module.nix adds services.vice: it installs the package, registers the
uaccess udev rule the hotkey listener needs, and defines the user daemon with
the same [Unit]/[Service] settings as packaging/vice.service.

vice doctor and the update notice also learn about a store install, so they
stop telling NixOS users to run yay or delete files Nix owns.
Without it gsr-kms-server is started through pkexec, which asks for a
password every time the recorder restarts, including on each settings save.
A hardcoded version drifts every release. The suite runs headless, so the
build now runs it too; build/ is removed first since the em-dash guard walks
the whole tree and would scan setuptools' copy of the bundle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants