!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

689 Members
141 Servers

Load older messages


SenderMessageTime
21 Mar 2025
@elikoga:matrix.orgelikoga?16:53:50
@elikoga:matrix.orgelikogaThere is an obivous freeform value place where you can write all the nix you want16:54:23
@elikoga:matrix.orgelikoga* There is an obvious freeform value place where you can write all the nix you want16:54:30
@joepie91:pixie.townjoepie91 🏳️‍🌈this is not relevant to my complaint16:54:50
@joepie91:pixie.townjoepie91 🏳️‍🌈"things should be the thing that they look like" is a pretty elementary principle of designing usable software and this violates that principle16:55:16
@joepie91:pixie.townjoepie91 🏳️‍🌈 it looks like a freeform .nix file but apparently isn't one, in that there are additional syntactic restrictions (ie. beyond the semantic restrictions that might be imposed by some other code that the result of a .nix file may be fed into, and which are within expectations) 16:56:03
@joepie91:pixie.townjoepie91 🏳️‍🌈 I'm sure there are a hundred ways to work around this but the point is that you shouldn't need to, it should either a) work the same as everywhere else, or b) if that is not possible, make it obvious that it doesn't in some way 16:56:45
@joepie91:pixie.townjoepie91 🏳️‍🌈(and the canonical way to denote different formats in most computer systems is... to use a different extension or variant of the standard extension)16:58:47
@elikoga:matrix.orgelikoga

I believe that the opposite design decision has worse developer UX due to more footguns in unrestricted nix that may manifest during inputs outputs resolution

Additionally, all .nix files are still fully syntactically valid nix files, which is the pre-condition that most tools expect. It's just the fact that some flake.nix files are not accepted by nix flake tooling, even though they are syntactically valid nix. This is normal and expected. I do not expect a file containing 5 to be a valid flake.nix.

Now can you tell me again in plain words what you are complaining about "things should be the thing that they look like" is either fulfilled or much too vague

17:04:47
@elikoga:matrix.orgelikoga *

I believe that the opposite design decision has worse developer UX due to more footguns in unrestricted nix that may manifest during inputs outputs resolution

Additionally, all .nix files are still fully syntactically valid nix files, which is the pre-condition that most tools expect. It's just the fact that some flake.nix files are not accepted by nix flake tooling, even though they are syntactically valid nix. This is normal and expected. I do not expect a file containing 5 to be a valid flake.nix.

Now can you tell me again in plain words what you are complaining about.
"things should be the thing that they look like" is either fulfilled or much too vague

17:05:00
@joepie91:pixie.townjoepie91 🏳️‍🌈 so what does "not accepted by nix flake tooling" mean here exactly? you said there were additional 'syntactic restrictions' but this does not sound like that 17:06:21
@elikoga:matrix.orgelikoga
[elikoga@hpLaptop:~/Dev/thymis/why-are-we-having-this-discussion]$ nix eval flake.nix
warning: Path '/home/elikoga/Dev/thymis/why-are-we-having-this-discussion/flake.nix' should point at the directory containing the 'flake.nix' file, not the file itself. Pretending that you meant '/home/elikoga/Dev/thymis/why-are-we-having-this-discussion'
error:
       … while evaluating the file '/nix/store/ajcvhz83nc55rnrk0hlnhgi0cdi9mfbd-source/flake.nix':

       error: file '/nix/store/ajcvhz83nc55rnrk0hlnhgi0cdi9mfbd-source/flake.nix' must be an attribute set
thymis-controller-py3.13
[elikoga@hpLaptop:~/Dev/thymis/why-are-we-having-this-discussion]$ nix eval -f flake.nix
5

Which behaves exactly as expected

17:07:39
@elikoga:matrix.orgelikoga 5 is not a valid flake.nix even though it's a completely valid .nix file 17:08:21
@joepie91:pixie.townjoepie91 🏳️‍🌈... okay, so that doesn't look like a syntactic restriction to me at all, just a typecheck on a value17:08:21
@joepie91:pixie.townjoepie91 🏳️‍🌈in which case my complaint doesn't apply as stated17:08:56
@elikoga:matrix.orgelikoga

No this is a syntactic check. With flake.nix: import ./why.nix and why.nix: {} we get

elikoga@hpLaptop:~/Dev/thymis/why-are-we-having-this-discussion]$ nix eval flake.nix
warning: Path '/home/elikoga/Dev/thymis/why-are-we-having-this-discussion/flake.nix' should point at the directory containing the 'flake.nix' file, not the file itself. Pretending that you meant '/home/elikoga/Dev/thymis/why-are-we-having-this-discussion'
error:
       … while evaluating the file '/nix/store/q3vbzdgg0r1hdxki9zc2aqap78nl9qj8-source/flake.nix':

       error: file '/nix/store/q3vbzdgg0r1hdxki9zc2aqap78nl9qj8-source/flake.nix' must be an attribute set

Which tells us that this is not "just a typecheck on a value"

17:10:17
@elikoga:matrix.orgelikogaI think in the case that one can do eta-expansion, one may want to loosen the restriction (assume the user does not destructure the args)17:11:23
@joepie91:pixie.townjoepie91 🏳️‍🌈 in which case my complaint does apply 17:12:38
@joepie91:pixie.townjoepie91 🏳️‍🌈.17:12:51
@joepie91:pixie.townjoepie91 🏳️‍🌈 it doesn't matter that you can technically still evaluate flake.nix via Nix directly and have it evaluate, because that has no bearing on how people actually use flake.nix files. what matters is that people cannot use "the way they write Nix files" for a flake.nix and expect it to work for its intended purpose, namely via nix flake evaluation 17:13:39
@joepie91:pixie.townjoepie91 🏳️‍🌈 because, with additional syntactic restrictions, it is not actually the same format 17:14:04
@joepie91:pixie.townjoepie91 🏳️‍🌈 if it were, you would be able to have a flake.nix that's just import ./actual-flake.nix where actual-flake.nix contains a valid flake 17:14:26
@joepie91:pixie.townjoepie91 🏳️‍🌈 * if it were, you would be able to have a flake.nix that's just import ./actual-flake.nix where actual-flake.nix contains a valid flake (after all, the evaluated value would be identical) 17:16:37
@elikoga:matrix.orgelikogahqdefault.jpg
Download hqdefault.jpg
17:18:05
@joepie91:pixie.townjoepie91 🏳️‍🌈okay, I guess this is where I stop bothering to put effort into an explanation then.17:18:39
@joepie91:pixie.townjoepie91 🏳️‍🌈you do you.17:18:48
22 Mar 2025
@hexa:lossy.networkhexahttps://github.com/NixOS/nix/issues/4945 fwiw00:31:08
@isabel:isabelroses.comisabel joined the room.00:42:31
@vaw:nlih.devaw joined the room.21:25:44
23 Mar 2025
@sincetheflood:matrix.org@sincetheflood:matrix.org left the room.00:21:10

There are no newer messages yet.


Back to Room ListRoom Version: 6