)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"3042009933997894e584745d84de3038d0f86900","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"60a47961_325b70ab","updated":"2021-09-13 09:55:23.000000000","message":"Some improvements to the tag library that make the examples easier.","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"}],"nix/utils/default.nix":[{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"3042009933997894e584745d84de3038d0f86900","unresolved":true,"context_lines":[{"line_number":97,"context_line":"       \u003d\u003e { missing \u003d true; }"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"       # Check if a path exists"},{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""}],"source_content_type":"text/x-nix","patch_set":4,"id":"886d8e3e_e31753d1","line":100,"updated":"2021-09-13 09:55:23.000000000","message":"The `?`-syntax for tags is cute, although it kinda depends on the internal representation of tags.\n\n idk if it would be better to have a domain-specific function like `tag.isTag`, otoh I don’t think we can gain much by doing that?","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"cf1c364a2991c5142e6fab95565f99b605322d2a","unresolved":true,"context_lines":[{"line_number":97,"context_line":"       \u003d\u003e { missing \u003d true; }"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"       # Check if a path exists"},{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""}],"source_content_type":"text/x-nix","patch_set":4,"id":"dbe2c934_7803c97b","line":100,"in_reply_to":"886d8e3e_e31753d1","updated":"2021-09-14 14:07:18.000000000","message":"IMO the strength of //nix/tag is precisely this internal structure which allows us to use the ergonomic nix idioms like foo ? bar and foo.bar or null \u003d\u003d \"foo\". \n\nHiding this behind an API would make working with tags much more annoying.","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"619ca9a9c774a543392c3f7fedbb37544222ef56","unresolved":false,"context_lines":[{"line_number":97,"context_line":"       \u003d\u003e { missing \u003d true; }"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"       # Check if a path exists"},{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""}],"source_content_type":"text/x-nix","patch_set":4,"id":"5ca52b43_49393ee6","line":100,"in_reply_to":"dbe2c934_7803c97b","updated":"2021-09-17 08:36:05.000000000","message":"Ack","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"3042009933997894e584745d84de3038d0f86900","unresolved":true,"context_lines":[{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"       # Match on the result using //nix/tag"},{"line_number":106,"context_line":"       tag.match (nix.utils.pathType ./result) {"}],"source_content_type":"text/x-nix","patch_set":4,"id":"ffcd37f8_814f923e","line":103,"range":{"start_line":103,"start_character":37,"end_line":103,"end_character":84},"updated":"2021-09-13 09:55:23.000000000","message":"hrm. now I feel like we should really have a function for this.\n\nSomething like \n\n```\nmatchDef false {\n  symlink \u003d s: s \u003d\u003d \"directory\";\n  directory \u003d true;\n}\n```","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"ffb46cae14b123ee42eadd871135cc7be35723f3","unresolved":true,"context_lines":[{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"       # Match on the result using //nix/tag"},{"line_number":106,"context_line":"       tag.match (nix.utils.pathType ./result) {"}],"source_content_type":"text/x-nix","patch_set":4,"id":"652aa6a1_6501198d","line":103,"range":{"start_line":103,"start_character":37,"end_line":103,"end_character":84},"in_reply_to":"00862ed2_9d56978b","updated":"2021-09-20 13:27:42.000000000","message":"This is at least an idiom that is really used and not a library function you have to know about:\n\n$ ag -c \"or null(\\))? (\u003d\u003d|!\u003d)\"\nlib/modules.nix:1\nmaintainers/scripts/rebuild-amount.sh:1\nnixos/lib/make-zfs-image.nix:1\nnixos/lib/make-disk-image.nix:2\nnixos/lib/testing-python.nix:1\nnixos/modules/services/networking/nsd.nix:1\nnixos/modules/virtualisation/amazon-options.nix:1\npkgs/applications/networking/browsers/firefox/common.nix:1\npkgs/build-support/buildenv/default.nix:1\npkgs/development/haskell-modules/lib.nix:1\npkgs/development/haskell-modules/make-package-set.nix:1\npkgs/development/interpreters/perl/default.nix:1\npkgs/development/libraries/libjpeg-turbo/default.nix:1\npkgs/games/planetaryannihilation/default.nix:2\npkgs/stdenv/generic/make-derivation.nix:2","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"189839d406d036fecb3978ac39d34ca88f7fe6b2","unresolved":true,"context_lines":[{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"       # Match on the result using //nix/tag"},{"line_number":106,"context_line":"       tag.match (nix.utils.pathType ./result) {"}],"source_content_type":"text/x-nix","patch_set":4,"id":"3a5c1b04_eb7f366f","line":103,"range":{"start_line":103,"start_character":37,"end_line":103,"end_character":84},"in_reply_to":"1bf16ec5_82c6208d","updated":"2021-09-18 12:44:40.000000000","message":"I think doing that is valid and even idiomatic nix. Having a specific function for tags is surely nice, but I think we can add that later and update the example","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"c661aa8adcc4b6af40f4ed53a3b50ddad82f575b","unresolved":true,"context_lines":[{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"       # Match on the result using //nix/tag"},{"line_number":106,"context_line":"       tag.match (nix.utils.pathType ./result) {"}],"source_content_type":"text/x-nix","patch_set":4,"id":"00862ed2_9d56978b","line":103,"range":{"start_line":103,"start_character":37,"end_line":103,"end_character":84},"in_reply_to":"3a5c1b04_eb7f366f","updated":"2021-09-20 12:58:50.000000000","message":"I don’t think it’s very idiomatic, I can’t see what is happening at a glance.","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"363e2c86c3f6856c3740eb9ae90991877f12dcea","unresolved":false,"context_lines":[{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"       # Match on the result using //nix/tag"},{"line_number":106,"context_line":"       tag.match (nix.utils.pathType ./result) {"}],"source_content_type":"text/x-nix","patch_set":4,"id":"b79cf460_e3a63f6c","line":103,"range":{"start_line":103,"start_character":37,"end_line":103,"end_character":84},"in_reply_to":"652aa6a1_6501198d","updated":"2021-10-02 18:24:12.000000000","message":"Done","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"619ca9a9c774a543392c3f7fedbb37544222ef56","unresolved":true,"context_lines":[{"line_number":100,"context_line":"       !(pathType /file ? missing)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"       # Check if a path is a directory or a symlink to a directory"},{"line_number":103,"context_line":"       pathType /path ? directory || (pathType /path).symlink or null \u003d\u003d \"directory\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"       # Match on the result using //nix/tag"},{"line_number":106,"context_line":"       tag.match (nix.utils.pathType ./result) {"}],"source_content_type":"text/x-nix","patch_set":4,"id":"1bf16ec5_82c6208d","line":103,"range":{"start_line":103,"start_character":37,"end_line":103,"end_character":84},"in_reply_to":"ffcd37f8_814f923e","updated":"2021-09-17 08:36:05.000000000","message":"I’d like to introduce this function and change the example, then I think this one is good.","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"3042009933997894e584745d84de3038d0f86900","unresolved":true,"context_lines":[{"line_number":111,"context_line":"       }"},{"line_number":112,"context_line":"       \u003d\u003e \"symlink to directory\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"       # Query path type"},{"line_number":115,"context_line":"       (nix.tag.verifyTag (pathType /path)).name"},{"line_number":116,"context_line":"       # or simply"},{"line_number":117,"context_line":"       with builtins; head (attrNames (pathType /path))"},{"line_number":118,"context_line":"  */"},{"line_number":119,"context_line":"  pathType \u003d path:"},{"line_number":120,"context_line":"    let"}],"source_content_type":"text/x-nix","patch_set":4,"id":"9a7dde09_8128b77f","line":117,"range":{"start_line":114,"start_character":0,"end_line":117,"end_character":55},"updated":"2021-09-13 09:55:23.000000000","message":"This would need a `tag.tagName`","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"cf1c364a2991c5142e6fab95565f99b605322d2a","unresolved":false,"context_lines":[{"line_number":111,"context_line":"       }"},{"line_number":112,"context_line":"       \u003d\u003e \"symlink to directory\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"       # Query path type"},{"line_number":115,"context_line":"       (nix.tag.verifyTag (pathType /path)).name"},{"line_number":116,"context_line":"       # or simply"},{"line_number":117,"context_line":"       with builtins; head (attrNames (pathType /path))"},{"line_number":118,"context_line":"  */"},{"line_number":119,"context_line":"  pathType \u003d path:"},{"line_number":120,"context_line":"    let"}],"source_content_type":"text/x-nix","patch_set":4,"id":"2fb84d6b_9032841a","line":117,"range":{"start_line":114,"start_character":0,"end_line":117,"end_character":55},"in_reply_to":"9a7dde09_8128b77f","updated":"2021-09-14 14:07:18.000000000","message":"Done","commit_id":"f7b501f08c8a56707f620a1471ada4e3bb2f0b4e"}]}
