| 28 Sep 2023 |
amnicolist | * Yes, I saw the stuff about consuming the overlay. That explained how to get the rust-overlay into the pkgs. I think I kind-of get that. The problem came when I wanted to actually install the package. I want to have multiple rust tool chains installed, nightly for some things etc. My understanding fell down when I tried to call something like
home.packages = with pkgs; [
rust-bin.stable.latest.default
];
Nixos would complain that it can't find rust-bin. I don't really get where it comes from in the overlay part so I couldn't reverse engineer the
(final:
# ... things you need to patch ...
})
| 01:00:42 |
| @jc:jc1.ca joined the room. | 03:34:17 |
| @jc:jc1.ca left the room. | 03:36:22 |
| @ThorHop:matrix.org changed their display name from hopland to hopland (negative nancy). | 21:37:10 |
| 29 Sep 2023 |
@petrichor:envs.net | In reply to @amnicolist:matrix.org
Yes, I saw the stuff about consuming the overlay. That explained how to get the rust-overlay into the pkgs. I think I kind-of get that. The problem came when I wanted to actually install the package. I want to have multiple rust tool chains installed, nightly for some things etc. My understanding fell down when I tried to call something like
home.packages = with pkgs; [
rust-bin.stable.latest.default
];
Nixos would complain that it can't find rust-bin. I don't really get where it comes from in the overlay part so I couldn't reverse engineer the
(final:
# ... things you need to patch ...
})
just had a look at that section of those docs and it's a bit confusing. you don't need to use the (final: prev: {…}) for at all (that's for defining your own quick inline overlay), you should be able to set overlays = [ inputs.rust-overlay.overlays.default]; | 06:19:43 |
@petrichor:envs.net | * just had a look at that section of those docs and it's a bit confusing. you don't need to use the
`(final: prev: {…})` form at all (that's for defining your own quick inline overlay), you should be able to set `overlays = [ inputs.rust-overlay.overlays.default];` | 06:20:19 |
| 30 Sep 2023 |
| marwri joined the room. | 04:31:57 |
| 1 Oct 2023 |
| @kchibisov:matrix.org left the room. | 08:11:27 |
| Mikael Fangel joined the room. | 09:33:44 |
| @ThorHop:matrix.org changed their display name from hopland (negative nancy) to hopland (positive pete). | 17:20:12 |
| @ThorHop:matrix.org changed their display name from hopland (positive pete) to hopland (ambivalent andy). | 17:44:01 |
| 3 Oct 2023 |
| pbsds changed their profile picture. | 21:04:21 |
| 4 Oct 2023 |
| pbsds changed their profile picture. | 22:20:26 |
| @ThorHop:matrix.org changed their display name from hopland (ambivalent andy) to hopland (glib gary). | 23:15:46 |
| 9 Oct 2023 |
| TooManyTomatoes joined the room. | 05:48:16 |
@ronnypfannschmidt:matrix.org | is there an common way to register new outputs - i'd like to register pre-commit hooks as a flake output in a sane way (new app type) | 08:02:40 |
| dunxen joined the room. | 14:25:33 |
| 10 Oct 2023 |
| sylvance_theone joined the room. | 06:02:23 |
| woobilicious joined the room. | 07:21:01 |
woobilicious | In reply to @ronnypfannschmidt:matrix.org is there an common way to register new outputs - i'd like to register pre-commit hooks as a flake output in a sane way (new app type) The wiki says there's no spec and it's all defined by what tools use it (i.e. nix build), I would say just edit the wiki page with your output, maybe an RFC should be opened for that...or even just nixpkgs thread. | 07:26:07 |
woobilicious | what's the correct way to pin nixpkgs via the registry declarively in NixOS conf? I notice I have a system and global nixpkgs that dont match, and I wonder what I did wrong. | 07:29:23 |
@petrichor:envs.net | nix.registry.nixpkgs.flake = inputs.nixpkgs; or similar ought to do the trick | 08:23:33 |
@petrichor:envs.net | if you do nix registry list you should see that the nixpkgs registry entry points to a path in the nix store so you know its pinned | 08:25:07 |
@petrichor:envs.net | other flakes will still use whatever is specified in their own flake.lock of course | 08:26:39 |
woobilicious | Jez (he/him) ♾️: system looks correct, is it just impossible to switch out the global one to stable?
❯ nix registry list | grep flake:nixpkgs
system flake:nixpkgs path:/nix/store/splp4lqr6n115q125nhqk2qmg81hsk1r-source?lastModified=1694048570&narHash=sha256-PEQptwFCVaJ+jLFJgrZll2shQ9VI%2f7xVhrCYkJo8iIw=&rev=4f77ea639305f1de0a14d9d41eef83313360638c
global flake:nixpkgs github:NixOS/nixpkgs/nixpkgs-unstable
| 08:54:16 |
woobilicious | I also can't figure out how to get nix-channel to follow the same commit, so I'm not randomly pulling pkgs in from a different version. | 08:57:09 |
@antifuchs:asf.computer | oh, hah, I have a snippet for this that I stole from somewhere (probably the flakes channel here or on discord):
globalNix = {
nixpkgs,
hostName,
inputs,
}: let
lib = nixpkgs.lib;
in {
# Setup the registry such that the entries are pinned to the versions we pull in here.
# That should help with reproducability of disjoint projects & with compile times, too.
nix.registry =
(lib.mapAttrs' (name: _v: lib.nameValuePair name {flake = inputs.${name};}) inputs)
// {
${hostName}.flake = self;
nixpkgs.flake = nixpkgs;
};
# Also set the nix path such that pinned versions of stuff is available as channels.
nix.nixPath =
(lib.mapAttrsToList (name: _v: "${name}=${inputs.${name}}") inputs)
++ [
"nixpkgs=${nixpkgs}"
"$HOME/.nix-defexpr/channels"
];
};
| 12:52:59 |
@antifuchs:asf.computer | (that function takes a concrete nixpkgs, a host name and the attrset of flake inputs & munges them such that all the inputs are on the flake registry & registered as channels) | 12:53:39 |
@rick:matrix.ciphernetics.nl | Oh heh, I should configure that too and remove the channels that are configured on my system now | 15:18:35 |
@2xsaiko:tchncs.de | In reply to @antifuchs:asf.computer
oh, hah, I have a snippet for this that I stole from somewhere (probably the flakes channel here or on discord):
globalNix = {
nixpkgs,
hostName,
inputs,
}: let
lib = nixpkgs.lib;
in {
# Setup the registry such that the entries are pinned to the versions we pull in here.
# That should help with reproducability of disjoint projects & with compile times, too.
nix.registry =
(lib.mapAttrs' (name: _v: lib.nameValuePair name {flake = inputs.${name};}) inputs)
// {
${hostName}.flake = self;
nixpkgs.flake = nixpkgs;
};
# Also set the nix path such that pinned versions of stuff is available as channels.
nix.nixPath =
(lib.mapAttrsToList (name: _v: "${name}=${inputs.${name}}") inputs)
++ [
"nixpkgs=${nixpkgs}"
"$HOME/.nix-defexpr/channels"
];
};
it is better to set nixPath to be constant, since it's an environment variable that won't update in already open applications, so you might keep using old nixpkgs | 15:51:58 |