dev: direnv + flake for nix-shell
Change-Id: Ic74d9f5e0529d550581d8ff96bdace74cb39b76f
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..b62b6ac
--- /dev/null
+++ b/.envrc
@@ -0,0 +1,5 @@
+# shellcheck shell=bash
+
+use flake
+
+export KUBECONFIG=$(pwd)/priv/kubeconfig-hetzner-new.yaml
diff --git a/.gitignore b/.gitignore
index eda363b..a12118e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,4 @@
.hugo_build.lock
dist
node_modules
+.direnv
\ No newline at end of file
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..9dd84ed
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,98 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": [
+ "systems"
+ ]
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1784555310,
+ "narHash": "sha256-/FCliTPgiuV1owejZFNx3Ch9irdvkOfOFl+HHZ+DrtM=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "421eebfd0ec7bccd4abe826ce62d7e6e83129493",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs-fluxcd": {
+ "locked": {
+ "lastModified": 1779643027,
+ "narHash": "sha256-uvtKlUxt2LSkoNGm2UWJ0NtvKbEKjNTfRXuwEre8zNA=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "e1ea2e5ee3decc21eaf91862bd3de37701e57595",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "e1ea2e5ee3decc21eaf91862bd3de37701e57595",
+ "type": "github"
+ }
+ },
+ "nixpkgs-kubectl": {
+ "locked": {
+ "lastModified": 1750386251,
+ "narHash": "sha256-1ovgdmuDYVo5OUC5NzdF+V4zx2uT8RtsgZahxidBTyw=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "076e8c6678d8c54204abcb4b1b14c366835a58bb",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "076e8c6678d8c54204abcb4b1b14c366835a58bb",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs",
+ "nixpkgs-fluxcd": "nixpkgs-fluxcd",
+ "nixpkgs-kubectl": "nixpkgs-kubectl",
+ "systems": "systems"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..dcd2fbf
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,42 @@
+{
+ description = "dodo dev shell";
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ systems.url = "github:nix-systems/default";
+ flake-utils = {
+ url = "github:numtide/flake-utils";
+ inputs.systems.follows = "systems";
+ };
+ # v1.33.1
+ nixpkgs-kubectl.url = "github:NixOS/nixpkgs/076e8c6678d8c54204abcb4b1b14c366835a58bb";
+ # v2.8.8
+ nixpkgs-fluxcd.url = "github:NixOS/nixpkgs/e1ea2e5ee3decc21eaf91862bd3de37701e57595";
+ };
+
+ outputs =
+ { nixpkgs, flake-utils, nixpkgs-kubectl, nixpkgs-fluxcd, ... }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ pkgs-kubectl = import nixpkgs-kubectl { inherit system; };
+ pkgs-fluxcd = import nixpkgs-fluxcd { inherit system; };
+ kubectl = pkgs-kubectl.kubectl;
+ fluxcd = pkgs-fluxcd.fluxcd;
+ alias-kubectl = pkgs.writeShellScriptBin "k" ''
+ exec ${kubectl}/bin/kubectl "$@"
+ '';
+ in
+ {
+ devShells.default = pkgs.mkShell {
+ packages = [
+ pkgs.bashInteractive
+ kubectl
+ fluxcd
+ pkgs.k9s
+ alias-kubectl
+ ];
+ };
+ }
+ );
+}