qutebrowser: fix escape sequences and disable session restore
- Simplify escape sequences in bind commands (M, Z keys) - Add c.session.default_name = '' and c.session.store_size = 0 - Update AGENTS.md (trimmed to 150 lines) - Update flake.lock with latest dependencies
This commit is contained in:
@@ -4,74 +4,47 @@ This is a NixOS/Nix flake-based configuration repository using home-manager for
|
|||||||
|
|
||||||
## Build Commands
|
## Build Commands
|
||||||
|
|
||||||
### Evaluating Configuration
|
### Evaluating
|
||||||
```bash
|
```bash
|
||||||
# Evaluate system config (Lauretta laptop)
|
|
||||||
nix eval .#nixosConfigurations.lauretta.config.system.build.toplevel
|
nix eval .#nixosConfigurations.lauretta.config.system.build.toplevel
|
||||||
|
|
||||||
# Evaluate flake info
|
|
||||||
nix flake show
|
nix flake show
|
||||||
|
|
||||||
# Evaluate all outputs
|
|
||||||
nix eval . --apply 'x: x'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
```bash
|
```bash
|
||||||
# Build VM
|
# VM (with submodules for azos-core)
|
||||||
nix build .#nixosConfigurations.vm.config.system.build.vm
|
|
||||||
# Or with submodules
|
|
||||||
nix build '.?submodules=1#nixosConfigurations.vm.config.system.build.vm'
|
nix build '.?submodules=1#nixosConfigurations.vm.config.system.build.vm'
|
||||||
|
|
||||||
# Build formatter (alejandra)
|
# Formatter
|
||||||
nix build .#formatter.x86_64-linux
|
nix build .#formatter.x86_64-linux
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deploying
|
### Deploying
|
||||||
```bash
|
```bash
|
||||||
# Switch to new config (Lauretta)
|
|
||||||
sudo nixos-rebuild switch --flake '.?submodules=1#lauretta'
|
sudo nixos-rebuild switch --flake '.?submodules=1#lauretta'
|
||||||
|
nix flake update # Update all inputs
|
||||||
# Update flake inputs
|
nix flake lock --update-input X # Update specific input
|
||||||
nix flake update
|
|
||||||
|
|
||||||
# Update specific input
|
|
||||||
nix flake lock --update-input azos-core
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Nix REPL
|
### Dev Shell & REPL
|
||||||
```bash
|
|
||||||
nix repl
|
|
||||||
:lf .
|
|
||||||
# Then explore with:
|
|
||||||
inputs.nixpkgs.lib
|
|
||||||
```
|
|
||||||
|
|
||||||
### Dev Shell
|
|
||||||
```bash
|
```bash
|
||||||
nix develop .#shells.x86_64-linux.debugTexShell
|
nix develop .#shells.x86_64-linux.debugTexShell
|
||||||
```
|
nix repl
|
||||||
|
:lf .
|
||||||
### Garbage Collection
|
|
||||||
```bash
|
|
||||||
sudo nix-collect-garbage --delete-old
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Linting/Formatting
|
## Linting/Formatting
|
||||||
|
|
||||||
This project uses [alejandra](https://github.comkamadorama/alejandra) as the formatter.
|
Uses [alejandra](https://github.com/kamadorama/alejandra):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Format all Nix files
|
nix fmt # Format all Nix files
|
||||||
nix fmt
|
|
||||||
|
|
||||||
# Or use alejandra directly
|
|
||||||
alejandra .
|
alejandra .
|
||||||
```
|
```
|
||||||
|
|
||||||
There are no automated tests in this repository. VM testing is manual:
|
## Testing
|
||||||
|
|
||||||
|
Manual VM testing:
|
||||||
```bash
|
```bash
|
||||||
# Build and run VM
|
|
||||||
nix build .#nixosConfigurations.vm.config.system.build.vm
|
nix build .#nixosConfigurations.vm.config.system.build.vm
|
||||||
./result/bin/run-nixos-vm
|
./result/bin/run-nixos-vm
|
||||||
```
|
```
|
||||||
@@ -79,15 +52,11 @@ nix build .#nixosConfigurations.vm.config.system.build.vm
|
|||||||
## Code Style Guidelines
|
## Code Style Guidelines
|
||||||
|
|
||||||
### File Organization
|
### File Organization
|
||||||
|
|
||||||
- **Home-manager modules**: `modules/home-manager/<name>.nix`
|
- **Home-manager modules**: `modules/home-manager/<name>.nix`
|
||||||
- **NixOS modules**: `modules/nixos/<name>.nix`
|
- **NixOS modules**: `modules/nixos/<name>.nix`
|
||||||
- **Imports**: All modules are imported in `modules/home-manager/default.nix` and `modules/nixos/default.nix`
|
- **Imports**: All modules in `modules/home-manager/default.nix` and `modules/nixos/default.nix` (alphabetical order)
|
||||||
- **Import sorting**: Alphabetical order in default.nix files
|
|
||||||
|
|
||||||
### Nix Module Structure
|
### Nix Module Template
|
||||||
|
|
||||||
Follow this template for home-manager modules:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -101,100 +70,65 @@ Follow this template for home-manager modules:
|
|||||||
in {
|
in {
|
||||||
options.azos.<module-name>.enable = lib.mkOption {
|
options.azos.<module-name>.enable = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = true;
|
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf isEnabled {
|
config = lib.mkIf isEnabled {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [ pkg1 pkg2 ];
|
||||||
<package1>
|
|
||||||
<package2>
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Naming Conventions
|
### Naming Conventions
|
||||||
|
- Option paths: `config.azos.<module-name>.<option>`
|
||||||
|
- Enable option: `enable` (bool), default `true`
|
||||||
|
- Module names: kebab-case (`libreoffice.nix`, `git-config.nix`)
|
||||||
|
- Variables: kebab-case (`isEnabled`)
|
||||||
|
|
||||||
- **Option paths**: `config.azos.<module-name>.<option>`
|
### Formatting
|
||||||
- **Enable option**: Always `enable` (bool), default `true`
|
- Indentation: 2 spaces
|
||||||
- **Module names**: kebab-case (e.g., `libreoffice.nix`, `git-config.nix`)
|
- Let bindings: multi-line with `isEnabled` on its own line
|
||||||
- **Variable names**: kebab-case in let bindings (e.g., `isEnabled`)
|
- Packages: Use `with pkgs; [ ... ]` syntax
|
||||||
|
|
||||||
### Formatting Rules
|
|
||||||
|
|
||||||
- **Indentation**: 2 spaces
|
|
||||||
- **Let bindings**: Multi-line format with `isEnabled` on its own line
|
|
||||||
```nix
|
|
||||||
let
|
|
||||||
isEnabled =
|
|
||||||
config.azos.module.enable;
|
|
||||||
in
|
|
||||||
```
|
|
||||||
- **Imports**: Sorted alphabetically in default.nix
|
|
||||||
- **Packages**: Use `with pkgs;` block for package lists
|
|
||||||
|
|
||||||
### Imports
|
### Imports
|
||||||
|
- Always include `{...}` for module args
|
||||||
- Always include `{...}` for module args even if unused
|
- Standard args: `lib, config, pkgs, ...`
|
||||||
- Standard module args: `lib, config, pkgs, ...`
|
|
||||||
- Use `./relative/path.nix` for local imports
|
- Use `./relative/path.nix` for local imports
|
||||||
|
|
||||||
### Adding New Modules
|
|
||||||
|
|
||||||
1. Create file in appropriate directory (`modules/home-manager/` or `modules/nixos/`)
|
|
||||||
2. Add import to `modules/<type>/default.nix` in alphabetical order
|
|
||||||
3. Use the standard module template above
|
|
||||||
4. Run `nix fmt` to format
|
|
||||||
|
|
||||||
### Option Patterns
|
### Option Patterns
|
||||||
|
- Boolean enable: `lib.mkOption { default = true; type = lib.types.bool; }`
|
||||||
|
- Conditional config: `lib.mkIf isEnabled { ... }`
|
||||||
|
- User-overridable: `lib.mkDefault`
|
||||||
|
- Force value: `lib.mkForce` (sparingly)
|
||||||
|
|
||||||
- **Boolean enable**: Always use `lib.mkOption` with `default = true`, `type = lib.types.bool`
|
### Home-Manager vs NixOS
|
||||||
- **Conditional config**: Always use `lib.mkIf isEnabled` wrapper
|
- Home-manager: `home.packages`, `home.file`, `programs.<program>`
|
||||||
- **Package lists**: Use `with pkgs; [ ... ]` syntax
|
- NixOS: `config.services`, `environment.systemPackages`
|
||||||
|
|
||||||
### Error Handling
|
## Adding New Modules
|
||||||
|
|
||||||
- Use `lib.mkIf` for conditional configuration rather than if-then-else
|
1. Create file in `modules/home-manager/` or `modules/nixos/`
|
||||||
- Use `lib.mkDefault` for values that can be overridden by users
|
2. Add import to `modules/<type>/default.nix` (alphabetical)
|
||||||
- Use `lib.mkForce` sparingly for values that must not be overridden
|
3. Use module template above
|
||||||
|
4. Run `nix fmt`
|
||||||
### Home-Manager Specific
|
|
||||||
|
|
||||||
- Config goes under `home` attribute (e.g., `home.packages`, `home.file`, `home.sessionVariables`)
|
|
||||||
- Use `programs.<program>` for program configurations
|
|
||||||
- Use `services.<service>` for system services
|
|
||||||
|
|
||||||
### NixOS Specific
|
|
||||||
|
|
||||||
- Config goes under `config` directly (e.g., `services`, `environment.systemPackages`)
|
|
||||||
- Use `environment.systemPackages` for system-wide packages
|
|
||||||
- Use `users.users.<name>` for user configuration
|
|
||||||
|
|
||||||
## Key Files
|
## Key Files
|
||||||
|
|
||||||
- `flake.nix`: Main flake definition, defines systems, overlays, modules
|
| File | Purpose |
|
||||||
- `modules/home-manager/default.nix`: Home-manager module imports
|
|------|---------|
|
||||||
- `modules/nixos/default.nix`: NixOS module imports
|
| `flake.nix` | Main flake, defines systems, overlays |
|
||||||
- `nixos/configuration.nix`: Lauretta laptop configuration
|
| `modules/home-manager/default.nix` | Home-manager imports |
|
||||||
- `nixos/configuration-vm.nix`: Test VM configuration
|
| `modules/nixos/default.nix` | NixOS imports |
|
||||||
- `overlays/`: Custom package overlays
|
| `nixos/configuration.nix` | Lauretta laptop config |
|
||||||
- `pkgs/`: Custom packages
|
| `nixos/configuration-vm.nix` | Test VM config |
|
||||||
|
| `overlays/` | Custom package overlays |
|
||||||
|
| `pkgs/` | Custom packages |
|
||||||
|
| `azos-core/` | Shared modules (submodule) |
|
||||||
|
|
||||||
## Common Tasks
|
## Common Tasks
|
||||||
|
|
||||||
### Add new package to system
|
**Add system package**: Edit NixOS module, add to `environment.systemPackages = with pkgs; [ pkg ]`
|
||||||
1. Create or edit module in `modules/nixos/`
|
|
||||||
2. Add to `environment.systemPackages = with pkgs; [ pkg ]`
|
|
||||||
|
|
||||||
### Add new home-manager package
|
**Add home-manager package**: Edit module, add to `home.packages = with pkgs; [ pkg ]`
|
||||||
1. Create or edit module in `modules/home-manager/`
|
|
||||||
2. Add to `home.packages = with pkgs; [ pkg ]`
|
|
||||||
|
|
||||||
### Add new system service
|
**Add system service**: Edit NixOS module, add under `services.<service>`
|
||||||
1. Edit appropriate NixOS module
|
|
||||||
2. Add service config under `services.<service>`
|
|
||||||
|
|
||||||
### Test changes locally
|
|
||||||
1. Build VM: `nix build .#nixosConfigurations.vm.config.system.build.vm`
|
|
||||||
2. Run VM: `./result/bin/run-nixos-vm`
|
|
||||||
Generated
+18
-18
@@ -64,11 +64,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772020340,
|
"lastModified": 1773264488,
|
||||||
"narHash": "sha256-aqBl3GNpCadMoJ/hVkWTijM1Aeilc278MjM+LA3jK6g=",
|
"narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "36e38ca0d9afe4c55405fdf22179a5212243eecc",
|
"rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -83,11 +83,11 @@
|
|||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767232402,
|
"lastModified": 1773185476,
|
||||||
"narHash": "sha256-li+h6crnhc5Zqs+M6pn7D7M0W9M63ECNennDjRgzioE=",
|
"narHash": "sha256-COuJkFg669oalmEN3T61gD3gM9SfUsiGvDS9pCOphZY=",
|
||||||
"owner": "musnix",
|
"owner": "musnix",
|
||||||
"repo": "musnix",
|
"repo": "musnix",
|
||||||
"rev": "d65f98e0b1f792365f1705653d7b2d266ceeff6e",
|
"rev": "739e2a1f94c87d5f4c8b880a12480185cf0d7620",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -98,11 +98,11 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771969195,
|
"lastModified": 1773533765,
|
||||||
"narHash": "sha256-qwcDBtrRvJbrrnv1lf/pREQi8t2hWZxVAyeMo7/E9sw=",
|
"narHash": "sha256-qonGfS2lzCgCl59Zl63jF6dIRRpvW3AJooBGMaXjHiY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "41c6b421bdc301b2624486e11905c9af7b8ec68e",
|
"rev": "f8e82243fd601afb9f59ad230958bd073795cbfe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -128,11 +128,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771848320,
|
"lastModified": 1773389992,
|
||||||
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
|
"narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
|
"rev": "c06b4ae3d6599a672a6210b7021d699c351eebda",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -158,11 +158,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766902085,
|
"lastModified": 1772198003,
|
||||||
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
|
"narHash": "sha256-I45esRSssFtJ8p/gLHUZ1OUaaTaVLluNkABkk6arQwE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
|
"rev": "dd9b079222d43e1943b6ebd802f04fd959dc8e61",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -174,11 +174,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773476965,
|
"lastModified": 1773507054,
|
||||||
"narHash": "sha256-Laaj25PvGeoP5SPhMfMGxvWqM6ZjZ6LdUeEhP6b3czY=",
|
"narHash": "sha256-Q8U5VXgrcxmCxPtCCJCIZkcAX3FCZwGh1GNVIXxMND0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f82ce7af0b79ac154b12e27ed800aeb97413723c",
|
"rev": "e80236013dc8b77aa49ca90e7a12d86f5d8d64c9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ config.load_autoconfig(True)
|
|||||||
#Also using this https://github.com/miseran/tabs_are_windows/blob/main/config.py
|
#Also using this https://github.com/miseran/tabs_are_windows/blob/main/config.py
|
||||||
|
|
||||||
c.tabs.show = 'never'
|
c.tabs.show = 'never'
|
||||||
|
c.session.default_name = ''
|
||||||
|
c.session.store_size = 0
|
||||||
c.tabs.tabs_are_windows = True
|
c.tabs.tabs_are_windows = True
|
||||||
c.window.title_format = 'qute: {private}{host}{perc}{title_sep}{current_title}'
|
c.window.title_format = 'qute: {private}{host}{perc}{title_sep}{current_title}'
|
||||||
|
|
||||||
@@ -26,12 +28,8 @@ c.url.searchengines = {
|
|||||||
|
|
||||||
#Youtube stuff from DT.
|
#Youtube stuff from DT.
|
||||||
#Added media-title to MPV and youtube-dl with exwm process to track progress.
|
#Added media-title to MPV and youtube-dl with exwm process to track progress.
|
||||||
config.bind('M', 'hint links spawn mpv --title=\'${media-title}\' {hint-url}')
|
config.bind('M', 'hint links spawn mpv --title="${media-title}" {hint-url}')
|
||||||
config.bind('Z',
|
config.bind('Z', 'hint links spawn emacsclient -e "(start-process \\"youtube-dl {hint-url}\\" \\"youtube-dl {hint-url}\\" \\"youtube-dl\\" \\"-o\\" \\"~/downloads/%(title)s.%(ext)s\\" \\"{hint-url}\\" \\"--newline\\")"')
|
||||||
'hint links spawn emacsclient -e "(start-process '\
|
|
||||||
'\\"youtube-dl {hint-url}\\" \\"youtube-dl {hint-url}\\" '\
|
|
||||||
'\\"youtube-dl\\" \\"-o\\" \\"~/downloads/%(title)s.%(ext)s\\" '\
|
|
||||||
'\\"{hint-url}\\" \\"--newline\\")"')
|
|
||||||
|
|
||||||
config.bind('xb', 'config-cycle statusbar.show always in-mode')
|
config.bind('xb', 'config-cycle statusbar.show always in-mode')
|
||||||
c.statusbar.show = 'in-mode'
|
c.statusbar.show = 'in-mode'
|
||||||
@@ -44,7 +42,7 @@ c.downloads.location.prompt = False
|
|||||||
|
|
||||||
c.editor.command = ['emacsclient', '-e', '(find-file "{}")']
|
c.editor.command = ['emacsclient', '-e', '(find-file "{}")']
|
||||||
|
|
||||||
monospace = "10pt 'LiberationMono'"
|
monospace = "10pt 'DejaVu Sans Mono'"
|
||||||
c.fonts.completion.category = f"bold{monospace}"
|
c.fonts.completion.category = f"bold{monospace}"
|
||||||
c.fonts.completion.entry = monospace
|
c.fonts.completion.entry = monospace
|
||||||
c.fonts.debug_console = monospace
|
c.fonts.debug_console = monospace
|
||||||
|
|||||||
@@ -26,9 +26,12 @@
|
|||||||
:stream t
|
:stream t
|
||||||
:key "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"
|
:key "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"
|
||||||
:models '(openai/gpt-oss-120b)))
|
:models '(openai/gpt-oss-120b)))
|
||||||
;; This is where I would update agents if I had them
|
#+end_src
|
||||||
;; (setq gptel-agent-dirs '("/home/aner/.agents"))
|
|
||||||
;; (gptel-agent-update)
|
** Agent Shell
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq agent-shell-preferred-agent-config (agent-shell-opencode-make-agent-config))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Headphones
|
** Headphones
|
||||||
|
|||||||
Reference in New Issue
Block a user