restruct
Some checks failed
CI / formatting (push) Failing after 9m25s
CI / nix_flake_check (push) Failing after 9m20s

This commit is contained in:
Narrator 2025-12-11 10:00:38 +01:00
parent 09e65c152f
commit f6f61a9250
Signed by: Narrator
SSH key fingerprint: SHA256:vVtKn4QxRw+5lhRxGf6CeaA4Dgnsl7DMlQEzwkcMPV0
23 changed files with 117 additions and 21 deletions

96
QUICKREF.md Normal file
View file

@ -0,0 +1,96 @@
# Quick Reference
## Essential Commands
```bash
# Rebuild system with new configuration
sudo nixos-rebuild switch --flake .#nxs
# Test without making permanent changes
sudo nixos-rebuild test --flake .#nxs
# Build without activating
sudo nixos-rebuild build --flake .#nxs
# Check flake syntax
nix flake check
# Update all dependencies
nix flake update
# Search for packages
nix search nixpkgs <package-name>
```
## File Layout
| Path | Purpose |
|------|---------|
| `flake.nix` | Main flake entry point |
| `hosts/nxs/default.nix` | System configuration |
| `hosts/nxs/hardware.nix` | Hardware settings |
| `hosts/nxs/home.nix` | User environment |
| `modules/system/` | Reusable system modules |
| `modules/home/` | Reusable user modules |
## Quick Edits
```bash
# Edit system config
vim hosts/nxs/default.nix
# Edit user packages/programs
vim hosts/nxs/home.nix
# Edit Neovim config
vim modules/home/neovim/default.nix
# Add language support to Neovim
vim modules/home/neovim/languages/<lang>.nix
```
## Where to Add Things
| What | Where | File |
|------|-------|------|
| System package | hosts/nxs/ | default.nix → environment.systemPackages |
| User package | hosts/nxs/ | home.nix → home.packages |
| System service | modules/system/ | relevant-module.nix |
| User program config | modules/home/ | program-name.nix |
| Boot settings | modules/system/ | boot.nix |
| Desktop/GUI | modules/system/ | desktop.nix |
## Git Workflow
```bash
# Check status
git status
# View changes
git diff
# Stage all changes
git add -A
# Commit
git commit -m "description"
# Push
git push
```
## Maintenance
```bash
# Clean old generations (7 days)
sudo nix-collect-garbage --delete-older-than 7d
# Optimize store
nix-store --optimise
# List generations
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
# Rollback
sudo nixos-rebuild switch --rollback
```

View file

@ -19,16 +19,16 @@
outputs = { self, nixpkgs, home-manager, flake-utils, nixvim, nix-ai-tools } @ inputs: {
# Reusable modules
homeManagerModules.copilot-cli = import ./modules/home-manager/copilot-cli.nix;
nixosModules.auto-upgrade = import ./modules/nixos/auto-upgrade.nix;
homeManagerModules.copilot-cli = import ./modules/home/copilot-cli.nix;
nixosModules.auto-upgrade = import ./modules/system/auto-upgrade.nix;
# Host configurations
nixosConfigurations.nxs = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/nxs/configuration.nix
./hosts/nxs/hardware-configuration.nix
./hosts/nxs
./hosts/nxs/hardware.nix
self.nixosModules.auto-upgrade
home-manager.nixosModules.home-manager
{

View file

@ -2,11 +2,11 @@
{
imports = [
./hardware-configuration.nix
./modules/nixos/boot.nix
./modules/nixos/hardware.nix
./modules/nixos/desktop.nix
./modules/nixos/power-management.nix
./hardware.nix
../../modules/system/boot.nix
../../modules/system/hardware.nix
../../modules/system/desktop.nix
../../modules/system/power-management.nix
];
# System settings

View file

@ -3,11 +3,11 @@
{
imports = [
inputs.nixvim.homeManagerModules.nixvim
./modules/home-manager/i3.nix
./modules/home-manager/i3blocks.nix
./modules/home-manager/neovim.nix
./modules/home-manager/fish.nix
./modules/home-manager/tmux.nix
../../modules/home/i3.nix
../../modules/home/i3blocks.nix
../../modules/home/neovim
../../modules/home/fish.nix
../../modules/home/tmux.nix
];
# Home Manager settings

View file

@ -2,13 +2,13 @@
{
imports = [
./nvim/core.nix
./nvim/lsp.nix
./nvim/lang/python.nix
./nvim/lang/haskell.nix
./nvim/lang/nix.nix
./nvim/lang/c.nix
./nvim/lang/rust.nix
./core.nix
./lsp.nix
./languages/python.nix
./languages/haskell.nix
./languages/nix.nix
./languages/c.nix
./languages/rust.nix
];
programs.nixvim = {