From 1de0bbe4fca7448166b2a6ec0863ca9fffbceaf3 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 29 Mar 2023 11:20:56 -0300 Subject: src/bin/paku.in: Generate build.nix --- src/bin/paku.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/bin/paku.in b/src/bin/paku.in index ca43aa6..8dc30c9 100755 --- a/src/bin/paku.in +++ b/src/bin/paku.in @@ -212,6 +212,20 @@ sub emit_release() { exit; } +sub emit_build_nix() { + my $json = load_json(); + my $ns = $json->{namespace}; + $ns =~ s/\./-/g; + print <<~EOF; + { pkgs ? + import { overlays = [ (import ./default.nix { inherit pkgs; }) ]; } + }: + + map (name: pkgs.$ns."\${name}") + (builtins.attrNames pkgs.$ns) + EOF +} + sub emit_nix() { my $json = load_json(); my $ns = $json->{namespace}; @@ -944,6 +958,7 @@ sub emit_html() { my %actions = ( 'debian-packages' => \&emit_packages, 'debian-release' => \&emit_release, + 'build-nix' => \&emit_build_nix, nix => \&emit_nix, guix => \&emit_guix, 'guix-channel-key' => \&emit_guix_channel_key, -- cgit v1.2.3