Skip to content

Instantly share code, notes, and snippets.

@lucperkins
Last active March 28, 2023 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucperkins/68659d946b7eb3448199bbb9c15a756f to your computer and use it in GitHub Desktop.
Save lucperkins/68659d946b7eb3448199bbb9c15a756f to your computer and use it in GitHub Desktop.
{
inputs = {
nixpkgs.url = "nixpkgs";
nuenv.url = "github:DeterminateSystems/nuenv";
};
outputs = { self, nixpkgs, nuenv }: let
overlays = [ nuenv.overlays.default ];
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
inherit system;
pkgs = import nixpkgs { inherit overlays system; };
});
in {
packages = forAllSystems ({ pkgs, system }: {
default = pkgs.nuenv.mkDerivation {
name = "hello";
src = ./.;
# This script is Nushell, not Bash!
build = ''
"Hello" | save hello.txt
let out = $"($env.out)/share"
mkdir $out
cp hello.txt $out
'';
};
});
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment