From 07fb5656f20472915610f9290bf1e2e900640003 Mon Sep 17 00:00:00 2001 From: Aner Zakobar Date: Sun, 15 Mar 2026 01:27:58 +0200 Subject: [PATCH] Update flake to unstable, add chromium/opencode modules, update emacs config --- AGENTS.md | 200 ++++++++++++++++++++++ azos-core | 2 +- flake.lock | 32 ++-- flake.nix | 5 +- modules/home-manager/chromium.nix | 21 +++ modules/home-manager/default.nix | 2 + modules/home-manager/opencode.nix | 21 +++ modules/home-manager/reaper.nix | 2 +- nixos/configuration.nix | 4 +- nixos/lauretta-hardware-configuration.nix | 11 +- pkgs/azos-emacs-lauretta.nix | 45 +---- pkgs/elisp/azos-emacs-lauretta.org | 25 ++- 12 files changed, 299 insertions(+), 71 deletions(-) create mode 100644 AGENTS.md create mode 100644 modules/home-manager/chromium.nix create mode 100755 modules/home-manager/opencode.nix diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..d6306ea --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,200 @@ +# AGENTS.md - Guidelines for Agentic Coding in Azos + +This is a NixOS/Nix flake-based configuration repository using home-manager for dotfiles and system configuration. + +## Build Commands + +### Evaluating Configuration +```bash +# Evaluate system config (Lauretta laptop) +nix eval .#nixosConfigurations.lauretta.config.system.build.toplevel + +# Evaluate flake info +nix flake show + +# Evaluate all outputs +nix eval . --apply 'x: x' +``` + +### Building +```bash +# Build VM +nix build .#nixosConfigurations.vm.config.system.build.vm +# Or with submodules +nix build '.?submodules=1#nixosConfigurations.vm.config.system.build.vm' + +# Build formatter (alejandra) +nix build .#formatter.x86_64-linux +``` + +### Deploying +```bash +# Switch to new config (Lauretta) +sudo nixos-rebuild switch --flake '.?submodules=1#lauretta' + +# Update flake inputs +nix flake update + +# Update specific input +nix flake lock --update-input azos-core +``` + +### Nix REPL +```bash +nix repl +:lf . +# Then explore with: +inputs.nixpkgs.lib +``` + +### Dev Shell +```bash +nix develop .#shells.x86_64-linux.debugTexShell +``` + +### Garbage Collection +```bash +sudo nix-collect-garbage --delete-old +``` + +## Linting/Formatting + +This project uses [alejandra](https://github.comkamadorama/alejandra) as the formatter. + +```bash +# Format all Nix files +nix fmt + +# Or use alejandra directly +alejandra . +``` + +There are no automated tests in this repository. VM testing is manual: +```bash +# Build and run VM +nix build .#nixosConfigurations.vm.config.system.build.vm +./result/bin/run-nixos-vm +``` + +## Code Style Guidelines + +### File Organization + +- **Home-manager modules**: `modules/home-manager/.nix` +- **NixOS modules**: `modules/nixos/.nix` +- **Imports**: All modules are imported in `modules/home-manager/default.nix` and `modules/nixos/default.nix` +- **Import sorting**: Alphabetical order in default.nix files + +### Nix Module Structure + +Follow this template for home-manager modules: + +```nix +{ + lib, + config, + pkgs, + ... +}: let + isEnabled = + config.azos..enable; +in { + options.azos..enable = lib.mkOption { + default = true; + example = true; + type = lib.types.bool; + }; + + config = lib.mkIf isEnabled { + home.packages = with pkgs; [ + + + ]; + }; +} +``` + +### Naming Conventions + +- **Option paths**: `config.azos..