Nix Flakes | 883 Members | |
| 180 Servers |
| Sender | Message | Time |
|---|---|---|
| 2 Aug 2021 | ||
| Las: well yeah i dont want to do that though | 08:16:30 | |
| There are a lot of situations where it wouldn't work | 08:16:34 | |
| Your flake's source is imported into the Nix store, after that it has no idea where it came from | 08:17:03 | |
| Las: yes i know that, thats why im asking the question | 08:17:14 | |
| 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 | |
| Well then there's nothing to say other than it's fundamentally impossible | 08:17:43 | |
| It's not even just impure | 08:17:47 | |
| It's impossible | 08:17:49 | |
| its not impossible -- you could eg patch nix | 08:18:14 | |
You could if you want have builtins.getEnv "THEPATH" in your flake and set THEPATH before evaluating it | 08:18:28 | |
| It would be a very complicated patch | 08:18:43 | |
| It isn't trivial | 08:18:45 | |
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 | |
| 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 | ||
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 | |
* 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 | |
| Ivan Malison: | 04:38:18 | |
*
I want to know that to in order to reason about ownership of a certain file (by a flake) | 04:40:32 | |
*
I want to know that too in order to reason about ownership of a certain file (by a flake) | 04:40:46 | |
*
I want to know that too in order to reason about ownership of a certain file (by a flake, or even better by a particular commit) | 04:40:59 | |
In reply to @Las:matrix.orgRight. The reason for this is that is rather not worry about the scripts in my dotfiles being out of sync with what I have put in my nix store. I realize that this is sort of a dumb concern, and that any new dependencies that these scripts have would still need associated system updates, but it just feels a bit heavy weight to need to do a system update every time I tweak or add a new user script. | 04:42:23 | |
| Anyway, the solution I settled on is adding a module that takes a parameter that is the absolute path to my dotfiles repo that is defaulted to /home/my-user/dotfiles which is where I almost always put them. If I out them somewhere else this parameter will need to be specified. Reminds me a bit of how the system parameter now needs to be specified in flakes. | 04:45:07 | |
| The way things work with flakes is certainly better, but full purity does have some downsides. | 04:46:14 | |
In reply to @elonsroadster:matrix.orgAs in your solution: It just makes the input an invariant. This is pretty cool! | 04:47:06 | |
In reply to @elonsroadster:matrix.org* As in your solution: It just makes that particular input an invariant. This is pretty cool! | 04:47:45 | |
| Often times I'm surprise by the marvles that ly behind this paradigm shift 😀 | 04:48:45 | |
| * Often times I'm surprise by the marvels that lie behind this paradigm shift 😀 | 04:49:00 | |
| I guess the point is that any parameter that could be passed in to a flake needs to be defined within the flake file. Flakes outputs must basically be enumerable. | 04:50:42 | |
But I still want to reason about the ownership of files owned by a particular flake. like in self.ownershipId == path.ownershipId | 04:51:40 | |
| It just feels to me like maybe complete purity is a bit limiting here. I get that it buys you a lot, but I do wonder if some sort of compromise that gets the best of both worlds is possible. | 04:51:51 | |