diff --git a/AGENTS.md b/AGENTS.md index d6306ea..fb77ffa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,74 +4,47 @@ This is a NixOS/Nix flake-based configuration repository using home-manager for ## Build Commands -### Evaluating Configuration +### Evaluating ```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 +# VM (with submodules for azos-core) nix build '.?submodules=1#nixosConfigurations.vm.config.system.build.vm' -# Build formatter (alejandra) +# Formatter 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 flake update # Update all inputs +nix flake lock --update-input X # Update specific input ``` -### Nix REPL -```bash -nix repl -:lf . -# Then explore with: -inputs.nixpkgs.lib -``` - -### Dev Shell +### Dev Shell & REPL ```bash nix develop .#shells.x86_64-linux.debugTexShell -``` - -### Garbage Collection -```bash -sudo nix-collect-garbage --delete-old +nix repl +:lf . ``` ## Linting/Formatting -This project uses [alejandra](https://github.comkamadorama/alejandra) as the formatter. - +Uses [alejandra](https://github.com/kamadorama/alejandra): ```bash -# Format all Nix files -nix fmt - -# Or use alejandra directly +nix fmt # Format all Nix files alejandra . ``` -There are no automated tests in this repository. VM testing is manual: +## Testing + +Manual VM testing: ```bash -# Build and run VM nix build .#nixosConfigurations.vm.config.system.build.vm ./result/bin/run-nixos-vm ``` @@ -79,15 +52,11 @@ nix build .#nixosConfigurations.vm.config.system.build.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 +- **Imports**: All modules in `modules/home-manager/default.nix` and `modules/nixos/default.nix` (alphabetical order) -### Nix Module Structure - -Follow this template for home-manager modules: +### Nix Module Template ```nix { @@ -101,100 +70,65 @@ Follow this template for home-manager modules: in { options.azos..enable = lib.mkOption { default = true; - example = true; type = lib.types.bool; }; config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - - - ]; + home.packages = with pkgs; [ pkg1 pkg2 ]; }; } ``` ### Naming Conventions +- Option paths: `config.azos..