| 24 Aug 2021 |
| Mazurel joined the room. | 14:09:20 |
| 25 Aug 2021 |
| NixOS Moderation Bot banned matthewcroughan - nix.zone (<no reason supplied>). | 22:02:33 |
| 28 Aug 2021 |
| lvkm joined the room. | 06:30:54 |
| emmanuelrosa joined the room. | 08:12:58 |
emmanuelrosa | I use nix-shell to create bash scripts using the -i intepreter flag. But I don't see a way to do the same thing with nix shell. Right now, I have NIX_PATH so that nix-shell continues to work, now that I'm using Nix flakes to build NixOS. But of course that means it can point to a different Nixpkgs. What's the Flakes equivalent of nix-shell -i bash? | 08:16:27 |
Roos | I don't know of an equivalent to nix-shell, but a more viable hack may be something based on nix-shell -E '(builtins.getFlake "github:nixos/nixpkgs").legacyPackages.${builtins.currentSystem}.hello'. | 08:26:48 |
emmanuelrosa | Which flake.lock does getFlake reference? | 08:32:09 |
Roos | The one from the registry: nix registry list | 08:34:59 |
Roos | (Or so I believe) | 08:35:15 |
emmanuelrosa | OK. The problem I see is that it can differ from the Nixpkgs that's pinned at /etc/nixos. I set the NIX_PATH using nix.nixPath, which I was setting to a local copy of Nixpkg. However, nixpkgs is an input to the Nixos configuration (in the flake.nix), so I tried this nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; and now NIX_PATH is being set to a copy of Nixpkgs in the Nix store :) I'm not sure if that path would get garbage collected, but I'll play with this idea some more. | 08:48:37 |
emmanuelrosa | It's referenced by set-environment, which is referenced in /etc/profile, so it should not be garbage collected. nix-store --query --referrers /nix/store/bvcyd3qcccdxyi61fk9gmgqp4rm7bkab-source/ /nix/store/0df147kd6hpj1f2wq1ahv92an3i9j9ma-set-environment /nix/store/7b2i6p6x0i4xaxjw2aakdz42azk724y9-etc-environment /nix/store/3z9bw0idqwbd4v130dj0bwr2cylfjryp-etc /nix/store/c3rf672q51l4fg4bjcsip909khm6zhp1-set-environment.drv /nix/store/ycxc3rsnw82fs0129syvaklr5km2ki5s-etc-environment.drv | 08:52:26 |
Roos | emmanuelrosa: I pin my registry nixpkgs flake to the one in the system derivation with this: https://gitlab.com/roosemberth/dotfiles/-/blob/master/flake.nix#L21 | 09:02:37 |
emmanuelrosa | I see. Thanks @Roos. | 09:10:45 |
| 29 Aug 2021 |
Las | ·Does anyone know how you're supposed to use builtins.getFlake now? | 21:39:11 |
Las | It doesn't work with --impure anymore | 21:39:17 |
| 30 Aug 2021 |
bew | In reply to @Las:matrix.org ·Does anyone know how you're supposed to use builtins.getFlake now? How did you try to use it? Iirc you pass it a flake uri and it returns you the attrset representing the flake. So you do sth like builtins.getFlake "flake:nixpkgs" or builtins.getFlake "path:." (if you're in a flake dir) | 15:55:38 |
Las | In reply to @bew:matrix.org How did you try to use it? Iirc you pass it a flake uri and it returns you the attrset representing the flake. So you do sth like builtins.getFlake "flake:nixpkgs" or builtins.getFlake "path:." (if you're in a flake dir) It doesn't work anymore with nix eval --expr | 16:55:56 |
Las | * In reply to @bew:matrix.org How did you try to use it? Iirc you pass it a flake uri and it returns you the attrset representing the flake. So you do sth like builtins.getFlake "flake:nixpkgs" or builtins.getFlake "path:." (if you're in a flake dir) It doesn't work anymore with nix eval --impure --expr | 16:56:11 |
| 31 Aug 2021 |
| Florian | W3F changed their display name from Florian | W3F to Florian | W3F - OoO. | 08:11:42 |
bew | In reply to @Las:matrix.org It doesn't work anymore with nix eval --impure --expr Hmm weird, open an issue on Nix's repo I guess | 09:52:24 |
| 1 Sep 2021 |
| El_Zarco joined the room. | 21:12:04 |
| 2 Sep 2021 |
Florian | W3F | In reply to @emmanuelrosa:matrix.org OK. The problem I see is that it can differ from the Nixpkgs that's pinned at /etc/nixos. I set the NIX_PATH using nix.nixPath, which I was setting to a local copy of Nixpkg. However, nixpkgs is an input to the Nixos configuration (in the flake.nix), so I tried this nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; and now NIX_PATH is being set to a copy of Nixpkgs in the Nix store :) I'm not sure if that path would get garbage collected, but I'll play with this idea some more. If combined with deleting all channels and setting nix.registry.nixpkgs.flake = nixpkgs; you should be all set to use your systems pinned nixpkgs for everything. | 07:33:05 |
Florian | W3F | In reply to @emmanuelrosa:matrix.org I use nix-shell to create bash scripts using the -i intepreter flag. But I don't see a way to do the same thing with nix shell. Right now, I have NIX_PATH so that nix-shell continues to work, now that I'm using Nix flakes to build NixOS. But of course that means it can point to a different Nixpkgs. What's the Flakes equivalent of nix-shell -i bash? I have not tried this, but maybe nix run nixpkgs#bash might work. | 07:33:48 |
Florian | W3F | In reply to @emmanuelrosa:matrix.org I use nix-shell to create bash scripts using the -i intepreter flag. But I don't see a way to do the same thing with nix shell. Right now, I have NIX_PATH so that nix-shell continues to work, now that I'm using Nix flakes to build NixOS. But of course that means it can point to a different Nixpkgs. What's the Flakes equivalent of nix-shell -i bash? * I have not tried this, but maybe nix run nixpkgs#bash -- -i might work. | 07:34:11 |
Florian | W3F | * I have not tried this, but maybe nix run nixpkgs#bash -- -i might work. (EDIT: I played around with this, could not make it work with some simple examples. Looks like nix-shell does something special when called as interpreter by the kernel). | 07:42:21 |
Florian | W3F | There is some work on shebang support though in #5189 | 07:46:41 |
| papojari joined the room. | 15:02:21 |
| 3 Sep 2021 |
| humancalico joined the room. | 06:34:29 |
emmanuelrosa | Is there a way to update only a specific input in a flake lock file? | 12:25:47 |
nan-matrix | In reply to @emmanuelrosa:matrix.org Is there a way to update only a specific input in a flake lock file? nix flake lock --update-input ... | 12:26:42 |