Skip to content

Instantly share code, notes, and snippets.

@torgeir
Created September 19, 2024 08:47
Show Gist options
  • Save torgeir/f2007919514e3135531af10f3e58919b to your computer and use it in GitHub Desktop.
Save torgeir/f2007919514e3135531af10f3e58919b to your computer and use it in GitHub Desktop.
Minimal nix flake
{
description = "minimal nix flake with a default package";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: {
# packages.x86_64-linux.default =
# with nixpkgs.legacyPackages.x86_64-linux;
packages.aarch64-darwin.default =
with nixpkgs.legacyPackages.aarch64-darwin;
stdenv.mkDerivation {
pname = "hello";
version = "1.0";
buildInputs = [
# cmake
];
src = null;
unpackPhase = ''
true
'';
buildPhase = ''
mkdir -p $out/bin
echo "echo Hello, World!" > $out/bin/hello
chmod +x $out/bin/hello
'';
};
# defaultPackage.x86_64-linux = self.packages.x86_64-linux.default;
defaultPackage.aarch64-darwin = self.packages.aarch64-darwin.default;
};
}
# nix develop
# nix run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment