Created
September 19, 2024 08:47
-
-
Save torgeir/f2007919514e3135531af10f3e58919b to your computer and use it in GitHub Desktop.
Minimal nix flake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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