Beady Belle Fanchannel @Profpatsch@mastodon.xyz · activity timestamp 12 hours ago I realized why I always thought `placeholder` was a weird primitive in the nix language: It breaks referential transparency! #nixos #nix Read more Read less Translate alt > cat example.nix with import <nixpkgs> {}; let inner = txt: writeText "inner" txt; in runCommand "outer" {} '' (echo -n "placeholder result: "; cat ${inner (placeholder "out")}) \ > $out <End of example.nix> > cat (nix-build example.nix) placeholder result: /nix/store/bnns37m7b4kiyqskxnfzka2jsj9byf9y-inner⏎ > cat example.nix with import <nixpkgs> {}; let inner = txt: writeText "inner" txt; in runCommand "outer" {} '' (echo -n "placeholder result: "; cat ${inner (placeholder "out")}) \ > $out <End of example.nix> > cat (nix-build example.nix) placeholder result: /nix/store/bnns37m7b4kiyqskxnfzka2jsj9byf9y-inner⏎ Reply 1 Boost Quote You cannot quote this post Like More actions Copy link Flag this post Block
alt > cat example.nix with import <nixpkgs> {}; let inner = txt: writeText "inner" txt; in runCommand "outer" {} '' (echo -n "placeholder result: "; cat ${inner (placeholder "out")}) \ > $out <End of example.nix> > cat (nix-build example.nix) placeholder result: /nix/store/bnns37m7b4kiyqskxnfzka2jsj9byf9y-inner⏎ > cat example.nix with import <nixpkgs> {}; let inner = txt: writeText "inner" txt; in runCommand "outer" {} '' (echo -n "placeholder result: "; cat ${inner (placeholder "out")}) \ > $out <End of example.nix> > cat (nix-build example.nix) placeholder result: /nix/store/bnns37m7b4kiyqskxnfzka2jsj9byf9y-inner⏎
Anselm "Two Sheds" Schüler @anselmschueler@ieji.de replied · activity timestamp 12 hours ago @Profpatsch What is this function? I can't find it in nixpkgs docs. Read more Read less Translate Reply 1 Boost Quote You cannot quote this post Like More actions Copy link Flag this comment Block
Anselm "Two Sheds" Schüler @anselmschueler@ieji.de replied · activity timestamp 12 hours ago @Profpatsch I see, it's a builtin Read more Read less Translate Reply Boost Quote You cannot quote this post Like More actions Copy link Flag this comment Block