!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

611 Members
121 Servers

Load older messages


SenderMessageTime
14 Apr 2024
@bootstrapper:matrix.orgIdo Samuelson changed their profile picture.04:54:41
@aftix:matrix.org@aftix:matrix.org joined the room.05:21:45
@aftix:matrix.org@aftix:matrix.org Is it possible to pin a flake's input to a specific package in nixpkgs? i.e. I would like to use a flake A from a "github:...", but A has an input B that points at another "github:...", and i'd like to point it at the pkgs.B i have in my environment.systemPackages instead 05:23:41
@windchimesofmagic:matrix.org@windchimesofmagic:matrix.org left the room.17:38:14
15 Apr 2024
@peacememories:matrix.orgpeacememories (Old)
In reply to @aftix:matrix.org
Is it possible to pin a flake's input to a specific package in nixpkgs? i.e. I would like to use a flake A from a "github:...", but A has an input B that points at another "github:...", and i'd like to point it at the pkgs.B i have in my environment.systemPackages instead
can you share which flake this is? what you can do kind of depends on how that flake is structured in my experience.
i don't think overriding an input with a specific package will work, since nix flakes expect inputs to always be flakes.
a lot of flakes are structured in a way that you can pass a package override to one of its functions. or maybe it has an overlay that you can use instead of packages output, that does not specify the dependency you want to override?
05:35:58
@aftix:matrix.org@aftix:matrix.orgIt's the hyprland-plugins flake and I would like to pin it against the hyprland package in unstable. The plugins flake starts off with `inherit (inputs.hyprland) nixpkgs` so it seems to me like it won't be possible 05:40:22
@nat:nekopon.plnat joined the room.17:04:08
16 Apr 2024
@dunxen:matrix.orgdunxen joined the room.12:23:18
@gdarends:matrix.orggdarends joined the room.12:26:46
@gdarends:matrix.orggdarendsHi all13:33:31
@gdarends:matrix.orggdarendsBeen experimenting with NixOS and it's been great so far.13:33:59
@gdarends:matrix.orggdarendsI did come across an application that I need to install but it is not in nixpkgs and I'm wondering how to install this. It's an application which I can find the executable binary on the product website. I searched the internet and there is some suggestion to create a derivation which I did. But I don't know how to load this in my flake. I couldn't find any example of how to do this.13:36:58
@gdarends:matrix.orggdarends
{ lib, stdenv, fetchurl, ...}:

stdenv.mkDerivation rec {
    name = "stereo_tool_gui_jack_64";
    version = "10.30";
    src = fetchurl {
        curlOpts = [ "-L" ];
        url = "https://www.stereotool.com/download/stereo_tool_gui_jack_64";
        sha = "b32d69b3892732548a55aa5241327afbc43bc7bd3f0a94548fb524596524ada2";
    };

    installPhase = ''
        mkdir -p $out/bin
        mkdir -p $out/share/applications
        cp $src $out/bin
    '';
}
13:41:59
@gdarends:matrix.orggdarendsI saved this file in my flake project. But how do I call this?13:42:44
@kranzes:matrix.orgIlan Joselevich (Kranzes)
In reply to @gdarends:matrix.org
I saved this file in my flake project. But how do I call this?
packages.X.Y = inputs.nixpkgs.legacyPackages.X.callPackage ./file.nix { };
14:00:43
@kranzes:matrix.orgIlan Joselevich (Kranzes)X being the system architecture14:00:56
@kranzes:matrix.orgIlan Joselevich (Kranzes)Y being the name of the package output14:01:01
@kranzes:matrix.orgIlan Joselevich (Kranzes)replace file with the file name14:01:06
@kranzes:matrix.orgIlan Joselevich (Kranzes) * replace file.nix with the file name14:01:17
@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

Show newer messages


Back to Room ListRoom Version: 6