This commit is contained in:
kiri committed 2026-08-22 16:55:00 +02:00
1 parent 81e576a877
commit cde67e4d75
46 files changed
+619 -518

No files matched your search

-13
View File
@@ -1,13 +0,0 @@
# Notes
## 16-04
- See if pinentry should be a variable and how pure ssh (no gpg anymore) handles pinentry.
- Reconsider placement and existence of system-base.nix
- Implement system-wide theming system
- Do we need separate stateVersions per host?
- pinentry.nix should not set programs consuming it explicitly, should probably be host-level concern or smoething.
- Primary email schema validation should not be located inside aspects like git.nix but somewhere in the schema definition probably
- assertions are defined, not sure if that actually does anything.
Code style related todos:
Consistent rules/guidelines for function or attribute set at root of aspect file.
When to nest sets and when to set directly (podman.nix).
+24
View File
@@ -0,0 +1,24 @@
# NixOS configuration
Host identity and topology live in `modules/hosts/<host>/default.nix`; shared account,
service, external-device, and server-topology facts live in `modules/facts.nix`.
- Add a package used by both workstations to the relevant Home Manager capability,
or to `workstation-apps` in `modules/capabilities/desktop-defaults.nix` when it needs
no configuration.
- Add a host-specific capability to that host's import list in
`modules/hosts/<host>/default.nix`.
- Change the selected terminal or editor by replacing the corresponding
`primary-terminal-*` import in `modules/profiles/workstation-base.nix` or
`primary-editor-*` import in `modules/profiles/host-base.nix`.
- Keep native theme settings with the application. Explicit Kanagawa color mappings
may import `modules/capabilities/_kanagawa.nix`.
Common commands:
```console
nix fmt
nix flake check --no-build
nh os switch
sops edit modules/secrets/secrets.yaml
```
+41
View File
@@ -0,0 +1,41 @@
{
displayName = "Kanagawa Wave";
palette = {
background = "#1F1F28";
foreground = "#DCD7BA";
secondaryBackground = "#16161D";
subtleBorder = "#54546D";
selectionBackground = "#2D4F67";
selectionForeground = "#C8C093";
url = "#72A7BC";
cursor = "#C8C093";
muted = "#727169";
accents = {
blue = "#7E9CD8";
red = "#E82424";
};
terminal = {
color0 = "#16161D";
color1 = "#C34043";
color2 = "#76946A";
color3 = "#C0A36E";
color4 = "#7E9CD8";
color5 = "#957FB8";
color6 = "#6A9589";
color7 = "#C8C093";
color8 = "#727169";
color9 = "#E82424";
color10 = "#98BB6C";
color11 = "#E6C384";
color12 = "#7FB4CA";
color13 = "#938AA9";
color14 = "#7AA89F";
color15 = "#DCD7BA";
color16 = "#FFA066";
color17 = "#FF5D62";
};
};
}
@@ -0,0 +1,25 @@
{ pkgs }:
pkgs.svelte-language-server.overrideAttrs (
finalAttrs: _: {
version = "0.18.3";
src = pkgs.fetchFromGitHub {
owner = "sveltejs";
repo = "language-tools";
tag = "svelte-language-server@${finalAttrs.version}";
hash = "sha256-FTOkJPXbsG6R53yr4n0/IR2lzFCovrdV0+epOi07lBQ=";
};
pnpmDeps = pkgs.fetchPnpmDeps {
inherit (finalAttrs)
pname
version
src
pnpmWorkspaces
;
pnpm = pkgs.pnpm_10;
fetcherVersion = 3;
hash = "sha256-fY3hrCkr/soJk1gp39/jec8lT2ZJI27xRBCZi006oWA=";
};
}
)
-69
View File
@@ -1,69 +0,0 @@
{
cursor = {
name = "phinger-cursors-light";
packageName = "phinger-cursors";
size = 24;
};
kanagawa = {
displayName = "Kanagawa Wave";
name = "kanagawa-wave";
gtkThemeName = "Kanagawa-BL-LB";
iconThemeName = "Kanagawa";
owner = "Fausto-Korpsvart";
repo = "Kanagawa-GKT-Theme";
rev = "55ca4ba249eba21f861b9866b71ab41bb8930318";
hash = "sha256-UdMoMx2DoovcxSp/zBZ3PRv/Qpj+prd0uPm1gmdak2E=";
version = "unstable-2025-10-23";
palette = {
background = "#1F1F28";
foreground = "#DCD7BA";
secondaryBackground = "#16161D";
border = "#2A2A37";
selectionBackground = "#2D4F67";
selectionForeground = "#C8C093";
url = "#72A7BC";
cursor = "#C8C093";
muted = "#727169";
accents = {
blue = "#7E9CD8";
green = "#98BB6C";
magenta = "#D27E99";
orange = "#FFA066";
purple = "#957FB8";
red = "#E82424";
yellow = "#E6C384";
cyan = "#7AA89F";
};
niri.border = {
active = "#7E9CD8";
inactive = "#54546D";
urgent = "#E82424";
};
terminal = {
color0 = "#16161D";
color1 = "#C34043";
color2 = "#76946A";
color3 = "#C0A36E";
color4 = "#7E9CD8";
color5 = "#957FB8";
color6 = "#6A9589";
color7 = "#C8C093";
color8 = "#727169";
color9 = "#E82424";
color10 = "#98BB6C";
color11 = "#E6C384";
color12 = "#7FB4CA";
color13 = "#938AA9";
color14 = "#7AA89F";
color15 = "#DCD7BA";
color16 = "#FFA066";
color17 = "#FF5D62";
};
};
};
}
+2
View File
@@ -27,6 +27,8 @@ in
flake.modules.homeManager.ai = flake.modules.homeManager.ai =
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ hmModules.podman ];
services.podman = { services.podman = {
volumes = { volumes = {
grounded-docs-config = { }; grounded-docs-config = { };
+45 -41
View File
@@ -1,66 +1,72 @@
{ config, ... }: { ... }:
let
homeModules = config.flake.modules.homeManager;
in
{ {
flake.modules.homeManager.browser-vivaldi = flake.modules.homeManager.desktop-commands =
{ pkgs, ... }: { lib, ... }:
{ {
home.packages = [ pkgs.vivaldi ]; options.desktop = {
commands = {
browser = lib.mkOption {
type = lib.types.nonEmptyListOf lib.types.nonEmptyStr;
};
launcher = lib.mkOption {
type = lib.types.nonEmptyListOf lib.types.nonEmptyStr;
};
terminal = lib.mkOption {
type = lib.types.nonEmptyListOf lib.types.nonEmptyStr;
};
};
autostart = lib.mkOption {
type = lib.types.listOf (lib.types.nonEmptyListOf lib.types.nonEmptyStr);
default = [ ];
};
};
}; };
flake.modules.homeManager.primary-browser-vivaldi = flake.modules.homeManager.vivaldi =
{ lib, pkgs, ... }: { lib, pkgs, ... }:
let let
browser = pkgs.vivaldi; command = lib.getExe pkgs.vivaldi;
browserCommand = lib.getExe browser;
in in
{ {
imports = [ homeModules.browser-vivaldi ]; desktop.commands.browser = [ command ];
home = {
facts.desktop.browserCommand = browserCommand; packages = [ pkgs.vivaldi ];
home.sessionVariables.BROWSER = browserCommand; sessionVariables.BROWSER = command;
xdg.mimeApps.defaultApplicationPackages = [ browser ]; };
xdg.mimeApps.defaultApplicationPackages = [ pkgs.vivaldi ];
}; };
flake.modules.homeManager.file-manager-nautilus = flake.modules.homeManager.nautilus =
{ pkgs, ... }: { config, pkgs, ... }:
{ {
home.packages = [ pkgs.nautilus ]; home.packages = [ pkgs.nautilus ];
}; gtk.gtk3.bookmarks = [
"sftp://${config.facts.topology.server.sshAlias} Orion VPS"
flake.modules.homeManager.primary-file-manager-nautilus = ];
{ pkgs, ... }:
{
imports = [ homeModules.file-manager-nautilus ];
xdg.mimeApps.defaultApplicationPackages = [ pkgs.nautilus ]; xdg.mimeApps.defaultApplicationPackages = [ pkgs.nautilus ];
}; };
flake.modules.homeManager.image-viewer-imv = { flake.modules.homeManager.imv =
programs.imv.enable = true;
};
flake.modules.homeManager.default-image-viewer-imv =
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ homeModules.image-viewer-imv ]; programs.imv.enable = true;
xdg.mimeApps.defaultApplicationPackages = [ pkgs.imv ]; xdg.mimeApps.defaultApplicationPackages = [ pkgs.imv ];
}; };
flake.modules.homeManager.document-viewer-sioyek = { flake.modules.homeManager.sioyek =
programs.sioyek.enable = true;
};
flake.modules.homeManager.default-document-viewer-sioyek =
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ homeModules.document-viewer-sioyek ]; programs.sioyek.enable = true;
xdg.mimeApps.defaultApplicationPackages = [ pkgs.sioyek ]; xdg.mimeApps.defaultApplicationPackages = [ pkgs.sioyek ];
}; };
flake.modules.homeManager.discord = {
programs.discord = {
enable = true;
settings.SKIP_HOST_UPDATE = true;
};
};
flake.modules.homeManager.workstation-apps = flake.modules.homeManager.workstation-apps =
{ pkgs, ... }: { pkgs, ... }:
{ {
@@ -110,9 +116,7 @@ in
templates = "${localDir}/templates"; templates = "${localDir}/templates";
}; };
mimeApps = { mimeApps.enable = true;
enable = true;
};
}; };
}; };
} }
-4
View File
@@ -46,8 +46,4 @@
}; };
}; };
}; };
flake.modules.nixos.openvpn = {
programs.openvpn3.enable = true;
services.resolved.enable = true;
};
} }
+2 -1
View File
@@ -18,7 +18,8 @@ in
email = account.emails.${scope}.address; email = account.emails.${scope}.address;
key = machine.sshKeys.${scope} or null; key = machine.sshKeys.${scope} or null;
hasSigningKey = key != null; hasSigningKey = key != null;
privateKeyPath = key.privateKeyPath or "~/.ssh/id_${scope}"; privateKeyPath =
if hasSigningKey && key.privateKeyPath != null then key.privateKeyPath else "~/.ssh/id_${scope}";
in in
{ {
allowedSigners = lib.optional hasSigningKey "${email} ${key.publicKey}"; allowedSigners = lib.optional hasSigningKey "${email} ${key.publicKey}";
+14 -26
View File
@@ -1,6 +1,9 @@
{ inputs, ... }: { config, inputs, ... }:
let
homeModules = config.flake.modules.homeManager;
in
{ {
flake.modules.nixos.helix = { flake.modules.nixos.helix-cache = {
nix.settings = { nix.settings = {
extra-substituters = [ "https://helix.cachix.org" ]; extra-substituters = [ "https://helix.cachix.org" ];
extra-trusted-public-keys = [ extra-trusted-public-keys = [
@@ -12,30 +15,11 @@
flake.modules.homeManager.helix = flake.modules.homeManager.helix =
{ pkgs, ... }: { pkgs, ... }:
let let
svelteLanguageServer = pkgs.svelte-language-server.overrideAttrs ( svelteLanguageServer = (import ./_svelte-language-server.nix { inherit pkgs; }).overrideAttrs (
finalAttrs: previousAttrs: { _: previousAttrs: {
version = "0.18.3";
src = pkgs.fetchFromGitHub {
owner = "sveltejs";
repo = "language-tools";
tag = "svelte-language-server@${finalAttrs.version}";
hash = "sha256-FTOkJPXbsG6R53yr4n0/IR2lzFCovrdV0+epOi07lBQ=";
};
pnpmDeps = pkgs.fetchPnpmDeps {
inherit (finalAttrs)
pname
version
src
pnpmWorkspaces
;
pnpm = pkgs.pnpm_10;
fetcherVersion = 3;
hash = "sha256-fY3hrCkr/soJk1gp39/jec8lT2ZJI27xRBCZi006oWA=";
};
postInstall = (previousAttrs.postInstall or "") + '' postInstall = (previousAttrs.postInstall or "") + ''
# @vscode/emmet-helper only enables JSX expansion for JSX syntax;
# Helix's Svelte HTML regions also need it for HTML syntax.
substituteInPlace \ substituteInPlace \
"$out/lib/node_modules/svelte-language-server/packages/language-server/node_modules/@vscode/emmet-helper/lib/cjs/emmetHelper.js" \ "$out/lib/node_modules/svelte-language-server/packages/language-server/node_modules/@vscode/emmet-helper/lib/cjs/emmetHelper.js" \
--replace-fail \ --replace-fail \
@@ -48,7 +32,6 @@
{ {
programs.helix = { programs.helix = {
enable = true; enable = true;
defaultEditor = true;
package = inputs.helix.packages.${pkgs.stdenv.hostPlatform.system}.default; package = inputs.helix.packages.${pkgs.stdenv.hostPlatform.system}.default;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
vtsls vtsls
@@ -179,4 +162,9 @@
}; };
}; };
}; };
flake.modules.homeManager.primary-editor-helix = {
imports = [ homeModules.helix ];
programs.helix.defaultEditor = true;
};
} }
+7 -5
View File
@@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
let let
palette = config.facts.theme.kanagawa.palette; palette = (import ./_kanagawa.nix).palette;
hex = lib.removePrefix "#"; hex = lib.removePrefix "#";
terminalPalette = palette.terminal; terminalPalette = palette.terminal;
mkPalette = colors: lib.concatStringsSep ";" (map hex colors); mkPalette = colors: lib.concatStringsSep ";" (map hex colors);
@@ -9,11 +9,11 @@ in
flake.modules.nixos.limine = flake.modules.nixos.limine =
{ config, lib, ... }: { config, lib, ... }:
let let
displayValues = builtins.attrValues (config.facts.machine.displays or { }); displayValues = builtins.attrValues config.facts.machine.displays;
primaryDisplays = lib.filter (display: display.primary or false) displayValues; primaryDisplays = lib.filter (display: display.primary) displayValues;
primaryDisplay = if primaryDisplays == [ ] then null else builtins.head primaryDisplays; primaryDisplay = if primaryDisplays == [ ] then null else builtins.head primaryDisplays;
interfaceResolution = interfaceResolution =
if primaryDisplay != null && primaryDisplay ? width && primaryDisplay ? height then if primaryDisplay != null && primaryDisplay.width != null then
"${toString primaryDisplay.width}x${toString primaryDisplay.height}" "${toString primaryDisplay.width}x${toString primaryDisplay.height}"
else else
null; null;
@@ -24,7 +24,6 @@ in
limine = { limine = {
enable = true; enable = true;
maxGenerations = 10; maxGenerations = 10;
resolution = "2560x1440";
style = { style = {
backdrop = hex palette.secondaryBackground; backdrop = hex palette.secondaryBackground;
@@ -69,6 +68,9 @@ in
resolution = interfaceResolution; resolution = interfaceResolution;
}; };
}; };
}
// lib.optionalAttrs (interfaceResolution != null) {
resolution = interfaceResolution;
}; };
}; };
}; };
@@ -1,6 +1,5 @@
{ ... }:
{ {
flake.modules.nixos.locale-nl = { flake.modules.nixos.locale = {
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
+15 -37
View File
@@ -1,15 +1,9 @@
{ config, ... }: { config, ... }:
let let
account = config.facts.account; account = config.facts.account;
theme = config.facts.theme.kanagawa; homeModules = config.flake.modules.homeManager;
in in
{ {
flake.modules.homeManager.default-editor-neovim =
{ pkgs, ... }:
{
xdg.mimeApps.defaultApplicationPackages = [ pkgs.neovim ];
};
flake.modules.homeManager.neovim = flake.modules.homeManager.neovim =
{ {
pkgs, pkgs,
@@ -20,30 +14,7 @@ in
}: }:
let let
nvimTreesitter = pkgs.vimPlugins.nvim-treesitter; nvimTreesitter = pkgs.vimPlugins.nvim-treesitter;
svelteLanguageServer = pkgs.svelte-language-server.overrideAttrs ( svelteLanguageServer = import ../_svelte-language-server.nix { inherit pkgs; };
finalAttrs: _: {
version = "0.18.3";
src = pkgs.fetchFromGitHub {
owner = "sveltejs";
repo = "language-tools";
tag = "svelte-language-server@${finalAttrs.version}";
hash = "sha256-FTOkJPXbsG6R53yr4n0/IR2lzFCovrdV0+epOi07lBQ=";
};
pnpmDeps = pkgs.fetchPnpmDeps {
inherit (finalAttrs)
pname
version
src
pnpmWorkspaces
;
pnpm = pkgs.pnpm_10;
fetcherVersion = 3;
hash = "sha256-fY3hrCkr/soJk1gp39/jec8lT2ZJI27xRBCZi006oWA=";
};
}
);
svelteGrammar = nvimTreesitter.builtGrammars.svelte.overrideAttrs (_: { svelteGrammar = nvimTreesitter.builtGrammars.svelte.overrideAttrs (_: {
version = "0.0.0+rev=c2457b9"; version = "0.0.0+rev=c2457b9";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
@@ -61,11 +32,6 @@ in
); );
in in
{ {
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
imports = [ imports = [
(inputs.nix-wrapper-modules.lib.getInstallModule { (inputs.nix-wrapper-modules.lib.getInstallModule {
name = "neovim"; name = "neovim";
@@ -195,7 +161,7 @@ in
}; };
themeSetup = import ./_kanagawa-theme.nix { themeSetup = import ./_kanagawa-theme.nix {
themeName = theme.name; themeName = "kanagawa-wave";
}; };
typstPreviewDependencies = { typstPreviewDependencies = {
@@ -209,4 +175,16 @@ in
binName = "nvim"; binName = "nvim";
}; };
}; };
flake.modules.homeManager.primary-editor-neovim =
{ pkgs, ... }:
{
imports = [ homeModules.neovim ];
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
xdg.mimeApps.defaultApplicationPackages = [ pkgs.neovim ];
};
} }
+6 -7
View File
@@ -8,13 +8,12 @@ in
}; };
flake.modules.nixos.network-manager = { flake.modules.nixos.network-manager = {
networking = { networking.networkmanager.enable = true;
networkmanager.enable = true; };
firewall.allowedTCPPorts = [
5173 flake.modules.nixos.openvpn = {
5174 programs.openvpn3.enable = true;
]; services.resolved.enable = true;
};
}; };
flake.modules.nixos.server-firewall = flake.modules.nixos.server-firewall =
+6 -11
View File
@@ -1,29 +1,24 @@
{ {
browserCommand, browser,
launcherCommand, launcher,
shortcutCommands, shortcutCommands,
terminalCommand, terminal,
}: }:
{ {
# Application and utility launchers # Application and utility launchers
"Mod+Return" = { "Mod+Return" = {
action.spawn = terminalCommand; action.spawn = terminal;
hotkey-overlay.title = "Terminal"; hotkey-overlay.title = "Terminal";
}; };
"Mod+B" = { "Mod+B" = {
action.spawn = browserCommand; action.spawn = browser;
hotkey-overlay.title = "Browser"; hotkey-overlay.title = "Browser";
}; };
"Mod+Space" = { "Mod+Space" = {
repeat = false; repeat = false;
action.spawn = launcherCommand; action.spawn = launcher;
hotkey-overlay.title = "App Launcher"; hotkey-overlay.title = "App Launcher";
}; };
"Mod+E" = {
repeat = false;
action.spawn = shortcutCommands.neovimProjects;
hotkey-overlay.title = "Neovim Projects";
};
"Mod+Ctrl+Return" = { "Mod+Ctrl+Return" = {
repeat = false; repeat = false;
action.spawn = shortcutCommands.nixosTerminal; action.spawn = shortcutCommands.nixosTerminal;
+2 -10
View File
@@ -1,11 +1,10 @@
{ {
config, config,
facts,
lib, lib,
pkgs, pkgs,
}: }:
let let
nixosConfigDir = facts.account.nixosConfigurationPath; nixosConfigDir = config.facts.account.nixosConfigurationPath;
mkTerminalScript = mkTerminalScript =
{ {
name, name,
@@ -28,7 +27,7 @@ let
text = lib.concatStringsSep "\n" [ text = lib.concatStringsSep "\n" [
"# shellcheck disable=SC2016" "# shellcheck disable=SC2016"
"cd ${lib.escapeShellArg workdir}" "cd ${lib.escapeShellArg workdir}"
"exec ${lib.escapeShellArg config.facts.desktop.terminalCommand} ${argString}" "exec ${lib.escapeShellArgs config.desktop.commands.terminal} ${argString}"
]; ];
}; };
in in
@@ -83,13 +82,6 @@ rec {
''; '';
}; };
neovimProjects = mkTerminalScript {
name = "niri-shortcut-neovim-projects";
command = ''
nvim -c 'Telescope projects'
'';
};
pickColor = pkgs.writeShellApplication { pickColor = pkgs.writeShellApplication {
name = "niri-shortcut-pick-color"; name = "niri-shortcut-pick-color";
runtimeInputs = [ runtimeInputs = [
+19 -18
View File
@@ -4,7 +4,7 @@
... ...
}: }:
let let
facts = config.facts; kanagawa = import ../_kanagawa.nix;
hmModules = config.flake.modules.homeManager; hmModules = config.flake.modules.homeManager;
in in
{ {
@@ -41,11 +41,10 @@ in
... ...
}: }:
let let
borderPalette = facts.theme.kanagawa.palette.niri.border; palette = kanagawa.palette;
shortcuts = import ./_shortcuts.nix { shortcuts = import ./_shortcuts.nix {
inherit inherit
config config
facts
lib lib
pkgs pkgs
; ;
@@ -60,6 +59,7 @@ in
[ [
playerctl playerctl
brightnessctl brightnessctl
wireplumber
xwayland-satellite xwayland-satellite
] ]
++ lib.attrValues shortcuts.scripts; ++ lib.attrValues shortcuts.scripts;
@@ -72,17 +72,16 @@ in
_: display: _: display:
{ {
position = { position = {
x = display.x or 0; inherit (display) x y;
y = display.y or 0;
}; };
} }
// lib.optionalAttrs (display.primary or false) { // lib.optionalAttrs display.primary {
"focus-at-startup" = true; "focus-at-startup" = true;
} }
// lib.optionalAttrs (display ? scale) { // lib.optionalAttrs (display.scale != null) {
inherit (display) scale; inherit (display) scale;
} }
// lib.optionalAttrs (display ? width && display ? height && display ? refresh) { // lib.optionalAttrs (display.width != null) {
mode = { mode = {
inherit (display) inherit (display)
height height
@@ -95,16 +94,16 @@ in
environment.DISPLAY = ":0"; environment.DISPLAY = ":0";
spawn-at-startup = [ spawn-at-startup = [
{ command = [ "xwayland-satellite" ]; } { command = [ (lib.getExe pkgs.xwayland-satellite) ]; }
{ command = [ "noctalia" ]; } ]
]; ++ map (command: { inherit command; }) config.desktop.autostart;
prefer-no-csd = true; prefer-no-csd = true;
hotkey-overlay.skip-at-startup = true; hotkey-overlay.skip-at-startup = true;
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%dT%H:%M:%S.png"; screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%dT%H:%M:%S.png";
animations.slowdown = 0.6; animations.slowdown = 0.6;
cursor = { cursor = lib.mkIf config.home.pointerCursor.enable {
inherit (config.home.pointerCursor) size; inherit (config.home.pointerCursor) size;
theme = config.home.pointerCursor.name; theme = config.home.pointerCursor.name;
hide-after-inactive-ms = 3000; hide-after-inactive-ms = 3000;
@@ -120,9 +119,9 @@ in
border = { border = {
enable = true; enable = true;
width = 3; width = 3;
active.color = borderPalette.active; active.color = palette.accents.blue;
inactive.color = borderPalette.inactive; inactive.color = palette.subtleBorder;
urgent.color = borderPalette.urgent; urgent.color = palette.accents.red;
}; };
}; };
@@ -157,9 +156,11 @@ in
}; };
binds = import ./_bindings.nix { binds = import ./_bindings.nix {
browserCommand = config.facts.desktop.browserCommand; inherit (config.desktop.commands)
launcherCommand = config.facts.desktop.launcherCommand; browser
terminalCommand = config.facts.desktop.terminalCommand; launcher
terminal
;
shortcutCommands = shortcuts.commands; shortcutCommands = shortcuts.commands;
}; };
}; };
+5 -40
View File
@@ -9,27 +9,12 @@
let let
homeDir = config.home.homeDirectory; homeDir = config.home.homeDirectory;
wallpaper = "${homeDir}/media/images/wallpapers/green-leaves.png"; wallpaper = "${homeDir}/media/images/wallpapers/green-leaves.png";
loginBox = output: {
box_height = 70.0;
box_width = 400.0;
cx = 1280.0;
cy = 1317.0;
inherit output;
rotation = 0.0;
type = "login_box";
settings = {
background_color = "surface_variant";
background_opacity = 0.88;
background_radius = 12.0;
input_opacity = 1.0;
input_radius = 6.0;
show_login_button = true;
};
};
in in
{ {
imports = [ inputs.noctalia.homeModules.default ]; imports = [ inputs.noctalia.homeModules.default ];
desktop.autostart = [ [ (lib.getExe config.programs.noctalia.package) ] ];
programs.noctalia = { programs.noctalia = {
enable = true; enable = true;
settings = { settings = {
@@ -49,7 +34,7 @@
"bluetooth" "bluetooth"
"volume" "volume"
] ]
++ lib.optionals config.facts.machine.portable [ ++ lib.optionals (config.facts.machine.name == "zenith") [
"network" "network"
"battery" "battery"
] ]
@@ -70,7 +55,7 @@
account.radicale = { account.radicale = {
name = "Personal"; name = "Personal";
provider = "custom"; provider = "custom";
server_url = config.facts.services.radicale.url; server_url = "${config.facts.services.radicale.origin}/";
type = "caldav"; type = "caldav";
username = config.facts.account.name; username = config.facts.account.name;
}; };
@@ -97,23 +82,7 @@
tint_intensity = 0.5; tint_intensity = 0.5;
}; };
lockscreen_widgets = { lockscreen_widgets.enabled = true;
enabled = true;
schema_version = 2;
widget_order = [
"lockscreen-login-box@DP-2"
"lockscreen-login-box@DP-3"
];
grid = {
cell_size = 16;
major_interval = 4;
visible = true;
};
widget = {
"lockscreen-login-box@DP-2" = loginBox "DP-2";
"lockscreen-login-box@DP-3" = loginBox "DP-3";
};
};
nightlight = { nightlight = {
enabled = true; enabled = true;
@@ -168,10 +137,6 @@
directory = "${homeDir}/media/images/wallpapers"; directory = "${homeDir}/media/images/wallpapers";
default.path = wallpaper; default.path = wallpaper;
last.path = wallpaper; last.path = wallpaper;
monitors = {
DP-2.path = wallpaper;
DP-3.path = wallpaper;
};
}; };
weather.refresh_minutes = 15; weather.refresh_minutes = 15;
+2 -2
View File
@@ -19,8 +19,8 @@ in
programs.rbw = { programs.rbw = {
enable = true; enable = true;
settings = { settings = {
base_url = facts.services.vaultwarden.url; base_url = facts.services.vaultwarden.origin;
email = account.primaryEmail.address; email = account.emails.${account.primaryEmail}.address;
pinentry = pinentryPackage; pinentry = pinentryPackage;
}; };
}; };
+12 -13
View File
@@ -5,6 +5,7 @@
let let
facts = config.facts; facts = config.facts;
account = facts.account; account = facts.account;
homeModules = config.flake.modules.homeManager;
in in
{ {
flake.modules.homeManager.email = flake.modules.homeManager.email =
@@ -17,12 +18,11 @@ in
mkOffice365Account = mkOffice365Account =
{ {
address, address,
primary ? false,
... ...
}: }:
{ {
enable = true; enable = true;
inherit address primary; inherit address;
realName = account.realName; realName = account.realName;
userName = address; userName = address;
thunderbird = { thunderbird = {
@@ -37,12 +37,11 @@ in
mkMxrouteAccount = mkMxrouteAccount =
{ {
address, address,
primary ? false,
... ...
}: }:
{ {
enable = true; enable = true;
inherit address primary; inherit address;
realName = account.realName; realName = account.realName;
userName = address; userName = address;
thunderbird.enable = true; thunderbird.enable = true;
@@ -60,13 +59,11 @@ in
}; };
}; };
mkEmailAccount = mkEmailAccount =
email: name: email:
if email.type == "office365" then (if email.type == "office365" then mkOffice365Account email else mkMxrouteAccount email)
mkOffice365Account email // {
else if email.type == "mxrouting" then primary = name == account.primaryEmail;
mkMxrouteAccount email };
else
throw "Unsupported email type `${email.type}` for ${config.home.username}";
in in
{ {
programs.thunderbird = { programs.thunderbird = {
@@ -87,7 +84,7 @@ in
}; };
}; };
accounts.email.accounts = lib.mapAttrs (_: mkEmailAccount) account.emails; accounts.email.accounts = lib.mapAttrs mkEmailAccount account.emails;
}; };
flake.modules.homeManager.calendar-tasks = flake.modules.homeManager.calendar-tasks =
@@ -100,6 +97,8 @@ in
calendarsPath = "${config.xdg.dataHome}/calendars"; calendarsPath = "${config.xdg.dataHome}/calendars";
in in
{ {
imports = [ homeModules.sops ];
programs.pimsync.enable = true; programs.pimsync.enable = true;
services.pimsync.enable = true; services.pimsync.enable = true;
@@ -138,7 +137,7 @@ in
}; };
remote = { remote = {
url = facts.services.radicale.url; url = "${facts.services.radicale.origin}/";
type = "caldav"; type = "caldav";
userName = config.home.username; userName = config.home.username;
passwordCommand = [ passwordCommand = [
+2 -6
View File
@@ -1,11 +1,7 @@
{ config, ... }:
let
account = config.facts.account;
in
{ {
flake.modules.nixos.qbittorrent = flake.modules.homeManager.qbittorrent =
{ pkgs, ... }: { pkgs, ... }:
{ {
home-manager.users.${account.name}.home.packages = [ pkgs.qbittorrent ]; home.packages = [ pkgs.qbittorrent ];
}; };
} }
+4
View File
@@ -16,6 +16,10 @@
extraPackages = with pkgs; [ extraPackages = with pkgs; [
kdePackages.qtmultimedia kdePackages.qtmultimedia
]; ];
settings.Theme = {
CursorTheme = "phinger-cursors-light";
CursorSize = 24;
};
}; };
}; };
} }
+6 -4
View File
@@ -1,19 +1,21 @@
{ config, ... }: { config, ... }:
let let
service = config.facts.services.actual; service = config.facts.services.actual;
nixosModules = config.flake.modules.nixos;
in in
{ {
flake.modules.nixos.actual = { flake.modules.nixos.actual = {
imports = [ nixosModules.caddy ];
services.actual = { services.actual = {
enable = true; enable = true;
openFirewall = false; openFirewall = false;
settings = { settings = {
inherit (service) port; hostname = "127.0.0.1";
hostname = service.host; port = 3000;
}; };
}; };
services.caddy.virtualHosts.${service.domain}.extraConfig = services.caddy.virtualHosts.${service.domain}.extraConfig = "reverse_proxy 127.0.0.1:3000";
"reverse_proxy :${toString service.port}";
}; };
} }
+1 -1
View File
@@ -6,7 +6,7 @@ in
flake.modules.nixos.caddy = { flake.modules.nixos.caddy = {
services.caddy = { services.caddy = {
enable = true; enable = true;
email = facts.account.primaryEmail.address; email = facts.account.emails.${facts.account.primaryEmail}.address;
openFirewall = true; openFirewall = true;
}; };
}; };
+10 -5
View File
@@ -1,18 +1,24 @@
{ config, ... }: { config, ... }:
let let
service = config.facts.services.gitea; service = config.facts.services.gitea;
nixosModules = config.flake.modules.nixos;
in in
{ {
flake.modules.nixos.gitea = { flake.modules.nixos.gitea = {
imports = [
nixosModules.caddy
nixosModules.openssh
];
services.gitea = { services.gitea = {
enable = true; enable = true;
settings = { settings = {
server = { server = {
DOMAIN = service.domain; DOMAIN = service.domain;
ROOT_URL = service.url; ROOT_URL = "${service.origin}/";
HTTP_PORT = service.port; HTTP_PORT = 3001;
HTTP_ADDR = service.host; HTTP_ADDR = "127.0.0.1";
START_SSH_SERVER = false; START_SSH_SERVER = false;
SSH_PORT = 22; SSH_PORT = 22;
@@ -24,7 +30,6 @@ in
services.openssh.settings.AllowUsers = [ "gitea" ]; services.openssh.settings.AllowUsers = [ "gitea" ];
services.caddy.virtualHosts.${service.domain}.extraConfig = services.caddy.virtualHosts.${service.domain}.extraConfig = "reverse_proxy 127.0.0.1:3001";
"reverse_proxy :${toString service.port}";
}; };
} }
+2 -2
View File
@@ -3,8 +3,8 @@ let
account = config.facts.account; account = config.facts.account;
personalPublicKeys = personalPublicKeys =
machines: machines:
map (machine: (machine.sshKeys or { }).personal.publicKey) ( map (machine: machine.sshKeys.personal.publicKey) (
lib.filter (machine: (machine.sshKeys or { }) ? personal) (builtins.attrValues machines) lib.filter (machine: machine.sshKeys ? personal) (builtins.attrValues machines)
); );
in in
{ {
+5 -2
View File
@@ -1,13 +1,16 @@
{ config, ... }: { config, ... }:
let let
service = config.facts.services.radicale; service = config.facts.services.radicale;
nixosModules = config.flake.modules.nixos;
in in
{ {
flake.modules.nixos.radicale = { flake.modules.nixos.radicale = {
imports = [ nixosModules.caddy ];
services.radicale = { services.radicale = {
enable = true; enable = true;
settings = { settings = {
server.hosts = [ "${service.host}:${toString service.port}" ]; server.hosts = [ "127.0.0.1:5232" ];
auth = { auth = {
type = "htpasswd"; type = "htpasswd";
@@ -20,7 +23,7 @@ in
}; };
services.caddy.virtualHosts.${service.domain}.extraConfig = '' services.caddy.virtualHosts.${service.domain}.extraConfig = ''
reverse_proxy :${toString service.port} { reverse_proxy 127.0.0.1:5232 {
header_up X-Script-Name / header_up X-Script-Name /
header_up X-Forwarded-For {remote} header_up X-Forwarded-For {remote}
header_up X-Remote-User {http.auth.user.id} header_up X-Remote-User {http.auth.user.id}
@@ -1,21 +1,24 @@
{ config, ... }: { config, ... }:
let let
service = config.facts.services.vaultwarden; service = config.facts.services.vaultwarden;
nixosModules = config.flake.modules.nixos;
in in
{ {
flake.modules.nixos.vaultwarden = { flake.modules.nixos.vaultwarden = {
imports = [ nixosModules.caddy ];
services.vaultwarden = { services.vaultwarden = {
enable = true; enable = true;
backupDir = "/var/backup/vaultwarden"; backupDir = "/var/backup/vaultwarden";
config = { config = {
DOMAIN = service.url; DOMAIN = service.origin;
SIGNUPS_ALLOWED = false; SIGNUPS_ALLOWED = false;
ROCKET_PORT = service.port; ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8100;
ROCKET_LOG = "critical"; ROCKET_LOG = "critical";
}; };
}; };
services.caddy.virtualHosts.${service.domain}.extraConfig = services.caddy.virtualHosts.${service.domain}.extraConfig = "reverse_proxy 127.0.0.1:8100";
"reverse_proxy :${toString service.port}";
}; };
} }
+18 -11
View File
@@ -1,13 +1,20 @@
{ ... }: { ... }:
{ {
flake.modules.nixos.vps-insights = flake.modules.nixos.vps-insights =
{ config, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
localAddress = "127.0.0.1"; localAddress = "127.0.0.1";
grafanaDataDir = config.services.grafana.dataDir; grafanaDataDir = config.services.grafana.dataDir;
lokiDataDir = config.services.loki.dataDir; lokiDataDir = config.services.loki.dataDir;
lokiUrl = "http://${localAddress}:3100"; lokiUrl = "http://${localAddress}:3100";
prometheusUrl = "http://${localAddress}:9090"; prometheusUrl = "http://${localAddress}:9090";
hasCaddy = config.services.caddy.enable;
hasOpenSSH = config.services.openssh.enable;
in in
{ {
environment = { environment = {
@@ -64,21 +71,17 @@
# Detect and block common attacks against SSH and Caddy. # Detect and block common attacks against SSH and Caddy.
crowdsec = { crowdsec = {
enable = true; enable = true;
hub.collections = [ hub.collections = [ "crowdsecurity/linux" ] ++ lib.optional hasCaddy "crowdsecurity/caddy";
"crowdsecurity/linux" localConfig.acquisitions =
"crowdsecurity/caddy" lib.optional hasOpenSSH {
];
localConfig.acquisitions = [
{
source = "journalctl"; source = "journalctl";
journalctl_filter = [ "_SYSTEMD_UNIT=sshd.service" ]; journalctl_filter = [ "_SYSTEMD_UNIT=sshd.service" ];
labels.type = "syslog"; labels.type = "syslog";
} }
{ ++ lib.optional hasCaddy {
filenames = [ "/var/log/caddy/*.log" ]; filenames = [ "/var/log/caddy/*.log" ];
labels.type = "caddy"; labels.type = "caddy";
} };
];
}; };
crowdsec-firewall-bouncer = { crowdsec-firewall-bouncer = {
@@ -86,11 +89,15 @@
registerBouncer.bouncerName = "${config.networking.hostName}-firewall-bouncer"; registerBouncer.bouncerName = "${config.networking.hostName}-firewall-bouncer";
}; };
# Grafana defaults to 127.0.0.1:3000; add secrets and datasources only. # Keep Grafana local and separate from Actual's port.
grafana = { grafana = {
enable = true; enable = true;
settings = { settings = {
analytics.reporting_enabled = false; analytics.reporting_enabled = false;
server = {
http_addr = localAddress;
http_port = 3002;
};
security = { security = {
admin_password = "$__file{${grafanaDataDir}/admin-password}"; admin_password = "$__file{${grafanaDataDir}/admin-password}";
secret_key = "$__file{${grafanaDataDir}/secret-key}"; secret_key = "$__file{${grafanaDataDir}/secret-key}";
+7 -7
View File
@@ -7,6 +7,10 @@
pkgs, pkgs,
... ...
}: }:
let
gardenctl = "${config.home.homeDirectory}/.garden/gardenctl";
uuidgen = lib.getExe' pkgs.util-linux "uuidgen";
in
{ {
home.sessionVariables = { home.sessionVariables = {
STARSHIP_CACHE = "${config.xdg.cacheHome}/starship"; STARSHIP_CACHE = "${config.xdg.cacheHome}/starship";
@@ -62,16 +66,12 @@
''; '';
initContent = '' initContent = ''
source <(/home/kiri/.garden/gardenctl completion zsh) source <(${gardenctl} completion zsh)
[ -n "$GCTL_SESSION_ID" ] || [ -n "$TERM_SESSION_ID" ] || export GCTL_SESSION_ID=$(uuidgen)
if [ -z "$GCTL_SESSION_ID" ] && [ -z "$TERM_SESSION_ID" ]; then if [ -z "$GCTL_SESSION_ID" ] && [ -z "$TERM_SESSION_ID" ]; then
export GCTL_SESSION_ID=$(uuidgen) export GCTL_SESSION_ID=$(${uuidgen})
fi fi
eval $(/home/kiri/.garden/gardenctl kubectl-env zsh) eval $(${gardenctl} kubectl-env zsh)
bindkey -v bindkey -v
+14 -5
View File
@@ -1,19 +1,28 @@
{ config, ... }:
let
homeModules = config.flake.modules.homeManager;
in
{ {
flake.modules.homeManager.ssh-client = flake.modules.homeManager.ssh-client =
{ config, ... }: { config, ... }:
let
server = config.facts.topology.server;
in
{ {
imports = [ homeModules.sops ];
programs.ssh = { programs.ssh = {
enable = true; enable = true;
enableDefaultConfig = false; enableDefaultConfig = false;
includes = [ includes = [
config.sops.templates."ssh-config-orion".path config.sops.templates."ssh-config-${server.machine}".path
]; ];
}; };
sops.secrets."orion-ip" = { }; sops.secrets."${server.machine}-ip" = { };
sops.templates."ssh-config-orion".content = '' sops.templates."ssh-config-${server.machine}".content = ''
Host orion Host ${server.sshAlias}
HostName ${config.sops.placeholder."orion-ip"} HostName ${config.sops.placeholder."${server.machine}-ip"}
ForwardAgent yes ForwardAgent yes
''; '';
}; };
+13 -11
View File
@@ -14,20 +14,18 @@ let
inherit name; inherit name;
id = machine.syncthingId; id = machine.syncthingId;
} }
) (lib.filterAttrs (_: machine: (machine.syncthingId or null) != null) config.facts.machines); ) (lib.filterAttrs (_: machine: machine.syncthingId != null) config.facts.machines);
syncPhones = { syncExternalDevices = lib.mapAttrs (name: device: {
"pixel-10" = { inherit name;
name = "pixel-10"; id = device.syncthingId;
id = "MTJHEHA-UMZDQZ7-BTMRRLQ-Y7BFPUJ-ZTY6LZX-PDXV3IS-XVJCU7B-EPETBQZ"; }) (lib.filterAttrs (_: device: device.syncthingId != null) config.facts.externalDevices);
};
};
syncDevices = syncMachines // syncPhones; syncDevices = syncMachines // syncExternalDevices;
in in
{ {
flake.modules.homeManager.syncthing = flake.modules.homeManager.syncthing =
{ ... }: { config, ... }:
{ {
services.syncthing = { services.syncthing = {
enable = true; enable = true;
@@ -38,12 +36,16 @@ in
settings = { settings = {
folders = { folders = {
sync = { sync = {
path = "~/sync"; path = "${config.home.homeDirectory}/sync";
label = "sync"; label = "sync";
devices = builtins.attrNames syncDevices; devices = builtins.attrNames syncDevices;
}; };
bruno = { bruno = {
path = "~/dev/bruno"; path =
if config.facts.machine.name == "orion" then
"${config.home.homeDirectory}/bruno"
else
"${config.xdg.userDirs.projects}/bruno";
label = "bruno"; label = "bruno";
devices = builtins.attrNames syncDevices; devices = builtins.attrNames syncDevices;
}; };
+10 -13
View File
@@ -1,6 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
let let
facts = config.facts; kanagawa = import ./_kanagawa.nix;
homeModules = config.flake.modules.homeManager;
kittySingleInstance = kittySingleInstance =
pkgs: pkgs:
@@ -25,13 +26,12 @@ in
... ...
}: }:
let let
palette = facts.theme.kanagawa.palette; palette = kanagawa.palette;
hex = lib.removePrefix "#"; hex = lib.removePrefix "#";
in in
{ {
programs.foot = { programs.foot = {
enable = true; enable = true;
package = pkgs.foot;
settings = { settings = {
main = { main = {
font = "JetBrains Mono:style=Medium:size=11:fontfeatures=-liga:fontfeatures=-calt"; font = "JetBrains Mono:style=Medium:size=11:fontfeatures=-liga:fontfeatures=-calt";
@@ -86,7 +86,7 @@ in
flake.modules.homeManager.terminal-kitty = flake.modules.homeManager.terminal-kitty =
{ pkgs, ... }: { pkgs, ... }:
let let
theme = facts.theme.kanagawa; theme = kanagawa;
palette = theme.palette; palette = theme.palette;
kitty = kittySingleInstance pkgs; kitty = kittySingleInstance pkgs;
in in
@@ -167,11 +167,11 @@ in
}; };
flake.modules.homeManager.primary-terminal-foot = flake.modules.homeManager.primary-terminal-foot =
{ lib, pkgs, ... }: { config, lib, ... }:
{ {
imports = [ config.flake.modules.homeManager.terminal-foot ]; imports = [ homeModules.terminal-foot ];
facts.desktop.terminalCommand = lib.getExe pkgs.foot; desktop.commands.terminal = [ (lib.getExe config.programs.foot.package) ];
xdg.terminal-exec = { xdg.terminal-exec = {
enable = true; enable = true;
@@ -180,14 +180,11 @@ in
}; };
flake.modules.homeManager.primary-terminal-kitty = flake.modules.homeManager.primary-terminal-kitty =
{ lib, pkgs, ... }: { config, lib, ... }:
let
kitty = kittySingleInstance pkgs;
in
{ {
imports = [ config.flake.modules.homeManager.terminal-kitty ]; imports = [ homeModules.terminal-kitty ];
facts.desktop.terminalCommand = lib.getExe kitty; desktop.commands.terminal = [ (lib.getExe config.programs.kitty.package) ];
xdg.terminal-exec = { xdg.terminal-exec = {
enable = true; enable = true;
+22 -47
View File
@@ -1,58 +1,36 @@
{ { config, ... }:
config,
...
}:
let let
facts = config.facts;
hmModules = config.flake.modules.homeManager; hmModules = config.flake.modules.homeManager;
mkCursorTheme = cursor = {
pkgs: name = "phinger-cursors-light";
facts.theme.cursor packageName = "phinger-cursors";
// { size = 24;
package = pkgs.${facts.theme.cursor.packageName}; };
}; mkCursor = pkgs: cursor // { package = pkgs.${cursor.packageName}; };
in in
{ {
flake.modules.nixos.theme = flake.modules.nixos.theme =
{ { pkgs, ... }:
pkgs,
...
}:
let let
cursorTheme = mkCursorTheme pkgs; cursorTheme = mkCursor pkgs;
in in
{ {
home-manager.sharedModules = [ hmModules.theme ]; home-manager.sharedModules = [ hmModules.theme ];
environment.systemPackages = [ cursorTheme.package ]; environment.systemPackages = [ cursorTheme.package ];
services.displayManager.sddm.settings = {
Theme = {
CursorTheme = cursorTheme.name;
CursorSize = cursorTheme.size;
};
};
}; };
flake.modules.homeManager.theme = flake.modules.homeManager.theme =
{ config, pkgs, ... }: { pkgs, ... }:
let let
theme = facts.theme; cursorTheme = mkCursor pkgs;
cursorTheme = mkCursorTheme pkgs; version = "unstable-2025-10-23";
src = pkgs.fetchFromGitHub {
kanagawaThemeSrc = pkgs.fetchFromGitHub { owner = "Fausto-Korpsvart";
inherit (theme.kanagawa) repo = "Kanagawa-GKT-Theme";
hash rev = "55ca4ba249eba21f861b9866b71ab41bb8930318";
owner hash = "sha256-UdMoMx2DoovcxSp/zBZ3PRv/Qpj+prd0uPm1gmdak2E=";
repo
rev
;
};
kanagawaOverride = {
version = theme.kanagawa.version;
src = kanagawaThemeSrc;
}; };
override = { inherit src version; };
in in
{ {
home.pointerCursor = { home.pointerCursor = {
@@ -68,17 +46,14 @@ in
gtk = { gtk = {
enable = true; enable = true;
gtk3.bookmarks = [
"sftp://orion Orion VPS"
];
theme = { theme = {
name = theme.kanagawa.gtkThemeName; name = "Kanagawa-BL-LB";
package = pkgs.kanagawa-gtk-theme.overrideAttrs (_: kanagawaOverride); package = pkgs.kanagawa-gtk-theme.overrideAttrs (_: override);
}; };
gtk4.theme = null; gtk4.theme = null;
iconTheme = { iconTheme = {
name = theme.kanagawa.iconThemeName; name = "Kanagawa";
package = pkgs.kanagawa-icon-theme.overrideAttrs (_: kanagawaOverride); package = pkgs.kanagawa-icon-theme.overrideAttrs (_: override);
}; };
}; };
+16 -23
View File
@@ -3,7 +3,9 @@ let
homeModules = config.flake.modules.homeManager; homeModules = config.flake.modules.homeManager;
in in
{ {
flake.modules.nixos.walker-cache = { flake.modules.nixos.walker = {
home-manager.sharedModules = [ homeModules.walker ];
nix.settings = { nix.settings = {
extra-substituters = [ extra-substituters = [
"https://walker.cachix.org" "https://walker.cachix.org"
@@ -16,14 +18,22 @@ in
}; };
}; };
flake.modules.homeManager.walker-base = flake.modules.homeManager.walker =
{ { lib, pkgs, ... }:
config, let
... launcher = pkgs.writeShellApplication {
}: name = "walker-launcher";
runtimeInputs = [ pkgs.libressl.nc ];
text = ''
exec nc -U "$XDG_RUNTIME_DIR/walker/walker.sock"
'';
};
in
{ {
imports = [ inputs.walker.homeManagerModules.default ]; imports = [ inputs.walker.homeManagerModules.default ];
desktop.commands.launcher = [ (lib.getExe launcher) ];
programs.walker = { programs.walker = {
enable = true; enable = true;
runAsService = true; runAsService = true;
@@ -36,21 +46,4 @@ in
]; ];
}; };
}; };
flake.modules.homeManager.primary-launcher-walker =
{
config,
lib,
pkgs,
...
}:
{
imports = [ homeModules.walker-base ];
facts.desktop.launcherCommand = [
(lib.getExe' pkgs.libressl.nc "nc")
"-U"
"/run/user/1000/walker/walker.sock"
];
};
} }
+7 -2
View File
@@ -3,8 +3,13 @@
{ config, ... }: { config, ... }:
{ {
security.pki.certificateFiles = [ security.pki.certificateFiles = [
../hosts/zenith/mkcert-rootCA.pem ./yookr-dev/zenith-rootCA.pem
../hosts/polaris/mkcert-rootCA.pem ./yookr-dev/polaris-rootCA.pem
];
networking.firewall.allowedTCPPorts = [
5173
5174
]; ];
networking.extraHosts = '' networking.extraHosts = ''
@@ -1,5 +1,5 @@
{ {
flake.modules.nixos.hidraw-access = { flake.modules.nixos.yunzi-b75-pro = {
services.udev.extraRules = '' services.udev.extraRules = ''
# ROYUAN YUNZII B75 PRO # ROYUAN YUNZII B75 PRO
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3151", ATTRS{idProduct}=="4015", MODE="0660", GROUP="users" KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3151", ATTRS{idProduct}=="4015", MODE="0660", GROUP="users"
+209 -32
View File
@@ -1,14 +1,193 @@
{ lib, ... }: { lib, ... }:
let let
factsOption = lib.mkOption { inherit (lib) mkOption types;
type = lib.types.submodule {
freeformType = lib.types.attrsOf lib.types.anything; emailType = types.submodule {
options = {
address = mkOption { type = types.nonEmptyStr; };
type = mkOption {
type = types.enum [
"mxrouting"
"office365"
];
};
}; };
default = { };
}; };
accountType = types.submodule {
options = {
name = mkOption { type = types.nonEmptyStr; };
realName = mkOption { type = types.nonEmptyStr; };
homeDirectory = mkOption { type = types.nonEmptyStr; };
nixosConfigurationPath = mkOption { type = types.nonEmptyStr; };
emails = mkOption { type = types.attrsOf emailType; };
primaryEmail = mkOption { type = types.nonEmptyStr; };
};
};
accountOption = mkOption {
type = accountType;
apply =
account:
assert lib.assertMsg (builtins.hasAttr account.primaryEmail account.emails)
"facts.account.primaryEmail must name an entry in facts.account.emails";
account;
};
sshKeyType = types.submodule {
options = {
publicKey = mkOption { type = types.nonEmptyStr; };
privateKeyPath = mkOption {
type = types.nullOr types.nonEmptyStr;
default = null;
};
};
};
displayType = types.submodule {
options = {
x = mkOption {
type = types.int;
default = 0;
};
y = mkOption {
type = types.int;
default = 0;
};
primary = mkOption {
type = types.bool;
default = false;
};
scale = mkOption {
type = types.nullOr types.number;
default = null;
};
width = mkOption {
type = types.nullOr types.ints.positive;
default = null;
};
height = mkOption {
type = types.nullOr types.ints.positive;
default = null;
};
refresh = mkOption {
type = types.nullOr types.number;
default = null;
};
};
};
displaysOption = mkOption {
type = types.attrsOf displayType;
default = { };
apply =
displays:
assert lib.assertMsg (lib.all (
display:
let
values = [
display.width
display.height
display.refresh
];
in
lib.all (value: value == null) values || lib.all (value: value != null) values
) (builtins.attrValues displays)) "display width, height, and refresh must be supplied together";
displays;
};
machineType =
{
withName ? false,
}:
types.submodule (
{ config, ... }:
{
options = {
system = mkOption { type = types.nonEmptyStr; };
stateVersion = mkOption { type = types.nonEmptyStr; };
hmStateVersion = mkOption {
type = types.nonEmptyStr;
default = config.stateVersion;
};
syncthingId = mkOption {
type = types.nullOr types.nonEmptyStr;
default = null;
};
sshKeys = mkOption {
type = types.attrsOf sshKeyType;
default = { };
};
displays = displaysOption;
}
// lib.optionalAttrs withName {
name = mkOption { type = types.nonEmptyStr; };
};
}
);
endpointType = types.submodule (
{ config, ... }:
{
options = {
scheme = mkOption {
type = types.enum [
"http"
"https"
];
};
domain = mkOption { type = types.nonEmptyStr; };
origin = mkOption {
type = types.nonEmptyStr;
readOnly = true;
default = "${config.scheme}://${config.domain}";
};
};
}
);
externalDeviceType = types.submodule {
options.syncthingId = mkOption {
type = types.nullOr types.nonEmptyStr;
default = null;
};
};
topologyType = types.submodule {
options.server = mkOption {
type = types.submodule {
options = {
machine = mkOption { type = types.nonEmptyStr; };
sshAlias = mkOption { type = types.nonEmptyStr; };
};
};
};
};
factsType =
{
withMachine ? false,
}:
types.submodule {
options = {
account = accountOption;
machines = mkOption { type = types.attrsOf (machineType { }); };
services = mkOption { type = types.attrsOf endpointType; };
externalDevices = mkOption {
type = types.attrsOf externalDeviceType;
default = { };
};
topology = mkOption { type = topologyType; };
}
// lib.optionalAttrs withMachine {
machine = mkOption { type = machineType { withName = true; }; };
};
};
in in
{ {
options.facts = factsOption; options.facts = mkOption {
type = factsType { };
};
config = { config = {
facts = { facts = {
@@ -17,11 +196,11 @@ in
realName = "Jelle Spreeuwenberg"; realName = "Jelle Spreeuwenberg";
homeDirectory = "/home/${name}"; homeDirectory = "/home/${name}";
nixosConfigurationPath = "${homeDirectory}/.config/nixos"; nixosConfigurationPath = "${homeDirectory}/.config/nixos";
primaryEmail = "personal";
emails = { emails = {
personal = { personal = {
address = "mail@jelles.net"; address = "mail@jelles.net";
primary = true;
type = "mxrouting"; type = "mxrouting";
}; };
old = { old = {
@@ -37,61 +216,59 @@ in
type = "office365"; type = "office365";
}; };
}; };
primaryEmail = emails.personal;
}; };
services = { services = {
actual = { actual = {
scheme = "https";
domain = "finance.jelles.net"; domain = "finance.jelles.net";
host = "127.0.0.1";
port = 3000;
url = "https://finance.jelles.net";
}; };
gitea = { gitea = {
scheme = "https";
domain = "git.jelles.net"; domain = "git.jelles.net";
host = "127.0.0.1";
port = 3001;
url = "https://git.jelles.net/";
}; };
radicale = { radicale = {
scheme = "https";
domain = "radicale.jelles.net"; domain = "radicale.jelles.net";
host = "127.0.0.1";
port = 5232;
url = "https://radicale.jelles.net/";
}; };
vaultwarden = { vaultwarden = {
scheme = "https";
domain = "vault.jelles.net"; domain = "vault.jelles.net";
host = "127.0.0.1";
port = 8100;
url = "https://vault.jelles.net";
}; };
}; };
theme = import ./capabilities/_theme.nix; externalDevices.pixel-10.syncthingId = "MTJHEHA-UMZDQZ7-BTMRRLQ-Y7BFPUJ-ZTY6LZX-PDXV3IS-XVJCU7B-EPETBQZ";
topology.server = {
machine = "orion";
sshAlias = "orion";
};
}; };
flake.modules.nixos.facts = { lib, ... }: { flake.modules.nixos.facts = {
options.facts = factsOption; options.facts = mkOption {
type = factsType { withMachine = true; };
};
}; };
flake.modules.homeManager.facts = flake.modules.homeManager.facts =
{ osConfig, ... }:
{ {
lib, options.facts = mkOption {
osConfig ? { }, type = factsType { withMachine = true; };
... };
}:
{
options.facts = factsOption;
config.facts = lib.optionalAttrs (osConfig ? facts) { config.facts = {
inherit (osConfig.facts) inherit (osConfig.facts)
account account
externalDevices
machine machine
machines machines
services topology
theme
; ;
services = lib.mapAttrs (_: service: {
inherit (service) scheme domain;
}) osConfig.facts.services;
}; };
}; };
}; };
+21 -20
View File
@@ -1,6 +1,7 @@
{ {
inputs, inputs,
config, config,
lib,
... ...
}: }:
let let
@@ -9,17 +10,12 @@ let
{ pkgs, ... }: { pkgs, ... }:
let let
account = config.facts.account; account = config.facts.account;
hmStateVersion = machine.hmStateVersion or machine.stateVersion; machineFacts = machine // {
machineFacts = { inherit name;
displays = { };
portable = false;
sshKeys = { };
syncthingId = null;
}
// machine
// {
inherit name hmStateVersion;
}; };
services = lib.mapAttrs (_: service: {
inherit (service) scheme domain;
}) config.facts.services;
in in
{ {
imports = [ imports = [
@@ -29,10 +25,11 @@ let
facts = { facts = {
inherit (config.facts) inherit (config.facts)
account account
externalDevices
machines machines
services topology
theme
; ;
inherit services;
machine = machineFacts; machine = machineFacts;
}; };
@@ -54,7 +51,7 @@ let
home-manager.users.${account.name}.home = { home-manager.users.${account.name}.home = {
username = account.name; username = account.name;
homeDirectory = account.homeDirectory; homeDirectory = account.homeDirectory;
stateVersion = hmStateVersion; stateVersion = machine.hmStateVersion;
}; };
}; };
in in
@@ -66,13 +63,17 @@ in
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
flake.nixosConfigurations = builtins.mapAttrs ( flake.nixosConfigurations =
name: machine: assert lib.assertMsg (builtins.hasAttr config.facts.topology.server.machine config.facts.machines)
inputs.nixpkgs.lib.nixosSystem { "facts.topology.server.machine must name an entry in facts.machines";
specialArgs = { inherit inputs; }; builtins.mapAttrs (
modules = [ (mkHost name machine) ]; name: machine:
} inputs.nixpkgs.lib.nixosSystem {
) config.facts.machines; inherit (machine) system;
specialArgs = { inherit inputs; };
modules = [ (mkHost name machine) ];
}
) config.facts.machines;
perSystem = perSystem =
{ pkgs, ... }: { pkgs, ... }:
+1
View File
@@ -5,6 +5,7 @@ let
in in
{ {
facts.machines.orion = { facts.machines.orion = {
system = "x86_64-linux";
syncthingId = "NNRNQKZ-OWPHSVA-B6KKBHE-SDYLSTV-7SVHGPR-NEWLKPL-4MWNJG4-G5FHUAI"; syncthingId = "NNRNQKZ-OWPHSVA-B6KKBHE-SDYLSTV-7SVHGPR-NEWLKPL-4MWNJG4-G5FHUAI";
stateVersion = "24.05"; stateVersion = "24.05";
+1 -2
View File
@@ -8,6 +8,7 @@ let
in in
{ {
facts.machines.polaris = { facts.machines.polaris = {
system = "x86_64-linux";
sshKeys = { sshKeys = {
personal.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEVORk45HKkX7gaGGp90KsVyUy6t+fKhbWN/grjkf3cQ kiri@polaris"; personal.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEVORk45HKkX7gaGGp90KsVyUy6t+fKhbWN/grjkf3cQ kiri@polaris";
work.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM5DMV6EQzsscgEOE0912mNglUHTEl+LPnaWYjj0y57B kiri@polaris#work"; work.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM5DMV6EQzsscgEOE0912mNglUHTEl+LPnaWYjj0y57B kiri@polaris#work";
@@ -36,9 +37,7 @@ in
{ {
imports = [ imports = [
nixosModules.workstation-base nixosModules.workstation-base
nixosModules.qbittorrent
nixosModules.steam nixosModules.steam
nixosModules.yookr-dev
./_hardware.nix ./_hardware.nix
] ]
++ (with inputs.nixos-hardware.nixosModules; [ ++ (with inputs.nixos-hardware.nixosModules; [
+1 -3
View File
@@ -8,7 +8,7 @@ let
in in
{ {
facts.machines.zenith = { facts.machines.zenith = {
portable = true; system = "x86_64-linux";
sshKeys = { sshKeys = {
personal.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIQy4k04gU7UpjBgyUQ57kUwxOdt79LvMCiCekXZeZhd kiri@zenith"; personal.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIQy4k04gU7UpjBgyUQ57kUwxOdt79LvMCiCekXZeZhd kiri@zenith";
@@ -35,9 +35,7 @@ in
{ {
imports = [ imports = [
nixosModules.workstation-base nixosModules.workstation-base
nixosModules.qbittorrent
nixosModules.laptop-power nixosModules.laptop-power
nixosModules.yookr-dev
{ {
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
services.fwupd.enable = true; services.fwupd.enable = true;
+3 -3
View File
@@ -13,9 +13,9 @@ in
nixosModules.facts nixosModules.facts
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
nixosModules.nix nixosModules.nix
nixosModules.locale-nl nixosModules.locale
nixosModules.sops-password nixosModules.sops-password
nixosModules.helix nixosModules.helix-cache
]; ];
home-manager = { home-manager = {
@@ -26,7 +26,7 @@ in
hmModules.facts hmModules.facts
hmModules.syncthing hmModules.syncthing
hmModules.shell hmModules.shell
hmModules.helix hmModules.primary-editor-helix
]; ];
}; };
+10 -15
View File
@@ -23,9 +23,10 @@ in
nixosModules.limine nixosModules.limine
nixosModules.theme nixosModules.theme
nixosModules.ai nixosModules.ai
nixosModules.hidraw-access nixosModules.yunzi-b75-pro
nixosModules.openvpn nixosModules.openvpn
nixosModules.walker-cache nixosModules.walker
nixosModules.yookr-dev
]; ];
services.dbus.implementation = "broker"; services.dbus.implementation = "broker";
@@ -42,32 +43,26 @@ in
imports = [ imports = [
homeModules.passwords homeModules.passwords
homeModules.clipboard homeModules.clipboard
homeModules.desktop-commands
homeModules.dev-tools homeModules.dev-tools
homeModules.zed homeModules.zed
homeModules.xdg homeModules.xdg
homeModules.workstation-apps homeModules.workstation-apps
homeModules.primary-browser-vivaldi homeModules.vivaldi
homeModules.primary-file-manager-nautilus homeModules.nautilus
homeModules.primary-launcher-walker homeModules.imv
homeModules.default-image-viewer-imv homeModules.sioyek
homeModules.default-document-viewer-sioyek homeModules.discord
homeModules.qbittorrent
homeModules.email homeModules.email
homeModules.mpv homeModules.mpv
homeModules.nix homeModules.nix
homeModules.calendar-tasks homeModules.calendar-tasks
homeModules.podman
homeModules.git homeModules.git
homeModules.ssh-client homeModules.ssh-client
homeModules.primary-terminal-kitty homeModules.primary-terminal-kitty
homeModules.terminal-foot
homeModules.noctalia homeModules.noctalia
homeModules.keyring homeModules.keyring
{
programs.discord = {
enable = true;
settings.SKIP_HOST_UPDATE = true;
};
}
]; ];
}; };
} }