diff --git a/.gitignore b/.gitignore index bfd6a29..632e837 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,11 @@ node_modules/ # Podman / Compose .env.podman +# Nix +.direnv/ +.result +result + # logs npm-debug.log* yarn-debug.log* diff --git a/README.md b/README.md index c7d79cc..774d55e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,21 @@ All commands are run from the root of the project, from a terminal: | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro -- --help` | Get help using the Astro CLI | +## Nix devshell (recommended) + +If you use Nix, you can enter a dev shell that provides the required CLI tools for this repo: + +```sh +nix develop +``` + +This is intended to provide tools like Forgejo CLI (`fj`) and Node.js so "when you enter the repo, everything is available": + +```sh +nix develop --command fj version +nix develop --command node --version +``` + ## Podman (container) development This repo can be developed inside a Podman container to keep your host clean and improve reproducibility. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..978e295 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "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": 1769598131, + "narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fa83fd837f3098e3e678e6cf017b2b36102c7211", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d1f9cbf --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "Naputo blog devshell"; + + inputs = { + # Use stable nixpkgs for a more predictable toolchain. + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + forgejo-cli + nodejs + ]; + }; + }); +}