You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To extend the current behaviour to include external flake, I had to do a couple of things:
{description="api";# Add my flake input here.inputs={nixpkgs.url="github:NixOS/nixpkgs?ref=nixos-unstable";xc.url="github:joerdav/xc";};outputs={self,nixpkgs,xc}:
let# Systems supportedallSystems=["x86_64-linux"# 64-bit Intel/AMD Linux"aarch64-linux"# 64-bit ARM Linux"x86_64-darwin"# 64-bit Intel macOS"aarch64-darwin"# 64-bit ARM macOS];# Helper to provide system-specific attributes.# Note, adding `system` to the output here.forAllSystems=f: nixpkgs.lib.genAttrsallSystems(system: f{system=system;pkgs=importnixpkgs{inheritsystem;};});in{# `nix build` builds the app.packages=forAllSystems({system,pkgs}: {default=pkgs.buildGo121Module{name="api";src=./.;subPackages=["./app"];vendorHash="sha256-TvncLmPfELnkFnp88xiFXWww7pniZb5YpTeW6oRiweA=";proxyVendor=true;postInstall='' mv $out/bin/app $out/bin/api '';};});# `nix develop` provides a shell containing required tools.# Note the use of the `system` attribute that is now output by the `forAllSystems` function as# an input to the function. This lets the flake input be referenced.devShell=forAllSystems({system,pkgs}:
pkgs.mkShell{buildInputs=[pkgs.go_1_21pkgs.nats-serverpkgs.miniopkgs.minio-clientpkgs.minio-certgenxc.packages.${system}.xc];});};}
I don't know if there's a better way of doing this, but I noticed that zero-to-nix doesn't seem to include an example of doing this sort of thing.
If there's appetite, I can do a PR?
The text was updated successfully, but these errors were encountered:
To extend the current behaviour to include external flake, I had to do a couple of things:
I don't know if there's a better way of doing this, but I noticed that zero-to-nix doesn't seem to include an example of doing this sort of thing.
If there's appetite, I can do a PR?
The text was updated successfully, but these errors were encountered: