# โš™๏ธ Nyx: NixOS System Management Toolkit **Nyx** is a modular toolkit for managing NixOS systems. It streamlines NixOS rebuilds, system cleanups, and developer workflow enhancements through a unified and extensible interface. Simply import one file to enable all features. --- ## โœจ Features * ๐Ÿ” **Enhanced NixOS Rebuilds** โ€” via `nyx-rebuild.nix` * ๐Ÿงน **Automated System Cleanup** โ€” via `nyx-cleanup.nix` * ๐Ÿ› ๏ธ **Custom Shell Tools & Visuals** โ€” like banners via `nyx-tool.nix` * ๐Ÿงฉ **One-File Integration** โ€” import just `nyx.nix` to activate everything --- ## ๐Ÿ“ฆ Dependencies * โœ… NixOS or compatible Nix environment * โœ… `sudo` access (for system operations) * โœ… [Home Manager](https://github.com/nix-community/home-manager) * โœ… Git โ€” required if you use `autoPush` features (must be a Git repo) * โœ… Zsh (included via Nyx modules) * โœ… [`nix-output-monitor`](https://github.com/maralorn/nix-output-monitor) (included via Nyx) > โ„น๏ธ No need to preinstall Zsh or `nix-output-monitor`; Nyx provides them internally. --- ## ๐Ÿ“ Project Structure ```bash Nyx-Tools โ”œโ”€โ”€ nyx.nix # Master module โ”œโ”€โ”€ nyx-tool.nix # Shell customizations (e.g., banners) โ”œโ”€โ”€ nyx-rebuild.nix # Enhanced nixos-rebuild logic โ”œโ”€โ”€ nyx-cleanup.nix # System cleanup logic โ””โ”€โ”€ zsh/ โ”œโ”€โ”€ nyx-cleanup.zsh โ”œโ”€โ”€ nyx-rebuild.zsh โ””โ”€โ”€ nyx-tool.zsh ```` --- ## โš™๏ธ How It Works * `nyx.nix`: Central module that imports all others. * `nyx-tool.nix`: Adds startup banners and sources Zsh helpers. * `nyx-rebuild.nix`: Extends `nixos-rebuild` with logs, Git push, and optional formatting. * `nyx-cleanup.nix`: Automates system cleanup and logs output. * `zsh/*.zsh`: Shell scripts sourced into Zsh to handle CLI tooling. --- ## ๐Ÿš€ Quick Start ### 1. Import into `home.nix` ```nix imports = [ ./path/to/Nyx-Tools/nyx.nix ]; ``` ### 2. Enable desired modules ```nix modules.nyx-rebuild = { enable = true; inherit username nixDirectory; }; modules.nyx-cleanup = { enable = true; inherit username nixDirectory; }; modules.nix-tool = { enable = true; inherit nixDirectory; }; ``` > โš ๏ธ **Note:** You must define `nixDirectory` in your configuration or import it. > It must be a **full path** to your flake directory (e.g., `/home/${username}/NixOS/Nyx-Tools`). ๐Ÿ‘‰ See the [example config](./EXAMPLE_home.nix) for a working setup. --- ## ๐Ÿ› ๏ธ Module Options ### `nyx-rebuild` | Option | Description | Default | | ------------------ | ----------------------------------- | ------- | | `enable` | Enable this module | `false` | | `startEditor` | Launch an editor before rebuild | `false` | | `editor` | Which editor to use (`nvim`, `vim`) | โ€” | | `enableFormatting` | Format Nix files before rebuild | `false` | | `formatter` | Formatter to use (`alejandra`) | โ€” | | `enableAlias` | Add shell alias for rebuild | `false` | | `autoPush` | Push rebuild logs or dir to GitHub | `false` | --- ### `nyx-cleanup` | Option | Description | Default | | ----------------- | ------------------------------------ | ------- | | `enable` | Enable this module | `false` | | `autoPush` | Push logs to GitHub after cleanup | `false` | | `keepGenerations` | Number of system generations to keep | `5` | | `enableAlias` | Add shell alias for cleanup | `false` | --- ### `nix-tool` | Option | Description | Default | | -------- | ------------------ | ------- | | `enable` | Enable this module | `false` | --- ## ๐ŸŽจ Customization Nyx is fully modular and extensible. You can: * Modify existing `.nix` or `.zsh` files * Add new modules and source them in `nyx.nix` ### Example: Adding a Custom Tool ```nix # Add to nyx.nix or your home.nix imports = [ ./nyx-rebuild.nix ./my-custom-tool.nix ]; ``` Create `my-custom-tool.nix` and optionally pair it with a `.zsh` helper script in the `zsh/` folder. --- ## ๐Ÿค Contributing Contributions are welcome! Feel free to open an issue or submit a pull request to: * Add new functionality * Improve existing tools * Fix bugs or typos --- ## ๐Ÿ“„ License Licensed under the [MIT License](./LICENSE).