-
Notifications
You must be signed in to change notification settings - Fork 0
Minimal flake #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal flake #40
Conversation
|
Would be great if there's also an example of consuming this flake. |
|
Sure. I'm working on a modification so it's still in motion for me. Will document when I get minimal working model. |
|
I'm testing here: https://github.com/LiGoldragon/aidiyz/blob/main/flake.nix I want to introduce a new way to deal with |
| { | ||
| description = "Composable Nix Modules"; | ||
| outputs = _: { | ||
| importAtom = import ./src/core/importAtom.nix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably be referenced in terms of core, i.e. self.core.importAtom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my clean flake branch, it fails:
error: attribute 'importAtom' missing
at /nix/store/gswph6rcxlv7inl1f0wwl1v3viz4wyb6-source/flake.nix:4:18:
3| outputs = { self }: {
4| importAtom = self.core.importAtom;
| ^
5| core = import ./src/core/mod.nix;
nrdxp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure if I actually want to support this. Atom is supposed to be a viable alternative to flakes, supporting a flakes interface sort of belies that purpose a bit.
If you wanted to use atom in a flake, you easily could by just importing the nix expression so I'm not sure this adds much value. I'll have to think about it 🤔
inputs.atom = ...
flake = false;
importAtom = inputs.atom + /src/core/importAtom.nix; |
It is easy to maintain a situation while it is still secure; It is easy to deal with a situation before symptoms develop; It is easy to break a thing when it is yet brittle; It is easy to dissolve a thing when it is yet minute. Deal with a thing while it is still nothing; Keep a thing in order before disorder sets in. A tree that can fill the span of a man's arms grows from a downy tip; A terrace nine storeys high rises from hodfuls of earth; A journey of a thousand miles starts from beneath one's feet. Whoever does anything to it will ruin it; whoever lays hold of it will lose it. Therefore the sage, because he does nothing, never ruins anything; and, because he does not lay hold of anything, loses nothing. In their enterprises the people always ruin them when on the verge of success. Be as careful at the end as at the beginning and there will be no ruined enterprises. Therefore the sage desires not to desire and does not value goods which are hard to come by; learns to be without learning and makes good the mistakes of the multitude, in order to help the myriad creatures to be natural and to refrain from daring to act. The reason why the River and the Sea are able to be king of the hundred valleys is that they excel in taking the lower position. Hence they are able to be king of the hundred valleys. Therefore, desiring to rule over the people, One must in one's words humble oneself before them; And, desiring to lead the people, One must, in one's person, follow behind them. Therefore the sage takes his place over the people yet is no burden; takes his place ahead of the people yet causes no obstruction. That is why the empire supports him joyfully and never tires of doing so. It is because he does not contend that no one in the empire is in a position to contend with him. Dao De Jing, 64-65 |
b61317d to
1eaa2ac
Compare
Emminently valuable wisdom, but perhaps I'm missing the relevance here? If you are suggesting I "humbly" support the legacy interface, well I already do that. Atom was designed intentionally to evaluate inside a flake context (pure evaluation). I could have broken this with path handling but chose explicitly to support it so those on the fence and still wanting to use flakes could try it out and hopefully derive some value from the added structure. However, fetching atom-nix with flakes breaks my intended usecase significantly. While early adopters like yourself might pick it up and use it immediately, fetching an atom with flakes or even having a flake.nix in the repo might give the wrong impression and encourage the wrong usage patterns. Atom-nix1 should be fetched and handled with In short, having a flake.nix in place sends the wrong signal and is, imho, not a good idea long term. Keep in mind, users will not even have to know this repo exists when using In other words, atom is more a low-level interface which is purposely designed to be hidden behind a higher level, user friendly API2 ( Footnotes |
|
if you could perhaps summarize what you are trying to say here, that might be helpful |
I think this is a very valid point @nrdxp |
The brief input was the first one. This video is the next level of brevity, until I record one myself. The benefit/cost ratio is extremely high. Enjoy 🙏 ☀️ |
I will catch the video at some point, but I meant specifically in relation to providing a flake.nix in this repo. I understand the impulse to "just make it work", but atom and eka are purposely designed as a fundamental rearchitecting of dependency handling in Nix. The absence of a flake.nix speaks more, imho, to the fact that we lose absolutely nothing, and that's sort of the point for something like atom to exist in the first place. That said, I feel comfortable closing this issue for now. I think the proper interface with flakes should be a compatibility layer #46, on which I left a further comment... |
To use atom with flakes