{ "uuid": [ { "value": "7210b16f-71c2-44c4-9dc1-4264b243c618" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T08:59:58+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Chaining tools for maximum benefit" } ], "created": [ { "value": "2025-04-08T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T08:59:58+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2025\/04\/08\/chaining", "langcode": "en" } ], "body": [ { "value": "\n

Yesterday I showed how I'm using Nix to build my presentation slide decks<\/a> with rst2pdf.<\/p>\n\n

This allows me to run a simple command like nix build .#test-driven-drupal<\/code> to build the slides for the given presentation.<\/p>\n\n

But I can use other tools to make this even easier.<\/p>\n\n

What if I wanted to have a list of the available presentations to select from, and selecting one would build it?<\/p>\n\n

Following the UNIX philosophy, I can use multiple tools together to achieve this.<\/p>\n\n

Firstly, I can run nix flake show --json<\/code> to show the output from my flake.nix file, which looks something like this:<\/p>\n\n

{\n  \"devShells\": { ... },\n  \"formatter\": { ... },\n  \"packages\": {\n    \"x86_64-linux\": {\n      \"build-configs\": { ... },\n      \"sculpin\": { ... },\n      \"shared\": { ... }\n    }\n  }\n}\n<\/code><\/pre>\n\n

The package names - a.k.a. the presentation names - are what I want to select from.<\/p>\n\n

I can parse the JSON object with jq<\/code>, remove any unwanted options with grep -v<\/code> and use fzf<\/code> to give me a list I can fuzzy search in.<\/p>\n\n

In a Bash script, I can assign this to a variable:<\/p>\n\n

selected=$(nix flake show --json | jq --raw-output '.packages[\"x86_64-linux\"] | keys[]' | grep -v shared | fzf)\n<\/code><\/pre>\n\n

Once I have selected a name, I can call nix build<\/code> on it.<\/p>\n\n

nix build .#\"$selected\"\n<\/code><\/pre>\n\n

This is a simple example, but it shows how programs can be used together and output can be passed through each program to get the result you want.<\/p>\n\n ", "format": "full_html", "processed": "\n

Yesterday I showed how I'm using Nix to build my presentation slide decks<\/a> with rst2pdf.<\/p>\n\n

This allows me to run a simple command like nix build .#test-driven-drupal<\/code> to build the slides for the given presentation.<\/p>\n\n

But I can use other tools to make this even easier.<\/p>\n\n

What if I wanted to have a list of the available presentations to select from, and selecting one would build it?<\/p>\n\n

Following the UNIX philosophy, I can use multiple tools together to achieve this.<\/p>\n\n

Firstly, I can run nix flake show --json<\/code> to show the output from my flake.nix file, which looks something like this:<\/p>\n\n

{\n  \"devShells\": { ... },\n  \"formatter\": { ... },\n  \"packages\": {\n    \"x86_64-linux\": {\n      \"build-configs\": { ... },\n      \"sculpin\": { ... },\n      \"shared\": { ... }\n    }\n  }\n}\n<\/code><\/pre>\n\n

The package names - a.k.a. the presentation names - are what I want to select from.<\/p>\n\n

I can parse the JSON object with jq<\/code>, remove any unwanted options with grep -v<\/code> and use fzf<\/code> to give me a list I can fuzzy search in.<\/p>\n\n

In a Bash script, I can assign this to a variable:<\/p>\n\n

selected=$(nix flake show --json | jq --raw-output '.packages[\"x86_64-linux\"] | keys[]' | grep -v shared | fzf)\n<\/code><\/pre>\n\n

Once I have selected a name, I can call nix build<\/code> on it.<\/p>\n\n

nix build .#\"$selected\"\n<\/code><\/pre>\n\n

This is a simple example, but it shows how programs can be used together and output can be passed through each program to get the result you want.<\/p>\n\n ", "summary": null } ], "feeds_item": [ { "imported": "1970-01-01T00:33:45+00:00", "guid": null, "hash": "6a6105cc8b6ef3e9fadb5aec0f56aaeb", "target_type": "feeds_feed", "target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76" } ] }