Compare commits

...

147 Commits

Author SHA1 Message Date
383c7bb15e [Gluetun] Switches to Wireguard config 2026-02-24 16:40:02 -08:00
a4bb91e68e [Wallabag] Adds wallabag 2026-02-24 16:40:02 -08:00
13f301c4fb [Obelisk] Adds Reflex FRP binary caches to the system 2026-02-12 15:53:26 -08:00
114a1ae125 [notes] Update Syncthing config for Proxima 2026-02-06 09:47:12 -08:00
9a4ab98506 [Jellyfin] Update to 10.11.6 2026-02-03 15:42:41 -08:00
bf0d4a11d2 [nix] Fixes deprecated function usage. 2026-02-02 17:18:04 -08:00
0950758532 [3d printing] Fix FreeCAD launcher 2026-01-27 23:20:31 -08:00
31907ff47b [Haskell] Adds support to the LSP. [neovim] Merges and checks in lazyvim.json 2026-01-26 12:44:23 -08:00
a985e8a0da [Browser,Firefox,Librewolf] Switch back to Firefox as default browser for better sync and features 2026-01-22 10:02:31 -08:00
8add79d14c [flake] Update 2026-01-09 16:19:43 -08:00
93523c54f2 [altair] Cleans up hardware config 2026-01-09 16:15:41 -08:00
c07dfe4259 [neovim] Check in extras config. 2026-01-06 15:29:51 -08:00
978b7ac2b7 [flake] update to 25.11 2026-01-02 12:37:18 -08:00
d1ccaa1c57 [hyprland] Adds a keybind for saving screenshots to files 2026-01-02 12:36:06 -08:00
1c098a032b [neovim] Switch to tab-completion so that I don't get confused when switching editors 2025-12-30 11:10:30 -08:00
b951779a92 [audio] Adds script to inhibit sleep while media is playing. 2025-12-30 11:05:10 -08:00
889d0b1057 [nvim] Adds a commented section about images in markdown docs, though it won't work in Foot tty. 2025-12-20 12:17:00 -08:00
64cac2b167 [printing] Adds Brother printer 2025-12-14 17:26:25 -08:00
2f278b5ecb [nvim] Adds link to do documentation for RenderMarkdown plugin 2025-12-12 12:25:51 -08:00
a0448def04 [desktop] Adds inkscape and groups some similar apps 2025-12-08 16:15:27 -08:00
edb0f18989 [nvim] Updates a few plugins to new versions/repositories 2025-12-08 16:06:55 -08:00
cfde735570 [nvim] Removes copilot 2025-11-21 12:18:06 -08:00
9bbb4aa2dc [astronomy] Added to Altair, removed from Vega 2025-11-21 12:18:06 -08:00
9818771f7c [dm-companion] Fixes deployment script? 2025-11-21 12:09:29 -08:00
f7af96c497 [scrutiny] Switches to UUIDs, removes missing device. 2025-11-21 12:09:29 -08:00
499b0f4334 [astronomy] Adds Stellarium, KStars and Celestia to Vega 2025-10-21 11:58:35 -07:00
879ad11d96 [flake] update 2025-10-19 20:18:27 -07:00
640eaec8a1 [3d printing] Adds Orynt 2025-10-16 20:10:02 -07:00
898e1bdde0 [3d printing] Adds openscad 2025-10-15 17:42:32 -07:00
a6d4c40beb [notes, syncthing] Adds proxima to syncing. 2025-10-14 15:32:00 -07:00
a13e8cea19 [docker dev] Remove rootless mode because some apps (Bambu Studio) do not work in rootless mode 2025-10-07 16:59:44 -07:00
3b8e38e702 [immich] Adds but disabled Immich because it's crashing on start-up 2025-09-25 17:23:01 -07:00
05c001081e [Containers] Adds GPU support for docker 2025-09-22 20:17:01 -07:00
3e2e3aca21 [Flake] Update 2025-09-19 14:50:05 -07:00
1837a545a4 [3d printing] Adds freecad 2025-09-19 14:32:14 -07:00
5c7649d3df [3d printing] Adds slicers, blender 2025-09-16 20:59:34 -07:00
3bb9ebf875 [desktop] Removes QuteBrowser and adds Chromium 2025-09-16 20:59:34 -07:00
ee3b7c2c53 [wow.blazestar.net] Adds static site 2025-09-15 17:08:03 -07:00
746e31dca2 [nextcloud] Move back to a stable version after some bugs 2025-09-15 17:08:03 -07:00
9a59e60044 [nextcloud] Remove unused env vars 2025-09-15 17:08:03 -07:00
646221721e [Tandoor] Adds tandoor service 2025-09-15 17:08:03 -07:00
554b2863f3 [notes] Fixes alias. [discord] Adds skeleton for PTT hotkey passthrough 2025-09-10 12:05:13 -07:00
5829dc294e [Flake] Updates dependencies 2025-09-02 15:18:59 -07:00
0645912626 [hyprctl] Tweaks for Cyberpunk 2025-09-01 17:49:50 -07:00
430a041724 Adds Nexus-Mods app. 2025-09-01 17:48:04 -07:00
80512c29ea [notes] Adds alias for editing notes 2025-08-21 10:32:21 -07:00
392d6fe537 [discord] Attempts to fix the keybinding issue 2025-08-21 10:31:05 -07:00
6d1e715d9c [neovim] Add link-openining to Obsidian 2025-08-18 11:22:44 -07:00
94b8065dba [gaming] Update warcraft logs client 2025-08-15 22:09:02 -07:00
ea902faf43 [neovim] Cleans up some Snacks config 2025-08-03 11:10:49 -07:00
3d3fa1ed68 [eww] Remove launcher I never use. 2025-08-03 10:36:52 -07:00
cd4367e252 [gaming] Updates Raider.io launcher, still doesn't run properly. 2025-08-03 10:36:52 -07:00
cf4d54ebfd [Webkooks] Switches the NPM deploy to rsync the directory instead of link it because docker will follow the link and then not update. 2025-07-31 17:09:56 -07:00
3b46856b66 [Uptime Kuma] Adds Uptime Kuma to blazestar.net 2025-07-31 16:05:15 -07:00
1d1702bd9b [webhook] Updates the NPM install hooks to do a new directory on each deploy. Clean will come later 2025-07-31 15:34:45 -07:00
8a566715db [habits] Removes Beaver Habits because it seems underdeveloped 2025-07-25 13:43:27 -07:00
19d8c5c097 [habits] Adds beaver habits. [oidc] Sets up OIDC auth forwarding, it works, but not sure which header. 2025-07-25 12:22:33 -07:00
b3c6e951ee [mcp] Removes specific kernel packages for ZFS, preferring the default which should be compatible. 2025-07-18 18:11:05 -07:00
44ac6ce262 [shell] Adds fuser util 2025-07-18 18:10:26 -07:00
1c2cd59f1f [web-containers] Adds an explicit service in case we want to have two services. 2025-07-18 17:54:41 -07:00
ca4d4d714c Enables android dev on altair 2025-07-14 15:29:56 -07:00
8791432964 [goatcounter] Fixes instance for blazestar.net 2025-07-14 15:14:13 -07:00
638f34c2d3 [goatcounter] Adds instance for blazestar.net 2025-07-10 15:35:57 -07:00
743ce58b14 [graphics] Modularizes graphics config. Applies it to vega. 2025-07-01 16:13:08 -07:00
0a1d7a24e7 [dm-companion] Fixes deployment script to apply migrations. 2025-06-28 20:21:41 -07:00
81cb09176c [nvim] Use snacks as the primary picker, no relying on extras 2025-06-27 20:31:26 -07:00
7f04c3aa4c [nvim] Remove less from treesitter installed grammars 2025-06-27 20:01:11 -07:00
bded723261 [nix] Updates again because signal isn't building properly on the last version 2025-06-27 18:16:06 -07:00
0776b9d7e5 [eww] Use the correct network interface for Vega 2025-06-27 17:54:53 -07:00
0ac07e4256 Ensure some grammars are installed for treesitter 2025-06-26 17:46:20 -07:00
cedf51580e [dm-companion] Serves index for all unrecognized files, sets some cache directives 2025-06-26 16:32:39 -07:00
1dc7d7b355 [matrix] Got Blazestar.net working, but federation and cross-server joining isn't quite right. 2025-06-25 15:49:25 -07:00
b1510c3670 [containers] Disables some containers, adds some docker config. 2025-06-24 18:32:15 -07:00
f4dd4583db [nix] Modularized the container backend so I can easily switch it with an option 2025-06-24 17:31:30 -07:00
c74e40e69e [nix,flake] Moves some container files around. Also updates the flake lock. [synapse] Gets the federation working 2025-06-24 16:57:38 -07:00
514746686f [matrix] Moves secrets into sops 2025-06-24 14:29:08 -07:00
286701ba83 [blazestar.net] Sets up auto-deploy of an npm-based app. 2025-06-24 14:28:59 -07:00
1bfec397b5 [goatcounter] Adds back the rewrite for count.js 2025-06-22 10:37:49 -07:00
84d05be93b [goatcounter] Removes the special rewrite rules. Leaves them as comments for reference 2025-06-17 16:00:53 -07:00
03b3fe16b1 [goatcounter] Adds goatcounter.terakoda.com 2025-06-17 15:34:18 -07:00
cda32ea550 [dm-companion] Sets up auto-deploy and moves it to terakoda.com 2025-06-15 11:00:50 -07:00
32e10284d0 [desktop] Fixes XDG mime types for default browser 2025-06-11 15:16:46 -07:00
b9c439f5a9 [nvim] Some extra todo states 2025-06-11 15:12:28 -07:00
449662db8c [desktop] Adds gimp 2025-06-11 10:36:42 -07:00
6601377ece [terakoda.com] Moves www2 to the main site. 2025-06-09 16:04:11 -07:00
d432ef8014 [webhook] Switches match rule to just use an IP whitelist. 2025-06-09 16:04:11 -07:00
9acaae9277 [homemanager] Fixes env vars 2025-06-09 15:47:16 -07:00
f46c5948e5 [flake] Update 2025-06-09 10:15:09 -07:00
1d94f2574c [desktop] Set Librewolf as the default browser. 2025-06-08 20:57:13 -07:00
0a64c5cd4b [hypridle] Tweaks timings 2025-06-06 22:07:14 -07:00
2f44b67e9e [nvim] Remove augment plugin 2025-06-04 21:30:17 -07:00
f8378354fb [webhook] Adds webhook for redeploying npm projects 2025-06-04 17:35:31 -07:00
104cd2fd2e [arr] Adds bazarr. 2025-06-03 23:47:43 -07:00
075613c5a5 [ghost] Removes ghost demo. 2025-06-03 15:15:50 -07:00
dd8ec9035e [ghost] Adds ghost demo. 2025-06-03 15:15:28 -07:00
e5861f8e6b [dm-companion] Routes the API through the same host as the frontend 2025-06-03 15:15:28 -07:00
1ae798e30c [swaylock] Increase pixelation to 20 2025-05-30 16:31:16 -07:00
fec3b3a1e2 [oauth-proxy] Making some progress on this. It's not working, but it's now redirecting and getting 'invalid status code' 2025-05-30 10:25:00 -07:00
9411f87dbc [timetagger,traefik] Adds timetagger back, and attempts to put it behind an oauth proxy, but the traefik config isn't quite right. 2025-05-29 17:05:53 -07:00
07123a0fc2 [lock,idle] Fixes the swaylock script to work for multiple monitors and fixes it's invocation 2025-05-29 12:36:03 -07:00
5299c6d72c [shell] Adds mprocs 2025-05-29 10:26:58 -07:00
aa6402cf7c [idle;lock] Switches to swaylock 2025-05-28 12:23:14 -07:00
efab3866c2 [vega] Removes lock because it isn't working. [shell] Fixes aliases 2025-05-28 11:32:36 -07:00
b56d904c4e [vega] Switches back to stable. 2025-05-27 10:23:46 -07:00
fbf475f179 [nvim] Updates obsidian options: better file names 2025-05-27 10:23:10 -07:00
30ad37c30f [shell] Adds lots of little utilities 2025-05-26 20:37:34 -07:00
2253423fc4 [XCompose] Adds greek letters 2025-05-23 10:36:50 -07:00
bfa912f513 [vega] Attempting to fix some audio popping. 2025-05-22 17:36:12 -07:00
7e7ffa6fa7 [nvim,vscode] VSCode/Copilot config 2025-05-22 17:35:46 -07:00
447fe20041 [vega] Moves to unstable to fix issues building hy3 2025-05-21 15:47:13 -07:00
a219966688 [mcp] Updates to 25.05 and adds FreshRSS. Removes Focalboard and Bookstack 2025-05-20 20:21:51 -07:00
f2875caabb [Rofi] Fixes rendering and updates styles 2025-05-20 17:50:59 -07:00
d5bc7c3143 [Hypr] Sets up hypridle. [Nvim] Sets up nix formatting 2025-05-19 15:52:29 -07:00
a5ceae0912 [Rofi] Adds focus-holding in Hyprland 2025-05-19 12:04:34 -07:00
af07210253 [altair] Adds VSCode 2025-05-17 10:38:31 -07:00
f5fd69ab28 Adds more VScode extensions 2025-05-12 19:43:56 -07:00
8796f36a68 [docker] sets the docker socket variable 2025-05-12 17:27:09 -07:00
4caddc6959 [nvim] Re-enables Augment Code 2025-05-12 17:26:52 -07:00
9263d2752f [vscode] Sets up VScode with some extensions on Vega. 2025-05-12 17:26:31 -07:00
23d71b3a09 [nix] Allow unfree for shells. [docker] Correctly export DOCKER_HOST. [nvim] Disable augment and turn on vtsls 2025-05-11 11:21:36 -07:00
945d3aa002 [nvim] Adds augment plugin. 2025-05-10 10:38:25 -07:00
f76969136e [nvim] Maybe finally fixes snacks smart picker 2025-05-09 18:20:44 -07:00
4dc66c25f6 [vega] Adds Zoom app 2025-05-09 18:20:29 -07:00
5e2c997cdc [linux-desktop] Adds a few more apps and reorganizes the config 2025-05-09 18:20:14 -07:00
b1ae2d56fb [markdown] Adds marksman languages server and telescope picker for obsidian 2025-05-09 11:02:11 -07:00
d814aa9465 [shell] Add dysk as alternative to df 2025-05-09 10:31:37 -07:00
bedce7a93c [neovim] Snacks smart-picker config 2025-05-09 10:31:27 -07:00
e2e32fb6cd [hyprland] Re-configure swayidle as a service 2025-05-09 10:31:00 -07:00
aa2cec9f70 [nvim] Improves markdown checkbox experience 2025-05-06 11:25:28 -07:00
2c3ab47daa [vega] Adds slack for business communication 2025-05-05 16:22:05 -07:00
4c9d2e90c3 [neovim] Sets up surround, emoji auto-complete, indentation 2025-05-05 14:29:29 -07:00
8d4febc16f [hyprland] Adds some gaming window rules 2025-05-05 13:14:11 -07:00
69bfb463fe [hyprland] Run eww only once. 2025-05-05 13:07:21 -07:00
73f2bcb362 [Altair] Switches to unstable 2025-05-05 13:05:23 -07:00
0914c02547 [nix] Cleans up warnings about options and reduces duplication 2025-05-05 10:33:00 -07:00
29317386a9 [gaming] Adds protonplus 2025-05-03 16:52:27 -07:00
177e91c658 [hyprland] Moves env to uswm/env as recommended in whe wiki 2025-05-03 16:52:27 -07:00
2643d3801f [development] More TS dev fixes, adds direnv. Fixes some markdown rendering. 2025-05-01 12:19:54 -07:00
8884bd51fd [container-dev] Switch to rootless docker. [nvim] Update snacks options. [hyprland] Use clipboard fixes globally 2025-04-30 14:29:31 -07:00
55bd116fde [wayland] Adds clipboard fix for wine 2025-04-30 10:42:39 -07:00
99da063b14 [eww] Fixes some errors due to missing functions or null values 2025-04-29 17:31:12 -07:00
0a7e176c1e [dev] Sets up podman as a system package instead of homemanager. 2025-04-29 17:31:12 -07:00
db8d2a3a23 [eww] Show only root partition on vega 2025-04-29 17:31:12 -07:00
828750087d [eww] Fixes networking. [swayosd] Removes instances started by hyprland 2025-04-29 17:31:12 -07:00
1153e9086a [eww] Fixes some stuff with the vertical statusbar 2025-04-29 17:31:12 -07:00
e405610baf [mcp] Adds back the user changes I accidentally clobbered. 2025-04-29 13:10:38 -07:00
35a3ec8f7c [vega] Enables running app-images as binaries 2025-04-29 11:45:52 -07:00
108 changed files with 2908 additions and 1421 deletions

56
flake.lock generated
View File

@@ -3,64 +3,36 @@
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs-stable"
"nixpkgs"
]
},
"locked": {
"lastModified": 1743788974,
"narHash": "sha256-2LeVyQZI2wTkSzMLvnN/kJjXVWp4HCVUoq17Bv8TNTk=",
"lastModified": 1767910483,
"narHash": "sha256-MOU5YdVu4DVwuT5ztXgQpPuRRBjSjUGIdUzOQr9iQOY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0f5908daf890c3d7e7052bef1d6deb0f2710aaa1",
"rev": "82fb7dedaad83e5e279127a38ef410bcfac6d77c",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"ref": "release-25.11",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 0,
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
"path": "/nix/store/fwhfa9pbx8vdi8nd5pcys665baz6xdxf-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1744168086,
"narHash": "sha256-S9M4HddBCxbbX1CKSyDYgZ8NCVyHcbKnBfoUXeRu2jQ=",
"lastModified": 1767799921,
"narHash": "sha256-r4GVX+FToWVE2My8VVZH4V0pTIpnu2ZE8/Z4uxGEMBE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "60e405b241edb6f0573f3d9f944617fe33ac4a73",
"rev": "d351d0653aeb7877273920cd3e823994e7579b0b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1744098102,
"narHash": "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
@@ -69,23 +41,21 @@
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs-stable"
"nixpkgs"
]
},
"locked": {
"lastModified": 1743756170,
"narHash": "sha256-2b11EYa08oqDmF3zEBLkG1AoNn9rB1k39ew/T/mSvbU=",
"lastModified": 1767826491,
"narHash": "sha256-WSBENPotD2MIhZwolL6GC9npqgaS5fkM7j07V2i/Ur8=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "cff8437c5fe8c68fc3a840a21bf1f4dc801da40d",
"rev": "ea3adcb6d2a000d9a69d0e23cad1f2cacb3a9fbe",
"type": "github"
},
"original": {

View File

@@ -2,54 +2,43 @@
description = "System Configuration";
inputs = {
nixpkgs-unstable = {
url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
nixpkgs-stable = {
url = "github:nixos/nixpkgs?ref=nixos-24.11";
};
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs-stable";
url = "github:nix-community/home-manager?ref=release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# hyprland = {
# url = "github:hyprwm/Hyprland";
# inputs.nixpkgs.follows = "nixpkgs-stable";
# };
# hy3 = {
# url = "github:outfoxxed/hy3";
# inputs.hyprland.follows = "hyprland";
# };
# split-monitor-workspaces = {
# url = "github:Duckonaut/split-monitor-workspaces";
# inputs.hyprland.follows = "hyprland";
# };
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs-stable";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
{
self,
nixpkgs,
...
}@inputs:
let
local = import ./lib;
# TODO: Convert other configurations to use this function.
mkNixosConfig =
{
path,
system ? "x86_64-linux",
nixpkgs ? inputs.nixpkgs-stable,
nixpkgs ? inputs.nixpkgs,
home-manager ? inputs.home-manager,
}:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
inputs.home-manager.nixosModules.home-manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs local;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs local;
};
};
}
path
@@ -72,7 +61,7 @@
};
};
features = {
development = (import ./home-manager/features/development/development.nix);
development = import ./home-manager/features/development/development.nix;
};
};
}

View File

@@ -8,7 +8,11 @@
discord = {
name = "Discord";
# Custom options to reduce flickering under wayland.
exec = "discord --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu";
exec = "env ELECTRON_OZONE_PLATFORM_HINT= discord --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu";
};
};
wayland.windowManager.hyprland.settings.bind = [
# Pass Mouse4 through to discord
# ", mouse:275, pass, class:^discord$"
];
}

View File

@@ -0,0 +1,64 @@
{
pkgs,
...
}:
let
freecad-wrapped = pkgs.symlinkJoin {
name = "freecad-wrapped";
paths = [ pkgs.freecad ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/freecad \
--prefix MESA_LOADER_DRIVER_OVERRIDE : zink \
--prefix __EGL_VENDOR_LIBRARY_FILENAMES : ${pkgs.mesa}/share/glvnd/egl_vendor.d/50_mesa.json
'';
};
bambu-studio-wrapped = pkgs.symlinkJoin {
name = "bambu-studio-wrapped";
paths = [ pkgs.bambu-studio ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/bambu-studio \
--prefix MESA_LOADER_DRIVER_OVERRIDE : zink \
--prefix __EGL_VENDOR_LIBRARY_FILENAMES : ${pkgs.mesa}/share/glvnd/egl_vendor.d/50_mesa.json
'';
};
in
{
home.packages = with pkgs; [
bambu-studio-wrapped
LycheeSlicer
orca-slicer
blender
freecad-wrapped
openscad
];
xdg.desktopEntries.orynt3d =
let
orynt3d-appimage = pkgs.fetchurl {
name = "orynt3d-appimage";
url = "https://files.orynt3d.com/client/Orynt3D-0.15.3.AppImage";
sha256 = "0j10myj06ff4frsd4yv7z3lb3qgw3ha70hc5hdc9idbryica801y";
};
in
{
name = "Orynt3D";
exec = "env __EGL_VENDOR_LIBRARY_FILENAMES=/run/opengl-driver/share/glvnd/egl_vendor.d/10_nvidia.json ${pkgs.appimage-run}/bin/appimage-run ${orynt3d-appimage}";
terminal = false;
type = "Application";
# icon = "";
comment = "3D model viewer and organizer";
categories = [
"Science"
"Development"
];
};
# Options to get Bambu Studio to run:
# __GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/nix/store/js9cfbjvlsls14nddk39fw74vyvlhz4l-mesa-25.0.7/share/glvnd/egl_vendor.d/50_mesa.json MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink WEBKIT_DISABLE_DMABUF_RENDERER=1 bambu-studio
}

View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
stellarium
kstars
celestia
];
}

View File

@@ -1,7 +1,41 @@
{ pkgs, ... }:
with pkgs;
let
# A script that runs as long as media is playing.
isMediaPlaying = writeShellApplication {
name = "isMediaPlaying";
runtimeInputs = [
playerctl
];
text = ''
set -e
while [ "$(playerctl status)" = "Playing" ]; do
echo -n "."
sleep 1
done
'';
};
# A script that prevents the system from going to sleep while media is playing
mediaCaffeine = writeShellApplication {
name = "media-caffeine";
runtimeInputs = [
isMediaPlaying
systemd
];
text = ''
set -e
systemd-inhibit --what=sleep --why="Media is playing" --mode=block isMediaPlaying
'';
};
in
{
home.packages = with pkgs; [
pulseaudio # for pactl and other tools
pavucontrol # GUI volume control with lots of options
mediaCaffeine
];
}

View File

@@ -0,0 +1,11 @@
{ pkgs, ... }:
{
imports = [
../apps/element.nix
../apps/discord.nix
];
home.packages = with pkgs; [
signal-desktop
];
}

View File

@@ -1,7 +1,64 @@
include "%L"
<Multi_key> <m> <u> : "μ"
<Multi_key> <p> <i> : "π"
<Multi_key> <minus> <comma> : "¬"
<Multi_key> <asciicircum> <asciicircum> : "∧"
<Multi_key> <v> <v> : ""
# GREEK CAPITAL LETTERS
<Multi_key> <G> <A> : "Α" U0391 # GREEK CAPITAL LETTER ALPHA
<Multi_key> <G> <B> : "Β" U0392 # GREEK CAPITAL LETTER BETA
<Multi_key> <G> <G> : "Γ" U0393 # GREEK CAPITAL LETTER GAMMA
<Multi_key> <G> <D> : "Δ" U0394 # GREEK CAPITAL LETTER DELTA
<Multi_key> <G> <E> : "Ε" U0395 # GREEK CAPITAL LETTER EPSILON
<Multi_key> <G> <Z> : "Ζ" U0396 # GREEK CAPITAL LETTER ZETA
<Multi_key> <G> <H> : "Η" U0397 # GREEK CAPITAL LETTER ETA
<Multi_key> <G> <I> : "Ι" U0399 # GREEK CAPITAL LETTER IOTA
<Multi_key> <G> <K> : "Κ" U039A # GREEK CAPITAL LETTER KAPPA
<Multi_key> <G> <L> : "Λ" U039B # GREEK CAPITAL LETTER LAMDA
<Multi_key> <G> <M> : "Μ" U039C # GREEK CAPITAL LETTER MU
<Multi_key> <G> <N> : "Ν" U039D # GREEK CAPITAL LETTER NU
<Multi_key> <G> <P> : "Π" U03A0 # GREEK CAPITAL LETTER PI
<Multi_key> <G> <R> : "Ρ" U03A1 # GREEK CAPITAL LETTER RHO
<Multi_key> <G> <S> : "Σ" U03A3 # GREEK CAPITAL LETTER SIGMA
<Multi_key> <G> <T> : "Τ" U03A4 # GREEK CAPITAL LETTER TAU
<Multi_key> <G> <U> : "Υ" U03A5 # GREEK CAPITAL LETTER UPSILON
<Multi_key> <G> <F> : "Φ" U03A6 # GREEK CAPITAL LETTER PHI
<Multi_key> <G> <X> : "Χ" U03A7 # GREEK CAPITAL LETTER CHI
<Multi_key> <G> <O> : "Ω" U03A9 # GREEK CAPITAL LETTER OMEGA
# DOUBLES (additional stroke <Q>)
<Multi_key> <G> <Q> <T> : "Θ" U0398 # GREEK CAPITAL LETTER THETA
<Multi_key> <G> <Q> <O> : "Ο" U039F # GREEK CAPITAL LETTER OMICRON
<Multi_key> <G> <Q> <X> : "Ξ" U039E # GREEK CAPITAL LETTER XI
<Multi_key> <G> <Q> <P> : "Ψ" U03A8 # GREEK CAPITAL LETTER PSI
# greek small letters
<Multi_key> <g> <a> : "α" U03B1 # GREEK SMALL LETTER ALPHA
<Multi_key> <g> <b> : "β" U03B2 # GREEK SMALL LETTER BETA
<Multi_key> <g> <g> : "γ" U03B3 # GREEK SMALL LETTER GAMMA
<Multi_key> <g> <d> : "δ" U03B4 # GREEK SMALL LETTER DELTA
<Multi_key> <g> <e> : "ε" U03B5 # GREEK SMALL LETTER EPSILON
<Multi_key> <g> <z> : "ζ" U03B6 # GREEK SMALL LETTER ZETA
<Multi_key> <g> <h> : "η" U03B7 # GREEK SMALL LETTER ETA
<Multi_key> <g> <i> : "ι" U03B9 # GREEK SMALL LETTER IOTA
<Multi_key> <g> <k> : "κ" U03BA # GREEK SMALL LETTER KAPPA
<Multi_key> <g> <l> : "λ" U03BB # GREEK SMALL LETTER LAMDA
<Multi_key> <g> <m> : "μ" U03BC # GREEK SMALL LETTER MU
<Multi_key> <g> <n> : "ν" U03BD # GREEK SMALL LETTER NU
<Multi_key> <g> <p> : "π" U03C0 # GREEK SMALL LETTER PI
<Multi_key> <g> <r> : "ρ" U03C1 # GREEK SMALL LETTER RHO
<Multi_key> <g> <s> : "σ" U03C3 # GREEK SMALL LETTER SIGMA
<Multi_key> <g> <t> : "τ" U03C4 # GREEK SMALL LETTER TAU
<Multi_key> <g> <u> : "υ" U03C5 # GREEK SMALL LETTER UPSILON
<Multi_key> <g> <f> : "φ" U03C6 # GREEK SMALL LETTER PHI
<Multi_key> <g> <x> : "χ" U03C7 # GREEK SMALL LETTER CHI
<Multi_key> <g> <o> : "ω" U03C9 # GREEK SMALL LETTER OMEGA
# doubles (additional stroke <q>)
<Multi_key> <g> <q> <t> : "θ" U03B8 # GREEK SMALL LETTER THETA
<Multi_key> <g> <q> <o> : "ο" U03BF # GREEK SMALL LETTER OMICRON
<Multi_key> <g> <q> <p> : "ψ" U03C8 # GREEK SMALL LETTER PSI
<Multi_key> <g> <q> <s> : "ς" U03C2 # GREEK SMALL LETTER FINAL SIGMA
<Multi_key> <g> <q> <x> : "ξ" U03BE # GREEK SMALL LETTER X

View File

@@ -1,4 +1,4 @@
{ ... }:
{ pkgs, ... }:
{
imports = [
# Dev apps
@@ -10,6 +10,11 @@
# Base languages that should always be available
./nix.nix
./lua.nix
./sh.nix
];
home.packages = with pkgs; [
hyperfine # Benchmarking tool
];
programs.direnv = {

View File

@@ -1,11 +1,6 @@
{ pkgs, ... }:
{
# Use podman over docker
services.podman = {
enable = true;
};
home.packages = with pkgs; [
podman-compose
docker-compose
];
}

View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
markdownlint-cli2 # linter
marksman # language server
];
}

View File

@@ -6,6 +6,7 @@
nixfmt-rfc-style # Formatter
nil # Language Server
statix # Lints and suggestions for Nix
];
home.shellAliases = {
@@ -14,4 +15,3 @@
rebuild-boot = "sudo nixos-rebuild boot --flake ~/system-config --show-trace --print-build-logs --verbose";
};
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
shfmt # Formatter
];
}

View File

@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
vtsls # Language Server
eslint # Linter
nodePackages.prettier # Formatter
tailwindcss-language-server # Language server for tailwind CSS
];
}

View File

@@ -0,0 +1,20 @@
{ pkgs, ... }:
{
programs.vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
asvetliakov.vscode-neovim # Use embedded neovim editor
enkia.tokyo-night # Color theme
eamodio.gitlens # Show git info inline
mechatroner.rainbow-csv # Make it easier to read CSV files
aaron-bond.better-comments # Provides some highlighting in comments
# Typescript
esbenp.prettier-vscode # Auto-formatting
# AI Agents
github.copilot
];
};
}

View File

@@ -33,6 +33,16 @@ $color-standout-dark: darker($color-standout);
font-family: 'Noto Sans Nerd Font', sans-serif;
}
window.vertical-statusbar {
background-color: $color-background;
// background-image: linear-gradient(160deg, rgba(255,00,00,0.5), $color-background);
color: $color-foreground;
padding: 16px;
font-size: 14px;
border-right: 3px solid $color-border;
font-family: 'Noto Sans Nerd Font', sans-serif;
}
.system-monitor {
padding-top: 8px;
padding-right: 8px;

View File

@@ -3,5 +3,4 @@
(include "./primary-statusbar.yuck")
(include "./secondary-statusbar.yuck")
(include "./system-monitor.yuck")
(include "./launcher.yuck")
(include "./vertical-statusbar.yuck")

View File

@@ -1,74 +0,0 @@
(defwindow launcher
:monitor '[ "<primary>", "DP-2", 0 ]'
:geometry (geometry
:x "100px"
:y "100px"
:anchor "top left"
)
:stacking "bottom"
:exclusive false
:focusable false
(box
:class "launcher-window stand-alone"
:orientation "v"
:spacing 4
:visible { arraylength(jq(workspaces-json-dp2, "map(select(.active and (.has_windows | not)))")) > 0 }
(box
:orientation "v"
:halign "start"
:spacing 4
:space-evenly false
(label
:text "Apps"
:halign "start"
)
(box
:orientation "h"
:halign "start"
:spacing 4
:space-evenly false
(button
:onclick "firefox"
(image
:class "launcher-icon"
:icon "firefox"
:icon-size "dialog"
)
)
)
)
(box
:orientation "v"
:halign "start"
:spacing 4
:space-evenly false
(label
:text "Games"
:halign "start"
)
(box
:orientation "h"
:halign "start"
:spacing 4
:space-evenly false
(button
;; :onclick "env LUTRIS_SKIP_INIT=1 lutris lutris:rungameid/1"
:onclick "/home/drew/.local/bin/wow.sh >/tmp/wow.log 2>&1"
(image
:class "launcher-icon"
:image-width 48
:path "/home/drew/.local/share/icons/hicolor/128x128/apps/lutris_battlenet.png"
)
)
;; (button
;; :onclick "steam steam://rungameid/1145350"
;; (image
;; :class "launcher-icon"
;; :icon "steam_icon_1145350"
;; :icon-size "dialog"
;; )
;;)
)
)
)
)

View File

@@ -30,7 +30,7 @@
:spacing 8
(system-monitor-perf)
(system-monitor-disks)
(system-monitor-net)
(system-monitor-net :interface "wlo1")
)
(box
:orientation "h"
@@ -145,13 +145,13 @@
:name "Disks"
(system-monitor-gauge
:name "Root"
:text-value {EWW_DISK['/'].free / powi(2, 30)}
:text-value {EWW_DISK['/'].free / 1000000000}
:gauge-pct {EWW_DISK['/'].used_perc}
:units " GB"
)
(system-monitor-gauge
:name "Home"
:text-value {EWW_DISK['/home'].free / powi(2, 30)}
:text-value {EWW_DISK['/home'].free / 1000000000}
:gauge-pct {EWW_DISK['/home'].used_perc}
:units " GB"
)
@@ -164,7 +164,7 @@
`iwgetid -r`
)
(defwidget system-monitor-net []
(defwidget system-monitor-net [ interface ]
(system-monitor-group
:name "Network"
:orientation "v"
@@ -174,12 +174,12 @@
)
(system-monitor-sparkgraph
:name "Down"
:value {EWW_NET["wlo1"]["NET_DOWN"] / 1000000}
:value {EWW_NET[interface]["NET_DOWN"] / 1000000}
:units " MB/s"
)
(system-monitor-sparkgraph
:name "Up"
:value {EWW_NET["wlo1"]["NET_UP"] / 1000000}
:value {EWW_NET[interface]["NET_UP"] / 1000000}
:units " MB/s"
)
)

View File

@@ -17,11 +17,22 @@
(workspaces :workspaces-json workspaces-json-hdmi-a-1)
)
(defwidget disks-vega []
(system-monitor-group
:name "Disks"
(system-monitor-gauge
:name "Root"
:text-value {EWW_DISK['/'].free / 1000000000}
:gauge-pct {EWW_DISK['/'].used_perc}
:units " GB"
)
)
)
(defwidget vertical-statusbar []
(box
:class "statusbar"
:orientation "v"
:halign "center"
:halign "fill"
:spacing 8
:space-evenly false
(clock-large)
@@ -33,8 +44,8 @@
(system-monitor-perf-cpu)
(system-monitor-perf-gpu)
)
(system-monitor-disks)
(system-monitor-net)
(disks-vega)
(system-monitor-net :interface "wlp5s0")
(system-monitor-audio)
)
)

View File

@@ -1,5 +1,13 @@
{ ... }:
{ pkgs, ... }:
{
home.packages = with pkgs; [
# For Noto Sans NF
# 25.05
nerd-fonts.noto
# 24.11
# (nerdfonts.override { fonts = [ "NotoSans" ]; })
];
programs.eww = {
enable = true;
configDir = ./config;

View File

@@ -16,7 +16,7 @@ let
# '';
warcraftLogsUploader = pkgs.fetchurl {
name = "warcraftlogs-client";
url = "https://github.com/RPGLogs/Uploaders-warcraftlogs/releases/download/v8.16.56/warcraftlogs-v8.16.56.AppImage";
url = "https://github.com/RPGLogs/Uploaders-warcraftlogs/releases/download/v8.17.47/warcraftlogs-v8.17.47.AppImage";
sha256 = "1aypr3ffy6lq0qj64d48c7n54nfs72404xb2kpxsw5slqh66imw6";
};
warcraftLogsIcon = pkgs.fetchurl {
@@ -27,7 +27,7 @@ let
raiderioClient = pkgs.fetchurl {
name = "raiderio-client";
url = "https://raider.io/client/download/linux";
sha256 = "0k665s5frs7pga38yjz38gszkn5gkxkfzqlq07x0bm4qjvbrjf7z";
sha256 = "0wcw53bgr9dr02x1ci2jlnc5irpiqxqxgs2hpbrsnj67q50nvlm9";
};
raiderioIcon = pkgs.fetchurl {
name = "raiderio-icon";
@@ -46,10 +46,15 @@ in
];
})
protonup-ng
protonplus
protontricks
vulkan-tools # useful for debugging Vulkan issues
# WoW addon updater
wowup-cf
# Nexus Mod Manager
nexusmods-app-unfree
];
# xdg.dataFile."applications/wowup-cf.desktop" = {
@@ -80,7 +85,7 @@ in
categories = [ "Game" ];
};
xdg.desktopEntries.raiderio = local.electronDesktopEntry {
xdg.desktopEntries.raiderio = {
name = "Raider.io";
exec = "${pkgs.appimage-run}/bin/appimage-run ${raiderioClient}";
terminal = false;
@@ -89,4 +94,26 @@ in
comment = "Raider.io Client";
categories = [ "Game" ];
};
wayland.windowManager.hyprland.settings.windowrulev2 = [
# Set up full-screen games on monitor 1 (since window 0 is the vertical one.)
"monitor 1,class:^steam_app_\d+$"
"float,class:^steam_app_\d+$"
"monitor 1,fullscreen:1"
"center,class:^steam_app_\d+$"
# Make sure WoW spawns on the right monitor and that Battlenet floats so it renders correctly
"monitor 1,title:^World of Warcraft$"
"fullscreen,title:^World of Warcraft$"
"monitor 1,title:^Battle.net$"
"float,title:^Battle.net$"
# Make Balatro into a regular window.
"monitor 1,title:^Balatro$"
"tile,title:^Balatro$"
# Load Cyberpunk 2077 on the right monitor.
"monitor 1,class:steam_app_1091500"
"fullscreen,class:steam_app_1091500"
];
}

View File

@@ -12,9 +12,6 @@
"l" = "log --oneline";
};
extraConfig = {
core = {
pager = "";
};
pull = {
rebase = true;
};
@@ -25,5 +22,7 @@
defaultBranch = "main";
};
};
# Enable the delta diff pager.
delta.enable = true;
};
}

View File

@@ -0,0 +1,34 @@
{ ... }:
{
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof swaylock || ~/.config/swaylock/swaylock.sh"; # avoid starting multiple lock instances.
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
};
listener = [
{
timeout = 300; # 5min
on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = "brightnessctl -r"; # monitor backlight restore.
}
{
timeout = 330; # 5.5 min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 600; # 10 min
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on && brightnessctl -r"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 1800; # 30min
on-timeout = "systemctl suspend"; # suspend pc
}
];
};
};
}

View File

@@ -1,11 +1,19 @@
{ pkgs, ... }:
{
imports = [
./swaylock.nix
./hypr/hypridle.nix
];
home.packages = with pkgs; [
swayidle # lock on idle
swayosd # volume pop-up
swaynotificationcenter # notifications
hyprpolkitagent # Privilege managent
hyprshot # Screenshot utility
# For clipboard management. See below.
wl-clipboard
xclip
];
wayland.windowManager.hyprland = {
@@ -28,34 +36,20 @@
"$terminal" = "foot";
"$menu" = "rofi -show combi -combi-modes drun,ssh,run -theme ~/.config/rofi/launcher/style.rasi";
"$browser" = "firefox";
"$browser" = "firefox --new-window";
exec-once = [
"nm-applet"
"sleep 2 && hyprpm reload -n"
"swayidle -w before-sleep hyprlock"
"swayosd-server"
"systemctl --user start hyprpolkitagent"
"gsettings set org.gnome.desktop.interface color-scheme \"prefer-dark\""
"gsettings set org.gnome.desktop.interface gtk-theme \"Adwaita-dark\""
];
env = [
"XCURSOR_SIZE,32"
"HYPRCURSOR_SIZE,32"
"HYPRCURSOR_THEME,phinger"
# Nvidia config
"LIBVA_DRIVER_NAME,nvidia"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
# For window theming
"QT_QPA_PLATFORMTHEME,qt6ct # for Qt apps"
"GTK_THEME,Adwaita-dark"
# Tell electron apps they should use OZone for Wayland
"ELECTRON_OZONE_PLATFORM_HINT,auto"
# Hyprland doesn't paste into Firefox or Wine apps. This program is a workaround.
# See https://github.com/hyprwm/Hyprland/issues/2319
# -t text = Only handle text
# -w xclip -selection clipboard = Watch for events and invoke xclip
"wl-paste -t text -w xclip -selection clipboard"
];
general = {
@@ -293,6 +287,7 @@
"$mainMod, B, exec, $browser"
"$mainMod, D, exec, $menu"
"$mainMod + SHIFT, S, exec, hyprshot -m region --clipboard-only"
"$mainMod + CTRL + SHIFT, S, exec, hyprshot -m region -o ~/Pictures"
"$mainMod, C, exec, swaync-client -t"
"$mainMod + L_CONTROL, Q, exec, /home/drew/.config/rofi/powermenu/powermenu.sh"
@@ -404,16 +399,6 @@
"opaque,class:(),title:()"
"noshadow,class:(),title:()"
"noblur,class:(),title:()"
# Set up full-screen games on monitor 1
"monitor 1,class:^steam_app_\d+$"
"float,class:^steam_app_\d+$"
"monitor 1,fullscreen:1"
"center,class:^steam_app_\d+$"
"monitor 1,title:^World of Warcraft$"
"monitor 1,title:^Battle.net$"
"float,title:^Battle.net$"
];
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
@@ -443,7 +428,7 @@
};
programs.hyprlock = {
enable = true;
enable = false;
settings = {
general = {
disable_loading_bar = true;
@@ -491,4 +476,24 @@
};
};
};
# UWSM sessions should not use Hyprland's variables but instead use UWSM's variable management.
# See https://wiki.hyprland.org/Configuring/Environment-variables/
home.file.".config/uwsm/env".text = ''
export XCURSOR_SIZE="32"
export HYPRCURSOR_SIZE="32"
export HYPRCURSOR_THEME="phinger"
# Nvidia config
export LIBVA_DRIVER_NAME="nvidia"
export __GLX_VENDOR_LIBRARY_NAME="nvidia"
# For window theming
export QT_QPA_PLATFORMTHEME="qt6ct # for Qt apps"
export GTK_THEME="Adwaita-dark"
# Tell electron apps they should use OZone for Wayland
export ELECTRON_OZONE_PLATFORM_HINT="auto"
'';
}

View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
gimp3
inkscape
];
}

View File

@@ -3,7 +3,6 @@
imports = [
./audio.nix
./hyprland.nix
./nix.nix
./rofi/rofi.nix
./sway.nix
../apps/element.nix
@@ -11,40 +10,48 @@
./terminal.nix
];
home.packages = with pkgs; [
# Desktop Applications
signal-desktop
firefox
home = {
packages = with pkgs; [
# Desktop Applications
gimp3
# Common utilities
feh
networkmanagerapplet # network control
gnome-keyring # Secret management
glib # for Gnome/GTK settings
gsettings-desktop-schemas # So that we can access gnome settings
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk # GTK backend for XDG components like pickers
grim # Screenshot provider
nwg-look # GTK settings editor
playerctl # for universal play/pause etc
wirelesstools
waypaper # Wallpaper switcher
];
# Common utilities
feh
networkmanagerapplet # network control
gnome-keyring # Secret management
glib # for Gnome/GTK settings
gsettings-desktop-schemas # So that we can access gnome settings
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk # GTK backend for XDG components like pickers
grim # Screenshot provider
nwg-look # GTK settings editor
playerctl # for universal play/pause etc
wirelesstools
waypaper # Wallpaper switcher
];
home.pointerCursor = {
enable = true;
gtk.enable = true;
name = "phinger-cursors";
size = 16;
package = pkgs.phinger-cursors;
pointerCursor = {
enable = true;
gtk.enable = true;
name = "phinger-cursors";
size = 16;
package = pkgs.phinger-cursors;
};
# Hint for electron apps to use wayland
sessionVariables.NIXOS_OZONE_WL = "1";
# Miscelaneous config files
file = {
".XCompose".source = ./config/XCompose;
};
};
# Hint for electron apps to use wayland
home.sessionVariables.NIXOS_OZONE_WL = "1";
# Miscelaneous config files
home.file = {
".XCompose".source = ./config/XCompose;
programs = {
# browsers
firefox.enable = true;
librewolf.enable = true;
chromium.enable = true;
};
# GTK settings
@@ -76,4 +83,18 @@
platformTheme.name = "adwaita";
style.name = "adwaita-dark";
};
# Default apps
xdg.mimeApps = {
enable = true;
defaultApplications = {
"text/html" = [ "firefox.desktop" ];
"default-web-browser" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ];
"x-scheme-handler/about" = [ "firefox.desktop" ];
"x-scheme-handler/unknown" = [ "firefox.desktop" ];
};
};
home.sessionVariables.DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox";
}

View File

@@ -0,0 +1,18 @@
{
"extras": [
"lazyvim.plugins.extras.coding.mini-comment",
"lazyvim.plugins.extras.coding.mini-surround",
"lazyvim.plugins.extras.editor.snacks_picker",
"lazyvim.plugins.extras.lang.astro",
"lazyvim.plugins.extras.lang.haskell",
"lazyvim.plugins.extras.lang.json",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.nix",
"lazyvim.plugins.extras.lang.rust",
"lazyvim.plugins.extras.lang.tailwind",
"lazyvim.plugins.extras.lang.toml",
"lazyvim.plugins.extras.lang.typescript"
],
"install_version": 8,
"version": 8
}

View File

@@ -10,8 +10,8 @@
vim.api.nvim_create_autocmd("FileType", {
pattern = { "markdown" },
callback = function()
vim.bo.shiftwidth = 4
vim.bo.tabstop = 4
vim.bo.softtabstop = 4
vim.o.shiftwidth = 2
vim.o.tabstop = 2
vim.o.softtabstop = 2
end,
})

View File

@@ -18,6 +18,10 @@ require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- Integrate ESlint for fixes and prettier for formatting
-- See: https://www.lazyvim.org/configuration/recipes
{ import = "lazyvim.plugins.extras.linting.eslint" },
{ import = "lazyvim.plugins.extras.formatting.prettier" },
-- import/override with your plugins
{ import = "plugins" },
},

View File

@@ -4,3 +4,6 @@
-- Creates a shortcut for adding the directory of the current buffer when specifying a file
vim.cmd("cnoreabbrev %. %:h<Tab>")
-- Set snacks as the preferred picker.
vim.g.lazyvim_picker = "snacks"

View File

@@ -1,6 +1,29 @@
return {
"saghen/blink.cmp",
dependencies = {
"moyiz/blink-emoji.nvim",
},
opts = {
sources = {
default = { "lsp", "buffer", "snippets", "path", "emoji" },
providers = {
-- https://github.com/moyiz/blink-emoji.nvim
emoji = {
module = "blink-emoji",
name = "Emoji",
score_offset = 15, -- Tune by preference
opts = { insert = true }, -- Insert emoji (default) or complete its name
should_show_items = function()
return vim.tbl_contains(
-- Enable emoji completion only for git commits and markdown.
-- By default, enabled for all file-types.
{ "gitcommit", "markdown" },
vim.o.filetype
)
end,
},
},
},
keymap = {
preset = "default",
["<C-space>"] = {
@@ -8,7 +31,7 @@ return {
cmp.show()
end,
},
["<C-enter>"] = { "select_and_accept" },
["<Tab>"] = { "select_and_accept", "snippet_forward", "fallback" },
},
},
}

View File

@@ -0,0 +1,8 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
nix = { "nixfmt" },
},
},
}

View File

@@ -1,9 +0,0 @@
return {
"zbirenbaum/copilot.lua",
opts = {
filetypes = {
markdown = false,
help = false,
},
},
}

View File

@@ -1,5 +1,5 @@
return {
-- Maeson installs it's own binaries that are incompatible with NixOS.
{ "williamboman/mason.nvim", enabled = false },
{ "williamboman/mason-lspconfig.nvim", enabled = false },
{ "mason-org/mason.nvim", enabled = false },
{ "mason-org/mason-lspconfig.nvim", enabled = false },
}

View File

@@ -3,8 +3,17 @@ return {
"neovim/nvim-lspconfig",
opts = {
servers = {
-- Lua
lua_ls = {},
-- Nix
nil_ls = {},
-- Typescript
vtsls = {},
-- Haskell
hls = {},
},
codelens = {
enable = true,
},
},
},

View File

@@ -0,0 +1,45 @@
-- https://github.com/MeanderingProgrammer/render-markdown.nvim?tab=readme-ov-file#setup
return {
"MeanderingProgrammer/render-markdown.nvim",
opts = {
checkbox = {
enabled = true,
render_modes = true,
unchecked = {
icon = "󰄱 ",
highlight = "RenderMarkdownUnchecked",
scope_highlight = nil,
},
checked = {
-- Replaces '[x]' of 'task_list_marker_checked'.
icon = "󰱒 ",
-- Highlight for the checked icon.
highlight = "RenderMarkdownChecked",
-- Highlight for item associated with checked checkbox.
scope_highlight = nil,
},
-- Define custom checkbox states, more involved, not part of the markdown grammar.
-- As a result this requires neovim >= 0.10.0 since it relies on 'inline' extmarks.
-- The key is for healthcheck and to allow users to change its values, value type below.
-- | raw | matched against the raw text of a 'shortcut_link' |
-- | rendered | replaces the 'raw' value when rendering |
-- | highlight | highlight for the 'rendered' icon |
-- | scope_highlight | optional highlight for item associated with custom checkbox |
-- stylua: ignore
custom = {
partial = {
raw = '[/]',
rendered = '',
highlight = 'RenderMarkdownTodo',
scope_highlight = nil
},
deferred = {
raw = '[>]',
rendered = '',
highlight = 'RenderMarkdownWarn',
scope_highlight = nil
},
},
},
},
}

View File

@@ -1,10 +1,38 @@
return {
{
"echasnovski/mini.surround",
"nvim-mini/mini.surround",
enable = true,
keys = function(_, keys)
-- Populate the keys based on the user's options
local opts = LazyVim.opts("mini.surround")
local mappings = {
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
{ opts.mappings.delete, desc = "Delete Surrounding" },
{ opts.mappings.find, desc = "Find Right Surrounding" },
{ opts.mappings.find_left, desc = "Find Left Surrounding" },
{ opts.mappings.highlight, desc = "Highlight Surrounding" },
{ opts.mappings.replace, desc = "Replace Surrounding" },
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
}
mappings = vim.tbl_filter(function(m)
return m[1] and #m[1] > 0
end, mappings)
return vim.list_extend(mappings, keys)
end,
opts = {
mappings = {
add = "gsa", -- Add surrounding in Normal and Visual modes
delete = "gsd", -- Delete surrounding
find = "gsf", -- Find surrounding (to the right)
find_left = "gsF", -- Find surrounding (to the left)
highlight = "gsh", -- Highlight surrounding
replace = "gsr", -- Replace surrounding
update_n_lines = "gsn", -- Update `n_lines`
},
},
},
{
"echasnovski/mini.comment",
"nvim-mini/mini.comment",
enable = true,
},
}

View File

@@ -1,20 +1,7 @@
return {
"epwalsh/obsidian.nvim",
"obsidian-nvim/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = true,
ft = "markdown",
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
-- -- refer to `:h file-pattern` for more examples
-- "BufReadPre path/to/my-vault/*.md",
-- "BufNewFile path/to/my-vault/*.md",
-- },
dependencies = {
-- Required.
"nvim-lua/plenary.nvim",
},
opts = {
workspaces = {
{
@@ -22,6 +9,14 @@ return {
path = "~/Documents/Notes",
},
},
-- Can I enable this somehow? I'm using blink.cmp but this is triggering
-- it to look for nvim-cmp directly.
-- completion = {
-- nvim_cmp = true,
-- min_chars = 2,
-- },
daily_notes = {
-- Optional, if you keep daily notes in a separate directory.
folder = "Daily Notes",
@@ -30,10 +25,49 @@ return {
-- Optional, if you want to automatically insert a template from your template directory like ''
template = "Daily Note",
},
templates = {
folder = "Templates",
date_format = "%Y-%m-%d",
time_format = "%H:%M",
},
ui = {
-- Disable the UI features and let render-markdown.nvim handle it.
enable = false,
-- Even with UI disabled, this determines the order of checkbox states for the smart action.
checkboxes = {
[" "] = { char = "", hl_group = "ObsidianTodo" },
["x"] = { char = "", hl_group = "ObsidianDone" },
["/"] = { char = "", hl_group = "ObsidianTodo" },
[">"] = { char = "»", hl_group = "ObsidianRightArrow" },
["~"] = { char = "»", hl_group = "ObsidianTilde" },
["!"] = { char = "", hl_group = "ObsidianDone" },
},
},
-- Put the note ID in the wiki links
wiki_link_func = "prepend_note_id",
preferred_link_style = "wiki",
-- Customize how note IDs are generated given an optional title.
---@param title string|?
---@return string
note_id_func = function(title)
if title ~= nil then
-- If title is given, transform it into valid file name by removing most special characters
-- Note that parens are not supported because they interfere with markdown links.
return title:gsub("[^A-Za-z0-9-_]", ""):lower()
else
-- If title is nil, just put the date and four random characters
for _ = 1, 4 do
return os.date("%Y-%m-%d ") .. string.char(math.random(65, 90))
end
end
end,
follow_url_func = function(url)
vim.ui.open(url) -- Use the built-in open, need Neovim 0.10.0+
end,
},
}

View File

@@ -1,6 +1,58 @@
return {
"folke/snacks.nvim",
---@type snacks.Config
opts = function(_, opts)
vim.tbl_deep_extend("force", opts, {
picker = {
smart = {
-- Remove the "recent" picker so we don't get things from other directories.
multi = { "buffers", "files" },
matcher = {
-- sort even when the search string is empty
sort_empty = true,
-- Enable frecensy for matchers. This puts more common files near the top
frecency = false,
-- Make sure files in the current directory are prioritized
cwd_bonus = true,
-- Give more weight to files that are more recent
history_bonus = true,
-- Give more weight to places where the filename is part of the match
filename_bonus = true,
},
},
sources = {
explorer = {
layout = { layout = { position = "right" } },
},
},
-- This only supports the Kitty graphics protocol.
-- See
-- https://github.com/folke/snacks.nvim/blob/main/docs/image.md
-- https://github.com/obsidian-nvim/obsidian.nvim/wiki/Images
-- image = {
-- resolve = function(path, src)
-- if require("obsidian.api").path_is_note(path) then
-- return require("obsidian.api").resolve_image_path(src)
-- end
-- end,
-- },
},
})
Snacks.toggle({
name = "Color Column",
get = function()
return vim.o.colorcolumn == "80"
end,
set = function(state)
if state then
vim.o.colorcolumn = "80"
vim.cmd([[highlight ColorColumn guibg=#202020]])
else
vim.o.colorcolumn = ""
vim.cmd([[highlight ColorColumn guibg=None]])
end
end,
}):map("<leader>ut", { desc = "Toggle Color Column" })
end,
keys = {
{
"<leader><space>",
@@ -9,257 +61,5 @@ return {
end,
desc = "Smart Find Files",
},
-- The rest of these are just default bindings. Setting the one binding above seems to override the others.
{
"<leader>,",
function()
Snacks.picker.buffers()
end,
desc = "Buffers",
},
{ "<leader>/", LazyVim.pick("grep"), desc = "Grep (Root Dir)" },
{
"<leader>:",
function()
Snacks.picker.command_history()
end,
desc = "Command History",
},
{
"<leader>n",
function()
Snacks.picker.notifications()
end,
desc = "Notification History",
},
-- find
{
"<leader>fb",
function()
Snacks.picker.buffers()
end,
desc = "Buffers",
},
{
"<leader>fB",
function()
Snacks.picker.buffers({ hidden = true, nofile = true })
end,
desc = "Buffers (all)",
},
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
{
"<leader>fg",
function()
Snacks.picker.git_files()
end,
desc = "Find Files (git-files)",
},
{ "<leader>fr", LazyVim.pick("oldfiles"), desc = "Recent" },
{
"<leader>fR",
function()
Snacks.picker.recent({ filter = { cwd = true } })
end,
desc = "Recent (cwd)",
},
{
"<leader>fp",
function()
Snacks.picker.projects()
end,
desc = "Projects",
},
-- git
{
"<leader>gd",
function()
Snacks.picker.git_diff()
end,
desc = "Git Diff (hunks)",
},
{
"<leader>gs",
function()
Snacks.picker.git_status()
end,
desc = "Git Status",
},
{
"<leader>gS",
function()
Snacks.picker.git_stash()
end,
desc = "Git Stash",
},
-- Grep
{
"<leader>sb",
function()
Snacks.picker.lines()
end,
desc = "Buffer Lines",
},
{
"<leader>sB",
function()
Snacks.picker.grep_buffers()
end,
desc = "Grep Open Buffers",
},
{ "<leader>sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
{
"<leader>sp",
function()
Snacks.picker.lazy()
end,
desc = "Search for Plugin Spec",
},
{ "<leader>sw", LazyVim.pick("grep_word"), desc = "Visual selection or word (Root Dir)", mode = { "n", "x" } },
{
"<leader>sW",
LazyVim.pick("grep_word", { root = false }),
desc = "Visual selection or word (cwd)",
mode = { "n", "x" },
},
-- search
{
'<leader>s"',
function()
Snacks.picker.registers()
end,
desc = "Registers",
},
{
"<leader>s/",
function()
Snacks.picker.search_history()
end,
desc = "Search History",
},
{
"<leader>sa",
function()
Snacks.picker.autocmds()
end,
desc = "Autocmds",
},
{
"<leader>sc",
function()
Snacks.picker.command_history()
end,
desc = "Command History",
},
{
"<leader>sC",
function()
Snacks.picker.commands()
end,
desc = "Commands",
},
{
"<leader>sd",
function()
Snacks.picker.diagnostics()
end,
desc = "Diagnostics",
},
{
"<leader>sD",
function()
Snacks.picker.diagnostics_buffer()
end,
desc = "Buffer Diagnostics",
},
{
"<leader>sh",
function()
Snacks.picker.help()
end,
desc = "Help Pages",
},
{
"<leader>sH",
function()
Snacks.picker.highlights()
end,
desc = "Highlights",
},
{
"<leader>si",
function()
Snacks.picker.icons()
end,
desc = "Icons",
},
{
"<leader>sj",
function()
Snacks.picker.jumps()
end,
desc = "Jumps",
},
{
"<leader>sk",
function()
Snacks.picker.keymaps()
end,
desc = "Keymaps",
},
{
"<leader>sl",
function()
Snacks.picker.loclist()
end,
desc = "Location List",
},
{
"<leader>sM",
function()
Snacks.picker.man()
end,
desc = "Man Pages",
},
{
"<leader>sm",
function()
Snacks.picker.marks()
end,
desc = "Marks",
},
{
"<leader>sR",
function()
Snacks.picker.resume()
end,
desc = "Resume",
},
{
"<leader>sq",
function()
Snacks.picker.qflist()
end,
desc = "Quickfix List",
},
{
"<leader>su",
function()
Snacks.picker.undo()
end,
desc = "Undotree",
},
-- ui
{
"<leader>uC",
function()
Snacks.picker.colorschemes()
end,
desc = "Colorschemes",
},
},
}

View File

@@ -0,0 +1,23 @@
return {
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"astro",
"bash",
"html",
"css",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
}

View File

@@ -9,6 +9,7 @@
extraPackages = with pkgs; [
gcc # For treesitter complation
tree-sitter # For treesitter binaries
ripgrep # Search support
wayclip # Clipboard support
fd # finder for telescope
@@ -17,6 +18,7 @@
wget # LazyVim dep?
sqlite # For Snacks
imagemagick # For image conversion/display
vscode-langservers-extracted # For language servers (it wants this version of eslint for some reason)
];
};

View File

@@ -1,10 +0,0 @@
{ pkgs, ... }:
{
# Enable flakes and nix-commnands.
nix.settings.experimental-features = ["flakes" "nix-command"];
# Allow unfree code
nixpkgs.config = {
allowUnfree = true;
};
}

View File

@@ -4,6 +4,10 @@
obsidian
];
home.shellAliases = {
"notes" = "(cd ~/Documents/Notes && nvim)";
};
services.syncthing = {
enable = true;
tray = {
@@ -21,6 +25,7 @@
"altair"
"mcp"
"vega"
"proxima"
];
};
};
@@ -52,6 +57,14 @@
];
compression = "always";
};
proxima = {
id = "NWZL6LY-ULJQMZE-EWY3MQU-XPDAFQB-LTIBZV7-GPKIABJ-WBJE36F-SK6LVAY";
name = "Proxima";
addresses = [
"relay://syncthing.blazestar.net:22067"
];
compression = "always";
};
};
options = {
localAnnounceEnabled = false;

View File

@@ -7,7 +7,7 @@
**/
* {
background: #15161EFF;
background: #15161ECC;
background-alt: #1A1B26FF;
foreground: #C0CAF5FF;
selected: #33467CFF;

View File

@@ -15,4 +15,4 @@
/* Import color-scheme from `colors` directory */
@import "~/.config/rofi/colors/onedark.rasi"
@import "~/.config/rofi/colors/tokyonight.rasi"

View File

@@ -10,8 +10,8 @@
/*****----- Configuration -----*****/
configuration {
modi: "drun";
show-icons: true;
display-drun: "";
show-icons: true;
display-drun: "";
drun-display-format: "{name}";
}
@@ -32,8 +32,8 @@ window {
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border: 2px solid;
border-radius: 5px;
border-color: @selected;
background-color: @background;
cursor: "default";

View File

@@ -15,4 +15,4 @@
/* Import color-scheme from `colors` directory */
@import "~/.config/rofi/colors/onedark.rasi"
@import "~/.config/rofi/colors/tokyonight.rasi"

View File

@@ -11,7 +11,7 @@ dir="${HOME}/.config/rofi/powermenu"
# CMDs
uptime="$(uptime | awk -F ' ' '{print $2}' | sed -e 's/,//g')"
host=`hostname`
host=$(hostname)
# Options
shutdown='󰐥'
@@ -24,89 +24,94 @@ no=''
# Rofi CMD
rofi_cmd() {
rofi -dmenu \
-p "Uptime: $uptime" \
-mesg "Uptime: $uptime" \
-theme ${dir}/style.rasi
rofi -dmenu \
-p "Uptime: $uptime" \
-mesg "Uptime: $uptime" \
-theme ${dir}/style.rasi
}
# Confirmation CMD
confirm_cmd() {
rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 350px;}' \
-theme-str 'mainbox {children: [ "message", "listview" ];}' \
-theme-str 'listview {columns: 2; lines: 1;}' \
-theme-str 'element-text {horizontal-align: 0.5;}' \
-theme-str 'textbox {horizontal-align: 0.5;}' \
-dmenu \
-p 'Confirmation' \
-mesg 'Are you Sure?' \
-theme ${dir}/style.rasi
rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 350px;}' \
-theme-str 'mainbox {children: [ "message", "listview" ];}' \
-theme-str 'listview {columns: 2; lines: 1;}' \
-theme-str 'element-text {horizontal-align: 0.5;}' \
-theme-str 'textbox {horizontal-align: 0.5;}' \
-dmenu \
-p 'Confirmation' \
-mesg 'Are you Sure?' \
-theme ${dir}/style.rasi
}
# Ask for confirmation
confirm_exit() {
echo -e "$yes\n$no" | confirm_cmd
echo -e "$yes\n$no" | confirm_cmd
}
# Pass variables to rofi dmenu
run_rofi() {
echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd
echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd
}
# Execute Command
run_cmd() {
selected="$(confirm_exit)"
if [[ "$selected" == "$yes" ]]; then
if [[ $1 == '--shutdown' ]]; then
systemctl poweroff
elif [[ $1 == '--reboot' ]]; then
systemctl reboot
elif [[ $1 == '--suspend' ]]; then
mpc -q pause
amixer set Master mute
systemctl suspend
elif [[ $1 == '--logout' ]]; then
if [[ "$DESKTOP_SESSION" == 'openbox' ]]; then
openbox --exit
elif [[ "$DESKTOP_SESSION" == 'bspwm' ]]; then
bspc quit
elif [[ "$DESKTOP_SESSION" == 'i3' ]]; then
i3-msg exit
elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
elif command -v hyprctl &>/dev/null; then
selected="$(confirm_exit)"
if [[ "$selected" == "$yes" ]]; then
if [[ $1 == '--shutdown' ]]; then
systemctl poweroff
elif [[ $1 == '--reboot' ]]; then
systemctl reboot
elif [[ $1 == '--suspend' ]]; then
mpc -q pause
amixer set Master mute
systemctl suspend
elif [[ $1 == '--logout' ]]; then
if [[ "$DESKTOP_SESSION" == 'openbox' ]]; then
openbox --exit
elif [[ "$DESKTOP_SESSION" == 'bspwm' ]]; then
bspc quit
elif [[ "$DESKTOP_SESSION" == 'i3' ]]; then
i3-msg exit
elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
elif [[ "$DESKTOP_SESSION" == 'hyprland-uwsm' ]]; then
hyprctl dispatch exit
fi
fi
else
exit 0
fi
elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then
hyprctl dispatch exit
fi
fi
else
exit 0
fi
}
# Actions
chosen="$(run_rofi)"
case ${chosen} in
$shutdown)
run_cmd --shutdown
;;
$reboot)
run_cmd --reboot
;;
$lock)
if [[ -x '/usr/bin/betterlockscreen' ]]; then
betterlockscreen -l
elif [[ -x '/usr/bin/i3lock' ]]; then
i3lock
elif command -v hyprlock &>/dev/null; then
hyprlock
fi
;;
$suspend)
run_cmd --suspend
;;
$logout)
run_cmd --logout
;;
$shutdown)
run_cmd --shutdown
;;
$reboot)
run_cmd --reboot
;;
$lock)
loginctl lock-session
# if [[ -x '/usr/bin/betterlockscreen' ]]; then
# betterlockscreen -l
# elif [[ -x '/usr/bin/i3lock' ]]; then
# i3lock
# elif command -v hyprlock &>/dev/null; then
# hyprlock
# elif command -v swaylock &>/dev/null; then
# swaylock
# fi
;;
$suspend)
run_cmd --suspend
;;
$logout)
run_cmd --logout
;;
esac

View File

@@ -35,8 +35,8 @@ window {
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border: 2px solid;
border-radius: 5px;
border-color: @selected;
cursor: "default";
background-color: @background;

View File

@@ -8,4 +8,10 @@
source = ./config;
recursive = true;
};
wayland.windowManager.hyprland.settings.windowrulev2 = [
# Forces the Rofi window to hold focus so that it gets input even if
# something else opens or the mouse is outside the window.
"stayfocused, class:Rofi"
];
}

View File

@@ -2,6 +2,10 @@
{ pkgs, ... }:
{
imports = [
./uutils.nix
];
# These are all the sort of shell commands that we want available whereever
# there is shell. These include just a lot of useful utilities for managing
# a system or working with other shell commands. Packages more specific to
@@ -11,35 +15,53 @@
htop
btop
neofetch
killall
psmisc # fuser, killal, pstree
# Files
# Archives
zip
xz
unzip
p7zip
unrar-wrapper
# File manipulation
file
tree
ranger
ueberzugpp # for image previews
yazi # File manager
w3m # terminal browser for image previews
dysk # better disk info
ripgrep # better grep
fd # Better find
bat # cat with wings
eza # Modern replacement for ls
dust # More intuitive du
dua # Interactive disk usage analyzer
# Networking
dnsutils
inetutils
socat
httpie
xh
# devices
usbutils
# Other
jq
mprocs # Manage multiple long-running processes
];
home.shellAliases = {
"p?" = "ps ax | grep";
"p?" = "ps ax | rg";
# Dysk is basically just better.
"df" = "echo 'Do you mean: dysk?'";
"grep" = "echo 'Do you mean: rg?'";
"find" = "echo 'Do you mean: fd'";
"cat" = "bat";
"ls" = "eza";
"http" = "echo 'Do you mean: xh'";
"du" = "echo 'Do you mean: dust or dua?'";
"ranger" = "echo 'Do you mean: yazi'";
};
programs.zsh = {
@@ -48,7 +70,7 @@
PATH=$PATH:$HOME/.local/bin
GITHUB_USERNAME=periodic
'';
initExtra = ''
initContent = ''
# Make ^U work like it does in Bash
bindkey "^U" backward-kill-line
@@ -94,6 +116,12 @@
];
};
programs.zoxide = {
# TODO: Learn all the capabilities of zoxide and use them.
enable = true;
enableZshIntegration = true;
};
programs.starship = {
enable = true;
settings = {

View File

@@ -1,21 +1,12 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./swaync.nix
];
home.packages = with pkgs; [
hyprlock # lock screen
# swayidle # lock on idle
# swayosd # volume pop-up
# swaynotificationcenter # notifications
# hyprpolkitagent # Privilege managent
# hyprshot # Screenshot utility
./swaylock.nix
];
services.swayosd = {
@@ -23,16 +14,6 @@
topMargin = 0.7;
};
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "hyprlock";
}
];
};
# Enable sway config generation for home.pointerCursor
home.pointerCursor.sway.enable = true;

View File

@@ -0,0 +1,37 @@
{ pkgs, ... }:
{
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
clock = true;
indicator = true;
effect-pixelate = 20;
};
};
home.file.".config/swaylock/swaylock.sh" = {
executable = true;
# A script that will take the wallpaper folder for each monitor (see
# wallpaper.nix) and use a random image as the background on each monitor.
text = ''
#!/usr/bin/env sh
wallpaper_dir="$HOME/Pictures/Wallpaper"
cmd="swaylock"
for monitor in $(hyprctl monitors | awk '/^Monitor/ { print $2 }'); do
dir="$wallpaper_dir/$monitor"
if [ -d "$dir" ]; then
image=$(find "$dir" -type f | shuf -n 1)
if [ -n "$image" ]; then
cmd="$cmd --image \"$monitor:$image\""
fi
fi
done
# Eval to handle the quoted image paths correctly
eval $cmd
'';
};
}

View File

@@ -5,14 +5,15 @@
home.packages = with pkgs; [
# Font
# 24.11
inconsolata-nerdfont
fira-code-nerdfont
# inconsolata-nerdfont
# fira-code-nerdfont
# 25.05
# nerd-fonts.inconsolata
# nerd-fonts.fira-code
# nerd-fonts.jetbrains-mono
nerd-fonts.inconsolata
nerd-fonts.fira-code
nerd-fonts.jetbrains-mono
libsixel # For working with images in terminals
ueberzugpp # for image previews
];
# Allow Home Manager to set fonts.
@@ -50,7 +51,7 @@
enable = true;
settings = {
main = {
font = "FiraCode Nerd Font:size=13";
font = "FiraCode Nerd Font:size=12";
selection-target = "primary";
pad = "8x8";
};

View File

@@ -0,0 +1,7 @@
{ pkgs, lib, ... }:
{
home.packages = with pkgs; [
# Use uutils core-utils with no prefix so they override the GNU coreutils
(lib.hiPrio uutils-coreutils-noprefix)
];
}

View File

@@ -12,6 +12,7 @@ monitors:
map (mon: {
name = mon;
value = {
# Each monitor gets a folder under wallpaper that containes the current images.
path = "~/Pictures/Wallpaper/${mon}";
};
}) monitors

View File

@@ -11,11 +11,23 @@ focalboard:
offen:
secret: ENC[AES256_GCM,data:sH2siPc/QH1O2M7ZlJwqhqlHRIeLIG9r,iv:eD29ALx2ji0rm1t9j6RulTZT3f6VLK7dxpPOze3qDKA=,tag:zqJTgT2UeA/ecBS4VremUw==,type:str]
smtp-token: ENC[AES256_GCM,data:ZTfe65g3JykPvG2l0AN8UQ==,iv:GTruGo/vcP+imfJyqB3NX9ic8dz5jvTEh6SF+OeqMDM=,tag:kgwd59pG/WUt8OAaVzi39Q==,type:str]
traefik:
oauth2-client-secret: ENC[AES256_GCM,data:p7/6OsN2ytBj8mQiK0YL7J6NYLtMHOXIIs/6+bIDpsU=,iv:k6jLZifJEFLYKSFMkyn/kA7iBE+EFB8O/3/3fyTh1SY=,tag:6s49O2+tdlZoXyAGEamuMQ==,type:str]
oauth2-plugin-secret: ENC[AES256_GCM,data:sArqwKHAdW35o5kD7DGfXSYCXFUXqvKQdoVnXutsNLw=,iv:qWf597QS3BqkVQkeAb99HbpDB0kUhdD+qKdpUPZEB0o=,tag:vXnb93npaklItWkMZ+/M9Q==,type:str]
protonvpn:
private_key: ENC[AES256_GCM,data:41pfbR1klj1F24v3HlCCA4ofW2sCEnyE5TH8iX4Ug8D+kmwstTaj5RG2Zz8=,iv:P6XyQnDVoOmdkP8ilBR9DyfqPZA6GsQ6VUwY/tSGhx4=,tag:Bzgdv29lbk/gYlADPZMGVA==,type:str]
deploy-key:
mcp: ENC[AES256_GCM,data:eQcX8xdz5qZ6nU8ISOvZo+ZtP4Z/ePd+/ZZReX1BKvTUqGQPPFxConbLMwFzvzpD6xAUbA1MLkcR/bT98QbNx6LJYlhbofuDUg2DI79RB0fcrAcj/wUV0YPhmgofUdYYDaimH5A2PSvtmKfB3CtKKuA5HNeLymoXeLEpFzbckkGhzPee/CHiUmxayogp6za6btsDJsiT8hdHbrzyD2S6fhMJrzX+PlRzT32M/6eaFuFWE8EUO1gbkRlNfKPXw/EM2GXWJfR4qXfN2YKIKigqrtlAAoxnrUbp5EBrn/hGHS2ZYZXeRUFr3avFjcI0bLX423PWRHAylfQCPxgYVEtbcRv11CAFmq4rfFl0ZdvnAKbTLNmWcrQNijBATZPaAdQzgKPDHs8pwPUFR9Tcg8pZNbzw0mK9kPolniAOL2PBKUHv6LP/uEkB1E6Pxc7yms0kGpeJyo7hrFVOiVAckCey+SI9dpbJMSB3md070I1xk6Ik7PywrWh2QDeUtOU1U28UkYgnJ/9MJelWsNlUX9SR,iv:oCNeanaV/7UZ3dhmq4ZmJUZ5hb61AnHpHCfskM2Jsm8=,tag:F2uJKN5beM/rfiBMSyUP7w==,type:str]
matrix:
syncv3:
db-password: ENC[AES256_GCM,data:N/IO0k/2BZpmaDTbKZmSgZNzmdk=,iv:p0jGjJ9mTCh5FPM/Oe1vxusYvlyg14UeggE5ynpDVL8=,tag:tZbddwxJf6wSH6L1QRUQVg==,type:str]
secret: ENC[AES256_GCM,data:KZjYxjUxGgkY1I5jGF7XMEhkHK+khDaQzxugoKxpLsROmVs722tFfbUAxhp71llam55gy9+eUWGxIPlmvOySlw==,iv:OoThGcT08Z11kpnAMQ7w59wj5JheNFGEk1jfFENsmy0=,tag:8EeKT7dh2/a52Amf6LsL1w==,type:str]
blazestar-registration-token: ENC[AES256_GCM,data:TB3bR+E4H4c2l9pRcEOAZr35+vBVaJUcuCs9K0Pjd0aW+M35x5LgZ8+F99Y=,iv:e28sie6LSI5UX41BPb+yN+3n+Yw9Ssfsqe4zppwbPkU=,tag:cQPgZcRFbYSiZnmPVtZxHg==,type:str]
tandoor:
secret_key: ENC[AES256_GCM,data:nl7S2fS1wENrT5k2iZfLEAGc99lCUktgwR5L5KklF69BNVKQkW1rUgb3aIv50VpXZa+3OxV/vdPmG9NhKMy96I5+Dno=,iv:FFyGQBARz0B5zrONZELzUMsOIn8TWrDNTKGsAHPlS7w=,tag:/c4MnDfLXQpBZDqVxZ0DTg==,type:str]
immich:
database: ENC[AES256_GCM,data:1fjOQsLZcq/T+r+AkzomWwCQWw==,iv:c4pn2rC+3xkxLJ7uAdhnTE6zVTRQkfuKK3tjUyDhfAw=,tag:kvk7DOv6X/+RDxfPxVak7w==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1yvdzvuvu5wqztcx6ll2xk6x547uuyqy735tjjdd7zftkz53jsf9qf5ahue
enc: |
@@ -35,8 +47,7 @@ sops:
by9aNFY4dXNxaWxnTXFTQS9reHhuQWMKh5rZ93nFtBV9EpFVRp+E+GXZ6xzVy2Jw
vFh4deGcAb60q4odSaeWfk1Dr7L9Ua69oK9omjbCNUt+P7Kwlfca7Q==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-04-28T23:33:42Z"
mac: ENC[AES256_GCM,data:cZkRcGV5/CPPVUdTDekwC8UjO6K348sBsS7NvR8wnoXS0AmSZsqN594nkvoc0VccM55Hwnm4jZxY56OV+UFMya1IRIkTo6LJRb88/CgZ8bjz30ACe33FKgJfCugimUDKsekbgNX1UFg1DVbqYK9/N4fcEBSxV3Xmzy5QGnQ/8KU=,iv:EprUHNtU5w7569ADMOxw+izDAL22A5OrB12T9iyHxKU=,tag:kRvyUEZwd/RttKdFOY2bJQ==,type:str]
pgp: []
lastmodified: "2026-02-25T00:28:13Z"
mac: ENC[AES256_GCM,data:hDmqObrtfoVkQqz8JPkqlyXMbiuyBophjdZNLvTFrZw3pAVNCuzsH4zxFBOaxJttkzLc65DWDHDeEIBY5YZam1GLFFXUQ5E3Dxno7hnyzOoM2ipgDTOacI0gbKJAWgGUF3LNDdqVoREA9LC91LoNUJoNmzpTSFtuLb7ORuwCrH4=,iv:8+W3n1Cr6woEiPU9ECaMYM64HNmFHr2AIw6UohCJi00=,tag:7drkZiPAUHaEx5PagXA9JQ==,type:str]
unencrypted_suffix: _unencrypted
version: 3.9.4
version: 3.11.0

View File

@@ -0,0 +1,5 @@
{ ... }:
{
programs.adb.enable = true;
users.users.drew.extraGroups = [ "adbusers" ];
}

22
system/features/audio.nix Normal file
View File

@@ -0,0 +1,22 @@
{ ... }:
{
# RealtimeKit hands out realtime scheduling priority to user processes on
# demand, e.g. audio
security.rtkit.enable = true;
# Enable sound with pipewire.
services.pulseaudio = {
enable = false;
daemon.config = {
exit-idle-time = -1;
};
};
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
}

View File

@@ -0,0 +1,26 @@
{ ... }:
{
virtualisation = {
docker = {
enable = true;
# rootless = {
# enable = true;
# setSocketVariable = true;
# };
};
# Do not use Podman in Wayland/Hyperland. It will crash the session. Very annoying.
# podman.enable = true;
};
hardware.nvidia-container-toolkit.enable = true;
home-manager.users.drew =
{ ... }:
{
# Add the path to the docker socket to the environment.
programs.zsh.envExtra = ''
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
'';
};
}

View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
services.flatpak.enable = true;
systemd.services.flatpak-repo = {
wantedBy = [ "multi-user.target" ];
path = [ pkgs.flatpak ];
script = ''
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
'';
};
}

View File

@@ -0,0 +1,50 @@
{ config, lib, ... }:
{
options =
with lib;
with types;
{
graphics = {
enable = mkEnableOption "graphics support";
driverChannel = mkOption {
type = str;
# Default to production because I often want new features, but I don't want bleeding edge.
default = "production";
description = "Driver channel to use (in order of oldest to newest): stable, beta, latest";
};
};
};
config = lib.mkIf config.graphics.enable {
# Graphics settings
hardware.graphics = {
enable = true;
enable32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages."${config.graphics.driverChannel}";
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management for PRIME. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
# Requires offload to be enabled.
# powerManagement.finegrained = false;
# Use the open-source driver?
open = false;
# Enable the nvidia-settings menu?
nvidiaSettings = true;
};
};
}

View File

@@ -26,4 +26,12 @@
xwayland.enable = true;
};
programs.sway = {
enable = true;
xwayland.enable = true;
wrapperFeatures = {
gtk = true;
base = true;
};
};
}

View File

@@ -0,0 +1,21 @@
{ pkgs, ... }:
{
services.printing = {
enable = true;
drivers = [ pkgs.brlaser ];
};
hardware.printers = {
ensurePrinters = [
{
name = "Brother_HL-L2370DW_series";
location = "Home";
deviceUri = "dnssd://Brother%20HL-L2370DW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-3c2af4f28c38";
model = "drv:///brlaser.drv/brl2370d.ppd";
ppdOptions = {
PageSize = "Letter";
};
}
];
ensureDefaultPrinter = "Brother_HL-L2370DW_series";
};
}

View File

@@ -0,0 +1,127 @@
{ config, lib, ... }:
{
options =
with lib;
with types;
{
virtualisation.web-containers = {
enable = mkEnableOption "web containers";
containers = mkOption {
type = lazyAttrsOf (submodule {
options =
let
strOpt = mkOption { type = str; };
intOpt = mkOption { type = int; };
boolOpt = mkOption {
type = bool;
default = false;
};
strList = mkOption {
type = listOf str;
default = [ ];
};
attrOpt = mkOption {
type = attrsOf str;
default = { };
};
in
{
image = strOpt;
hostname = strOpt;
port = intOpt;
homepageOpts = attrOpt;
dependsOn = strList;
domain = strOpt;
volumes = strList;
environment = attrOpt;
environmentFiles = strList;
public = boolOpt;
user = mkOption {
type = nullOr str;
default = null;
};
extraOptions = strList;
oauthProxy = boolOpt;
extraLabels = attrOpt;
};
});
default = { };
description = "";
};
};
};
config = {
virtualisation.oci-containers.containers = lib.mkIf config.virtualisation.web-containers.enable (
let
hostRule = host: domain: "Host(`${host}.${domain}`)";
localNet = "192.168.0.0/16";
dockerNet = "10.88.0.0/16";
localNetRule = "(ClientIP(`${localNet}`) || ClientIP(`${dockerNet}`))";
localHostRule = host: domain: "${localNetRule} && ${hostRule host domain}";
mkContainer =
key:
{
image,
hostname,
port,
homepageOpts,
dependsOn,
domain,
volumes,
environment,
environmentFiles,
public,
user,
extraOptions,
oauthProxy,
extraLabels,
}:
let
fqn = "${hostname}.${domain}";
serviceName = builtins.replaceStrings [ "." ] [ "-" ] fqn;
routerRule = if public then hostRule hostname domain else localHostRule hostname domain;
homepageLabels =
if homepageOpts == { } then
{ }
else
{
"homepage.group" = "${homepageOpts.group}";
"homepage.name" = "${homepageOpts.name}";
"homepage.icon" = "${homepageOpts.icon}";
"homepage.href" = "https://${fqn}";
"homepage.description" = "${homepageOpts.description}";
};
oauthLabels =
if oauthProxy then
{ "traefik.http.routers.${serviceName}.middlewares" = "oidc-auth@file"; }
else
{ };
in
{
inherit
image
dependsOn
volumes
environment
environmentFiles
user
extraOptions
;
autoStart = true;
labels = {
"traefik.enable" = "true";
"traefik.http.routers.${serviceName}.rule" = "${routerRule}";
"traefik.http.routers.${serviceName}.service" = "${serviceName}";
"traefik.http.routers.${serviceName}.entrypoints" = "web,websecure";
"traefik.http.services.${serviceName}.loadbalancer.server.port" = "${toString port}";
}
// oauthLabels
// homepageLabels
// extraLabels;
};
in
builtins.mapAttrs mkContainer config.virtualisation.web-containers.containers
);
};
}

View File

@@ -8,10 +8,6 @@
}:
{
imports = [
./qmk.nix
];
networking.hostName = "altair"; # Define your hostname.
# Configure network proxy if necessary
@@ -92,11 +88,6 @@
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Allow unfree packages
nixpkgs.config = {
allowUnfree = true;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [

View File

@@ -3,9 +3,14 @@
imports = [
./configuration.nix
./hardware-configuration.nix
./qmk.nix
../../authorized-keys.nix
../../features/audio.nix
../../features/gc.nix
../../features/gui.nix
../../features/container-dev.nix
../../features/android-dev.nix
../../features/flatpak.nix
];
nixpkgs.config.allowUnfree = true;

View File

@@ -8,18 +8,31 @@ in
{
imports =
map (x: ../../../home-manager + x) [
"/features/astronomy.nix"
"/features/chat.nix"
"/features/development/development.nix"
"/features/development/docker.nix"
"/features/development/haskell.nix"
"/features/development/markdown.nix"
"/features/development/typescript.nix"
"/features/development/vscode.nix"
"/features/eww"
"/features/gaming.nix"
"/features/image-editing.nix"
"/features/linux-desktop.nix"
"/features/notes.nix"
"/features/3d-printing.nix"
]
++ [
(import ../../../home-manager/features/wallpaper.nix monitors)
];
# This config file is needed for nix shell to allow unfree programs. I'm not
# sure why this isn't a home-manager option.
home.file.".config/nixpkgs/config.nix".text = ''
{ allowUnfree = true; }
'';
home.stateVersion = "24.11";
home.username = "drew";
@@ -30,9 +43,16 @@ in
userEmail = "drew.haven@gmail.com";
};
# Set up eww here because it's based on the monitor configuration
# Eww is idempotent, so it's fine to just run it on every reload to make sure things are open
wayland.windowManager.hyprland.settings.exec = [
"eww open-many primary-statusbar secondary-statusbar launcher"
];
wayland.windowManager.hyprland.settings = {
exec-once = [
# Set up eww here because it's based on the monitor configuration
"sleep 2 && eww open-many primary-statusbar secondary-statusbar"
# Set DP-2 as the primary monitor, otherwise it defaults to DP-1 because it's first in the list.
"xrandr --output DP-2 --primary"
];
windowrulev2 = [
# Rofi doesn't center properly when I have the two asymetric monitors, so we need hyprland to manage it.
"center, class:Rofi"
];
};
}

View File

@@ -13,38 +13,46 @@
(modulesPath + "/installer/scan/not-detected.nix")
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/343c0ac5-3973-49b3-964a-6ad90c36b89c";
fsType = "ext4";
initrd = {
availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5F99-043D";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/343c0ac5-3973-49b3-964a-6ad90c36b89c";
fsType = "ext4";
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/28f4fb41-9414-4504-a767-c2e8bf5eb2c8";
fsType = "ext4";
"/boot" = {
device = "/dev/disk/by-uuid/5F99-043D";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
"/home" = {
device = "/dev/disk/by-uuid/28f4fb41-9414-4504-a767-c2e8bf5eb2c8";
fsType = "ext4";
};
};
swapDevices = [ ];
@@ -58,37 +66,47 @@
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Graphics settings
hardware.graphics = {
enable = true;
enable32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.beta;
hardware = {
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
graphics = {
enable = true;
enable32Bit = true;
};
nvidia = {
# Other options include:
# stable - Current stable
# production - Same as stable
# latest - Bleeding edge
# beta - latest beta
#
# See https://nixos.wiki/wiki/Nvidia
#
# Current versions can be found in https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/os-specific/linux/nvidia-x11/default.nix
#
package = config.boot.kernelPackages.nvidiaPackages.beta;
modesetting.enable = true;
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management for PRIME. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
# Requires offload to be enabled.
# powerManagement.finegrained = false;
# Fine-grained power management for PRIME. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
# Requires offload to be enabled.
# powerManagement.finegrained = false;
# Use the open-source driver?
open = false;
# Use the open-source driver?
open = false;
# Enable the nvidia-settings menu?
nvidiaSettings = true;
# Enable the nvidia-settings menu?
nvidiaSettings = true;
};
};
# Add a udev rule to prevent the mouse from waking the system. Note that it

View File

@@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
imports = [
./vars.nix
@@ -16,9 +16,6 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Set the kernel to be compatible with ZFS
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
networking.hostName = "mcp"; # Define your hostname.
networking.hostId = "5e292f2d"; # Define a host ID for ZFS with `head -c 8 /etc/machine-id`
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
@@ -62,6 +59,7 @@
"networkmanager"
"wheel"
"docker-registry"
"docker"
];
shell = pkgs.zsh;
# Enable linger so that systemd services run for this user are started and
@@ -96,7 +94,8 @@
port = 5000;
openFirewall = true;
# Bind to the podman network so Traefik can route to it.
# Note that it may fail to start if this network has not been created yet.
# Note that it may fail to start if this network has not been created yet,
# so this has to be manually restarted when the system boots.
listenAddress = "10.88.0.1";
};
@@ -107,8 +106,10 @@
enabledCollectors = [ "systemd" ];
port = 9002;
# Open the firewall, but only listen on the internal address
# TODO: Add some form authentication
openFirewall = true;
# Bind to the podman network so Traefik can route to it.
# Note that it may fail to start if this network has not been created yet,
# so this has to be manually restarted when the system boots.
listenAddress = "10.88.0.1";
};
};

View File

@@ -1,352 +1,183 @@
# Started from https://nixos.wiki/wiki/Podman
{ config, pkgs, ... }:
{
config,
pkgs,
lib,
...
}:
{
# Additional configuration
imports = [
./containers/bookstack.nix
./containers/focalboard.nix
./containers/havenisms.com
./containers/blazestar.net
# Docker containers
./containers/dm-companion.nix
./containers/freshrss.nix
./containers/gitea.nix
./containers/goatcounter.nix
./containers/grafana.nix
./containers/jobhunt.nix
# ./containers/jobhunt.nix
./containers/mariadb.nix
./containers/media-system.nix
./containers/nextcloud.nix
./containers/offen.nix
# ./containers/offen.nix
./containers/pocket-id.nix
./containers/prometheus.nix
./containers/public-homepage.nix
./containers/searxng.nix
./containers/shared-postgres.nix
./containers/synapse.nix
# ./containers/timetagger.nix
./containers/traefik.nix
./containers/users.nix
# NixOS Containers
./static-site-hooks.nix
];
# Enable common container config files in /etc/containers
virtualisation.containers.enable = true;
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
extraPackages = [ pkgs.zfs ];
options.local = with lib; {
container-backend = mkOption {
type = with types; uniq str;
default = "docker";
example = "docker";
description = "Which backend to use for containers: docker or podman";
};
container-socket = mkOption {
type = with types; uniq str;
default = "/var/run/docker.sock";
example = "/var/run/docker.sock";
description = "Path to the container management deamon's socket.";
};
};
# Useful other development tools
environment.systemPackages = with pkgs; [
dive # look into docker image layers
podman-tui # status of containers in the terminal
docker-compose # start group of containers for dev
#podman-compose # start group of containers for dev
];
config = {
# local = {
# container-backend = "docker";
# container-socket = "/var/run/docker.sock";
# };
local = {
container-backend = "podman";
container-socket = "/var/run/podman/podman.sock";
};
users.groups = {
git = { };
timetagger = { };
};
users.users = {
gitea = {
uid = 2001;
isSystemUser = true;
description = "System User for Gitea";
extraGroups = [ "git" ];
group = "git";
};
timetagger = {
uid = 2002;
isSystemUser = true;
description = "System User for TimeTagger";
group = "timetagger";
};
};
# Enable common container config files in /etc/containers
virtualisation.oci-containers.backend = "podman";
virtualisation.oci-containers.containers =
let
inherit (import ./containers/lib.nix config)
hostRuleHavenisms
localHostRuleHavenisms
havenisms;
in
{
jellyfin = {
image = "lscr.io/linuxserver/jellyfin";
autoStart = true;
extraOptions = [
"--device=/dev/dri:/dev/dri"
"-l=traefik.enable=true"
"-l=traefik.http.routers.jellyfin.rule=${hostRuleHavenisms "jellyfin"}"
"-l=traefik.http.services.jellyfin.loadbalancer.server.port=8096"
"-l=homepage.group=Apps"
"-l=homepage.name=Jellyfin"
"-l=homepage.icon=jellyfin.svg"
"-l=homepage.href=https://jellyfin.${havenisms}"
"-l=homepage.description=Media player"
"-l=homepage.widget.type=jellyfin"
"-l=homepage.widget.key={{HOMEPAGE_FILE_JELLYFIN_KEY}}"
"-l=homepage.widget.url=http://jellyfin:8096"
"-l=homepage.widget.enableBlocks=true"
];
volumes = [
"/tank/media/collection:/data"
"/tank/config/jellyfin:/config"
];
# environment = {
# TZ = vars.timeZone;
# PUID = "994";
# UMASK = "002";
# GUID = "993";
# };
};
deluge = {
image = "linuxserver/deluge:latest";
autoStart = true;
dependsOn = [
"gluetun"
];
extraOptions = [
"--network=container:gluetun"
"-l=homepage.group=Arr"
"-l=homepage.name=Deluge"
"-l=homepage.icon=deluge.svg"
"-l=homepage.href=https://deluge.${havenisms}"
"-l=homepage.description=Torrent client"
"-l=homepage.widget.type=deluge"
"-l=homepage.widget.password={{HOMEPAGE_FILE_DELUGE_PASSWORD}}"
"-l=homepage.widget.url=http://gluetun:8112"
];
volumes = [
"/tank/media:/data"
"/tank/config/deluge:/config"
];
};
qbittorrent = {
image = "linuxserver/qbittorrent:latest";
autoStart = true;
dependsOn = [
"gluetun"
];
extraOptions = [
"--network=container:gluetun"
"-l=homepage.group=Arr"
"-l=homepage.name=qBitTorrent"
"-l=homepage.icon=qbittorrent.svg"
"-l=homepage.href=https://torrents.${havenisms}"
"-l=homepage.description=Torrent client"
"-l=homepage.widget.type=qbittorrent"
"-l=homepage.widget.url=http://torrents.${havenisms}"
];
volumes = [
"/tank/media/Downloads:/downloads"
"/tank/config/qbittorrent:/config"
];
environment = {
PUID = "911";
PGID = "911";
UMASK = "002";
virtualisation = {
containers.enable = true;
oci-containers.backend = config.local.container-backend;
docker = lib.mkIf (config.local.container-backend == "docker") {
enable = true;
# Enable rootless so that I can run containers as other users for security.
rootless = {
enable = true;
# Set this to make the default DOCKER_HOST be the rootless version for normal users.
setSocketVariable = true;
daemon = {
settings = {
default-address-pools = [
{
base = "10.88.0.0/16";
size = 24;
}
];
};
};
};
daemon = {
settings = {
default-address-pools = [
{
base = "10.88.0.0/16";
size = 24;
}
];
};
};
};
gluetun = {
image = "qmcgaw/gluetun:latest";
autoStart = true;
extraOptions = [
# add network admin capability.
"--cap-add=NET_ADMIN"
"--device=/dev/net/tun:/dev/net/tun"
"-l=traefik.enable=true"
"-l=traefik.http.routers.torrents.rule=${localHostRuleHavenisms "torrents"}"
"-l=traefik.http.routers.torrents.service=torrents"
"-l=traefik.http.services.torrents.loadbalancer.server.port=8080"
"-l=homepage.group=Infra"
"-l=homepage.name=GlueTun"
"-l=homepage.icon=gluetun.svg"
"-l=homepage.href=https://torrents.${havenisms}"
"-l=homepage.description=VPN killswitch"
"-l=homepage.widget.type=gluetun"
"-l=homepage.widget.url=http://gluetun:8000"
];
ports = [
"127.0.0.1:8083:8000"
];
environmentFiles = [
"/tank/config/gluetun/vpn.env"
];
environment = {
VPN_SERVICE_PROVIDER = "protonvpn";
UMASK = "002";
};
};
prowlarr = {
image = "lscr.io/linuxserver/prowlarr";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.prowlarr.rule=${localHostRuleHavenisms "prowlarr"}"
"-l=traefik.http.services.prowlarr.loadbalancer.server.port=9696"
"-l=homepage.group=Arr"
"-l=homepage.name=Prowlarr"
"-l=homepage.icon=prowlarr.svg"
"-l=homepage.href=https://prowlarr.${havenisms}"
"-l=homepage.description=Torrent indexer"
];
volumes = [
"/tank/config/prowlarr:/config"
];
environment = {
UMASK = "002";
};
};
# Currently broken and doesn't work. :(
# flaresolverr = {
# image = "ghcr.io/flaresolverr/flaresolverr:latest";
# autoStart = true;
# extraOptions = [
# "-l=homepage.group=Infra"
# "-l=homepage.name=FlareSolverr"
# "-l=homepage.icon=flaresolverr.svg"
# "-l=homepage.href=https://flaresolverr.${domain}"
# "-l=homepage.description=Cloudflare bypass"
# ];
# volumes = [
# "/tank/config/flaresolverr:/config"
# ];
# environment = {
# UMASK = "002";
# };
# };
radarr = {
image = "lscr.io/linuxserver/radarr";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.radarr.rule=${localHostRuleHavenisms "radarr"}"
"-l=traefik.http.services.radarr.loadbalancer.server.port=7878"
"-l=homepage.group=Arr"
"-l=homepage.name=Radarr"
"-l=homepage.icon=radarr.svg"
"-l=homepage.href=https://radarr.${havenisms}"
"-l=homepage.description=Movie acquisition"
"-l=homepage.widget.type=radarr"
"-l=homepage.widget.url=http://radarr:7878"
"-l=homepage.widget.key={{HOMEPAGE_FILE_RADARR_KEY}}"
];
volumes = [
"/tank/media:/data"
"/tank/config/radarr:/config"
];
environment = {
UMASK = "002";
};
};
sonarr = {
image = "lscr.io/linuxserver/sonarr";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.sonarr.rule=${localHostRuleHavenisms "sonarr"}"
"-l=traefik.http.services.sonarr.loadbalancer.server.port=8989"
"-l=homepage.group=Arr"
"-l=homepage.name=Sonarr"
"-l=homepage.icon=sonarr.svg"
"-l=homepage.href=https://sonarr.${havenisms}"
"-l=homepage.description=Show acquisition"
"-l=homepage.widget.type=sonarr"
"-l=homepage.widget.url=http://sonarr:8989"
"-l=homepage.widget.key={{HOMEPAGE_FILE_SONARR_KEY}}"
];
volumes = [
"/tank/media:/data"
"/tank/config/sonarr:/config"
];
environment = {
UMASK = "002";
};
};
readarr = {
# The Linuxserver version of this image doesn't have a latest tag. Odd.
image = "lscr.io/linuxserver/readarr:develop";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.readarr.rule=${localHostRuleHavenisms "readarr"}"
"-l=traefik.http.services.readarr.loadbalancer.server.port=8787"
"-l=homepage.group=Arr"
"-l=homepage.name=Readarr"
"-l=homepage.icon=readarr.svg"
"-l=homepage.href=https://readarr.${havenisms}"
"-l=homepage.description=E-book acquisition"
"-l=homepage.widget.type=readarr"
"-l=homepage.widget.url=http://readarr.havenisms.com:8787"
"-l=homepage.widget.key={{HOMEPAGE_FILE_READARR_KEY}}"
];
volumes = [
"/tank/media:/data"
"/tank/config/readarr:/config"
];
environment = {
UMASK = "002";
};
};
homepage = {
image = "ghcr.io/gethomepage/homepage:latest";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.homepage.rule=${localHostRuleHavenisms "start"}"
"-l=traefik.http.services.homepage.loadbalancer.server.port=3000"
];
volumes = [
"/tank/config/homepage:/app/config"
"/tank/secrets/deluge.pass:/app/config/secrets/deluge.pass"
"/tank/secrets/jellyfin.key:/app/config/secrets/jellyfin.key"
"/tank/secrets/radarr.key:/app/config/secrets/radarr.key"
"/tank/secrets/sonarr.key:/app/config/secrets/sonarr.key"
"/var/run/podman/podman.sock:/var/run/docker.sock:ro"
];
environment = {
HOMEPAGE_FILE_JELLYFIN_KEY = "/app/config/secrets/jellyfin.key";
HOMEPAGE_FILE_RADARR_KEY = "/app/config/secrets/radarr.key";
HOMEPAGE_FILE_SONARR_KEY = "/app/config/secrets/sonarr.key";
HOMEPAGE_FILE_READARR_KEY = "/app/config/secrets/readarr.key";
HOMEPAGE_FILE_DELUGE_PASSWORD = "/app/config/secrets/deluge.pass";
};
};
scrutiny = {
image = "ghcr.io/analogj/scrutiny:master-omnibus";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.scrutiny.rule=${localHostRuleHavenisms "scrutiny"}"
"-l=traefik.http.services.scrutiny.loadbalancer.server.port=8080"
"-l=homepage.group=Infra"
"-l=homepage.name=Scrutiny"
"-l=homepage.icon=scrutiny-light.png"
"-l=homepage.href=https://scrutiny.${havenisms}"
"-l=homepage.description=S.M.A.R.T. monitoring"
"-l=homepage.widget.type=scrutiny"
"-l=homepage.widget.url=http://scrutiny:8080"
"--cap-add=SYS_RAWIO"
"--device=/dev/sda:/dev/sda"
"--device=/dev/sdb:/dev/sdb"
"--device=/dev/sdc:/dev/sdc"
"--device=/dev/sdd:/dev/sdd"
];
volumes = [
"/run/udev:/run/udev:ro"
"/tank/config/scrutiny/config:/opt/scrutiny/config"
"/tank/config/scrutiny/influxdb:/opt/scrutiny/influxdb"
];
};
valkey = {
image = "docker.io/valkey/valkey:7-alpine";
autoStart = true;
volumes = [
"/tank/config/valkey:/usr/local/etc/valkey"
];
podman = lib.mkIf (config.local.container-backend == "podman") {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
extraPackages = [ pkgs.zfs ];
};
};
# Useful other development tools
environment.systemPackages = with pkgs; [
dive # look into docker image layers
docker-compose # start group of containers for dev
];
virtualisation.oci-containers.containers =
let
inherit (import ./containers/lib.nix config)
localHostRuleHavenisms
havenisms
;
in
{
homepage = {
image = "ghcr.io/gethomepage/homepage:latest";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.homepage.rule=${localHostRuleHavenisms "start"}"
"-l=traefik.http.services.homepage.loadbalancer.server.port=3000"
];
volumes = [
"/tank/config/homepage:/app/config"
"/tank/secrets/deluge.pass:/app/config/secrets/deluge.pass"
"/tank/secrets/jellyfin.key:/app/config/secrets/jellyfin.key"
"/tank/secrets/radarr.key:/app/config/secrets/radarr.key"
"/tank/secrets/sonarr.key:/app/config/secrets/sonarr.key"
"${config.local.container-socket}:/var/run/docker.sock:ro"
];
environment = {
HOMEPAGE_FILE_JELLYFIN_KEY = "/app/config/secrets/jellyfin.key";
HOMEPAGE_FILE_RADARR_KEY = "/app/config/secrets/radarr.key";
HOMEPAGE_FILE_SONARR_KEY = "/app/config/secrets/sonarr.key";
HOMEPAGE_FILE_READARR_KEY = "/app/config/secrets/readarr.key";
HOMEPAGE_FILE_DELUGE_PASSWORD = "/app/config/secrets/deluge.pass";
};
};
scrutiny = {
image = "ghcr.io/analogj/scrutiny:master-omnibus";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.scrutiny.rule=${localHostRuleHavenisms "scrutiny"}"
"-l=traefik.http.services.scrutiny.loadbalancer.server.port=8080"
"-l=homepage.group=Infra"
"-l=homepage.name=Scrutiny"
"-l=homepage.icon=scrutiny-light.png"
"-l=homepage.href=https://scrutiny.${havenisms}"
"-l=homepage.description=S.M.A.R.T. monitoring"
"-l=homepage.widget.type=scrutiny"
"-l=homepage.widget.url=http://scrutiny:8080"
"--cap-add=SYS_RAWIO"
"--device=/dev/disk/by-id/wwn-0x5000cca26fca1aed:/dev/disk/by-id/wwn-0x5000cca26fca1aed"
"--device=/dev/disk/by-id/wwn-0x5000cca26fef696c:/dev/disk/by-id/wwm-0x5000cca26fef696c"
"--device=/dev/disk/by-id/wwn-0x5000cca270db1d0e:/dev/disk/by-id/wwn-0x5000cca270db1d0e"
# "--device=/dev/sdd:/dev/sdd" Removing this one while the disk is down
];
volumes = [
"/run/udev:/run/udev:ro"
"/tank/config/scrutiny/config:/opt/scrutiny/config"
"/tank/config/scrutiny/influxdb:/opt/scrutiny/influxdb"
];
};
valkey = {
image = "docker.io/valkey/valkey:7-alpine";
autoStart = true;
volumes = [
"/tank/config/valkey:/usr/local/etc/valkey"
];
};
};
};
}

View File

@@ -0,0 +1,104 @@
{ config, ... }:
let
inherit (import ../lib.nix config) mkContainer blazestar;
matrixHost = "matrix";
serviceName = "matrix-blazestar-net";
dbPath = "/var/lib/matrix";
port = 8448;
in
{
sops.secrets = {
"matrix/blazestar-registration-token" = {
restartUnits = [ "${config.local.container-backend}-matrix-blazestar-net.service" ];
};
};
sops.templates."matrix-blazestar-net.env".content = ''
TUWUNEL_REGISTRATION_TOKEN=${config.sops.placeholder."matrix/blazestar-registration-token"}
'';
# This isn't using any of my usual helpers because I wanted to set a custom
# serviceName in Traefik that is different from the hostname to avoid
# conflicts with the havenisms.com server.
virtualisation.oci-containers.containers."${serviceName}" = {
# The 1.1.0 version has an issue with the compression being incorrectly tagged.
# See: https://github.com/matrix-construct/tuwunel/issues/79
image = "ghcr.io/matrix-construct/tuwunel:v1.0.0-release-all-x86_64-linux-gnu";
autoStart = true;
volumes = [
"matrix-blazestar-net-db:${dbPath}"
];
environment = {
TUWUNEL_PORT = toString port;
TUWUNEL_ADDRESS = "0.0.0.0"; # It'll bind to localhost by default with Podman
TUWUNEL_SERVER_NAME = "blazestar.net";
TUWUNEL_ALLOW_REGISTRATION = "true";
TUWUNEL_ALLOW_CHECK_FOR_UPDATES = "true";
TUWUNEL_ALLOW_FEDERATION = "true";
TUWUNEL_DATABASE_BACKEND = "rocksdb";
TUWUNEL_DATABASE_PATH = dbPath;
TUWUNEL_WELL_KNOWN = ''
{
client=https://${matrixHost}.blazestar.net,
server=${matrixHost}.blazestar.net:443
}
'';
TUWUNEL_TRUSTED_SERVERS = ''["matrix.org", "chat.havenisms.com"]'';
};
environmentFiles = [
config.sops.templates."matrix-blazestar-net.env".path
];
labels = {
"traefik.enable" = "true";
"traefik.http.routers.${serviceName}.rule" = "Host(`${matrixHost}.${blazestar}`)";
"traefik.http.services.${serviceName}.loadbalancer.server.port" = "${toString port}";
# Redirect well-known requests to this host.
"traefik.http.routers.${matrixHost}-blazestar-net-well-known.rule" =
"Host(`blazestar.net`) && PathPrefix(`/.well-known/matrix`)";
"traefik.http.routers.${matrixHost}-blazestar-net-well-known.service" = serviceName;
};
};
# virtualisation.oci-containers.containers.matrix-blazestar-net =
# mkContainer {
# image = "registry.gitlab.com/famedly/conduit/matrix-conduit:latest";
# hostName = hostname;
# domain = blazestar;
# port = port;
# ports = [
# "8449:6167"
# ];
# volumes = [
# "chat-blazestar-net-db:${dbPath}"
# ];
# environment = {
# CONDUIT_PORT = "6167";
# CONDUIT_SERVER_NAME = "blazestar.net";
# CONDUIT_ALLOW_REGISTRATION = "true";
# CONDUIT_DATABASE_BACKEND = "rocksdb";
# CONDUIT_DATABASE_PATH = dbPath;
# CONDUIT_ALLOW_CHECK_FOR_UPDATES = "true";
# CONDUIT_ALLOW_FEDERATION = "true";
# CONDUIT_MAX_REQUEST_SIZE = "20000000";
# CONDUIT_TRUSTED_SERVERS = "[\"matrix.org\"]";
# CONDUIT_MAX_CONCURRENT_REQUESTS = "100";
# CONDUIT_WELL_KNOWN_CLIENT = "https://${hostname}.blazestar.net";
# CONDUIT_WELL_KNOWN_SERVER = "${hostname}.blazestar.net:443";
# CONDUIT_CONFIG = ""; # Ignore the config file
# };
# extraLabels = {
# "traefik.http.routers.${hostname}-blazestar-net-well-known.rule" =
# "Host(`blazestar.net`) && PathPrefix(`/.well-known`)";
# "traefik.http.routers.${hostname}-blazestar-net-well-known.service" = "${hostname}-blazestar-net";
# };
# };
virtualisation.oci-containers.containers.chat = mkContainer {
image = "vectorim/element-web:latest";
hostName = "chat";
port = 8080;
domain = blazestar;
environment = {
ELEMENT_WEB_PORT = "8080";
};
};
}

View File

@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./chat.nix
./uptime.nix
];
}

View File

@@ -0,0 +1,15 @@
{ config, ... }:
let
inherit (import ../lib.nix config) blazestar;
in
{
virtualisation.web-containers.containers.uptime = {
image = "louislam/uptime-kuma:1";
hostname = "uptime";
domain = blazestar;
port = 3001;
volumes = [
"uptime-kuma:/app/data"
];
};
}

View File

@@ -1,37 +1,26 @@
{ config, ... }:
let
inherit (import ./lib.nix config) mkContainer mkMariaDbContainer havenisms;
userIds = import ./user-ids.nix;
in {
in
{
imports = [
(mkMariaDbContainer {
name = "bookstack";
uid = userIds.bookstack.uid;
gid = userIds.bookstack.gid;
uid = config.users.users.bookstack.uid;
gid = config.users.groups.bookstack.gid;
directory = "/tank/bookstack/db";
passwordSecret = "bookstack_db";
})
];
users.groups.bookstack = {
gid = userIds.bookstack.gid;
};
users.users.bookstack = {
uid = userIds.bookstack.uid;
isSystemUser = true;
description = "System User for Bookstack";
group = "bookstack";
};
sops.secrets = {
bookstack_app_key = {
restartUnits = [ "podman-bookstack.service" ];
restartUnits = [ "${config.local.container-backend}-bookstack.service" ];
mode = "0400";
owner = config.users.users.bookstack.name;
};
bookstack_db = {
restartUnits = [ "podman-bookstack-mariadb.service" ];
restartUnits = [ "${config.local.container-backend}-bookstack-mariadb.service" ];
mode = "0400";
owner = config.users.users.bookstack.name;
};
@@ -55,8 +44,8 @@ in {
];
environment = {
APP_URL = "https://bookstack.${havenisms}";
PID = toString userIds.bookstack.uid;
GID = toString userIds.bookstack.gid;
PID = toString config.users.users.bookstack.uid;
GID = toString config.users.groups.bookstack.gid;
DB_HOST = "bookstack-mariadb";
DB_USERNAME = "bookstack";
DB_DATABASE = "bookstack";

View File

@@ -0,0 +1,108 @@
{ config, pkgs, ... }:
let
inherit (import ./lib.nix config) mkContainer localHostRule terakoda;
nginxConf = pkgs.writeText "dm-companion-nginx.conf" ''
user nginx;
worker_processes auto;
# error.log is symlinked to /dev/stderr
error_log /var/log/nginx/error.log notice;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# access.log is symlinked to /dev/stdout
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
server_name dm.blazestar.net;
root /usr/share/nginx/html;
# X-Frame-Options is to prevent from clickJacking attack
add_header X-Frame-Options SAMEORIGIN;
# disable content-type sniffing on some browsers.
add_header X-Content-Type-Options nosniff;
# This header enables the Cross-site scripting (XSS) filter
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy "no-referrer-when-downgrade";
# Enables response header of "Vary: Accept-Encoding"
# This lets the cache have different entries depending on the encoding, e.g. compression
gzip_vary on;
# Serve static files separately.
location ~ ^/(robots.txt|manifest.json) {
expires modified 1y;
add_header Cache-Control "public";
access_log off;
}
location / {
try_files $uri $uri/ /index.html;
index index.html;
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
}
}
'';
in
{
virtualisation.oci-containers.containers = {
dm-companion-pocketbase =
let
hostName = "dm-pocketbase";
in
mkContainer {
inherit hostName;
image = "docker.havenisms.com/lazy-dm/pocketbase";
domain = terakoda;
port = 8080;
volumes = [
"/tank/web/dm.terakoda.com/pb_data:/pb/pb_data"
"/tank/web/dm.terakoda.com/pb_migrations:/pb/pb_migrations:ro"
];
environment = { };
extraLabels = {
"traefik.http.routers.${hostName}-api.rule" =
"PathPrefix(`/api`) && ${localHostRule "dm" terakoda}";
"traefik.http.routers.${hostName}-api.service" = "${hostName}";
};
};
dm-companion = mkContainer {
image = "nginx:alpine";
hostName = "dm";
domain = terakoda;
port = 80;
dependsOn = [
"dm-companion-pocketbase"
];
volumes = [
"/tank/web/dm.terakoda.com/deployed:/usr/share/nginx/html:ro"
"${nginxConf}:/etc/nginx/nginx.conf:ro"
];
};
};
}

View File

@@ -1,47 +1,40 @@
{ config, ... }:
let
inherit (import ./lib.nix config) mkContainer mkPostgresContainer terakoda;
userIds = import ./user-ids.nix;
in {
in
{
imports = [
(mkPostgresContainer {
name = "focalboard";
directory = "/tank/focalboard/db";
uid = userIds.focalboard.uid;
gid = userIds.focalboard.gid;
uid = config.users.users.focalboard.uid;
gid = config.users.groups.focalboard.gid;
passwordSecret = "focalboard/database";
})
];
users.groups.focalboard = {
gid = userIds.focalboard.gid;
};
users.users.focalboard = {
uid = userIds.focalboard.uid;
isSystemUser = true;
description = "System User for Focalboard";
group = "focalboard";
};
sops.secrets = {
"focalboard/database" = {
restartUnits = [ "podman-focalboard.service" "podman-focalboard-postgres.service" ];
restartUnits = [
"${config.local.container-backend}-focalboard.service"
"${config.local.container-backend}-focalboard-postgres.service"
];
mode = "0400";
owner = config.users.users.focalboard.name;
};
};
sops.templates."focalboard-config.json" = {
restartUnits = [ "podman-focalboard.service" ];
restartUnits = [ "${config.local.container-backend}-focalboard.service" ];
owner = config.users.users.focalboard.name;
content = builtins.toJSON {
# Defaults from https://github.com/mattermost-community/focalboard/blob/main/config.json
"serverRoot" = "https://focalboard.terakoda.com";
"port" = 8000;
"dbtype" = "postgres";
"dbconfig" = "postgres://focalboard:${config.sops.placeholder."focalboard/database"}@focalboard-postgres/focalboard?sslmode=disable&connect_timeout=10";
"dbconfig" = "postgres://focalboard:${
config.sops.placeholder."focalboard/database"
}@focalboard-postgres/focalboard?sslmode=disable&connect_timeout=10";
"useSSL" = true;
"prometheus_address" = ":9092";
"session_expire_time" = 2592000;
@@ -63,7 +56,7 @@ in {
domain = terakoda;
dependsOn = [ "focalboard-postgres" ];
port = 8000;
user = "${toString userIds.focalboard.uid}:${toString userIds.focalboard.gid}";
user = "${toString config.users.users.focalboard.uid}:${toString config.users.groups.focalboard.gid}";
volumes = [
"/tank/focalboard/data/files:/opt/focalboard/data/files"
"${config.sops.templates."focalboard-config.json".path}:/opt/focalboard/config.json:ro"

View File

@@ -0,0 +1,20 @@
{ config, ... }:
let
inherit (import ./lib.nix config) mkContainer havenisms;
in {
virtualisation.oci-containers.containers.freshrss = mkContainer {
image = "lscr.io/linuxserver/freshrss:latest";
hostName = "freshrss";
domain = havenisms;
port = "80";
homepageOpts = {
group = "Apps";
name = "FreshRSS";
icon = "freshrss.svg";
description = "Feed aggregator";
};
volumes = [
"/tank/config/freshrss:/config"
];
};
}

View File

@@ -5,10 +5,10 @@ in
{
sops.secrets = {
"gitea/db_password" = {
restartUnits = [ "podman-gitea.service" ];
restartUnits = [ "${config.local.container-backend}-gitea.service" ];
};
"gitea/registration_token" = {
restartUnits = [ "podman-gitea-runner.service" ];
restartUnits = [ "${config.local.container-backend}-gitea-runner.service" ];
};
};
@@ -66,7 +66,7 @@ in
];
volumes = [
# The runner will spawn new containers to run the actions
"/var/run/podman/podman.sock:/var/run/docker.sock:ro"
"${config.local.container-socket}:/var/run/docker.sock:ro"
];
};
}

View File

@@ -0,0 +1,58 @@
{ config, ... }:
let
inherit (import ./lib.nix config)
terakoda
blazestar
hostRule
;
in
{
imports = [
../../../features/web-containers.nix
];
virtualisation.web-containers = {
enable = true;
containers = {
goatcounter-terakoda = {
image = "arp242/goatcounter";
hostname = "goatcounter";
domain = terakoda;
public = true;
port = 8080;
volumes = [
"goatcounter-data:/home/goatcounter/goatcounter-data"
];
extraLabels = {
# "traefik.http.middlewares.strip-analytics.stripprefix.prefixes" = "/analytics";
# "traefik.http.routers.www-terakoda-com-goatcounter.middlewares" = "strip-analytics";
# Host the script on www.terakoda.com so that it is easy to fetch
"traefik.http.routers.www-terakoda-com-goatcounter.rule" =
"PathPrefix(`/count`) && ${hostRule "www" terakoda}";
"traefik.http.routers.www-terakoda-com-goatcounter.entrypoints" = "websecure";
"traefik.http.routers.www-terakoda-com-goatcounter.service" = "goatcounter-terakoda-com";
};
};
goatcounter-blazestar = {
image = "arp242/goatcounter";
hostname = "goatcounter";
domain = blazestar;
public = true;
port = 8080;
volumes = [
"goatcounter-data-blazestar:/home/goatcounter/goatcounter-data"
];
extraLabels = {
# "traefik.http.middlewares.strip-analytics.stripprefix.prefixes" = "/analytics";
# "traefik.http.routers.www-blazestar-net-goatcounter.middlewares" = "strip-analytics";
# Host the script on www.blazestar.net so that it is easy to fetch
"traefik.http.routers.www-blazestar-net-goatcounter.rule" =
"PathPrefix(`/count`) && ${hostRule "www" blazestar}";
"traefik.http.routers.www-blazestar-net-goatcounter.entrypoints" = "websecure";
"traefik.http.routers.www-blazestar-net-goatcounter.service" = "goatcounter-blazestar-net@docker";
};
};
};
};
}

View File

@@ -0,0 +1,84 @@
{ config, ... }:
let
inherit (import ../lib.nix config) hostRule havenisms;
syncRule = "(PathPrefix(`/client/`) || PathPrefix(`/_matrix/client/unstable/org.matrix.msc3575/sync`))";
wellKnownRule = "(Host(`havenisms.com`) || Host(`chat.havenisms.com`)) && PathPrefix(`/.well-known`)";
in
{
sops.secrets = {
"matrix/syncv3/db-password" = {
restartUnits = [ "${config.local.container-backend}-matrix-sliding-sync.service" ];
};
"matrix/syncv3/secret" = {
restartUnits = [ "${config.local.container-backend}-matrix-sliding-sync.service" ];
};
};
sops.templates."matrix-sliding-sync.env".content = ''
SYNCV3_SERVER=http://synapse:8008
SYNCV3_DB=postgres://syncv3:${
config.sops.placeholder."matrix/syncv3/db-password"
}@db:5432/syncv3?sslmode=disable
SYNCV3_SECRET=${config.sops.placeholder."matrix/syncv3/secret"}
SYNCV3_BINDADDR=:8009
'';
virtualisation.oci-containers.containers = {
synapse = {
image = "docker.io/matrixdotorg/synapse:latest";
autoStart = true;
dependsOn = [
"db"
];
volumes = [
"/tank/config/synapse/data:/data"
];
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.synapse.rule=${hostRule "chat" havenisms} && !(${syncRule} || ${wellKnownRule})"
"-l=traefik.http.routers.synapse.service=synapse"
"-l=traefik.http.services.synapse.loadbalancer.server.port=8008"
# Federation forwarding
"-l=traefik.http.routers.synapse-federation.rule=${hostRule "chat" havenisms}"
"-l=traefik.http.routers.synapse-federation.service=synapse-federation"
"-l=traefik.http.routers.synapse-federation.entrypoints=matrix-federation"
"-l=traefik.http.services.synapse-federation.loadbalancer.server.port=8448"
];
};
matrix-sliding-sync = {
image = "ghcr.io/matrix-org/sliding-sync:latest";
dependsOn = [
"db"
"synapse"
];
environmentFiles = [
config.sops.templates."matrix-sliding-sync.env".path
];
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.syncv3.rule=${hostRule "chat" havenisms} && ${syncRule}"
"-l=traefik.http.services.syncv3.loadbalancer.server.port=8009"
];
};
# This server helps to serve the .well-known files that are required by clients to find the sync server.
matrix-well-known = {
image = "nginx";
dependsOn = [ "synapse" ];
volumes = [
"/tank/config/synapse/static-files:/usr/share/nginx/html:ro"
];
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.middlewares.strip-well-known.stripprefix.prefixes=/.well-known"
"-l=traefik.http.routers.matrix-well-known.rule=${wellKnownRule}"
"-l=traefik.http.routers.matrix-well-known.middlewares=strip-well-known"
"-l=traefik.http.services.matrix-well-known.loadbalancer.server.port=80"
];
};
};
}

View File

@@ -0,0 +1,11 @@
{ ... }:
{
imports = [
./chat.nix
# Currently disabled because it doesn't start up properly
# ./immich.nix
./storyden.nix
./tandoor.nix
./wallabag.nix
];
}

View File

@@ -0,0 +1,73 @@
{ config, ... }:
let
inherit (import ../lib.nix config) havenisms mkPostgresContainer;
in
{
imports = [
(mkPostgresContainer {
# Immich wants a custom build of postgres with the vectors extensions.
image = "ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:c44be5f2871c59362966d71eab4268170eb6f5653c0e6170184e72b38ffdf107";
name = "immich";
directory = "/tank/immich/db";
uid = config.users.users.immich.uid;
gid = config.users.groups.immich.gid;
passwordSecret = "immich/database";
})
];
sops.secrets = {
"immich/database" = {
restartUnits = [
"${config.local.container-backend}-immich-db.service"
];
mode = "0400";
owner = config.users.users.immich.name;
};
};
sops.templates."immich.env" = {
restartUnits = [ "${config.local.container-backend}-immich.service" ];
owner = config.users.users.immich.name;
content = ''
DB_HOSTNAME=immich-postgres
DB_PASSWORD=${config.sops.placeholder."immich/database"}
DB_USERNAME=immich
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich-redis
IMMICH_LOG_LEVEL=verbose
'';
};
virtualisation.web-containers.containers.immich = {
image = "ghcr.io/immich-app/immich-server:release";
hostname = "immich";
domain = havenisms;
port = 2283;
volumes = [
"/tank/photos/immich:/data"
"/etc/localtime:/etc/localtime:ro"
];
dependsOn = [
"immich-redis"
"immich-postgres"
];
environmentFiles = [
"${config.sops.templates."immich.env".path}"
];
};
virtualisation.oci-containers.containers = {
"immich-redis" = {
image = "docker.io/valkey/valkey";
};
"immich-machine-learning" = {
image = "ghcr.io/immich-app/immich-machine-learning:release";
volumes = [
"model-cache:/cache"
];
environmentFiles = [
"${config.sops.templates."immich.env".path}"
];
};
};
}

View File

@@ -0,0 +1,17 @@
{ config, ... }:
let
inherit (import ../lib.nix config) havenisms;
in
{
virtualisation.web-containers.containers.storyden = {
image = "ghcr.io/southclaws/storyden";
port = 8000;
hostname = "storyden";
domain = havenisms;
environment = {
PUBLIC_WEB_ADDRESS = "https://storyden.${havenisms}";
PUBLIC_API_ADDRESS = "https://storyden.${havenisms}";
};
};
}

View File

@@ -0,0 +1,30 @@
{ config, ... }:
let
inherit (import ../lib.nix config) havenisms;
in
{
sops.secrets = {
"tandoor/secret_key" = {
restartUnits = [ "${config.local.container-backend}-tandoor.service" ];
};
};
sops.templates."tandoor.env".content = ''
SECRET_KEY="${config.sops.placeholder."tandoor/secret_key"}"
DB_ENGINE=django.db.backends.sqlite3
'';
virtualisation.web-containers.containers.tandoor = {
image = "vabene1111/recipes";
hostname = "recipes";
domain = havenisms;
port = 80;
volumes = [
"/tank/tandoor-recipes/mediafiles:/opt/recipes/mediafiles"
"/tank/tandoor-recipes/staticfiles:/opt/recipes/staticfiles"
];
environmentFiles = [
config.sops.templates."tandoor.env".path
];
};
}

View File

@@ -0,0 +1,19 @@
{ config, ... }:
let
inherit (import ../lib.nix config) havenisms;
in
{
virtualisation.web-containers.containers.wallabag = {
image = "wallabag/wallabag";
hostname = "wallabag";
domain = havenisms;
port = 80;
volumes = [
"wallabag-data:/var/www/wallabag/data"
"wallabag-images:/var/www/wallabag/web/assets/images"
];
environment = {
SYMFONY__ENV__DOMAIN_NAME = "https://wallabag.${havenisms}";
};
};
}

View File

@@ -21,41 +21,63 @@ in
havenisms
blazestar
terakoda
terakoda_net;
terakoda_net
;
mkContainer = {
image,
hostName,
port,
homepageOpts ? {},
dependsOn ? [],
domain ? havenisms,
ports ? [],
volumes ? [],
environment ? {},
environmentFiles ? [],
public ? false,
user ? null,
extraOptions ? [],
}:
mkContainer =
{
image,
hostName,
port,
homepageOpts ? { },
dependsOn ? [ ],
domain ? havenisms,
ports ? [ ],
volumes ? [ ],
environment ? { },
environmentFiles ? [ ],
public ? false,
user ? null,
extraOptions ? [ ],
oauthProxy ? false,
extraLabels ? { },
}:
let
routerRule = if public then hostRule hostName domain else localHostRule hostName domain;
homepageLabels = if homepageOpts == {} then {} else {
"homepage.group" = "${homepageOpts.group}";
"homepage.name" = "${homepageOpts.name}";
"homepage.icon" = "${homepageOpts.icon}";
"homepage.href" = "https://${hostName}.${domain}";
"homepage.description" = "${homepageOpts.description}";
};
homepageLabels =
if homepageOpts == { } then
{ }
else
{
"homepage.group" = "${homepageOpts.group}";
"homepage.name" = "${homepageOpts.name}";
"homepage.icon" = "${homepageOpts.icon}";
"homepage.href" = "https://${hostName}.${domain}";
"homepage.description" = "${homepageOpts.description}";
};
oauthLabels =
if oauthProxy then { "traefik.http.routers.${hostName}.middlewares" = "oidc-auth@file"; } else { };
in
{
inherit image dependsOn volumes environment environmentFiles ports user extraOptions;
inherit
image
dependsOn
volumes
environment
environmentFiles
ports
user
extraOptions
;
autoStart = true;
labels = {
"traefik.enable" = "true";
"traefik.http.routers.${hostName}.rule" = "${routerRule}";
"traefik.http.services.${hostName}.loadbalancer.server.port" = "${toString port}";
} // homepageLabels;
}
// oauthLabels
// homepageLabels
// extraLabels;
};
# Creates a MariaDB container for a specific app. It should be safe to give
@@ -64,60 +86,65 @@ in
# user.
#
# Note that this returns a _module_ so that it can be imported and provide many different config values.
mkMariaDbContainer = {
name,
uid,
gid,
passwordSecret,
directory,
}:
{ config, ... }:
{
virtualisation.oci-containers.containers."${name}-mariadb" = {
image = "lscr.io/linuxserver/mariadb:latest";
autoStart = true;
ports = [ "3306:3306" ];
volumes = [
"${directory}:/config"
"${config.sops.secrets.mariadb_root_password.path}:/run/secrets/mariadb_root_password"
"${config.sops.secrets."${passwordSecret}".path}:/run/secrets/mariadb_password"
];
environment = {
PUID = "${toString uid}";
PGID = "${toString gid}";
MYSQL_USER = name;
MYSQL_DATABASE = name;
FILE__MYSQL_ROOT_PASSWORD = "/run/secrets/mariadb_root_password";
FILE__MYSQL_PASSWORD = "/run/secrets/mariadb_password";
mkMariaDbContainer =
{
name,
uid,
gid,
passwordSecret,
directory,
}:
{ config, ... }:
{
virtualisation.oci-containers.containers."${name}-mariadb" = {
image = "lscr.io/linuxserver/mariadb:latest";
autoStart = true;
ports = [ "3306:3306" ];
volumes = [
"${directory}:/config"
"${config.sops.secrets.mariadb_root_password.path}:/run/secrets/mariadb_root_password"
"${config.sops.secrets."${passwordSecret}".path}:/run/secrets/mariadb_password"
];
environment = {
PUID = "${toString uid}";
PGID = "${toString gid}";
MYSQL_USER = name;
MYSQL_DATABASE = name;
FILE__MYSQL_ROOT_PASSWORD = "/run/secrets/mariadb_root_password";
FILE__MYSQL_PASSWORD = "/run/secrets/mariadb_password";
};
};
};
};
mkPostgresContainer = {
name,
uid,
gid,
passwordSecret,
directory,
containerName ? "${name}-postgres",
databaseName ? name,
username ? name,
}: { config, ... }: {
virtualisation.oci-containers.containers."${containerName}" = {
image = "postgres";
autoStart = true;
volumes = [
# Note that data must be mounted at this location to persist.
# See https://github.com/docker-library/docs/blob/master/postgres/README.md#pgdata
"${directory}:/var/lib/postgresql/data"
"${config.sops.secrets."${passwordSecret}".path}:/run/secrets/postgres_password"
];
user = "${toString uid}:${toString gid}";
environment = {
POSTGRES_USER = username;
POSTGRES_DB = databaseName;
POSTGRES_PASSWORD_FILE = "/run/secrets/postgres_password";
mkPostgresContainer =
{
name,
uid,
gid,
passwordSecret,
directory,
containerName ? "${name}-postgres",
databaseName ? name,
username ? name,
image ? "postgres",
}:
{ config, ... }:
{
virtualisation.oci-containers.containers."${containerName}" = {
inherit image;
autoStart = true;
volumes = [
# Note that data must be mounted at this location to persist.
# See https://github.com/docker-library/docs/blob/master/postgres/README.md#pgdata
"${directory}:/var/lib/postgresql/data"
"${config.sops.secrets."${passwordSecret}".path}:/run/secrets/postgres_password"
];
user = "${toString uid}:${toString gid}";
environment = {
POSTGRES_USER = username;
POSTGRES_DB = databaseName;
POSTGRES_PASSWORD_FILE = "/run/secrets/postgres_password";
};
};
};
};
}

View File

@@ -1,16 +1,8 @@
# Common config for all mariadb containers
{ ... }:
let
userIds = import ./user-ids.nix;
in {
users = {
groups."mariadb" = {
gid = userIds.mariadb.gid;
};
};
{ config, ... }:
{
sops.secrets."mariadb_root_password" = {
restartUnits = [ "podman-mariadb.service" ];
restartUnits = [ "${config.local.container-backend}-mariadb.service" ];
mode = "0440";
group = "mariadb";
};

View File

@@ -0,0 +1,280 @@
{ config, ... }:
let
inherit (import ./lib.nix config)
hostRuleHavenisms
localHostRuleHavenisms
havenisms
mkContainer
;
gluetun_env = "gluetun-proton-vpn-wireguard.env";
in
{
sops.secrets = {
"protonvpn/private_key" = {
restartUnits = [ "${config.local.container-backend}-gluetun.service" ];
};
};
# Example Wireguard config file:
# # Key for MCP Wireguard
# # Bouncing = 13
# # NetShield = 1
# # Moderate NAT = off
# # NAT-PMP (Port Forwarding) = on
# # VPN Accelerator = on
# PrivateKey = ${config.sops.placeholder."protonvpn/private_key"}
# Address = 10.2.0.2/32
# DNS = 10.2.0.1
#
# [Peer]
# # US-CA#906
# PublicKey = 2xvxhMK0AalXOMq6Dh0QMVJ0Cl3WQTmWT5tdeb8SpR0=
# AllowedIPs = 0.0.0.0/0, ::/0
# Endpoint = 79.127.185.166:51820
#
# PersistentKeepalive = 25
sops.templates.${gluetun_env}.content = ''
VPN_SERVICE_PROVIDER=protonvpn
VPN_TYPE=wireguard
WIREGUARD_PRIVATE_KEY="${config.sops.placeholder."protonvpn/private_key"}"
SERVER_COUNTRIES="United States,United Kingdom,Netherlands,Switzerland,Sweden"
VPN_PORT_FORWARDING=on
'';
virtualisation.oci-containers.containers = {
jellyfin = {
image = "lscr.io/linuxserver/jellyfin:10.11.6";
autoStart = true;
extraOptions = [
"--device=/dev/dri:/dev/dri"
"-l=traefik.enable=true"
"-l=traefik.http.routers.jellyfin.rule=${hostRuleHavenisms "jellyfin"}"
"-l=traefik.http.services.jellyfin.loadbalancer.server.port=8096"
"-l=homepage.group=Apps"
"-l=homepage.name=Jellyfin"
"-l=homepage.icon=jellyfin.svg"
"-l=homepage.href=https://jellyfin.${havenisms}"
"-l=homepage.description=Media player"
"-l=homepage.widget.type=jellyfin"
"-l=homepage.widget.key={{HOMEPAGE_FILE_JELLYFIN_KEY}}"
"-l=homepage.widget.url=http://jellyfin:8096"
"-l=homepage.widget.enableBlocks=true"
];
volumes = [
"/tank/media/collection:/data"
"/tank/config/jellyfin:/config"
];
# environment = {
# TZ = vars.timeZone;
# PUID = "994";
# UMASK = "002";
# GUID = "993";
# };
};
deluge = {
image = "lscr.io/linuxserver/deluge:latest";
autoStart = true;
dependsOn = [
"gluetun"
];
extraOptions = [
"--network=container:gluetun"
"-l=homepage.group=Arr"
"-l=homepage.name=Deluge"
"-l=homepage.icon=deluge.svg"
"-l=homepage.href=https://deluge.${havenisms}"
"-l=homepage.description=Torrent client"
"-l=homepage.widget.type=deluge"
"-l=homepage.widget.password={{HOMEPAGE_FILE_DELUGE_PASSWORD}}"
"-l=homepage.widget.url=http://gluetun:8112"
];
volumes = [
"/tank/media:/data"
"/tank/config/deluge:/config"
];
};
qbittorrent = {
image = "lscr.io/linuxserver/qbittorrent:latest";
autoStart = true;
dependsOn = [
"gluetun"
];
extraOptions = [
"--network=container:gluetun"
"-l=homepage.group=Arr"
"-l=homepage.name=qBitTorrent"
"-l=homepage.icon=qbittorrent.svg"
"-l=homepage.href=https://torrents.${havenisms}"
"-l=homepage.description=Torrent client"
"-l=homepage.widget.type=qbittorrent"
"-l=homepage.widget.url=http://torrents.${havenisms}"
];
volumes = [
"/tank/media/Downloads:/downloads"
"/tank/config/qbittorrent:/config"
];
environment = {
PUID = "911";
PGID = "911";
UMASK = "002";
};
};
gluetun = {
image = "qmcgaw/gluetun:latest";
autoStart = true;
extraOptions = [
# add network admin capability.
"--cap-add=NET_ADMIN"
"--device=/dev/net/tun:/dev/net/tun"
"-l=traefik.enable=true"
"-l=traefik.http.routers.torrents.rule=${localHostRuleHavenisms "torrents"}"
"-l=traefik.http.routers.torrents.service=torrents"
"-l=traefik.http.services.torrents.loadbalancer.server.port=8080"
"-l=homepage.group=Infra"
"-l=homepage.name=GlueTun"
"-l=homepage.icon=gluetun.svg"
"-l=homepage.href=https://torrents.${havenisms}"
"-l=homepage.description=VPN killswitch"
"-l=homepage.widget.type=gluetun"
"-l=homepage.widget.url=http://gluetun:8000"
];
ports = [
"127.0.0.1:8083:8000"
];
environmentFiles = [
config.sops.templates.${gluetun_env}.path
];
};
prowlarr = {
image = "lscr.io/linuxserver/prowlarr";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.prowlarr.rule=${localHostRuleHavenisms "prowlarr"}"
"-l=traefik.http.services.prowlarr.loadbalancer.server.port=9696"
"-l=homepage.group=Arr"
"-l=homepage.name=Prowlarr"
"-l=homepage.icon=prowlarr.svg"
"-l=homepage.href=https://prowlarr.${havenisms}"
"-l=homepage.description=Torrent indexer"
];
volumes = [
"/tank/config/prowlarr:/config"
];
environment = {
UMASK = "002";
};
};
# Currently broken and doesn't work. :(
# flaresolverr = {
# image = "ghcr.io/flaresolverr/flaresolverr:latest";
# autoStart = true;
# extraOptions = [
# "-l=homepage.group=Infra"
# "-l=homepage.name=FlareSolverr"
# "-l=homepage.icon=flaresolverr.svg"
# "-l=homepage.href=https://flaresolverr.${domain}"
# "-l=homepage.description=Cloudflare bypass"
# ];
# volumes = [
# "/tank/config/flaresolverr:/config"
# ];
# environment = {
# UMASK = "002";
# };
# };
radarr = {
image = "lscr.io/linuxserver/radarr";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.radarr.rule=${localHostRuleHavenisms "radarr"}"
"-l=traefik.http.services.radarr.loadbalancer.server.port=7878"
"-l=homepage.group=Arr"
"-l=homepage.name=Radarr"
"-l=homepage.icon=radarr.svg"
"-l=homepage.href=https://radarr.${havenisms}"
"-l=homepage.description=Movie acquisition"
"-l=homepage.widget.type=radarr"
"-l=homepage.widget.url=http://radarr:7878"
"-l=homepage.widget.key={{HOMEPAGE_FILE_RADARR_KEY}}"
];
volumes = [
"/tank/media:/data"
"/tank/config/radarr:/config"
];
environment = {
UMASK = "002";
};
};
sonarr = {
image = "lscr.io/linuxserver/sonarr";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.sonarr.rule=${localHostRuleHavenisms "sonarr"}"
"-l=traefik.http.services.sonarr.loadbalancer.server.port=8989"
"-l=homepage.group=Arr"
"-l=homepage.name=Sonarr"
"-l=homepage.icon=sonarr.svg"
"-l=homepage.href=https://sonarr.${havenisms}"
"-l=homepage.description=Show acquisition"
"-l=homepage.widget.type=sonarr"
"-l=homepage.widget.url=http://sonarr:8989"
"-l=homepage.widget.key={{HOMEPAGE_FILE_SONARR_KEY}}"
];
volumes = [
"/tank/media:/data"
"/tank/config/sonarr:/config"
];
environment = {
UMASK = "002";
};
};
readarr = {
# The Linuxserver version of this image doesn't have a latest tag. Odd.
image = "lscr.io/linuxserver/readarr:develop";
autoStart = true;
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.readarr.rule=${localHostRuleHavenisms "readarr"}"
"-l=traefik.http.services.readarr.loadbalancer.server.port=8787"
"-l=homepage.group=Arr"
"-l=homepage.name=Readarr"
"-l=homepage.icon=readarr.svg"
"-l=homepage.href=https://readarr.${havenisms}"
"-l=homepage.description=E-book acquisition"
"-l=homepage.widget.type=readarr"
"-l=homepage.widget.url=http://readarr.havenisms.com:8787"
"-l=homepage.widget.key={{HOMEPAGE_FILE_READARR_KEY}}"
];
volumes = [
"/tank/media:/data"
"/tank/config/readarr:/config"
];
environment = {
UMASK = "002";
};
};
bazarr = mkContainer {
# The Linuxserver version of this image doesn't have a latest tag. Odd.
image = "lscr.io/linuxserver/bazarr:latest";
port = 6767;
hostName = "bazarr";
homepageOpts = {
group = "Arr";
name = "Bazarr";
icon = "bazarr.svg";
description = "Subtitles";
};
volumes = [
"/tank/media:/data"
"/tank/config/bazarr:/config"
];
environment = {
UMASK = "002";
};
};
};
}

View File

@@ -4,7 +4,7 @@ let
in
{
virtualisation.oci-containers.containers.nextcloud = {
image = "docker.io/library/nextcloud:latest";
image = "docker.io/library/nextcloud:31";
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.nextcloud.rule=${hostRule "cloud" havenisms}"
@@ -20,13 +20,5 @@ in
volumes = [
"/tank/nextcloud:/var/www/html"
];
environment = {
POSTGRES_HOST = "db";
POSTGRES_DB = "nextcloud";
POSTGRES_USER = "nextcloud";
# TODO: Secrets
POSTGRES_PASSWORD = "nextcloud123";
};
};
}

View File

@@ -0,0 +1,50 @@
{ config, ... }:
let
inherit (import ./lib.nix config) mkContainer blazestar havenisms;
in
{
sops.secrets = {
"oauth2-proxy/cookie-secret" = {
restartUnits = [ "${config.local.container-backend}-oauth2-proxy.service" ];
mode = "0400";
};
"oauth2-proxy/client-secret" = {
restartUnits = [ "${config.local.container-backend}-oauth2-proxy.service" ];
mode = "0400";
};
};
sops.templates."oauth2-proxy.env".content = ''
OAUTH2_PROXY_HTTP_ADDRESS='0.0.0.0:4180'
OAUTH2_PROXY_COOKIE_SECRET='${config.sops.placehoder."oauth2-proxy/cookie-secret"}'
OAUTH2_PROXY_COOKIE_DOMAINS='.${blazestar} .${havenisms}'
OAUTH2_PROXY_WHITELIST_DOMAINS='.${blazestar} .${havenisms}'
OAUTH2_PROXY_PROVIDER='oidc'
OAUTH2_PROXY_CLIENT_ID='oauth2-proxy'
OAUTH2_PROXY_CLIENT_SECRET='${config.sops.placehoder."oauth2-proxy/client-secret"}'
OAUTH2_PROXY_EMAIL_DOMAINS='*'
OAUTH2_PROXY_OIDC_ISSUER_URL='https://auth.${blazestar}/realms/master'
OAUTH2_PROXY_REDIRECT_URL='https://auth.${blazestar}/oauth2/callback'
OAUTH2_PROXY_COOKIE_CSRF_PER_REQUEST=true
OAUTH2_PROXY_COOKIE_CSRF_EXPIRE='5m'
OAUTH2_PROXY_CUSTOM_TEMPLATES_DIR="/templates"
OAUTH2_PROXY_REVERSE_PROXY=true
'';
virtualisation.oci-containers.containers.oauth2-proxy = mkContainer {
image = "quay.io/oauth2-proxy/oauth2-proxy";
hostName = "oauth";
domain = blazestar;
port = "4180";
homepageOpts = {
group = "Infra";
name = "OAuth2-Proxy";
icon = "oauth2-proxy.png";
description = "An OAuth2 Reverse Proxy";
};
volumes = [
];
environment = {
};
};
}

View File

@@ -1,10 +1,7 @@
{ config, ... }:
let
inherit (import ./lib.nix config) mkContainer terakoda;
userIds = import ./user-ids.nix;
in {
users = userIds.mkUserAndGroup "offen" userIds.offen;
sops = {
secrets = {
"offen/smtp-token" = {};
@@ -30,7 +27,7 @@ in {
image = "offen/offen";
hostName = "offen";
domain = terakoda;
user = "${toString userIds.offen.uid}:${toString userIds.offen.gid}";
user = "${toString config.users.users.offen.uid}:${toString config.users.groups.offen.gid}";
port = 80;
volumes = [
"${config.sops.templates."offen.env".path}:/etc/offen/offen.env:ro"

View File

@@ -2,18 +2,19 @@
let
inherit (import ./lib.nix config) mkContainer havenisms;
hostName = "projects";
in {
in
{
sops.secrets = {
"openproject/secret-key-base" = {
restartUnits = [ "podman-openproject.service" ];
restartUnits = [ "${config.local.container-backend}-openproject.service" ];
mode = "0400";
owner = config.users.users.bookstack.name;
};
};
sops.templates."openproject.env" = {
restartUnits = [ "podman-openproject.service" ];
restartUnits = [ "${config.local.container-backend}-openproject.service" ];
content = ''
OPENPROJECT_SECRET_KEY_BASE=${config.sops.placeholder."openproject/secret-key-base"}
OPENPROJECT_HOST__NAME=${hostName}.${havenisms}

View File

@@ -1,7 +1,6 @@
{ config, ... }:
let
inherit (import ./lib.nix config) mkContainer blazestar;
userIds = import ./user-ids.nix;
# The default is to run on port 80, which the pocket-id user cannot bind to.
# We need a different port to be able to serve traffic.
# The following ports in the container are already taken:
@@ -11,17 +10,6 @@ let
port = 8888;
in
{
users.groups.pocket-id = {
gid = userIds.pocket-id.gid;
};
users.users.pocket-id = {
uid = userIds.pocket-id.uid;
isSystemUser = true;
description = "System User for Pocket ID";
group = "pocket-id";
};
virtualisation.oci-containers.containers.pocket-id = mkContainer {
image = "ghcr.io/pocket-id/pocket-id";
dependsOn = [];
@@ -45,8 +33,8 @@ in
CADDY_PORT = toString port;
# PORT = "3000"; # Frontend port
# BACKEND_PORT = "8080"; # Backend port
PUID = toString userIds.pocket-id.uid;
PGID = toString userIds.pocket-id.gid;
PUID = toString config.users.users."pocket-id".uid;
PGID = toString config.users.groups."pocket-id".gid;
};
};
}

View File

@@ -1,30 +1,64 @@
# Static websites
{ lib, config, ... }:
let
inherit (import ./lib.nix config) terakoda havenisms blazestar;
mkStaticSite = domain: let
cleanDomain = lib.strings.stringAsChars (c: if c == "." then "-" else c) domain;
in {
"${cleanDomain}-static" = {
image = "nginx:alpine";
autoStart = true;
volumes = [
"/tank/web/${domain}/public:/usr/share/nginx/html:ro"
];
labels = {
"traefik.enable" = "true";
"traefik.http.routers.${cleanDomain}.rule" = "Host(`${domain}`) || Host(`www.${domain}`)";
"traefik.http.routers.${cleanDomain}.middlewares" = "${cleanDomain}-add-www@docker";
"traefik.http.services.${cleanDomain}.loadbalancer.server.port" = "80";
"traefik.http.middlewares.${cleanDomain}-add-www.redirectregex.regex" = "^https://${domain}/(.*)";
"traefik.http.middlewares.${cleanDomain}-add-www.redirectregex.replacement" = "https://www.${domain}/\${1}";
"traefik.http.middlewares.${cleanDomain}-add-www.redirectregex.permanent" = "true";
inherit (import ./lib.nix config)
terakoda
havenisms
blazestar
;
mkStaticSite =
{
host,
dir ? "public",
redirectWww ? true,
}:
let
cleanHost = lib.strings.stringAsChars (c: if c == "." then "-" else c) host;
wwwLabels =
if redirectWww then
{
"traefik.http.routers.${cleanHost}.middlewares" = "${cleanHost}-add-www@docker";
"traefik.http.middlewares.${cleanHost}-add-www.redirectregex.regex" = "^https://${host}/(.*)";
"traefik.http.middlewares.${cleanHost}-add-www.redirectregex.replacement" =
"https://www.${host}/\${1}";
"traefik.http.middlewares.${cleanHost}-add-www.redirectregex.permanent" = "true";
}
else
{ };
in
{
"${cleanHost}-static" = {
image = "nginx:alpine";
autoStart = true;
volumes = [
"/tank/web/${host}/${dir}:/usr/share/nginx/html:ro"
];
labels = {
"traefik.enable" = "true";
"traefik.http.routers.${cleanHost}.rule" = "Host(`${host}`) || Host(`www.${host}`)";
"traefik.http.services.${cleanHost}.loadbalancer.server.port" = "80";
} // wwwLabels;
};
};
};
in {
in
{
virtualisation.oci-containers.containers =
mkStaticSite terakoda //
mkStaticSite havenisms //
mkStaticSite blazestar;
mkStaticSite {
host = terakoda;
dir = "deployed";
}
// mkStaticSite {
host = blazestar;
dir = "deployed";
}
// mkStaticSite {
host = "wow.${blazestar}";
dir = "deployed";
redirectWww = false;
}
// mkStaticSite {
host = havenisms;
dir = "public";
};
}

View File

@@ -1,60 +0,0 @@
{ config, ... }:
let inherit (import ./lib.nix config) hostRule havenisms;
syncRule = "(PathPrefix(`/client/`) || PathPrefix(`/_matrix/client/unstable/org.matrix.msc3575/sync`))";
wellKnownRule = "PathPrefix(`/.well-known`)";
in
{
virtualisation.oci-containers.containers = {
synapse = {
image = "docker.io/matrixdotorg/synapse:latest";
autoStart = true;
dependsOn = [
"db"
];
volumes = [
"/tank/config/synapse/data:/data"
];
ports = [
"8008:8008/tcp"
];
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.synapse.rule=${hostRule "chat" havenisms} && !(${syncRule} || ${wellKnownRule})"
"-l=traefik.http.services.synapse.loadbalancer.server.port=8008"
];
};
matrix_sliding_sync = {
image = "ghcr.io/matrix-org/sliding-sync:latest";
dependsOn = ["db"];
ports = [
"8009:8009"
];
environment = {
SYNCV3_SERVER = "http://synapse:8008";
# TODO: Store password securely
SYNCV3_DB = "postgres://syncv3:TZKr3RNmVx@db:5432/syncv3?sslmode=disable";
# TODO: Store secret securely
SYNCV3_SECRET = "4917590296b90910ec31ba355af6c7731409fd5f284d24912b852c3f928fa162";
SYNCV3_BINDADDR = ":8009";
};
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.syncv3.rule=${hostRule "chat" havenisms} && ${syncRule}"
"-l=traefik.http.services.syncv3.loadbalancer.server.port=8009"
];
};
# This server helps to serve the .well-known files that are required by clients to find the sync server.
matrix_well_known = {
image = "nginx";
ports = [ "80" ];
volumes = [
"/tank/config/synapse/static-files:/usr/share/nginx/html:ro"
];
extraOptions = [
"-l=traefik.enable=true"
"-l=traefik.http.routers.matrix-static.rule=${hostRule "chat" havenisms} && ${wellKnownRule}"
"-l=traefik.http.services.matrix-static.loadbalancer.server.port=80"
];
};
};
}

View File

@@ -0,0 +1,30 @@
{ config, ... }:
let
inherit (import ./lib.nix config) mkContainer;
in
{
virtualisation.oci-containers.containers.timetagger = mkContainer {
image = "ghcr.io/almarklein/timetagger:v24.12.2";
hostName = "time";
port = "80";
oauthProxy = true;
homepageOpts = {
group = "Apps";
name = "TimeTagger";
icon = "timetagger.png";
description = "Time tracker";
};
volumes = [
"/tank/config/timetagger:/data"
];
environment = {
TIMETAGGER_BIND = "0.0.0.0:80";
TIMETAGGER_DATADIR = "/data";
TIMETAGGER_LOG_LEVEL = "debug";
TIMETAGGER_PROXY_AUTH_ENABLED = "True";
TIMETAGGER_PROXY_AUTH_TRUSTED = "10.88.0.0/16";
TIMETAGGER_PROXY_AUTH_HEADER = "X-Remote-User";
};
};
}

View File

@@ -5,28 +5,77 @@ let
name = "traefik-config";
path = ./traefik;
};
in {
virtualisation.oci-containers.containers.traefik = mkContainer {
image = "traefik";
hostName = "proxy";
port = 8080;
domain = blazestar;
public = false;
ports = [
"80:80"
"443:443"
];
volumes =
[
"/var/run/podman/podman.sock:/var/run/docker.sock:ro"
"${traefikConfigDir}:/etc/traefik"
"/tank/config/traefik/acme:/etc/traefik/acme"
];
homepageOpts = {
name = "Traefik";
icon = "traefik.svg";
group = "Infra";
description = "Reverse Proxy";
};
in
{
sops.secrets = {
"traefik/oauth2-client-secret" = {
restartUnits = [ "${config.local.container-backend}-traefik.service" ];
mode = "0400";
};
}
"traefik/oauth2-plugin-secret" = {
restartUnits = [ "${config.local.container-backend}-traefik.service" ];
mode = "0400";
};
};
sops.templates."traefik/oauth2-config.yaml".content = ''
http:
middlewares:
oidc-auth:
plugin:
traefik-oidc-auth:
LogLevel: DEBUG
Secret: "${config.sops.placeholder."traefik/oauth2-plugin-secret"}"
# Omitting the Callback URL means it will use the current domain for the callback.
# CallbackUri: "https://oidc.blazestar.net/oidc/callback"
Provider:
Url: "https://auth.blazestar.net/"
ClientId: "3e3f7d9a-a684-4412-866c-ea7281954a9f"
ClientSecret: "${config.sops.placeholder."traefik/oauth2-client-secret"}"
TokenValidation: "IdToken"
UsePkce: false
Scopes: ["openid", "profile", "email"]
Headers:
- Name: "X-Oidc-Username"
Value: "{{`{{ .claims.preferred_username }}`}}"
- Name: "X-Oidc-Email"
Value: "{{`{{ .claims.email }}`}}"
- Name: "X-Oidc-Subject"
Value: "sub"
- Name: "Authorization"
Value: "{{`Bearer {{ .accessToken }}`}}"
- Name: "IdToken"
Value: "{{`Bearer {{ .idToken }}`}}"
'';
virtualisation.oci-containers.containers.traefik = mkContainer {
image = "traefik";
hostName = "proxy";
port = 8080;
domain = blazestar;
public = false;
ports = [
"80:80"
"443:443"
"8448:8448"
];
volumes = [
"${config.local.container-socket}:/var/run/docker.sock:ro"
# All the configs from the config directory
"${traefikConfigDir}:/etc/traefik"
# Oauth2 config containing secrets
"${config.sops.templates."traefik/oauth2-config.yaml".path}:/etc/traefik/dynamic/oauth2-config.yaml"
# Persistent storage for acme certificates
# TODO: It may be possible to just use docker storage because persistence
# is not critical when the cert can just be renewed.
"/tank/config/traefik/acme:/etc/traefik/acme"
];
homepageOpts = {
name = "Traefik";
icon = "traefik.svg";
group = "Infra";
description = "Reverse Proxy";
};
};
}

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