Skip to content

NixOS #17

Open
Open

Description

@mbrignall

Hi there,

Great project!

Is there a plan to package this for NixOS?

Best,

M.

Activity

  1. ldelossa commented on May 30, 2024

    @ldelossa
    Owner

    Hey there.

    Not unless a community member contributes this. I will only maintain packages for the distro I currently use, which is Fedora.

  2. sudanchapagain commented on Jun 9, 2024

    @sudanchapagain

    With some help, i managed to build the binary with nix-shell. As in it's still using make but uses nix-shell to provide the paths for dependencies. However, i had to add a new entry to the Make file dependency

    DEPS := libadwaita-1 \
    		gtk4-layer-shell-0 \
    		upower-glib \
    		wireplumber-0.5 \
    ++		libpipewire-0.3 \
    		json-glib-1.0 \
    		libnm \
    		libpulse \
    		libpulse-simple \
    		libpulse-mainloop-glib \

    shell.nix:

    with import <nixpkgs> {};
    mkShell {
      name = "env";
      packages = [
        pkg-config
        gtk4
        libadwaita
        gtk4-layer-shell
        upower
        wireplumber
        pipewire.dev
        json-glib
        networkmanager.dev
        libpulseaudio
        wayland-protocols
        wayland-utils
        xwayland
        glib.dev
      ];
    }

    just add these to the root of repo run nix-shell & then make

    NOTE: 1. I have not mapped exact dependencies in nix-shell. I should have used nix-locate or something as such it might contain unnecessary dependencies. 2. I have not ran the binary as i am in gnome and ran into a error which is i think is because i am not in sway.

  3. ldelossa commented on Jun 9, 2024

    @ldelossa
    Owner

    Very cool! Id love to help out more here but Im not too Nix savvy.

    Your comments around running in Gnome is right. We fail if we can't take a few dbus names, which Gnome is almost definitely owning.

  4. sudanchapagain commented on Jun 10, 2024

    @sudanchapagain

    I just tried running it on sway but i got an error.

    (way-shell:5405): GLib-GIO-ERROR **: 15:54:42.969: Settings schema 'org.ldelossa.way-shell.window-manager' is not installed
    Trace/breakpoint trap (core dumped)
    

    I am not sure why but i am assuming it's because it isn't installed in system as in it's not linked and is in nix store. idk.

  5. ldelossa commented on Jun 10, 2024

    @ldelossa
    Owner

    @sudanchapagain The gschema file has not be integrated with your system.

    Check out the makefile targets here:

    .PHONY:
    install-gschema:
    	glib-compile-schemas $(DESTDIR)$(SCHEMADIR)
    
    .PHONY:
    install:
    	install -D ./way-shell $(DESTDIR)$(BINDIR)/way-shell
    	install -D ./way-sh/way-sh $(DESTDIR)$(BINDIR)/way-sh
    	install -D data/org.ldelossa.way-shell.gschema.xml $(DESTDIR)$(SCHEMADIR)/org.ldelossa.way-shell.gschema.xml
    	install -D contrib/systemd/way-shell.service $(DESTDIR)$(USERUNITDIR)/way-shell.service
    

    After the install, a call to make install-gschema should be called to compile the gschema database.

    For instance, we do this in a post scriptlet in the rpm spec file:

    https://github.com/ldelossa/way-shell/blob/main/way-shell.spec#L64C1-L71C50

  6. sudanchapagain commented on Jul 23, 2024

    @sudanchapagain

    It's been long, i had exams. But today i have been trying to make a nixpkgs derivation. I have managed to compile the program and also generate the gschema file but it's not being used. I'm having huge skill issues with this, i'll see what i can do.

  7. ldelossa commented on Jul 23, 2024

    @ldelossa
    Owner

    @sudanchapagain thanks!

    Check out the RPM spec: https://github.com/ldelossa/way-shell/blob/main/way-shell.spec#L65-L69
    We basically do an install and then install the gschema.

    You may need to figure out where the gschema directory is on your system. Maybe this is covered in NixOS documentation somewhere? At the minimum you can probably just do a search for 'gschemas.compiled' file at the root of your OS, and find the directory that looks like a unix standard path like "/usr/share/..." or similar.

  8. sudanchapagain commented on Jul 23, 2024

    @sudanchapagain

    I did look at it, by generating gschema file i meant i managed to get the .xml file (it was not being generated last time or i never looked at it idk), in short i don't have the .compiled file.

    In nix, the packages are sandboxed(?) and it exists in /nix/store/<someHash>-way-shell-<version>/. Each build generates a new hash as such new directory. The directory acts as the root for the package. /usr/share usr/bin all exists in that directory for each package for each build.

    The issue i have right now is, during build for some reason, calling glib-compile-schemas $out/share/glib-2.0/schemas is not compiling the .xml even tho the build succeeds.

    $out is the current build's hash directory on /nix/store

  9. ldelossa commented on Jul 23, 2024

    @ldelossa
    Owner

    @sudanchapagain hmm, and you see that the way-shell gschema file is in that directory?

  10. sudanchapagain commented on Jul 23, 2024

    @sudanchapagain

    on each build directory i see this

    .
    └── usr
        ├── bin
        │   ├── way-sh
        │   └── way-shell
        ├── lib
        │   └── systemd
        │       └── user
        │           └── way-shell.service
        └── share
            └── glib-2.0
                └── schemas
                    └── org.ldelossa.way-shell.gschema.xml
    
  11. ldelossa commented on Jul 23, 2024

    @ldelossa
    Owner

    Im not really sure how this should work with Nix.

    On a non-Nix system, dconf-enabled applications would place their gschema files in a well-known system path. Then, you compile all schemas in that path into one database. Dconf is then pointed to this path for the database.

    Maybe its worth looking at another project like WayBar which integrates with gschema/dconf as well. Maybe it has a nix build we can rip?

    Or maybe SwayNotificationCenter: https://github.com/ErikReider/SwayNotificationCenter/blob/main/data/org.erikreider.swaync.gschema.xml

  12. sudanchapagain commented on Jul 23, 2024

    @sudanchapagain

    Good suggestion, thank you!

    I managed to get this far because i was ripping things from the gnome application's nixpkgs package.nix files.

    I honestly couldn't understand the waybar's package.nix.

    SwayNotificationCenter appears to simply call this file during build https://github.com/ErikReider/SwayNotificationCenter/blob/main/build-aux/meson/postinstall.py

  13. sudanchapagain commented on Jul 24, 2024

    @sudanchapagain

    I tried today too, couldn't do it. I opened a issue in nixpkgs repo for packaging request.

    NixOS/nixpkgs#329583

  14. ldelossa commented on Jul 24, 2024

    @ldelossa
    Owner

    Thanks! Lets see what the response is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions