diff --git a/.gitignore b/.gitignore index 3ff1697..400857f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ Eldev-local # OS .DS_Store +/.envrc +/.direnv/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3fa3b42 --- /dev/null +++ b/flake.lock @@ -0,0 +1,240 @@ +{ + "nodes": { + "blueprint": { + "inputs": { + "nixpkgs": [ + "jailed-agents", + "llm-agents", + "nixpkgs" + ], + "systems": "systems_3" + }, + "locked": { + "lastModified": 1769353768, + "narHash": "sha256-zI+7cbMI4wMIR57jMjDSEsVb3grapTnURDxxJPYFIW0=", + "owner": "numtide", + "repo": "blueprint", + "rev": "c7da5c70ad1c9b60b6f5d4f674fbe205d48d8f6c", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "blueprint", + "type": "github" + } + }, + "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" + } + }, + "flake-utils_2": { + "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" + } + }, + "jail-nix": { + "locked": { + "lastModified": 1765903853, + "narHash": "sha256-buoPpx7moJzAXbLuHAImn6x9fGRdk3x0T57goPv1vnc=", + "owner": "~alexdavid", + "repo": "jail.nix", + "rev": "bf9f49c8118e7a77b68a675dbe26e93e91412066", + "type": "sourcehut" + }, + "original": { + "owner": "~alexdavid", + "repo": "jail.nix", + "type": "sourcehut" + } + }, + "jailed-agents": { + "inputs": { + "flake-utils": "flake-utils_2", + "jail-nix": "jail-nix", + "llm-agents": "llm-agents", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1769818307, + "narHash": "sha256-FjojfnmW2/jRmbxfk+8yzU9OfqIl1mClNLywzSujSKQ=", + "path": "/conf/jailed-agents", + "type": "path" + }, + "original": { + "path": "/conf/jailed-agents", + "type": "path" + } + }, + "llm-agents": { + "inputs": { + "blueprint": "blueprint", + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1769813338, + "narHash": "sha256-IlRKon8+bfoi/uOa8CUPAAWW0Pv6AHBSF1jVSD4QO8U=", + "owner": "numtide", + "repo": "llm-agents.nix", + "rev": "58939415e56d01c30d429cf0c49a9d8e2a6a07c3", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "llm-agents.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1769740369, + "narHash": "sha256-xKPyJoMoXfXpDM5DFDZDsi9PHArf2k5BJjvReYXoFpM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6308c3b21396534d8aaeac46179c14c439a89b8a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1769461804, + "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1769789167, + "narHash": "sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "62c8382960464ceb98ea593cb8321a2cf8f9e3e5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "jailed-agents": "jailed-agents", + "nixpkgs": "nixpkgs_3" + } + }, + "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" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "jailed-agents", + "llm-agents", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769691507, + "narHash": "sha256-8aAYwyVzSSwIhP2glDhw/G0i5+wOrren3v6WmxkVonM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "28b19c5844cc6e2257801d43f2772a4b4c050a1b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0579f25 --- /dev/null +++ b/flake.nix @@ -0,0 +1,61 @@ +{ + description = "Emacs mode development environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + jailed-agents.url = "path:/conf/jailed-agents"; + }; + + outputs = + { self, nixpkgs, flake-utils, jailed-agents, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + # Choose your Emacs build (e.g., pkgs.emacs, pkgs.emacs-nox, pkgs.emacs-pgtk) + epkgs = pkgs.emacsPackagesFor pkgs.emacs; + + # Emacs wrapped with useful dev/test/lint packages available in load-path + emacsWithDeps = epkgs.emacsWithPackages (p: with p; [ + package-lint + relint + buttercup + ]); + + devInputs = with pkgs; [ + emacsWithDeps + epkgs.eldev + git + gnumake + texinfo + ripgrep + ]; + in + { + devShells.default = pkgs.mkShell { + packages = devInputs ++ [ + (jailed-agents.lib.${system}.makeJailedOpencode system { + extraPkgs = devInputs; + }) + ]; + + shellHook = '' + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo " Emacs Mode Development Environment" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" + echo "Common tasks:" + echo " eldev lint # package-lint + relint" + echo " eldev test # run ERT/Buttercup tests" + echo " eldev compile # byte-compile" + echo " eldev package # build release tarball" + echo "" + echo "Start Emacs (preconfigured load-path):" + echo " emacs ." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + ''; + }; + } + ); +}