Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

chore(nix): add support for flakes

Mahyar Mirrashed23f6f5dfd4e4
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000000..3550a30f2d
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000000..3104f340d0
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1741445498,
+ "narHash": "sha256-F5Em0iv/CxkN5mZ9hRn3vPknpoWdcdCyR0e4WklHwiE=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "52e3095f6d812b91b22fb7ad0bfc1ab416453634",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-24.11",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000000..ffed5545c7
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,35 @@
+{
+ description = "Flake for github:Infisical/infisical repository.";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
+ };
+
+ outputs = { self, nixpkgs }: {
+ devShells.aarch64-darwin.default = let
+ pkgs = nixpkgs.legacyPackages.aarch64-darwin;
+ in
+ pkgs.mkShell {
+ packages = with pkgs; [
+ git
+ lazygit
+
+ nodejs_20
+ ];
+
+ shellHook = ''
+ # Define a writable directory for global npm packages
+ export NPM_CONFIG_PREFIX="$HOME/.npm-global"
+ export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
+
+ # Ensure the directory exists
+ mkdir -p "$NPM_CONFIG_PREFIX"
+
+ # Install Infisical CLI only if it's not already installed
+ if ! command -v infisical &>/dev/null; then
+ npm install -g @infisical/cli
+ fi
+ '';
+ };
+ };
+}