Merge branch 'feat/dendritic'
This commit is contained in:
commit
a5e20a6a75
219 changed files with 4322 additions and 9005 deletions
431
AGENTS.md
431
AGENTS.md
|
|
@ -1,276 +1,245 @@
|
||||||
# Agent Guide for nix-config
|
# AGENTS.md — nix-config
|
||||||
|
|
||||||
This document provides guidelines for AI coding agents working in this Nix configuration repository.
|
Personal NixOS/nix-darwin configuration using flake-parts, import-tree, home-manager, and nixvim.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Repository Overview
|
## 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 # Thin entry: delegates to import-tree ./modules
|
||||||
├── flake.nix # Main flake configuration
|
Justfile # Task runner (deploy, dry-run, update, gc, etc.)
|
||||||
├── Justfile # Common build/deploy commands
|
modules/
|
||||||
├── hosts/ # Host-specific configurations
|
config.nix # flake-parts options schema (flake.modules, flake.globalConfig)
|
||||||
│ ├── dnsc-air/
|
systems.nix # Supported systems list
|
||||||
│ ├── dnsc-work/
|
hosts/
|
||||||
│ ├── dnsc-server/
|
dnsc-machine/ # Only active NixOS host (x86_64-linux)
|
||||||
│ └── dnsc-vps-sm/
|
base/ # macOS system defaults + NixOS locale/boot/user base
|
||||||
├── home/ # Home-manager configurations
|
<feature>/ # One directory per feature module
|
||||||
│ ├── darwin.nix
|
default.nix # Always the primary file
|
||||||
│ ├── darwin-work.nix
|
_sub-module.nix # Underscore-prefixed for large module splits
|
||||||
│ ├── linux.nix
|
|
||||||
│ ├── server.nix
|
|
||||||
│ └── deck.nix
|
|
||||||
├── modules/ # Reusable modules
|
|
||||||
│ ├── base/
|
|
||||||
│ ├── fish/
|
|
||||||
│ ├── git/
|
|
||||||
│ ├── nixvim/
|
|
||||||
│ └── [40+ other modules]
|
|
||||||
└── secrets/ # agenix encrypted secrets
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Build Commands
|
`import-tree` auto-discovers every `.nix` file under `modules/` — **no manual imports list in flake.nix**.
|
||||||
|
New modules are picked up automatically; just create `modules/<name>/default.nix`.
|
||||||
|
|
||||||
### Validation and Testing
|
---
|
||||||
```bash
|
|
||||||
# Check flake evaluates correctly
|
|
||||||
nix flake check
|
|
||||||
|
|
||||||
# Show flake metadata
|
## Build / Validation Commands
|
||||||
nix flake show
|
|
||||||
|
|
||||||
# Update flake inputs
|
There is no CI and no `nix fmt`/`nix flake check` target configured.
|
||||||
just up
|
|
||||||
|
|
||||||
# Update specific input
|
| Goal | Command |
|
||||||
just upi i=home-manager
|
|---|---|
|
||||||
|
| Deploy to host | `just deploy <host>` (`sudo nixos-rebuild switch --flake .#<host>`) |
|
||||||
|
| Deploy with trace | `just debug <host>` (adds `--show-trace --verbose`) |
|
||||||
|
| Dry-run build | `just dry <host>` — evaluates the closure without realising it |
|
||||||
|
| Update all inputs | `just update` (`nix flake update`) |
|
||||||
|
| Garbage collect | `just gc` (`sudo nix-collect-garbage --delete-old`) |
|
||||||
|
| Wipe old profiles | `just clean` (removes profiles older than 7 days) |
|
||||||
|
| NixOS REPL | `just repl` |
|
||||||
|
|
||||||
|
**Only active host:** `dnsc-machine`
|
||||||
|
|
||||||
|
```
|
||||||
|
just dry dnsc-machine # fastest sanity check — no sudo required
|
||||||
|
just deploy dnsc-machine
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deployment
|
There are no unit tests or `checks` outputs. Validation = dry-run build succeeds + manual deploy.
|
||||||
|
|
||||||
**macOS (darwin-rebuild):**
|
**Linting tools available** (installed as system packages): `nil` (LSP), `statix` (linter).
|
||||||
```bash
|
Run `statix check .` to lint Nix files for common anti-patterns.
|
||||||
# Deploy to current macOS host
|
|
||||||
just mre
|
|
||||||
|
|
||||||
# Deploy with lock file recreation
|
---
|
||||||
just mup
|
|
||||||
|
|
||||||
# Manual deployment
|
## Flake Architecture
|
||||||
darwin-rebuild switch --flake .
|
|
||||||
|
```
|
||||||
|
inputs.flake-parts → mkFlake framework
|
||||||
|
inputs.import-tree → auto-loads modules/
|
||||||
|
inputs.nixpkgs → nixpkgs-unstable (channel tarball URL, not github:)
|
||||||
|
inputs.home-manager → follows nixpkgs
|
||||||
|
inputs.nix-darwin → LnL7/nix-darwin master
|
||||||
|
inputs.nixvim → nix-community/nixvim
|
||||||
|
inputs.helium → custom browser flake
|
||||||
|
inputs.dms → DankMaterialShell (COSMIC alternative desktop)
|
||||||
```
|
```
|
||||||
|
|
||||||
**NixOS (nixos-rebuild):**
|
**Custom flake-parts options** (defined in `modules/config.nix`):
|
||||||
```bash
|
- `flake.modules.nixos.<name>` — NixOS system modules
|
||||||
# Deploy NixOS configuration
|
- `flake.modules.darwin.<name>` — nix-darwin system modules
|
||||||
just deploy
|
- `flake.modules.homeManager.<name>` — home-manager user modules
|
||||||
|
- `flake.globalConfig.{username,fullname,email}` — shared personal values
|
||||||
|
|
||||||
# Deploy with debug output
|
---
|
||||||
just debug
|
|
||||||
|
|
||||||
# Manual deployment
|
## Module Pattern
|
||||||
nixos-rebuild switch --flake .
|
|
||||||
```
|
|
||||||
|
|
||||||
**Steam Deck (home-manager):**
|
Every feature lives in `modules/<feature>/default.nix` and registers itself into the module registry.
|
||||||
```bash
|
Host configs (`modules/hosts/<name>/default.nix`) opt in by listing modules explicitly.
|
||||||
# Deploy to Steam Deck
|
|
||||||
just dre
|
|
||||||
|
|
||||||
# Manual deployment
|
### Standard tri-layer module
|
||||||
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
|
```nix
|
||||||
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
config,
|
flake.modules.nixos.<name> =
|
||||||
inputs,
|
{ pkgs, ... }:
|
||||||
outputs,
|
{
|
||||||
lib,
|
# NixOS system-level config
|
||||||
pkgs,
|
home-manager.sharedModules = [
|
||||||
...
|
inputs.self.modules.homeManager.<name>
|
||||||
}:
|
];
|
||||||
{
|
};
|
||||||
imports = [
|
|
||||||
# List imports first
|
|
||||||
];
|
|
||||||
|
|
||||||
# Configuration follows
|
flake.modules.darwin.<name> =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
# nix-darwin system-level config
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
inputs.self.modules.homeManager.<name>
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.homeManager.<name> =
|
||||||
|
{ pkgs, config, ... }:
|
||||||
|
{
|
||||||
|
# home-manager user-level config
|
||||||
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Formatting:**
|
### System-only module (no HM layer)
|
||||||
- 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
|
```nix
|
||||||
# In flake.nix
|
{ ... }:
|
||||||
inputs.home-manager.nixosModules.home-manager
|
{
|
||||||
|
flake.modules.nixos.<name> =
|
||||||
# In configuration files
|
{ pkgs, ... }:
|
||||||
outputs.nixosModules.base
|
{
|
||||||
../../modules/docker
|
# NixOS config only, e.g. bluetooth, printing, gaming
|
||||||
./hardware-configuration.nix
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Package Management:**
|
### Sub-module splitting (for large modules like neovim)
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# System packages
|
flake.modules.homeManager.neovim =
|
||||||
environment.systemPackages = with pkgs; [
|
{ pkgs, ... }:
|
||||||
git
|
{
|
||||||
btop
|
imports = [
|
||||||
neovim
|
./_options.nix
|
||||||
];
|
./_lsp.nix
|
||||||
|
./_formatter.nix
|
||||||
# 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:**
|
### Host definition pattern
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
services.syncthing = {
|
{ inputs, config, ... }:
|
||||||
enable = true;
|
let
|
||||||
user = "dennis";
|
hostname = "dnsc-machine";
|
||||||
configDir = "/home/dennis/.config/syncthing";
|
in
|
||||||
# ... additional settings
|
{
|
||||||
};
|
flake.nixosConfigurations.dnsc-machine = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = with config.flake.modules.nixos; [
|
||||||
|
home-manager
|
||||||
|
base
|
||||||
|
shell
|
||||||
|
# ... feature modules by name
|
||||||
|
{
|
||||||
|
imports = [ ./_hardware-configuration.nix ];
|
||||||
|
networking.hostName = hostname;
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Secrets with agenix:**
|
---
|
||||||
|
|
||||||
|
## Code Style
|
||||||
|
|
||||||
|
### Formatting
|
||||||
|
|
||||||
|
- **2-space indentation** throughout, no tabs
|
||||||
|
- Opening brace on the same line as the attribute/binding
|
||||||
|
- Closing brace on its own line
|
||||||
|
- No trailing commas in attribute sets or lists (standard Nix)
|
||||||
|
- Multi-line function arguments use the exploded form:
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
```
|
||||||
|
Short arg lists use the inline form: `{ pkgs, ... }:`
|
||||||
|
|
||||||
|
### Inline embedded languages
|
||||||
|
|
||||||
|
Use language comments to enable editor syntax highlighting inside multiline Nix strings:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
age = {
|
interactiveShellInit = /* fish */ ''
|
||||||
identityPaths = [ "${config.users.users.dennis.home}/.ssh/id_ed25519" ];
|
fish_vi_key_bindings insert
|
||||||
secrets."restic/password".file = ../../secrets/restic/password.age;
|
'';
|
||||||
};
|
|
||||||
|
extraConfig = /* lua */ ''
|
||||||
|
vim.opt.number = true
|
||||||
|
'';
|
||||||
```
|
```
|
||||||
|
|
||||||
### Fish Shell Functions
|
### Naming conventions
|
||||||
|
|
||||||
|
| Thing | Convention | Example |
|
||||||
|
|---|---|---|
|
||||||
|
| Module directories | `kebab-case` | `cli-tools/`, `nvidia-graphics/` |
|
||||||
|
| Primary module file | `default.nix` | every feature dir |
|
||||||
|
| Sub-module files | `_kebab-case.nix` (underscore prefix) | `_lsp.nix`, `_formatter.nix` |
|
||||||
|
| Hardware config | `_hardware-configuration.nix` | matches sub-module style |
|
||||||
|
| `flake.modules.nixos.*` keys | `kebab-case` | `flake.modules.nixos.cli-tools` |
|
||||||
|
| `flake.modules.homeManager.*` keys | `kebab-case` name, `homeManager` namespace | `flake.modules.homeManager.shell` |
|
||||||
|
| `let` bindings | `camelCase` | `hmConfig`, `commonPackages` |
|
||||||
|
| Host names | `kebab-case` with owner prefix | `dnsc-machine`, `dnsc-server` |
|
||||||
|
| Fish functions | `snake_case` | `fish_greeting`, `tmux_sessionizer` |
|
||||||
|
| Fish abbrs | short lowercase | `lg`, `gg`, `g` |
|
||||||
|
|
||||||
|
### Attribute ordering
|
||||||
|
|
||||||
|
In NixOS/HM options, follow upstream conventions:
|
||||||
|
- `enable = true;` first
|
||||||
|
- then primary config attributes
|
||||||
|
- then nested option sets
|
||||||
|
|
||||||
|
### No conditional feature flags
|
||||||
|
|
||||||
|
Feature modules do **not** use `mkEnableOption`/`mkIf`. Everything in a module is unconditionally enabled when that module is included in a host's modules list. Opt-in/opt-out happens at the host level by adding or removing the module name.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Adding a New Feature Module
|
||||||
|
|
||||||
|
1. Create `modules/<feature>/default.nix`
|
||||||
|
2. Define `flake.modules.nixos.<feature>` and/or `flake.modules.homeManager.<feature>`
|
||||||
|
3. To activate on a host, add `<feature>` to the `modules = with config.flake.modules.nixos; [ ... ]` list in the host's `default.nix`
|
||||||
|
4. No registration in `flake.nix` needed — `import-tree` picks it up automatically
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Commit Style
|
||||||
|
|
||||||
|
Lowercase, brief, imperative — no conventional-commits prefix required:
|
||||||
|
|
||||||
**Function Style:**
|
|
||||||
```nix
|
|
||||||
functions = {
|
|
||||||
function_name = /* fish */ ''
|
|
||||||
# Fish shell code here
|
|
||||||
echo "example"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
```
|
```
|
||||||
|
add bluetooth module
|
||||||
**Inline Comments:**
|
fix cli tools config
|
||||||
Use `/* fish */` or `/* bash */` before multi-line strings to indicate language
|
remove gtk handling
|
||||||
|
update nixpkgs input
|
||||||
## 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
|
|
||||||
|
|
|
||||||
26
Justfile
26
Justfile
|
|
@ -1,16 +1,17 @@
|
||||||
deploy:
|
deploy:
|
||||||
nixos-rebuild switch --flake .
|
nixos-rebuild switch --flake .
|
||||||
|
|
||||||
|
dd:
|
||||||
|
darwin-rebuild switch --flake .
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
nixos-rebuild switch --flake . --show-trace --verbose
|
nixos-rebuild switch --flake . --show-trace --verbose
|
||||||
|
|
||||||
up:
|
dry host:
|
||||||
nix flake update
|
nix build .#nixosConfigurations.{{host}}.config.system.build.toplevel --dry-run --no-link
|
||||||
|
|
||||||
# Update specific input
|
update:
|
||||||
# usage: make upi i=home-manager
|
nix flake update
|
||||||
upi:
|
|
||||||
nix flake update $(i)
|
|
||||||
|
|
||||||
history:
|
history:
|
||||||
nix profile history --profile /nix/var/nix/profiles/system
|
nix profile history --profile /nix/var/nix/profiles/system
|
||||||
|
|
@ -19,18 +20,7 @@ repl:
|
||||||
nix repl -f flake:nixpkgs
|
nix repl -f flake:nixpkgs
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
||||||
|
|
||||||
gc:
|
gc:
|
||||||
sudo nix-collect-garbage --delete-old
|
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
|
|
||||||
|
|
|
||||||
29
README.md
29
README.md
|
|
@ -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`)
|
|
||||||
350
flake.lock
generated
350
flake.lock
generated
|
|
@ -60,27 +60,49 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"firefox-addons": {
|
"dms": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"quickshell": "quickshell"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "pkgs/firefox-addons",
|
"lastModified": 1772034342,
|
||||||
"lastModified": 1772078860,
|
"narHash": "sha256-InX8kRyrpVL+MP/gW1qhH9tGtDx2z2gmJ9NfmvUJ35I=",
|
||||||
"narHash": "sha256-Pojf7QHic9RmZFIoWYx5LoHy1UytoOHuGnLH3U5Nipo=",
|
"owner": "AvengeMedia",
|
||||||
"owner": "rycee",
|
"repo": "DankMaterialShell",
|
||||||
"repo": "nur-expressions",
|
"rev": "47b12d09fc8526f9c231de60848a41b5990b4a37",
|
||||||
"rev": "ae41eb07a37d1d5cd7b5714df0fbcb315c492e4d",
|
"type": "github"
|
||||||
"type": "gitlab"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"dir": "pkgs/firefox-addons",
|
"owner": "AvengeMedia",
|
||||||
"owner": "rycee",
|
"ref": "stable",
|
||||||
"repo": "nur-expressions",
|
"repo": "DankMaterialShell",
|
||||||
"type": "gitlab"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"nixpkgs-lib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1772408722,
|
||||||
|
"narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"nixvim",
|
"nixvim",
|
||||||
|
|
@ -101,6 +123,27 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"helium": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"utils": "utils"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1772003810,
|
||||||
|
"narHash": "sha256-FfaHvYDfcWZ+0ZPkWDVywkglmQjBq0DoIqzl7TH2hXc=",
|
||||||
|
"owner": "schembriaiden",
|
||||||
|
"repo": "helium-browser-nix-flake",
|
||||||
|
"rev": "9001c8ec8bb3a4b9103eca2f2fc707bda1401977",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "schembriaiden",
|
||||||
|
"repo": "helium-browser-nix-flake",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -129,11 +172,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772060133,
|
"lastModified": 1772516620,
|
||||||
"narHash": "sha256-VuyRptb8v1lVGMlLp4/1vRX3Efwec0CN0S6mKmDPzLg=",
|
"narHash": "sha256-2r4cKdqCVlQkvcTcLUMxmsmAYZZxCMd//w/PnDnukTE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "ce9b6e52500a0ea0ec48f0bbf6d7a3e431d9dfa4",
|
"rev": "2b9504d5a0169d4940a312abe2df2c5658db8de9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -142,42 +185,18 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager_3": {
|
"import-tree": {
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"zen-browser",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771756436,
|
"lastModified": 1772344373,
|
||||||
"narHash": "sha256-Tl2I0YXdhSTufGqAaD1ySh8x+cvVsEI1mJyJg12lxhI=",
|
"narHash": "sha256-OQQ1MhB9t1J71b2wxRRTdH/Qd8UGG0p+dGspfCf5U1c=",
|
||||||
"owner": "nix-community",
|
"owner": "vic",
|
||||||
"repo": "home-manager",
|
"repo": "import-tree",
|
||||||
"rev": "5bd3589390b431a63072868a90c0f24771ff4cbb",
|
"rev": "10fda59eee7d7970ec443b925f32a1bc7526648c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "vic",
|
||||||
"repo": "home-manager",
|
"repo": "import-tree",
|
||||||
"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"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -188,11 +207,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771992996,
|
"lastModified": 1772379624,
|
||||||
"narHash": "sha256-Y/ijH/unOPxzUicbla6yT/14RJgubUWnY2I2A6Ast2Q=",
|
"narHash": "sha256-NG9LLTWlz4YiaTAiRGChbrzbVxBfX+Auq4Ab/SWmk4A=",
|
||||||
"owner": "LnL7",
|
"owner": "LnL7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "3bfa436c1975674ca465ce34586467be301ff509",
|
"rev": "52d061516108769656a8bd9c6e811c677ec5b462",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -236,67 +255,20 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1771903837,
|
|
||||||
"narHash": "sha256-sdaqdnsQCv3iifzxwB22tUwN/fSHoN7j2myFW5EIkGk=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-25.11",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744536153,
|
"lastModified": 1772525000,
|
||||||
"narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
|
"narHash": "sha256-JVA3N5t5II0xI9+sJ44UgaN6tMrZGOox0w2xZzKYt9Q=",
|
||||||
"owner": "nixos",
|
"rev": "72b1d820cb0149b40a35aa077b4b6d60cd1b23c3",
|
||||||
"repo": "nixpkgs",
|
"type": "tarball",
|
||||||
"rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
|
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre957475.72b1d820cb01/nixexprs.tar.xz"
|
||||||
"type": "github"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"type": "tarball",
|
||||||
"ref": "nixpkgs-unstable",
|
"url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 0,
|
|
||||||
"narHash": "sha256-US1tAChvPxT52RV8GksWZS415tTS7PV42KTc2PNDBmc=",
|
|
||||||
"path": "/nix/store/aa0zsahvyqnvzkicsh29jirm9hwv95pg-source",
|
|
||||||
"type": "path"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"id": "nixpkgs",
|
|
||||||
"type": "indirect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_4": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1771923393,
|
|
||||||
"narHash": "sha256-Fy0+UXELv9hOE8WjYhJt8fMDLYTU2Dqn3cX4BwoGBos=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "ea7f1f06811ce7fcc81d6c6fd4213150c23edcf2",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_5": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770380644,
|
"lastModified": 1770380644,
|
||||||
"narHash": "sha256-P7dWMHRUWG5m4G+06jDyThXO7kwSk46C1kgjEWcybkE=",
|
"narHash": "sha256-P7dWMHRUWG5m4G+06jDyThXO7kwSk46C1kgjEWcybkE=",
|
||||||
|
|
@ -312,62 +284,18 @@
|
||||||
"type": "github"
|
"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": 1771369470,
|
|
||||||
"narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "0182a361324364ae3f436a63005877674cf45efb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixvim": {
|
"nixvim": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts_2",
|
||||||
"nixpkgs": "nixpkgs_5",
|
"nixpkgs": "nixpkgs_3",
|
||||||
"systems": "systems_2"
|
"systems": "systems_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771135771,
|
"lastModified": 1772402258,
|
||||||
"narHash": "sha256-wyvBIhDuyCRyjB3yPg77qoyxrlgQtBR1rVW3c9knV3E=",
|
"narHash": "sha256-3DmCFOdmbkFML1/G9gj8Wb+rCCZFPOQtNoMCpqOF8SA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "ed0424f0b08d303a7348f52f7850ad1b2704f9ba",
|
"rev": "21ae25e13b01d3b4cdc750b5f9e7bad68b150c10",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -376,7 +304,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"noctalia": {
|
"paneru": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
|
@ -384,72 +312,57 @@
|
||||||
"noctalia-qs": "noctalia-qs"
|
"noctalia-qs": "noctalia-qs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772119551,
|
"lastModified": 1772734644,
|
||||||
"narHash": "sha256-3drUXfTGL2tIMliI8Qr2ISdkNThu8cOSHkkcC3clJUM=",
|
"narHash": "sha256-+vmK3OBNboX4LBxlC+1gYvnofko6/dxvc0Dx3UYGTuo=",
|
||||||
"owner": "noctalia-dev",
|
"owner": "karinushka",
|
||||||
"repo": "noctalia-shell",
|
"repo": "paneru",
|
||||||
"rev": "49e1642830c090bef1e65fc84fdc861ec79d6522",
|
"rev": "0a2b802eb5d922ca726901b71d6e813f779ae0d2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "noctalia-dev",
|
"owner": "karinushka",
|
||||||
"repo": "noctalia-shell",
|
"repo": "paneru",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"noctalia-qs": {
|
"quickshell": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"noctalia",
|
"dms",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771796397,
|
"lastModified": 1766725085,
|
||||||
"narHash": "sha256-lbZkAMNQl5Ymqhdvp46K8hubZ7n7KQRPnTP5bNJzMSk=",
|
"narHash": "sha256-O2aMFdDUYJazFrlwL7aSIHbUSEm3ADVZjmf41uBJfHs=",
|
||||||
"owner": "noctalia-dev",
|
"ref": "refs/heads/master",
|
||||||
"repo": "noctalia-qs",
|
"rev": "41828c4180fb921df7992a5405f5ff05d2ac2fff",
|
||||||
"rev": "1711c5a20b74a31b703394164c5d2d9561f13ee9",
|
"revCount": 715,
|
||||||
"type": "github"
|
"type": "git",
|
||||||
|
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "noctalia-dev",
|
"rev": "41828c4180fb921df7992a5405f5ff05d2ac2fff",
|
||||||
"repo": "noctalia-qs",
|
"type": "git",
|
||||||
"type": "github"
|
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"firefox-addons": "firefox-addons",
|
"dms": "dms",
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"helium": "helium",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"ip-whitelist": "ip-whitelist",
|
"import-tree": "import-tree",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nix-homebrew": "nix-homebrew",
|
"nix-homebrew": "nix-homebrew",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-lib": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
"noctalia": "noctalia",
|
"paneru": "paneru"
|
||||||
"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": {
|
"systems": {
|
||||||
|
|
@ -497,42 +410,21 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zellij-switch": {
|
"utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_6",
|
"systems": "systems_2"
|
||||||
"rust-overlay": "rust-overlay",
|
|
||||||
"systems": "systems_3"
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742588229,
|
"lastModified": 1731533236,
|
||||||
"narHash": "sha256-IPg0pBw0ciF+xl6viq3nK+dvZoDZrfBDui7dkPLz258=",
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
"owner": "mostafaqanbaryan",
|
"owner": "numtide",
|
||||||
"repo": "zellij-switch",
|
"repo": "flake-utils",
|
||||||
"rev": "0e3c303c19890ccb03589230ac5a7c4307e573e4",
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "mostafaqanbaryan",
|
"owner": "numtide",
|
||||||
"repo": "zellij-switch",
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"zen-browser": {
|
|
||||||
"inputs": {
|
|
||||||
"home-manager": "home-manager_3",
|
|
||||||
"nixpkgs": "nixpkgs_8"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1772085492,
|
|
||||||
"narHash": "sha256-1o9qkvOI/ThFDgEbW4Q4GVK7aV+traAIWSqP7gom7/0=",
|
|
||||||
"owner": "0xc000022070",
|
|
||||||
"repo": "zen-browser-flake",
|
|
||||||
"rev": "6577a70551b52ef35138e5d8b87a35d40b14eeeb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "0xc000022070",
|
|
||||||
"repo": "zen-browser-flake",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
123
flake.nix
123
flake.nix
|
|
@ -1,109 +1,40 @@
|
||||||
{
|
{
|
||||||
description = "dnsc-server NixOS flake";
|
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
agenix.url = "github:ryantm/agenix";
|
flake-parts = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
inputs.nixpkgs-lib.follows = "nixpkgs-lib";
|
||||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11";
|
url = "github:hercules-ci/flake-parts";
|
||||||
|
};
|
||||||
home-manager = {
|
home-manager = {
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
|
};
|
||||||
|
import-tree.url = "github:vic/import-tree";
|
||||||
|
nix-darwin = {
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
url = "github:LnL7/nix-darwin/master";
|
||||||
|
};
|
||||||
|
helium = {
|
||||||
|
url = "github:schembriaiden/helium-browser-nix-flake";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nix-darwin.url = "github:LnL7/nix-darwin/master";
|
nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
|
||||||
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
nixpkgs-lib.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";
|
nixvim.url = "github:nix-community/nixvim";
|
||||||
noctalia = {
|
agenix.url = "github:ryantm/agenix";
|
||||||
url = "github:noctalia-dev/noctalia-shell";
|
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
|
||||||
|
paneru = {
|
||||||
|
url = "github:karinushka/paneru";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
dms = {
|
||||||
|
url = "github:AvengeMedia/DankMaterialShell/stable";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{
|
inputs:
|
||||||
self,
|
inputs.flake-parts.lib.mkFlake {
|
||||||
nixpkgs,
|
inherit inputs;
|
||||||
home-manager,
|
} (inputs.import-tree ./modules);
|
||||||
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 ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 ];
|
|
||||||
}
|
|
||||||
|
|
@ -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 ];
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
118
home/linux.nix
118
home/linux.nix
|
|
@ -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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
|
|
@ -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"; };
|
|
||||||
}
|
|
||||||
|
|
@ -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"
|
|
||||||
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
programs.atuin = {
|
|
||||||
enable = true;
|
|
||||||
enableBashIntegration = false;
|
|
||||||
enableFishIntegration = false;
|
|
||||||
settings = {
|
|
||||||
style = "compact";
|
|
||||||
inline_height = 20;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,57 +1,124 @@
|
||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
username = config.flake.globalConfig.username;
|
||||||
|
fullname = config.flake.globalConfig.fullname;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
pkgs,
|
flake.modules.darwin.base =
|
||||||
inputs,
|
{ pkgs, ... }:
|
||||||
...
|
{
|
||||||
}:
|
users.users.${username} = {
|
||||||
|
home = "/Users/${username}";
|
||||||
|
description = fullname;
|
||||||
|
};
|
||||||
|
|
||||||
{
|
system = {
|
||||||
nix = {
|
primaryUser = username;
|
||||||
channel.enable = false;
|
stateVersion = 5;
|
||||||
package = pkgs.nix;
|
activationScripts.postActivation.text = ''
|
||||||
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
||||||
settings = {
|
'';
|
||||||
experimental-features = [
|
|
||||||
"nix-command"
|
defaults = {
|
||||||
"flakes"
|
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/Nix Apps/Helium.app"
|
||||||
|
"/Applications/Ghostty.app"
|
||||||
|
"/System/Applications/System Settings.app/"
|
||||||
|
];
|
||||||
|
persistent-others = [
|
||||||
|
"/Users/${username}/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/${username}/Downloads";
|
||||||
|
target = "file";
|
||||||
|
};
|
||||||
|
|
||||||
|
spaces.spans-displays = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
security.pam.services.sudo_local.touchIdAuth = true;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs = {
|
flake.modules.nixos.base =
|
||||||
config = {
|
{ pkgs, ... }:
|
||||||
allowUnfree = true;
|
{
|
||||||
allowUnsupportedSystem = true;
|
boot.loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
time.timeZone = "Europe/Berlin";
|
||||||
|
i18n = {
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "de_DE.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||||
|
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||||
|
LC_MONETARY = "de_DE.UTF-8";
|
||||||
|
LC_NAME = "de_DE.UTF-8";
|
||||||
|
LC_NUMERIC = "de_DE.UTF-8";
|
||||||
|
LC_PAPER = "de_DE.UTF-8";
|
||||||
|
LC_TELEPHONE = "de_DE.UTF-8";
|
||||||
|
LC_TIME = "de_DE.UTF-8";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
security.sudo.enable = true;
|
||||||
|
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
};
|
||||||
|
programs.mtr.enable = true;
|
||||||
|
|
||||||
|
services.xserver.xkb.layout = "eu";
|
||||||
|
services.openssh.enable = true;
|
||||||
|
services.udisks2.enable = true;
|
||||||
|
|
||||||
|
users.users."${username}" = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [
|
||||||
|
"networkmanager"
|
||||||
|
"wheel"
|
||||||
|
];
|
||||||
|
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"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
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
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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})'
|
|
||||||
|
|
@ -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
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
23
modules/bluetooth/default.nix
Normal file
23
modules/bluetooth/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.bluetooth =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
|
hardware.bluetooth = {
|
||||||
|
enable = true;
|
||||||
|
powerOnBoot = true;
|
||||||
|
settings = {
|
||||||
|
General = {
|
||||||
|
Enable = "Source,Sink,Media,Socket";
|
||||||
|
Experimental = true;
|
||||||
|
FastConnectable = true;
|
||||||
|
};
|
||||||
|
Policy = {
|
||||||
|
AutoEnable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
18
modules/browser/default.nix
Normal file
18
modules/browser/default.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.browser =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = [
|
||||||
|
inputs.helium.packages.${pkgs.system}.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.darwin.browser =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = [
|
||||||
|
inputs.helium.packages.${pkgs.system}.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
73
modules/cli-tools/default.nix
Normal file
73
modules/cli-tools/default.nix
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
let
|
||||||
|
commonPackages =
|
||||||
|
pkgs: with pkgs; [
|
||||||
|
neofetch
|
||||||
|
zip
|
||||||
|
unzip
|
||||||
|
ripgrep
|
||||||
|
fzf
|
||||||
|
fd
|
||||||
|
sd
|
||||||
|
bat
|
||||||
|
tldr
|
||||||
|
fortune
|
||||||
|
just
|
||||||
|
mmv-go
|
||||||
|
usbutils
|
||||||
|
opencode
|
||||||
|
lazygit
|
||||||
|
wget
|
||||||
|
btop
|
||||||
|
rsync
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.modules.nixos.cli-tools =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = commonPackages pkgs;
|
||||||
|
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
inputs.self.modules.homeManager.cli-tools
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.darwin.cli-tools =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = commonPackages pkgs;
|
||||||
|
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
inputs.self.modules.homeManager.cli-tools
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.homeManager.cli-tools =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
26
modules/config.nix
Normal file
26
modules/config.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
options.flake.modules = lib.mkOption {
|
||||||
|
type = lib.types.attrsOf (lib.types.lazyAttrsOf lib.types.raw);
|
||||||
|
default = { };
|
||||||
|
description = "Reusable NixOS/Darwin/home-manager modules keyed by type and name";
|
||||||
|
};
|
||||||
|
|
||||||
|
options.flake.globalConfig = {
|
||||||
|
username = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "dennis";
|
||||||
|
description = "Primary username for the system";
|
||||||
|
};
|
||||||
|
fullname = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "Dennis Schoepf";
|
||||||
|
description = "Full Name of the user";
|
||||||
|
};
|
||||||
|
email = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "me@dnsc.io";
|
||||||
|
description = "Full Name of the user";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
55
modules/desktop/default.nix
Normal file
55
modules/desktop/default.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.desktop =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.displayManager.cosmic-greeter.enable = true;
|
||||||
|
services.desktopManager.cosmic.enable = true;
|
||||||
|
services.system76-scheduler.enable = true;
|
||||||
|
|
||||||
|
environment.cosmic.excludePackages = with pkgs; [
|
||||||
|
cosmic-term
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
bibata-cursors
|
||||||
|
gimp
|
||||||
|
darktable
|
||||||
|
];
|
||||||
|
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
nerd-fonts.victor-mono
|
||||||
|
];
|
||||||
|
|
||||||
|
fonts.fontconfig = {
|
||||||
|
enable = true;
|
||||||
|
antialias = true;
|
||||||
|
hinting = {
|
||||||
|
enable = true;
|
||||||
|
style = "slight";
|
||||||
|
};
|
||||||
|
defaultFonts.monospace = [ "VictorMono Nerd Font Mono" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
inputs.self.modules.homeManager.desktop
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.homeManager.desktop =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.sessionVariables = {
|
||||||
|
XCURSOR_THEME = "Bibata-Modern-Ice";
|
||||||
|
XCURSOR_SIZE = "24";
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".icons/default/index.theme".text = ''
|
||||||
|
[Icon Theme]
|
||||||
|
Inherits=Bibata-Modern-Ice
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO: Persist ~/.config/cosmic after setup
|
||||||
|
# and symlink it with home manager
|
||||||
|
}
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
programs.direnv = {
|
|
||||||
enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
virtualisation.docker = {
|
|
||||||
enable = true;
|
|
||||||
rootless = {
|
|
||||||
enable = true;
|
|
||||||
setSocketVariable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.dennis.extraGroups = [ "docker" ];
|
|
||||||
}
|
|
||||||
14
modules/drawing-tablet/default.nix
Normal file
14
modules/drawing-tablet/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.drawing-tablet =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
hardware.opentabletdriver.enable = true;
|
||||||
|
hardware.uinput.enable = true;
|
||||||
|
boot.kernelModules = [ "uinput" ];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
krita
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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})'
|
|
||||||
29
modules/gaming/default.nix
Normal file
29
modules/gaming/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.gaming =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.gamemode.enable = true;
|
||||||
|
programs.gamescope.enable = true;
|
||||||
|
programs.steam = {
|
||||||
|
enable = true;
|
||||||
|
remotePlay.openFirewall = true;
|
||||||
|
gamescopeSession.enable = true;
|
||||||
|
protontricks.enable = true;
|
||||||
|
|
||||||
|
extraCompatPackages = with pkgs; [
|
||||||
|
proton-ge-bin
|
||||||
|
];
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
gamescope
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
lutris
|
||||||
|
steam-run
|
||||||
|
gamescope
|
||||||
|
mangohud
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +1,58 @@
|
||||||
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
programs.git = {
|
flake.modules.nixos.git =
|
||||||
enable = true;
|
{ pkgs, ... }:
|
||||||
settings = {
|
{
|
||||||
init = {
|
environment.systemPackages = with pkgs; [
|
||||||
defaultBranch = "main";
|
git
|
||||||
};
|
];
|
||||||
|
|
||||||
core = {
|
home-manager.sharedModules = [
|
||||||
ignorecase = "false";
|
inputs.self.modules.homeManager.git
|
||||||
};
|
];
|
||||||
|
};
|
||||||
|
|
||||||
pull = {
|
flake.modules.darwin.git =
|
||||||
rebase = false;
|
{ pkgs, ... }:
|
||||||
};
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
];
|
||||||
|
|
||||||
push = {
|
home-manager.sharedModules = [
|
||||||
autoSetupRemote = true;
|
inputs.self.modules.homeManager.git
|
||||||
};
|
];
|
||||||
|
};
|
||||||
|
|
||||||
user = {
|
flake.modules.homeManager.git =
|
||||||
name = "Dennis Schoepf";
|
{ pkgs, config, ... }:
|
||||||
email = "me@dnsc.io";
|
{
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
init = {
|
||||||
|
defaultBranch = "main";
|
||||||
|
};
|
||||||
|
|
||||||
|
core = {
|
||||||
|
ignorecase = "false";
|
||||||
|
};
|
||||||
|
|
||||||
|
pull = {
|
||||||
|
rebase = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
push = {
|
||||||
|
autoSetupRemote = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
user = {
|
||||||
|
# TODO get from config
|
||||||
|
name = "Dennis Schoepf";
|
||||||
|
email = "me@dnsc.io";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ignores = [ ".DS_Store" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
ignores = [ ".DS_Store" ];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
25
modules/home-manager/default.nix
Normal file
25
modules/home-manager/default.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{ inputs, config, ... }:
|
||||||
|
let
|
||||||
|
username = config.flake.globalConfig.username;
|
||||||
|
hmConfig = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
backupFileExtension = "backup";
|
||||||
|
users.${username}.home.stateVersion = "24.11";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.modules.nixos.home-manager =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||||
|
home-manager = hmConfig;
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.darwin.home-manager =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [ inputs.home-manager.darwinModules.home-manager ];
|
||||||
|
home-manager = hmConfig;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,38 +1,59 @@
|
||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
username = config.flake.globalConfig.username;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
nix-homebrew = {
|
flake.modules.darwin.homebrew =
|
||||||
enable = true;
|
{ pkgs, ... }:
|
||||||
user = "dennis";
|
{
|
||||||
autoMigrate = true;
|
nix-homebrew = {
|
||||||
};
|
enable = true;
|
||||||
|
user = username;
|
||||||
|
autoMigrate = true;
|
||||||
|
};
|
||||||
|
|
||||||
homebrew = {
|
homebrew = {
|
||||||
user = "dennis";
|
user = username;
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
onActivation = {
|
onActivation = {
|
||||||
autoUpdate = true;
|
autoUpdate = true;
|
||||||
upgrade = true;
|
upgrade = true;
|
||||||
cleanup = "zap";
|
cleanup = "zap";
|
||||||
|
};
|
||||||
|
|
||||||
|
brews = [
|
||||||
|
"go"
|
||||||
|
"mas"
|
||||||
|
"yt-dlp"
|
||||||
|
];
|
||||||
|
|
||||||
|
casks = [
|
||||||
|
"font-victor-mono"
|
||||||
|
"font-victor-mono-nerd-font"
|
||||||
|
"vlc"
|
||||||
|
"ghostty"
|
||||||
|
"hiddenbar"
|
||||||
|
"eurkey"
|
||||||
|
"karabiner-elements"
|
||||||
|
"caffeine"
|
||||||
|
"raycast"
|
||||||
|
"spotify"
|
||||||
|
"keyboard-cowboy"
|
||||||
|
"krita"
|
||||||
|
"darktable"
|
||||||
|
"beekeeper-studio"
|
||||||
|
"qbittorrent"
|
||||||
|
"tpvirtual"
|
||||||
|
];
|
||||||
|
|
||||||
|
masApps = {
|
||||||
|
Bitwarden = 1352778147;
|
||||||
|
"Yesterday For Old Reddit" = 1603279883;
|
||||||
|
"Final Cut Pro" = 424389933;
|
||||||
|
Wireguard = 1451685025;
|
||||||
|
Pages = 409201541;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
brews = [
|
|
||||||
"go"
|
|
||||||
"mas"
|
|
||||||
];
|
|
||||||
|
|
||||||
casks = [
|
|
||||||
"font-victor-mono"
|
|
||||||
"font-victor-mono-nerd-font"
|
|
||||||
"vlc"
|
|
||||||
"ghostty"
|
|
||||||
"hiddenbar"
|
|
||||||
"eurkey"
|
|
||||||
"karabiner-elements"
|
|
||||||
"caffeine"
|
|
||||||
"raycast"
|
|
||||||
"spotify"
|
|
||||||
"zen"
|
|
||||||
"keyboard-cowboy"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
33
modules/hosts/dnsc-air/default.nix
Normal file
33
modules/hosts/dnsc-air/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
{ inputs, config, ... }:
|
||||||
|
let
|
||||||
|
hostname = "dnsc-air";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.darwinConfigurations.${hostname} = inputs.nix-darwin.lib.darwinSystem {
|
||||||
|
system = "aarch64-darwin";
|
||||||
|
modules = with config.flake.modules.darwin; [
|
||||||
|
inputs.nix-homebrew.darwinModules.nix-homebrew
|
||||||
|
|
||||||
|
base
|
||||||
|
home-manager
|
||||||
|
shell
|
||||||
|
git
|
||||||
|
ssh
|
||||||
|
cli-tools
|
||||||
|
nix
|
||||||
|
neovim
|
||||||
|
terminal
|
||||||
|
browser
|
||||||
|
tiling-desktop
|
||||||
|
|
||||||
|
(
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
networking.hostName = hostname;
|
||||||
|
networking.computerName = hostname;
|
||||||
|
system.defaults.smb.NetBIOSName = hostname;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
36
modules/hosts/dnsc-machine/_hardware-configuration.nix
Normal file
36
modules/hosts/dnsc-machine/_hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
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"; } ];
|
||||||
|
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault true;
|
||||||
|
}
|
||||||
33
modules/hosts/dnsc-machine/default.nix
Normal file
33
modules/hosts/dnsc-machine/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
{ inputs, config, ... }:
|
||||||
|
let
|
||||||
|
hostname = "dnsc-machine";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.nixosConfigurations.dnsc-machine = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = with config.flake.modules.nixos; [
|
||||||
|
home-manager
|
||||||
|
base
|
||||||
|
shell
|
||||||
|
git
|
||||||
|
ssh
|
||||||
|
neovim
|
||||||
|
cli-tools
|
||||||
|
nix
|
||||||
|
nvidia-graphics
|
||||||
|
drawing-tablet
|
||||||
|
bluetooth
|
||||||
|
printing
|
||||||
|
scrolling-desktop
|
||||||
|
terminal
|
||||||
|
gaming
|
||||||
|
browser
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ./_hardware-configuration.nix ];
|
||||||
|
networking.hostName = hostname;
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
52
modules/hosts/dnsc-server/_hardware-configuration.nix
Normal file
52
modules/hosts/dnsc-server/_hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
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;
|
||||||
|
}
|
||||||
49
modules/hosts/dnsc-server/default.nix
Normal file
49
modules/hosts/dnsc-server/default.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
{ inputs, config, ... }:
|
||||||
|
let
|
||||||
|
hostname = "dnsc-server";
|
||||||
|
secretsDir = "${inputs.self}/secrets";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.nixosConfigurations.${hostname} = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = with config.flake.modules.nixos; [
|
||||||
|
inputs.agenix.nixosModules.default
|
||||||
|
home-manager
|
||||||
|
base
|
||||||
|
server-shell
|
||||||
|
git
|
||||||
|
ssh
|
||||||
|
zfs
|
||||||
|
ups
|
||||||
|
cli-tools
|
||||||
|
nix
|
||||||
|
jellyfin
|
||||||
|
restic
|
||||||
|
samba-share
|
||||||
|
|
||||||
|
(
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
imports = [ ./_hardware-configuration.nix ];
|
||||||
|
networking.hostName = hostname;
|
||||||
|
networking.hostId = "e5d5a602";
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
|
||||||
|
# Secrets for this machine
|
||||||
|
age = {
|
||||||
|
identityPaths = [
|
||||||
|
"${config.users.users.dennis.home}/.ssh/id_ed25519"
|
||||||
|
];
|
||||||
|
secrets."restic/password" = {
|
||||||
|
file = "${secretsDir}/restic/password.age";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Options for my custom modules
|
||||||
|
samba-share.path = "/main/share";
|
||||||
|
samba-share.allowedHosts = "192.168.178. 127.0.0.1 localhost";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
services.immich = {
|
|
||||||
enable = true;
|
|
||||||
port = 9003;
|
|
||||||
host = "192.168.178.69";
|
|
||||||
openFirewall = true;
|
|
||||||
mediaLocation = "/main/pictures";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +1,32 @@
|
||||||
|
{ ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
flake.modules.nixos.jellyfin =
|
||||||
...
|
{ pkgs, ... }:
|
||||||
}:
|
{
|
||||||
{
|
services.jellyfin = {
|
||||||
services.jellyfin = {
|
enable = true;
|
||||||
enable = true;
|
openFirewall = true;
|
||||||
openFirewall = true;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config.packageOverrides = pkgs: {
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.graphics = {
|
hardware.graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
intel-media-driver
|
intel-media-driver
|
||||||
intel-vaapi-driver
|
intel-vaapi-driver
|
||||||
libva-vdpau-driver
|
libva-vdpau-driver
|
||||||
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
|
intel-compute-runtime
|
||||||
vpl-gpu-rt # QSV on 11th gen or newer
|
vpl-gpu-rt
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
jellyfin
|
||||||
|
jellyfin-web
|
||||||
|
jellyfin-ffmpeg
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
services.keyd = {
|
|
||||||
enable = true;
|
|
||||||
keyboards = {
|
|
||||||
default = {
|
|
||||||
ids = [ "05ac:024f" ];
|
|
||||||
settings = {
|
|
||||||
main = {
|
|
||||||
space = "overload(control, space)";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
14
modules/neovim/_colorscheme.nix
Normal file
14
modules/neovim/_colorscheme.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
30
modules/neovim/_completion.nix
Normal file
30
modules/neovim/_completion.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim.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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
93
modules/neovim/_editing.nix
Normal file
93
modules/neovim/_editing.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
plugins.guess-indent.enable = true;
|
||||||
|
plugins.nvim-surround.enable = true;
|
||||||
|
plugins.flash.enable = true;
|
||||||
|
plugins.nvim-autopairs.enable = true;
|
||||||
|
|
||||||
|
# Workaround: Neovim 0.11.x does not implement the is? / is-not? treesitter
|
||||||
|
# predicates, but newer grammar query files (tree-sitter-nix, tree-sitter-javascript)
|
||||||
|
# use (#is-not? local) to scope highlights to non-local identifiers.
|
||||||
|
# Register no-op handlers to suppress the error; remove once Neovim
|
||||||
|
# ships with built-in support for these predicates.
|
||||||
|
extraConfigLua = /* lua */ ''
|
||||||
|
-- (#is?) always returns false (node never "is" something)
|
||||||
|
vim.treesitter.query.add_predicate("is?", function()
|
||||||
|
return false
|
||||||
|
end, { force = true })
|
||||||
|
-- (#is-not?) always returns true (node is always "not" something)
|
||||||
|
vim.treesitter.query.add_predicate("is-not?", function()
|
||||||
|
return true
|
||||||
|
end, { force = true })
|
||||||
|
'';
|
||||||
|
|
||||||
|
plugins.treesitter = {
|
||||||
|
enable = true;
|
||||||
|
highlight.enable = true;
|
||||||
|
indent.enable = false;
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
plugins.conform-nvim = {
|
programs.nixvim.plugins.conform-nvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
|
|
@ -51,6 +50,6 @@
|
||||||
lsp_format = "fallback";
|
lsp_format = "fallback";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
extraPackages = [pkgs.stylua];
|
extraPackages = [ pkgs.stylua ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
31
modules/neovim/_git.nix
Normal file
31
modules/neovim/_git.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
132
modules/neovim/_keybindings.nix
Normal file
132
modules/neovim/_keybindings.nix
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
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'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
200
modules/neovim/_lsp.nix
Normal file
200
modules/neovim/_lsp.nix
Normal file
|
|
@ -0,0 +1,200 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
50
modules/neovim/_options.nix
Normal file
50
modules/neovim/_options.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
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;
|
||||||
|
showtabline = 0;
|
||||||
|
smartcase = true;
|
||||||
|
autoindent = true;
|
||||||
|
smartindent = 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
171
modules/neovim/_picker.nix
Normal file
171
modules/neovim/_picker.nix
Normal file
|
|
@ -0,0 +1,171 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
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 = "λ ",
|
||||||
|
},
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
9
modules/neovim/_statusline.nix
Normal file
9
modules/neovim/_statusline.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim.plugins.mini-statusline = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
use_icons = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
45
modules/neovim/default.nix
Normal file
45
modules/neovim/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.neovim =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
inputs.self.modules.homeManager.neovim
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.darwin.neovim =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
inputs.self.modules.homeManager.neovim
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.homeManager.neovim =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.nixvim.homeModules.nixvim
|
||||||
|
./_colorscheme.nix
|
||||||
|
./_completion.nix
|
||||||
|
./_editing.nix
|
||||||
|
./_formatter.nix
|
||||||
|
./_keybindings.nix
|
||||||
|
./_lsp.nix
|
||||||
|
./_options.nix
|
||||||
|
./_picker.nix
|
||||||
|
./_statusline.nix
|
||||||
|
];
|
||||||
|
programs.nixvim = {
|
||||||
|
enable = true;
|
||||||
|
defaultEditor = true;
|
||||||
|
package = pkgs.neovim-unwrapped;
|
||||||
|
vimAlias = true;
|
||||||
|
vimdiffAlias = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -25,8 +25,8 @@ hi("IncSearch", { bg = palette.magenta_subtle_bg, fg = palette.magenta })
|
||||||
hi("ModeMsg", { bold = true, cterm = { bold = true } })
|
hi("ModeMsg", { bold = true, cterm = { bold = true } })
|
||||||
hi("NonText", { fg = palette.grey, ctermfg = "DarkGrey" })
|
hi("NonText", { fg = palette.grey, ctermfg = "DarkGrey" })
|
||||||
hi("PmenuSbar", { bg = palette.grey, ctermbg = "Grey" })
|
hi("PmenuSbar", { bg = palette.grey, ctermbg = "Grey" })
|
||||||
hi("StatusLine", { reverse = true, bold = true, cterm = { reverse = true, bold = true } })
|
hi("StatusLine", { bg = palette.bg_secondary, fg = palette.fg_dim, bold = true, cterm = { reverse = true, bold = true } })
|
||||||
hi("StatusLineNC", { reverse = true, cterm = { reverse = true } })
|
hi("StatusLineNC", { bg = palette.bg_secondary, fg = palette.fg, cterm = { reverse = true } })
|
||||||
hi("TabLineFill", { reverse = true, cterm = { reverse = true } })
|
hi("TabLineFill", { reverse = true, cterm = { reverse = true } })
|
||||||
hi("TabLineSel", { bold = true, cterm = { bold = true } })
|
hi("TabLineSel", { bold = true, cterm = { bold = true } })
|
||||||
hi("TermCursor", { reverse = true, cterm = { reverse = true } })
|
hi("TermCursor", { reverse = true, cterm = { reverse = true } })
|
||||||
|
|
@ -210,7 +210,7 @@ hi("@lsp.type.variable", { link = "Identifier" })
|
||||||
hi("@lsp.typemod.keyword.documentation", { fg = palette.grey, bold = true })
|
hi("@lsp.typemod.keyword.documentation", { fg = palette.grey, bold = true })
|
||||||
|
|
||||||
if vim.o.background == "light" then
|
if vim.o.background == "light" then
|
||||||
-- TODO: Define light scheme
|
-- TODO: Define light scheme
|
||||||
else
|
else
|
||||||
-- Default colors only used with a dark background.
|
-- Default colors only used with a dark background.
|
||||||
hi("ColorColumn", { bg = palette.red_subtle_bg, ctermbg = "DarkRed" })
|
hi("ColorColumn", { bg = palette.red_subtle_bg, ctermbg = "DarkRed" })
|
||||||
|
|
@ -365,4 +365,8 @@ else
|
||||||
hi("NeogitCommitViewHeader", { bg = palette.bg_secondary, fg = palette.fg })
|
hi("NeogitCommitViewHeader", { bg = palette.bg_secondary, fg = palette.fg })
|
||||||
hi("NeogitDiffHeader", { bg = palette.bg, fg = palette.grey_bright, bold = true })
|
hi("NeogitDiffHeader", { bg = palette.bg, fg = palette.grey_bright, bold = true })
|
||||||
hi("NeogitActiveItem", { bg = palette.grey_bright, fg = palette.bg, bold = true })
|
hi("NeogitActiveItem", { bg = palette.grey_bright, fg = palette.bg, bold = true })
|
||||||
|
|
||||||
|
-- Mini Statusline
|
||||||
|
hi("MiniStatusLineModeNormal", { fg = palette.magenta_brighter, bg = palette.magenta_subtle_bg, bold = true })
|
||||||
|
hi("MiniStatusLineModeCommand", { bg = palette.blue_subtle_bg, fg = palette.blue_bright, bold = true })
|
||||||
end
|
end
|
||||||
55
modules/nix/default.nix
Normal file
55
modules/nix/default.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.nix =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.direnv = {
|
||||||
|
enable = true;
|
||||||
|
silent = false;
|
||||||
|
loadInNixShell = true;
|
||||||
|
direnvrcExtra = "";
|
||||||
|
nix-direnv = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
programs.nix-ld.enable = true;
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nil
|
||||||
|
statix
|
||||||
|
manix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.darwin.nix =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.direnv = {
|
||||||
|
enable = true;
|
||||||
|
silent = false;
|
||||||
|
loadInNixShell = true;
|
||||||
|
direnvrcExtra = "";
|
||||||
|
nix-direnv = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nil
|
||||||
|
statix
|
||||||
|
manix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -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'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -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 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
21
modules/nvidia-graphics/default.nix
Normal file
21
modules/nvidia-graphics/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.nvidia-graphics =
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
hardware = {
|
||||||
|
graphics.enable = true;
|
||||||
|
nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
powerManagement.enable = false;
|
||||||
|
powerManagement.finegrained = false;
|
||||||
|
open = true;
|
||||||
|
nvidiaSettings = true;
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
setlocal expandtab
|
|
||||||
setlocal smartindent
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
setlocal conceallevel=2
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
setlocal expandtab
|
|
||||||
setlocal smartindent
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
setlocal conceallevel=2
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
setlocal expandtab
|
|
||||||
setlocal smartindent
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
setlocal conceallevel=2
|
|
||||||
setlocal nocompatible
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
/nix/store/mp57l6qar04fcicsvmryl7fjzq6wwfmp-home-manager-files/.config/nvim/colors/winterly.lua
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
/nix/store/mp57l6qar04fcicsvmryl7fjzq6wwfmp-home-manager-files/.config/nvim/init.lua
|
|
||||||
|
|
@ -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" }
|
|
||||||
}
|
|
||||||
|
|
@ -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,
|
|
||||||
}
|
|
||||||
|
|
@ -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',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -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,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -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,
|
|
||||||
}
|
|
||||||
|
|
@ -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 },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -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" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
return {
|
|
||||||
cmd = { "nil" },
|
|
||||||
filetypes = { "nix" },
|
|
||||||
root_markers = { "flake.nix", ".git" },
|
|
||||||
}
|
|
||||||
|
|
@ -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,
|
|
||||||
}
|
|
||||||
|
|
@ -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,
|
|
||||||
}
|
|
||||||
|
|
@ -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>")
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue