| 2 Aug 2021 |
colemickens 🏳️🌈 | I mean, you can't...? | 00:17:30 |
elonsroadster | In reply to @colemickens:matrix.org I mean, you can't...? even with --impure? Is there a way you can pass an argument to a flake | 02:30:12 |
colemickens 🏳️🌈 | I guess you could do nix build --expr and pass it an expression where you're providing the path of where the scripts are. | 04:12:25 |
colemickens 🏳️🌈 | Not sure that's any better than just ... setting it via convention and then hard-coding it. Either way you're making an un-enforceable assumption. | 04:12:51 |
colemickens 🏳️🌈 | Right? If you build that into the toplevel, nothing stops you from just... not cloning the scripts there and forgetting and putting it in the wrong place. | 04:13:56 |
elonsroadster | couldn't i do something like builtins getEnv if I use --impure | 07:13:31 |
elonsroadster | no i guess that wont work, because the file will already be in the store | 07:26:41 |
Las | In reply to @elonsroadster:matrix.org So I think I want to do something that would generally be regarded as a bad idea. I get that flakes are supposed to be as pure as possible, but I really want to be able to know what directory the flake is defined in, because I want to be able to talk about paths relative to that flake. The reason I want to do this is that I want to add to certain paths in my dotfiles to the global path environment variable. I realize that the nixy way to do this would be to actually add all of the relevant paths/scripts to the nix store and add them that way, but I don't want to have to explicitly rebuild to get new versions of all the scripts every time they are changed. You don't have to do this | 08:15:37 |
Las | That's a really bad solution honestly | 08:15:44 |
Las | You can just refer to the paths normally | 08:15:53 |
Las | With " | 08:15:58 |
Las | Just don't depend on them being where the flake is | 08:16:17 |
elonsroadster | Las: well yeah i dont want to do that though | 08:16:30 |
Las | There are a lot of situations where it wouldn't work | 08:16:34 |
Las | Your flake's source is imported into the Nix store, after that it has no idea where it came from | 08:17:03 |
elonsroadster | Las: yes i know that, thats why im asking the question | 08:17:14 |
elonsroadster | i want to do something impure in a flake, and I know thats wrong, so i kind of get why this is sort of dumb | 08:17:38 |
Las | Well then there's nothing to say other than it's fundamentally impossible | 08:17:43 |
Las | It's not even just impure | 08:17:47 |
Las | It's impossible | 08:17:49 |
elonsroadster | its not impossible -- you could eg patch nix | 08:18:14 |
Las | You could if you want have builtins.getEnv "THEPATH" in your flake and set THEPATH before evaluating it | 08:18:28 |
Las | It would be a very complicated patch | 08:18:43 |
Las | It isn't trivial | 08:18:45 |
niksnut | Maybe I'm missing something about the question, but if you have a derivation in your flake that has an attribute like src = ./foo.c, then it will only depend on that file and changes to other files in the flake won't trigger a rebuild. | 17:15:27 |
Las | I don't think he wants to copy the files to the store. I think he wants to refer to the files by their actual path, so that the system refers to paths outside the | 19:55:14 |
| 3 Aug 2021 |
David Arnold (blaggacao) | So I built an object oriented flake that knows how to consume self.budModules on a foreign flake without further ado. Because it can be rebound. The only thing that is missing is that it learns how to hook into the nix flake command when run on that foreign flake in order to teach it some UX tricks for nix flake show (w.r.t. self.budModules). niksnut any ideas? | 04:31:49 |
David Arnold (blaggacao) | * So I built an object oriented flake that knows how to consume self.budModules on a foreign flake without further ado. Because it can be rebound. The only thing that is missing is that it learns how to hook into the nix flake command when run on that foreign flake in order to teach it some UX tricks for nix flake show (w.r.t. self.budModules). niksnut / @garbas any ideas? | 04:36:04 |
David Arnold (blaggacao) | Ivan Malison: | 04:38:18 |
David Arnold (blaggacao) | * Ivan Malison:
I get that flakes are supposed to be as pure as possible, but I really want to be able to know what directory the flake is defined in, because I want to be able to talk about paths relative to that flake.
I want to know that to in order to reason about ownership of a certain file (by a flake)
| 04:40:32 |