-
-
Save andrzejsliwa/288c071f628977c039114dfbd3aaf5f4 to your computer and use it in GitHub Desktop.
Use nix flakes with private github deps
This file contains hidden or 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
#!/bin/sh | |
#If already set (e.g. in github actions); use that instead | |
if [ -z "$GITHUB_TOKEN" ]; then | |
nix run nixpkgs#gh auth status || nix run nixpkgs#gh auth login | |
GITHUB_TOKEN="$(nix run nixpkgs#gh auth token)" | |
export GITHUB_TOKEN | |
fi | |
NIX_CONFIG="access-tokens = github.com=$GITHUB_TOKEN" | |
export NIX_CONFIG | |
use flake | |
This file contains hidden or 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 = "A very private flake"; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; | |
runners.url = "github:arianvp/runners"; # private dep | |
}; | |
outputs = { self, nixpkgs, runners }: { | |
packages.aarch64-darwin.default = nixpkgs.legacyPackages.aarch64-darwin.hello; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment