efx
April 18, 2024, 8:47pm
1
I’m wandering through experimental lands of flake registries.
I found I can install my flakes using nix profile install gitlab:cool-group/cool-project/main?host=gitlab.mycompany.com
.
That seems verbose and error-prone for end-users.
I’d like to be able to say nix profile install mycompany#cool-group/cool-project
.
Have you found how to configure a custom registry to work with self-managed GitLab instances? Or something similar?
TLATER
April 18, 2024, 10:08pm
2
If you write the file by hand you can set the reference in attribute representation, which might allow you to set things like host
without specifying the rest - I haven’t tried this though: nix registry - Nix Reference Manual
afaik the details of what attributes are supported aren’t exactly documented though: nix flake - Nix Reference Manual
1 Like
Alternatively you can install custom local registry aliases through nix.registry
option.
Here’s an example of adding custom aliases (ns
= nixpkgs/23.11
, nu
= nixpkgs-unstable
, pin all system inputs as pinned-<inputname>
).
Which results in:
❯ nix registry list | grep -m1 'system'
system flake:ns path:/nix/store/yj20wqsmn7x89z6avx9syjwiirga9jpv-source?lastModified=1712543224&narHash=sha256-9RSfZL1TKYdGxZwgDxwtBtsKMGR4Zgn%2BDAnF9s71/lU%3D&rev=b0dab7cc34ef4d8a1b2de36178da801090bcb271
1 Like
efx
April 19, 2024, 6:09pm
4
Thanks for the ideas folks.
I’ve discovered a bug prevents me from using the path syntax I started with: #6614 broke flake URL decoding for Gitlab · Issue #9161 · NixOS/nix · GitHub
So I’ll like take the attribute representation / meta flake approach.
efx
April 23, 2024, 8:18pm
5
For posterity, my confusion and issue here looks like a duplicate of this same topic: Nix flake gitlab HTTP 404 error
efx
April 23, 2024, 8:46pm
6
Unfortunately I could not find a time and my nix flake knowledge reasonable way to install directly with nix profile <installable>
.
I solved my use case by:
clone the gitlab repository using a personal access token on the GNU/Linux instance
nix profile install ./cool-project/#my-app