feat: add nix flake for development

This commit is contained in:
2024-11-20 15:03:20 +05:00
parent e503427098
commit c8257741e1
4 changed files with 94 additions and 0 deletions

2
.envrc Normal file
View File

@@ -0,0 +1,2 @@
use flake
export SHELL=$(which bash)

1
.gitignore vendored
View File

@@ -1 +1,2 @@
1password-credentials.json 1password-credentials.json
.direnv

60
flake.lock generated Normal file
View File

@@ -0,0 +1,60 @@
{
"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": 1732030272,
"narHash": "sha256-gbBICByjt1UDdRhv5BM0J5aKmA3PCF/Wj9b3RWabtUE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f89fd475c539369dae474126b4d82ec87fbb2a1d",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"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
}

31
flake.nix Normal file
View File

@@ -0,0 +1,31 @@
{
description = "Flake to work with homelab setup";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
# Import nixpkgs to access packages
pkgs = import nixpkgs { inherit system; };
# Define the devshell
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
helmfile
kubernetes-helm
kubernetes-helmPlugins.helm-diff
kubectl
# Adding node for copilot
nodejs_20
];
};
in {
# Define the devShell for the current system
devShell = devShell;
}
);
}