{ description = "what does the cow say"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs"; }; outputs = { self, nixpkgs }: let supportedSystems = [ "x86_64-linux" "aarch64-linux" ]; forEachSystem = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forEachSystem (system: import nixpkgs { inherit system; }); in { devShells = forEachSystem (system: let pkgs = nixpkgsFor.${system}; in { default = pkgs.mkShell { packages = [ pkgs.cowsay ]; }; }); packages = forEachSystem (system: let pkgs = nixpkgsFor.${system}; in { default = pkgs.stdenv.mkDerivation { name = "cow-hello.sh"; src = ./.; unpackPhase = "true"; buildPhase = ":"; installPhase = '' mkdir -p $out/bin cp $src/cow-hello.sh $out/bin chmod +x $out/bin/cow-hello.sh # modify the cow-hello.sh script so it can find cowsay COWSAY=$(type -p cowsay) sed "s_cowsay_"$COWSAY"_" --in-place $out/bin/cow-hello.sh ''; buildInputs = [ pkgs.cowsay ]; }; # mkDerivation }); # packages }; # outputs }