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:
2026-03-22 00:07:52 +02:00
parent c567ca5c3f
commit e6188adc0d
4 changed files with 80 additions and 145 deletions
+51 -117
View File
@@ -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/<name>.nix`
- **NixOS modules**: `modules/nixos/<name>.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.<module-name>.enable = lib.mkOption {
default = true;
example = true;
type = lib.types.bool;
};
config = lib.mkIf isEnabled {
home.packages = with pkgs; [
<package1>
<package2>
];
home.packages = with pkgs; [ pkg1 pkg2 ];
};
}
```
### 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>`
- **Enable option**: Always `enable` (bool), default `true`
- **Module names**: kebab-case (e.g., `libreoffice.nix`, `git-config.nix`)
- **Variable names**: kebab-case in let bindings (e.g., `isEnabled`)
### 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
### Formatting
- Indentation: 2 spaces
- Let bindings: multi-line with `isEnabled` on its own line
- Packages: Use `with pkgs; [ ... ]` syntax
### Imports
- Always include `{...}` for module args even if unused
- Standard module args: `lib, config, pkgs, ...`
- Always include `{...}` for module args
- Standard args: `lib, config, pkgs, ...`
- 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
- 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`
- **Conditional config**: Always use `lib.mkIf isEnabled` wrapper
- **Package lists**: Use `with pkgs; [ ... ]` syntax
### Home-Manager vs NixOS
- Home-manager: `home.packages`, `home.file`, `programs.<program>`
- NixOS: `config.services`, `environment.systemPackages`
### Error Handling
## Adding New Modules
- Use `lib.mkIf` for conditional configuration rather than if-then-else
- Use `lib.mkDefault` for values that can be overridden by users
- Use `lib.mkForce` sparingly for values that must not be overridden
### 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
1. Create file in `modules/home-manager/` or `modules/nixos/`
2. Add import to `modules/<type>/default.nix` (alphabetical)
3. Use module template above
4. Run `nix fmt`
## Key Files
- `flake.nix`: Main flake definition, defines systems, overlays, modules
- `modules/home-manager/default.nix`: Home-manager module imports
- `modules/nixos/default.nix`: NixOS module imports
- `nixos/configuration.nix`: Lauretta laptop configuration
- `nixos/configuration-vm.nix`: Test VM configuration
- `overlays/`: Custom package overlays
- `pkgs/`: Custom packages
| File | Purpose |
|------|---------|
| `flake.nix` | Main flake, defines systems, overlays |
| `modules/home-manager/default.nix` | Home-manager imports |
| `modules/nixos/default.nix` | NixOS imports |
| `nixos/configuration.nix` | Lauretta laptop config |
| `nixos/configuration-vm.nix` | Test VM config |
| `overlays/` | Custom package overlays |
| `pkgs/` | Custom packages |
| `azos-core/` | Shared modules (submodule) |
## Common Tasks
### Add new package to system
1. Create or edit module in `modules/nixos/`
2. Add to `environment.systemPackages = with pkgs; [ pkg ]`
**Add system package**: Edit NixOS module, add to `environment.systemPackages = with pkgs; [ pkg ]`
### Add new home-manager package
1. Create or edit module in `modules/home-manager/`
2. Add to `home.packages = with pkgs; [ pkg ]`
**Add home-manager package**: Edit module, add to `home.packages = with pkgs; [ pkg ]`
### Add new system 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`
**Add system service**: Edit NixOS module, add under `services.<service>`
Generated
+18 -18
View File
@@ -64,11 +64,11 @@
]
},
"locked": {
"lastModified": 1772020340,
"narHash": "sha256-aqBl3GNpCadMoJ/hVkWTijM1Aeilc278MjM+LA3jK6g=",
"lastModified": 1773264488,
"narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "36e38ca0d9afe4c55405fdf22179a5212243eecc",
"rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c",
"type": "github"
},
"original": {
@@ -83,11 +83,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1767232402,
"narHash": "sha256-li+h6crnhc5Zqs+M6pn7D7M0W9M63ECNennDjRgzioE=",
"lastModified": 1773185476,
"narHash": "sha256-COuJkFg669oalmEN3T61gD3gM9SfUsiGvDS9pCOphZY=",
"owner": "musnix",
"repo": "musnix",
"rev": "d65f98e0b1f792365f1705653d7b2d266ceeff6e",
"rev": "739e2a1f94c87d5f4c8b880a12480185cf0d7620",
"type": "github"
},
"original": {
@@ -98,11 +98,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1771969195,
"narHash": "sha256-qwcDBtrRvJbrrnv1lf/pREQi8t2hWZxVAyeMo7/E9sw=",
"lastModified": 1773533765,
"narHash": "sha256-qonGfS2lzCgCl59Zl63jF6dIRRpvW3AJooBGMaXjHiY=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "41c6b421bdc301b2624486e11905c9af7b8ec68e",
"rev": "f8e82243fd601afb9f59ad230958bd073795cbfe",
"type": "github"
},
"original": {
@@ -128,11 +128,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1771848320,
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
"lastModified": 1773389992,
"narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
"rev": "c06b4ae3d6599a672a6210b7021d699c351eebda",
"type": "github"
},
"original": {
@@ -158,11 +158,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"lastModified": 1772198003,
"narHash": "sha256-I45esRSssFtJ8p/gLHUZ1OUaaTaVLluNkABkk6arQwE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"rev": "dd9b079222d43e1943b6ebd802f04fd959dc8e61",
"type": "github"
},
"original": {
@@ -174,11 +174,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1773476965,
"narHash": "sha256-Laaj25PvGeoP5SPhMfMGxvWqM6ZjZ6LdUeEhP6b3czY=",
"lastModified": 1773507054,
"narHash": "sha256-Q8U5VXgrcxmCxPtCCJCIZkcAX3FCZwGh1GNVIXxMND0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f82ce7af0b79ac154b12e27ed800aeb97413723c",
"rev": "e80236013dc8b77aa49ca90e7a12d86f5d8d64c9",
"type": "github"
},
"original": {
+5 -7
View File
@@ -7,6 +7,8 @@ config.load_autoconfig(True)
#Also using this https://github.com/miseran/tabs_are_windows/blob/main/config.py
c.tabs.show = 'never'
c.session.default_name = ''
c.session.store_size = 0
c.tabs.tabs_are_windows = True
c.window.title_format = 'qute: {private}{host}{perc}{title_sep}{current_title}'
@@ -26,12 +28,8 @@ c.url.searchengines = {
#Youtube stuff from DT.
#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('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\\")"')
config.bind('M', 'hint links spawn mpv --title="${media-title}" {hint-url}')
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\\")"')
config.bind('xb', 'config-cycle statusbar.show always in-mode')
c.statusbar.show = 'in-mode'
@@ -44,7 +42,7 @@ c.downloads.location.prompt = False
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.entry = monospace
c.fonts.debug_console = monospace
+6 -3
View File
@@ -26,9 +26,12 @@
:stream t
:key "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"
:models '(openai/gpt-oss-120b)))
;; This is where I would update agents if I had them
;; (setq gptel-agent-dirs '("/home/aner/.agents"))
;; (gptel-agent-update)
#+end_src
** Agent Shell
#+begin_src emacs-lisp
(setq agent-shell-preferred-agent-config (agent-shell-opencode-make-agent-config))
#+end_src
** Headphones