Skip to content

Commit

Permalink
functions: pin , to specific revision for caching
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanshelly committed Feb 14, 2021
1 parent c0e1488 commit 189f684
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions functions/comma
Expand Up @@ -24,11 +24,18 @@ EOF

args=("${@:2}")

# use stable package set to take advantage of caching
# pin to specific commit (as of 2/14) to take advantage of caching
# list of channels (corresponds to flakes) - https://status.nixos.org/
flake=github:nixos/nixpkgs/nixpkgs-20.09

# use darwin packages on macOS
"$DOTFILES/infra/scripts/is_macos.sh" && flake="$flake-darwin"
#
# TODO: use version specified/pinned in `flake.nix|lock`
if "$DOTFILES/infra/scripts/is_macos.sh"; then
# `nixpkgs-20.09-darwin` branch
# https://github.com/NixOS/nixpkgs/commit/387bf54ac5af5970277066a68e43ef9d88d7823a
flake="github:nixos/nixpkgs?rev=387bf54ac5af5970277066a68e43ef9d88d7823a"
else
# `release-20.09` branch
# https://github.com/NixOS/nixpkgs/commit/6d19fa61ea4f8b590935cc7f1c60839fe9ad0ba6
flake="github:nixos/nixpkgs?rev=6d19fa61ea4f8b590935cc7f1c60839fe9ad0ba6"
fi

nix run "$flake#$command" -- "${args[@]}"

0 comments on commit 189f684

Please sign in to comment.