Skip to content

Instantly share code, notes, and snippets.

@dln
Last active April 30, 2024 18:21
Show Gist options
  • Save dln/5653f1319f41fcae65e7db38f2dd419b to your computer and use it in GitHub Desktop.
Save dln/5653f1319f41fcae65e7db38f2dd419b to your computer and use it in GitHub Desktop.
Minimal example of using nix flake as "devshell" with direnv for a portable environment of various handy tools
if has nix; then
use flake
fi
{
description = "my k8s project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; };
in
{
devShell = pkgs.mkShell {
buildInputs = (with pkgs; [
argocd
bat
cue
curl
fzf
gatekeeper
go-task
jq
jless
kapp
kail
krew
kubectl
kubectl-cnpg
kubectl-view-secret
kubelogin-oidc
kubernetes-helm
k9s
kubelogin-oidc
kustomize
miller
minio-client
talosctl
packer
vault-bin
]);
};
}
);
}
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
tasks:
nix:update: nix flake update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment