There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

lloram239 ,

Good question. NUR doesn’t seem to output the packages directly, but requires that you supply your pkgs manually. You can use nix shell with NUR, but it gets rather ugly:


<span style="color:#323232;">nix shell --impure --expr '(import (builtins.getFlake github:nix-community/NUR) { pkgs = (import  {}).pkgs; }).repos.mic92.hello-nur'
</span>

nix registry doesn’t help here, as it’s just for managing aliases that allow you to type “nixpkgs” instead of “github:NixOS/nixpkgs/nixos-23.05” in some places.

It might be possible to write a flake that outputs NUR packages for direct use, e.g. something like:


<span style="color:#323232;">{
</span><span style="color:#323232;">  inputs = {
</span><span style="color:#323232;">    nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
</span><span style="color:#323232;">    flake-utils.url = "github:numtide/flake-utils";
</span><span style="color:#323232;">    nur_src.url = "github:nix-community/NUR";
</span><span style="color:#323232;">  };
</span><span style="color:#323232;">
</span><span style="color:#323232;">  outputs = { self, nixpkgs, flake-utils, nur_src }:
</span><span style="color:#323232;">    flake-utils.lib.eachDefaultSystem (system:
</span><span style="color:#323232;">      let
</span><span style="color:#323232;">        pkgs = nixpkgs.legacyPackages.${system};
</span><span style="color:#323232;">        nurpkgs = import "${nur_src}/default.nix" { pkgs = pkgs; nurpkgs = pkgs; };
</span><span style="color:#323232;">      in {
</span><span style="color:#323232;">        packages = nurpkgs.repos.mic92; // FIXME: this needs more work and filtering
</span><span style="color:#323232;">      }
</span><span style="color:#323232;">    );
</span><span style="color:#323232;">}
</span>

Which gives:


<span style="color:#323232;">$ nix --allow-import-from-derivation flake show .
</span><span style="color:#323232;">git+file:///
</span><span style="color:#323232;">└───packages
</span><span style="color:#323232;">    ├───aarch64-darwin
</span><span style="color:#323232;">    │   ├───bing-image-creator: package 'python3.10-bing-image-creator-0.4.4'
</span><span style="color:#323232;">    │   ├───clearsans: package 'clearsans-1.00'
</span><span style="color:#323232;">    │   ├───cntr: package 'cntr-1.5.1'
</span><span style="color:#323232;">    │   ├───conky-symbols: package 'ConkySymbols'
</span><span style="color:#323232;">    │   ├───eapol_test: package 'eapol_test-2.10'
</span><span style="color:#323232;">    │   ├───edge-gpt: package 'python3.10-edge-gpt-0.13.1'
</span><span style="color:#323232;">    │   ├───fira-code-pro-nerdfonts: package 'nerdfonts-3.0.1'
</span><span style="color:#323232;">    │   ├───gatttool: package 'bluez-5.66'
</span><span style="color:#323232;">    │   ├───gdb-dashboard: package 'gdb-dashboard-0.11.4'
</span>

But needs some more work and might be reinventing the wheel. Haven’t used NUR myself and no idea what the state of flakes in NUR is.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines