From 67ab805c9250d201e713ac90664b82c73d4a2cf9 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Fri, 28 Jun 2024 20:11:48 -0700 Subject: [PATCH] coreutils? --- builder.sh | 1 + flake.nix | 29 +++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/builder.sh b/builder.sh index 149e6c2..5c2e81e 100755 --- a/builder.sh +++ b/builder.sh @@ -1,2 +1,3 @@ +export PATH="$coreutils/bin" mkdir $out cp *\.{png,webp} $out diff --git a/flake.nix b/flake.nix index 5c9f928..a9556db 100644 --- a/flake.nix +++ b/flake.nix @@ -2,13 +2,26 @@ inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; outputs = - { nixpkgs, ... }: { - packages."x86_64-linux".default = derivation - { - name = "backgrounds"; - builder = "${nixpkgs.bash}/bin/bash"; - args = [ ./builder.sh ]; - system = builtins.currentSystem; - }; + { nixpkgs, ... }: + let + systems = [ "aarch64-linux" "x86_64-linux" ]; + forAllSystems = + function: + nixpkgs.lib.genAttrs systems ( + system: function nixpkgs.legacyPackages.${system} system + ); + in + { + packages = forAllSystems (pkgs: system: rec { + default = backgrounds; + backgrounds = derivation + { + inherit system; + inherit (pkgs) coreutils; + name = "backgrounds"; + builder = "${pkgs.bash}/bin/bash"; + args = [ ./builder.sh ]; + }; + }); }; }