~ruther/agent-environments

14f4be6351f3f3030a52adaf8a708092c83be129 — František Boháček 2 months ago f725506
Add flake with a default environment without skills
3 files changed, 186 insertions(+), 0 deletions(-)

A environments/default.nix
A flake.lock
A flake.nix
A environments/default.nix => environments/default.nix +16 -0
@@ 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";
    };
  };
}

A flake.lock => flake.lock +119 -0
@@ 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
}

A flake.nix => flake.nix +51 -0
@@ 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);
    };
}