From 14f4be6351f3f3030a52adaf8a708092c83be129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sat, 26 Sep 2026 21:52:14 +0200 Subject: [PATCH] Add flake with a default environment without skills --- environments/default.nix | 16 ++++++ flake.lock | 119 +++++++++++++++++++++++++++++++++++++++ flake.nix | 51 +++++++++++++++++ 3 files changed, 186 insertions(+) create mode 100644 environments/default.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/environments/default.nix b/environments/default.nix new file mode 100644 index 0000000000000000000000000000000000000000..c5b3bcb43127797eef13a848c40fa880a495e3b5 --- /dev/null +++ b/environments/default.nix @@ -0,0 +1,16 @@ +# The default environment: both agents, no instructions, no skills. +{ + claude.enable = true; + codex.enable = true; + + launchers = { + claude = { + agent = "claude"; + id = "default-claude"; + }; + codex = { + agent = "codex"; + id = "default-codex"; + }; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000000000000000000000000000000000..7789b5cb640889f8bf1eb3cc5273bc994bd5853a --- /dev/null +++ b/flake.lock @@ -0,0 +1,119 @@ +{ + "nodes": { + "claude-code": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1790373703, + "narHash": "sha256-K4bkqmIIQraMokq3xAaZo/Vm/fptjLBA5ajXbUvzwOg=", + "owner": "sadjow", + "repo": "claude-code-nix", + "rev": "0bbe2588524a0280307c81c14fd5631c7cd277b0", + "type": "github" + }, + "original": { + "owner": "sadjow", + "repo": "claude-code-nix", + "type": "github" + } + }, + "codex": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1790385878, + "narHash": "sha256-qSfulhmPl3ec5QrO0UGfUTRy2WFJnsjzQqWhyjEpclU=", + "owner": "sadjow", + "repo": "codex-cli-nix", + "rev": "4c27cc2b9a774831ba3718bdfa6465a5d02cb225", + "type": "github" + }, + "original": { + "owner": "sadjow", + "repo": "codex-cli-nix", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "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": 1790323409, + "narHash": "sha256-VVTPf+Hyd5ebpjBMHmrLMSBIeW6ls48Bqtosj7CNKLA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e94cb152ed51bd6e24eb4a41f1460252beb52cd2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "claude-code": "claude-code", + "codex": "codex", + "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" + } + }, + "systems_2": { + "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 0000000000000000000000000000000000000000..67b00dbfe4eb9ca86b909a41d8895e6e844c9416 --- /dev/null +++ b/flake.nix @@ -0,0 +1,51 @@ +{ + description = "Module-based environments for coding agents (Claude Code, Codex)"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + claude-code = { + url = "github:sadjow/claude-code-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + codex = { + url = "github:sadjow/codex-cli-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + self, + nixpkgs, + claude-code, + codex, + }: + let + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system}); + in + { + lib = import ./lib { + inherit (nixpkgs) lib; + defaultPackages = system: { + claude = claude-code.packages.${system}.default; + codex = codex.packages.${system}.default; + }; + }; + + packages = forAllSystems (pkgs: { + default = + (self.lib.mkEnvironment { + inherit pkgs; + modules = [ ./environments/default.nix ]; + }).package; + }); + + formatter = forAllSystems (pkgs: pkgs.nixfmt); + }; +}