!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

624 Members
128 Servers

Load older messages


SenderMessageTime
16 Apr 2024
@tomberek:matrix.orgtomberekYou can get more complicated with using overlays or a flake helper library, but normally, I recommend just to start simple with something like this.14:05:07
@gdarends:matrix.orggdarends

Where exactly do I add this? I added it to the modules but that returned an error.

....
nixosConfigurations = {
  nixos = nixpkgs.lib.nixosSystem {
    specialArgs = ....
    system = ....
    modules = [
    ]
.......
.....
14:16:50
@dramforever:matrix.orgdramforever in flake.nix 14:25:29
@gdarends:matrix.orggdarends
outputs = { self, nixpkgs, nixpkgs-unstable }@inputs: 
  let
    system = "x86_64-linux";
    specialArgs = inputs // { inherit system; };
  in
  {
    nixosConfigurations = {
      audioproc1 = nixpkgs.lib.nixosSystem {
        specialArgs = specialArgs;
        system = system;
        modules = [ 
          ./hosts/audioproc1/configuration.nix
          ./nixosModules
          { packages.${system}.stereo_tool_gui_jack_64 = nixpkgs.legacyPackages.${system}.callPackage ./packages/stereo_tool_gui_jack_64.nix {}; }
        ];
      };
    };
  };

I did this, but I get an error that "packages" does not exist.

14:34:29
@tomberek:matrix.orgtomberekThe packages expression goes further up, alongside the nixosConfigurations. It is a top-level flake output. Now, you seem to want to add this to your NixOS configuration as well. I recommend you do this in steps, to help understand how things are wired up. First figure out how to just build that package (using "nix build", not "nixos-rebuild"). Then learn enough about overlays to incorporate the package into your config.14:44:32
@gdarends:matrix.orggdarends tomberek: as suggested I tried to build the package first. But I think I hit a wall and don't I will be able to get this working. I got an error "cannot execute: required file not found". After reading some more it's probably because the binary is not made for nixos filesystem structure. 16:19:21
@gdarends:matrix.orggdarendsI tried just downloading the binary and running it and I get the same issue. 16:19:58
@tomberek:matrix.orgtomberekIt looks like you are taking a pre-built binary that has dependencies, dynamic loader, etc that will not work as-is on NixOS. This is on purpose, as the Nix reliability benefits come from having these things being tracked rather than accidentally working "most of the time". I recommend reading through: https://nixos.wiki/wiki/Packaging/Binaries16:28:33
@gdarends:matrix.orggdarendsHello again. Thanks for this. I've gotten the app to launch. But I'm still having some problems with the derivation.19:36:33
@gdarends:matrix.orggdarends

I did this:

preFixup = let
    libPath = lib.makeLibraryPath [
      xorg.libX11
      xorg.libXpm
      alsa-lib
      zlib
    ];
    in ''
      patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
        --set-rpath "${libPath}" $out/bin/stereo_tool_gui_jack_64
    '';

But I'm getting an error of "No such file or directory"

It produces the following, which has a prefix for the file name.

and in the patchelf I'm referencing $out/bin/stereo_tool_gui_jack_64.

So I think there is a mismatch happening there.

19:41:07
@gdarends:matrix.orggdarendsRedacted or Malformed Event19:42:30
@gdarends:matrix.orggdarends *

I did this:

preFixup = let
    libPath = lib.makeLibraryPath [
      xorg.libX11
      xorg.libXpm
      alsa-lib
      zlib
    ];
    in ''
      patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
        --set-rpath "${libPath}" $out/bin/stereo_tool_gui_jack_64
    '';

But I'm getting an error of "No such file or directory"

It produces the following, which has a prefix for the file name.

nix/store/1rfxwagch6q2xsx6si07rw2sm0lgn1wy-stereo_tool_gui_jack_64-v10.30/bin/xn02wh7bk6fww0l9kpnn4mbmgx4505by-stereo_tool_gui_jack_64

and in the patchelf I'm referencing $out/bin/stereo_tool_gui_jack_64.

So I think there is a mismatch happening there.

19:43:28
@gdarends:matrix.orggdarends
Running phase: fixupPhase
patchelf: getting info about '/nix/store/1rfxwagch6q2xsx6si07rw2sm0lgn1wy-stereo_tool_gui_jack_64-v10.30/bin/stereo_tool_gui_jack_64': No such file or directory
19:51:13
@tomberek:matrix.orgtomberek gdarends: in your original where you have "cp $src $out/bin" you should do something more like: "cp $src $out/bin/stereo_tool_gui_jack_64" 19:54:01
@kiike:matrix.orgEnric Morales joined the room.19:59:20
@kiike:matrix.orgEnric MoralesRedacted or Malformed Event20:09:14
@gdarends:matrix.orggdarends tomberek: Great! Build succeeded. Now for the next part to add to nixOS configuration. 20:16:04
@gdarends:matrix.orggdarends * tomberek: Great! Build succeeded. Now for the next part... add to nixOS configuration. 20:16:26
@tomberek:matrix.orgtomberek

almost there..... now you use an overlay to add your package to the "pkgs" available in your NixOS config.... something close to this:

 nixosConfigurations = {
      audioproc1 = nixpkgs.lib.nixosSystem {
        specialArgs = specialArgs;
        system = system;
        modules = [
          {
            nixpkgs.overlays = [(final: prev: {
              inherit (self.packages.${system}) stereo_tool_gui_jack_64;
           })];
          }
          ./hosts/audioproc1/configuration.nix
          ./nixosModules
        ];
      };
    };
21:12:39
@kiike:matrix.orgEnric Moralesplease correct me if I'm wrong, but maybe I should make an overlay when installing papis, so that it includes papis-zotero, then?21:24:51
@kiike:matrix.orgEnric Moralessince the papis-zotero sitedir needs to be patched in papis, right?21:25:36
17 Apr 2024
@alex3829:matrix.org@alex3829:matrix.org changed their display name from alex3829 to real_z22.04:36:32
@alex3829:matrix.org@alex3829:matrix.org changed their display name from real_z22 to real_z2.05:34:01
@ahoneybun:matrix.orgahoneybun changed their profile picture.15:23:58
@JoelMcCracken:matrix.orgJoelMcCracken joined the room.16:21:40
@lychee:lefishe.club@lychee:lefishe.club changed their display name from kay to kaylee.17:10:13
18 Apr 2024
@fractivore:cyberia.club@fractivore:cyberia.club left the room.02:36:53
19 Apr 2024
@jnglrobba:matrix.orgjunglerobba joined the room.08:00:19
@lychee:lefishe.club@lychee:lefishe.club changed their profile picture.12:19:27
@tanja-6584:matrix.orgTanja (Old; I'm now @tanja:catgirl.cloud) changed their display name from Tanja to Tanja (Old).14:20:55

Show newer messages


Back to Room ListRoom Version: 6