updates config

This commit is contained in:
Dennis Schoepf 2026-03-03 21:51:59 +01:00
parent 8156c9bd85
commit e72a052384
182 changed files with 47 additions and 10411 deletions

View file

@ -1,276 +0,0 @@
# Agent Guide for nix-config
This document provides guidelines for AI coding agents working in this Nix configuration repository.
## Repository Overview
This is a flake-based Nix configuration managing multiple hosts:
- `dnsc-air` (nix-darwin, macOS)
- `dnsc-work` (nix-darwin, macOS)
- `dnsc-deck` (home-manager only, Steam Deck)
- `dnsc-server` (NixOS)
- `dnsc-vps-sm` (NixOS)
## Directory Structure
```
.
├── flake.nix # Main flake configuration
├── Justfile # Common build/deploy commands
├── hosts/ # Host-specific configurations
│ ├── dnsc-air/
│ ├── dnsc-work/
│ ├── dnsc-server/
│ └── dnsc-vps-sm/
├── home/ # Home-manager configurations
│ ├── darwin.nix
│ ├── darwin-work.nix
│ ├── linux.nix
│ ├── server.nix
│ └── deck.nix
├── modules/ # Reusable modules
│ ├── base/
│ ├── fish/
│ ├── git/
│ ├── nixvim/
│ └── [40+ other modules]
└── secrets/ # agenix encrypted secrets
```
## Build Commands
### Validation and Testing
```bash
# Check flake evaluates correctly
nix flake check
# Show flake metadata
nix flake show
# Update flake inputs
just up
# Update specific input
just upi i=home-manager
```
### Deployment
**macOS (darwin-rebuild):**
```bash
# Deploy to current macOS host
just mre
# Deploy with lock file recreation
just mup
# Manual deployment
darwin-rebuild switch --flake .
```
**NixOS (nixos-rebuild):**
```bash
# Deploy NixOS configuration
just deploy
# Deploy with debug output
just debug
# Manual deployment
nixos-rebuild switch --flake .
```
**Steam Deck (home-manager):**
```bash
# Deploy to Steam Deck
just dre
# Manual deployment
nix run home-manager/master -- switch --flake .#dnsc-deck
```
### Maintenance
```bash
# View system generation history
just history
# Clean old generations (>7 days)
just clean
# Run garbage collection
just gc
# Open Nix REPL
just repl
```
## Code Style Guidelines
### Nix Language Conventions
**File Structure:**
```nix
{
config,
inputs,
outputs,
lib,
pkgs,
...
}:
{
imports = [
# List imports first
];
# Configuration follows
}
```
**Formatting:**
- Use 2 spaces for indentation
- Opening braces on same line: `{ foo = "bar"; }`
- Function parameters use named pattern matching
- Multi-line lists: one item per line with trailing semicolons
- String interpolation: `"${variable}"` or `''${expression}''`
**Naming Conventions:**
- Module files: `default.nix` in subdirectories
- Descriptive attribute names: `services.syncthing.enable`
- Host configurations: `dnsc-<hostname>`
- Use kebab-case for file/directory names: `nixos-modules`
- Use camelCase for attribute names in Nix expressions
**Imports:**
```nix
# In flake.nix
inputs.home-manager.nixosModules.home-manager
# In configuration files
outputs.nixosModules.base
../../modules/docker
./hardware-configuration.nix
```
**Package Management:**
```nix
# System packages
environment.systemPackages = with pkgs; [
git
btop
neovim
];
# Using lib.mkAfter for additions
environment.systemPackages = lib.mkAfter (
with pkgs; [
additional-package
]
);
```
**Module Structure:**
- Keep modules focused and reusable
- Place in `modules/<service-name>/default.nix`
- Use option declarations when creating configurable modules
- Include modules in host configs via `imports = [ ]`
### Configuration Patterns
**Home Manager Integration:**
```nix
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
useGlobalPkgs = true;
backupFileExtension = "backup";
users = {
dennis = import ../../home/darwin.nix;
};
};
```
**Service Configuration:**
```nix
services.syncthing = {
enable = true;
user = "dennis";
configDir = "/home/dennis/.config/syncthing";
# ... additional settings
};
```
**Secrets with agenix:**
```nix
age = {
identityPaths = [ "${config.users.users.dennis.home}/.ssh/id_ed25519" ];
secrets."restic/password".file = ../../secrets/restic/password.age;
};
```
### Fish Shell Functions
**Function Style:**
```nix
functions = {
function_name = /* fish */ ''
# Fish shell code here
echo "example"
'';
};
```
**Inline Comments:**
Use `/* fish */` or `/* bash */` before multi-line strings to indicate language
## Common Tasks
### Adding a New Module
1. Create `modules/<module-name>/default.nix`
2. Define module structure:
```nix
{ pkgs, ... }:
{
# Configuration here
}
```
3. Export in `flake.nix` if needed:
```nix
nixosModules.moduleName = import ./modules/module-name;
```
4. Import in host configuration:
```nix
imports = [ ../../modules/module-name ];
```
### Adding a New Host
1. Create `hosts/<hostname>/default.nix`
2. Create `hosts/<hostname>/hardware-configuration.nix` (for NixOS)
3. Add configuration to `flake.nix`:
```nix
nixosConfigurations.hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs outputs; };
modules = [ ./hosts/hostname ];
};
```
### Modifying Home Manager Config
1. Edit appropriate file in `home/`:
- `darwin.nix` for dnsc-air
- `darwin-work.nix` for dnsc-work
- `server.nix` for servers
2. Changes take effect on next deployment
3. Home configs import modules from `modules/` directory
## Important Notes
- **Never commit secrets**: Use agenix for sensitive data
- **Test before deploying**: Run `nix flake check` before major changes
- **System state version**: Don't change `system.stateVersion` without migration
- **Flake inputs**: Keep inputs up-to-date with `just up`
- **Git ignore**: `.DS_Store` files are ignored globally (see `modules/git/default.nix`)
- **No traditional package.json**: This is a Nix project, not a Node.js project
- **Experimental features**: This config uses `nix-command` and `flakes` features

View file

@ -1,36 +0,0 @@
deploy:
nixos-rebuild switch --flake .
debug:
nixos-rebuild switch --flake . --show-trace --verbose
up:
nix flake update
# Update specific input
# usage: make upi i=home-manager
upi:
nix flake update $(i)
history:
nix profile history --profile /nix/var/nix/profiles/system
repl:
nix repl -f flake:nixpkgs
clean:
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
gc:
sudo nix-collect-garbage --delete-old
# dnsc-air
mre:
if ! git diff --quiet || ! git diff --staged --quiet; then git add . && git commit -am "new revision"; fi && darwin-rebuild switch --flake .
mup:
darwin-rebuild switch --recreate-lock-file --flake .
# dnsc-deck
dre:
nix run home-manager/master -- switch --flake .#dnsc-deck

View file

@ -1,29 +0,0 @@
# Nix
The flake-based nix configuration I use for my servers and personal computing devices:
- `dnsc-air` (nix-darwin)
- `dnsc-work` (nix-darwin)
- `dnsc-deck` (nix package/configuration management on Steam Deck)
- `dnsc-server` (NixOS)
- `dnsc-vps-sm` (nixOS)
## Modules
Shared functionality can be found in the `./modules` directory. The modules are just included in the relevant host configuration.
## Home Manager
In addition to the system configuration in `./hosts` I use `home-manager` to handle user-specific configuration (`./home`).
## Secrets
Secrets are managed with `agenix`. A step-by-step tutorial is included as a comment in the main secrets file.
## Commands
Because Nix-CLI commands can get a bit unwieldy (at least as how I use them currently) I've added a `Justfile` with commands to deploy changes and update packages and flakes.
## TODO
- [ ] Modularize server configs (`dnsc-vps-sm` and `dnsc-server`)

520
bak/flake.lock generated
View file

@ -1,520 +0,0 @@
{
"nodes": {
"agenix": {
"inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"systems": "systems"
},
"locked": {
"lastModified": 1770165109,
"narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=",
"owner": "ryantm",
"repo": "agenix",
"rev": "b027ee29d959fda4b60b57566d64c98a202e0feb",
"type": "github"
},
"original": {
"owner": "ryantm",
"repo": "agenix",
"type": "github"
}
},
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1769363988,
"narHash": "sha256-BiGPeulrDVetXP+tjxhMcGLUROZAtZIhU5m4MqawCfM=",
"owner": "Homebrew",
"repo": "brew",
"rev": "d01011cac6d72032c75fd2cd9489909e95d9faf2",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "5.0.12",
"repo": "brew",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1744478979,
"narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "43975d782b418ebf4969e9ccba82466728c2851b",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"firefox-addons": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1770350627,
"narHash": "sha256-gaLX5akNsppWTRPw4Q+E8QxsjxMkMAU539wFdnI8i70=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "27854a8a99d8ef77d0d6c70cf9c7f99f1a3e8d8f",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1769996383,
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1745494811,
"narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770318660,
"narHash": "sha256-yFVde8QZK7Dc0Xa8eQDsmxLX4NJNfL1NKfctSyiQgMY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "471e6a065f9efed51488d7c51a9abbd387df91b8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_3": {
"inputs": {
"nixpkgs": [
"zen-browser",
"nixpkgs"
]
},
"locked": {
"lastModified": 1769872935,
"narHash": "sha256-07HMIGQ/WJeAQJooA7Kkg1SDKxhAiV6eodvOwTX6WKI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f4ad5068ee8e89e4a7c2e963e10dd35cd77b37b7",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"ip-whitelist": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1733315147,
"narHash": "sha256-maBv+DuS0e0xuO+lh1WebUg8YkHL1jnafrmCPLrd2D0=",
"owner": "Oak-Digital",
"repo": "nixos-ip-whitelist-firewall",
"rev": "14e3346cc015d370b00a16b790a1c323b985ff63",
"type": "github"
},
"original": {
"owner": "Oak-Digital",
"repo": "nixos-ip-whitelist-firewall",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770184146,
"narHash": "sha256-DsqnN6LvXmohTRaal7tVZO/AKBuZ02kPBiZKSU4qa/k=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "0d7874ef7e3ba02d58bebb871e6e29da36fa1b37",
"type": "github"
},
"original": {
"owner": "LnL7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-homebrew": {
"inputs": {
"brew-src": "brew-src"
},
"locked": {
"lastModified": 1769437432,
"narHash": "sha256-8d7KnCpT2LweRvSzZYEGd9IM3eFX+A78opcnDM0+ndk=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "a5409abd0d5013d79775d3419bcac10eacb9d8c5",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "nix-homebrew",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1754028485,
"narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "59e69648d345d6e8fef86158c555730fa12af9de",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1770136044,
"narHash": "sha256-tlFqNG/uzz2++aAmn4v8J0vAkV3z7XngeIIB3rM3650=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e576e3c9cf9bad747afcddd9e34f51d18c855b4e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1744536153,
"narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 0,
"narHash": "sha256-US1tAChvPxT52RV8GksWZS415tTS7PV42KTc2PNDBmc=",
"path": "/nix/store/aa0zsahvyqnvzkicsh29jirm9hwv95pg-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1770169770,
"narHash": "sha256-awR8qIwJxJJiOmcEGgP2KUqYmHG4v/z8XpL9z8FnT1A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "aa290c9891fa4ebe88f8889e59633d20cc06a5f2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1770169770,
"narHash": "sha256-awR8qIwJxJJiOmcEGgP2KUqYmHG4v/z8XpL9z8FnT1A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "aa290c9891fa4ebe88f8889e59633d20cc06a5f2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 0,
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=",
"path": "/nix/store/khbvilmsrv4l69nwd52h27j1mp44a0xi-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1728538411,
"narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1769461804,
"narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_5",
"systems": "systems_2"
},
"locked": {
"lastModified": 1770388595,
"narHash": "sha256-0NvpmDqFcJAtRFJE3RDZWnN7PDJBZutoDtN+Cl8a3DY=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "51abc532525e486176f9a7b24b17908c60017b54",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"noctalia": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770405424,
"narHash": "sha256-yZA6Kutl6ptH0ZYBzeiVg4X+nMqFWuj/raWh9WPEBd0=",
"owner": "noctalia-dev",
"repo": "noctalia-shell",
"rev": "ef94643dbc42a4566540994f08aafc1c5a2f9825",
"type": "github"
},
"original": {
"owner": "noctalia-dev",
"repo": "noctalia-shell",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager_2",
"ip-whitelist": "ip-whitelist",
"nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable",
"nixvim": "nixvim",
"noctalia": "noctalia",
"zellij-switch": "zellij-switch",
"zen-browser": "zen-browser"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1736476219,
"narHash": "sha256-+qyv3QqdZCdZ3cSO/cbpEY6tntyYjfe1bB12mdpNFaY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "de30cc5963da22e9742bbbbb9a3344570ed237b9",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"zellij-switch": {
"inputs": {
"nixpkgs": "nixpkgs_6",
"rust-overlay": "rust-overlay",
"systems": "systems_3"
},
"locked": {
"lastModified": 1742588229,
"narHash": "sha256-IPg0pBw0ciF+xl6viq3nK+dvZoDZrfBDui7dkPLz258=",
"owner": "mostafaqanbaryan",
"repo": "zellij-switch",
"rev": "0e3c303c19890ccb03589230ac5a7c4307e573e4",
"type": "github"
},
"original": {
"owner": "mostafaqanbaryan",
"repo": "zellij-switch",
"type": "github"
}
},
"zen-browser": {
"inputs": {
"home-manager": "home-manager_3",
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1770382887,
"narHash": "sha256-on4vg7ctpMPzKWcvXPtV095aal6KUPDSKV9+I8HhQtY=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "58aa8fb418e2853382d52453a6a7739125f2b8e0",
"type": "github"
},
"original": {
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,109 +0,0 @@
{
description = "dnsc-server NixOS flake";
inputs = {
agenix.url = "github:ryantm/agenix";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin.url = "github:LnL7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
ip-whitelist.url = "github:Oak-Digital/nixos-ip-whitelist-firewall";
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
zellij-switch.url = "github:mostafaqanbaryan/zellij-switch";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
firefox-addons.url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
nixvim.url = "github:nix-community/nixvim";
noctalia = {
url = "github:noctalia-dev/noctalia-shell";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
home-manager,
nix-darwin,
nix-homebrew,
agenix,
zellij-switch,
nixvim,
noctalia,
...
}@inputs:
let
inherit (self) outputs;
in
{
# Custom nixosModules
nixosModules.base = import ./modules/base;
nixosModules.macos = import ./modules/macos;
nixosModules.homebrew = import ./modules/homebrew;
nixosModules.aerospace = import ./modules/aerospace;
nixosModules.keyd = import ./modules/keyd;
nixosModules.ly = import ./modules/wm/ly;
nixosModules.unix = import ./modules/unix;
nixosModules.nvidia = import ./modules/unix/nvidia.nix;
nixosModules.bluetooth = import ./modules/unix/bluetooth.nix;
nixosModules.audio = import ./modules/unix/audio.nix;
nixosModules.printing = import ./modules/unix/printing.nix;
nixosModules.tablet = import ./modules/unix/tablet.nix;
nixosModules.steam = import ./modules/steam;
nixosModules.niriSystem = import ./modules/wm/niri-system;
nixosModules.direnv = import ./modules/direnv;
nixosConfigurations.dnsc-machine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs outputs; };
modules = [
./hosts/dnsc-machine
];
};
nixosConfigurations.dnsc-server = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs outputs; };
modules = [
./hosts/dnsc-server
agenix.nixosModules.default
];
};
nixosConfigurations.dnsc-vps-sm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs outputs; };
modules = [
./hosts/dnsc-vps-sm
agenix.nixosModules.default
];
};
darwinConfigurations.dnsc-air = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = { inherit inputs outputs; };
modules = [
nix-homebrew.darwinModules.nix-homebrew
./hosts/dnsc-air
];
};
darwinConfigurations.dnsc-work = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = { inherit inputs outputs; };
modules = [
nix-homebrew.darwinModules.nix-homebrew
./hosts/dnsc-work
];
};
homeConfigurations."dnsc-deck" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [ ./home/deck.nix ];
};
};
}

View file

@ -1,29 +0,0 @@
{ inputs, ... }:
{
home.username = "dennis";
home.stateVersion = "24.11";
home.homeDirectory = "/Users/dennis";
home.sessionVariables = {
EDITOR = "nvim";
GOPATH = "$HOME/go";
JAVA_HOME = "/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home";
ANDROID_HOME = "$HOME/Library/Android/sdk";
};
xdg.enable = true;
imports = [
inputs.nixvim.homeModules.nixvim
../modules/git
../modules/zoxide
../modules/fish
../modules/ghostty
../modules/tmux
../modules/tmuxinator/work.nix
../modules/lazygit
];
programs.home-manager.enable = true;
programs.nixvim.imports = [ ../modules/nixvim ];
}

View file

@ -1,30 +0,0 @@
{ inputs, ... }:
{
home.username = "dennis";
home.homeDirectory = "/Users/dennis";
home.stateVersion = "24.11";
home.sessionVariables = {
EDITOR = "nvim";
GOPATH = "$HOME/go";
QT_QPA_PLATFORMTHEME = "gtk3";
};
xdg.enable = true;
imports = [
inputs.nixvim.homeModules.nixvim
../modules/ssh
../modules/git
../modules/zoxide
../modules/fish
../modules/tmux
../modules/tmuxinator/personal.nix
../modules/ghostty
../modules/lazygit
];
programs.home-manager.enable = true;
programs.nixvim.imports = [ ../modules/nixvim ];
}

View file

@ -1,53 +0,0 @@
{ pkgs, ... }:
{
nix = {
package = pkgs.nix;
settings.experimental-features = [
"nix-command"
"flakes"
];
};
nixpkgs = {
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
home.username = "deck";
home.homeDirectory = "/home/deck";
home.stateVersion = "24.11";
home.sessionVariables = {
EDITOR = "nvim";
};
home.packages = with pkgs; [
git
neovim
neofetch
zip
unzip
ripgrep
fzf
just
lazygit
fortune
zoxide
fnm
gcc
];
xdg.enable = true;
imports = [
../modules/git
../modules/fish
../modules/nvim/deck.nix
../modules/lazygit
];
programs.home-manager.enable = true;
}

View file

@ -1,118 +0,0 @@
{ inputs, pkgs, ... }:
{
home.username = "dennis";
home.homeDirectory = "/home/dennis";
home.stateVersion = "24.11";
home.packages = with pkgs; [
neofetch
zip
unzip
ripgrep
fzf
fd
sd
bat
tldr
fortune
just
mmv-go
zoxide
xwayland-satellite
nerd-fonts.victor-mono
adwaita-fonts
noto-fonts-color-emoji
bodoni-moda
reversal-icon-theme
fnm
libnotify
swww
loupe
nautilus
nautilus-open-any-terminal
swaynotificationcenter
gimp
wl-clipboard
hyprpicker
usbutils
krita
gpustat
tmux
tmuxinator
adw-gtk3
kdePackages.qt6ct
];
imports = [
inputs.nixvim.homeModules.nixvim
inputs.noctalia.homeModules.default
../modules/ssh
../modules/git
../modules/zoxide
../modules/direnv
../modules/ghostty/linux.nix
../modules/fish
../modules/tmux
../modules/tmuxinator/personal.nix
../modules/zen
../modules/ungoogled-chromium
../modules/wm/niri
../modules/wm/noctalia
];
programs.home-manager.enable = true;
programs.nixvim.imports = [ ../modules/nixvim ];
# Appearance
fonts.fontconfig = {
enable = true;
antialiasing = true;
defaultFonts = {
monospace = [ "VictorMono Nerd Font" ];
sansSerif = [
"Adwaita Sans"
"Noto Color Emoji"
];
serif = [ "Bodoni Moda" ];
};
};
gtk = {
enable = true;
colorScheme = "dark";
theme.name = "adw-gtk3";
font = {
package = pkgs.adwaita-fonts;
name = "Adwaita Sans";
size = 11;
};
iconTheme = {
package = pkgs.reversal-icon-theme;
name = "Reversal-dark";
};
gtk4.iconTheme = {
package = pkgs.reversal-icon-theme;
name = "Reversal-dark";
};
cursorTheme = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
};
# Services
# Mpris (Media Player)
services.mpris-proxy.enable = true;
# Udiskie (Mass Storage Devices)
services.udiskie = {
enable = true;
settings = {
program_options = {
file_manager = "${pkgs.nautilus}/bin/nautilus";
};
};
};
}

View file

@ -1,60 +0,0 @@
{ _config, pkgs, ... }:
{
home.username = "dennis";
home.homeDirectory = "/home/dennis";
home.stateVersion = "24.11";
home.packages = with pkgs; [
neofetch
zip
unzip
ripgrep
fzf
fd
sd
bat
tldr
fortune
iotop
iftop
btop
just
mmv-go
zoxide
tmux
];
imports = [
../modules/ssh
../modules/tmux/server.nix
];
programs.home-manager.enable = true;
programs.git = {
enable = true;
settings = {
init = {
defaultBranch = "main";
};
core = {
ignorecase = "false";
};
pull = {
rebase = false;
};
push = {
autoSetupRemote = true;
};
user = {
name = "Dennis Schoepf";
email = "me@dnsc.io";
};
};
};
}

View file

@ -1,89 +0,0 @@
{
inputs,
outputs,
lib,
pkgs,
...
}:
{
imports = [
inputs.home-manager.darwinModules.home-manager
outputs.nixosModules.base
outputs.nixosModules.macos
outputs.nixosModules.homebrew
outputs.nixosModules.aerospace
outputs.nixosModules.direnv
];
# Device & user-specific settings
networking.hostName = "dnsc-air";
networking.computerName = "dnsc-air";
system.defaults.smb.NetBIOSName = "dnsc-air";
users.users."dennis" = {
home = "/Users/dennis";
description = "Dennis Schoepf";
};
nix.settings.trusted-users = [ "dennis" ];
security.pam.services.sudo_local.touchIdAuth = true;
# Device specific overlays
nixpkgs.overlays = [ ];
# System Packages
environment.systemPackages = lib.mkAfter (
with pkgs;
[
rsync
# Some global devtools that are
# not included in project flakes
tree-sitter
nil
stylua
lua-language-server
]
);
# Install additional homebrew apps
homebrew.masApps = {
Bitwarden = 1352778147;
"Yesterday For Old Reddit" = 1603279883;
"Final Cut Pro" = 424389933;
Wireguard = 1451685025;
Pages = 409201541;
};
homebrew.brews = lib.mkAfter ([
"harfbuzz"
"openexr"
"openjph"
"p11-kit"
"ca-certificates"
"gettext"
"yt-dlp"
]);
homebrew.casks = lib.mkAfter ([
"cyberduck"
"krita"
"darktable"
]);
# Shells
environment.shells = [ pkgs.fish ];
# Home Manager Setup
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
useGlobalPkgs = true;
backupFileExtension = "backup";
users = {
dennis = import ../../home/darwin.nix;
};
};
nix.enable = false;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
}

View file

@ -1,84 +0,0 @@
{
lib,
inputs,
outputs,
pkgs,
...
}:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager
outputs.nixosModules.base
outputs.nixosModules.unix
outputs.nixosModules.nvidia
outputs.nixosModules.bluetooth
outputs.nixosModules.printing
outputs.nixosModules.tablet
outputs.nixosModules.audio
outputs.nixosModules.ly
outputs.nixosModules.niriSystem
outputs.nixosModules.keyd
outputs.nixosModules.steam
];
# Device specific overlays
# Overlays for all devices are defined
# in flake.nix
nixpkgs.overlays = [
(final: prev: {
python3Packages = prev.python3Packages // {
python-dbusmock =
inputs.nixpkgs-backport-fix.legacyPackages.x86_64-linux.python3Packages.python-dbusmock;
};
})
];
# General settings
networking.hostName = "dnsc-machine";
time.timeZone = "Europe/Berlin";
services.xserver.xkb.layout = "eu";
users.users.dennis = {
isNormalUser = true;
description = "dennis";
extraGroups = [
"networkmanager"
"wheel"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXWZOPOJJDAoF+Sx/ZLoAVu6G/7/MAWoknBgMAzjul dennis@dnsc-mac"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnmuxDkpDIku5t1Tykz21u78xoQ7LJR8JEcfth32LGu dennis@dnsc-work"
];
};
# Home Manager
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
backupFileExtension = "backup";
users = {
dennis = {
imports = [
inputs.zen-browser.homeModules.beta
../../home/linux.nix
];
};
};
};
# System Packages
environment.systemPackages = lib.mkAfter (with pkgs; [ ]);
# Enable some services that do not need configuration
services.openssh.enable = true;
services.udisks2.enable = true;
services.tuned.enable = true;
services.upower.enable = true;
services.udev.packages = with pkgs; [
vial
];
system.stateVersion = "25.05";
}

View file

@ -1,41 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/30277f94-8b7b-4e91-8438-6815170edfdd";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4DC9-7AB7";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/9b7564e7-2deb-4432-a4fc-d18d21ef2d11"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp42s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp45s0f3u3u4.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,173 +0,0 @@
{
config,
inputs,
outputs,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager
../../modules/docker
../../modules/ups
../../modules/restic
../../modules/samba
../../modules/openssh
../../modules/jellyfin
../../modules/actual-server
../../modules/immich
../../modules/cockpit
../../modules/backrest
];
# General
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
# Boot
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.configurationLimit = 10;
boot.supportedFilesystems = [ "zfs" ];
boot.zfs.forceImportRoot = false;
boot.zfs.extraPools = [ "main" ];
# Secrets
age = {
identityPaths = [ "${config.users.users.dennis.home}/.ssh/id_ed25519" ];
secrets."restic/password" = {
file = ../../secrets/restic/password.age;
};
};
# Nix Settings
# Perform garbage collection weekly to maintain low disk usage
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
nix.settings.auto-optimise-store = true;
programs.bash = {
enable = true;
};
# Networking
networking.hostName = "dnsc-server";
networking.hostId = "380f584e";
networking.networkmanager.enable = true;
# Fix due to https://github.com/NixOS/nixpkgs/issues/180175
systemd.services.NetworkManager-wait-online.enable = false;
# Firewall
networking.firewall = {
enable = true;
allowedTCPPorts = [
22
443
9004
];
allowedUDPPorts = [
22
443
9004
];
};
# My user account
users.users.dennis = {
description = "dennis";
isNormalUser = true;
extraGroups = [
"wheel"
"networkmanager"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXWZOPOJJDAoF+Sx/ZLoAVu6G/7/MAWoknBgMAzjul dennis@dnsc-mac"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnmuxDkpDIku5t1Tykz21u78xoQ7LJR8JEcfth32LGu dennis@dnsc-work"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF8LXdDU3C4PcCHb/BEm1xQIZyo2KTR5Dcuw6ni+SxmH dennis@dnsc-machine"
];
};
security.sudo.enable = true;
# Home Manager Setup
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
backupFileExtension = "backup";
users = {
dennis = import ../../home/server.nix;
};
};
# Enable new Nix CLI and flakes
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Install system wide packages
environment.systemPackages = with pkgs; [
git
btop
neovim
wget
jellyfin
jellyfin-web
jellyfin-ffmpeg
usbutils
restic
mkcert
actual-server
cockpit
];
# GnuPG
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# ZFS
services.zfs = {
autoSnapshot.enable = true;
trim.enable = true;
};
# Caddy
services.caddy = {
enable = true;
virtualHosts."media.home.lan".extraConfig = ''
reverse_proxy http://127.0.0.1:8096
tls internal
'';
virtualHosts."finance.home.lan".extraConfig = ''
encode gzip zstd
reverse_proxy http://127.0.0.1:9002
tls internal
'';
virtualHosts."photos.home.lan".extraConfig = ''
reverse_proxy http://127.0.0.1:9003
tls internal
'';
virtualHosts."backup.home.lan".extraConfig = ''
reverse_proxy http://127.0.0.1:9004
tls internal
'';
};
# Environment variables
environment.variables.EDITOR = "nvim";
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.11";
}

View file

@ -1,40 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/89318ceb-c0c6-47f2-9cad-99612498bd75";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/EE6C-978E";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/9c843b67-418a-4d11-8700-6a0eb866c02c"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,187 +0,0 @@
{
inputs,
outputs,
_lib,
config,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
./networking.nix
inputs.home-manager.nixosModules.home-manager
inputs.ip-whitelist.nixosModules.default
../../modules/openssh
../../modules/vaultwarden
../../modules/uptime-kuma
../../modules/glance
../../modules/docker
../../modules/actual-server
];
# Secrets
age = {
identityPaths = [ "${config.users.users.dennis.home}/.ssh/id_ed25519" ];
secrets."vaultwarden/env".file = ../../secrets/vaultwarden/env.age;
secrets."restic/password".file = ../../secrets/restic/password.age;
};
# Generated automatically
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
# General
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
# Nix Settings
nix.gc = {
automatic = true;
dates = "03:15";
options = "-d";
};
nix.settings.auto-optimise-store = true;
programs.bash = {
enable = true;
};
security.sudo.enable = true;
# Networking
networking.hostName = "dnsc-vps-sm";
networking.hostId = "380f585f";
networking.domain = "dnsc.io";
networking.networkmanager.enable = true;
# Fix due to https://github.com/NixOS/nixpkgs/issues/180175
systemd.services.NetworkManager-wait-online.enable = false;
# Firewall
networking.firewall = {
enable = true;
allowedTCPPorts = [
22
80
443
];
};
# My user account
users.users.dennis = {
description = "dennis";
initialPassword = "admin";
isNormalUser = true;
linger = true;
extraGroups = [
"wheel"
"networkmanager"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXWZOPOJJDAoF+Sx/ZLoAVu6G/7/MAWoknBgMAzjul dennis@dnsc-mac"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnmuxDkpDIku5t1Tykz21u78xoQ7LJR8JEcfth32LGu dennis@dnsc-work"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF8LXdDU3C4PcCHb/BEm1xQIZyo2KTR5Dcuw6ni+SxmH dennis@dnsc-machine"
];
};
# Home Manager Setup
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
backupFileExtension = "backup";
users = {
dennis = import ../../home/server.nix;
};
};
# Enable new Nix CLI and flakes
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Install system wide packages
environment.systemPackages = with pkgs; [
git
btop
neovim
wget
docker-compose
actual-server
restic
glance
ncdu
];
# Programs
# GnuPG
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# Services
# Caddy
services.caddy = {
enable = true;
virtualHosts."www.dnsc.io".extraConfig = ''
redir https://dnsc.io{uri}
'';
virtualHosts."dnsc.io".extraConfig = ''
encode gzip
file_server
root * /var/www/homepage
'';
virtualHosts."slides.dnsc.io".extraConfig = ''
encode gzip
file_server
root * /var/www/slides
'';
virtualHosts."vault.dnsc.io".extraConfig = ''
reverse_proxy localhost:8000
'';
virtualHosts."uptime.dnsc.io".extraConfig = ''
reverse_proxy localhost:9000
'';
virtualHosts."home.dnsc.io".extraConfig = ''
reverse_proxy localhost:9001
'';
virtualHosts."finance.dnsc.io".extraConfig = ''
reverse_proxy localhost:9002
'';
};
# Restic
services.restic.backups.dnsc-vps-sm-backup = {
initialize = true;
passwordFile = config.age.secrets."restic/password".path;
repository = "sftp:u295965@u295965.your-storagebox.de:restic/dnsc-vps-sm";
paths = [
"/var/backup/vaultwarden"
];
pruneOpts = [
"--keep-daily 1"
"--keep-weekly 3"
"--keep-monthly 5"
"--keep-yearly 10"
];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
# Environment variables
environment.variables.EDITOR = "nvim";
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11";
}

View file

@ -1,8 +0,0 @@
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
}

View file

@ -1,33 +0,0 @@
{ lib, ... }: {
# This file was populated at runtime with the networking
# details gathered from the active system.
networking = {
nameservers = [ "8.8.8.8"
];
defaultGateway = "172.31.1.1";
defaultGateway6 = {
address = "fe80::1";
interface = "eth0";
};
dhcpcd.enable = false;
usePredictableInterfaceNames = lib.mkForce false;
interfaces = {
eth0 = {
ipv4.addresses = [
{ address="91.99.21.186"; prefixLength=32; }
];
ipv6.addresses = [
{ address="2a01:4f8:1c1a:cdfb::1"; prefixLength=64; }
{ address="fe80::9400:4ff:fe27:8245"; prefixLength=64; }
];
ipv4.routes = [ { address = "172.31.1.1"; prefixLength = 32; } ];
ipv6.routes = [ { address = "fe80::1"; prefixLength = 128; } ];
};
};
};
services.udev.extraRules = ''
ATTR{address}=="96:00:04:27:82:45", NAME="eth0"
'';
}

View file

@ -1,104 +0,0 @@
{
inputs,
outputs,
pkgs,
...
}:
{
imports = [
inputs.home-manager.darwinModules.home-manager
outputs.nixosModules.base
outputs.nixosModules.macos
outputs.nixosModules.homebrew
outputs.nixosModules.aerospace
outputs.nixosModules.direnv
];
# Device & user-specific settings
networking.hostName = "dnsc-work";
networking.computerName = "dnsc-work";
users.users."dennis" = {
home = "/Users/dennis";
description = "Dennis Schoepf";
};
nix.settings.trusted-users = [ "dennis" ];
nixpkgs.overlays = [ ];
# System Packages
environment.systemPackages = with pkgs; [
circumflex
gh
fnm
stylua
typescript-language-server
vscode-langservers-extracted
astro-language-server
tailwindcss-language-server
lua-language-server
prettierd
eslint_d
nil
tree-sitter
tmux
tmuxinator
uv
# rsync
];
homebrew.masApps = {
Bitwarden = 1352778147;
Wireguard = 1451685025;
# XCode = 497799835;
};
homebrew.taps = [ "huseyinbabal/tap" ];
homebrew.brews = [
"watchman"
"pnpm"
"pkg-config"
"cairo"
"pango"
"libpng"
"jpeg"
"giflib"
"librsvg"
"pixman"
"python-setuptools"
"gmp"
"rbenv"
"mysql@8.0"
"huseyinbabal/tap/tredis"
"yt-dlp"
"minikube"
];
homebrew.casks = [
"microsoft-teams"
"1password"
"1password-cli"
"android-studio"
"zulu@17"
"postman"
"docker-desktop"
"google-chrome"
];
# Shells
environment.shells = [ pkgs.fish ];
# Home Manager Setup
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
useGlobalPkgs = true;
backupFileExtension = "backup";
users = {
dennis = import ../../home/darwin-work.nix;
};
};
# Nix settings
# Use determinate systems
nix.enable = false;
}

View file

@ -1,21 +0,0 @@
{
pkgs,
...
}:
{
systemd.services.actual = {
enable = true;
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
description = "user service for the actual budgeting server instance";
environment = {
ACTUAL_PORT = "9002";
};
serviceConfig = {
Type = "simple";
ExecStart = "/run/current-system/sw/bin/actual-server";
Restart = "on-failure";
RestartSec = 3;
};
};
}

View file

@ -1,115 +0,0 @@
{
services.aerospace = {
enable = true;
settings = {
accordion-padding = 25;
gaps = {
inner.horizontal = 6;
inner.vertical = 6;
outer.left = 6;
outer.bottom = 6;
outer.top = 6;
outer.right = 6;
};
workspace-to-monitor-force-assignment = {
"1" = "main";
"2" = "main";
"3" = "main";
"4" = "main";
"5" = "secondary";
"6" = "secondary";
};
mode.main.binding = {
alt-h = "focus left";
alt-j = "focus down";
alt-k = "focus up";
alt-l = "focus right";
alt-shift-h = "move left";
alt-shift-j = "move down";
alt-shift-k = "move up";
alt-shift-l = "move right";
alt-comma = "layout tiles horizontal vertical";
alt-period = "layout accordion horizontal vertical";
alt-f = "fullscreen";
alt-1 = "workspace 1";
alt-2 = "workspace 2";
alt-3 = "workspace 3";
alt-4 = "workspace 4";
alt-5 = "workspace 5";
alt-6 = "workspace 6";
alt-shift-1 = [
"move-node-to-workspace 1"
"workspace 1"
];
alt-shift-2 = [
"move-node-to-workspace 2"
"workspace 2"
];
alt-shift-3 = [
"move-node-to-workspace 3"
"workspace 3"
];
alt-shift-4 = [
"move-node-to-workspace 4"
"workspace 4"
];
alt-shift-5 = [
"move-node-to-workspace 5"
"workspace 5"
];
alt-shift-6 = [
"move-node-to-workspace 6"
"workspace 6"
];
alt-tab = "workspace-back-and-forth";
alt-shift-tab = "move-workspace-to-monitor --wrap-around next";
};
on-window-detected = [
{
"if".app-id = "app.zen-browser.zen";
run = "move-node-to-workspace 1";
}
{
"if".app-id = "company.thebrowser.Browser";
run = "move-node-to-workspace 1";
}
{
"if".app-id = "com.github.wez.wezterm";
run = "move-node-to-workspace 2";
}
{
"if".app-id = "com.mitchellh.ghostty";
run = "move-node-to-workspace 2";
}
{
"if".app-id = "com.apple.Preview";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.apple.dt.Xcode";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.postmanlabs.mac";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.apple.iCal";
run = "move-node-to-workspace 4";
}
{
"if".app-id = "com.microsoft.teams2";
run = "move-node-to-workspace 5";
}
{
"if".app-id = "com.spotify.client";
run = "move-node-to-workspace 6";
}
{
"if".app-id = "com.apple.reminders";
run = "move-node-to-workspace 6";
}
];
};
};
}

View file

@ -1,11 +0,0 @@
{
programs.atuin = {
enable = true;
enableBashIntegration = false;
enableFishIntegration = false;
settings = {
style = "compact";
inline_height = 20;
};
};
}

View file

@ -1,98 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
# Declarative backrest config referencing the existing restic repo.
# The password is read at runtime from the agenix secret path via
# BACKREST_VAR_RESTIC_PASSWORD, which backrest expands as ${RESTIC_PASSWORD}
# inside the repo env block.
backrestConfig = builtins.toJSON {
version = 4;
modno = 1;
instance = "dnsc-server";
repos = [
{
id = "dnsc-storage";
uri = "sftp:dnsc-storage:restic/dnsc-server";
env = [ "RESTIC_PASSWORD_FILE=${config.age.secrets."restic/password".path}" ];
flags = [
"-o 'sftp.args=-i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new'"
];
autoInitialize = false;
guid = "15448172d015919712f015508d40e28d13db4c9e877bf545454c8289ad621069";
prunePolicy = {
schedule = {
disabled = true;
};
};
checkPolicy = {
schedule = {
disabled = true;
};
};
}
];
plans = [
{
id = "dnsc-storage-plan";
repo = "dnsc-storage";
paths = config.services.restic.backups."dnsc-storage".paths;
schedule = {
disabled = true;
};
retention = {
policyKeepLastN = 3;
};
}
];
auth = {
disabled = true;
};
};
in
{
environment.systemPackages = lib.mkAfter (
with pkgs;
[
backrest
]
);
# Write the declarative config into the backrest state dir at activation time.
# The file must be in a writable location because backrest creates a .bak
# alongside it when migrating. /var/lib/backrest is owned by the backrest user.
system.activationScripts.backrestConfig = {
deps = [ "users" ];
text = ''
install -d -m 750 /var/lib/backrest
install -m 640 \
${pkgs.writeText "backrest-config.json" backrestConfig} \
/var/lib/backrest/config.json
'';
};
systemd.services.backrest = {
enable = true;
description = "Restic GUI";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
BACKREST_PORT = "9004";
BACKREST_RESTIC_COMMAND = "${pkgs.restic}/bin/restic";
BACKREST_CONFIG = "/var/lib/backrest/config.json";
BACKREST_DATA = "/var/lib/backrest/data";
};
serviceConfig = {
Type = "simple";
User = "root";
ExecStart = "${pkgs.backrest}/bin/backrest";
Restart = "on-failure";
RestartSec = "5s";
};
};
}

View file

@ -1,58 +0,0 @@
{
pkgs,
inputs,
...
}:
{
nix = {
channel.enable = false;
package = pkgs.nix;
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
settings = {
experimental-features = [
"nix-command"
"flakes"
];
};
};
nixpkgs = {
config = {
allowUnfree = true;
allowUnsupportedSystem = true;
};
};
environment.systemPackages = with pkgs; [
gcc
wget
git
btop
fish
ripgrep
fzf
fd
sd
bat
vim
just
tldr
fortune
ffmpeg
zoxide
sqlite
restic
imagemagick
sqlite
fortune
lazygit
tmux
tmuxinator
nix-prefetch
nix-prefetch-github
dua
opencode
vial
];
}

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
# Switch between Ripgrep launcher mode (CTRL-R) and fzf filtering mode (CTRL-F)
rm -f /tmp/rg-fzf-{r,f}
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="${*:-}"
fzf --ansi --disabled --query "$INITIAL_QUERY" \
--bind "start:reload($RG_PREFIX {q})+unbind(ctrl-r)" \
--bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \
--bind "ctrl-f:unbind(change,ctrl-f)+change-prompt(2. fzf> )+enable-search+rebind(ctrl-r)+transform-query(echo {q} > /tmp/rg-fzf-r; cat /tmp/rg-fzf-f)" \
--bind "ctrl-r:unbind(ctrl-r)+change-prompt(1. ripgrep> )+disable-search+reload($RG_PREFIX {q} || true)+rebind(change,ctrl-f)+transform-query(echo {q} > /tmp/rg-fzf-f; cat /tmp/rg-fzf-r)" \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--prompt '1. ripgrep> ' \
--delimiter : \
--header ' CTRL-R (ripgrep mode) CTRL-F (fzf mode) ' \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
--bind 'enter:become(nvim {1} +{2})'

View file

@ -1,55 +0,0 @@
{
programs.bash = {
enable = true;
enableCompletion = true;
sessionVariables = {
GPG_TTY = "$(tty)";
PROMPT_DIRTRIM = 3;
GOPATH = "$HOME/go";
GOROOT = "$(brew --prefix golang)/libexec";
};
shellAliases = {
"ff" = "${./bin/ff.sh}";
"ipl" = "ifconfig | grep \"inet \" | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
"ipp" = "curl -4 ifconfig.me";
"lg" = "lazygit";
"g" = "git";
"xsrc" = "source ~/.bashrc && source .bash_profile";
"ll" = "ls -l";
"la" = "ls -la";
};
profileExtra = ''
export PATH=\
$GOPATH/bin:\
$GOROOT/bin:\
/run/current-system/sw/bin:\
/opt/homebrew/bin:$PATH
'';
bashrcExtra = ''
# FNM
eval "$(fnm env --use-on-cd --shell bash)"
# emacs-libvterm
if [[ "$INSIDE_EMACS" = 'vterm' ]] \
&& [[ -n "$EMACS_VTERM_PATH" ]] \
&& [[ -f "$EMACS_VTERM_PATH/etc/emacs-vterm-bash.sh" ]]; then
source "$EMACS_VTERM_PATH/etc/emacs-vterm-bash.sh"
fi
'';
initExtra = ''
if [ "$TERM" == "dumb" ]; then
PS1="[\u@\h:\w]\\$ "
else
source ~/.git-prompt.sh
PROMPT_COMMAND='PS1_CMD1=$(__git_ps1 "(%s)")';
PS1="\[\e[95m\]\u\[\e[35m\]@\h\[\e[0m\] \[\e[96m\]\w\[\e[0m\] \[\e[95m\]$PS1_CMD1\n\[\e[96m\]λ\[\e[0m\] "
fi
'';
};
}

View file

@ -1,15 +0,0 @@
{
services.cockpit = {
enable = true;
openFirewall = true;
allowed-origins = [
"http://192.168.178.69:9090"
"wss://192.168.178.69:9090"
];
settings = {
WebService = {
AllowUnencrypted = true;
};
};
};
}

View file

@ -1,6 +0,0 @@
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View file

@ -1,11 +0,0 @@
{
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
users.users.dennis.extraGroups = [ "docker" ];
}

View file

@ -1,162 +0,0 @@
{ inputs, pkgs, ... }:
{
programs.firefox = {
enable = true;
nativeMessagingHosts = [ pkgs.firefoxpwa ];
languagePacks = [
"en-US"
"de"
];
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableFirefoxScreenshots = true;
DisableForgetButton = true;
DisableMasterPasswordCreation = true;
DisableProfileImport = true;
DisableProfileRefresh = true;
DisableSetDesktopBackground = true;
DisplayBookmarksToolbar = "never";
DisplayMenuBar = "default-off";
SearchBar = "unified";
OfferToSaveLogins = false;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DefaultDownloadDirectory = "\${home}/Downloads";
};
profiles = {
"dennis" = {
id = 0;
isDefault = true;
containersForce = true;
containers = {
default = {
name = "personal";
color = "turquoise";
icon = "chill";
id = 1;
};
};
extensions.force = true;
extensions.packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [
ublock-origin
dearrow
bitwarden
sponsorblock
vimium
];
search = {
default = "google";
force = true;
engines = {
bing.metaData.hidden = true;
perplexity.metaData.hidden = true;
wikipedia.metaData.hidden = true;
ddg.metaData.hidden = true;
nix-packages = {
name = "Nix Packages";
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
nix-options = {
name = "Nix Options";
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
nix-home-manager = {
name = "Nix Home Manager";
urls = [
{
template = "https://home-manager-options.extranix.com";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nh" ];
};
nix-wiki = {
name = "Nix Wiki";
urls = [
{
template = "https://wiki.nixos.org/w/index.php";
params = [
{
name = "search";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nw" ];
};
};
};
settings = {
"browser.startup.homepage" = "https://home.dnsc.io";
"browser.newtabpage.pinned" = [
{
title = "[dnsc] Home";
url = "https://home.dnsc.io";
}
];
"browser.search.region" = "DE";
"general.useragent.locale" = "en-US";
"layout.css.prefers-color-scheme.content-override" = 0;
};
};
};
};
}

View file

@ -1,240 +0,0 @@
{ ... }:
{
programs.fish = {
enable = true;
functions = {
ff = "bash ${./ff.bash}";
fish_greeting = "fortune -a";
localip = "ifconfig | grep \"inet \" | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
publicip = "curl -4 ifconfig.me";
enter_vps = "ssh dnsc-vps-sm -t tmux new -As main";
rebuild_vps = "ssh -t dnsc-vps-sm 'cd ~/nix-config && git pull && sudo just deploy'";
enter_server = "ssh dnsc-server -t tmux new -As main";
rebuild_server = "ssh -t dnsc-server 'cd ~/nix-config && git pull && sudo just deploy'";
kill_tunnels = /* fish */ ''
ps -o pid,command | grep "^[0-9]\{4,5\} ssh -fNL" | awk '{print $1}' | xargs kill -9
'';
dbui = ''
uvx --with PyMySQL --with sqlit-tui[ssh] --from sqlit-tui@1.2.11 sqlit
'';
dev_projects = /* fish */ ''
if test "$hn" = "dnsc-work"
begin
fd . ~/dev/ride/apps/backend/edge-services -t d -d 1;
fd . ~/dev/ride/apps/backend/backend-services -t d -d 1;
fd . ~/dev/ride/apps/frontend/projects -t d -d 1;
fd . ~/dev/ride/apps/native -t d -d 1;
fd . ~/dev/ride/packages -t d -d 1;
fd . ~/dev -t d -d 1;
echo "$HOME/dev/ride/apps/frontend";
echo "$HOME/dev/ride/apps/lib";
echo "$HOME/dev/ride/apps/packages";
end
else
begin
echo "$HOME/notes"
fd . ~/dev -t d -d 1
end
end
'';
cdd = /* fish */ ''
set folder (dev_projects | fzf)
cd $folder
'';
cdr = /* fish */ ''
set folder (dev_projects | fzf)
cd $folder
if test -n "$folder"
set service (basename $folder)
cd $folder
if test -f "package.json"
set script_cmd (jq -r '.scripts | to_entries | .[] | "\(.key): \(.value)"' package.json | fzf)
if test -n "$script_cmd"
set script_name (string split ": " $script_cmd)[1]
if test -n "$script_name"
echo "Running: npm run $script_name"
npm run $script_name
end
end
end
end
'';
sessionizer = /* fish */ ''
set -l selected (tmuxinator ls -n | tail -n +2 | fzf --prompt " switch to >> ")
if test -z "$selected"
return 1
end
tmuxinator start "$selected"
'';
tmux_sessionizer = /* fish */ ''
tmux display-popup -h 50% -w 80% -E sessionizer
'';
nn = /* fish */ ''
# Require a title argument
if test (count $argv) -lt 1
echo "Usage: nn \"My Note\""
return 1
end
# Join all arguments into single title (preserves spaces inside quotes)
set -l title $argv[1]
# Timestamp up to minutes, format: YYYY-MM-DD_HH-MM
set -l ts (date "+%Y%m%d%H%M")
# Normalize title: lowercase, replace spaces with hyphens, remove/replace
# characters unsafe for filenames (keep a-z0-9- and replace others with -)
set -l slug (string lower -- $title)
# Replace any sequence of non-alphanumeric characters with single hyphen
set -l slug (echo $slug | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/^-|-$//g')
# Compose filename
set -l filename "$ts"_"$slug.md"
# Directory for notes (change if you prefer another path)
set -l notes_dir ~/dev/notes
# Ensure directory exists
test -d $notes_dir; or mkdir -p $notes_dir
# Full path
set -l fullpath "$notes_dir/$filename"
# If file doesn't exist, create with timestamp and title at top
if not test -f $fullpath
# Human-friendly timestamp line (no seconds)
set -l display_ts (date "+%Y-%m-%d %H:%M")
printf "---\nCREATED_AT: %s\n---\n\n# %s\n\n" "$display_ts" "$title" > $fullpath
end
# Open file in neovim
nvim $fullpath
'';
fish_mode_prompt = /* fish */ ''
switch $fish_bind_mode
case default
set_color --bold brcyan
echo '[N] '
case insert
set_color --bold brgreen
echo '[I] '
case replace_one
set_color --bold yellow
echo '[R] '
case replace
set_color --bold bryellow
echo '[R] '
case visual
set_color --bold brmagenta
echo '[V] '
case '*'
set_color --bold red
echo '[?] '
end
set_color normal
'';
setup_winterly_theme_colors = /* fish */ ''
set --universal fish_color_autosuggestion brblack # autosuggestions
set --universal fish_color_command brwhite # commands
set --universal fish_color_comment brblack # code comments
set --universal fish_color_cwd brblack # current working directory in the default prompt
set --universal fish_color_end brblack # process separators like ';' and '&'
set --universal fish_color_error brwhite # highlight potential errors
set --universal fish_color_escape brblack # highlight character escapes like '\n' and '\x70'
set --universal fish_color_match yellow # highlight matching parenthesis
set --universal fish_color_normal brwhite # default color
set --universal fish_color_operator brblack # parameter expansion operators like '*' and '~'
set --universal fish_color_param bryellow # regular command parameters
set --universal fish_color_quote brmagenta # quoted blocks of text
set --universal fish_color_redirection brwhite # IO redirections
set --universal fish_color_search --bold --background=black --foreground=bryellow
set --universal fish_color_search_match --background black # highlight history search matches and the selected pager item (must be a background)
set --universal fish_pager_color_selected_background --background black --foreground brmagenta
set --universal fish_pager_color_progress --foreground=brwhite --background=black
set --universal fish_color_selection --background magenta # when selecting text (in vi visual mode)
set --universal fish_color_cancel brblack # the '^C' indicator on a canceled command
set --universal fish_color_host brwhite # current host system in some of fish default prompts
set --universal fish_color_host_remote yellow #ayu:syntax.constant current host system in some of fish default prompts, if fish is running remotely (via ssh or similar)
set --universal fish_color_user brwhite # current username in some of fish default prompts
'';
setup_homebrew = /* fish */ ''
fish_add_path /opt/homebrew/bin
if test -d (brew --prefix)"/share/fish/completions"
set -p fish_complete_path (brew --prefix)/share/fish/completions
end
if test -d (brew --prefix)"/share/fish/vendor_completions.d"
set -p fish_complete_path (brew --prefix)/share/fish/vendor_completions.d
end
'';
setup_path = /* fish */ ''
fish_add_path /run/wrappers/bin
fish_add_path /run/current-system/sw/bin
fish_add_path $HOME/.nix-profile/bin
if test "$(uname)" = "Darwin"
fish_add_path /nix/var/nix/profiles/default/bin
setup_homebrew
end
'';
setup_env = /* fish */ ''
for line in (cat $HOME/.env | grep -v '^#')
set item (string split -m 1 '=' $line)
set -gx $item[1] $item[2]
end
'';
setup_work = /* fish */ ''
fish_add_path $ANDROID_HOME/emulator
fish_add_path $ANDROID_HOME/platform-tools
fish_add_path $HOME/.local/share/uv/tools
rbenv init - | source
fnm env --use-on-cd --shell fish | source
'';
};
interactiveShellInit = /* fish */ ''
# Set some global values
set -x GPG_TTY (tty)
set hn (prompt_hostname)
fish_vi_key_bindings insert
fish_vi_cursor xterm
setup_winterly_theme_colors
setup_env
setup_path
if test "$hn" = "dnsc-work"
setup_work
end
# Custom init
direnv hook fish | source
# Auto start tmux
if status is-interactive; and not set -q TMUX
if tmux list-sessions >/dev/null 2>&1
# Attach to the first available session
tmux a
else
# Create a new session
tmux new-session -t main
end
end
'';
shellAbbrs = {
lg = "lazygit";
gg = "lazygit";
g = "git";
frc = "source ~/.config/fish/**/*.fish";
};
};
}

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
# Switch between Ripgrep launcher mode (CTRL-R) and fzf filtering mode (CTRL-F)
rm -f /tmp/rg-fzf-{r,f}
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="${*:-}"
fzf --ansi --disabled --query "$INITIAL_QUERY" \
--bind "start:reload($RG_PREFIX {q})+unbind(ctrl-r)" \
--bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \
--bind "ctrl-f:unbind(change,ctrl-f)+change-prompt(2. fzf> )+enable-search+rebind(ctrl-r)+transform-query(echo {q} > /tmp/rg-fzf-r; cat /tmp/rg-fzf-f)" \
--bind "ctrl-r:unbind(ctrl-r)+change-prompt(1. ripgrep> )+disable-search+reload($RG_PREFIX {q} || true)+rebind(change,ctrl-f)+transform-query(echo {q} > /tmp/rg-fzf-f; cat /tmp/rg-fzf-r)" \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--prompt '1. ripgrep> ' \
--delimiter : \
--header ' CTRL-R (ripgrep mode) CTRL-F (fzf mode) ' \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
--bind 'enter:become(nvim {1} +{2})'

View file

@ -1,57 +0,0 @@
{
programs.ghostty = {
enable = true;
enableFishIntegration = true;
package = null;
settings = {
font-size = 18;
font-family = "Victor Mono";
font-style = "SemiBold";
background-opacity = 0.945;
window-padding-x = 0;
window-padding-y = 0;
window-padding-balance = true;
window-inherit-working-directory = true;
window-theme = "ghostty";
shell-integration-features = true;
scrollback-limit = 100000;
link-url = true;
link-previews = true;
title = " ";
background = "#0f0b15";
foreground = "#ffffff";
cursor-color = "#d369af";
selection-foreground = "#af85ea";
selection-background = "#572454";
palette = [
"0=#0f0b15"
"1=#f47359"
"2=#29a444"
"3=#b58a52"
"4=#3f95f6"
"5=#d369af"
"6=#4fbaef"
"7=#b8c6d5"
"8=#807c9f"
"9=#ff6a7a"
"10=#00a392"
"11=#df9080"
"12=#029fff"
"13=#af85ea"
"14=#35afbf"
"15=#ffffff"
];
keybind = [
"ctrl+plus=increase_font_size:2"
"ctrl+minus=decrease_font_size:2"
"ctrl+0=reset_font_size"
"ctrl+shift+a=select_all"
"ctrl+shift+c=copy_to_clipboard"
"ctrl+shift+v=paste_from_clipboard"
"cmd+c=copy_to_clipboard"
"cmd+v=paste_from_clipboard"
"global:cmd+semicolon=toggle_quick_terminal"
];
};
};
}

View file

@ -1,56 +0,0 @@
{
programs.ghostty = {
enable = true;
enableFishIntegration = true;
settings = {
font-size = 14;
font-family = "VictorMono Nerd Font";
font-style = "SemiBold";
background-opacity = 0.945;
window-padding-x = 0;
window-padding-y = 0;
window-padding-balance = true;
window-inherit-working-directory = true;
window-theme = "ghostty";
shell-integration-features = true;
scrollback-limit = 100000;
link-url = true;
link-previews = true;
title = " ";
background = "#0f0b15";
foreground = "#ffffff";
cursor-color = "#d369af";
selection-foreground = "#af85ea";
selection-background = "#572454";
palette = [
"0=#0f0b15"
"1=#f47359"
"2=#29a444"
"3=#b58a52"
"4=#3f95f6"
"5=#d369af"
"6=#4fbaef"
"7=#b8c6d5"
"8=#807c9f"
"9=#ff6a7a"
"10=#00a392"
"11=#df9080"
"12=#029fff"
"13=#af85ea"
"14=#35afbf"
"15=#ffffff"
];
keybind = [
"ctrl+plus=increase_font_size:2"
"ctrl+minus=decrease_font_size:2"
"ctrl+0=reset_font_size"
"ctrl+shift+a=select_all"
"ctrl+shift+c=copy_to_clipboard"
"ctrl+shift+v=paste_from_clipboard"
"cmd+c=copy_to_clipboard"
"cmd+v=paste_from_clipboard"
"global:cmd+semicolon=toggle_quick_terminal"
];
};
};
}

View file

@ -1,28 +0,0 @@
{
programs.git = {
enable = true;
settings = {
init = {
defaultBranch = "main";
};
core = {
ignorecase = "false";
};
pull = {
rebase = false;
};
push = {
autoSetupRemote = true;
};
user = {
name = "Dennis Schoepf";
email = "me@dnsc.io";
};
};
ignores = [ ".DS_Store" ];
};
}

View file

@ -1,205 +0,0 @@
{
services.glance = {
enable = true;
settings = {
server = {
port = 9001;
};
theme = {
background-color = "hsl(264 31.3% 6.3%)";
primary-color = "hsl(9 92.1% 85.1%)";
contrast-multiplier = 1.2;
positive-color = "hsl(174 100% 32%)";
negative-color = "hsl(354 100% 70.8%)";
disable-picker = false;
};
pages = [
{
name = "Home";
columns = [
{
size = "small";
widgets = [
{
type = "monitor";
cache = "1m";
title = "Selfhosted";
sites = [
{
title = "Fastmail";
url = "https://app.fastmail.com/";
icon = "si:protonmail";
}
{
title = "Actual";
url = "https://finance.dnsc.io";
icon = "si:actualbudget";
}
{
title = "Vaultwarden";
url = "https://vault.dnsc.io";
icon = "si:vaultwarden";
}
{
title = "Uptime Kuma";
url = "https://uptime.dnsc.io";
icon = "si:uptimekuma";
}
{
title = "dnsc.io";
url = "https://dnsc.io";
icon = "si:htmx";
}
{
title = "Jellyfin";
url = "http://192.168.178.69:8096";
icon = "si:jellyfin";
allow-insecure = true;
}
];
}
{
type = "bookmarks";
groups = [
{
title = "Hosting";
color = "hsl(187 56.6% 47.8%)";
links = [
{
title = "Hetzner";
url = "https://console.hetzner.com/projects/1355757/dashboard";
}
{
title = "Netcup";
url = "https://www.servercontrolpanel.de/SCP/Home";
}
{
title = "Porkbun";
url = "https://porkbun.com/account/domainsSpeedy";
}
];
}
{
title = "Dev";
color = "hsl(319 37.6% 63.5%)";
links = [
{
title = "Codeberg";
url = "https://codeberg.org/dnscio";
}
{
title = "Github";
url = "https://github.com/dennisschoepf?tab=repositories";
}
];
}
];
}
];
}
{
size = "full";
widgets = [
{
type = "group";
widgets = [
{
type = "hacker-news";
limit = 15;
collapse-after = 5;
}
{
type = "rss";
title = "r/neovim";
single-line-titles = true;
feeds = [
{
url = "https://www.reddit.com/r/neovim.rss";
}
];
}
{
type = "rss";
title = "r/onepiece";
single-line-titles = true;
feeds = [
{
url = "https://www.reddit.com/r/onepiece.rss";
}
];
}
{
type = "rss";
title = "r/triathlon";
single-line-titles = true;
feeds = [
{
url = "https://www.reddit.com/r/triathlon.rss";
}
];
}
];
}
{
type = "twitch-channels";
channels = [
"theprimeagen"
"tsoding"
"noway4u_sir"
"broxah"
"caedrel"
"bashbunni"
];
}
{
type = "videos";
collapse-after = 6;
channels = [
"UCuTaETsuCOkJ0H_GAztWt0Q"
"UCJVMrR290HU9pDxaP35u_cg"
"UCqqJQ_cXSat0KIAVfIfKkVA"
"UCdC0An4ZPNr_YiFiYoVbwaw"
"UCsXVk37bltHxD1rDPwtNM8Q"
"UCofJu853kJKpkg4y5a-9YXg"
"UCewLMcro9tNP97XQ1rxtLXQ"
"UCuo9VyowIT-ljA5G2ZuC6Yw"
"UCipCyKo5D3FyWE6_TpQyr5A"
"UCmL9OhLB27r1lTCHQ3pEiIQ"
"UCNIuvl7V8zACPpTmmNIqP2A"
"UC-gct8TB_8l5HsQHBBr8hyQ"
];
}
];
}
{
size = "small";
widgets = [
{
type = "server-stats";
servers = [
{
name = "dnsc-vps-sm";
type = "local";
}
];
}
{
type = "calendar";
first-day-of-the-week = "monday";
}
{
type = "weather";
units = "metric";
hour-format = "24h";
location = "Munich, Germany";
}
];
}
];
}
];
};
};
}

View file

@ -1,38 +0,0 @@
{
nix-homebrew = {
enable = true;
user = "dennis";
autoMigrate = true;
};
homebrew = {
user = "dennis";
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
cleanup = "zap";
};
brews = [
"go"
"mas"
];
casks = [
"font-victor-mono"
"font-victor-mono-nerd-font"
"vlc"
"ghostty"
"hiddenbar"
"eurkey"
"karabiner-elements"
"caffeine"
"raycast"
"spotify"
"zen"
"keyboard-cowboy"
];
};
}

View file

@ -1,175 +0,0 @@
{
services.homepage-dashboard = {
enable = true;
listenPort = 9001;
allowedHosts = "home.dnsc.io";
settings = {
theme = "dark";
maxBookmarkGroupColumns = 2;
headerStyle = "boxedWidgets";
background = {
image = "https://i.ibb.co/v6FjzW5V/winter.png";
opacity = 40;
brightness = 50;
};
};
widgets = [
{
resources = {
cpu = true;
cputemp = true;
units = "metric";
};
}
{
resources = {
memory = true;
uptime = true;
network = true;
};
}
];
services = [
{
"VPS" = [
{
"Vaultwarden" = {
href = "https://vault.dnsc.io";
icon = "vaultwarden.png";
};
}
{
"Uptime Kuma" = {
href = "https://uptime.dnsc.io";
icon = "uptime-kuma.png";
};
}
{
"Actual" = {
href = "https://finance.dnsc.io";
icon = "actual-budget.png";
};
}
{
"Slides" = {
href = "https://slides.dnsc.io";
icon = "slidev.png";
};
}
{
"Homepage" = {
href = "https://dnsc.io";
icon = "html.png";
};
}
];
}
{
"Homelab" = [
{
"Jellyfin" = {
href = "http://100.103.199.4:8096";
icon = "jellyfin.png";
};
}
{
"Syncthing" = {
href = "http://100.103.199.4:8384";
icon = "syncthing.png";
};
}
];
}
];
bookmarks = [
{
Hosting = [
{
Porkbun = [
{
abbr = "PB";
href = "https://porkbun.com/account/domainsSpeedy";
}
];
}
{
Hetzner = [
{
abbr = "HZ";
href = "https://console.hetzner.com/projects/1355757/dashboard";
}
];
}
];
}
{
Apps = [
{
Fastmail = [
{
abbr = "FM";
href = "https://app.fastmail.com";
}
];
}
{
YNAB = [
{
abbr = "YN";
href = "https://app.ynab.com";
}
];
}
];
}
{
Dev = [
{
Codeberg = [
{
abbr = "CB";
href = "https://codeberg.org";
}
];
}
{
Github = [
{
abbr = "GH";
href = "https://github.com/dennisschoepf";
}
];
}
];
}
{
Entertainment = [
{
YouTube = [
{
abbr = "YT";
href = "https://youtube.com/feed/subscriptions";
}
];
}
{
Twitch = [
{
abbr = "TW";
href = "https://www.twitch.tv/directory/following";
}
];
}
{
Overcast = [
{
abbr = "OC";
href = "https://overcast.fm";
}
];
}
];
}
];
};
}

View file

@ -1,9 +0,0 @@
{
services.immich = {
enable = true;
port = 9003;
host = "192.168.178.69";
openFirewall = true;
mediaLocation = "/main/pictures";
};
}

View file

@ -1,26 +0,0 @@
{
pkgs,
...
}:
{
services.jellyfin = {
enable = true;
openFirewall = true;
};
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-vaapi-driver
libva-vdpau-driver
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
vpl-gpu-rt # QSV on 11th gen or newer
];
};
}

View file

@ -1,15 +0,0 @@
{
services.keyd = {
enable = true;
keyboards = {
default = {
ids = [ "05ac:024f" ];
settings = {
main = {
space = "overload(control, space)";
};
};
};
};
};
}

View file

@ -1,21 +0,0 @@
{ config, ... }:
{
programs.lazygit = {
enable = true;
settings = {
gui = {
nerdFontsVersion = "3";
theme = {
lightTheme = false;
activeBorderColor = [ "magenta" "bold" ];
searchingActiveBorderColor = [ "cyan" "bold" ];
inactiveBorderColor = [ "#807c9f" ];
optionsTextColor = [ "#807c9f" ];
selectedLineBgColor = [ "#331531" ];
inactiveViewSelectedLineBgColor = [ "#1d202f" ];
};
};
};
};
}

View file

@ -1,165 +0,0 @@
{
inputs,
pkgs,
...
}:
{
programs.librewolf = {
enable = true;
nativeMessagingHosts = [ pkgs.firefoxpwa ];
policies = {
AutofillAddressEnabled = true;
AutofillCreditCardEnabled = false;
DisableAppUpdate = true;
DisableFeedbackCommands = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
DontCheckDefaultBrowser = true;
OfferToSaveLogins = false;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
};
settings = {
"webgl.disabled" = false;
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.cookies" = false;
};
profiles.default = {
isDefault = true;
name = "default";
settings = {
"layout.css.prefers-color-scheme.content-override" = 0;
};
bookmarks = {
force = true;
settings = [
{
name = "Home";
url = "https://home.dnsc.io";
}
"separator"
{
name = "Nix Packages";
url = "https://search.nixos.org/packages";
}
{
name = "Nix Options";
url = "https://search.nixos.org/options";
}
{
name = "Home Manager";
url = "https://home-manager-options.extranix.com/";
}
];
};
containersForce = true;
containers = {
default = {
name = "personal";
color = "turquoise";
icon = "chill";
id = 1;
};
};
search = {
default = "google";
force = true;
engines = {
nix-packages = {
name = "Nix Packages";
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
nix-options = {
name = "Nix Options";
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
nix-home-manager = {
name = "Nix Home Manager";
urls = [
{
template = "https://home-manager-options.extranix.com";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nh" ];
};
nix-wiki = {
name = "Nix Wiki";
urls = [
{
template = "https://wiki.nixos.org/w/index.php";
params = [
{
name = "search";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nw" ];
};
};
};
extensions.force = true;
extensions.packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [
ublock-origin
dearrow
bitwarden
sponsorblock
vimium
];
};
};
}

View file

@ -1,61 +0,0 @@
{ pkgs, ... }:
{
system = {
primaryUser = "dennis";
stateVersion = 5;
activationScripts.postActivation.text = ''
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
'';
defaults = {
NSGlobalDomain."com.apple.swipescrolldirection" = false;
dock = {
autohide = true;
autohide-delay = 0.01;
autohide-time-modifier = 0.01;
expose-group-apps = true;
launchanim = false;
minimize-to-application = true;
orientation = "right";
show-recents = false;
persistent-apps = [
"/Applications/Helium.app"
"/Applications/Ghostty.app"
"/System/Applications/System Settings.app/"
];
persistent-others = [
"/Users/dennis/Downloads"
];
};
finder = {
AppleShowAllExtensions = true;
CreateDesktop = false;
FXEnableExtensionChangeWarning = false;
FXPreferredViewStyle = "clmv";
ShowPathbar = true;
ShowStatusBar = true;
};
loginwindow = {
LoginwindowText = "(λ) powered by nix-darwin";
};
menuExtraClock = {
Show24Hour = true;
ShowDate = 0;
};
screencapture = {
location = "/Users/dennis/Downloads";
target = "file";
};
spaces.spans-displays = false;
};
};
security.pam.services.sudo_local.touchIdAuth = true;
}

View file

@ -1,45 +0,0 @@
{ ... }:
{
plugins.opencode = {
enable = true;
settings = {
provider.enabled = "tmux";
};
};
keymaps = [
{
action.__raw = ''function() require("opencode").ask("@this: ", { submit = true }) end'';
key = "<leader>at";
options.desc = "ask opencode about this";
}
{
action.__raw = ''function() require("opencode").toggle() end'';
key = "<leader>aa";
options.desc = "toggle opencode";
}
{
action.__raw = ''function() require("opencode").select() end'';
key = "<leader>as";
options.desc = "select an opencode action";
}
{
mode = [
"n"
"x"
];
action.__raw = ''function() return require("opencode").operator("@this ") end'';
key = "go";
options.desc = "add range to opencode";
}
{
mode = [
"n"
];
action.__raw = ''function() return require("opencode").operator("@this ") .. "_" end'';
key = "go";
options.desc = "add line to opencode";
}
];
}

View file

@ -1,13 +0,0 @@
{ ... }:
{
colorscheme = "winterly";
# Make palette available to this module but
# also for other configuration (e.g. lualine)
extraFiles."lua/dnsc/palette.lua".source = ./extraFiles/palette.lua;
# Set custorscheme in neovims runtimepath so that neovim
# discovers it automatically
extraFiles."colors/winterly.lua".source = ./extraFiles/winterly.lua;
}

View file

@ -1,29 +0,0 @@
{
plugins.blink-cmp = {
enable = true;
settings = {
keymap = {
preset = "enter";
"<Tab>" = [
"select_next"
"fallback"
];
"<S-Tab>" = [
"select_prev"
"fallback"
];
"<C-y>" = [
"select_and_accept"
];
"<C-k>" = [
"show_documentation"
"hide_documentation"
];
};
appearance.nerd_font_variant = "mono";
completion.documentation.auto_show = false;
signature.enabled = true;
cmdline.completion.menu.auto_show = true;
};
};
}

View file

@ -1,27 +0,0 @@
{ pkgs, ... }:
# These options are imported in nixvim.imports and therefore
# every option here lives within `programs.nixvim`
{
enable = true;
defaultEditor = true;
package = pkgs.neovim-unwrapped;
# Setup some aliases
vimAlias = true;
vimdiffAlias = true;
imports = [
./colorscheme.nix
./completion.nix
./editing.nix
./picker.nix
./formatter.nix
./git.nix
./lsp.nix
./options.nix
./statusline.nix
./keybindings.nix
./ai.nix
];
}

View file

@ -1,79 +0,0 @@
{ pkgs, ... }:
{
plugins.sleuth.enable = true;
plugins.nvim-surround.enable = true;
plugins.flash.enable = true;
plugins.blink-pairs = {
enable = true;
};
plugins.treesitter = {
enable = true;
highlight.enable = true;
indent.enable = true;
folding.enable = true;
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
angular
bash
css
html
javascript
jsdoc
json
lua
make
markdown
markdown_inline
go
gomod
gotmpl
python
styled
tsx
typescript
nix
regex
toml
vim
vimdoc
xml
yaml
];
};
plugins.substitute = {
enable = true;
luaConfig.post = /* lua */ ''
local sub = require("substitute")
vim.keymap.set("n", "s", sub.operator, { noremap = true })
vim.keymap.set("n", "ss", sub.line, { noremap = true })
vim.keymap.set("n", "S", sub.eol, { noremap = true })
vim.keymap.set("x", "s", sub.visual, { noremap = true })
'';
};
extraPlugins = [
pkgs.vimPlugins.vim-cool
];
autoCmd = [
{
callback.__raw = "function() vim.highlight.on_yank() end";
event = [
"TextYankPost"
];
}
{
event = [ "FileType" ];
pattern = "qf";
callback.__raw = /* lua */ ''
function()
vim.keymap.set("n", "<CR>", "<CR>", { buffer = true })
end
'';
}
];
}

View file

@ -1,33 +0,0 @@
return {
fg = "#ffffff",
fg_alt = "#bf8a9f",
fg_dim = "#807c9f",
bg = "#0f0b15",
bg_secondary = "#1d202f",
grey = "#807c9f",
grey_bright = "#807c9f",
red = "#f47359",
red_bright = "#ff6a7a",
red_subtle_bg = "#67182f",
green = "#29a444",
green_bright = "#00a392",
green_subtle_bg = "#10452f",
yellow = "#b58a52",
yellow_bright = "#df9080",
yellow_brighter = "#FCC1B6",
yellow_subtle_bg = "#54362a",
blue = "#3f95f6",
blue_bright = "#029fff",
blue_subtle_bg = "#2a346e",
blue_subtle_dark_bg = "#003045",
magenta = "#d369af",
magenta_bright = "#af85ea",
magenta_brighter = "#c57faf",
magenta_subtle_bg = "#572454",
magenta_subtle_bg_darker = "#331531",
cyan = "#4fbaef",
cyan_bright = "#35afbf",
cyan_subtle_bg = "#133d56",
silver = "#b8c6d5",
silver_bright = "#ffffff",
}

View file

@ -1,368 +0,0 @@
local palette = require("dnsc.palette")
vim.cmd.highlight("clear")
vim.g.colors_name = "winterly"
local hi = function(name, val)
-- Force links
val.force = true
-- Make sure that `cterm` attribute is not populated from `gui`
val.cterm = val.cterm or {} ---@type vim.api.keyset.highlight
-- Define global highlight
vim.api.nvim_set_hl(0, name, val)
end
-- General
hi("Normal", { fg = palette.fg })
hi("Conceal", { fg = palette.silver, bg = palette.grey, ctermfg = "LightGrey", ctermbg = "DarkGrey" })
hi("Cursor", { bg = palette.magenta_bright })
hi("DiffText", { bg = palette.yellow_subtle_bg, bold = true, ctermbg = "DarkYellow", cterm = { bold = true } })
hi("ErrorMsg", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermfg = "White", ctermbg = "DarkRed" })
hi("IncSearch", { bg = palette.magenta_subtle_bg, fg = palette.magenta })
hi("ModeMsg", { bold = true, cterm = { bold = true } })
hi("NonText", { fg = palette.grey, ctermfg = "DarkGrey" })
hi("PmenuSbar", { bg = palette.grey, ctermbg = "Grey" })
hi("StatusLine", { reverse = true, bold = true, cterm = { reverse = true, bold = true } })
hi("StatusLineNC", { reverse = true, cterm = { reverse = true } })
hi("TabLineFill", { reverse = true, cterm = { reverse = true } })
hi("TabLineSel", { bold = true, cterm = { bold = true } })
hi("TermCursor", { reverse = true, cterm = { reverse = true } })
hi("WinBar", { bold = true, cterm = { bold = true } })
hi("WildMenu", { fg = palette.bg, bg = palette.yellow_subtle_bg, ctermfg = "Black", ctermbg = "Yellow" })
hi("VertSplit", { link = "Comment" })
hi("WinSeparator", { link = "VertSplit" })
hi("WinBarNC", { link = "WinBar" })
hi("DiffTextAdd", { link = "DiffText" })
hi("EndOfBuffer", { link = "NonText" })
hi("LineNrAbove", { link = "LineNr" })
hi("LineNrBelow", { link = "LineNr" })
hi("QuickFixLine", { link = "Search" })
hi("CursorLineSign", { link = "SignColumn" })
hi("CursorLineFold", { link = "FoldColumn" })
hi("CurSearch", { link = "Search" })
hi("PmenuKind", { link = "Pmenu" })
hi("PmenuKindSel", { link = "PmenuSel" })
hi("PmenuMatch", { link = "Pmenu" })
hi("PmenuMatchSel", { link = "PmenuSel" })
hi("PmenuExtra", { link = "Pmenu" })
hi("PmenuExtraSel", { link = "PmenuSel" })
hi("PreInsert", { link = "Added" })
hi("ComplMatchIns", {})
hi("ComplHint", { link = "NonText" })
hi("ComplHintMore", { link = "MoreMsg" })
hi("Whitespace", { link = "NonText" })
hi("MsgSeparator", { link = "StatusLine" })
hi("NormalFloat", { link = "Pmenu" })
hi("FloatBorder", { bg = palette.bg_secondary, fg = palette.fg_dim })
hi("FloatTitle", { bg = palette.bg_secondary, fg = palette.fg, bold = true })
hi("FloatFooter", { link = "Title" })
hi("FloatShadow", { bg = palette.bg, blend = 80 })
hi("FloatShadowThrough", { bg = palette.bg, blend = 100 })
hi("RedrawDebugNormal", { reverse = true, cterm = { reverse = true } })
hi("RedrawDebugClear", { bg = palette.yellow_subtle_bg, ctermbg = "DarkYellow" })
hi("RedrawDebugComposed", { bg = palette.green_subtle_bg, ctermbg = "DarkGreen" })
hi("RedrawDebugRecompose", { bg = palette.red_subtle_bg, ctermbg = "DarkRed" })
hi("Error", { link = "ErrorMsg" })
hi("NvimInternalError", { link = "ErrorMsg" })
hi("Todo", { fg = palette.blue_bright, bg = palette.blue_subtle_bg, ctermbg = "DarkBlue", ctermfg = "LightBlue" })
hi("String", { link = "Constant" })
hi("Character", { link = "Constant" })
hi("Number", { link = "Boolean" })
hi("Boolean", { fg = palette.magenta_bright, bold = true })
hi("Float", { link = "Number" })
hi("Function", { link = "Identifier" })
hi("Conditional", { link = "Statement" })
hi("Repeat", { link = "Statement" })
hi("Label", { link = "Statement" })
hi("Operator", { fg = palette.fg_alt, italic = false, ctermfg = "White" })
hi("Keyword", { link = "Statement" })
hi("Exception", { link = "Statement" })
hi("Include", { link = "PreProc" })
hi("Define", { link = "PreProc" })
hi("Macro", { link = "PreProc" })
hi("PreCondit", { link = "PreProc" })
hi("StorageClass", { link = "Type" })
hi("Structure", { link = "Type" })
hi("Typedef", { bold = true, fg = palette.yellow_brighter, ctermfg = "LightYellow" })
hi("Tag", { link = "Special" })
hi("SpecialChar", { link = "Special" })
hi("Delimiter", { link = "Special" })
hi("SpecialComment", { link = "Special" })
hi("Debug", { link = "Special" })
hi("DiagnosticError", { fg = palette.red_bright, ctermfg = 1 })
hi("DiagnosticWarn", { fg = palette.yellow, ctermfg = 3 })
hi("DiagnosticInfo", { fg = palette.cyan, ctermfg = 4 })
hi("DiagnosticHint", { fg = palette.silver, ctermfg = 7 })
hi("DiagnosticOk", { fg = palette.green_bright, ctermfg = 10 })
hi("DiagnosticUnderlineError", { fg = palette.red_bright, undercurl = true, cterm = { underline = true } })
hi("DiagnosticUnderlineWarn", { fg = palette.yellow, undercurl = true, cterm = { underline = true } })
hi("DiagnosticUnderlineInfo", { fg = palette.cyan, undercurl = true, cterm = { underline = true } })
hi("DiagnosticUnderlineHint", { fg = palette.silver, undercurl = true, cterm = { underline = true } })
hi("DiagnosticUnderlineOk", { fg = palette.green_bright, undercurl = true, cterm = { underline = true } })
hi("DiagnosticVirtualTextError", { link = "DiagnosticError" })
hi("DiagnosticVirtualTextWarn", { link = "DiagnosticWarn" })
hi("DiagnosticVirtualTextInfo", { link = "DiagnosticInfo" })
hi("DiagnosticVirtualTextHint", { link = "DiagnosticHint" })
hi("DiagnosticVirtualTextOk", { link = "DiagnosticOk" })
hi("DiagnosticFloatingError", { link = "DiagnosticError" })
hi("DiagnosticFloatingWarn", { link = "DiagnosticWarn" })
hi("DiagnosticFloatingInfo", { link = "DiagnosticInfo" })
hi("DiagnosticFloatingHint", { link = "DiagnosticHint" })
hi("DiagnosticFloatingOk", { link = "DiagnosticOk" })
hi("DiagnosticSignError", { link = "DiagnosticError" })
hi("DiagnosticSignWarn", { link = "DiagnosticWarn" })
hi("DiagnosticSignInfo", { link = "DiagnosticInfo" })
hi("DiagnosticSignHint", { link = "DiagnosticHint" })
hi("DiagnosticSignOk", { link = "DiagnosticOk" })
hi("DiagnosticDeprecated", { fg = palette.red, strikethrough = true, cterm = { strikethrough = true } })
hi("DiagnosticUnnecessary", { link = "Unused" })
hi("LspInlayHint", { link = "NonText" })
hi("SnippetTabstop", { link = "Visual" })
hi("SnippetTabstopActive", { link = "SnippetTabstop" })
-- Text
hi("@markup.raw", { link = "Special" })
hi("@markup.link", { link = "Identifier" })
hi("@markup.link.label", { link = "ConstantUnderlined" })
hi("@markup.heading", { link = "Title" })
hi("@markup.heading.gitcommit", { bg = palette.bg, fg = palette.fg, bold = true })
hi("@markup.link.url", { link = "Underlined" })
hi("@markup.underline", { link = "Underlined" })
hi("@comment.todo", { link = "Todo" })
-- Miscs
hi("@comment", { link = "Comment" })
hi("@punctuation", { link = "Delimiter" })
-- Constants
hi("@constant", { link = "Constant" })
hi("@constant.builtin", { link = "Special" })
hi("@constant.macro", { link = "Define" })
hi("@keyword.directive", { link = "Define" })
hi("@string", { link = "String" })
hi("@string.escape", { link = "SpecialChar" })
hi("@string.special", { link = "SpecialChar" })
hi("@character", { link = "Character" })
hi("@character.special", { link = "SpecialChar" })
hi("@number", { link = "Number" })
hi("@boolean", { link = "Boolean" })
hi("@number.float", { link = "Float" })
-- Functions
hi("@function", { link = "Function" })
hi("@function.builtin", { link = "Special" })
hi("@function.macro", { link = "Macro" })
hi("@function.method", { link = "Function" })
hi("@variable.parameter", { link = "Identifier" })
hi("@variable.parameter.builtin", { link = "Special" })
hi("@variable.member", { link = "Identifier" })
hi("@property", { link = "Identifier" })
hi("@attribute", { link = "Macro" })
hi("@attribute.builtin", { link = "Special" })
hi("@constructor", { link = "Special" })
-- Keywords
hi("@keyword.conditional", { link = "Conditional" })
hi("@keyword.repeat", { link = "Repeat" })
hi("@keyword.type", { link = "Structure" })
hi("@label", { link = "Label" })
hi("@operator", { link = "Operator" })
hi("@keyword", { link = "Keyword" })
hi("@keyword.exception", { link = "Exception" })
hi("@variable", { link = "Identifier" })
hi("@type", { link = "Type" })
hi("@type.builtin", { link = "Type" })
hi("@type.definition", { link = "Typedef" })
hi("@module", { link = "Identifier" })
hi("@keyword.import", { link = "Include" })
hi("@keyword.directive", { link = "PreProc" })
hi("@keyword.debug", { link = "Debug" })
hi("@tag", { link = "Tag" })
hi("@tag.tsx", { link = "Identifier" })
hi("@tag.builtin", { link = "Special" })
-- LSP semantic tokens
hi("@lsp.type.class", { link = "Structure" })
hi("@lsp.type.comment", { link = "Comment" })
hi("@lsp.type.decorator", { link = "Function" })
hi("@lsp.type.enum", { link = "Structure" })
hi("@lsp.type.enumMember", { link = "Constant" })
hi("@lsp.type.function", { link = "Function" })
hi("@lsp.type.interface", { link = "Structure" })
hi("@lsp.type.macro", { link = "Macro" })
hi("@lsp.type.method", { link = "Function" })
hi("@lsp.type.namespace", { link = "Structure" })
hi("@lsp.type.parameter", { link = "Identifier" })
hi("@lsp.type.property", { link = "Identifier" })
hi("@lsp.type.struct", { link = "Structure" })
hi("@lsp.type.type", { link = "Type" })
hi("@lsp.type.typeParameter", { link = "TypeDef" })
hi("@lsp.type.variable", { link = "Identifier" })
hi("@lsp.typemod.keyword.documentation", { fg = palette.grey, bold = true })
if vim.o.background == "light" then
-- TODO: Define light scheme
else
-- Default colors only used with a dark background.
hi("ColorColumn", { bg = palette.red_subtle_bg, ctermbg = "DarkRed" })
hi("CursorColumn", { bg = palette.grey, ctermbg = "DarkGrey" })
hi("CursorLine", { bg = palette.magenta_subtle_bg_darker, cterm = { underline = true } })
hi("CursorLineNr", {
fg = palette.fg,
bg = palette.magenta_subtle_bg_darker,
bold = true,
ctermfg = "White",
cterm = { underline = true },
})
hi("DiffAdd", { fg = palette.green_bright, bg = palette.green_subtle_bg, ctermbg = "DarkGreen" })
hi("DiffChange", { fg = palette.yellow_brighter, bg = palette.yellow_subtle_bg, ctermbg = "DarkYellow" })
hi("DiffDelete", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermbg = "DarkRed" })
hi("Directory", { fg = palette.magenta, bold = true, ctermfg = "Magenta" })
hi("FoldColumn", { fg = palette.cyan_bright, bg = palette.grey, ctermfg = "Cyan", ctermbg = "DarkGrey" })
hi("Folded", { fg = palette.cyan_bright, bg = palette.grey, ctermfg = "Cyan", ctermbg = "DarkGrey" })
hi("LineNr", { fg = palette.grey_bright, ctermfg = "Grey" })
hi(
"MatchParen",
{ fg = palette.fg_alt, bg = palette.magenta_subtle_bg, ctermbg = "DarkMagenta", ctermfg = "Black" }
)
hi("MoreMsg", { fg = palette.grey, ctermfg = "DarkGrey" })
hi("Pmenu", { bg = palette.bg_secondary, ctermfg = "White", ctermbg = "Black" })
hi("PmenuSel", {
bg = palette.magenta_subtle_bg,
fg = palette.fg,
bold = true,
ctermfg = "LightMagenta",
ctermbg = "DarkMagenta",
})
hi("PmenuThumb", { bg = palette.fg, ctermbg = "White" })
hi("Question", { fg = palette.green_bright, bold = true, ctermfg = "LightGreen" })
hi("Search", { link = "IncSearch" })
hi("Substitute", {
fg = palette.green_bright,
bg = palette.green_subtle_bg,
bold = true,
ctermfg = "DarkBlue",
ctermbg = "LightBlue",
})
hi("SignColumn", { fg = palette.grey_bright, bg = palette.bg, ctermfg = "Cyan", ctermbg = "DarkGrey" })
hi("SpecialKey", { fg = palette.cyan_bright, ctermfg = "LightBlue" })
hi("SpellBad", { fg = palette.red, undercurl = true, ctermbg = "Red" })
hi("SpellCap", { fg = palette.blue, undercurl = true, ctermbg = "Blue" })
hi("SpellLocal", { fg = palette.cyan, undercurl = true, ctermbg = "Cyan" })
hi("SpellRare", { fg = palette.magenta, undercurl = true, ctermbg = "Magenta" })
hi("StatusLineTerm", {
fg = palette.bg,
bg = palette.green_bright,
bold = true,
ctermfg = "Black",
ctermbg = "LightGreen",
cterm = { bold = true },
})
hi("StatusLineTermNC", { fg = palette.bg, bg = palette.green_bright, ctermfg = "Black", ctermbg = "LightGreen" })
hi(
"TabLine",
{ bg = palette.grey, underline = true, ctermfg = "White", ctermbg = "DarkGrey", cterm = { underline = true } }
)
hi("Title", { fg = palette.magenta_bright, bold = true, ctermfg = "Magenta" })
hi("Visual", {
fg = palette.magenta_brighter,
bg = palette.magenta_subtle_bg,
ctermfg = "LightMagenta",
ctermbg = "DarkMagenta",
})
hi("WarningMsg", { fg = palette.red_bright, ctermfg = "LightRed" })
hi("Comment", { fg = palette.grey, ctermfg = "Cyan" })
hi("Unused", { fg = palette.grey_bright, undercurl = true, ctermfg = "LightGrey" })
hi("Constant", { fg = palette.yellow_brighter, ctermfg = "LightYellow" })
hi("ConstantUnderlined", { fg = palette.yellow_brighter, underline = true, ctermfg = "LightYellow" })
hi("Special", { fg = palette.silver, ctermfg = "LightGrey" })
hi("Identifier", { fg = palette.fg, ctermfg = "White", cterm = { bold = true } })
hi("Statement", { fg = palette.fg_alt, bold = true, ctermfg = "White" })
hi("PreProc", { fg = palette.magenta, ctermfg = "LightMagenta" })
hi("Type", { fg = palette.silver, bold = true, ctermfg = "LightCyan" })
hi("Underlined", { fg = palette.silver, underline = true, ctermfg = "LightGrey", cterm = { underline = true } })
hi("Ignore", { fg = palette.bg, ctermfg = "Black" })
hi(
"Added",
{ fg = palette.green_bright, bg = palette.green_subtle_bg, ctermfg = "LightGreen", ctermbg = "DarkGreen" }
)
hi(
"Changed",
{ fg = palette.blue_bright, bg = palette.blue_subtle_bg, ctermfg = "LightBlue", ctermbg = "DarkBlue" }
)
hi("Removed", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermfg = "LightRed", ctermbg = "DarkRed" })
hi("NotificationInfo", { fg = palette.silver, bg = palette.bg, ctermfg = "White", ctermbg = "Black" })
-- Snacks
hi("SnacksIndentScope", { fg = palette.magenta, ctermfg = "LightGrey" })
hi("SnacksIndent", { fg = palette.magenta_subtle_bg, ctermfg = "DarkGrey" })
hi(
"SnacksPickerCursorLine",
{ bg = palette.magenta_subtle_bg, fg = palette.fg, bold = true, cterm = { underline = true } }
)
hi("SnacksPickerListCursorLine", { link = "SnacksPickerCursorLine" })
hi("SnacksPickerTitle", { link = "FloatTitle" })
hi("SnacksBackdrop", { link = "Pmenu" })
-- Flash
hi("FlashMatch", { reverse = true })
hi("FlashLabel", { bg = palette.fg, fg = palette.bg })
-- FzfLua
hi("FzfLuaNormal", { link = "Pmenu" })
hi("FzfLuaBorder", { link = "Pmenu" })
hi("FzfLuaTitle", { link = "Pmenu" })
hi("FzfLuaBackdrop", { link = "Pmenu" })
hi("FzfLuaPreviewNormal", { link = "FzfLuaNormal" })
hi("FzfLuaPreviewBorder", { link = "FzfLuaBorder" })
hi("FzfLuaPreviewTitle", { link = "FzfLuaTitle" })
hi(
"FzfLuaCursorLine",
{ bg = palette.magenta_subtle_bg, fg = palette.fg, bold = true, cterm = { underline = true } }
)
hi("FzfLuaTitleFlags", { link = "FzfLuaCursorLine" })
hi("FzfLuaCursorLineNr", { link = "FzfLuaCursorLine" })
hi("FzfLuaHeaderBind", { link = "Pmenu" })
hi("FzfLuaHeaderText", { link = "Comment" })
hi("FzfLuaPathLineNr", { link = "Pmenu" })
hi("FzfLuaPathColNr", { link = "Pmenu" })
hi("FzfLuaLivePrompt", { link = "Pmenu" })
hi("FzfLuaCmdBuf", { link = "Comment" })
hi("FzfLuaBufName", { link = "Pmenu" })
hi("FzfLuaBufId", { link = "Special" })
hi("FzfLuaBufLineNr", { link = "Special" })
hi("FzfLuaBufFlagCur", { link = "Pmenu" })
hi("FzfLuaBufFlagAlt", { link = "Comment" })
-- Blinkpairs
hi("BlinkPairsOrange", { link = "Comment" })
hi("BlinkPairsPurple", { fg = palette.magenta_brighter })
hi("BlinkPairsBlue", { fg = palette.magenta_bright })
-- Neogit
hi("NeogitDiffAdd", { link = "DiffAdd" })
hi("NeogitDiffDelete", { link = "DiffDelete" })
hi("NeogitDiffContext", { bg = palette.bg_secondary, fg = palette.fg })
hi("NeogitDiffContextCursor", { bg = palette.magenta_subtle_bg_darker, fg = palette.magenta_brighter })
hi("NeogitDiffAddCursor", { bg = palette.green_bright, fg = palette.green_subtle_bg })
hi("NeogitDiffDeleteCursor", { bg = palette.red_bright, fg = palette.red_subtle_bg })
hi("NeogitDiffContextHighlight", { link = "NeogitDiffContext" })
hi("NeogitDiffAddHighlight", { link = "DiffAdd" })
hi("NeogitDiffDeleteHighlight", { link = "DiffDelete" })
hi("NeogitHunkHeader", { bg = palette.bg_secondary, fg = palette.grey_bright })
hi("NeogitHunkMergeHeader", { link = "NeogitHunkHeader" })
hi("NeogitHunkHeaderHighlight", { bg = palette.magenta_subtle_bg, fg = palette.magenta_brighter })
hi("NeogitHunkHeaderCursor", { link = "NeogitHunkHeaderHighlight" })
hi("NeogitCommitViewHeader", { bg = palette.bg_secondary, fg = palette.fg })
hi("NeogitDiffHeader", { bg = palette.bg, fg = palette.grey_bright, bold = true })
hi("NeogitActiveItem", { bg = palette.grey_bright, fg = palette.bg, bold = true })
end

View file

@ -1,56 +0,0 @@
{ pkgs, ... }:
{
plugins.conform-nvim = {
enable = true;
settings = {
formatters_by_ft = {
typescriptreact = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
astro = [ "prettierd" ];
typescript = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
javascript = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
javascriptreact = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
html = [ "prettierd" ];
htmlangular = [ "prettierd" ];
css = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
yaml = [ "prettierd" ];
markdown = [ "prettierd" ];
json = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
lua = [ "stylua" ];
go = [ "goimports" ];
gomod = [ "goimports" ];
gowork = [ "goimports" ];
gotmpl = [ "goimports" ];
};
format_on_save = {
timeout_ms = 500;
lsp_format = "fallback";
};
};
extraPackages = [pkgs.stylua];
};
}

View file

@ -1,28 +0,0 @@
{
plugins.gitportal = {
enable = true;
};
keymaps = [
{
key = "<leader>gll";
action = "<cmd>GitPortal<cr>";
options.desc = "Open line in Git provider";
}
{
key = "<leader>gll";
action = "<cmd>GitPortal<cr>";
options.desc = "Open line in Git provider";
}
{
key = "<leader>gly";
action = "<cmd>GitPortal copy_link_to_clipboard<cr>";
options.desc = "Copy link to line at Git provider";
}
{
key = "<leader>glo";
action = "<cmd>GitPortal open_link<cr>";
options.desc = "Open link to line at Git provider";
}
];
}

View file

@ -1,129 +0,0 @@
{
plugins.which-key = {
enable = true;
icons.mappings = false;
};
keymaps = [
# Open
{
mode = [ "n" ];
key = "<leader>od";
action = "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>";
options.desc = "Go to definition in other window";
}
# Buffer
{
mode = [ "n" ];
key = "<leader>bn";
action = "<cmd>bn<cr>";
options.desc = "Move to next buffer";
}
{
mode = [ "n" ];
key = "<leader>bp";
action = "<cmd>bp<cr>";
options.desc = "Move to previous buffer";
}
{
mode = [ "n" ];
key = "<leader>bk";
action = "<cmd>bn<cr>";
options.desc = "Kill buffer and window";
}
# File
{
mode = [ "n" ];
key = "<leader>fn";
action = "<cmd>enew<cr>";
options.desc = "Create a new file";
}
{
mode = [ "n" ];
key = "<leader>fs";
action = "<cmd>w<cr>";
options.desc = "Save currently opened file";
}
# Quit
{
mode = [ "n" ];
key = "<leader>qq";
action = "<cmd>qa!<cr>";
options.desc = "Leave neovim";
}
# Window
{
mode = [ "n" ];
key = "<leader>w+";
action = ":vertical resize +4<cr>";
options.desc = "Increase window size";
}
{
mode = [ "n" ];
key = "<leader>w-";
action = ":vertical resize -4<cr>";
options.desc = "Decrease window size";
}
{
mode = [ "n" ];
key = "<leader>wx";
action = ":bd<cr>";
options.desc = "Kill active window and buffer";
}
{
mode = [ "n" ];
key = "<leader>wh";
action = "<C-W>h";
options.desc = "Move to window on left";
}
{
mode = [ "n" ];
key = "<leader>wj";
action = "<C-W>j";
options.desc = "Move to window on bottom";
}
{
mode = [ "n" ];
key = "<leader>wk";
action = "<C-W>k";
options.desc = "Move to window on top";
}
{
mode = [ "n" ];
key = "<leader>wl";
action = "<C-W>l";
options.desc = "Move to window on right";
}
{
mode = [ "n" ];
key = "<leader>ws";
action = "<cmd>sp<cr>";
options.desc = "Split windows horizontally";
}
{
mode = [ "n" ];
key = "<leader>wv";
action = "<cmd>vsp<cr>";
options.desc = "Split windows vertically";
}
{
mode = [ "n" ];
key = "<leader>wd";
action = "<cmd>close<cr>";
options.desc = "Delete window only";
}
{
mode = [
"n"
"x"
"o"
];
key = "<CR>";
action.__raw = /* lua */ ''function() require("flash").jump() end'';
}
];
}

View file

@ -1,199 +0,0 @@
{ pkgs, ... }:
{
plugins.lspconfig.enable = true;
lsp = {
enable = true;
servers = {
lua_ls = {
enable = true;
package = pkgs.lua-language-server;
packageFallback = true;
};
nil_ls = {
enable = true;
package = pkgs.nil;
packageFallback = true;
};
gopls = {
enable = true;
package = pkgs.gopls;
packageFallback = true;
};
ts_ls = {
enable = true;
package = pkgs.typescript-language-server;
packageFallback = true;
};
jsonls = {
enable = true;
package = pkgs.vscode-langservers-extracted;
packageFallback = true;
};
cssls = {
enable = true;
package = pkgs.vscode-langservers-extracted;
packageFallback = true;
};
html = {
enable = true;
package = pkgs.vscode-langservers-extracted;
packageFallback = true;
};
astro = {
enable = true;
package = pkgs.astro-language-server;
packageFallback = true;
config.init_options.typescript.tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib";
};
eslint = {
enable = true;
package = pkgs.vscode-langservers-extracted;
packageFallback = true;
config = {
root_markers = [
".eslintrc"
".eslintrc.js"
".eslintrc.cjs"
".eslintrc.yaml"
".eslintrc.yml"
".eslintrc.json"
"eslint.config.js"
"eslint.config.mjs"
"eslint.config.cjs"
"eslint.config.ts"
"eslint.config.mts"
"eslint.config.cts"
"package.json"
];
settings = {
validate = "on";
useESLintClass = false;
experimental = {
useFlatConfig = true;
};
codeActionOnSave = {
enable = false;
mode = "all";
};
format = true;
quiet = false;
onIgnoredFiles = "off";
rulesCustomizations = { };
run = "onType";
problems = {
shortenToSingleLine = false;
};
nodePath = "";
workingDirectory = {
mode = "location";
};
codeAction = {
disableRuleComment = {
enable = true;
location = "separateLine";
};
showDocumentation = {
enable = true;
};
};
};
handlers = {
"eslint/openDoc".__raw = /* lua */ ''
function(_, result)
if result then
vim.ui.open(result.url)
end
return {}
end
'';
"eslint/confirmESLintExecution" = /* lua */ ''
function(_, result)
if not result then
return
end
return 4 -- approved
end
'';
"eslint/probeFailed" = /* lua */ ''
function()
vim.notify("[lspconfig] ESLint probe failed.", vim.log.levels.WARN)
return {}
end
'';
"eslint/noLibrary" = /* lua */ ''
function()
vim.notify("[lspconfig] Unable to find ESLint library.", vim.log.levels.WARN)
return {}
end
'';
};
on_new_config.__raw = /* lua */ ''
function(config, new_root_dir)
-- This function is called when LSP attaches to a new buffer
-- Set the working directory to the root where eslint config is found
config.settings = config.settings or {}
config.settings.workspaceFolder = {
uri = new_root_dir,
name = vim.fn.fnamemodify(new_root_dir, ":t"),
}
-- Detect flat config
local flat_config_files = {
"eslint.config.js",
"eslint.config.mjs",
"eslint.config.cjs",
"eslint.config.ts",
"eslint.config.mts",
"eslint.config.cts",
}
for _, file in ipairs(flat_config_files) do
local config_path = new_root_dir .. "/" .. file
if vim.uv.fs_stat(config_path) then
config.settings.experimental = config.settings.experimental or {}
config.settings.experimental.useFlatConfig = true
break
end
end
-- Support Yarn PnP
local pnp_cjs = new_root_dir .. "/.pnp.cjs"
local pnp_js = new_root_dir .. "/.pnp.js"
if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then
config.cmd = vim.list_extend({ "yarn", "exec" }, config.cmd or {})
end
end
'';
};
};
biome = {
enable = true;
package = null;
packageFallback = false;
};
};
keymaps = [
{
key = "<leader>ca";
lspBufAction = "code_action";
}
{
key = "<leader>e";
action = "<cmd>lua vim.diagnostic.open_float()<cr>";
}
];
};
# Define diagnostic appearance
diagnostic.settings = {
virtual_text = false;
signs = true;
underline = true;
update_in_insert = false;
severity_sort = false;
};
}

View file

@ -1,47 +0,0 @@
{
globals = {
mapleader = " ";
maplocalleader = " ";
};
clipboard.register = "unnamedplus";
opts = {
backup = false;
cmdheight = 1;
conceallevel = 0;
fileencoding = "utf-8";
hlsearch = true;
ignorecase = true;
mouse = "a";
pumheight = 10;
showmode = false;
smartindent = true;
breakindent = true;
showtabline = 0;
smartcase = true;
splitbelow = true;
splitright = true;
swapfile = false;
termguicolors = true;
timeoutlen = 600;
undofile = true;
updatetime = 230;
writebackup = false;
expandtab = true;
shiftwidth = 2;
tabstop = 2;
cursorline = true;
number = true;
relativenumber = true;
numberwidth = 2;
signcolumn = "yes";
linebreak = true;
breakat = " ^I!@*-+;:,./?";
scrolloff = 4;
sidescrolloff = 4;
winbar = "";
foldlevel = 99;
foldlevelstart = 99;
};
}

View file

@ -1,171 +0,0 @@
{ pkgs, ... }:
{
plugins.oil = {
enable = true;
settings = {
keymaps = {
"q" = "actions.close";
};
columns = [
"icon"
"permissions"
"size"
"mtime"
];
};
};
extraPlugins = [ pkgs.vimPlugins.snacks-nvim ];
extraConfigLua = /* lua */ ''
local Snacks = require("snacks");
local filter_lsp_definitions = function(item)
if item.file:match("/react/ts5.0/") or item.file:match("react.d.ts") then
return false
end
return true
end
Snacks.setup({
bigfile = { enabled = true },
bufdelete = { enabled = true },
git = { enabled = true },
indent = { enabled = true },
input = { enabled = true },
notifier = { enabled = true },
picker = {
enabled = true,
prompt = "λ ",
layout = { preset = "ivy" },
},
statuscolumn = { enabled = true },
})
'';
keymaps = [
# Git
{
key = "<leader>gb";
action.__raw = "function() Snacks.git.blame_line() end";
options.desc = "Show git blame for current line";
}
# Picker
{
key = "<leader>.";
action.__raw = "function() Snacks.picker.files({ hidden = true }) end";
options.desc = "Files";
}
{
key = "<leader><leader>";
action.__raw = "function() Snacks.picker.git_files() end";
options.desc = "Git files";
}
# Find
{
key = "<leader>fr";
action.__raw = "function() Snacks.picker.recent() end";
options.desc = "Recent";
}
{
key = "<leader>fp";
action.__raw = "function() Snacks.picker.projects() end";
options.desc = "Projects";
}
{
key = "<leader>bb";
action.__raw = "function() Snacks.picker.buffers() end";
options.desc = "List buffers";
}
{
key = "<leader>bd";
action.__raw = "function() Snacks.bufdelete() end";
options.desc = "Delete buffer";
}
{
key = "<leader>bD";
action.__raw = "function() Snacks.bufdelete.all() end";
options.desc = "Delete all buffers";
}
{
key = "<leader>bo";
action.__raw = "function() Snacks.bufdelete.other() end";
options.desc = "Delete other buffers";
}
# Search
{
key = "<leader>ss";
action.__raw = "function() Snacks.picker.grep() end";
options.desc = "Grep";
}
{
mode = [
"n"
"x"
];
key = "<leader>sw";
action.__raw = "function() Snacks.picker.grep_word() end";
options.desc = "Visual selection or word";
}
{
key = "<leader>su";
action.__raw = "function() Snacks.picker.undo() end";
options.desc = "Undo History";
}
# Diagnostics
{
key = "<leader>td";
action.__raw = "function() Snacks.picker.diagnostics_buffer() end";
options.desc = "Buffer Diagnostics";
}
{
key = "<leader>ta";
action.__raw = "function() Snacks.picker.diagnostics() end";
options.desc = "Diagnostics";
}
# LSP
{
key = "gd";
action.__raw = "function() Snacks.picker.lsp_definitions({ filter = { filter = filter_lsp_definitions } }) end";
options.desc = "Goto Definition";
}
{
key = "gD";
action.__raw = "function() Snacks.picker.lsp_declarations() end";
options.desc = "Goto Declaration";
}
{
key = "grr";
action.__raw = "function() Snacks.picker.lsp_references() end";
options = {
desc = "References";
nowait = true;
};
}
{
key = "gI";
action.__raw = "function() Snacks.picker.lsp_implementations() end";
options.desc = "Goto Implementation";
}
{
key = "gy";
action.__raw = "function() Snacks.picker.lsp_type_definitions() end";
options.desc = "Goto T[y]pe Definition";
}
# Notifications and highlights
{
key = "<leader>on";
action.__raw = "function() Snacks.notifier.show_history() end";
options.desc = "Open notification history";
}
{
key = "<leader>oh";
action.__raw = "function() Snacks.picker.highlights() end";
options.desc = "List highlights";
}
{
key = "<leader>n";
action = "<cmd>Oil<cr>";
options.desc = "Opens file explorer";
}
];
}

View file

@ -1,96 +0,0 @@
{
plugins.lualine = {
enable = true;
settings = {
options = {
theme = {
__raw = "winterly_lualine";
};
icons_enabled = false;
component_separators = {
left = "|";
right = "|";
};
section_separators = {
left = "";
right = "";
};
};
sections = {
lualine_a = [
{
__unkeyed-1 = "mode";
fmt = {
__raw = "function(str) return str:sub(1, 1) end";
};
}
];
lualine_b = [
{
__unkeyed-1 = "filename";
file_status = true;
newfile_status = false;
path = 4;
shorting_target = 120;
symbols = {
modified = "[+]";
readonly = "[-]";
unnamed = "[No Name]";
newfile = "[New]";
};
}
"encoding"
];
lualine_c = null;
lualine_x = null;
lualine_y = [
"branch"
"diff"
"diagnostics"
];
lualine_z = [
"location"
];
};
};
# Sets up my custom colorscheme
luaConfig.pre = /* lua */ ''
local palette = require("dnsc.palette")
local winterly_lualine = {
normal = {
a = { bg = palette.magenta, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.magenta },
c = { bg = palette.bg_secondary, fg = palette.magenta },
},
insert = {
a = { bg = palette.cyan_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.cyan_bright },
c = { bg = palette.bg_secondary, fg = palette.cyan_bright },
},
visual = {
a = { bg = palette.blue_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.blue_bright },
c = { bg = palette.bg_secondary, fg = palette.blue_bright },
},
replace = {
a = { bg = palette.red_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.red_bright },
c = { bg = palette.bg_secondary, fg = palette.red_bright },
},
command = {
a = { bg = palette.green_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.green_bright },
c = { bg = palette.bg_secondary, fg = palette.green_bright },
},
inactive = {
a = { bg = palette.bg_secondary, fg = palette.fg_dim },
b = { bg = palette.bg_secondary, fg = palette.fg_dim },
c = { bg = palette.bg_secondary, fg = palette.fg_dim },
},
}
'';
};
}

View file

@ -1,5 +0,0 @@
setlocal expandtab
setlocal smartindent
setlocal tabstop=2
setlocal shiftwidth=2
setlocal conceallevel=2

View file

@ -1,5 +0,0 @@
setlocal expandtab
setlocal smartindent
setlocal tabstop=2
setlocal shiftwidth=2
setlocal conceallevel=2

View file

@ -1,6 +0,0 @@
setlocal expandtab
setlocal smartindent
setlocal tabstop=2
setlocal shiftwidth=2
setlocal conceallevel=2
setlocal nocompatible

View file

@ -1 +0,0 @@
/nix/store/mp57l6qar04fcicsvmryl7fjzq6wwfmp-home-manager-files/.config/nvim/colors/winterly.lua

View file

@ -1,7 +0,0 @@
au BufNewFile,BufRead Appfile set ft=ruby
au BufNewFile,BufRead Deliverfile set ft=ruby
au BufNewFile,BufRead Fastfile set ft=ruby
au BufNewFile,BufRead Gymfile set ft=ruby
au BufNewFile,BufRead Matchfile set ft=ruby
au BufNewFile,BufRead Snapfile set ft=ruby
au BufNewFile,BufRead Scanfile set ft=ruby

View file

@ -1 +0,0 @@
/nix/store/mp57l6qar04fcicsvmryl7fjzq6wwfmp-home-manager-files/.config/nvim/init.lua

View file

@ -1,23 +0,0 @@
{
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
"codecompanion.nvim": { "branch": "main", "commit": "a8c696d1fc4268085e4306d54af39b07be884b17" },
"conform.nvim": { "branch": "master", "commit": "cde4da5c1083d3527776fee69536107d98dae6c9" },
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
"follow-md-links.nvim": { "branch": "main", "commit": "728d96d268eef9666f0ee77a083e7e2f0b44f607" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitportal.nvim": { "branch": "main", "commit": "2420f27c6269184f13d018f347f36eb120403110" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
"mini.pairs": { "branch": "main", "commit": "b316e68f2d242d5bd010deaab645daa27ed86297" },
"nvim-surround": { "branch": "main", "commit": "fcfa7e02323d57bfacc3a141f8a74498e1522064" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"schemastore.nvim": { "branch": "main", "commit": "eed1834170f343c14a6768f085b26b3571a55302" },
"snacks.nvim": { "branch": "main", "commit": "3c5c23ba91e608bd89bb36d76cb005aa63d20dbf" },
"substitute.nvim": { "branch": "main", "commit": "9db749a880e3dd3b0eb57f698aa8f1e1630e1f25" },
"vim-cool": { "branch": "master", "commit": "9ea940c0d537e55de0de4c0298c04b976960fb12" },
"vim-dispatch": { "branch": "master", "commit": "a2ff28abdb2d89725192db5b8562977d392a4d3f" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}

View file

@ -1,25 +0,0 @@
local function get_typescript_server_path(root_dir)
local project_roots = vim.fs.find("node_modules", { path = root_dir, upward = true, limit = math.huge })
for _, project_root in ipairs(project_roots) do
local typescript_path = project_root .. "/typescript"
local stat = vim.loop.fs_stat(typescript_path)
if stat and stat.type == "directory" then
return typescript_path .. "/lib"
end
end
return ""
end
return {
cmd = { "astro-ls", "--stdio" },
filetypes = { "astro" },
root_markers = { "package.json", "tsconfig.json", "jsconfig.json", ".git" },
init_options = {
typescript = {},
},
before_init = function(_, config)
if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then
config.init_options.typescript.tsdk = get_typescript_server_path(config.root_dir)
end
end,
}

View file

@ -1,34 +0,0 @@
---@type vim.lsp.Config
return {
cmd = function(dispatchers, config)
local cmd = 'biome'
local local_cmd = (config or {}).root_dir and config.root_dir .. '/node_modules/.bin/biome'
if local_cmd and vim.fn.executable(local_cmd) == 1 then
cmd = local_cmd
end
return vim.lsp.rpc.start({ cmd, 'lsp-proxy' }, dispatchers)
end,
filetypes = {
'astro',
'css',
'graphql',
'html',
'javascript',
'javascriptreact',
'json',
'jsonc',
'svelte',
'typescript',
'typescriptreact',
'vue',
},
workspace_required = true,
root_markers = {
'package-lock.json',
'yarn.lock',
'pnpm-lock.yaml',
'bun.lockb',
'bun.lock',
'deno.lock',
},
}

View file

@ -1,152 +0,0 @@
local utils = require("dnsc.utils")
local lsp = vim.lsp
local eslint_config_files = {
".eslintrc",
".eslintrc.js",
".eslintrc.cjs",
".eslintrc.yaml",
".eslintrc.yml",
".eslintrc.json",
"eslint.config.js",
"eslint.config.mjs",
"eslint.config.cjs",
"eslint.config.ts",
"eslint.config.mts",
"eslint.config.cts",
}
---@type vim.lsp.Config
return {
cmd = { "vscode-eslint-language-server", "--stdio" },
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
"vue",
"svelte",
"astro",
"htmlangular",
},
workspace_required = true,
on_attach = function(client, bufnr)
vim.api.nvim_buf_create_user_command(0, "LspEslintFixAll", function()
client:request_sync("workspace/executeCommand", {
command = "eslint.applyAllFixes",
arguments = {
{
uri = vim.uri_from_bufnr(bufnr),
version = lsp.util.buf_versions[bufnr],
},
},
}, nil, bufnr)
end, {})
end,
root_markers = eslint_config_files,
-- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation.
settings = {
validate = "on",
packageManager = nil,
useESLintClass = false,
experimental = {
useFlatConfig = false,
},
codeActionOnSave = {
enable = false,
mode = "all",
},
format = true,
quiet = false,
onIgnoredFiles = "off",
rulesCustomizations = {},
run = "onType",
problems = {
shortenToSingleLine = false,
},
-- nodePath configures the directory in which the eslint server should start its node_modules resolution.
-- This path is relative to the workspace folder (root dir) of the server instance.
nodePath = "",
-- use the workspace folder location or the file location (if no workspace folder is open) as the working directory
workingDirectory = { mode = "auto" },
codeAction = {
disableRuleComment = {
enable = true,
location = "separateLine",
},
showDocumentation = {
enable = true,
},
},
},
before_init = function(_, config)
-- The "workspaceFolder" is a VSCode concept. It limits how far the
-- server will traverse the file system when locating the ESLint config
-- file (e.g., .eslintrc).
local root_dir = config.root_dir
if root_dir then
config.settings = config.settings or {}
config.settings.workspaceFolder = {
uri = root_dir,
name = vim.fn.fnamemodify(root_dir, ":t"),
}
-- Support flat config files
-- They contain 'config' in the file name
local flat_config_files = vim.tbl_filter(function(file)
return file:match("config")
end, eslint_config_files)
for _, file in ipairs(flat_config_files) do
local found_files = vim.fn.globpath(root_dir, file, true, true)
-- Filter out files inside node_modules
local filtered_files = {}
for _, found_file in ipairs(found_files) do
if string.find(found_file, "[/\\]node_modules[/\\]") == nil then
table.insert(filtered_files, found_file)
end
end
if #filtered_files > 0 then
config.settings.experimental = config.settings.experimental or {}
config.settings.experimental.useFlatConfig = true
break
end
end
-- Support Yarn2 (PnP) projects
local pnp_cjs = root_dir .. "/.pnp.cjs"
local pnp_js = root_dir .. "/.pnp.js"
if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then
local cmd = config.cmd
config.cmd = vim.list_extend({ "yarn", "exec" }, cmd)
end
end
end,
handlers = {
["eslint/openDoc"] = function(_, result)
if result then
vim.ui.open(result.url)
end
return {}
end,
["eslint/confirmESLintExecution"] = function(_, result)
if not result then
return
end
return 4 -- approved
end,
["eslint/probeFailed"] = function()
vim.notify("[lspconfig] ESLint probe failed.", vim.log.levels.WARN)
return {}
end,
["eslint/noLibrary"] = function()
vim.notify("[lspconfig] Unable to find ESLint library.", vim.log.levels.WARN)
return {}
end,
},
}

View file

@ -1,99 +0,0 @@
---@brief
---
--- https://github.com/golang/tools/tree/master/gopls
---
--- Google's lsp server for golang.
--- @class go_dir_custom_args
---
--- @field envvar_id string
---
--- @field custom_subdir string?
local mod_cache = nil
local std_lib = nil
---@param custom_args go_dir_custom_args
---@param on_complete fun(dir: string | nil)
local function identify_go_dir(custom_args, on_complete)
local cmd = { "go", "env", custom_args.envvar_id }
vim.system(cmd, { text = true }, function(output)
local res = vim.trim(output.stdout or "")
if output.code == 0 and res ~= "" then
if custom_args.custom_subdir and custom_args.custom_subdir ~= "" then
res = res .. custom_args.custom_subdir
end
on_complete(res)
else
vim.schedule(function()
vim.notify(
("[gopls] identify " .. custom_args.envvar_id .. " dir cmd failed with code %d: %s\n%s"):format(
output.code,
vim.inspect(cmd),
output.stderr
)
)
end)
on_complete(nil)
end
end)
end
---@return string?
local function get_std_lib_dir()
if std_lib and std_lib ~= "" then
return std_lib
end
identify_go_dir({ envvar_id = "GOROOT", custom_subdir = "/src" }, function(dir)
if dir then
std_lib = dir
end
end)
return std_lib
end
---@return string?
local function get_mod_cache_dir()
if mod_cache and mod_cache ~= "" then
return mod_cache
end
identify_go_dir({ envvar_id = "GOMODCACHE" }, function(dir)
if dir then
mod_cache = dir
end
end)
return mod_cache
end
---@param fname string
---@return string?
local function get_root_dir(fname)
if mod_cache and fname:sub(1, #mod_cache) == mod_cache then
local clients = vim.lsp.get_clients({ name = "gopls" })
if #clients > 0 then
return clients[#clients].config.root_dir
end
end
if std_lib and fname:sub(1, #std_lib) == std_lib then
local clients = vim.lsp.get_clients({ name = "gopls" })
if #clients > 0 then
return clients[#clients].config.root_dir
end
end
return vim.fs.root(fname, "go.work") or vim.fs.root(fname, "go.mod") or vim.fs.root(fname, ".git")
end
---@type vim.lsp.Config
return {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_dir = function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
get_mod_cache_dir()
get_std_lib_dir()
-- see: https://github.com/neovim/nvim-lspconfig/issues/804
on_dir(get_root_dir(fname))
end,
}

View file

@ -1,15 +0,0 @@
return {
cmd = { "vscode-json-language-server", "--stdio" },
filetypes = { "json", "jsonc" },
init_options = {
provideFormatter = true,
},
root_markers = { ".git" },
single_file_support = true,
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
}

View file

@ -1,46 +0,0 @@
return {
cmd = { "lua-language-server" },
filetypes = { "lua" },
root_markers = {
".luarc.json",
".luarc.jsonc",
".luacheckrc",
".stylua.toml",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
single_file_support = true,
log_level = vim.lsp.protocol.MessageType.Warning,
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
path ~= vim.fn.stdpath("config")
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = {
version = "LuaJIT",
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
})
end,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
},
},
}

View file

@ -1,5 +0,0 @@
return {
cmd = { "nil" },
filetypes = { "nix" },
root_markers = { "flake.nix", ".git" },
}

View file

@ -1,153 +0,0 @@
function root_markers_with_field(root_files, new_names, field, fname)
local path = vim.fn.fnamemodify(fname, ":h")
local found = vim.fs.find(new_names, { path = path, upward = true })
for _, f in ipairs(found or {}) do
-- Match the given `field`.
for line in io.lines(f) do
if line:find(field) then
root_files[#root_files + 1] = vim.fs.basename(f)
break
end
end
end
return root_files
end
function insert_package_json(root_files, field, fname)
return root_markers_with_field(root_files, { "package.json", "package.json5" }, field, fname)
end
return {
cmd = { "tailwindcss-language-server", "--stdio" },
-- filetypes copied and adjusted from tailwindcss-intellisense
filetypes = {
-- html
"aspnetcorerazor",
"astro",
"astro-markdown",
"blade",
"clojure",
"django-html",
"htmldjango",
"edge",
"eelixir", -- vim ft
"elixir",
"ejs",
"erb",
"eruby", -- vim ft
"gohtml",
"gohtmltmpl",
"haml",
"handlebars",
"hbs",
"html",
"htmlangular",
"html-eex",
"heex",
"jade",
"leaf",
"liquid",
"markdown",
"mdx",
"mustache",
"njk",
"nunjucks",
"php",
"razor",
"slim",
"twig",
-- css
"css",
"less",
"postcss",
"sass",
"scss",
"stylus",
"sugarss",
-- js
"javascript",
"javascriptreact",
"reason",
"rescript",
"typescript",
"typescriptreact",
-- mixed
"vue",
"svelte",
"templ",
},
settings = {
tailwindCSS = {
validate = true,
lint = {
cssConflict = "warning",
invalidApply = "error",
invalidScreen = "error",
invalidVariant = "error",
invalidConfigPath = "error",
invalidTailwindDirective = "error",
recommendedVariantOrder = "warning",
},
classAttributes = {
"class",
"className",
"class:list",
"classList",
"ngClass",
},
includeLanguages = {
eelixir = "html-eex",
elixir = "phoenix-heex",
eruby = "erb",
heex = "phoenix-heex",
htmlangular = "html",
templ = "html",
},
},
},
before_init = function(_, config)
if not config.settings then
config.settings = {}
end
if not config.settings.editor then
config.settings.editor = {}
end
if not config.settings.editor.tabSize then
config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop()
end
end,
workspace_required = true,
root_dir = function(bufnr, on_dir)
local root_files = {
-- Generic
"tailwind.config.js",
"tailwind.config.cjs",
"tailwind.config.mjs",
"tailwind.config.ts",
"postcss.config.js",
"postcss.config.cjs",
"postcss.config.mjs",
"postcss.config.ts",
-- Phoenix
"assets/tailwind.config.js",
"assets/tailwind.config.cjs",
"assets/tailwind.config.mjs",
"assets/tailwind.config.ts",
-- Django
"theme/static_src/tailwind.config.js",
"theme/static_src/tailwind.config.cjs",
"theme/static_src/tailwind.config.mjs",
"theme/static_src/tailwind.config.ts",
"theme/static_src/postcss.config.js",
-- Rails
"app/assets/stylesheets/application.tailwind.css",
"app/assets/tailwind/application.css",
}
local fname = vim.api.nvim_buf_get_name(bufnr)
root_files = insert_package_json(root_files, "tailwindcss", fname)
root_files = root_markers_with_field(root_files, { "mix.lock" }, "tailwind", fname)
on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
end,
}

View file

@ -1,22 +0,0 @@
return {
cmd = { "typescript-language-server", "--stdio" },
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
},
root_markers = { "tsconfig.json", "package.json", ".git" },
init_options = {
hostInfo = "neovim",
preferences = {
includeCompletionsForModuleExports = true,
includeCompletionsForImportStatements = true,
importModuleSpecifierPreference = "relative",
importModuleSpecifierEnding = "minimal",
},
},
single_file_support = true,
}

View file

@ -1,10 +0,0 @@
local opts = { noremap = true, silent = true, expr = true }
-- Non-leader general keybindings
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", opts)
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", opts)
vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Move down" })
vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Move up" })
vim.keymap.set("n", "n", "nzzzv", { desc = "Move to next occurence" })
vim.keymap.set("n", "N", "Nzzzv", { desc = "Move to next occurence" })
vim.keymap.set("n", "<C-f>", "<Nop>")

View file

@ -1,80 +0,0 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.cmd([[colorscheme winterly]])
local options = {
backup = false, -- creates a backup file
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
cmdheight = 1, -- more space in the neovim command line for displaying messages
completeopt = { "menu", "menuone", "noselect" }, -- mostly just for cmp
conceallevel = 0, -- so that `` is visible in markdown files
fileencoding = "utf-8", -- the encoding written to a file
hlsearch = true, -- highlight all matches on previous search pattern
ignorecase = true, -- ignore case in search patterns
mouse = "a", -- allow the mouse to be used in neovim
pumheight = 10, -- pop up menu height
showmode = false, -- we don't need to see things like -- INSERT -- anymore
smartindent = true,
breakindent = true,
showtabline = 0, -- always show tabs
smartcase = true, -- smart case
splitbelow = true, -- force all horizontal splits to go below current window
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile
termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 600, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
updatetime = 230, -- faster completion (4000ms default)
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
expandtab = true, -- convert tabs to spaces
shiftwidth = 2, -- the number of spaces inserted for each indentation
tabstop = 2, -- insert 2 spaces for a tab
cursorline = true, -- highlight the current line
number = true, -- set numbered lines
relativenumber = true, -- set relative numbered lines
numberwidth = 4, -- set number column width to 2 {default 4}
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
linebreak = true,
breakat = " ^I!@*-+;:,./?",
scrolloff = 6, -- is one of my fav
sidescrolloff = 4,
winbar = nil,
foldlevel = 99,
foldlevelstart = 99,
}
vim.opt.shortmess:append("c")
for k, v in pairs(options) do
vim.opt[k] = v
end
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "winterly" } },
-- automatically check for plugin updates
checker = { enabled = false },
})

View file

@ -1,34 +0,0 @@
vim.lsp.enable("ts_ls")
vim.lsp.enable("lua_ls")
vim.lsp.enable("jsonls")
vim.lsp.enable("nil_ls")
vim.lsp.enable("astro")
vim.lsp.enable("tailwindcss")
vim.lsp.enable("gopls")
vim.lsp.enable("eslint")
vim.lsp.enable("biome")
vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = true,
update_in_insert = false,
severity_sort = false,
})
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
vim.keymap.set(
"n",
"<leader>e",
"<cmd>lua vim.diagnostic.open_float()<cr>",
{ buffer = args.buf, desc = "Show diagnostics on current line" }
)
vim.keymap.set(
"n",
"<leader>ca",
"<cmd>lua vim.lsp.buf.code_action()<cr>",
{ buffer = args.buf, desc = "Code actions for current line" }
)
end,
})

View file

@ -1 +0,0 @@
/nix/store/mp57l6qar04fcicsvmryl7fjzq6wwfmp-home-manager-files/.config/nvim/lua/dnsc/palette.lua

View file

@ -1,152 +0,0 @@
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
})
function tbl_flatten(t)
--- @diagnostic disable-next-line:deprecated
return nvim_eleven and vim.iter(t):flatten(math.huge):totable() or vim.tbl_flatten(t)
end
function search_ancestors(startpath, func)
if nvim_eleven then
validate("func", func, "function")
end
if func(startpath) then
return startpath
end
local guard = 100
for path in vim.fs.parents(startpath) do
-- Prevent infinite recursion if our algorithm breaks
guard = guard - 1
if guard == 0 then
return
end
if func(path) then
return path
end
end
end
local function escape_wildcards(path)
return path:gsub("([%[%]%?%*])", "\\%1")
end
function strip_archive_subpath(path)
-- Matches regex from zip.vim / tar.vim
path = vim.fn.substitute(path, "zipfile://\\(.\\{-}\\)::[^\\\\].*$", "\\1", "")
path = vim.fn.substitute(path, "tarfile:\\(.\\{-}\\)::.*$", "\\1", "")
return path
end
local function root_pattern(...)
local patterns = tbl_flatten({ ... })
return function(startpath)
startpath = strip_archive_subpath(startpath)
for _, pattern in ipairs(patterns) do
local match = search_ancestors(startpath, function(path)
for _, p in ipairs(vim.fn.glob(table.concat({ escape_wildcards(path), pattern }, "/"), true, true)) do
if vim.loop.fs_stat(p) then
return path
end
end
end)
if match ~= nil then
return match
end
end
end
end
local function filter(arr, fn)
if type(arr) ~= "table" then
return arr
end
local filtered = {}
for k, v in pairs(arr) do
if fn(v, k, arr) then
table.insert(filtered, v)
end
end
return filtered
end
local function filterReactDTS(value)
-- Depending on typescript version either uri or targetUri is returned
if value.uri then
return string.match(value.uri, "%.d.ts") == nil
elseif value.targetUri then
return string.match(value.targetUri, "%.d.ts") == nil
end
end
local project_types = {
["main.odin"] = "odin run .",
["package.json"] = "pnpm run dev",
["Makefile"] = "make",
["flake.nix"] = "sudo just deploy",
}
local function find_project_type()
for marker, _ in pairs(project_types) do
if vim.fn.glob(marker) ~= "" then
return marker
end
end
return nil
end
local function compile_project()
local marker = find_project_type()
if not marker then
vim.notify("No recognized project type found", vim.log.levels.WARN)
return
end
local cmd = project_types[marker]
-- Create a new terminal buffer and run the command
vim.cmd("botright new") -- Create new window at bottom
vim.cmd("terminal " .. cmd)
-- Enter normal mode and hide the buffer number
vim.cmd("setlocal nonumber")
vim.cmd("setlocal norelativenumber")
vim.cmd("startinsert")
end
local function root_markers_with_field(root_files, new_names, field, fname)
local path = vim.fn.fnamemodify(fname, ":h")
local found = vim.fs.find(new_names, { path = path, upward = true })
for _, f in ipairs(found or {}) do
-- Match the given `field`.
for line in io.lines(f) do
if line:find(field) then
root_files[#root_files + 1] = vim.fs.basename(f)
break
end
end
end
return root_files
end
local function insert_package_json(root_files, field, fname)
return root_markers_with_field(root_files, { "package.json", "package.json5" }, field, fname)
end
return {
compile_project = compile_project,
filter = filter,
filterReactDTS = filterReactDTS,
root_pattern = root_pattern,
insert_package_json = insert_package_json,
root_markers_with_field = root_markers_with_field,
}

View file

@ -1,49 +0,0 @@
return {
"saghen/blink.cmp",
dependencies = { "rafamadriz/friendly-snippets" },
version = "1.*",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
preset = "enter",
["<Tab>"] = { "select_next", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
["<C-k>"] = { "show_documentation", "hide_documentation" },
},
appearance = {
nerd_font_variant = "mono",
},
completion = {
documentation = {
auto_show = false,
},
list = {
selection = {
preselect = false,
auto_insert = true,
},
},
},
signature = {
enabled = true,
},
sources = {
default = { "lsp", "path", "snippets", "buffer" },
per_filetype = {
sql = { "dadbod" },
mysql = { "dadbod" },
plsql = { "dadbod" },
codecompanion = { "codecompanion" },
},
providers = {
dadbod = { module = "vim_dadbod_completion.blink" },
},
},
fuzzy = { implementation = "prefer_rust_with_warning" },
cmdline = {
completion = { menu = { auto_show = true } },
},
},
opts_extend = { "sources.default" },
}

View file

@ -1,26 +0,0 @@
return {
"olimorris/codecompanion.nvim",
config = function()
require("codecompanion").setup({
strategies = {
chat = {
adapter = "anthropic",
},
inline = {
adapter = "anthropic",
},
},
})
vim.cmd([[cab cc CodeCompanion]])
end,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
keys = {
{ "<leader>cc", "<cmd>CodeCompanionChat Toggle<cr>", desc = "Open companion chat", mode = "n" },
{ "<leader>ca", "<cmd>CodeCompanionActions<cr>", desc = "Open companion actions", mode = "n" },
{ "ga", "<cmd>CodeCompanionChat Add<cr>", desc = "Add selection", mode = "v" },
},
}

View file

@ -1,28 +0,0 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
typescriptreact = { "biome-check", "prettierd", stop_after_first = true },
astro = { "prettierd" },
typescript = { "biome-check", "prettierd", stop_after_first = true },
javascript = { "biome-check", "prettierd", stop_after_first = true },
javascriptreact = { "biome-check", "prettierd", stop_after_first = true },
html = { "prettierd" },
htmlangular = { "prettierd" },
css = { "biome-check", "prettierd", stop_after_first = true },
yaml = { "prettierd" },
markdown = { "prettierd" },
json = { "biome-check", "prettierd", stop_after_first = true },
lua = { "stylua" },
go = { "goimports" },
gomod = { "goimports" },
gowork = { "goimports" },
gotmpl = { "goimports" },
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_format = "fallback",
},
},
}

View file

@ -1,3 +0,0 @@
return {
"tpope/vim-dispatch",
}

View file

@ -1,25 +0,0 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
opts = {},
config = function()
vim.api.nvim_create_autocmd("BufReadPost", {
pattern = "quickfix",
callback = function()
vim.keymap.set("n", "<CR>", "<CR>", { buffer = true })
end,
})
end,
keys = {
{
"<CR>",
mode = { "n", "x", "o" },
function()
if vim.bo.filetype ~= "qf" then
require("flash").jump()
end
end,
desc = "Flash",
},
},
}

View file

@ -1,24 +0,0 @@
return {
"trevorhauter/gitportal.nvim",
opts = {
always_include_current_line = true,
switch_branch_or_commit_upon_ingestion = "ask_first",
},
keys = {
{
"<leader>gll",
"<cmd>GitPortal<cr>",
desc = "Browse file at git remote",
},
{
"<leader>gly",
"<cmd>GitPortal copy_link_to_clipboard<cr>",
desc = "Yank git link to clipboard",
},
{
"<leader>glo",
"<cmd>GitPortal open_link<cr>",
desc = "Browse file at git remote",
},
},
}

View file

@ -1,4 +0,0 @@
return {
"romainl/vim-cool",
"tpope/vim-sleuth",
}

View file

@ -1,78 +0,0 @@
local palette = require("dnsc.palette")
local modus_vivendi_tinted = {
normal = {
a = { bg = palette.magenta, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.magenta },
c = { bg = palette.bg_secondary, fg = palette.magenta },
},
insert = {
a = { bg = palette.cyan_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.cyan_bright },
c = { bg = palette.bg_secondary, fg = palette.cyan_bright },
},
visual = {
a = { bg = palette.blue_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.blue_bright },
c = { bg = palette.bg_secondary, fg = palette.blue_bright },
},
replace = {
a = { bg = palette.red_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.red_bright },
c = { bg = palette.bg_secondary, fg = palette.red_bright },
},
command = {
a = { bg = palette.green_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.green_bright },
c = { bg = palette.bg_secondary, fg = palette.green_bright },
},
inactive = {
a = { bg = palette.bg_secondary, fg = palette.fg_dim },
b = { bg = palette.bg_secondary, fg = palette.fg_dim },
c = { bg = palette.bg_secondary, fg = palette.fg_dim },
},
}
return {
"nvim-lualine/lualine.nvim",
opts = {
options = {
theme = modus_vivendi_tinted,
icons_enabled = false,
-- globalstatus = true
component_separators = { left = "|", right = "|" },
section_separators = { left = "", right = "" },
},
winbar = {},
sections = {
lualine_a = {
{
"mode",
fmt = function(str)
return str:sub(1, 1)
end,
},
},
lualine_b = {
{
"filename",
file_status = true,
newfile_status = false,
path = 1,
shorting_target = 120,
symbols = {
modified = "[+]", -- Text to show when the file is modified.
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
unnamed = "[No Name]", -- Text to show for unnamed buffers.
newfile = "[New]", -- Text to show for newly created file before first write
},
},
"encoding",
},
lualine_c = {},
lualine_x = {},
lualine_y = { "branch", "diff", "diagnostics" },
lualine_z = { "progress" },
},
},
}

View file

@ -1,7 +0,0 @@
return {
"jghauser/follow-md-links.nvim",
ft = { "markdown" },
config = function()
vim.keymap.set("n", "<bs>", ":edit #<cr>", { silent = true })
end,
}

View file

@ -1,4 +0,0 @@
return {
"echasnovski/mini.pairs",
opts = {},
}

View file

@ -1,6 +0,0 @@
return {
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
opts = {},
}

View file

@ -1,19 +0,0 @@
return {
"stevearc/oil.nvim",
opts = {
keymaps = {
["q"] = "actions.close",
},
columns = {
"icon",
"permissions",
"size",
"mtime",
},
},
-- stylua: ignore
keys = {
{ "<leader>n", "<cmd>Oil<cr>", desc = "Open file browser", mode = "n" },
}
,
}

View file

@ -1,3 +0,0 @@
return {
'b0o/schemastore.nvim'
}

View file

@ -1,217 +0,0 @@
---@module 'snacks'
local filter_lsp_definitions = function(item)
if item.file:match("/react/ts5.0/") or item.file:match("react.d.ts") then
return false
end
return true
end
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = {
bigfile = { enabled = true },
bufdelete = { enabled = true },
git = { enabled = true },
-- TODO: Integrate GH and see how that works out
-- gh = {
-- enabled = true
-- }
indent = {
enabled = true,
},
input = { enabled = true },
lazygit = {
enabled = true,
},
notifier = { enabled = true },
picker = {
enabled = true,
prompt = "λ ",
},
statuscolumn = { enabled = true },
zen = { enabled = true },
},
keys = {
-- Git
{
"<leader>gg",
function()
Snacks.lazygit()
end,
desc = "Lazygit",
},
{
"<leader>gb",
function()
Snacks.git.blame_line()
end,
desc = "Show git blame for current line",
},
-- Zen Mode
{
"<leader>z",
function()
Snacks.zen()
end,
desc = "Toggle Zen Mode",
},
-- Picker
{
"<leader>.",
function()
Snacks.picker.files({ hidden = true })
end,
desc = "Files",
},
{
"<leader>a",
function()
Snacks.picker.files({ hidden = true, ignored = true })
end,
desc = "All files",
},
{
"<leader><leader>",
function()
Snacks.picker.git_files()
end,
desc = "Git files",
},
-- Find
{
"<leader>fr",
function()
Snacks.picker.recent()
end,
desc = "Recent",
},
{
"<leader>fp",
function()
Snacks.picker.projects()
end,
desc = "Projects",
},
{
"<leader>bb",
function()
Snacks.picker.buffers()
end,
desc = "List buffers",
},
{
"<leader>bd",
function()
Snacks.bufdelete()
end,
desc = "Buffers",
},
{
"<leader>bD",
function()
Snacks.bufdelete.all()
end,
desc = "Buffers",
},
{
"<leader>bo",
function()
Snacks.bufdelete.other()
end,
desc = "Buffers",
},
-- Search
{
"<leader>ss",
function()
Snacks.picker.grep()
end,
desc = "Grep",
},
{
"<leader>sw",
function()
Snacks.picker.grep_word()
end,
desc = "Visual selection or word",
mode = { "n", "x" },
},
{
"<leader>su",
function()
Snacks.picker.undo()
end,
desc = "Undo History",
},
-- Diagnostics
{
"<leader>td",
function()
Snacks.picker.diagnostics_buffer()
end,
desc = "Buffer Diagnostics",
},
{
"<leader>ta",
function()
Snacks.picker.diagnostics()
end,
desc = "Diagnostics",
},
-- LSP
{
"gd",
function()
Snacks.picker.lsp_definitions({ filter = { filter = filter_lsp_definitions } })
end,
desc = "Goto Definition",
},
{
"gD",
function()
Snacks.picker.lsp_declarations()
end,
desc = "Goto Declaration",
},
{
"grr",
function()
Snacks.picker.lsp_references()
end,
nowait = true,
desc = "References",
},
{
"gI",
function()
Snacks.picker.lsp_implementations()
end,
desc = "Goto Implementation",
},
{
"gy",
function()
Snacks.picker.lsp_type_definitions()
end,
desc = "Goto T[y]pe Definition",
},
{
"<leader>on",
function()
Snacks.notifier.show_history()
end,
desc = "Open notification history",
},
{
"<leader>oh",
function()
Snacks.picker.highlights()
end,
desc = "List highlights",
},
},
}

View file

@ -1,13 +0,0 @@
return {
"gbprod/substitute.nvim",
config = function()
local sub = require("substitute")
sub.setup()
vim.keymap.set("n", "s", sub.operator, { noremap = true })
vim.keymap.set("n", "ss", sub.line, { noremap = true })
vim.keymap.set("n", "S", sub.eol, { noremap = true })
vim.keymap.set("x", "s", sub.visual, { noremap = true })
end,
}

View file

@ -1,100 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
opts = {
ensure_installed = {
"angular",
"bash",
"c",
"css",
"diff",
"html",
"javascript",
"jsdoc",
"json",
"jsonc",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"odin",
"go",
"goctl",
"gowork",
"gomod",
"gosum",
"gotmpl",
"printf",
"python",
"query",
"regex",
"toml",
"tsx",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
auto_install = true,
sync_install = false,
ignore_install = {},
modules = {},
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<c-space>",
node_incremental = "<c-space>",
scope_incremental = "<c-s>",
node_decremental = "<M-space>",
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
},
},
}

View file

@ -1,153 +0,0 @@
local utils = require("dnsc.utils")
return {
"folke/which-key.nvim",
event = "VeryLazy",
config = function()
local wk = require("which-key")
---@class wk.Opts
local opts = {
icons = { mappings = false },
win = { border = "rounded" },
}
wk.setup(opts)
wk.add({
{ "<leader>o", group = "+open", mode = "n" },
{
"<leader>od",
"<cmd>vsplit | lua vim.lsp.buf.definition()<cr>",
desc = "Go to definition in other window",
mode = "n",
},
{ "<leader>b", group = "+buffer", mode = "n" },
{
"<leader>bn",
"<Cmd>bn<CR>",
desc = "Move to next buffer",
mode = "n",
},
{
"<leader>bp",
"<Cmd>bp<CR>",
desc = "Move to previous buffer",
mode = "n",
},
{
"<leader>bk",
"<Cmd>bn<CR>",
desc = "Kill buffer and window",
mode = "n",
},
{ "<leader>c", group = "+code", mode = "n" },
{
"<leader>cr",
function()
utils.compile_project()
end,
desc = "Compile project",
mode = "n",
},
{ "<leader>f", group = "+file", mode = "n" },
{
"<leader>fn",
"<cmd>enew<cr>",
desc = "Create a new file",
mode = "n",
},
{
"<leader>fs",
"<cmd>w<cr>",
desc = "Save currently opened file",
mode = "n",
},
{ "<leader>qq", "<cmd>qa!<cr>", desc = "Leave neovim", mode = "n" },
{ "<leader>s", group = "+search", mode = "n" },
{ "<leader>g", group = "+git", mode = "n" },
{ "<leader>t", group = "+diagnostics", mode = "n" },
{ "<leader>ta", "<cmd>TodoQuickFix<cr>", desc = "Show all todo comments", mode = "n" },
{ "<leader>w", group = "+window", mode = "n" },
{
"<leader>w+",
":vertical resize +4<CR>",
desc = "Increase window size",
mode = "n",
},
{
"<leader>w-",
":vertical resize -4<CR>",
desc = "Decrease window size",
mode = "n",
},
{
"<leader>wx",
"<C-W>q",
desc = "Close active window",
mode = "n",
},
{
"<leader>wx",
":bd<CR>",
desc = "Kill active window and buffer",
mode = "n",
},
{
"<leader>wh",
"<C-W>h",
desc = "Move to window on left",
mode = "n",
},
{
"<leader>wj",
"<C-W>j",
desc = "Move to window on bottom",
mode = "n",
},
{
"<leader>wk",
"<C-W>k",
desc = "Move to window on top",
mode = "n",
},
{
"<leader>wl",
"<C-W>l",
desc = "Move to window on right",
mode = "n",
},
{
"<leader>ws",
"<cmd>sp<cr>",
desc = "Split windows horizontally",
mode = "n",
},
{
"<leader>wv",
"<cmd>vsp<cr>",
desc = "Split windows vertically",
mode = "n",
},
{
"<leader>wd",
"<cmd>close<cr>",
desc = "Delete window only",
mode = "n",
},
{ "<leader>x", group = "+config", mode = "n" },
{
"<leader>xn",
"<cmd>set number relativenumber<cr>",
desc = "Show relative numbers",
mode = "n",
},
{ "<leader>xr", "<cmd>source $MYVIMRC<cr>", desc = "Reload config", mode = "n" },
})
end,
}

View file

@ -1,9 +0,0 @@
column_width = 120
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "Always"
collapse_simple_statement = "Never"
[sort_requires]
enabled = false

View file

@ -1,9 +0,0 @@
{ config, ... }:
{
xdg.configFile."nvim" = {
# mkOutOfStoreSymlink needs an absolute path, otherwise it does not work: https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685
# TODO: At least make the location of the config folder dynamic so that it works on other machines
source = config.lib.file.mkOutOfStoreSymlink /home/deck/dev/nix-config/modules/nvim/config;
};
}

View file

@ -1,25 +0,0 @@
{
pkgs,
config,
lib,
...
}:
{
xdg.configFile."nvim" = {
# mkOutOfStoreSymlink needs an absolute path, otherwise it does not work: https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/nvim/config";
};
home.packages = lib.mkAfter (
with pkgs;
[
# Some devtools not included in project
# flakes
stylua
lua-language-server
nil
tree-sitter
]
);
}

View file

@ -1,12 +0,0 @@
{
services.openssh = {
enable = true;
settings = {
X11Forwarding = false;
PermitRootLogin = "no";
PasswordAuthentication = false;
};
openFirewall = true;
};
}

Some files were not shown because too many files have changed in this diff Show more