playground/flake.nix

25 lines
721 B
Nix
Raw Normal View History

2023-09-25 20:54:26 +00:00
{
description = "A flake for building Hello World";
inputs.nixpkgs.url = github:NixOS/nixpkgs;
outputs = { self, nixpkgs }: {
defaultPackage.x86_64-linux =
with import nixpkgs { system = "x86_64-linux"; };
stdenv.mkDerivation {
name = "hello";
src = self;
buildPhase = "cc -o hello ./hello.c";
installPhase = "mkdir -p $out/bin; install -t $out/bin hello";
};
defaultPackage.aarch64-darwin =
with import nixpkgs { system = "aarch64-darwin"; };
stdenv.mkDerivation {
name = "hello";
src = self;
buildPhase = "cc -o hello ./hello.c";
installPhase = "mkdir -p $out/bin; install -t $out/bin hello";
};
};
}