Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiny-dfr: init at 0.2.0 #277549

Merged
merged 1 commit into from
May 15, 2024
Merged

tiny-dfr: init at 0.2.0 #277549

merged 1 commit into from
May 15, 2024

Conversation

alyssais
Copy link
Member

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@n8henrie
Copy link
Contributor

Thanks for packaging!

How are you using this?

I get this:

$ sudo /tmp/tmp.Xx745C5nhu/result/bin/tiny-dfr
thread 'main' panicked at src/main.rs:314:43:
called `Result::unwrap()` on an `Err` value: No touchbar device found, attempted: [
    /dev/dri/card2: Device or resource busy (os error 16),
    /dev/dri/card1: Operation not supported (os error 95),
    /dev/dri/card0: Device or resource busy (os error 16)
]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Others seem to be having trouble too: https://github.com/WhatAmISupposedToPutHere/tiny-dfr/issues

@thedaringdev
Copy link
Contributor

Thanks for packaging!

How are you using this?

I get this:

$ sudo /tmp/tmp.Xx745C5nhu/result/bin/tiny-dfr
thread 'main' panicked at src/main.rs:314:43:
called `Result::unwrap()` on an `Err` value: No touchbar device found, attempted: [
    /dev/dri/card2: Device or resource busy (os error 16),
    /dev/dri/card1: Operation not supported (os error 95),
    /dev/dri/card0: Device or resource busy (os error 16)
]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Others seem to be having trouble too: https://github.com/WhatAmISupposedToPutHere/tiny-dfr/issues

I just tried building the package on my MacBook Pro (13-inch, M1, 2020) running nixos-apple-silicon and it works fine.

@n8henrie
Copy link
Contributor

Interesting, im using the same year and model also on nixos-silicon.

Are you just running the binary like I did above? From a graphical session? If so, what DE are you on? Wayland?

Thanks for any details you can provide.

nativeBuildInputs = [ pkg-config ];
buildInputs = [ cairo gdk-pixbuf glib libinput libxml2 pango udev ];

postConfigure = ''
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
postConfigure = ''
postPatch = ''

Copy link
Member Author

Choose a reason for hiding this comment

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

Why? I think this makes more semantic sense in configurePhase, since that's where build systems (when they actually support it like autoconf, cmake or meson, and unlike cargo) will do this sort of substitution based on configuration.

Copy link
Member

Choose a reason for hiding this comment

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

Well, it's kinda a patch, so it should live in patchPhase

Copy link
Contributor

Choose a reason for hiding this comment

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

is this blocking an addition of this pkg? I would personally go with patch phase since there is no real support for configuration upstream, however I don't think it's really essential

Copy link
Member Author

Choose a reason for hiding this comment

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

There's no real support for patching upstream either, but the fact is that we have a configure phase, and replacing placeholder paths with environment-specific ones is exactly what the configure phase is for. I don't intend to change it.

pkgs/by-name/ti/tiny-dfr/package.nix Show resolved Hide resolved
@thedaringdev
Copy link
Contributor

thedaringdev commented Apr 17, 2024

@n8henrie I am using Hyprland. Interestingly enough I switched over to plasma6 with wayland to try as well and I received the No touchbar device found Error.

Heres what I did

nix-build -A tiny-dfr
cd result/bin
sudo ./tiny-dfr

@n8henrie
Copy link
Contributor

Ok, thanks. I'm on plasma (wayland). I've been trying to get Hyprland to work but have been unable (tpwrules/nixos-apple-silicon#159 tpwrules/nixos-apple-silicon#136)

@thedaringdev
Copy link
Contributor

Ok, thanks. I'm on plasma (wayland). I've been trying to get Hyprland to work but have been unable (tpwrules/nixos-apple-silicon#159 tpwrules/nixos-apple-silicon#136)

@n8henrie a workaround was recently discovered. You should be able to get it working by adding the following to your nix config.

  environment.variables = {
    WLR_DRM_DEVICES = "/dev/dri/card0";
  };

@n8henrie
Copy link
Contributor

@thedaringdev yes, I saw that thread! I'm excited to give it a shot the next time I reboot into NixOS (still mostly MacOS + nix-darwin on this machine). Thanks for making sure I had heard the good news.

@alyssais alyssais force-pushed the tiny-dfr branch 2 times, most recently from 3177e36 to a165e27 Compare May 3, 2024 11:26
Copy link
Contributor

@zvolin zvolin left a comment

Choose a reason for hiding this comment

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

can confirm it works perfectly for me on m2 pro with following config:

{ lib, pkgs, config, inputs, ... }:

{
  options.services.tiny-dfr.enable = lib.mkEnableOption "tiny-dfr";

  config = lib.mkIf config.services.tiny-dfr.enable (let
    tiny-dfr = inputs.nixpkgs-alyssais.legacyPackages.aarch64-linux.tiny-dfr;
  in {
    environment.systemPackages = [ tiny-dfr ];
    systemd.packages = [ tiny-dfr ];
    services.udev.packages = [ tiny-dfr ];

    environment.etc."tiny-dfr/screenshot.svg".text = ''
       ...some new svg
    '';

    environment.etc."tiny-dfr/config.toml".text = ''
      ...some tweaks
      '';
  });
}

@thedaringdev
Copy link
Contributor

Any updates on this?

@alyssais alyssais merged commit a784860 into NixOS:master May 15, 2024
24 checks passed
@alyssais alyssais deleted the tiny-dfr branch May 15, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants