Compare commits
95 Commits
768caf9882
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cbd4e7b4bb | |||
| a1057c5954 | |||
| 2409574330 | |||
| 6b09de5afc | |||
| e5ca18d368 | |||
| 68ac29b68b | |||
| e89003a063 | |||
| 62072e71ea | |||
| 6bfb3286e3 | |||
| 325705f4cb | |||
| 96a92bd67f | |||
| b17b2ab977 | |||
| 2d2a7e6765 | |||
| a9dfdccf63 | |||
| 8a1ed7b0ab | |||
| 04a9d2ce76 | |||
| d4d9e715ff | |||
| 3b23c25509 | |||
| 0874bb6698 | |||
| 316bffb9f5 | |||
| b19be561bf | |||
| 452426f363 | |||
| a50801f5bb | |||
| dee3da3b12 | |||
| 8cdb41674c | |||
| eaf994c5b5 | |||
| ccc7116c3f | |||
| 7be66a5d2f | |||
| 686501d464 | |||
| 09686e1ee6 | |||
| 7caf921746 | |||
| 7b86a1cb21 | |||
| 4f18892d1b | |||
| 580fcac817 | |||
| 8364bbb3cb | |||
| e0e7f514ec | |||
| 82f69166c5 | |||
| dce2e160da | |||
| b10e5253f8 | |||
| d4a0ab60cf | |||
| 5269b2ee10 | |||
| d9c9b55d49 | |||
| fd5e28b368 | |||
| da793b82e7 | |||
| c2e4fbb59f | |||
| 25a7f185bc | |||
| 044a0156df | |||
| 4e0cb41780 | |||
| 34737a5aef | |||
| 81ea7f695e | |||
| ea7707d050 | |||
| 30a54caa03 | |||
| 3ed6781ae1 | |||
| 3418e577c5 | |||
| 2741e25585 | |||
| e9aed100af | |||
| 1ac96316ea | |||
| 8d636ce194 | |||
| bbeed99f43 | |||
| 7e6ece1b0d | |||
| 60952a0e7f | |||
| 738013df66 | |||
| 34160d0de4 | |||
| 02b8a16f41 | |||
| 684f6fdea5 | |||
| 7ef1785a0f | |||
| 49c0c607d8 | |||
| ab52b423ee | |||
| f852a73d47 | |||
| 998ebc1164 | |||
| 9acb378e5f | |||
| dca434c0ba | |||
| c22ff38874 | |||
| 0591868be3 | |||
| e249f13313 | |||
| 4ecf045deb | |||
| 05d1890b01 | |||
| 2babff5576 | |||
| aa7c26516c | |||
| a1369cbb41 | |||
| 54c5cf932d | |||
| bb68711814 | |||
| 6b31922615 | |||
| 21e779c304 | |||
| e718da413b | |||
| 98989afdec | |||
| 3a97de6af2 | |||
| 66b7a31943 | |||
| ddb53d879e | |||
| e403e47c28 | |||
| d8b3d6fb09 | |||
| 91d6863d60 | |||
| 618e5593e7 | |||
| e1c9a27ca3 | |||
| 7a58571c03 |
46
AGENTS.md
46
AGENTS.md
@@ -4,28 +4,8 @@ This repository contains NixOS, nix-darwin, and Home Manager configurations in N
|
|||||||
|
|
||||||
## Build, Test, and Deployment Commands
|
## Build, Test, and Deployment Commands
|
||||||
|
|
||||||
### Build and Apply Configurations
|
### Build and Apply Configurations & Deploy to Remote Machines
|
||||||
|
Can use deploy for both local and remote hosts
|
||||||
**Linux (NixOS):**
|
|
||||||
```bash
|
|
||||||
just build # Build configuration
|
|
||||||
just install cores='32' # Apply with 32 cores
|
|
||||||
sudo nixos-rebuild test --fast --flake . # Test without activation
|
|
||||||
sudo nixos-rebuild switch --rollback --flake . # Rollback
|
|
||||||
```
|
|
||||||
|
|
||||||
**macOS (nix-darwin):**
|
|
||||||
```bash
|
|
||||||
just build # Build configuration
|
|
||||||
just install # Apply configuration
|
|
||||||
```
|
|
||||||
|
|
||||||
**Home Manager:**
|
|
||||||
```bash
|
|
||||||
just home
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deploy to Remote Machines (deploy-rs)
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
deploy -s .#ryu # Desktop (x86_64-linux)
|
deploy -s .#ryu # Desktop (x86_64-linux)
|
||||||
@@ -35,6 +15,23 @@ deploy -s .#kuro # MacBook M4 Pro (aarch64-darwin)
|
|||||||
deploy -s .#shiro # Mac Mini M4 (aarch64-darwin)
|
deploy -s .#shiro # Mac Mini M4 (aarch64-darwin)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Linux (NixOS):**
|
||||||
|
```bash
|
||||||
|
deploy -s .#ryu
|
||||||
|
deploy -s .#tako
|
||||||
|
deploy -s .#tako --builders '' --cores 32 # with no other builders and 32 cores
|
||||||
|
deploy -s .#ryu --max-jobs 4 --cores 32 # use 32 cores and 4 parallel derivations
|
||||||
|
sudo nixos-rebuild test --fast --flake . # Test without activation
|
||||||
|
sudo nixos-rebuild switch --rollback --flake . # Rollback
|
||||||
|
```
|
||||||
|
|
||||||
|
**macOS (nix-darwin):**
|
||||||
|
```bash
|
||||||
|
deploy -s .#kuro
|
||||||
|
deploy -s .#shiro
|
||||||
|
sudo nix-darwin test --fast --flake .
|
||||||
|
```
|
||||||
|
|
||||||
### Validation and Formatting
|
### Validation and Formatting
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -162,6 +159,11 @@ sessionVariables.BROWSER = if device.isDarwin then "open" else "xdg-open";
|
|||||||
just add program myprogram # Creates home/programs/myprogram.nix and adds import
|
just add program myprogram # Creates home/programs/myprogram.nix and adds import
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Adding a new dns entry
|
||||||
|
```bash
|
||||||
|
cfcli add --type A foobar.bazbar.biz 100.102.64.19
|
||||||
|
```
|
||||||
|
|
||||||
### Creating a Module
|
### Creating a Module
|
||||||
|
|
||||||
1. Determine location: `modules/nixos/`, `modules/darwin/`, or `modules/home/`
|
1. Determine location: `modules/nixos/`, `modules/darwin/`, or `modules/home/`
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
# "mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM="
|
# "mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM="
|
||||||
];
|
];
|
||||||
|
download-buffer-size = 524288000;
|
||||||
};
|
};
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
build-users-group = nixbld
|
build-users-group = nixbld
|
||||||
|
|||||||
@@ -6,10 +6,7 @@
|
|||||||
casks = [
|
casks = [
|
||||||
"1password"
|
"1password"
|
||||||
"lunar"
|
"lunar"
|
||||||
"orcaslicer"
|
|
||||||
"raycast"
|
"raycast"
|
||||||
"zed"
|
|
||||||
"zen"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,12 @@
|
|||||||
homebrew = {
|
homebrew = {
|
||||||
enable = true;
|
enable = true;
|
||||||
brews = [
|
brews = [
|
||||||
"docker-compose"
|
|
||||||
];
|
];
|
||||||
casks = [
|
casks = [
|
||||||
"1password"
|
"1password"
|
||||||
"docker"
|
|
||||||
"raycast"
|
"raycast"
|
||||||
"lunar"
|
"lunar"
|
||||||
"orcaslicer"
|
"orcaslicer"
|
||||||
"zed"
|
|
||||||
"zen"
|
"zen"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
{...}: {
|
{...}: {
|
||||||
imports = [
|
imports = [
|
||||||
# ../../../modules/darwin/caddy
|
# ../../../modules/darwin/caddy
|
||||||
./yabai.nix
|
|
||||||
./skhd.nix
|
|
||||||
./tailscale.nix
|
|
||||||
./autossh.nix
|
|
||||||
# ./caddy.nix
|
|
||||||
./sops.nix
|
|
||||||
# ./lmstudio.nix
|
|
||||||
# ./colima.nix
|
|
||||||
# ./zerotier.nix
|
|
||||||
# ./aerospace.nix
|
# ./aerospace.nix
|
||||||
|
# ./caddy.nix
|
||||||
|
# ./colima.nix
|
||||||
|
# ./lmstudio.nix
|
||||||
|
# ./zerotier.nix
|
||||||
|
|
||||||
|
./autossh.nix
|
||||||
|
./skhd.nix
|
||||||
|
./sops.nix
|
||||||
|
./sunshine.nix
|
||||||
|
./tailscale.nix
|
||||||
|
./yabai.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
10
darwin/shiro/services/sunshine.nix
Normal file
10
darwin/shiro/services/sunshine.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{...}: {
|
||||||
|
homebrew = {
|
||||||
|
taps = [
|
||||||
|
"lizardbyte/homebrew"
|
||||||
|
];
|
||||||
|
brews = [
|
||||||
|
"lizardbyte/homebrew/sunshine-beta"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
24
deploy.nix
24
deploy.nix
@@ -5,14 +5,6 @@
|
|||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
nodes = {
|
nodes = {
|
||||||
mirai = {
|
|
||||||
hostname = "mirai.darksailor.dev";
|
|
||||||
profiles.system = {
|
|
||||||
sshUser = "fs0c131y";
|
|
||||||
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.mirai;
|
|
||||||
user = "root";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tsuba = {
|
tsuba = {
|
||||||
hostname = "tsuba.darksailor.dev";
|
hostname = "tsuba.darksailor.dev";
|
||||||
profiles.system = {
|
profiles.system = {
|
||||||
@@ -55,13 +47,13 @@
|
|||||||
user = "root";
|
user = "root";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# deck = {
|
deck = {
|
||||||
# hostname = "steamdeck";
|
hostname = "sdeck";
|
||||||
# profiles.system = {
|
profiles.system = {
|
||||||
# sshUser = "deck";
|
sshUser = "deck";
|
||||||
# path = deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.deck;
|
path = deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.deck;
|
||||||
# user = "deck";
|
user = "deck";
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
2335
flake.lock
generated
2335
flake.lock
generated
File diff suppressed because it is too large
Load Diff
128
flake.nix
128
flake.nix
@@ -17,10 +17,6 @@
|
|||||||
url = "github:nix-community/stylix";
|
url = "github:nix-community/stylix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
stylix-stable = {
|
|
||||||
url = "github:nix-community/stylix/release-25.11";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs-stable";
|
|
||||||
};
|
|
||||||
home-manager-stable = {
|
home-manager-stable = {
|
||||||
url = "github:nix-community/home-manager/release-25.11";
|
url = "github:nix-community/home-manager/release-25.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs-stable";
|
inputs.nixpkgs.follows = "nixpkgs-stable";
|
||||||
@@ -51,26 +47,10 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nur.url = "github:nix-community/nur";
|
nur.url = "github:nix-community/nur";
|
||||||
hyprland = {
|
|
||||||
url = "github:hyprwm/Hyprland";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
hyprlock = {
|
|
||||||
url = "github:hyprwm/hyprlock";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
zjstatus = {
|
zjstatus = {
|
||||||
url = "github:dj95/zjstatus";
|
url = "github:dj95/zjstatus";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
rust-overlay = {
|
|
||||||
url = "github:oxalica/rust-overlay";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
openapi-tui = {
|
|
||||||
url = "github:zaghaghi/openapi-tui";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
musnix = {
|
musnix = {
|
||||||
url = "github:musnix/musnix";
|
url = "github:musnix/musnix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -83,26 +63,10 @@
|
|||||||
url = "github:Mic92/sops-nix";
|
url = "github:Mic92/sops-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
csshacks = {
|
|
||||||
url = "github:MrOtherGuy/firefox-csshacks";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
nno = {
|
nno = {
|
||||||
url = "github:nvim-neorg/nixpkgs-neorg-overlay";
|
url = "github:nvim-neorg/nixpkgs-neorg-overlay";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
pets = {
|
|
||||||
url = "github:giusgad/pets.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
rest-nvim = {
|
|
||||||
url = "github:rest-nvim/rest.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
neogit = {
|
|
||||||
url = "github:NeogitOrg/neogit/nightly";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
d2 = {
|
d2 = {
|
||||||
url = "github:terrastruct/d2-vim";
|
url = "github:terrastruct/d2-vim";
|
||||||
flake = false;
|
flake = false;
|
||||||
@@ -127,25 +91,6 @@
|
|||||||
url = "github:pest-parser/tree-sitter-pest";
|
url = "github:pest-parser/tree-sitter-pest";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
navigator = {
|
|
||||||
url = "github:ray-x/navigator.lua";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
guihua = {
|
|
||||||
url = "github:ray-x/guihua.lua";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
ghostty = {
|
|
||||||
url = "github:ghostty-org/ghostty";
|
|
||||||
};
|
|
||||||
typr = {
|
|
||||||
url = "github:nvzone/typr";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
volt = {
|
|
||||||
url = "github:nvzone/volt";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
arion = {
|
arion = {
|
||||||
url = "github:hercules-ci/arion";
|
url = "github:hercules-ci/arion";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -155,9 +100,9 @@
|
|||||||
};
|
};
|
||||||
zen-browser = {
|
zen-browser = {
|
||||||
url = "github:0xc000022070/zen-browser-flake";
|
url = "github:0xc000022070/zen-browser-flake";
|
||||||
# IMPORTANT: we're using "libgbm" and is only available in unstable so ensure
|
# IMPORTANT: To ensure compatibility with the latest Firefox version, use nixpkgs-unstable.
|
||||||
# to have it up-to-date or simply don't specify the nixpkgs input
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.home-manager.follows = "home-manager";
|
||||||
};
|
};
|
||||||
|
|
||||||
anyrun = {
|
anyrun = {
|
||||||
@@ -169,18 +114,10 @@
|
|||||||
url = "github:uttarayan21/anyrun-hyprwin";
|
url = "github:uttarayan21/anyrun-hyprwin";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
anyrun-rink = {
|
|
||||||
url = "github:uttarayan21/anyrun-rink";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
onepassword-shell-plugins = {
|
onepassword-shell-plugins = {
|
||||||
url = "github:1Password/shell-plugins";
|
url = "github:1Password/shell-plugins";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
zeronsd = {
|
|
||||||
url = "github:uttarayan21/zeronsd";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
tmux-float = {
|
tmux-float = {
|
||||||
url = "github:uttarayan21/tmux-float";
|
url = "github:uttarayan21/tmux-float";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -199,24 +136,6 @@
|
|||||||
# url = "path:/home/servius/Projects/ALVR";
|
# url = "path:/home/servius/Projects/ALVR";
|
||||||
# inputs.nixpkgs.follows = "nixpkgs";
|
# inputs.nixpkgs.follows = "nixpkgs";
|
||||||
# };
|
# };
|
||||||
ik_llama = {
|
|
||||||
url = "github:ikawrakow/ik_llama.cpp?submodules=1";
|
|
||||||
# submodules = true;
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
llama-cpp = {
|
|
||||||
# url = "https://github.com/ggml-org/llama.cpp";
|
|
||||||
url = "github:ggml-org/llama.cpp/b6178?submodules=1";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
yabai = {
|
|
||||||
url = "github:koekeishiya/yabai";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
nix-auth = {
|
|
||||||
url = "github:numtide/nix-auth";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
nixpkgs-xr = {
|
nixpkgs-xr = {
|
||||||
url = "github:nix-community/nixpkgs-xr";
|
url = "github:nix-community/nixpkgs-xr";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -241,21 +160,34 @@
|
|||||||
url = "github:vicinaehq/vicinae";
|
url = "github:vicinaehq/vicinae";
|
||||||
# inputs.nixpkgs.follows = "nixpkgs";
|
# inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
wivrn = {
|
|
||||||
url = "github:uttarayan21/wivrn?submodules=1";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
eilmeldung = {
|
eilmeldung = {
|
||||||
url = "github:christo-auer/eilmeldung";
|
url = "github:christo-auer/eilmeldung";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
hytale-launcher = {
|
servius-website = {
|
||||||
url = "github:JPyke3/hytale-launcher-nix";
|
url = "git+https://git.darksailor.dev/servius/servius.neocities.org";
|
||||||
};
|
|
||||||
mixid = {
|
|
||||||
url = "github:leguteape/MixiD";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
nixify = {
|
||||||
|
url = "github:uttarayan21/nixify";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
tangled-core = {
|
||||||
|
url = "git+https://tangled.org/tangled.org/core";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
hyprland = {
|
||||||
|
url = "github:hyprwm/Hyprland";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
iamb = {
|
||||||
|
url = "github:ulyssa/iamb/latest";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
cinny = {
|
||||||
|
url = "github:cinnyapp/cinny/dev";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
@@ -433,16 +365,20 @@
|
|||||||
};
|
};
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
|
cratesNix = inputs.crates-nix.mkLib {inherit pkgs;};
|
||||||
in {
|
in {
|
||||||
# packages = rec {
|
|
||||||
# default = neovim;
|
|
||||||
# neovim = pkgs.nixvim.makeNixvim (pkgs.callPackage ./neovim);
|
|
||||||
# };
|
|
||||||
devShells = {
|
devShells = {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs; [sops just openssl ast-grep];
|
packages = with pkgs; [sops just openssl ast-grep];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
packages = {
|
||||||
|
default = cratesNix.buildCrate "ironclaw" {
|
||||||
|
nativeBuildInputs = [pkgs.pkg-config];
|
||||||
|
buildInputs = [pkgs.openssl];
|
||||||
|
doCheck = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,43 +5,65 @@
|
|||||||
}: {
|
}: {
|
||||||
sops = {
|
sops = {
|
||||||
secrets."accounts/mail/fastmail" = {};
|
secrets."accounts/mail/fastmail" = {};
|
||||||
|
secrets."accounts/calendar/fastmail" = {};
|
||||||
};
|
};
|
||||||
accounts.email = {
|
accounts = {
|
||||||
maildirBasePath = "Mail";
|
email = {
|
||||||
accounts = {
|
maildirBasePath = "Mail";
|
||||||
fastmail = rec {
|
accounts = {
|
||||||
maildir = {
|
fastmail = rec {
|
||||||
path = "fastmail";
|
maildir = {
|
||||||
|
path = "fastmail";
|
||||||
|
};
|
||||||
|
primary = true;
|
||||||
|
address = "email@uttarayan.me";
|
||||||
|
aliases = ["servius@darksailor.dev"];
|
||||||
|
userName = address;
|
||||||
|
realName = "Uttarayan Mondal";
|
||||||
|
imap = {
|
||||||
|
host = "imap.fastmail.com";
|
||||||
|
port = 993;
|
||||||
|
tls.enable = true;
|
||||||
|
# authentication = "login";
|
||||||
|
};
|
||||||
|
smtp = {
|
||||||
|
host = "smtp.fastmail.com";
|
||||||
|
port = 465;
|
||||||
|
tls.enable = true;
|
||||||
|
};
|
||||||
|
passwordCommand = ["cat" "${config.sops.secrets."accounts/mail/fastmail".path}"];
|
||||||
|
mbsync = {
|
||||||
|
enable = true;
|
||||||
|
create = "both";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
primary = true;
|
};
|
||||||
address = "email@uttarayan.me";
|
};
|
||||||
aliases = ["servius@darksailor.dev"];
|
calendar = {
|
||||||
userName = address;
|
basePath = "Calendar";
|
||||||
realName = "Uttarayan Mondal";
|
accounts = {
|
||||||
imap = {
|
fastmail = {
|
||||||
host = "imap.fastmail.com";
|
remote = {
|
||||||
port = 993;
|
url = "https://caldav.fastmail.com/dav/calendars/user/email@uttarayan.me";
|
||||||
tls.enable = true;
|
userName = "email@uttarayan.me";
|
||||||
# authentication = "login";
|
passwordCommand = ["cat" "${config.sops.secrets."accounts/calendar/fastmail".path}"];
|
||||||
};
|
type = "caldav";
|
||||||
smtp = {
|
};
|
||||||
host = "smtp.fastmail.com";
|
khal = {
|
||||||
port = 465;
|
enable = true;
|
||||||
tls.enable = true;
|
addresses = ["email@uttarayan.me"];
|
||||||
};
|
type = "discover";
|
||||||
imapnotify = {
|
};
|
||||||
enable = true;
|
vdirsyncer = {
|
||||||
};
|
enable = true;
|
||||||
passwordCommand = ["cat" "${config.sops.secrets."accounts/mail/fastmail".path}"];
|
conflictResolution = "remote wins";
|
||||||
mbsync = {
|
collections = ["from a"];
|
||||||
enable = true;
|
metadata = ["color" "displayname"];
|
||||||
create = "both";
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.mbsync.enable = true;
|
|
||||||
services.mbsync.enable = pkgs.stdenv.isLinux;
|
|
||||||
# accounts.email.accounts.<name>.mbsync.create
|
# accounts.email.accounts.<name>.mbsync.create
|
||||||
# services.mbsync.enable = true;
|
# services.mbsync.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
9
home/apps/affine.nix
Normal file
9
home/apps/affine.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = lib.optionals pkgs.stdenv.isLinux [
|
||||||
|
pkgs.affine
|
||||||
|
];
|
||||||
|
}
|
||||||
1
home/apps/cinny.nix
Normal file
1
home/apps/cinny.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{pkgs, ...}: {home.packages = [pkgs.cinny-desktop];}
|
||||||
@@ -6,41 +6,48 @@
|
|||||||
lib.optionalAttrs device.hasGui {
|
lib.optionalAttrs device.hasGui {
|
||||||
imports = [
|
imports = [
|
||||||
# ./audacity.nix
|
# ./audacity.nix
|
||||||
# ./blueman.nix
|
|
||||||
# ./bottles.nix
|
# ./bottles.nix
|
||||||
./chromium.nix
|
# ./cinny.nix
|
||||||
# ./cursor.nix
|
# ./cursor.nix
|
||||||
./discord.nix
|
|
||||||
./firefox.nix
|
|
||||||
./ghostty.nix
|
|
||||||
# ./gimp.nix
|
# ./gimp.nix
|
||||||
# ./guitarix.nix
|
# ./guitarix.nix
|
||||||
./hyprpicker.nix
|
|
||||||
# ./ida.nix
|
# ./ida.nix
|
||||||
# ./jellyflix.nix
|
# ./jellyflix.nix
|
||||||
# ./kicad.nix
|
# ./kicad.nix
|
||||||
./kitty.nix
|
# ./lmstudio.nix
|
||||||
./lmstudio.nix
|
|
||||||
./mpv.nix
|
|
||||||
# ./neovide.nix
|
# ./neovide.nix
|
||||||
./nextcloud.nix
|
|
||||||
./obs-studio.nix
|
|
||||||
# ./openscad.nix
|
# ./openscad.nix
|
||||||
./orcaslicer.nix
|
# ./orcaslicer.nix
|
||||||
# ./pcsx2.nix
|
# ./pcsx2.nix
|
||||||
./prismlauncher.nix
|
# ./prismlauncher.nix
|
||||||
# ./rpcs3.nix
|
# ./rpcs3.nix
|
||||||
./shadps4.nix
|
# ./shadps4.nix
|
||||||
./slack.nix
|
|
||||||
# ./thunderbird.nix
|
# ./thunderbird.nix
|
||||||
# ./tsukimi.nix
|
# ./tsukimi.nix
|
||||||
# ./vial.nix
|
# ./vial.nix
|
||||||
./vicinae.nix
|
# ./vlc.nix
|
||||||
./vlc.nix
|
|
||||||
# ./vscode.nix
|
# ./vscode.nix
|
||||||
|
# ./zen.nix
|
||||||
|
|
||||||
|
./moonlight.nix
|
||||||
|
# ./zed.nix
|
||||||
|
|
||||||
|
./affine.nix
|
||||||
|
./blueman.nix
|
||||||
|
./chromium.nix
|
||||||
|
# ./discord.nix
|
||||||
|
./firefox.nix
|
||||||
|
./ghostty.nix
|
||||||
|
./hyprpicker.nix
|
||||||
|
./kitty.nix
|
||||||
|
./matrix.nix
|
||||||
|
./mpv.nix
|
||||||
|
./nextcloud.nix
|
||||||
|
./obs-studio.nix
|
||||||
|
./slack.nix
|
||||||
|
./vicinae.nix
|
||||||
./wezterm.nix
|
./wezterm.nix
|
||||||
./zathura.nix
|
./zathura.nix
|
||||||
./zed.nix
|
|
||||||
./zen.nix
|
./zen.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
home.packages = lib.optionals pkgs.stdenv.isLinux [
|
# home.packages = lib.optionals pkgs.stdenv.isLinux [
|
||||||
(pkgs.discord.override {
|
# (pkgs.discord.override {
|
||||||
withOpenASAR = true;
|
# withOpenASAR = true;
|
||||||
withVencord = true;
|
# withVencord = true;
|
||||||
})
|
# })
|
||||||
# pkgs.vesktop
|
# # pkgs.vesktop
|
||||||
# pkgs.discord-canary
|
# # pkgs.discord-canary
|
||||||
# pkgs.discord-ptb
|
# # pkgs.discord-ptb
|
||||||
];
|
# ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,8 @@
|
|||||||
stylix.targets.kitty.enable = false;
|
stylix.targets.kitty.enable = false;
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# enable = false;
|
|
||||||
font = {
|
font = {
|
||||||
# name = "FiraCode Nerd Font Mono";
|
|
||||||
name = "Hasklug Nerd Font Mono";
|
name = "Hasklug Nerd Font Mono";
|
||||||
# name = "Monaspace Krypton Var Light";
|
|
||||||
size = lib.mkForce 13;
|
size = lib.mkForce 13;
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
12
home/apps/matrix.nix
Normal file
12
home/apps/matrix.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
device,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = lib.optionals (device.is "ryu") [
|
||||||
|
pkgs.fluffychat
|
||||||
|
pkgs.element-desktop
|
||||||
|
# pkgs.quaternion
|
||||||
|
];
|
||||||
|
}
|
||||||
8
home/apps/moonlight.nix
Normal file
8
home/apps/moonlight.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
device,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = lib.optionals (device.name == "ryu") [pkgs.moonlight-qt];
|
||||||
|
}
|
||||||
@@ -8,20 +8,20 @@
|
|||||||
loop-playlist = "inf";
|
loop-playlist = "inf";
|
||||||
};
|
};
|
||||||
profiles = {
|
profiles = {
|
||||||
hdr = {
|
# hdr = {
|
||||||
vo = "gpu-next";
|
# vo = "gpu-next";
|
||||||
gpu-api = "vulkan";
|
# gpu-api = "vulkan";
|
||||||
hdr-compute-peak = "yes";
|
# hdr-compute-peak = "yes";
|
||||||
hdr-peak-detect = "yes";
|
# hdr-peak-detect = "yes";
|
||||||
target-peak = 400;
|
# target-peak = 400;
|
||||||
target-prim = "bt.2020";
|
# target-prim = "bt.2020";
|
||||||
target-trc = "pq";
|
# target-trc = "pq";
|
||||||
inverse-tone-mapping = "yes";
|
# inverse-tone-mapping = "yes";
|
||||||
tone-mapping = "spline";
|
# tone-mapping = "spline";
|
||||||
tone-mapping-mode = "auto";
|
# tone-mapping-mode = "auto";
|
||||||
target-colorspace-hint = "auto";
|
# target-colorspace-hint = "auto";
|
||||||
gamut-mapping = "desaturate";
|
# gamut-mapping = "desaturate";
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,9 @@
|
|||||||
autoStart = true;
|
autoStart = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs;
|
||||||
pulseaudio
|
lib.optionals (device.is "ryu") [
|
||||||
];
|
# pulseaudio
|
||||||
|
playerctl
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,26 +2,151 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
inputs,
|
||||||
device,
|
device,
|
||||||
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.zen-browser.homeModules.beta
|
inputs.zen-browser.homeModules.beta
|
||||||
];
|
];
|
||||||
|
programs.zen-browser.darwinDefaultsId = "org.mozilla.firefox.plist";
|
||||||
programs.zen-browser = {
|
programs.zen-browser = {
|
||||||
enable = device.isLinux;
|
enable = true;
|
||||||
profiles.default = {
|
profiles.default = rec {
|
||||||
|
containersForce = true;
|
||||||
|
containers = {
|
||||||
|
Personal = {
|
||||||
|
color = "purple";
|
||||||
|
icon = "fingerprint";
|
||||||
|
id = 1;
|
||||||
|
};
|
||||||
|
Work = {
|
||||||
|
color = "blue";
|
||||||
|
icon = "briefcase";
|
||||||
|
id = 2;
|
||||||
|
};
|
||||||
|
Shopping = {
|
||||||
|
color = "yellow";
|
||||||
|
icon = "dollar";
|
||||||
|
id = 3;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
spacesForce = true;
|
||||||
|
spaces = let
|
||||||
|
containers = config.programs.zen-browser.profiles."default".containers;
|
||||||
|
in {
|
||||||
|
"Personal" = {
|
||||||
|
id = "0b4dab19-9b39-4f2c-8ad1-0268d9fa2e49";
|
||||||
|
icon = "👤";
|
||||||
|
container = containers."Personal".id;
|
||||||
|
position = 1000;
|
||||||
|
};
|
||||||
|
"Work" = {
|
||||||
|
id = "8f687163-6b15-4c3c-885f-8ffe465b386f";
|
||||||
|
icon = "💼";
|
||||||
|
container = containers."Work".id;
|
||||||
|
position = 2000;
|
||||||
|
};
|
||||||
|
"Shopping" = {
|
||||||
|
id = "74f46a1b-cdd7-408c-98d7-382a2b11bd51";
|
||||||
|
icon = "💸";
|
||||||
|
container = containers."Shopping".id;
|
||||||
|
position = 3000;
|
||||||
|
};
|
||||||
|
};
|
||||||
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
|
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||||
privacy-badger
|
|
||||||
violentmonkey
|
|
||||||
tridactyl
|
|
||||||
clearurls
|
clearurls
|
||||||
onepassword-password-manager
|
floccus
|
||||||
ublock-origin
|
|
||||||
i-dont-care-about-cookies
|
i-dont-care-about-cookies
|
||||||
keepa
|
keepa
|
||||||
|
onepassword-password-manager
|
||||||
|
privacy-badger
|
||||||
sponsorblock
|
sponsorblock
|
||||||
floccus
|
tridactyl
|
||||||
|
ublock-origin
|
||||||
|
violentmonkey
|
||||||
];
|
];
|
||||||
|
search = {
|
||||||
|
force = true;
|
||||||
|
default = "ddg";
|
||||||
|
engines = {
|
||||||
|
mynixos = {
|
||||||
|
name = "My NixOS";
|
||||||
|
urls = [
|
||||||
|
{
|
||||||
|
template = "https://mynixos.com/search?q={searchTerms}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||||
|
definedAliases = ["@nx"]; # Keep in mind that aliases defined here only work if they start with "@"
|
||||||
|
};
|
||||||
|
hm = {
|
||||||
|
name = "Home Manager Options";
|
||||||
|
urls = [
|
||||||
|
{
|
||||||
|
template = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
definedAliases = ["@hm"];
|
||||||
|
};
|
||||||
|
nv = {
|
||||||
|
name = "NixVim";
|
||||||
|
urls = [
|
||||||
|
{
|
||||||
|
template = "https://nix-community.github.io/nixvim/search";
|
||||||
|
params = [
|
||||||
|
{
|
||||||
|
name = "query";
|
||||||
|
value = "{searchTerms}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
definedAliases = ["@nv"];
|
||||||
|
};
|
||||||
|
lib = {
|
||||||
|
name = "Lib.rs";
|
||||||
|
urls = [
|
||||||
|
{
|
||||||
|
template = "https://lib.rs/search";
|
||||||
|
params = [
|
||||||
|
{
|
||||||
|
name = "q";
|
||||||
|
value = "{searchTerms}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
definedAliases = ["@lib"];
|
||||||
|
};
|
||||||
|
searchix = {
|
||||||
|
name = "Searchix";
|
||||||
|
urls = [
|
||||||
|
{
|
||||||
|
template = "https://searchix.ovh/?query={searchTerms}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
definedAliases = ["sx"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
pins = {
|
||||||
|
dashboard = {
|
||||||
|
id = "d163f090-67b7-47d2-8f76-7d638b9f742b";
|
||||||
|
workspace = spaces.Personal.id;
|
||||||
|
url = "https://dashboard.darksailor.dev";
|
||||||
|
isEssential = true;
|
||||||
|
position = 101;
|
||||||
|
};
|
||||||
|
github = {
|
||||||
|
id = "db2f3e36-9279-4b8d-8b5d-52a90f34ea0d";
|
||||||
|
workspace = spaces.Personal.id;
|
||||||
|
url = "https://github.com";
|
||||||
|
isEssential = true;
|
||||||
|
position = 102;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
pinsForce = true;
|
||||||
};
|
};
|
||||||
nativeMessagingHosts = [pkgs.tridactyl-native];
|
nativeMessagingHosts = [pkgs.tridactyl-native];
|
||||||
policies = {
|
policies = {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
home-manager = {
|
home-manager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
man.generateCaches = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|||||||
35
home/programs/attic.nix
Normal file
35
home/programs/attic.nix
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
attic-unwrapped = pkgs.attic-client.overrideAttrs (oldAttrs: {
|
||||||
|
patches =
|
||||||
|
(oldAttrs.patches or [])
|
||||||
|
++ [
|
||||||
|
# PR #309: Add environment variable support for login
|
||||||
|
# https://github.com/zhaofengli/attic/pull/309
|
||||||
|
(pkgs.fetchpatch {
|
||||||
|
url = "https://github.com/zhaofengli/attic/pull/309.patch";
|
||||||
|
hash = "sha256-mDoxA+e2bBZDvERp03SyYvkEdtH/bfWtZqKZv0uCS0M=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
});
|
||||||
|
in {
|
||||||
|
sops.secrets."attic/token" = {};
|
||||||
|
home.packages = [
|
||||||
|
(pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "attic-client";
|
||||||
|
version = "0.1.0";
|
||||||
|
src = attic-unwrapped;
|
||||||
|
buildInputs = [];
|
||||||
|
nativeBuildInputs = [pkgs.makeWrapper];
|
||||||
|
installPhase = ''
|
||||||
|
install -Dm755 $src/bin/attic $out/bin/attic
|
||||||
|
wrapProgram $out/bin/attic \
|
||||||
|
--run "export ATTIC_LOGIN_TOKEN=\`cat -v ${config.sops.secrets."attic/token".path}\`"
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -4,5 +4,5 @@
|
|||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
home.packages = lib.optionals (device.name != "shiro") [pkgs.blobdrop];
|
home.packages = lib.optionals (device.name == "ryu") [pkgs.blobdrop];
|
||||||
}
|
}
|
||||||
|
|||||||
17
home/programs/calendar.nix
Normal file
17
home/programs/calendar.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
programs.khal = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
default = {
|
||||||
|
# default_calendar = "fastmail";
|
||||||
|
};
|
||||||
|
view = {
|
||||||
|
agenda_event_format = "{calendar-color}{cancelled}{start-end-time-style} {title}{repeat-symbol}{reset}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.qcal.enable = true;
|
||||||
|
programs.vdirsyncer.enable = true;
|
||||||
|
services.vdirsyncer.enable = true;
|
||||||
|
accounts.calendar.accounts.fastmail.qcal.enable = true;
|
||||||
|
}
|
||||||
@@ -1,13 +1,8 @@
|
|||||||
{
|
{...}: {
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
device,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
programs.
|
programs.
|
||||||
carapace = {
|
carapace = {
|
||||||
enable = false;
|
enable = false;
|
||||||
enableFishIntegration = true;
|
enableFishIntegration = false;
|
||||||
enableNushellIntegration = true;
|
enableNushellIntegration = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
cratesNix,
|
cratesNix,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cargo-credential-1password = cratesNix.buildCrate "cargo-credential-1password" {};
|
cargo-credential-1password = cratesNix.buildCrate "cargo-credential-1password" {
|
||||||
|
meta.mainProgram = "cargo-credential-1password";
|
||||||
|
};
|
||||||
in
|
in
|
||||||
lib.mkIf (!device.isServer) {
|
lib.mkIf (!device.isServer) {
|
||||||
home.file.".cargo/config.toml".text =
|
home.file.".cargo/config.toml".text =
|
||||||
@@ -13,6 +15,7 @@ in
|
|||||||
[alias]
|
[alias]
|
||||||
lldb = ["with", "rust-lldb", "--"]
|
lldb = ["with", "rust-lldb", "--"]
|
||||||
t = ["nextest", "run"]
|
t = ["nextest", "run"]
|
||||||
|
pkgs = ["metadata", "--no-deps", "--format-version", "1"]
|
||||||
|
|
||||||
[net]
|
[net]
|
||||||
git-fetch-with-cli = true
|
git-fetch-with-cli = true
|
||||||
|
|||||||
27
home/programs/cfcli.nix
Normal file
27
home/programs/cfcli.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
sops.secrets."cloudflare/darksailor_dev_api_key" = {};
|
||||||
|
home.packages = [
|
||||||
|
# (pkgs.stdenv.mkDerivation {
|
||||||
|
# pname = "cfcli";
|
||||||
|
# version = "0.1.0";
|
||||||
|
# buildInputs = [pkgs.cloudflare-cli];
|
||||||
|
# nativeBuildInputs = [pkgs.makeWrapper];
|
||||||
|
# installPhase = ''
|
||||||
|
# $out/bin/cfcli \
|
||||||
|
# --run "export CF_API_KEY=\`cat -v ${config.sops.secrets."cloudflare/darksailor_dev_api_key".path}\`"
|
||||||
|
# '';
|
||||||
|
# })
|
||||||
|
(pkgs.writeShellScriptBin
|
||||||
|
"cfcli"
|
||||||
|
''
|
||||||
|
#!/bin/sh
|
||||||
|
export CF_API_KEY="$(cat -v ${config.sops.secrets."cloudflare/darksailor_dev_api_key".path})"
|
||||||
|
exec ${pkgs.cloudflare-cli}/bin/cfcli "$@"
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
}
|
||||||
1
home/programs/codex.nix
Normal file
1
home/programs/codex.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{pkgs, ...}: {home.packages = [pkgs.codex];}
|
||||||
@@ -4,12 +4,33 @@
|
|||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
|
# ./bluetui.nix
|
||||||
|
# ./goread.nix
|
||||||
|
# ./helix.nix
|
||||||
|
# ./iamb.nix
|
||||||
|
# ./magika.nix
|
||||||
|
# ./mpd.nix
|
||||||
|
# ./mpris-scrobbler.nix
|
||||||
|
# ./ncmpcpp.nix
|
||||||
|
# ./newsboat.nix
|
||||||
|
# ./nh.nix
|
||||||
|
# ./ryujinx.nix
|
||||||
|
# ./sxiv.nix
|
||||||
|
# ./tea.nix
|
||||||
|
# ./template.nix
|
||||||
|
# ./tuifeed.nix
|
||||||
|
# ./xh.nix
|
||||||
|
# ./yt-dlp.nix
|
||||||
|
# ./zellij.nix
|
||||||
|
|
||||||
../../modules
|
../../modules
|
||||||
|
|
||||||
./1password-cli.nix
|
./1password-cli.nix
|
||||||
./aichat.nix
|
./aichat.nix
|
||||||
./alejandra.nix
|
./alejandra.nix
|
||||||
./aria2.nix
|
./aria2.nix
|
||||||
./ast-grep.nix
|
./ast-grep.nix
|
||||||
|
./attic.nix
|
||||||
./atuin.nix
|
./atuin.nix
|
||||||
./bat.nix
|
./bat.nix
|
||||||
./binwalk.nix
|
./binwalk.nix
|
||||||
@@ -17,8 +38,11 @@
|
|||||||
./bottom.nix
|
./bottom.nix
|
||||||
./btop.nix
|
./btop.nix
|
||||||
./cachix.nix
|
./cachix.nix
|
||||||
|
./calendar.nix
|
||||||
./carapace.nix
|
./carapace.nix
|
||||||
./cargo.nix
|
./cargo.nix
|
||||||
|
./cfcli.nix
|
||||||
|
./codex.nix
|
||||||
./ddcbacklight.nix
|
./ddcbacklight.nix
|
||||||
./deploy-rs.nix
|
./deploy-rs.nix
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
@@ -37,11 +61,13 @@
|
|||||||
./himalaya.nix
|
./himalaya.nix
|
||||||
./hyprshade.nix
|
./hyprshade.nix
|
||||||
./jq.nix
|
./jq.nix
|
||||||
|
./jujutsu.nix
|
||||||
./just.nix
|
./just.nix
|
||||||
./ncpamixer.nix
|
./ncpamixer.nix
|
||||||
./neomutt.nix
|
./neomutt.nix
|
||||||
./neovim.nix
|
./neovim.nix
|
||||||
./nix-index.nix
|
./nix-index.nix
|
||||||
|
./nixify.nix
|
||||||
./nushell.nix
|
./nushell.nix
|
||||||
./omnix.nix
|
./omnix.nix
|
||||||
./opencode.nix
|
./opencode.nix
|
||||||
@@ -58,23 +84,7 @@
|
|||||||
./tmux.nix
|
./tmux.nix
|
||||||
./uv.nix
|
./uv.nix
|
||||||
./yazi.nix
|
./yazi.nix
|
||||||
./yt-dlp.nix
|
./yq.nix
|
||||||
./zoxide.nix
|
./zoxide.nix
|
||||||
# ./bluetui.nix
|
|
||||||
# ./goread.nix
|
|
||||||
# ./helix.nix
|
|
||||||
# ./magika.nix
|
|
||||||
# ./mpd.nix
|
|
||||||
# ./mpris-scrobbler.nix
|
|
||||||
# ./ncmpcpp.nix
|
|
||||||
# ./newsboat.nix
|
|
||||||
# ./nh.nix
|
|
||||||
# ./ryujinx.nix
|
|
||||||
# ./sxiv.nix
|
|
||||||
# ./tea.nix
|
|
||||||
# ./template.nix
|
|
||||||
# ./tuifeed.nix
|
|
||||||
# ./xh.nix
|
|
||||||
# ./zellij.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1,8 @@
|
|||||||
{pkgs, ...}: {home.packages = [pkgs.deploy-rs.deploy-rs];}
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
device,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = lib.optionals (device.is "ryu") [pkgs.deploy-rs.deploy-rs];
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
j = "just --choose";
|
j = "just --choose";
|
||||||
# t = "zellij a -c --index 0";
|
# t = "zellij a -c --index 0";
|
||||||
t = "tmux";
|
t = "tmux";
|
||||||
|
neorg = "nvim -c ':Neorg index'";
|
||||||
};
|
};
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
g = "git";
|
g = "git";
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
'';
|
'';
|
||||||
# ${pkgs.spotify-player}/bin/spotify_player generate fish | source
|
# ${pkgs.spotify-player}/bin/spotify_player generate fish | source
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
if test -n "$TMUX"; ${lib.getExe pkgs.fastfetch} --logo-type sixel; else ${lib.getExe pkgs.fastfetch}; end
|
if test -n "$TMUX"; ${lib.getExe pkgs.fastfetch} --logo-type kitty-icat; else ${lib.getExe pkgs.fastfetch}; end
|
||||||
# ${pkgs.nb}/bin/nb todo undone
|
# ${pkgs.nb}/bin/nb todo undone
|
||||||
${lib.optionalString (device.isLinux && !device.isNix) "source /etc/profile.d/nix-daemon.fish"}
|
${lib.optionalString (device.isLinux && !device.isNix) "source /etc/profile.d/nix-daemon.fish"}
|
||||||
${lib.optionalString (device.is "ryu") ''
|
${lib.optionalString (device.is "ryu") ''
|
||||||
@@ -43,6 +44,16 @@
|
|||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
home.shell.enableFishIntegration = true;
|
||||||
|
|
||||||
|
# programs.bash = {
|
||||||
|
# enable = true;
|
||||||
|
# initExtra = ''
|
||||||
|
# if [[ $- == *i* && -z "$FISH_VERSION" ]]; then
|
||||||
|
# ${lib.getExe pkgs.fish}
|
||||||
|
# fi
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (!(device.is "tsuba")) {
|
// lib.optionalAttrs (!(device.is "tsuba")) {
|
||||||
stylix.targets.fish.enable = false;
|
stylix.targets.fish.enable = false;
|
||||||
|
|||||||
3
home/programs/iamb.nix
Normal file
3
home/programs/iamb.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
home.packages = [pkgs.iamb];
|
||||||
|
}
|
||||||
1
home/programs/jujutsu.nix
Normal file
1
home/programs/jujutsu.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{pkgs, ...}: {home.packages = [pkgs.jujutsu];}
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
{pkgs, ...}: {
|
{pkgs, ...}: let
|
||||||
|
theme = builtins.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/catppuccin/neomutt/refs/heads/main/neomuttrc";
|
||||||
|
sha256 = "sha256:1q086p5maqwxa4gh6z8g7h3nfavdmkbql025ibdhglpz46hsq0hs";
|
||||||
|
};
|
||||||
|
in {
|
||||||
programs.neomutt = {
|
programs.neomutt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
vimKeys = true;
|
vimKeys = true;
|
||||||
@@ -6,6 +11,9 @@
|
|||||||
sidebar = {
|
sidebar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
source ${theme}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
programs.notmuch = {
|
programs.notmuch = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -17,4 +25,38 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
neomutt.enable = true;
|
neomutt.enable = true;
|
||||||
};
|
};
|
||||||
|
services.imapnotify = {
|
||||||
|
enable = true;
|
||||||
|
path = [pkgs.coreutils pkgs.isync pkgs.libnotify];
|
||||||
|
};
|
||||||
|
accounts.email.accounts.fastmail.imapnotify = {
|
||||||
|
enable = true;
|
||||||
|
boxes = ["Inbox"];
|
||||||
|
onNotify = "${pkgs.writeShellScript "mbsync-notify" ''
|
||||||
|
${pkgs.isync}/bin/mbsync $1
|
||||||
|
${pkgs.libnotify}/bin/notify-send "New Mail" "New email in $1"
|
||||||
|
''} %s";
|
||||||
|
};
|
||||||
|
programs.mbsync.enable = true;
|
||||||
|
services.mbsync.enable = pkgs.stdenv.isLinux;
|
||||||
|
|
||||||
|
# launchd.agents.mbsync = {
|
||||||
|
# enable = true;
|
||||||
|
# config = {
|
||||||
|
# # A label for the service
|
||||||
|
# Label = "dev.darksailor.atuin-daemon";
|
||||||
|
# # The command to run
|
||||||
|
# ProgramArguments = [
|
||||||
|
# "${pkgs.atuin}/bin/atuin"
|
||||||
|
# "daemon"
|
||||||
|
# ];
|
||||||
|
# # Run the service when you log in
|
||||||
|
# RunAtLoad = true;
|
||||||
|
# # Keep the process alive, or restart if it dies
|
||||||
|
# KeepAlive = true;
|
||||||
|
# # Log files
|
||||||
|
# StandardOutPath = "${device.home}/Library/Logs/atuin-daemon.log";
|
||||||
|
# StandardErrorPath = "${device.home}/Library/Logs/atuin-daemon.error.log";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
}
|
}
|
||||||
|
|||||||
9
home/programs/nixify.nix
Normal file
9
home/programs/nixify.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = [
|
||||||
|
inputs.nixify.packages.${pkgs.system}.default
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -26,4 +26,5 @@
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
home.shell.enableNushellIntegration = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,20 @@
|
|||||||
lib.optionalAttrs (device.is "ryu" || device.is "kuro") {
|
lib.optionalAttrs (device.is "ryu" || device.is "kuro") {
|
||||||
programs.opencode = {
|
programs.opencode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
settings.provider = {
|
||||||
|
ollama = {
|
||||||
|
models = {
|
||||||
|
"glm-4.7-flash" = {
|
||||||
|
# "_launch" = true;
|
||||||
|
name = "glm-4.7-flash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
name = "Ollama (local)";
|
||||||
|
npm = "@ai-sdk/openai-compatible";
|
||||||
|
options = {
|
||||||
|
baseURL = "https://ollama.darksailor.dev/v1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,11 +16,6 @@
|
|||||||
user = "git";
|
user = "git";
|
||||||
host = "github.com";
|
host = "github.com";
|
||||||
};
|
};
|
||||||
# mirai = {
|
|
||||||
# user = "fs0c131y";
|
|
||||||
# hostname = "mirai.darksailor.dev";
|
|
||||||
# forwardAgent = true;
|
|
||||||
# };
|
|
||||||
tako = {
|
tako = {
|
||||||
user = "servius";
|
user = "servius";
|
||||||
hostname = "tako.darksailor.dev";
|
hostname = "tako.darksailor.dev";
|
||||||
|
|||||||
@@ -17,5 +17,6 @@
|
|||||||
cache_dir = config.home.homeDirectory + "/.cache/yazi/previews";
|
cache_dir = config.home.homeDirectory + "/.cache/yazi/previews";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
shellWrapperName = "yy";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
1
home/programs/yq.nix
Normal file
1
home/programs/yq.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{pkgs, ...}: {home.packages = [pkgs.yq];}
|
||||||
@@ -36,11 +36,11 @@ in {
|
|||||||
pkgs.writeShellApplication {
|
pkgs.writeShellApplication {
|
||||||
name = "git-install-prepare-commit-msg";
|
name = "git-install-prepare-commit-msg";
|
||||||
text = ''
|
text = ''
|
||||||
cp ${../scripts/prepare-commit-msg} .git/hooks/prepare-commit-msg
|
ln -sf ${../scripts/prepare-commit-msg} .git/hooks/prepare-commit-msg
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
(mkScript ../scripts/yt-dlp.sh (with pkgs; [yt-dlp]))
|
# (mkScript ../scripts/yt-dlp.sh (with pkgs; [yt-dlp]))
|
||||||
(mkScript ../scripts/autossh.sh (with pkgs; [autossh openssh]))
|
# (mkScript ../scripts/autossh.sh (with pkgs; [autossh openssh]))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
{...}: {
|
{...}: {
|
||||||
imports = [
|
imports = [
|
||||||
|
./gtk.nix
|
||||||
|
./gui.nix
|
||||||
|
./hyprland.nix
|
||||||
|
./hyprmon.nix
|
||||||
|
./hyprpaper.nix
|
||||||
|
./ironbar
|
||||||
|
./kdeconnect.nix
|
||||||
|
./remmina.nix
|
||||||
|
# ./ollama.nix
|
||||||
./swaync.nix
|
./swaync.nix
|
||||||
./swayosd.nix
|
./swayosd.nix
|
||||||
./kdeconnect.nix
|
|
||||||
./gtk.nix
|
|
||||||
# ./anyrun.nix
|
|
||||||
./ironbar
|
|
||||||
./gui.nix
|
|
||||||
# ./eww.nix
|
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
./hyprmon.nix
|
./ironclaw.nix
|
||||||
./hyprland.nix
|
# ./anyrun.nix
|
||||||
./hyprpaper.nix
|
# ./eww.nix
|
||||||
./remmina.nix
|
|
||||||
# ./wallpaperengine.nix
|
# ./wallpaperengine.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
device,
|
device,
|
||||||
lib,
|
lib,
|
||||||
|
inputs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# lib.optionalAttrs device.isNix
|
# lib.optionalAttrs device.isNix
|
||||||
@@ -31,6 +32,8 @@
|
|||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = device.is "ryu";
|
enable = device.is "ryu";
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
package = pkgs.hyprland;
|
||||||
|
portalPackage = pkgs.xdph;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
# source = "${pkgs.catppuccinThemes.hyprland}/themes/mocha.conf";
|
# source = "${pkgs.catppuccinThemes.hyprland}/themes/mocha.conf";
|
||||||
@@ -61,9 +64,9 @@
|
|||||||
{
|
{
|
||||||
output = device.monitors.secondary;
|
output = device.monitors.secondary;
|
||||||
mode = "2560x1440@170";
|
mode = "2560x1440@170";
|
||||||
position = "-1440x-1120";
|
position = "-2560x0";
|
||||||
scale = 1;
|
scale = 1;
|
||||||
transform = 1;
|
transform = 0;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
output = device.monitors.tertiary;
|
output = device.monitors.tertiary;
|
||||||
@@ -156,24 +159,23 @@
|
|||||||
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
|
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
|
||||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||||
|
|
||||||
windowrulev2 = [
|
windowrule = [
|
||||||
# "float, title:^(Steam)$"
|
# "match:title ^(Steam)$ float"
|
||||||
"float, title:^(Archetype.*)$"
|
"match:title ^(Archetype.*)$ float"
|
||||||
"float, class:(.*nextcloud.*)"
|
"match:class (.*nextcloud.*) float"
|
||||||
"float, class:org.kde.kdeconnect.app"
|
"match:class org.kde.kdeconnect.app float"
|
||||||
];
|
];
|
||||||
|
|
||||||
# "misc:vfr" = true;
|
|
||||||
|
|
||||||
env = [
|
env = [
|
||||||
"XCURSOR_SIZE,24"
|
"XCURSOR_SIZE,24"
|
||||||
"XDG_SESSION_TYPE,wayland"
|
"XDG_SESSION_TYPE,wayland"
|
||||||
"MOZ_ENABLE_WAYLAND,1"
|
"MOZ_ENABLE_WAYLAND,1"
|
||||||
"QT_QPA_PLATFORM,wayland"
|
"QT_QPA_PLATFORM,wayland"
|
||||||
];
|
];
|
||||||
|
|
||||||
exec-once = [
|
exec-once = [
|
||||||
# "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
# "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
||||||
"${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
|
"${pkgs.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
|
||||||
# "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
|
# "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
|
||||||
# "${pkgs.swww}/bin/swww init; swww img ~/.local/share/dotfiles/images/wallpaper.jpg"
|
# "${pkgs.swww}/bin/swww init; swww img ~/.local/share/dotfiles/images/wallpaper.jpg"
|
||||||
# "${pkgs.ironbar}/bin/ironbar"
|
# "${pkgs.ironbar}/bin/ironbar"
|
||||||
@@ -204,7 +206,7 @@
|
|||||||
"$mainMod, d, exec, ${lib.getExe pkgs.vicinae} toggle"
|
"$mainMod, d, exec, ${lib.getExe pkgs.vicinae} toggle"
|
||||||
"$mainMod, Space, exec, ${lib.getExe pkgs.vicinae} toggle"
|
"$mainMod, Space, exec, ${lib.getExe pkgs.vicinae} toggle"
|
||||||
"$mainMod, p, pseudo, # dwindle"
|
"$mainMod, p, pseudo, # dwindle"
|
||||||
"$mainMod, v, togglesplit,"
|
"$mainMod, v, layoutmsg, togglesplit"
|
||||||
"$mainMod, a, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t"
|
"$mainMod, a, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t"
|
||||||
"$mainMod, Tab, cyclenext"
|
"$mainMod, Tab, cyclenext"
|
||||||
# Audio
|
# Audio
|
||||||
|
|||||||
@@ -7,25 +7,29 @@
|
|||||||
services.hyprpaper = let
|
services.hyprpaper = let
|
||||||
wallpapers = import ../../utils/wallhaven.nix {inherit pkgs;};
|
wallpapers = import ../../utils/wallhaven.nix {inherit pkgs;};
|
||||||
nextcloudWallpapers = name: config.home.homeDirectory + "/Nextcloud/Wallpapers/" + name;
|
nextcloudWallpapers = name: config.home.homeDirectory + "/Nextcloud/Wallpapers/" + name;
|
||||||
silksongFleas = nextcloudWallpapers "silksong-fleas.jpg";
|
# silksongFleas = nextcloudWallpapers "silksong-fleas.jpg";
|
||||||
silksongShadeLord = nextcloudWallpapers "silksong-shadelord.jpg";
|
|
||||||
|
# The artist https://www.bilibili.com/video/BV1s44y1S7MM/
|
||||||
|
bocchiVertical = nextcloudWallpapers "bocchi-guitar.jpg";
|
||||||
|
frieren = nextcloudWallpapers "frieren.png";
|
||||||
in {
|
in {
|
||||||
enable = device.is "ryu";
|
enable = device.is "ryu";
|
||||||
settings = {
|
settings = {
|
||||||
|
splash = false;
|
||||||
wallpaper = [
|
wallpaper = [
|
||||||
{
|
{
|
||||||
monitor = device.monitors.primary;
|
monitor = device.monitors.primary;
|
||||||
path = silksongShadeLord;
|
path = wallpapers.moon;
|
||||||
fit_mode = "cover";
|
fit_mode = "cover";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
monitor = device.monitors.secondary;
|
monitor = device.monitors.secondary;
|
||||||
path = wallpapers.frieren_3;
|
path = frieren;
|
||||||
fit_mode = "cover";
|
fit_mode = "cover";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
monitor = device.monitors.tertiary;
|
monitor = device.monitors.tertiary;
|
||||||
path = silksongFleas;
|
path = bocchiVertical;
|
||||||
fit_mode = "cover";
|
fit_mode = "cover";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -36,45 +36,45 @@
|
|||||||
{type = "clock";}
|
{type = "clock";}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"${device.monitors.primary}" = {
|
# "${device.monitors.primary}" = {
|
||||||
position = "bottom";
|
# position = "bottom";
|
||||||
icon_theme = "Papirus-Dark";
|
# icon_theme = "Papirus-Dark";
|
||||||
end = [
|
# end = [
|
||||||
{
|
# {
|
||||||
type = "sys_info";
|
# type = "sys_info";
|
||||||
format = [
|
# format = [
|
||||||
" CPU {cpu_percent}% | {temp_c:coretemp-Package-id-0}°C"
|
# " CPU {cpu_percent}% | {temp_c:coretemp-Package-id-0}°C"
|
||||||
" RAM {memory_used}GB/{memory_total}GB"
|
# " RAM {memory_used}GB/{memory_total}GB"
|
||||||
];
|
# ];
|
||||||
interval = {
|
# interval = {
|
||||||
cpu = 1;
|
# cpu = 1;
|
||||||
temps = 5;
|
# temps = 5;
|
||||||
memory = 30;
|
# memory = 30;
|
||||||
# disks= 300;
|
# # disks= 300;
|
||||||
# networks= 3;
|
# # networks= 3;
|
||||||
};
|
# };
|
||||||
}
|
# }
|
||||||
];
|
# ];
|
||||||
start = [
|
# start = [
|
||||||
{
|
# {
|
||||||
type = "workspaces";
|
# type = "workspaces";
|
||||||
name_map = {
|
# name_map = {
|
||||||
"1" = "icon:kitty";
|
# "1" = "icon:kitty";
|
||||||
"2" = "icon:code";
|
# "2" = "icon:code";
|
||||||
"3" = "icon:firefox";
|
# "3" = "icon:firefox";
|
||||||
"4" = "icon:slack";
|
# "4" = "icon:slack";
|
||||||
# "5" = "icon:steam";
|
# # "5" = "icon:steam";
|
||||||
# "6" = "icon:foot";
|
# # "6" = "icon:foot";
|
||||||
# "7" = "icon:foot";
|
# # "7" = "icon:foot";
|
||||||
# "8" = "icon:firefox";
|
# # "8" = "icon:firefox";
|
||||||
# "9" = "icon:discord";
|
# # "9" = "icon:discord";
|
||||||
# "10" = "icon:spotify";
|
# # "10" = "icon:spotify";
|
||||||
};
|
# };
|
||||||
favorites = ["1" "2" "3" "4"];
|
# favorites = ["1" "2" "3" "4"];
|
||||||
all_monitors = false;
|
# all_monitors = false;
|
||||||
}
|
# }
|
||||||
];
|
# ];
|
||||||
};
|
# };
|
||||||
"${device.monitors.tertiary}" = {
|
"${device.monitors.tertiary}" = {
|
||||||
position = "bottom";
|
position = "bottom";
|
||||||
icon_theme = "Papirus-Dark";
|
icon_theme = "Papirus-Dark";
|
||||||
|
|||||||
12
home/services/ironclaw.nix
Normal file
12
home/services/ironclaw.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
device,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages =
|
||||||
|
lib.optionals (device.is "ryu")
|
||||||
|
[
|
||||||
|
pkgs.ironclaw
|
||||||
|
];
|
||||||
|
}
|
||||||
7
home/services/ollama.nix
Normal file
7
home/services/ollama.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
device,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.ollama.enable = device.is "shiro";
|
||||||
|
}
|
||||||
@@ -5,28 +5,28 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
lib.mkIf (device.is "ryu") {
|
lib.mkIf (device.is "ryu") {
|
||||||
# systemd.user.services.wallpaperengine = {
|
systemd.user.services.wallpaperengine = {
|
||||||
# Unit = {
|
Unit = {
|
||||||
# Description = "Linux Wallpaper Engine";
|
Description = "Linux Wallpaper Engine";
|
||||||
# After = ["hyprland-session.target"];
|
After = ["hyprland-session.target"];
|
||||||
# Wants = ["hyprland-session.target"];
|
Wants = ["hyprland-session.target"];
|
||||||
# PartOf = ["hyprland-session.target"];
|
PartOf = ["hyprland-session.target"];
|
||||||
# };
|
};
|
||||||
#
|
|
||||||
# Service = {
|
Service = {
|
||||||
# Environment = [
|
Environment = [
|
||||||
# "XDG_SESSION_TYPE=wayland"
|
"XDG_SESSION_TYPE=wayland"
|
||||||
# ];
|
];
|
||||||
# Type = "simple";
|
Type = "simple";
|
||||||
# ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
|
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
|
||||||
# ExecStart = "${pkgs.linux-wallpaperengine}/bin/linux-wallpaperengine --silent --no-audio-processing -f 15 --scaling fill --screen-root HDMI-A-1 --bg 2780316434";
|
ExecStart = "${pkgs.linux-wallpaperengine}/bin/linux-wallpaperengine --silent --no-audio-processing -f 15 --scaling fill --screen-root HDMI-A-1 --bg 2780316434";
|
||||||
# Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
# RestartSec = 5;
|
RestartSec = 5;
|
||||||
# TimeoutStartSec = 30;
|
TimeoutStartSec = 30;
|
||||||
# };
|
};
|
||||||
#
|
|
||||||
# Install = {
|
Install = {
|
||||||
# WantedBy = ["hyprland-session.target"];
|
WantedBy = ["hyprland-session.target"];
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
device,
|
device,
|
||||||
|
inputs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
@@ -10,10 +11,9 @@
|
|||||||
hyprland.default = ["hyprland"];
|
hyprland.default = ["hyprland"];
|
||||||
common.default = ["*" "hyprland"];
|
common.default = ["*" "hyprland"];
|
||||||
};
|
};
|
||||||
extraPortals = with pkgs; [
|
|
||||||
kdePackages.xdg-desktop-portal-kde
|
|
||||||
xdg-desktop-portal-hyprland
|
|
||||||
xdg-desktop-portal-gtk
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
# // lib.optionalAttrs (device.is "ryu") {
|
||||||
|
# environment.pathsToLink = ["/share/xdg-desktop-portal" "/share/applications"];
|
||||||
|
# }
|
||||||
|
|
||||||
|
|||||||
2
justfile
2
justfile
@@ -41,3 +41,5 @@ add program:
|
|||||||
alejandra fmt home/programs/{{program}}.nix home/programs/default.nix
|
alejandra fmt home/programs/{{program}}.nix home/programs/default.nix
|
||||||
git add home/programs/{{program}}.nix
|
git add home/programs/{{program}}.nix
|
||||||
|
|
||||||
|
# add-secret secret:
|
||||||
|
# openssl rand -hex 32 | tr -d '\n' | jq -sR | sops set --value-stdin secrets/secrets.yaml {{secret}}
|
||||||
|
|||||||
162
modules/nixos/affine.nix
Normal file
162
modules/nixos/affine.nix
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.services.affine;
|
||||||
|
dbName = "affine";
|
||||||
|
dbUser = "affine";
|
||||||
|
in {
|
||||||
|
options.services.affine = {
|
||||||
|
enable = mkEnableOption "AFFiNE self-hosted workspace";
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 3010;
|
||||||
|
description = "Port for the AFFiNE server to listen on";
|
||||||
|
};
|
||||||
|
|
||||||
|
domain = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "Public domain for AFFiNE (e.g. notes.darksailor.dev)";
|
||||||
|
};
|
||||||
|
|
||||||
|
imageTag = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "stable";
|
||||||
|
description = "Docker image tag for AFFiNE (stable, beta, canary)";
|
||||||
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "/var/lib/affine";
|
||||||
|
description = "Base data directory for AFFiNE storage";
|
||||||
|
};
|
||||||
|
|
||||||
|
environmentFiles = mkOption {
|
||||||
|
type = types.listOf types.path;
|
||||||
|
default = [];
|
||||||
|
description = "Environment files containing secrets (DB password, etc.)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# Create data directories
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d ${cfg.dataDir} 0755 root root -"
|
||||||
|
"d ${cfg.dataDir}/storage 0755 root root -"
|
||||||
|
"d ${cfg.dataDir}/config 0755 root root -"
|
||||||
|
"d ${cfg.dataDir}/postgres 0700 root root -"
|
||||||
|
"d ${cfg.dataDir}/redis 0755 root root -"
|
||||||
|
];
|
||||||
|
|
||||||
|
virtualisation.oci-containers = {
|
||||||
|
backend = "docker";
|
||||||
|
containers = {
|
||||||
|
affine-postgres = {
|
||||||
|
image = "pgvector/pgvector:pg16";
|
||||||
|
volumes = [
|
||||||
|
"${cfg.dataDir}/postgres:/var/lib/postgresql/data"
|
||||||
|
];
|
||||||
|
environment = {
|
||||||
|
POSTGRES_USER = dbUser;
|
||||||
|
POSTGRES_DB = dbName;
|
||||||
|
POSTGRES_INITDB_ARGS = "--data-checksums";
|
||||||
|
POSTGRES_HOST_AUTH_METHOD = "trust";
|
||||||
|
};
|
||||||
|
environmentFiles = cfg.environmentFiles;
|
||||||
|
extraOptions = [
|
||||||
|
"--health-cmd=pg_isready -U ${dbUser} -d ${dbName}"
|
||||||
|
"--health-interval=10s"
|
||||||
|
"--health-timeout=5s"
|
||||||
|
"--health-retries=5"
|
||||||
|
];
|
||||||
|
networks = ["affine-net"];
|
||||||
|
};
|
||||||
|
|
||||||
|
affine-redis = {
|
||||||
|
image = "redis:7";
|
||||||
|
volumes = [
|
||||||
|
"${cfg.dataDir}/redis:/data"
|
||||||
|
];
|
||||||
|
networks = ["affine-net"];
|
||||||
|
extraOptions = [
|
||||||
|
"--health-cmd=redis-cli --raw incr ping"
|
||||||
|
"--health-interval=10s"
|
||||||
|
"--health-timeout=5s"
|
||||||
|
"--health-retries=5"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
affine = {
|
||||||
|
image = "ghcr.io/toeverything/affine:${cfg.imageTag}";
|
||||||
|
ports = ["127.0.0.1:${toString cfg.port}:3010"];
|
||||||
|
dependsOn = [
|
||||||
|
"affine-postgres"
|
||||||
|
"affine-redis"
|
||||||
|
"affine-migration"
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
"${cfg.dataDir}/storage:/root/.affine/storage"
|
||||||
|
"${cfg.dataDir}/config:/root/.affine/config"
|
||||||
|
];
|
||||||
|
environment = {
|
||||||
|
AFFINE_SERVER_PORT = "3010";
|
||||||
|
AFFINE_SERVER_HOST = cfg.domain;
|
||||||
|
AFFINE_SERVER_HTTPS = "true";
|
||||||
|
AFFINE_SERVER_EXTERNAL_URL = "https://${cfg.domain}";
|
||||||
|
REDIS_SERVER_HOST = "affine-redis";
|
||||||
|
DATABASE_URL = "postgresql://${dbUser}:$${AFFINE_DB_PASSWORD:-affine}@affine-postgres:5432/${dbName}";
|
||||||
|
AFFINE_INDEXER_ENABLED = "false";
|
||||||
|
};
|
||||||
|
environmentFiles = cfg.environmentFiles;
|
||||||
|
networks = ["affine-net"];
|
||||||
|
};
|
||||||
|
|
||||||
|
affine-migration = {
|
||||||
|
image = "ghcr.io/toeverything/affine:${cfg.imageTag}";
|
||||||
|
dependsOn = [
|
||||||
|
"affine-postgres"
|
||||||
|
"affine-redis"
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
"${cfg.dataDir}/storage:/root/.affine/storage"
|
||||||
|
"${cfg.dataDir}/config:/root/.affine/config"
|
||||||
|
];
|
||||||
|
cmd = ["sh" "-c" "node ./scripts/self-host-predeploy.js"];
|
||||||
|
environment = {
|
||||||
|
REDIS_SERVER_HOST = "affine-redis";
|
||||||
|
DATABASE_URL = "postgresql://${dbUser}:$${AFFINE_DB_PASSWORD:-affine}@affine-postgres:5432/${dbName}";
|
||||||
|
AFFINE_INDEXER_ENABLED = "false";
|
||||||
|
};
|
||||||
|
environmentFiles = cfg.environmentFiles;
|
||||||
|
networks = ["affine-net"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Create the Docker network
|
||||||
|
# systemd.services.affine-network = {
|
||||||
|
# description = "Create AFFiNE Docker network";
|
||||||
|
# after = ["docker.service"];
|
||||||
|
# wantedBy = ["multi-user.target"];
|
||||||
|
# serviceConfig = {
|
||||||
|
# Type = "oneshot";
|
||||||
|
# RemainAfterExit = true;
|
||||||
|
# # ExecStart = "${config.virtualisation.docker.package}/bin/docker network create affine-net";
|
||||||
|
# # ExecStop = "${config.virtualisation.docker.package}/bin/docker network remove affine-net";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# Ensure containers start after the network is created
|
||||||
|
# systemd.services.docker-affine.after = ["affine-network.service"];
|
||||||
|
# systemd.services.docker-affine.requires = ["affine-network.service"];
|
||||||
|
# systemd.services.docker-affine-postgres.after = ["affine-network.service"];
|
||||||
|
# systemd.services.docker-affine-postgres.requires = ["affine-network.service"];
|
||||||
|
# systemd.services.docker-affine-redis.after = ["affine-network.service"];
|
||||||
|
# systemd.services.docker-affine-redis.requires = ["affine-network.service"];
|
||||||
|
# systemd.services.docker-affine-migration.after = ["affine-network.service"];
|
||||||
|
# systemd.services.docker-affine-migration.requires = ["affine-network.service"];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,480 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; let
|
|
||||||
cfg = config.services.caddy;
|
|
||||||
|
|
||||||
certs = config.security.acme.certs;
|
|
||||||
virtualHosts = attrValues cfg.virtualHosts;
|
|
||||||
acmeEnabledVhosts = filter (hostOpts: hostOpts.useACMEHost != null) virtualHosts;
|
|
||||||
vhostCertNames = unique (map (hostOpts: hostOpts.useACMEHost) acmeEnabledVhosts);
|
|
||||||
dependentCertNames = filter (cert: certs.${cert}.dnsProvider == null) vhostCertNames; # those that might depend on the HTTP server
|
|
||||||
independentCertNames = filter (cert: certs.${cert}.dnsProvider != null) vhostCertNames; # those that don't depend on the HTTP server
|
|
||||||
|
|
||||||
mkVHostConf = hostOpts: let
|
|
||||||
sslCertDir = config.security.acme.certs.${hostOpts.useACMEHost}.directory;
|
|
||||||
in ''
|
|
||||||
${hostOpts.hostName} ${concatStringsSep " " hostOpts.serverAliases} {
|
|
||||||
${optionalString (
|
|
||||||
hostOpts.listenAddresses != []
|
|
||||||
) "bind ${concatStringsSep " " hostOpts.listenAddresses}"}
|
|
||||||
${optionalString (
|
|
||||||
hostOpts.useACMEHost != null
|
|
||||||
) "tls ${sslCertDir}/cert.pem ${sslCertDir}/key.pem"}
|
|
||||||
log {
|
|
||||||
${hostOpts.logFormat}
|
|
||||||
}
|
|
||||||
|
|
||||||
${hostOpts.extraConfig}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
settingsFormat = pkgs.formats.json {};
|
|
||||||
|
|
||||||
configFile =
|
|
||||||
if cfg.settings != {}
|
|
||||||
then settingsFormat.generate "caddy.json" cfg.settings
|
|
||||||
else let
|
|
||||||
Caddyfile = pkgs.writeTextDir "Caddyfile" ''
|
|
||||||
{
|
|
||||||
${cfg.globalConfig}
|
|
||||||
}
|
|
||||||
${cfg.extraConfig}
|
|
||||||
${concatMapStringsSep "\n" mkVHostConf virtualHosts}
|
|
||||||
'';
|
|
||||||
|
|
||||||
Caddyfile-formatted = pkgs.runCommand "Caddyfile-formatted" {} ''
|
|
||||||
mkdir -p $out
|
|
||||||
cp --no-preserve=mode ${Caddyfile}/Caddyfile $out/Caddyfile
|
|
||||||
${lib.getExe cfg.package} fmt --overwrite $out/Caddyfile
|
|
||||||
'';
|
|
||||||
in "${
|
|
||||||
if pkgs.stdenv.buildPlatform == pkgs.stdenv.hostPlatform
|
|
||||||
then Caddyfile-formatted
|
|
||||||
else Caddyfile
|
|
||||||
}/Caddyfile";
|
|
||||||
|
|
||||||
etcConfigFile = "caddy/caddy_config";
|
|
||||||
|
|
||||||
configPath = "/etc/${etcConfigFile}";
|
|
||||||
|
|
||||||
mkCertOwnershipAssertion = import ../../../security/acme/mk-cert-ownership-assertion.nix lib;
|
|
||||||
in {
|
|
||||||
imports = [
|
|
||||||
(mkRemovedOptionModule [
|
|
||||||
"services"
|
|
||||||
"caddy"
|
|
||||||
"agree"
|
|
||||||
] "this option is no longer necessary for Caddy 2")
|
|
||||||
(mkRenamedOptionModule ["services" "caddy" "ca"] ["services" "caddy" "acmeCA"])
|
|
||||||
(mkRenamedOptionModule ["services" "caddy" "config"] ["services" "caddy" "extraConfig"])
|
|
||||||
];
|
|
||||||
|
|
||||||
# interface
|
|
||||||
options.services.caddy = {
|
|
||||||
enable = mkEnableOption "Caddy web server";
|
|
||||||
|
|
||||||
user = mkOption {
|
|
||||||
default = "caddy";
|
|
||||||
type = types.str;
|
|
||||||
description = ''
|
|
||||||
User account under which caddy runs.
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
If left as the default value this user will automatically be created
|
|
||||||
on system activation, otherwise you are responsible for
|
|
||||||
ensuring the user exists before the Caddy service starts.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
group = mkOption {
|
|
||||||
default = "caddy";
|
|
||||||
type = types.str;
|
|
||||||
description = ''
|
|
||||||
Group under which caddy runs.
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
If left as the default value this group will automatically be created
|
|
||||||
on system activation, otherwise you are responsible for
|
|
||||||
ensuring the group exists before the Caddy service starts.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkPackageOption pkgs "caddy" {};
|
|
||||||
|
|
||||||
dataDir = mkOption {
|
|
||||||
type = types.path;
|
|
||||||
default = "/var/lib/caddy";
|
|
||||||
description = ''
|
|
||||||
The data directory for caddy.
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
If left as the default value this directory will automatically be created
|
|
||||||
before the Caddy server starts, otherwise you are responsible for ensuring
|
|
||||||
the directory exists with appropriate ownership and permissions.
|
|
||||||
|
|
||||||
Caddy v2 replaced `CADDYPATH` with XDG directories.
|
|
||||||
See <https://caddyserver.com/docs/conventions#file-locations>.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
logDir = mkOption {
|
|
||||||
type = types.path;
|
|
||||||
default = "/var/log/caddy";
|
|
||||||
description = ''
|
|
||||||
Directory for storing Caddy access logs.
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
If left as the default value this directory will automatically be created
|
|
||||||
before the Caddy server starts, otherwise the sysadmin is responsible for
|
|
||||||
ensuring the directory exists with appropriate ownership and permissions.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
logFormat = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
default = ''
|
|
||||||
level ERROR
|
|
||||||
'';
|
|
||||||
example = literalExpression ''
|
|
||||||
mkForce "level INFO";
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Configuration for the default logger. See
|
|
||||||
<https://caddyserver.com/docs/caddyfile/options#log>
|
|
||||||
for details.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
configFile = mkOption {
|
|
||||||
type = types.path;
|
|
||||||
default = configFile;
|
|
||||||
defaultText = "A Caddyfile automatically generated by values from services.caddy.*";
|
|
||||||
example = literalExpression ''
|
|
||||||
pkgs.writeText "Caddyfile" '''
|
|
||||||
example.com
|
|
||||||
|
|
||||||
root * /var/www/wordpress
|
|
||||||
php_fastcgi unix//run/php/php-version-fpm.sock
|
|
||||||
file_server
|
|
||||||
''';
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Override the configuration file used by Caddy. By default,
|
|
||||||
NixOS generates one automatically.
|
|
||||||
|
|
||||||
The configuration file is exposed at {file}`${configPath}`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
adapter = mkOption {
|
|
||||||
default =
|
|
||||||
if ((cfg.configFile != configFile) || (builtins.baseNameOf cfg.configFile) == "Caddyfile")
|
|
||||||
then "caddyfile"
|
|
||||||
else null;
|
|
||||||
defaultText = literalExpression ''
|
|
||||||
if ((cfg.configFile != configFile) || (builtins.baseNameOf cfg.configFile) == "Caddyfile") then "caddyfile" else null
|
|
||||||
'';
|
|
||||||
example = literalExpression "nginx";
|
|
||||||
type = with types; nullOr str;
|
|
||||||
description = ''
|
|
||||||
Name of the config adapter to use.
|
|
||||||
See <https://caddyserver.com/docs/config-adapters>
|
|
||||||
for the full list.
|
|
||||||
|
|
||||||
If `null` is specified, the `--adapter` argument is omitted when
|
|
||||||
starting or restarting Caddy. Notably, this allows specification of a
|
|
||||||
configuration file in Caddy's native JSON format, as long as the
|
|
||||||
filename does not start with `Caddyfile` (in which case the `caddyfile`
|
|
||||||
adapter is implicitly enabled). See
|
|
||||||
<https://caddyserver.com/docs/command-line#caddy-run> for details.
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
Any value other than `null` or `caddyfile` is only valid when providing
|
|
||||||
your own `configFile`.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
resume = mkOption {
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
description = ''
|
|
||||||
Use saved config, if any (and prefer over any specified configuration passed with `--config`).
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
globalConfig = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
default = "";
|
|
||||||
example = ''
|
|
||||||
debug
|
|
||||||
servers {
|
|
||||||
protocol {
|
|
||||||
experimental_http3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Additional lines of configuration appended to the global config section
|
|
||||||
of the `Caddyfile`.
|
|
||||||
|
|
||||||
Refer to <https://caddyserver.com/docs/caddyfile/options#global-options>
|
|
||||||
for details on supported values.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
default = "";
|
|
||||||
example = ''
|
|
||||||
example.com {
|
|
||||||
encode gzip
|
|
||||||
log
|
|
||||||
root /srv/http
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Additional lines of configuration appended to the automatically
|
|
||||||
generated `Caddyfile`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts = mkOption {
|
|
||||||
type = with types; attrsOf (submodule (import ./vhost-options.nix {inherit cfg;}));
|
|
||||||
default = {};
|
|
||||||
example = literalExpression ''
|
|
||||||
{
|
|
||||||
"hydra.example.com" = {
|
|
||||||
serverAliases = [ "www.hydra.example.com" ];
|
|
||||||
extraConfig = '''
|
|
||||||
encode gzip
|
|
||||||
root * /srv/http
|
|
||||||
''';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Declarative specification of virtual hosts served by Caddy.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
acmeCA = mkOption {
|
|
||||||
default = null;
|
|
||||||
example = "https://acme-v02.api.letsencrypt.org/directory";
|
|
||||||
type = with types; nullOr str;
|
|
||||||
description = ''
|
|
||||||
::: {.note}
|
|
||||||
Sets the [`acme_ca` option](https://caddyserver.com/docs/caddyfile/options#acme-ca)
|
|
||||||
in the global options block of the resulting Caddyfile.
|
|
||||||
:::
|
|
||||||
|
|
||||||
The URL to the ACME CA's directory. It is strongly recommended to set
|
|
||||||
this to `https://acme-staging-v02.api.letsencrypt.org/directory` for
|
|
||||||
Let's Encrypt's [staging endpoint](https://letsencrypt.org/docs/staging-environment/)
|
|
||||||
while testing or in development.
|
|
||||||
|
|
||||||
Value `null` should be prefered for production setups,
|
|
||||||
as it omits the `acme_ca` option to enable
|
|
||||||
[automatic issuer fallback](https://caddyserver.com/docs/automatic-https#issuer-fallback).
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
email = mkOption {
|
|
||||||
default = null;
|
|
||||||
type = with types; nullOr str;
|
|
||||||
description = ''
|
|
||||||
Your email address. Mainly used when creating an ACME account with your
|
|
||||||
CA, and is highly recommended in case there are problems with your
|
|
||||||
certificates.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
enableReload = mkOption {
|
|
||||||
default = true;
|
|
||||||
type = types.bool;
|
|
||||||
description = ''
|
|
||||||
Reload Caddy instead of restarting it when configuration file changes.
|
|
||||||
|
|
||||||
Note that enabling this option requires the [admin API](https://caddyserver.com/docs/caddyfile/options#admin)
|
|
||||||
to not be turned off.
|
|
||||||
|
|
||||||
If you enable this option, consider setting [`grace_period`](https://caddyserver.com/docs/caddyfile/options#grace-period)
|
|
||||||
to a non-infinite value in {option}`services.caddy.globalConfig`
|
|
||||||
to prevent Caddy waiting for active connections to finish,
|
|
||||||
which could delay the reload essentially indefinitely.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = mkOption {
|
|
||||||
type = settingsFormat.type;
|
|
||||||
default = {};
|
|
||||||
description = ''
|
|
||||||
Structured configuration for Caddy to generate a Caddy JSON configuration file.
|
|
||||||
See <https://caddyserver.com/docs/json/> for available options.
|
|
||||||
|
|
||||||
::: {.warning}
|
|
||||||
Using a [Caddyfile](https://caddyserver.com/docs/caddyfile) instead of a JSON config is highly recommended by upstream.
|
|
||||||
There are only very few exception to this.
|
|
||||||
|
|
||||||
Please use a Caddyfile via {option}`services.caddy.configFile`, {option}`services.caddy.virtualHosts` or
|
|
||||||
{option}`services.caddy.extraConfig` with {option}`services.caddy.globalConfig` instead.
|
|
||||||
:::
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
Takes presence over most `services.caddy.*` options, such as {option}`services.caddy.configFile` and {option}`services.caddy.virtualHosts`, if specified.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
environmentFile = mkOption {
|
|
||||||
type = with types; nullOr path;
|
|
||||||
default = null;
|
|
||||||
example = "/run/secrets/caddy.env";
|
|
||||||
description = ''
|
|
||||||
Environment file as defined in {manpage}`systemd.exec(5)`.
|
|
||||||
|
|
||||||
You can use environment variables to pass secrets to the service without adding
|
|
||||||
them to the world-redable nix store.
|
|
||||||
|
|
||||||
```
|
|
||||||
# in configuration.nix
|
|
||||||
services.caddy.environmentFile = "/run/secrets/caddy.env";
|
|
||||||
services.caddy.globalConfig = '''
|
|
||||||
{
|
|
||||||
acme_ca https://acme.zerossl.com/v2/DV90
|
|
||||||
acme_eab {
|
|
||||||
key_id {$EAB_KEY_ID}
|
|
||||||
mac_key {$EAB_MAC_KEY}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
''';
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
# in /run/secrets/caddy.env
|
|
||||||
EAB_KEY_ID=secret
|
|
||||||
EAB_MAC_KEY=secret
|
|
||||||
```
|
|
||||||
|
|
||||||
Find more examples
|
|
||||||
[here](https://caddyserver.com/docs/caddyfile/concepts#environment-variables)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
assertions =
|
|
||||||
[
|
|
||||||
{
|
|
||||||
assertion = cfg.configFile == configFile -> cfg.adapter == "caddyfile" || cfg.adapter == null;
|
|
||||||
message = "To specify an adapter other than 'caddyfile' please provide your own configuration via `services.caddy.configFile`";
|
|
||||||
}
|
|
||||||
]
|
|
||||||
++ map (
|
|
||||||
name:
|
|
||||||
mkCertOwnershipAssertion {
|
|
||||||
cert = config.security.acme.certs.${name};
|
|
||||||
groups = config.users.groups;
|
|
||||||
services = [config.systemd.services.caddy];
|
|
||||||
}
|
|
||||||
)
|
|
||||||
vhostCertNames;
|
|
||||||
|
|
||||||
services.caddy.globalConfig = ''
|
|
||||||
${optionalString (cfg.email != null) "email ${cfg.email}"}
|
|
||||||
${optionalString (cfg.acmeCA != null) "acme_ca ${cfg.acmeCA}"}
|
|
||||||
log {
|
|
||||||
${cfg.logFormat}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes
|
|
||||||
boot.kernel.sysctl."net.core.rmem_max" = mkDefault 2500000;
|
|
||||||
boot.kernel.sysctl."net.core.wmem_max" = mkDefault 2500000;
|
|
||||||
|
|
||||||
systemd.packages = [cfg.package];
|
|
||||||
systemd.services.caddy = {
|
|
||||||
wants = map (certName: "acme-finished-${certName}.target") vhostCertNames;
|
|
||||||
after =
|
|
||||||
map (certName: "acme-selfsigned-${certName}.service") vhostCertNames
|
|
||||||
++ map (certName: "acme-${certName}.service") independentCertNames; # avoid loading self-signed key w/ real cert, or vice-versa
|
|
||||||
before = map (certName: "acme-${certName}.service") dependentCertNames;
|
|
||||||
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
startLimitIntervalSec = 14400;
|
|
||||||
startLimitBurst = 10;
|
|
||||||
reloadTriggers = optional cfg.enableReload cfg.configFile;
|
|
||||||
restartTriggers = optional (!cfg.enableReload) cfg.configFile;
|
|
||||||
|
|
||||||
serviceConfig = let
|
|
||||||
runOptions = ''--config ${configPath} ${
|
|
||||||
optionalString (cfg.adapter != null) "--adapter ${cfg.adapter}"
|
|
||||||
}'';
|
|
||||||
in {
|
|
||||||
# Override the `ExecStart` line from upstream's systemd unit file by our own:
|
|
||||||
# https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart=
|
|
||||||
# If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect.
|
|
||||||
ExecStart = [
|
|
||||||
""
|
|
||||||
''${lib.getExe cfg.package} run ${runOptions} ${optionalString cfg.resume "--resume"}''
|
|
||||||
];
|
|
||||||
# Validating the configuration before applying it ensures we’ll get a proper error that will be reported when switching to the configuration
|
|
||||||
ExecReload =
|
|
||||||
[
|
|
||||||
""
|
|
||||||
]
|
|
||||||
++ lib.optional cfg.enableReload "${lib.getExe cfg.package} reload ${runOptions} --force";
|
|
||||||
User = cfg.user;
|
|
||||||
Group = cfg.group;
|
|
||||||
ReadWritePaths = [cfg.dataDir];
|
|
||||||
StateDirectory = mkIf (cfg.dataDir == "/var/lib/caddy") ["caddy"];
|
|
||||||
LogsDirectory = mkIf (cfg.logDir == "/var/log/caddy") ["caddy"];
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartPreventExitStatus = 1;
|
|
||||||
RestartSec = "5s";
|
|
||||||
EnvironmentFile = optional (cfg.environmentFile != null) cfg.environmentFile;
|
|
||||||
|
|
||||||
# TODO: attempt to upstream these options
|
|
||||||
NoNewPrivileges = true;
|
|
||||||
PrivateDevices = true;
|
|
||||||
ProtectHome = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users = optionalAttrs (cfg.user == "caddy") {
|
|
||||||
caddy = {
|
|
||||||
group = cfg.group;
|
|
||||||
uid = config.ids.uids.caddy;
|
|
||||||
home = cfg.dataDir;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups = optionalAttrs (cfg.group == "caddy") {
|
|
||||||
caddy.gid = config.ids.gids.caddy;
|
|
||||||
};
|
|
||||||
|
|
||||||
security.acme.certs = let
|
|
||||||
certCfg =
|
|
||||||
map (
|
|
||||||
certName:
|
|
||||||
nameValuePair certName {
|
|
||||||
group = mkDefault cfg.group;
|
|
||||||
reloadServices = ["caddy.service"];
|
|
||||||
}
|
|
||||||
)
|
|
||||||
vhostCertNames;
|
|
||||||
in
|
|
||||||
listToAttrs certCfg;
|
|
||||||
|
|
||||||
environment.etc.${etcConfigFile}.source = cfg.configFile;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{cfg}: {
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
name,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) literalExpression mkOption types;
|
|
||||||
in {
|
|
||||||
options = {
|
|
||||||
hostName = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = name;
|
|
||||||
description = "Canonical hostname for the server.";
|
|
||||||
};
|
|
||||||
|
|
||||||
serverAliases = mkOption {
|
|
||||||
type = with types; listOf str;
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
"www.example.org"
|
|
||||||
"example.org"
|
|
||||||
];
|
|
||||||
description = ''
|
|
||||||
Additional names of virtual hosts served by this virtual host configuration.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
listenAddresses = mkOption {
|
|
||||||
type = with types; listOf str;
|
|
||||||
description = ''
|
|
||||||
A list of host interfaces to bind to for this virtual host.
|
|
||||||
'';
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
"127.0.0.1"
|
|
||||||
"::1"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
useACMEHost = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
A host of an existing Let's Encrypt certificate to use.
|
|
||||||
This is mostly useful if you use DNS challenges but Caddy does not
|
|
||||||
currently support your provider.
|
|
||||||
|
|
||||||
*Note that this option does not create any certificates, nor
|
|
||||||
does it add subdomains to existing ones – you will need to create them
|
|
||||||
manually using [](#opt-security.acme.certs).*
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
logFormat = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
default = ''
|
|
||||||
output file ${cfg.logDir}/access-${lib.replaceStrings ["/" " "] ["_" "_"] config.hostName}.log
|
|
||||||
'';
|
|
||||||
defaultText = ''
|
|
||||||
output file ''${config.services.caddy.logDir}/access-''${hostName}.log
|
|
||||||
'';
|
|
||||||
example = literalExpression ''
|
|
||||||
mkForce '''
|
|
||||||
output discard
|
|
||||||
''';
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Configuration for HTTP request logging (also known as access logs). See
|
|
||||||
<https://caddyserver.com/docs/caddyfile/directives/log#log>
|
|
||||||
for details.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
default = "";
|
|
||||||
description = ''
|
|
||||||
Additional lines of configuration appended to this virtual host in the
|
|
||||||
automatically generated `Caddyfile`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,50 +1,19 @@
|
|||||||
{
|
{...}: {
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; let
|
|
||||||
cfg = config.nix.substituters;
|
|
||||||
in {
|
|
||||||
options.nix.substituters = {
|
|
||||||
enableCuda = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Enable NixOS CUDA cache";
|
|
||||||
};
|
|
||||||
|
|
||||||
enableLlamaCpp = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Enable llama-cpp cache";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
trusted-substituters =
|
trusted-substituters = [
|
||||||
[
|
"https://nix-community.cachix.org"
|
||||||
"https://nix-community.cachix.org"
|
"https://nixos-raspberrypi.cachix.org"
|
||||||
"https://nixos-raspberrypi.cachix.org"
|
"https://llama-cpp.cachix.org"
|
||||||
]
|
"https://cache.nixos-cuda.org"
|
||||||
++ optionals cfg.enableLlamaCpp [
|
];
|
||||||
"https://llama-cpp.cachix.org"
|
|
||||||
]
|
|
||||||
++ optionals cfg.enableCuda [
|
|
||||||
"https://cache.nixos-cuda.org"
|
|
||||||
];
|
|
||||||
|
|
||||||
trusted-public-keys =
|
trusted-public-keys = [
|
||||||
[
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
|
||||||
"nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
|
"llama-cpp.cachix.org-1:H75X+w83wUKTIPSO1KWy9ADUrzThyGs8P5tmAbkWhQc="
|
||||||
]
|
"cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M="
|
||||||
++ optionals cfg.enableLlamaCpp [
|
];
|
||||||
"llama-cpp.cachix.org-1:H75X+w83wUKTIPSO1KWy9ADUrzThyGs8P5tmAbkWhQc="
|
|
||||||
]
|
|
||||||
++ optionals cfg.enableCuda [
|
|
||||||
"cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M="
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ in {
|
|||||||
"core.keybinds" = {
|
"core.keybinds" = {
|
||||||
config = {
|
config = {
|
||||||
default_keybinds = true;
|
default_keybinds = true;
|
||||||
neorg_leader = "<C-m>";
|
neorg_leader = "<C-i>";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"core.integrations.treesitter" = {
|
"core.integrations.treesitter" = {
|
||||||
@@ -620,6 +620,21 @@ in {
|
|||||||
};
|
};
|
||||||
sources = {
|
sources = {
|
||||||
cmdline = [];
|
cmdline = [];
|
||||||
|
# default =
|
||||||
|
# rawLua
|
||||||
|
# /*
|
||||||
|
# lua
|
||||||
|
# */
|
||||||
|
# ''
|
||||||
|
# function(ctx)
|
||||||
|
# local success, node = pcall(vim.treesitter.get_node)
|
||||||
|
# if success and node and vim.tbl_contains({ 'comment', 'line_comment', 'block_comment' }, node:type()) then
|
||||||
|
# return { 'buffer' }
|
||||||
|
# else
|
||||||
|
# return { 'git', 'lsp', 'path', 'snippets', 'buffer', 'dictionary', 'ripgrep', 'tmux' }
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# '';
|
||||||
default = [
|
default = [
|
||||||
"git"
|
"git"
|
||||||
"lsp"
|
"lsp"
|
||||||
@@ -628,6 +643,7 @@ in {
|
|||||||
"path"
|
"path"
|
||||||
"buffer"
|
"buffer"
|
||||||
"ripgrep"
|
"ripgrep"
|
||||||
|
# "tmux"
|
||||||
];
|
];
|
||||||
providers = {
|
providers = {
|
||||||
buffer = {
|
buffer = {
|
||||||
@@ -639,23 +655,30 @@ in {
|
|||||||
path = {};
|
path = {};
|
||||||
dictionary = {
|
dictionary = {
|
||||||
module = "blink-cmp-dictionary";
|
module = "blink-cmp-dictionary";
|
||||||
name = "Dict";
|
name = "dict";
|
||||||
min_keyword_length = 3;
|
min_keyword_length = 3;
|
||||||
opts = {
|
opts = {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
git = {
|
git = {
|
||||||
module = "blink-cmp-git";
|
module = "blink-cmp-git";
|
||||||
name = "Git";
|
name = "git";
|
||||||
opts = {
|
opts = {
|
||||||
# -- options for the blink-cmp-git
|
# -- options for the blink-cmp-git
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
ripgrep = {
|
ripgrep = {
|
||||||
module = "blink-ripgrep";
|
module = "blink-ripgrep";
|
||||||
name = "Ripgrep";
|
name = "ripgrep";
|
||||||
opts = {};
|
opts = {};
|
||||||
};
|
};
|
||||||
|
# tmux = {
|
||||||
|
# module = "blink-cmp-tmux";
|
||||||
|
# name = "tmux";
|
||||||
|
# opts = {
|
||||||
|
# triggered_only = false;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -663,8 +686,9 @@ in {
|
|||||||
blink-ripgrep.enable = true;
|
blink-ripgrep.enable = true;
|
||||||
blink-cmp-git.enable = true;
|
blink-cmp-git.enable = true;
|
||||||
blink-cmp-dictionary.enable = true;
|
blink-cmp-dictionary.enable = true;
|
||||||
blink-cmp-copilot.enable = true;
|
# blink-cmp-copilot.enable = true;
|
||||||
blink-cmp-spell.enable = true;
|
blink-cmp-spell.enable = true;
|
||||||
|
blink-cmp-tmux.enable = true;
|
||||||
blink-compat = {
|
blink-compat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.impersonate_nvim_cmp = true;
|
settings.impersonate_nvim_cmp = true;
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
in [
|
in [
|
||||||
inputs.nno.overlays.default
|
|
||||||
inputs.nixvim.overlays.default
|
inputs.nixvim.overlays.default
|
||||||
vimPlugins
|
inputs.nno.overlays.default
|
||||||
tree-sitter-grammars
|
tree-sitter-grammars
|
||||||
|
vimPlugins
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
inputs.stylix.nixosModules.stylix
|
inputs.stylix.nixosModules.stylix
|
||||||
inputs.headplane.nixosModules.headplane
|
inputs.headplane.nixosModules.headplane
|
||||||
|
inputs.tangled-core.nixosModules.knot
|
||||||
|
|
||||||
./${device.name}/configuration.nix
|
./${device.name}/configuration.nix
|
||||||
../home/module.nix
|
../home/module.nix
|
||||||
|
|||||||
@@ -4,4 +4,5 @@
|
|||||||
documentation.dev.enable = true;
|
documentation.dev.enable = true;
|
||||||
documentation.doc.enable = true;
|
documentation.doc.enable = true;
|
||||||
documentation.nixos.enable = true;
|
documentation.nixos.enable = true;
|
||||||
|
documentation.man.cache.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
3
nixos/ryu/apps/crosspipe.nix
Normal file
3
nixos/ryu/apps/crosspipe.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [crosspipe];
|
||||||
|
}
|
||||||
@@ -6,8 +6,12 @@
|
|||||||
imports = [
|
imports = [
|
||||||
# ./alvr.nix
|
# ./alvr.nix
|
||||||
./easyeffects.nix
|
./easyeffects.nix
|
||||||
./mixid.nix
|
|
||||||
./vr.nix
|
./vr.nix
|
||||||
./helvum.nix
|
./crosspipe.nix
|
||||||
|
# ./wine.nix
|
||||||
|
# ./virt.nix
|
||||||
|
./gparted.nix
|
||||||
|
./nvtop.nix
|
||||||
|
# ./qpwgraph.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
3
nixos/ryu/apps/gparted.nix
Normal file
3
nixos/ryu/apps/gparted.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [gparted];
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
environment.systemPackages = with pkgs; [helvum];
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
environment.systemPackages = with pkgs; [mixid];
|
|
||||||
services.udev.packages = with pkgs; [mixid];
|
|
||||||
}
|
|
||||||
3
nixos/ryu/apps/nvtop.nix
Normal file
3
nixos/ryu/apps/nvtop.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [nvtopPackages.nvidia];
|
||||||
|
}
|
||||||
3
nixos/ryu/apps/qpwgraph.nix
Normal file
3
nixos/ryu/apps/qpwgraph.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [qpwgraph];
|
||||||
|
}
|
||||||
6
nixos/ryu/apps/virt.nix
Normal file
6
nixos/ryu/apps/virt.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
virt-manager
|
||||||
|
quickemu
|
||||||
|
];
|
||||||
|
}
|
||||||
7
nixos/ryu/apps/wine.nix
Normal file
7
nixos/ryu/apps/wine.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
wine-wayland
|
||||||
|
winetricks
|
||||||
|
wineWowPackages.waylandFull
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
device,
|
device,
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
@@ -21,15 +23,6 @@
|
|||||||
tctiEnvironment.enable = true;
|
tctiEnvironment.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
|
||||||
hyprland = {
|
|
||||||
enable = true;
|
|
||||||
withUWSM = true;
|
|
||||||
xwayland.enable = true;
|
|
||||||
};
|
|
||||||
uwsm.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
|
systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
|
||||||
# systemd.tmpfiles.rules = [
|
# systemd.tmpfiles.rules = [
|
||||||
# "L+ /etc/gdm/.config/monitors.xml - - - - ${./monitors.xml}"
|
# "L+ /etc/gdm/.config/monitors.xml - - - - ${./monitors.xml}"
|
||||||
@@ -47,6 +40,8 @@
|
|||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
extra-experimental-features = "nix-command flakes auto-allocate-uids";
|
extra-experimental-features = "nix-command flakes auto-allocate-uids";
|
||||||
trusted-users = [device.user];
|
trusted-users = [device.user];
|
||||||
|
extra-sandbox-paths = [config.programs.ccache.cacheDir];
|
||||||
|
download-buffer-size = 524288000;
|
||||||
};
|
};
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
build-users-group = nixbld
|
build-users-group = nixbld
|
||||||
@@ -65,11 +60,6 @@
|
|||||||
# ../../builders/tsuba.nix
|
# ../../builders/tsuba.nix
|
||||||
];
|
];
|
||||||
distributedBuilds = true;
|
distributedBuilds = true;
|
||||||
# Enable CUDA and llama-cpp caches
|
|
||||||
substituters = {
|
|
||||||
enableCuda = true;
|
|
||||||
enableLlamaCpp = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.${device.user} = {
|
users.users.${device.user} = {
|
||||||
@@ -157,12 +147,31 @@
|
|||||||
Name = "Ryu";
|
Name = "Ryu";
|
||||||
Enable = "Source,Sink,Media,Socket";
|
Enable = "Source,Sink,Media,Socket";
|
||||||
ControllerMode = "dual";
|
ControllerMode = "dual";
|
||||||
FactConnectable = "true";
|
FactConnectable = true;
|
||||||
Experimental = "true";
|
Experimental = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
boot.extraModprobeConfig = ''
|
||||||
|
# Keep Bluetooth coexistence disabled for better BT audio stability
|
||||||
|
options iwlwifi bt_coex_active=0
|
||||||
|
|
||||||
|
# Enable software crypto (helps BT coexistence sometimes)
|
||||||
|
options iwlwifi swcrypto=1
|
||||||
|
|
||||||
|
# Disable power saving on Wi-Fi module to reduce radio state changes that might disrupt BT
|
||||||
|
options iwlwifi power_save=0
|
||||||
|
|
||||||
|
# Disable Unscheduled Automatic Power Save Delivery (U-APSD) to improve BT audio stability
|
||||||
|
options iwlwifi uapsd_disable=1
|
||||||
|
|
||||||
|
# Disable D0i3 power state to avoid problematic power transitions
|
||||||
|
options iwlwifi d0i3_disable=1
|
||||||
|
|
||||||
|
# Set power scheme for performance (iwlmvm)
|
||||||
|
options iwlmvm power_scheme=1
|
||||||
|
'';
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
interfaces.eno1.wakeOnLan = {
|
interfaces.eno1.wakeOnLan = {
|
||||||
@@ -272,41 +281,6 @@
|
|||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
fonts.fontDir.enable = true;
|
fonts.fontDir.enable = true;
|
||||||
environment = {
|
environment = {
|
||||||
# List packages installed in system profile. To search, run:
|
|
||||||
# $ nix search wget
|
|
||||||
systemPackages = with pkgs; [
|
|
||||||
v4l-utils
|
|
||||||
polychromatic
|
|
||||||
openrazer-daemon
|
|
||||||
cudatoolkit
|
|
||||||
# Wine
|
|
||||||
wine-wayland
|
|
||||||
winetricks
|
|
||||||
wineWowPackages.waylandFull
|
|
||||||
|
|
||||||
virt-manager
|
|
||||||
gparted
|
|
||||||
nvtopPackages.nvidia
|
|
||||||
quickemu
|
|
||||||
# (nixvim.makeNixvim (import ../../neovim))
|
|
||||||
qpwgraph
|
|
||||||
hyprland
|
|
||||||
xorg.xhost
|
|
||||||
foot
|
|
||||||
git
|
|
||||||
fish
|
|
||||||
nushell
|
|
||||||
# (pkgs.wrapFirefox
|
|
||||||
# (pkgs.firefox-unwrapped.override {pipewireSupport = true;})
|
|
||||||
# {})
|
|
||||||
gnumake
|
|
||||||
python3
|
|
||||||
nerd-fonts.fira-code
|
|
||||||
nerd-fonts.hasklug
|
|
||||||
nerd-fonts.symbols-only
|
|
||||||
monaspace
|
|
||||||
ddcutil
|
|
||||||
];
|
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
WLR_NO_HARDWARE_CURSORS = "1";
|
WLR_NO_HARDWARE_CURSORS = "1";
|
||||||
NIXOS_OZONE_WL = "1";
|
NIXOS_OZONE_WL = "1";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{...}: {
|
{...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./hytale.nix
|
# ./hytale.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
0
nixos/ryu/hardware/default.nix
Normal file
0
nixos/ryu/hardware/default.nix
Normal file
6
nixos/ryu/programs/ccache.nix
Normal file
6
nixos/ryu/programs/ccache.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{...}: {
|
||||||
|
programs.ccache = {
|
||||||
|
enable = true;
|
||||||
|
packageNames = ["ollama" "orca-slicer" "opencv" "onnxruntime" "obs-studio" "llama-cpp"];
|
||||||
|
};
|
||||||
|
}
|
||||||
3
nixos/ryu/programs/cuda.nix
Normal file
3
nixos/ryu/programs/cuda.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [cudatoolkit];
|
||||||
|
}
|
||||||
3
nixos/ryu/programs/ddcutil.nix
Normal file
3
nixos/ryu/programs/ddcutil.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [ddcutil];
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
./steam.nix
|
./steam.nix
|
||||||
./1password.nix
|
./1password.nix
|
||||||
./localsend.nix
|
./localsend.nix
|
||||||
./appimage.nix
|
# ./appimage.nix
|
||||||
./obs-studio.nix
|
./obs-studio.nix
|
||||||
./gnome-disks.nix
|
./gnome-disks.nix
|
||||||
./nix-ld.nix
|
./nix-ld.nix
|
||||||
@@ -12,5 +12,16 @@
|
|||||||
./droidcam.nix
|
./droidcam.nix
|
||||||
./wireshark.nix
|
./wireshark.nix
|
||||||
./flatpak.nix
|
./flatpak.nix
|
||||||
|
./v4l-utils.nix
|
||||||
|
./razer.nix
|
||||||
|
./cuda.nix
|
||||||
|
./fonts.nix
|
||||||
|
./dev.nix
|
||||||
|
./shells.nix
|
||||||
|
./hyprland.nix
|
||||||
|
./foot.nix
|
||||||
|
./ddcutil.nix
|
||||||
|
./libnotify.nix
|
||||||
|
./fish.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
7
nixos/ryu/programs/dev.nix
Normal file
7
nixos/ryu/programs/dev.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
gnumake
|
||||||
|
python3
|
||||||
|
];
|
||||||
|
}
|
||||||
7
nixos/ryu/programs/fish.nix
Normal file
7
nixos/ryu/programs/fish.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{...}: {
|
||||||
|
programs.fish = {
|
||||||
|
enable = true;
|
||||||
|
generateCompletions = true;
|
||||||
|
};
|
||||||
|
stylix.targets.fish.enable = false;
|
||||||
|
}
|
||||||
8
nixos/ryu/programs/fonts.nix
Normal file
8
nixos/ryu/programs/fonts.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nerd-fonts.fira-code
|
||||||
|
nerd-fonts.hasklug
|
||||||
|
nerd-fonts.symbols-only
|
||||||
|
monaspace
|
||||||
|
];
|
||||||
|
}
|
||||||
3
nixos/ryu/programs/foot.nix
Normal file
3
nixos/ryu/programs/foot.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [foot];
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
device,
|
device,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
programs.gamemode = {
|
programs.gamemode = {
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
custom = {
|
custom = {
|
||||||
start = let
|
start = let
|
||||||
out = pkgs.writeScriptBin "gamemode-start" ''
|
out = pkgs.writeScriptBin "gamemode-start" ''
|
||||||
${pkgs.lmstudio}/bin/lms unload
|
${lib.getExe pkgs.ollama} ps | tail +2 | cut -d' ' -f1 | xargs ${lib.getExe pkgs.ollama} stop
|
||||||
${pkgs.libnotify}/bin/notify-send 'GameMode started'
|
${pkgs.libnotify}/bin/notify-send 'GameMode started'
|
||||||
'';
|
'';
|
||||||
in "${out}/bin/gamemode-start";
|
in "${out}/bin/gamemode-start";
|
||||||
|
|||||||
19
nixos/ryu/programs/hyprland.nix
Normal file
19
nixos/ryu/programs/hyprland.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
xhost
|
||||||
|
];
|
||||||
|
programs = {
|
||||||
|
hyprland = {
|
||||||
|
enable = true;
|
||||||
|
withUWSM = true;
|
||||||
|
xwayland.enable = true;
|
||||||
|
package = pkgs.hyprland;
|
||||||
|
portalPackage = pkgs.xdph;
|
||||||
|
};
|
||||||
|
uwsm.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
3
nixos/ryu/programs/libnotify.nix
Normal file
3
nixos/ryu/programs/libnotify.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [libnotify];
|
||||||
|
}
|
||||||
6
nixos/ryu/programs/razer.nix
Normal file
6
nixos/ryu/programs/razer.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
polychromatic
|
||||||
|
openrazer-daemon
|
||||||
|
];
|
||||||
|
}
|
||||||
6
nixos/ryu/programs/shells.nix
Normal file
6
nixos/ryu/programs/shells.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
fish
|
||||||
|
nushell
|
||||||
|
];
|
||||||
|
}
|
||||||
3
nixos/ryu/programs/v4l-utils.nix
Normal file
3
nixos/ryu/programs/v4l-utils.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [v4l-utils];
|
||||||
|
}
|
||||||
@@ -7,8 +7,5 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
dumpcap.enable = true;
|
dumpcap.enable = true;
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
wireshark-qt
|
|
||||||
];
|
|
||||||
users.users.${device.user}.extraGroups = ["wireshark"];
|
users.users.${device.user}.extraGroups = ["wireshark"];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,11 +130,10 @@
|
|||||||
options = ["nofail"];
|
options = ["nofail"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# fileSystems."/volumes/windows-games" = {
|
fileSystems."/var" = {
|
||||||
# device = "/dev/disk/by-partuuid/56359fb7-7d33-44d2-bebd-b0c53daeeb73";
|
device = "/dev/disk/by-uuid/ff874913-dc21-43f3-82f8-cdf45dd888f7";
|
||||||
# fsType = "ntfs3";
|
fsType = "ext4";
|
||||||
# options = ["nofail"];
|
};
|
||||||
# };
|
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
pipewire = {
|
pipewire = {
|
||||||
"10-clock-rate" = {
|
"10-clock-rate" = {
|
||||||
"context.properties" = {
|
"context.properties" = {
|
||||||
"default.clock.rate" = 48000;
|
|
||||||
"default.clock.quantum" = 32;
|
"default.clock.quantum" = 32;
|
||||||
"default.clock.allowed-rates" = [44100 48000 88200 96000];
|
"default.clock.allowed-rates" = [44100 48000 88200 96000];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -57,9 +57,6 @@
|
|||||||
};
|
};
|
||||||
package = pkgs.nixVersions.nix_2_32; # deploy-rs doesn't work with nix >= 2.32
|
package = pkgs.nixVersions.nix_2_32; # deploy-rs doesn't work with nix >= 2.32
|
||||||
distributedBuilds = true;
|
distributedBuilds = true;
|
||||||
substituters = {
|
|
||||||
enableCuda = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.${device.user} = {
|
users.users.${device.user} = {
|
||||||
|
|||||||
89
nixos/tako/services/affine.nix
Normal file
89
nixos/tako/services/affine.nix
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
{config, ...}: let
|
||||||
|
domain = "notes.darksailor.dev";
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
../../../modules/nixos/affine.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# SOPS secrets
|
||||||
|
sops = {
|
||||||
|
secrets = {
|
||||||
|
"affine/db_password" = {};
|
||||||
|
"authelia/oidc/affine/client_id" = {
|
||||||
|
owner = config.systemd.services.authelia-darksailor.serviceConfig.User;
|
||||||
|
mode = "0440";
|
||||||
|
restartUnits = ["authelia-darksailor.service"];
|
||||||
|
};
|
||||||
|
"authelia/oidc/affine/client_secret" = {
|
||||||
|
owner = config.systemd.services.authelia-darksailor.serviceConfig.User;
|
||||||
|
mode = "0440";
|
||||||
|
restartUnits = ["authelia-darksailor.service"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
templates."affine.env".content = ''
|
||||||
|
AFFINE_DB_PASSWORD=${config.sops.placeholder."affine/db_password"}
|
||||||
|
POSTGRES_PASSWORD=${config.sops.placeholder."affine/db_password"}
|
||||||
|
AFFINE_SERVER_EXTERNAL_URL=https://${domain}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable AFFiNE service
|
||||||
|
services.affine = {
|
||||||
|
enable = true;
|
||||||
|
inherit domain;
|
||||||
|
environmentFiles = [
|
||||||
|
config.sops.templates."affine.env".path
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Caddy reverse proxy with SSO forward auth
|
||||||
|
services.caddy.virtualHosts."${domain}".extraConfig = ''
|
||||||
|
reverse_proxy localhost:${toString config.services.affine.port}
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Authelia access control rules
|
||||||
|
services.authelia.instances.darksailor.settings = {
|
||||||
|
access_control.rules = [
|
||||||
|
{
|
||||||
|
inherit domain;
|
||||||
|
policy = "bypass";
|
||||||
|
resources = [
|
||||||
|
"^/api/(sync|awareness)([/?].*)?$"
|
||||||
|
"^/socket\\.io([/?].*)?$"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
inherit domain;
|
||||||
|
policy = "one_factor";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
# OIDC client for AFFiNE
|
||||||
|
identity_providers.oidc.clients = [
|
||||||
|
{
|
||||||
|
client_name = "AFFiNE: Darksailor";
|
||||||
|
client_id = ''{{ secret "${config.sops.secrets."authelia/oidc/affine/client_id".path}" }}'';
|
||||||
|
client_secret = ''{{ secret "${config.sops.secrets."authelia/oidc/affine/client_secret".path}" }}'';
|
||||||
|
public = false;
|
||||||
|
authorization_policy = "one_factor";
|
||||||
|
require_pkce = false;
|
||||||
|
redirect_uris = [
|
||||||
|
"https://${domain}/oauth/callback"
|
||||||
|
];
|
||||||
|
scopes = [
|
||||||
|
"openid"
|
||||||
|
"email"
|
||||||
|
"profile"
|
||||||
|
];
|
||||||
|
response_types = ["code"];
|
||||||
|
grant_types = ["authorization_code"];
|
||||||
|
userinfo_signed_response_alg = "none";
|
||||||
|
token_endpoint_auth_method = "client_secret_post";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Ensure containers start after secrets are available
|
||||||
|
systemd.services.docker-affine.after = ["sops-install-secrets.service"];
|
||||||
|
systemd.services.docker-affine-migration.after = ["sops-install-secrets.service"];
|
||||||
|
systemd.services.docker-affine-postgres.after = ["sops-install-secrets.service"];
|
||||||
|
}
|
||||||
@@ -1,16 +1,21 @@
|
|||||||
{...}: {
|
{config, ...}: let
|
||||||
|
address = "127.0.0.1:8052";
|
||||||
|
in {
|
||||||
|
sops = {
|
||||||
|
secrets."attic/jwt_secret" = {};
|
||||||
|
templates."attic.env".content = ''
|
||||||
|
ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64=${config.sops.placeholder."attic/jwt_secret"}
|
||||||
|
'';
|
||||||
|
};
|
||||||
services = {
|
services = {
|
||||||
atticd = {
|
atticd = {
|
||||||
enable = false;
|
enable = true;
|
||||||
listen = "/run/attic.sock";
|
settings.listen = address;
|
||||||
|
environmentFile = config.sops.templates."attic.env".path;
|
||||||
};
|
};
|
||||||
caddy = {
|
caddy = {
|
||||||
virtualHosts."cache.darksailor.dev".extraConfig = ''
|
virtualHosts."cache.darksailor.dev".extraConfig = ''
|
||||||
reverse_proxy /run/attic.sock {
|
reverse_proxy ${address}
|
||||||
transport http {
|
|
||||||
protocol = "fd"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,29 +1,35 @@
|
|||||||
{...}: {
|
{...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./games
|
|
||||||
# ./headscale.nix
|
|
||||||
./llms.nix
|
|
||||||
./monitoring.nix
|
|
||||||
# ./paperless.nix
|
|
||||||
./navidrome.nix
|
|
||||||
./shitpost.nix
|
|
||||||
./atuin.nix
|
./atuin.nix
|
||||||
./authelia.nix
|
./authelia.nix
|
||||||
./caddy.nix
|
./caddy.nix
|
||||||
./excalidraw.nix
|
|
||||||
./fail2ban.nix
|
./fail2ban.nix
|
||||||
./flaresolverr.nix
|
|
||||||
./gitea.nix
|
|
||||||
./homepage.nix
|
./homepage.nix
|
||||||
./immich.nix
|
|
||||||
./lldap.nix
|
./lldap.nix
|
||||||
|
./navidrome.nix
|
||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
./openssh.nix
|
./openssh.nix
|
||||||
./prowlarr.nix
|
|
||||||
./resolved.nix
|
./resolved.nix
|
||||||
./searxng.nix
|
|
||||||
./tailscale.nix
|
./tailscale.nix
|
||||||
|
./gitea.nix
|
||||||
|
./knot.nix
|
||||||
|
|
||||||
|
./affine.nix
|
||||||
|
./attic.nix
|
||||||
|
./excalidraw.nix
|
||||||
|
./flaresolverr.nix
|
||||||
|
# ./games
|
||||||
|
# ./headscale.nix
|
||||||
|
./immich.nix
|
||||||
./kellnr.nix
|
./kellnr.nix
|
||||||
|
./llms.nix
|
||||||
|
./matrix
|
||||||
|
./monitoring.nix
|
||||||
|
# ./servius-website.nix
|
||||||
|
# ./paperless.nix
|
||||||
|
./prowlarr.nix
|
||||||
|
# ./searxng.nix
|
||||||
|
./shitpost.nix
|
||||||
];
|
];
|
||||||
services = {
|
services = {
|
||||||
nix-serve = {
|
nix-serve = {
|
||||||
|
|||||||
@@ -1,29 +1,90 @@
|
|||||||
{...}: {
|
{config, ...}: let
|
||||||
|
dataDir = "/var/lib/excalidraw";
|
||||||
|
base_domain = "darksailor.dev";
|
||||||
|
in {
|
||||||
|
# SOPS secrets and templates
|
||||||
|
sops = {
|
||||||
|
secrets = {
|
||||||
|
"excalidraw/jwt_secret" = {};
|
||||||
|
"authelia/oidc/excalidraw/client_id" = {
|
||||||
|
owner = config.systemd.services.authelia-darksailor.serviceConfig.User;
|
||||||
|
mode = "0440";
|
||||||
|
restartUnits = ["authelia-darksailor.service"];
|
||||||
|
};
|
||||||
|
"authelia/oidc/excalidraw/client_secret" = {
|
||||||
|
owner = config.systemd.services.authelia-darksailor.serviceConfig.User;
|
||||||
|
mode = "0440";
|
||||||
|
restartUnits = ["authelia-darksailor.service"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
templates."excalidraw.env".content = ''
|
||||||
|
OIDC_ISSUER_URL=https://auth.${base_domain}
|
||||||
|
OIDC_CLIENT_ID=${config.sops.placeholder."authelia/oidc/excalidraw/client_id"}
|
||||||
|
OIDC_CLIENT_SECRET=${config.sops.placeholder."authelia/oidc/excalidraw/client_secret"}
|
||||||
|
OIDC_REDIRECT_URL=https://draw.${base_domain}/auth/callback
|
||||||
|
JWT_SECRET=${config.sops.placeholder."excalidraw/jwt_secret"}
|
||||||
|
STORAGE_TYPE=sqlite
|
||||||
|
DATA_SOURCE_NAME=excalidraw.db
|
||||||
|
LOCAL_STORAGE_PATH=/root/data
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Create data directory and initialize SQLite DB
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d ${dataDir} 0755 root root -"
|
||||||
|
"d ${dataDir}/data 0755 root root -"
|
||||||
|
"f ${dataDir}/excalidraw.db 0644 root root -"
|
||||||
|
];
|
||||||
|
|
||||||
virtualisation.oci-containers = {
|
virtualisation.oci-containers = {
|
||||||
backend = "docker";
|
backend = "docker";
|
||||||
containers = {
|
containers = {
|
||||||
|
# Excalidraw Full backend
|
||||||
excalidraw = {
|
excalidraw = {
|
||||||
image = "excalidraw/excalidraw:latest";
|
image = "ghcr.io/betterandbetterii/excalidraw-full:latest";
|
||||||
ports = ["127.0.0.1:5959:80"];
|
ports = ["127.0.0.1:3002:3002"];
|
||||||
volumes = [];
|
environmentFiles = [
|
||||||
|
config.sops.templates."excalidraw.env".path
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
"${dataDir}/data:/root/data"
|
||||||
|
"${dataDir}/excalidraw.db:/root/excalidraw.db"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.caddy.virtualHosts."draw.darksailor.dev".extraConfig = ''
|
|
||||||
import auth
|
# Caddy reverse proxy
|
||||||
reverse_proxy localhost:5959
|
services.caddy.virtualHosts."draw.${base_domain}".extraConfig = ''
|
||||||
|
reverse_proxy localhost:3002
|
||||||
'';
|
'';
|
||||||
services.authelia = {
|
|
||||||
instances.darksailor = {
|
# Configure Authelia OIDC for Excalidraw
|
||||||
settings = {
|
services.authelia.instances.darksailor.settings = {
|
||||||
access_control = {
|
identity_providers = {
|
||||||
rules = [
|
oidc = {
|
||||||
{
|
clients = [
|
||||||
domain = "draw.darksailor.dev";
|
{
|
||||||
policy = "one_factor";
|
client_name = "Excalidraw: Darksailor";
|
||||||
}
|
client_id = ''{{ secret "${config.sops.secrets."authelia/oidc/excalidraw/client_id".path}" }}'';
|
||||||
];
|
client_secret = ''{{ secret "${config.sops.secrets."authelia/oidc/excalidraw/client_secret".path}" }}'';
|
||||||
};
|
public = false;
|
||||||
|
authorization_policy = "one_factor";
|
||||||
|
require_pkce = false;
|
||||||
|
redirect_uris = [
|
||||||
|
"https://draw.${base_domain}/auth/callback"
|
||||||
|
];
|
||||||
|
scopes = [
|
||||||
|
"openid"
|
||||||
|
"email"
|
||||||
|
"profile"
|
||||||
|
];
|
||||||
|
response_types = ["code"];
|
||||||
|
grant_types = ["authorization_code"];
|
||||||
|
userinfo_signed_response_alg = "none";
|
||||||
|
token_endpoint_auth_method = "client_secret_post";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
ignoreIP = [
|
ignoreIP = [
|
||||||
"106.219.121.52"
|
"106.219.121.52"
|
||||||
"106.219.122.125"
|
"106.219.122.125"
|
||||||
|
"106.219.122.221"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,22 +79,22 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# gitea-actions-runner = {
|
gitea-actions-runner = {
|
||||||
# instances = {
|
instances = {
|
||||||
# tako = {
|
tako = {
|
||||||
# enable = true;
|
enable = true;
|
||||||
# name = "tako";
|
name = "tako";
|
||||||
# url = "https://git.darksailor.dev";
|
url = "https://git.darksailor.dev";
|
||||||
# labels = [
|
labels = [
|
||||||
# "ubuntu-latest:docker://catthehacker/ubuntu:full-latest"
|
"ubuntu-latest:docker://catthehacker/ubuntu:full-latest"
|
||||||
# "ubuntu-22.04:docker://catthehacker/ubuntu:full-22.04"
|
"ubuntu-22.04:docker://catthehacker/ubuntu:full-22.04"
|
||||||
# "ubuntu-20.04:docker://catthehacker/ubuntu:full-20.04"
|
"ubuntu-20.04:docker://catthehacker/ubuntu:full-20.04"
|
||||||
# "native:host"
|
"native:host"
|
||||||
# ];
|
];
|
||||||
# tokenFile = "${config.sops.templates."GITEA_REGISTRATION_TOKEN.env".path}";
|
tokenFile = "${config.sops.templates."GITEA_REGISTRATION_TOKEN.env".path}";
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
caddy = {
|
caddy = {
|
||||||
virtualHosts."git.darksailor.dev".extraConfig = ''
|
virtualHosts."git.darksailor.dev".extraConfig = ''
|
||||||
reverse_proxy localhost:3000
|
reverse_proxy localhost:3000
|
||||||
|
|||||||
@@ -34,12 +34,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# headplane = {
|
headplane = {
|
||||||
# enable = true;
|
enable = true;
|
||||||
# settings = {
|
settings = {
|
||||||
# server.port = 42562;
|
server.port = 42562;
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
caddy = {
|
caddy = {
|
||||||
virtualHosts."headscale.darksailor.dev".extraConfig = ''
|
virtualHosts."headscale.darksailor.dev".extraConfig = ''
|
||||||
reverse_proxy localhost:${toString config.services.headplane.settings.server.port}
|
reverse_proxy localhost:${toString config.services.headplane.settings.server.port}
|
||||||
|
|||||||
@@ -59,6 +59,14 @@
|
|||||||
siteMonitor = "https://deluge.tsuba.darksailor.dev";
|
siteMonitor = "https://deluge.tsuba.darksailor.dev";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"Aria2" = {
|
||||||
|
icon = "aria2.png";
|
||||||
|
description = "Aria2: Download Manager";
|
||||||
|
href = "https://aria2.tsuba.darksailor.dev";
|
||||||
|
siteMonitor = "https://aria2.tsuba.darksailor.dev";
|
||||||
|
};
|
||||||
|
}
|
||||||
{
|
{
|
||||||
"Home Assistant" = {
|
"Home Assistant" = {
|
||||||
icon = "home-assistant.png";
|
icon = "home-assistant.png";
|
||||||
@@ -198,19 +206,19 @@
|
|||||||
reverse_proxy localhost:${builtins.toString config.services.homepage-dashboard.listenPort}
|
reverse_proxy localhost:${builtins.toString config.services.homepage-dashboard.listenPort}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
# authelia = {
|
authelia = {
|
||||||
# instances.darksailor = {
|
instances.darksailor = {
|
||||||
# settings = {
|
settings = {
|
||||||
# access_control = {
|
access_control = {
|
||||||
# rules = [
|
rules = [
|
||||||
# {
|
{
|
||||||
# domain = "dashboard.darksailor.dev";
|
domain = "dashboard.darksailor.dev";
|
||||||
# policy = "one_factor";
|
policy = "one_factor";
|
||||||
# }
|
}
|
||||||
# ];
|
];
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
31
nixos/tako/services/knot.nix
Normal file
31
nixos/tako/services/knot.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.tangled.knot = {
|
||||||
|
enable = true;
|
||||||
|
package = inputs.tangled-core.packages.${pkgs.system}.knot;
|
||||||
|
server = {
|
||||||
|
hostname = "tangled.darksailor.dev";
|
||||||
|
owner = "did:plc:tllyvpa5oxw6fwwhkj3kv6dr";
|
||||||
|
listenAddr = "127.0.0.1:5969";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts."tangled.darksailor.dev".extraConfig = ''
|
||||||
|
reverse_proxy ${config.services.tangled.knot.server.listenAddr} {
|
||||||
|
header_up Host {host}
|
||||||
|
header_up X-Real-IP {remote}
|
||||||
|
header_up X-Forwarded-For {remote}
|
||||||
|
header_up X-Forwarded-Proto {scheme}
|
||||||
|
}
|
||||||
|
handle /events/* {
|
||||||
|
reverse_proxy ${config.services.tangled.knot.server.listenAddr} {
|
||||||
|
header_up X-Forwarded-For {remote}
|
||||||
|
header_up Host {host}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
66
nixos/tako/services/matrix/cinny.nix
Normal file
66
nixos/tako/services/matrix/cinny.nix
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
base_domain = "darksailor.dev";
|
||||||
|
cinnyConfig = builtins.toJSON {
|
||||||
|
defaultHomeserver = 0;
|
||||||
|
homeserverList = ["darksailor.dev" "matrix.org"];
|
||||||
|
allowCustomHomeservers = false;
|
||||||
|
hashRouter = {
|
||||||
|
enabled = true;
|
||||||
|
basename = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
cinnyConfigFile = pkgs.writeText "cinny-config.json" cinnyConfig;
|
||||||
|
cinny = with pkgs;
|
||||||
|
buildNpmPackage rec {
|
||||||
|
pname = "cinny-unwrapped";
|
||||||
|
version = "4.11.1";
|
||||||
|
src = inputs.cinny;
|
||||||
|
|
||||||
|
nodejs = nodejs_22;
|
||||||
|
|
||||||
|
npmDepsHash = "sha256-27WFjb08p09aJRi0S2PvYq3bivEuG5+z2QhFahTSj4Q=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
python3
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs =
|
||||||
|
[
|
||||||
|
pixman
|
||||||
|
cairo
|
||||||
|
pango
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.hostPlatform.isDarwin [giflib];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
cp -r dist $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
services.caddy.virtualHosts = {
|
||||||
|
"matrix.${base_domain}".extraConfig = ''
|
||||||
|
handle /_matrix/* {
|
||||||
|
reverse_proxy /_matrix/* localhost:${toString (builtins.elemAt config.services.matrix-tuwunel.settings.global.port 0)}
|
||||||
|
}
|
||||||
|
handle_path /config.json {
|
||||||
|
file_server
|
||||||
|
root ${cinnyConfigFile}
|
||||||
|
}
|
||||||
|
handle {
|
||||||
|
root * ${cinny}
|
||||||
|
try_files {path} /index.html
|
||||||
|
file_server
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
8
nixos/tako/services/matrix/default.nix
Normal file
8
nixos/tako/services/matrix/default.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./tuwunel.nix
|
||||||
|
./cinny.nix
|
||||||
|
# ./signal.nix
|
||||||
|
# ./discord.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
19
nixos/tako/services/matrix/discord.nix
Normal file
19
nixos/tako/services/matrix/discord.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{...}: {
|
||||||
|
services.mautrix-discord = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
homeserver = {
|
||||||
|
address = "http://localhost:6167";
|
||||||
|
domain = "darksailor.dev";
|
||||||
|
};
|
||||||
|
appservice.public = {
|
||||||
|
prefix = "/public";
|
||||||
|
external = "https://matrix.darksailor.dev/public";
|
||||||
|
};
|
||||||
|
bridge.permissions = {
|
||||||
|
"darksailor.dev" = "user";
|
||||||
|
"@servius:darksailor.dev" = "admin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user