Compare commits
69 Commits
3ab9f0b465
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9df7bfd825 | |||
| 9f565b85db | |||
| 562a65a714 | |||
| beabcabb60 | |||
| 709e89c017 | |||
| b35c95b4c8 | |||
| 5a1f5a9894 | |||
| d6a3587a89 | |||
| ed1c94735c | |||
| 239febf3e0 | |||
| e7c0a084a0 | |||
| 30564171f0 | |||
| 1d591c4f4a | |||
| b204e48509 | |||
| 86dcf5ce4b | |||
| 8453447f90 | |||
| 2c2276c9b8 | |||
| c4146eaae0 | |||
| f193c02f4a | |||
| d84fec1a82 | |||
| 1458dd1ae6 | |||
| c501097e4c | |||
| 4b6e05212c | |||
| c01c13aa50 | |||
| e33602e879 | |||
| d6878abc61 | |||
| be1a9b7852 | |||
| 7299f5bb79 | |||
| c2082e942e | |||
| fdf6ac5e08 | |||
| fdc269483e | |||
| e8d1f58ed5 | |||
| 5bc37c7009 | |||
| efb0179344 | |||
| a18d405ea7 | |||
| 9b3db93dbd | |||
| cacb6c01e9 | |||
| f4ac94c65c | |||
| 85cf1d92ca | |||
| 61971e2b37 | |||
| 783bd9958d | |||
| 44fe4552ef | |||
| 93624900ad | |||
| 0b2ecd31b0 | |||
| bac6e4997b | |||
| 8b31e1ca9f | |||
| 4cd2d1addd | |||
| 5091db4ac9 | |||
| 8126141b22 | |||
| 9b0c2e647d | |||
| ca4594d420 | |||
| 6d3c549284 | |||
| 7ccbdcfa33 | |||
| f769de0c91 | |||
| aecdfef9b3 | |||
| 5d604e827a | |||
| 0937d29ed4 | |||
| 52ea09563f | |||
| 0318dd0cf6 | |||
| 703c0e82e0 | |||
| 0e29e08c20 | |||
| 2a2b192255 | |||
| dba24ce5f3 | |||
| 75ba00929e | |||
| 66bc0866b7 | |||
| c5e3f674b6 | |||
| c61efc6f5c | |||
| 3cbfe566e4 | |||
| 26e9593aab |
@@ -1,73 +0,0 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Purpose
|
||||
|
||||
This repo uses the Dendritic Pattern with `flake-parts`.
|
||||
|
||||
Design and change the configuration as a composition of **features**, not as a host-first tree.
|
||||
|
||||
For deeper design rationale and pattern descriptions, refer to `.agents/dendritic-design-with-flake-parts.wiki`.
|
||||
|
||||
## Core Terms
|
||||
|
||||
- **Feature**: a flake-parts module under `modules/` that defines one coherent concern.
|
||||
- **Aspect**: a reusable module published at `flake.modules.<module class>.<aspect name>`.
|
||||
- **Module class**: the configuration context of an aspect. This repo primarily uses `nixos` and `homeManager`.
|
||||
- **Feature module**: the flake-parts module that defines aspects, flake outputs, options, or shared helpers.
|
||||
|
||||
In this repo, `flake.nix` imports `./modules` recursively via `inputs.import-tree`. Any non-private `.nix` file under `modules/` is therefore treated as a feature module.
|
||||
|
||||
## Design Principles
|
||||
|
||||
- Work bottom-up. Define features first; assemble hosts from features.
|
||||
- Keep semantic ownership local. A feature should contain the configuration for that concern across all relevant module classes.
|
||||
- Name aspects semantically. The aspect name should usually match the file or directory name that defines it.
|
||||
- Prefer small, composable aspects. Build larger configurations with `imports`.
|
||||
- Import aspects unconditionally and only within the same module class.
|
||||
- Put conditions inside module content with `lib.mkIf` or `lib.mkMerge`, never around `imports`.
|
||||
- Avoid importing the same aspect multiple times along one import path.
|
||||
- Keep private helper files next to the feature that uses them and prefix them with `_` so `import-tree` does not import them as feature modules.
|
||||
- Put shared schemas and constructors in dedicated shared modules, not ad hoc host files.
|
||||
|
||||
## Repo Structure
|
||||
|
||||
- `modules/features/`: reusable features and most aspect definitions.
|
||||
- `modules/hosts/<name>/default.nix`: host features that assemble NixOS aspects into `flake.modules.nixos.<name>`.
|
||||
- `modules/secrets/`: secret-related features shared by hosts.
|
||||
- `modules/flake-parts.nix`: flake-parts entrypoint; defines systems, formatter, and `flake.nixosConfigurations`.
|
||||
- `modules/lib.nix`: shared constructors and helpers in `config.meta.lib`, especially `mkHost` and `mkCaddyReverseProxy`.
|
||||
- `modules/data.nix`: canonical shared repo data and account attrsets exposed through `meta.lib.repo` and `meta.lib.accounts`.
|
||||
- `modules/features/meta.nix`: shared metadata schema for `meta.host` and `meta.user`.
|
||||
|
||||
## How Features Are Applied Here
|
||||
|
||||
- Reusable NixOS concerns are published as `flake.modules.nixos.<name>`.
|
||||
- Reusable Home Manager concerns are published as `flake.modules.homeManager.<name>`.
|
||||
- Hosts are aspects too. `orion`, `polaris`, and `zenith` are `nixos` aspects assembled from smaller aspects.
|
||||
- Host modules should use `config.meta.lib.mkHost` to define `meta.host`, base imports, hostname, and state version.
|
||||
- Per-host user declarations should stay inline under `users.<name>` using canonical accounts from `meta.lib.accounts`, so host-local defaults stay close to the host and `mkHost` can wire `meta.host` and `meta.user` into Home Manager consistently.
|
||||
- Features may rely on the `meta` contract. Existing modules already read `config.meta.host`, `config.meta.user`, and `config.meta.lib`.
|
||||
|
||||
## Preferred Aspect Patterns
|
||||
|
||||
- **Simple Aspect**: use for one self-contained concern in one or more module classes.
|
||||
- **Multi Context Aspect**: use when one concern must configure both `nixos` and `homeManager`.
|
||||
- **Inheritance Aspect**: use by importing a parent aspect and extending it.
|
||||
- **Conditional Aspect**: use `lib.mkMerge` plus `lib.mkIf` for conditional content.
|
||||
|
||||
Use **Collector Aspect** only when composition through imports or shared library helpers is insufficient.
|
||||
|
||||
## Change Rules
|
||||
|
||||
- When adding a feature, add or extend aspects under `modules/features/` and let hosts opt into them explicitly.
|
||||
- When adding a host, create `modules/hosts/<name>/default.nix` and keep host-local generated files private as `_hardware.nix`, `_disk.nix`, or similar.
|
||||
- When a feature needs local data or helper code, keep it inside that feature directory and prefix non-feature files with `_` when they live under `modules/`.
|
||||
- Do not place arbitrary non-feature `.nix` files under `modules/` unless they are intentionally private and excluded from recursive import.
|
||||
- If a concern is shared across hosts, it belongs in a reusable feature, not inline in one host unless it is truly host-specific.
|
||||
|
||||
## Practical Heuristics
|
||||
|
||||
- If you are about to edit a host because of a reusable concern, that concern probably wants its own feature.
|
||||
- If a Home Manager module needs host or user facts, prefer reading `config.meta.host` or `config.meta.user` instead of duplicating literals.
|
||||
- If a concern spans system and user space, keep both aspects in one feature so the behavior stays coherent.
|
||||
- If imports would need to be conditional, redesign the aspect boundary instead.
|
||||
Generated
+490
-268
File diff suppressed because it is too large
Load Diff
@@ -2,21 +2,47 @@
|
||||
description = "NixOS Configuration";
|
||||
|
||||
inputs = {
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
devenv.url = "github:cachix/devenv";
|
||||
flake-parts.follows = "lux-pkgs/flake-parts";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
import-tree.url = "github:vic/import-tree";
|
||||
llm-agents.url = "github:numtide/llm-agents.nix";
|
||||
llm-agents = {
|
||||
url = "github:numtide/llm-agents.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
niri.url = "github:sodiboo/niri-flake";
|
||||
nix-wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules";
|
||||
nix-wrapper-modules = {
|
||||
url = "github:BirdeeHub/nix-wrapper-modules";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
|
||||
noctalia.url = "github:noctalia-dev/noctalia-shell";
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
nix-index-database.url = "github:nix-community/nix-index-database";
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nix-index-database = {
|
||||
url = "github:nix-community/nix-index-database";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
#vicinae.url = "github:vicinaehq/vicinae";
|
||||
vicinae-extensions.url = "github:vicinaehq/extensions";
|
||||
elephant = {
|
||||
url = "github:abenz1267/elephant";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
walker = {
|
||||
url = "github:abenz1267/walker";
|
||||
inputs.elephant.follows = "elephant";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
lux-pkgs.url = "git+ssh://gitea@orion/kiri/lux-pkgs";
|
||||
};
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
cursor = {
|
||||
name = "phinger-cursors-light";
|
||||
packagePath = [ "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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,23 +1,13 @@
|
||||
{ inputs, ... }:
|
||||
{ inputs, config, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
|
||||
sharedContext = ''
|
||||
# Global Agent Context
|
||||
|
||||
Be a concise technical thought partner. Check the premise before executing, optimize for the user's actual outcome, and make important assumptions or tradeoffs visible.
|
||||
|
||||
## Workflow
|
||||
|
||||
- Respect mode words literally: "read-only", "debug", "investigate", or "do not change code" means no edits; "plan" means produce a decision-complete plan; "implement" means make the smallest useful patch and verify it.
|
||||
- Ask only when the answer cannot be discovered locally and a wrong assumption would materially change the result. Otherwise state the assumption and continue.
|
||||
- Keep responses dense. Lead with the answer, cause, patch result, or recommendation. Avoid long preambles and generic reassurance.
|
||||
|
||||
## Code Changes
|
||||
|
||||
- Preserve user work. Never revert or overwrite unrelated changes; read dirty files before editing them.
|
||||
- Prefer simple, ergonomic code that matches the existing project style. Avoid future-proofing and new abstractions unless the current problem clearly pays for them.
|
||||
- Before editing, understand the local architecture, dependency manager, formatter, and test commands. After editing, run the narrowest meaningful verification and report what ran.
|
||||
- Do not install dependencies globally or mutate system configuration unless explicitly asked.
|
||||
|
||||
## Machine Environment
|
||||
|
||||
- This machine is Nix/NixOS-based. Standard Linux assumptions may be wrong: software is usually provided by flakes, dev shells, `devenv`, `direnv`, or the user's NixOS/Home Manager config rather than `apt`, `dnf`, or global installs.
|
||||
@@ -32,6 +22,8 @@ let
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.ai = {
|
||||
home-manager.sharedModules = [ hmModules.ai ];
|
||||
|
||||
nixpkgs.overlays = [ inputs.llm-agents.overlays.default ];
|
||||
|
||||
nix.settings = {
|
||||
@@ -61,7 +53,7 @@ in
|
||||
};
|
||||
|
||||
programs.gemini-cli = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
package = pkgs.llm-agents.gemini-cli;
|
||||
enableMcpIntegration = true;
|
||||
context.AGENTS = sharedContext;
|
||||
@@ -93,10 +85,15 @@ in
|
||||
"context-remaining"
|
||||
"five-hour-limit"
|
||||
];
|
||||
projects.${config.meta.user.account.nixosConfigurationPath}.trust_level = "trusted";
|
||||
projects.${account.nixosConfigurationPath}.trust_level = "trusted";
|
||||
projects."${config.home.homeDirectory}/work/repos/yookr_data_science".trust_level = "trusted";
|
||||
sandbox_mode = "workspace-write";
|
||||
personality = "pragmatic";
|
||||
features.undo = true;
|
||||
mcp_servers.nixos = config.programs.mcp.servers.nixos // {
|
||||
enabled = true;
|
||||
default_tools_approval_mode = "approve";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,115 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
vivaldiPackage = pkgs: pkgs.vivaldi;
|
||||
nautilusPackage = pkgs: pkgs.nautilus;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.browser-vivaldi =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ (vivaldiPackage pkgs) ];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.primary-browser-vivaldi =
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
imports = [ homeModules.browser-vivaldi ];
|
||||
|
||||
facts.desktop.browserCommand = lib.getExe (vivaldiPackage pkgs);
|
||||
home.sessionVariables.BROWSER = lib.getExe (vivaldiPackage pkgs);
|
||||
xdg.mimeApps.defaultApplicationPackages = [ (vivaldiPackage pkgs) ];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.file-manager-nautilus =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ (nautilusPackage pkgs) ];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.primary-file-manager-nautilus =
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
imports = [ homeModules.file-manager-nautilus ];
|
||||
|
||||
xdg.mimeApps.defaultApplicationPackages = [ (nautilusPackage pkgs) ];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.image-viewer-imv = {
|
||||
programs.imv.enable = true;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.default-image-viewer-imv =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ homeModules.image-viewer-imv ];
|
||||
|
||||
xdg.mimeApps.defaultApplicationPackages = [ pkgs.imv ];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.document-viewer-sioyek = {
|
||||
programs.sioyek.enable = true;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.default-document-viewer-sioyek =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ homeModules.document-viewer-sioyek ];
|
||||
|
||||
xdg.mimeApps.defaultApplicationPackages = [ pkgs.sioyek ];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.workstation-apps =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
postman
|
||||
spotify
|
||||
calcure
|
||||
planify
|
||||
unzip
|
||||
gimp
|
||||
dbeaver-bin
|
||||
];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.xdg =
|
||||
{ config, ... }:
|
||||
let
|
||||
homeDir = config.home.homeDirectory;
|
||||
localDir = "${homeDir}/.local";
|
||||
mediaDir = "${homeDir}/media";
|
||||
in
|
||||
{
|
||||
home.preferXdgDirectories = true;
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
|
||||
cacheHome = "${localDir}/cache";
|
||||
configHome = "${homeDir}/.config";
|
||||
dataHome = "${localDir}/share";
|
||||
stateHome = "${localDir}/state";
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
setSessionVariables = true;
|
||||
|
||||
download = "${homeDir}/downloads";
|
||||
documents = "${homeDir}/documents";
|
||||
projects = "${homeDir}/dev";
|
||||
music = "${mediaDir}/music";
|
||||
pictures = "${mediaDir}/images";
|
||||
videos = "${mediaDir}/videos";
|
||||
desktop = "${localDir}/desktop";
|
||||
publicShare = "${localDir}/public";
|
||||
templates = "${localDir}/templates";
|
||||
};
|
||||
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,22 +1,27 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
flake.modules.homeManager.dev-tools =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
home.sessionVariables.CARGO_HOME = "${config.xdg.dataHome}/cargo";
|
||||
home.packages = with pkgs; [
|
||||
devenv
|
||||
httpie
|
||||
bruno
|
||||
usql
|
||||
posting
|
||||
resterm
|
||||
inputs.devenv.packages.${pkgs.stdenv.hostPlatform.system}.default
|
||||
];
|
||||
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
# programs.direnv = {
|
||||
# enable = true;
|
||||
# enableZshIntegration = true;
|
||||
# nix-direnv.enable = true;
|
||||
# };
|
||||
|
||||
programs.zsh.initContent = ''
|
||||
eval "$(devenv hook zsh)"
|
||||
'';
|
||||
|
||||
programs.lazygit = {
|
||||
enable = true;
|
||||
@@ -27,14 +32,6 @@
|
||||
programs.jq.enable = true;
|
||||
programs.bun.enable = true;
|
||||
programs.ripgrep.enable = true;
|
||||
programs.uv.enable = true;
|
||||
|
||||
programs.git.ignores = [
|
||||
"devenv.*"
|
||||
".devenv*"
|
||||
".direnv"
|
||||
"pre-commit-config.yaml"
|
||||
".envrc"
|
||||
];
|
||||
#programs.uv.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -21,6 +21,24 @@
|
||||
source-sans-pro
|
||||
source-serif-pro
|
||||
];
|
||||
|
||||
fontconfig = {
|
||||
enable = true;
|
||||
antialias = true;
|
||||
allowBitmaps = false;
|
||||
useEmbeddedBitmaps = false;
|
||||
|
||||
hinting = {
|
||||
enable = true;
|
||||
autohint = false;
|
||||
style = "slight";
|
||||
};
|
||||
|
||||
subpixel = {
|
||||
rgba = "none";
|
||||
lcdfilter = "none";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.git =
|
||||
{
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
let
|
||||
machine = osConfig.facts.machine;
|
||||
allowedSignersFile = "${config.xdg.configHome}/git/allowed_signers";
|
||||
|
||||
mkScope =
|
||||
scope:
|
||||
let
|
||||
email = account.emails.${scope}.address;
|
||||
key = lib.attrByPath [ scope ] null machine.sshKeys;
|
||||
hasSigningKey = key != null;
|
||||
privateKeyPath = key.privateKeyPath or "~/.ssh/id_${scope}";
|
||||
in
|
||||
{
|
||||
allowedSigners = lib.optional hasSigningKey "${email} ${key.publicKey}";
|
||||
git = {
|
||||
user = {
|
||||
name = account.realName;
|
||||
inherit email;
|
||||
}
|
||||
// lib.optionalAttrs hasSigningKey {
|
||||
signingKey = "${privateKeyPath}.pub";
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs hasSigningKey {
|
||||
gpg.ssh.allowedSignersFile = allowedSignersFile;
|
||||
};
|
||||
};
|
||||
|
||||
personal = mkScope "personal";
|
||||
work = mkScope "work";
|
||||
in
|
||||
{
|
||||
xdg.configFile."git/allowed_signers".text = lib.concatStringsSep "\n" (
|
||||
personal.allowedSigners ++ work.allowedSigners ++ [ "" ]
|
||||
);
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
signing.format = "ssh";
|
||||
ignores = [
|
||||
".claude/"
|
||||
".codex"
|
||||
];
|
||||
settings = {
|
||||
init.defaultBranch = "main";
|
||||
user = {
|
||||
name = account.realName;
|
||||
email = account.emails.personal.address;
|
||||
};
|
||||
};
|
||||
includes = [
|
||||
{
|
||||
condition = "gitdir:${account.nixosConfigurationPath}/";
|
||||
contents = personal.git;
|
||||
}
|
||||
{
|
||||
condition = "gitdir:${config.xdg.userDirs.projects}/";
|
||||
contents = personal.git;
|
||||
}
|
||||
{
|
||||
condition = "gitdir:${config.home.homeDirectory}/work/";
|
||||
contents = work.git;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
settings.git_protocol = "ssh";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
flake.modules.nixos.hidraw-access = {
|
||||
services.udev.extraRules = ''
|
||||
# ROYUAN YUNZII B75 PRO
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3151", ATTRS{idProduct}=="4015", MODE="0660", GROUP="users"
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
palette = config.repo.theme.kanagawa.palette;
|
||||
hex = lib.removePrefix "#";
|
||||
terminalPalette = palette.terminal;
|
||||
mkPalette = colors: lib.concatStringsSep ";" (map hex colors);
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.limine =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
displayValues = builtins.attrValues (config.facts.machine.displays or { });
|
||||
primaryDisplays = lib.filter (display: display.primary or false) displayValues;
|
||||
primaryDisplay = if primaryDisplays == [ ] then null else builtins.head primaryDisplays;
|
||||
interfaceResolution =
|
||||
if primaryDisplay != null && primaryDisplay ? width && primaryDisplay ? height then
|
||||
"${toString primaryDisplay.width}x${toString primaryDisplay.height}"
|
||||
else
|
||||
null;
|
||||
in
|
||||
{
|
||||
boot.loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
limine = {
|
||||
enable = true;
|
||||
maxGenerations = 10;
|
||||
resolution = "2560x1440";
|
||||
|
||||
style = {
|
||||
backdrop = hex palette.secondaryBackground;
|
||||
|
||||
graphicalTerminal = {
|
||||
background = "00${hex palette.background}";
|
||||
foreground = hex palette.foreground;
|
||||
brightForeground = hex palette.selectionForeground;
|
||||
brightBackground = hex palette.selectionBackground;
|
||||
palette = mkPalette [
|
||||
terminalPalette.color0
|
||||
terminalPalette.color1
|
||||
terminalPalette.color2
|
||||
terminalPalette.color3
|
||||
terminalPalette.color4
|
||||
terminalPalette.color5
|
||||
terminalPalette.color6
|
||||
terminalPalette.color7
|
||||
];
|
||||
brightPalette = mkPalette [
|
||||
terminalPalette.color8
|
||||
terminalPalette.color9
|
||||
terminalPalette.color10
|
||||
terminalPalette.color11
|
||||
terminalPalette.color12
|
||||
terminalPalette.color13
|
||||
terminalPalette.color14
|
||||
terminalPalette.color15
|
||||
];
|
||||
font = {
|
||||
scale = "2x2";
|
||||
spacing = 1;
|
||||
};
|
||||
margin = 64;
|
||||
marginGradient = 24;
|
||||
};
|
||||
|
||||
interface = {
|
||||
branding = config.networking.hostName;
|
||||
brandingColor = hex palette.accents.blue;
|
||||
helpHidden = false;
|
||||
resolution = interfaceResolution;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.modules.nixos.region-nl = {
|
||||
flake.modules.nixos.locale-nl = {
|
||||
time.timeZone = "Europe/Amsterdam";
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
+19
@@ -1,6 +1,7 @@
|
||||
{ themeName }:
|
||||
''
|
||||
require("kanagawa").setup({
|
||||
dimInactive = true,
|
||||
colors = {
|
||||
theme = {
|
||||
all = {
|
||||
@@ -37,6 +38,24 @@
|
||||
DiagnosticVirtualTextInfo = makeDiagnosticColor(theme.diag.info),
|
||||
DiagnosticVirtualTextWarn = makeDiagnosticColor(theme.diag.warning),
|
||||
DiagnosticVirtualTextError = makeDiagnosticColor(theme.diag.error),
|
||||
|
||||
DiagnosticVirtualLinesHint = makeDiagnosticColor(theme.diag.hint),
|
||||
DiagnosticVirtualLinesInfo = makeDiagnosticColor(theme.diag.info),
|
||||
DiagnosticVirtualLinesWarn = makeDiagnosticColor(theme.diag.warning),
|
||||
DiagnosticVirtualLinesError = makeDiagnosticColor(theme.diag.error),
|
||||
|
||||
FloatBorder = { fg = theme.ui.float.fg_border, bg = theme.ui.float.bg },
|
||||
NormalFloat = { fg = theme.ui.float.fg, bg = theme.ui.float.bg },
|
||||
WinBar = { fg = theme.ui.fg_dim, bg = "NONE" },
|
||||
WinBarNC = { fg = theme.ui.nontext, bg = theme.ui.bg_dim },
|
||||
|
||||
BufferLineFill = { bg = theme.ui.bg_m3 },
|
||||
BufferLineBackground = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m3 },
|
||||
BufferLineBufferSelected = { fg = theme.ui.fg, bg = theme.ui.bg, bold = true },
|
||||
BufferLineModified = { fg = theme.vcs.changed, bg = theme.ui.bg_m3 },
|
||||
BufferLineModifiedSelected = { fg = theme.vcs.changed, bg = theme.ui.bg },
|
||||
BufferLineDiagnostic = { fg = theme.ui.nontext, bg = theme.ui.bg_m3 },
|
||||
BufferLineDiagnosticSelected = { fg = theme.ui.fg_dim, bg = theme.ui.bg },
|
||||
}
|
||||
end,
|
||||
})
|
||||
@@ -1,13 +1,21 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
repoTheme = config.repo.theme.kanagawa;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.default-editor-neovim =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
xdg.mimeApps.defaultApplicationPackages = [ pkgs.neovim ];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.neovim =
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -17,13 +25,9 @@ in
|
||||
};
|
||||
|
||||
imports = [
|
||||
(inputs.nix-wrapper-modules.lib.mkInstallModule {
|
||||
(inputs.nix-wrapper-modules.lib.getInstallModule {
|
||||
name = "neovim";
|
||||
value = inputs.nix-wrapper-modules.lib.wrapperModules.neovim;
|
||||
loc = [
|
||||
"home"
|
||||
"packages"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
@@ -35,7 +39,7 @@ in
|
||||
|
||||
# 2. Runtime Dependencies (from lspsAndRuntimeDeps)
|
||||
# These are added to the PATH of the wrapper
|
||||
extraPackages = with pkgs; [
|
||||
runtimePkgs = with pkgs; [
|
||||
# Tools
|
||||
universal-ctags
|
||||
ripgrep
|
||||
@@ -57,6 +61,7 @@ in
|
||||
astro-language-server
|
||||
tinymist
|
||||
typstyle
|
||||
websocat
|
||||
|
||||
# ty
|
||||
# basedpyright
|
||||
@@ -64,63 +69,106 @@ in
|
||||
ruff
|
||||
];
|
||||
|
||||
# 3. Plugins (from startupPlugins & optionalPlugins)
|
||||
# Since you use lz.n in Lua, we just list them all here.
|
||||
# The wrapper will add them to the packpath.
|
||||
# 3. Plugins
|
||||
# Nix provisions plugins; lz.n controls when lazy specs are packadd'd.
|
||||
specs = {
|
||||
# Core lazy-loading plugin
|
||||
lz-n = {
|
||||
data = pkgs.vimPlugins.lz-n;
|
||||
};
|
||||
plenary = {
|
||||
data = pkgs.vimPlugins.plenary-nvim;
|
||||
};
|
||||
|
||||
# All other plugins
|
||||
general = {
|
||||
support = {
|
||||
data = with pkgs.vimPlugins; [
|
||||
plenary-nvim
|
||||
kanagawa-nvim
|
||||
nvim-treesitter.withAllGrammars
|
||||
nvim-treesitter-textobjects
|
||||
trouble-nvim
|
||||
guess-indent-nvim
|
||||
which-key-nvim
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
conform-nvim
|
||||
rainbow-delimiters-nvim
|
||||
];
|
||||
};
|
||||
|
||||
completion = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
blink-cmp
|
||||
luasnip
|
||||
friendly-snippets
|
||||
mini-nvim
|
||||
colorful-menu-nvim
|
||||
];
|
||||
};
|
||||
|
||||
lsp = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
nvim-lspconfig
|
||||
lazydev-nvim
|
||||
colorful-menu-nvim
|
||||
lualine-nvim
|
||||
zen-mode-nvim
|
||||
kanagawa-nvim
|
||||
project-nvim
|
||||
trouble-nvim
|
||||
typst-preview-nvim
|
||||
];
|
||||
};
|
||||
|
||||
formatting = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
conform-nvim
|
||||
];
|
||||
};
|
||||
|
||||
core = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
mini-nvim
|
||||
guess-indent-nvim
|
||||
direnv-vim
|
||||
codecompanion-nvim
|
||||
copilot-lua
|
||||
];
|
||||
};
|
||||
|
||||
ui = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
lualine-nvim
|
||||
bufferline-nvim
|
||||
gitsigns-nvim
|
||||
zen-mode-nvim
|
||||
which-key-nvim
|
||||
kulala-nvim
|
||||
];
|
||||
};
|
||||
|
||||
project = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
project-nvim
|
||||
];
|
||||
};
|
||||
|
||||
telescope = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# 4. Passing Data to Lua (Replacing nixCats.extra)
|
||||
# We put these in `settings` so they appear in require('nix-info').settings
|
||||
# 4. Values exposed to Lua through require("nix-info").settings.
|
||||
settings = {
|
||||
# Hostname/ConfigDir needed for nixd
|
||||
nixdExtras = {
|
||||
nixpkgs = "import ${pkgs.path} {}";
|
||||
nixos_options = ''(builtins.getFlake "path://${config.meta.user.account.nixosConfigurationPath}").nixosConfigurations.${config.meta.machine.name}.options'';
|
||||
home_manager_options = ''(builtins.getFlake "path://${config.meta.user.account.nixosConfigurationPath}").nixosConfigurations.${config.meta.machine.name}.options.home-manager.users.type.getSubOptions []'';
|
||||
nixos_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.facts.machine.name}.options'';
|
||||
home_manager_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.facts.machine.name}.options.home-manager.users.type.getSubOptions []'';
|
||||
};
|
||||
|
||||
themeSetup = import ./_kanagawa-theme.nix {
|
||||
themeName = repoTheme.name;
|
||||
};
|
||||
|
||||
typstPreviewDependencies = {
|
||||
tinymist = "${pkgs.tinymist}/bin/tinymist";
|
||||
websocat = "${pkgs.websocat}/bin/websocat";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# 5. Wrapper Configuration
|
||||
-1
@@ -6,4 +6,3 @@ require("plugins.treesitter")
|
||||
require("plugins.telescope")
|
||||
require("plugins.ui")
|
||||
require("plugins.core")
|
||||
require("plugins.ai")
|
||||
@@ -0,0 +1,74 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.o.expandtab = true
|
||||
vim.o.shiftwidth = 2
|
||||
vim.o.tabstop = 2
|
||||
vim.o.softtabstop = 2
|
||||
|
||||
vim.o.number = true
|
||||
-- vim.o.relativenumber = true
|
||||
|
||||
vim.o.mouse = "a"
|
||||
|
||||
vim.o.showmode = false
|
||||
|
||||
vim.opt.shortmess:append("Wc")
|
||||
|
||||
vim.schedule(function()
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
end)
|
||||
|
||||
vim.o.breakindent = true
|
||||
|
||||
vim.o.undofile = true
|
||||
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
vim.o.signcolumn = "yes"
|
||||
|
||||
vim.o.updatetime = 250
|
||||
|
||||
vim.o.timeoutlen = 300
|
||||
|
||||
vim.o.splitright = true
|
||||
vim.o.splitbelow = true
|
||||
|
||||
vim.o.list = true
|
||||
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||
|
||||
vim.o.inccommand = "split"
|
||||
|
||||
vim.o.cursorline = true
|
||||
|
||||
vim.o.scrolloff = 10
|
||||
|
||||
vim.o.confirm = true
|
||||
|
||||
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
|
||||
|
||||
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
||||
|
||||
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
|
||||
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
|
||||
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
||||
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
||||
|
||||
vim.keymap.set("n", "j", "gj", { silent = true })
|
||||
vim.keymap.set("n", "k", "gk", { silent = true })
|
||||
|
||||
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
||||
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
||||
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
||||
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
||||
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
desc = "Highlight when yanking (copying) text",
|
||||
group = vim.api.nvim_create_augroup("lux-highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.hl.on_yank()
|
||||
end,
|
||||
})
|
||||
+9
-1
@@ -4,6 +4,7 @@ require("lz.n").load({
|
||||
},
|
||||
{
|
||||
"luasnip",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
before = function()
|
||||
require("lz.n").trigger_load("friendly-snippets")
|
||||
end,
|
||||
@@ -15,6 +16,7 @@ require("lz.n").load({
|
||||
},
|
||||
{
|
||||
"colorful-menu.nvim",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
after = function()
|
||||
require("colorful-menu").setup({})
|
||||
end,
|
||||
@@ -51,8 +53,12 @@ require("lz.n").load({
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 500,
|
||||
window = {
|
||||
border = "none",
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
border = "none",
|
||||
draw = {
|
||||
columns = { { "kind_icon" }, { "label", gap = 1 } },
|
||||
components = {
|
||||
@@ -96,9 +102,11 @@ require("lz.n").load({
|
||||
|
||||
signature = {
|
||||
enabled = true,
|
||||
window = {
|
||||
border = "none",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
+1
-9
@@ -3,13 +3,8 @@ require("lz.n").load({
|
||||
"mini.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
after = function()
|
||||
-- Better Around/Inside textobjects
|
||||
require("mini.ai").setup({ n_lines = 500 })
|
||||
|
||||
-- Add/delete/replace surroundings (brackets, quotes, etc.)
|
||||
require("mini.surround").setup()
|
||||
|
||||
-- Auto-pairs (replaces nvim-autopairs)
|
||||
require("mini.pairs").setup()
|
||||
|
||||
local files = require("mini.files")
|
||||
@@ -27,9 +22,7 @@ require("lz.n").load({
|
||||
local hipatterns = require("mini.hipatterns")
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
-- Highlight hex color strings (#rrggbb) using that color
|
||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||
-- Highlight TODOs, FIXMEs, etc. (replaces todo-comments.nvim)
|
||||
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" },
|
||||
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" },
|
||||
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
|
||||
@@ -43,7 +36,7 @@ require("lz.n").load({
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
|
||||
pattern = { "help", "Trouble" },
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
@@ -62,4 +55,3 @@ require("lz.n").load({
|
||||
event = "BufEnter",
|
||||
},
|
||||
})
|
||||
|
||||
+2
-9
@@ -17,9 +17,6 @@ require("lz.n").load({
|
||||
require("conform").setup({
|
||||
notify_on_error = true,
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- languages here or re-enable it for the disabled ones.
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
return nil
|
||||
@@ -32,11 +29,7 @@ require("lz.n").load({
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
python = { "isort", "black" },
|
||||
--
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
python = { "ruff_fix", "ruff_format", "ruff_organize_imports" },
|
||||
},
|
||||
formatters = {
|
||||
stylua = {
|
||||
@@ -46,4 +39,4 @@ require("lz.n").load({
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
})
|
||||
+104
-45
@@ -6,9 +6,7 @@ require("lz.n").load({
|
||||
-- Setup typst-preview
|
||||
require("typst-preview").setup({
|
||||
-- Optionally configure things here
|
||||
dependencies_bin = {
|
||||
-- For example, use tinymist as the LSP if that's what you are running
|
||||
},
|
||||
dependencies_bin = require("nix-info").settings.typstPreviewDependencies,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>tp", "<cmd>TypstPreviewToggle<cr>", { desc = "[T]ypst [P]review Toggle" })
|
||||
@@ -21,7 +19,7 @@ require("lz.n").load({
|
||||
after = function()
|
||||
require("lazydev").setup({
|
||||
library = {
|
||||
{ words = { "nixCats", "settings" }, path = "nix-info" },
|
||||
{ words = { "nix%-info", "settings" }, path = "nix-info" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
@@ -33,10 +31,73 @@ require("lz.n").load({
|
||||
require("lz.n").trigger_load("lazydev.nvim")
|
||||
end,
|
||||
after = function()
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
local telescope_plugins = {
|
||||
"project.nvim",
|
||||
"telescope.nvim",
|
||||
"telescope-fzf-native.nvim",
|
||||
"telescope-ui-select.nvim",
|
||||
}
|
||||
|
||||
local telescope_picker = function(picker)
|
||||
return function()
|
||||
require("lz.n").trigger_load(telescope_plugins)
|
||||
require("telescope.builtin")[picker]()
|
||||
end
|
||||
end
|
||||
|
||||
local lsp_float = { border = "single" }
|
||||
|
||||
local navic_excluded_filetypes = {
|
||||
[""] = true,
|
||||
help = true,
|
||||
minifiles = true,
|
||||
TelescopePrompt = true,
|
||||
Trouble = true,
|
||||
}
|
||||
|
||||
local function navic_enabled(bufnr)
|
||||
return vim.bo[bufnr].buftype == "" and not navic_excluded_filetypes[vim.bo[bufnr].filetype]
|
||||
end
|
||||
|
||||
_G.lux_navic_location = function()
|
||||
local ok, navic = pcall(require, "nvim-navic")
|
||||
if not ok or not navic.is_available() then
|
||||
return ""
|
||||
end
|
||||
|
||||
return navic.get_location()
|
||||
end
|
||||
|
||||
local function update_winbar(winid, bufnr)
|
||||
if not vim.api.nvim_win_is_valid(winid) then
|
||||
return
|
||||
end
|
||||
|
||||
local is_float = vim.api.nvim_win_get_config(winid).relative ~= ""
|
||||
local winbar = ""
|
||||
if not is_float and vim.b[bufnr].lux_navic_attached and navic_enabled(bufnr) then
|
||||
winbar = "%{%v:lua.lux_navic_location()%}"
|
||||
end
|
||||
|
||||
vim.api.nvim_set_option_value("winbar", winbar, { win = winid })
|
||||
end
|
||||
|
||||
local function update_winbars_for_buffer(bufnr)
|
||||
for _, winid in ipairs(vim.fn.win_findbuf(bufnr)) do
|
||||
update_winbar(winid, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter", "WinEnter" }, {
|
||||
group = vim.api.nvim_create_augroup("lux-navic-winbar", { clear = true }),
|
||||
callback = function(args)
|
||||
update_winbar(vim.api.nvim_get_current_win(), args.buf)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("lux-lsp-attach", { clear = true }),
|
||||
callback = function(args)
|
||||
-- Get the client and buffer from the event arguments [cite: 119]
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
local bufnr = args.buf
|
||||
|
||||
@@ -45,23 +106,35 @@ require("lz.n").load({
|
||||
vim.keymap.set(mode, keys, func, { buffer = bufnr, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
-- Standard LSP functions
|
||||
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" })
|
||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
map("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
map("K", function()
|
||||
vim.lsp.buf.hover(lsp_float)
|
||||
end, "Hover Documentation")
|
||||
map("<C-s>", function()
|
||||
vim.lsp.buf.signature_help(lsp_float)
|
||||
end, "Signature Help", { "i", "s" })
|
||||
|
||||
-- Telescope Mappings
|
||||
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
|
||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
||||
map("<leader>D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
|
||||
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
|
||||
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
||||
map("gd", telescope_picker("lsp_definitions"), "[G]oto [D]efinition")
|
||||
map("gr", telescope_picker("lsp_references"), "[G]oto [R]eferences")
|
||||
map("gI", telescope_picker("lsp_implementations"), "[G]oto [I]mplementation")
|
||||
map("<leader>D", telescope_picker("lsp_type_definitions"), "Type [D]efinition")
|
||||
map("<leader>ds", telescope_picker("lsp_document_symbols"), "[D]ocument [S]ymbols")
|
||||
map("<leader>ws", telescope_picker("lsp_dynamic_workspace_symbols"), "[W]orkspace [S]ymbols")
|
||||
|
||||
if client and client:supports_method("textDocument/documentSymbol", bufnr) and navic_enabled(bufnr) then
|
||||
require("lz.n").trigger_load("nvim-navic")
|
||||
local ok, navic = pcall(require, "nvim-navic")
|
||||
if ok then
|
||||
navic.attach(client, bufnr)
|
||||
vim.b[bufnr].lux_navic_attached = true
|
||||
update_winbars_for_buffer(bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
-- Highlight references (Document Highlight)
|
||||
if client and client:supports_method("textDocument/documentHighlight", bufnr) then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("lux-lsp-highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = bufnr,
|
||||
group = highlight_augroup,
|
||||
@@ -75,15 +148,14 @@ require("lz.n").load({
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
||||
group = vim.api.nvim_create_augroup("lux-lsp-detach", { clear = true }),
|
||||
callback = function(event)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event.buf })
|
||||
vim.api.nvim_clear_autocmds({ group = "lux-lsp-highlight", buffer = event.buf })
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Inlay Hints
|
||||
if client and client:supports_method("textDocument/inlayHint", bufnr) then
|
||||
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
||||
map("<leader>th", function()
|
||||
@@ -93,10 +165,9 @@ require("lz.n").load({
|
||||
end,
|
||||
})
|
||||
|
||||
-- 1. Setup Diagnostics (Visuals)
|
||||
vim.diagnostic.config({
|
||||
severity_sort = true,
|
||||
-- underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
underline = true,
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
@@ -105,19 +176,13 @@ require("lz.n").load({
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
},
|
||||
},
|
||||
virtual_text = {
|
||||
virtual_text = false,
|
||||
virtual_lines = {
|
||||
current_line = true,
|
||||
},
|
||||
float = {
|
||||
border = "single",
|
||||
source = "if_many",
|
||||
spacing = 4,
|
||||
prefix = "●",
|
||||
format = function(diagnostic)
|
||||
local diagnostic_message = {
|
||||
[vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||
[vim.diagnostic.severity.WARN] = diagnostic.message,
|
||||
[vim.diagnostic.severity.INFO] = diagnostic.message,
|
||||
[vim.diagnostic.severity.HINT] = diagnostic.message,
|
||||
}
|
||||
return diagnostic_message[diagnostic.severity]
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -126,7 +191,7 @@ require("lz.n").load({
|
||||
Lua = {
|
||||
runtime = { version = "LuaJIT" },
|
||||
signatureHelp = { enabled = true },
|
||||
diagnostics = { globals = { "nixCats", "vim" } },
|
||||
diagnostics = { globals = { "vim" } },
|
||||
telemetry = { enabled = false },
|
||||
completion = { callSnippet = "Replace" },
|
||||
},
|
||||
@@ -136,7 +201,6 @@ require("lz.n").load({
|
||||
|
||||
local settings = require("nix-info").settings
|
||||
|
||||
-- Nix
|
||||
vim.lsp.config("nixd", {
|
||||
settings = {
|
||||
nixd = {
|
||||
@@ -151,19 +215,11 @@ require("lz.n").load({
|
||||
})
|
||||
vim.lsp.enable("nixd")
|
||||
|
||||
-- Dafny
|
||||
vim.lsp.enable("dafny")
|
||||
|
||||
-- TypeScript/JS
|
||||
vim.lsp.enable("ts_ls")
|
||||
|
||||
-- Rust
|
||||
vim.lsp.enable("rust_analyzer")
|
||||
|
||||
-- Python
|
||||
vim.lsp.enable("ty")
|
||||
vim.lsp.enable("ruff")
|
||||
|
||||
vim.lsp.enable("astro")
|
||||
|
||||
vim.lsp.config("tinymist", {
|
||||
@@ -186,6 +242,9 @@ require("lz.n").load({
|
||||
after = function()
|
||||
require("trouble").setup({
|
||||
focus = true,
|
||||
preview = {
|
||||
border = "single",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
@@ -0,0 +1,111 @@
|
||||
local telescope_plugins = {
|
||||
"project.nvim",
|
||||
"telescope.nvim",
|
||||
"telescope-fzf-native.nvim",
|
||||
"telescope-ui-select.nvim",
|
||||
}
|
||||
|
||||
local function load_telescope()
|
||||
require("lz.n").trigger_load(telescope_plugins)
|
||||
return require("telescope.builtin")
|
||||
end
|
||||
|
||||
local function map_picker(lhs, picker, desc, opts)
|
||||
vim.keymap.set("n", lhs, function()
|
||||
load_telescope()[picker](opts or {})
|
||||
end, { desc = desc })
|
||||
end
|
||||
|
||||
map_picker("<leader>sh", "help_tags", "[S]earch [H]elp")
|
||||
map_picker("<leader>sk", "keymaps", "[S]earch [K]eymaps")
|
||||
map_picker("<leader>sf", "find_files", "[S]earch [F]iles")
|
||||
map_picker("<leader>ss", "builtin", "[S]earch [S]elect Telescope")
|
||||
map_picker("<leader>sw", "grep_string", "[S]earch current [W]ord")
|
||||
map_picker("<leader>sg", "live_grep", "[S]earch by [G]rep")
|
||||
map_picker("<leader>sd", "diagnostics", "[S]earch [D]iagnostics")
|
||||
map_picker("<leader>sr", "resume", "[S]earch [R]esume")
|
||||
map_picker("<leader>s.", "oldfiles", '[S]earch Recent Files ("." for repeat)')
|
||||
map_picker("<leader><leader>", "buffers", "[ ] Find existing buffers")
|
||||
map_picker("<leader>sn", "find_files", "[S]earch [N]eovim files", { cwd = vim.fn.stdpath("config") })
|
||||
|
||||
vim.keymap.set("n", "<leader>sp", function()
|
||||
load_telescope()
|
||||
require("telescope").extensions.projects.projects({})
|
||||
end, { desc = "[S]earch [P]rojects" })
|
||||
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
local builtin = load_telescope()
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
||||
|
||||
vim.keymap.set("n", "<leader>s/", function()
|
||||
load_telescope().live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]earch [/] in Open Files" })
|
||||
|
||||
require("lz.n").load({
|
||||
{
|
||||
"project.nvim",
|
||||
event = "VimEnter",
|
||||
after = function()
|
||||
require("project").setup({
|
||||
manual_mode = false,
|
||||
lsp = { enabled = true },
|
||||
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", "flake.nix" },
|
||||
show_hidden = true,
|
||||
scope_chdir = "global",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"telescope-fzf-native.nvim",
|
||||
},
|
||||
{
|
||||
"telescope-ui-select.nvim",
|
||||
},
|
||||
{
|
||||
"telescope.nvim",
|
||||
cmd = "Telescope",
|
||||
before = function()
|
||||
require("lz.n").trigger_load("project.nvim")
|
||||
end,
|
||||
after = function()
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
path_display = { "truncate" },
|
||||
border = true,
|
||||
borderchars = { "─", "│", "─", "│", "┌", "┐", "┘", "└" },
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
prompt_position = "top",
|
||||
},
|
||||
sorting_strategy = "ascending",
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("lz.n").trigger_load({ "telescope-fzf-native.nvim", "telescope-ui-select.nvim" })
|
||||
pcall(require("telescope").load_extension, "projects")
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "ui-select")
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,201 @@
|
||||
require("lz.n").load({
|
||||
{
|
||||
"theme-loader",
|
||||
event = "VimEnter",
|
||||
load = function()
|
||||
local settings = require("nix-info").settings
|
||||
local theme_code = settings.themeSetup
|
||||
|
||||
local func, err = loadstring(theme_code)
|
||||
if func then
|
||||
func()
|
||||
else
|
||||
print("Error loading theme code: " .. err)
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"kulala.nvim",
|
||||
after = function()
|
||||
require("kulala").setup({
|
||||
global_keymaps = true,
|
||||
global_keymaps_prefix = "<leader>R",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lualine.nvim",
|
||||
event = "VimEnter",
|
||||
after = function()
|
||||
local filename = {
|
||||
"filename",
|
||||
path = 1,
|
||||
symbols = {
|
||||
modified = "●",
|
||||
readonly = "",
|
||||
unnamed = "[No Name]",
|
||||
},
|
||||
}
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
globalstatus = false,
|
||||
component_separators = "",
|
||||
section_separators = "",
|
||||
theme = "kanagawa",
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { filename },
|
||||
|
||||
lualine_x = { "lsp_status" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { filename },
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"bufferline.nvim",
|
||||
event = "VimEnter",
|
||||
before = function()
|
||||
require("lz.n").trigger_load("mini.nvim")
|
||||
end,
|
||||
after = function()
|
||||
require("bufferline").setup({
|
||||
options = {
|
||||
mode = "buffers",
|
||||
numbers = "none",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_indicator = function(count, level)
|
||||
local icon = level:match("error") and " " or level:match("warning") and " " or " "
|
||||
return " " .. icon .. count
|
||||
end,
|
||||
always_show_bufferline = true,
|
||||
show_buffer_close_icons = false,
|
||||
show_close_icon = false,
|
||||
separator_style = "thin",
|
||||
sort_by = "insert_after_current",
|
||||
offsets = {
|
||||
{
|
||||
filetype = "minifiles",
|
||||
text = "Files",
|
||||
separator = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<C-0>", "<cmd>BufferLineCycleNext<cr>", { desc = "[B]uffer [N]ext" })
|
||||
vim.keymap.set("n", "<C-9>", "<cmd>BufferLineCyclePrev<cr>", { desc = "[B]uffer [P]revious" })
|
||||
vim.keymap.set("n", "<leader>bb", "<cmd>BufferLinePick<cr>", { desc = "[B]uffer [B]rowse" })
|
||||
vim.keymap.set("n", "<leader>bd", "<cmd>bdelete<cr>", { desc = "[B]uffer [D]elete" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
after = function()
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { text = "│" },
|
||||
change = { text = "│" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
untracked = { text = "┆" },
|
||||
},
|
||||
signs_staged_enable = true,
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
local map = function(mode, lhs, rhs, desc, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
opts.desc = desc
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
map("n", "]h", function()
|
||||
if vim.wo.diff then
|
||||
return "]h"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.nav_hunk("next")
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, "Next git hunk", { expr = true })
|
||||
|
||||
map("n", "[h", function()
|
||||
if vim.wo.diff then
|
||||
return "[h"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.nav_hunk("prev")
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, "Previous git hunk", { expr = true })
|
||||
|
||||
map("n", "<leader>hp", gs.preview_hunk, "Git [H]unk [P]review")
|
||||
map("n", "<leader>hs", gs.stage_hunk, "Git [H]unk [S]tage")
|
||||
map("n", "<leader>hr", gs.reset_hunk, "Git [H]unk [R]eset")
|
||||
map("n", "<leader>hu", gs.undo_stage_hunk, "Git [H]unk [U]ndo stage")
|
||||
map("n", "<leader>hS", gs.stage_buffer, "Git [H]unk [S]tage buffer")
|
||||
map("n", "<leader>hR", gs.reset_buffer, "Git [H]unk [R]eset buffer")
|
||||
map("v", "<leader>hs", function()
|
||||
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, "Git [H]unk [S]tage")
|
||||
map("v", "<leader>hr", function()
|
||||
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, "Git [H]unk [R]eset")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"zen-mode.nvim",
|
||||
cmd = "ZenMode",
|
||||
after = function()
|
||||
require("zen-mode").setup({
|
||||
window = {
|
||||
options = {
|
||||
linebreak = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"which-key.nvim",
|
||||
event = "VimEnter",
|
||||
before = function()
|
||||
require("lz.n").trigger_load("mini.nvim")
|
||||
end,
|
||||
after = function()
|
||||
require("which-key").setup({
|
||||
preset = "modern",
|
||||
delay = 200,
|
||||
icons = {
|
||||
mappings = true,
|
||||
keys = {},
|
||||
},
|
||||
|
||||
spec = {
|
||||
{ "<leader>b", group = "[B]uffer" },
|
||||
{ "<leader>s", group = "[S]earch" },
|
||||
{ "<leader>t", group = "[T]oggle" },
|
||||
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,23 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.nftables-firewall = {
|
||||
networking.nftables.enable = true;
|
||||
};
|
||||
|
||||
flake.modules.nixos.network-manager = {
|
||||
networking.networkmanager.enable = true;
|
||||
};
|
||||
|
||||
flake.modules.nixos.server-firewall =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
nixosModules.nftables-firewall
|
||||
];
|
||||
|
||||
networking.firewall.allowPing = false;
|
||||
};
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
{
|
||||
browserCommand,
|
||||
lib,
|
||||
terminalPackage,
|
||||
launcherCommand,
|
||||
shortcutCommands,
|
||||
terminalCommand,
|
||||
}:
|
||||
{
|
||||
# Application and utility launchers
|
||||
"Mod+Return" = {
|
||||
action.spawn = "${lib.getExe terminalPackage}";
|
||||
action.spawn = terminalCommand;
|
||||
hotkey-overlay.title = "Terminal";
|
||||
};
|
||||
"Mod+B" = {
|
||||
@@ -14,13 +16,36 @@
|
||||
};
|
||||
"Mod+Space" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
"vicinae"
|
||||
"toggle"
|
||||
];
|
||||
action.spawn = launcherCommand;
|
||||
hotkey-overlay.title = "App Launcher";
|
||||
};
|
||||
"Mod+E" = {
|
||||
repeat = false;
|
||||
action.spawn = shortcutCommands.neovimProjects;
|
||||
hotkey-overlay.title = "Neovim Projects";
|
||||
};
|
||||
"Mod+Ctrl+Return" = {
|
||||
repeat = false;
|
||||
action.spawn = shortcutCommands.nixosTerminal;
|
||||
hotkey-overlay.title = "NixOS Config Terminal";
|
||||
};
|
||||
"Mod+Ctrl+Shift+Return" = {
|
||||
repeat = false;
|
||||
action.spawn = shortcutCommands.nixosSwitch;
|
||||
hotkey-overlay.title = "NixOS Switch";
|
||||
};
|
||||
"Mod+Ctrl+E" = {
|
||||
repeat = false;
|
||||
action.spawn = shortcutCommands.editSecrets;
|
||||
hotkey-overlay.title = "Edit Secrets";
|
||||
};
|
||||
"Mod+Ctrl+C" = {
|
||||
repeat = false;
|
||||
action.spawn = shortcutCommands.pickColor;
|
||||
hotkey-overlay.title = "Pick Color";
|
||||
};
|
||||
|
||||
# Hardware media, volume, and brightness keys
|
||||
"XF86AudioPlay" = {
|
||||
action.spawn-sh = "playerctl play-pause";
|
||||
allow-when-locked = true;
|
||||
@@ -62,23 +87,26 @@
|
||||
allow-when-locked = true;
|
||||
};
|
||||
|
||||
# Screenshots
|
||||
"Mod+S".action.screenshot = [ ];
|
||||
"Mod+Ctrl+S".action.screenshot-screen = [ ];
|
||||
"Mod+Alt+S".action.screenshot-window = [ ];
|
||||
|
||||
# Session and compositor controls
|
||||
"Mod+Shift+Slash".action.show-hotkey-overlay = [ ];
|
||||
"Mod+Escape" = {
|
||||
action.toggle-keyboard-shortcuts-inhibit = [ ];
|
||||
allow-inhibiting = false;
|
||||
};
|
||||
"Mod+Alt+L" = {
|
||||
"Mod+Ctrl+L" = {
|
||||
action.spawn-sh = "loginctl lock-session";
|
||||
hotkey-overlay.title = "Lock Screen";
|
||||
};
|
||||
"Mod+Shift+E".action.quit = [ ];
|
||||
"Mod+Ctrl+Shift+Q".action.quit = [ ];
|
||||
"Ctrl+Alt+Delete".action.quit = [ ];
|
||||
"Mod+Shift+P".action.power-off-monitors = [ ];
|
||||
|
||||
# Overview and window close
|
||||
"Mod+O" = {
|
||||
action.toggle-overview = [ ];
|
||||
repeat = false;
|
||||
@@ -88,58 +116,66 @@
|
||||
repeat = false;
|
||||
};
|
||||
|
||||
# Keyboard focus movement
|
||||
"Mod+Left".action.focus-column-or-monitor-left = [ ];
|
||||
"Mod+Down".action.focus-window-down = [ ];
|
||||
"Mod+Up".action.focus-window-up = [ ];
|
||||
"Mod+Right".action.focus-column-or-monitor-right = [ ];
|
||||
"Mod+H".action.focus-column-or-monitor-left = [ ];
|
||||
"Mod+J".action.focus-window-down = [ ];
|
||||
"Mod+K".action.focus-window-up = [ ];
|
||||
"Mod+L".action.focus-column-or-monitor-right = [ ];
|
||||
|
||||
"Mod+Ctrl+Left".action.move-column-left = [ ];
|
||||
"Mod+Ctrl+Down".action.move-window-down = [ ];
|
||||
"Mod+Ctrl+Up".action.move-window-up = [ ];
|
||||
"Mod+Ctrl+Right".action.move-column-right = [ ];
|
||||
"Mod+Ctrl+H".action.move-column-left = [ ];
|
||||
"Mod+Ctrl+J".action.move-window-down = [ ];
|
||||
"Mod+Ctrl+K".action.move-window-up = [ ];
|
||||
"Mod+Ctrl+L".action.move-column-right = [ ];
|
||||
# Keyboard window and column movement
|
||||
"Mod+Alt+Left".action.move-column-left-or-to-monitor-left = [ ];
|
||||
"Mod+Alt+Down".action.move-window-down-or-to-workspace-down = [ ];
|
||||
"Mod+Alt+Up".action.move-window-up-or-to-workspace-up = [ ];
|
||||
"Mod+Alt+Right".action.move-column-right-or-to-monitor-right = [ ];
|
||||
"Mod+Alt+H".action.move-column-left-or-to-monitor-left = [ ];
|
||||
"Mod+Alt+J".action.move-window-down-or-to-workspace-down = [ ];
|
||||
"Mod+Alt+K".action.move-window-up-or-to-workspace-up = [ ];
|
||||
"Mod+Alt+L".action.move-column-right-or-to-monitor-right = [ ];
|
||||
|
||||
# First and last column navigation
|
||||
"Mod+Home".action.focus-column-first = [ ];
|
||||
"Mod+End".action.focus-column-last = [ ];
|
||||
"Mod+Ctrl+Home".action.move-column-to-first = [ ];
|
||||
"Mod+Ctrl+End".action.move-column-to-last = [ ];
|
||||
"Mod+Alt+Home".action.move-column-to-first = [ ];
|
||||
"Mod+Alt+End".action.move-column-to-last = [ ];
|
||||
|
||||
# Move focus, columns, and workspaces across monitors
|
||||
"Mod+Tab".action.focus-monitor-next = [ ];
|
||||
"Mod+A" = {
|
||||
repeat = false;
|
||||
action.spawn = shortcutCommands.swapMonitorWorkspaces;
|
||||
hotkey-overlay.title = "Swap Monitor Workspaces";
|
||||
};
|
||||
"Mod+Alt+Tab".action.move-column-to-monitor-next = [ ];
|
||||
"Mod+Shift+Tab".action.move-workspace-to-monitor-next = [ ];
|
||||
|
||||
"Mod+Shift+Left".action.focus-monitor-left = [ ];
|
||||
"Mod+Shift+Down".action.focus-monitor-down = [ ];
|
||||
"Mod+Shift+Up".action.focus-monitor-up = [ ];
|
||||
"Mod+Shift+Right".action.focus-monitor-right = [ ];
|
||||
"Mod+Shift+H".action.focus-monitor-left = [ ];
|
||||
"Mod+Shift+J".action.focus-monitor-down = [ ];
|
||||
"Mod+Shift+K".action.focus-monitor-up = [ ];
|
||||
"Mod+Shift+L".action.focus-monitor-right = [ ];
|
||||
|
||||
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = [ ];
|
||||
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = [ ];
|
||||
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = [ ];
|
||||
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = [ ];
|
||||
"Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = [ ];
|
||||
"Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = [ ];
|
||||
"Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = [ ];
|
||||
"Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = [ ];
|
||||
|
||||
# Linear workspace navigation
|
||||
"Mod+Page_Down".action.focus-workspace-down = [ ];
|
||||
"Mod+Page_Up".action.focus-workspace-up = [ ];
|
||||
"Mod+U".action.focus-workspace-down = [ ];
|
||||
"Mod+I".action.focus-workspace-up = [ ];
|
||||
|
||||
"Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = [ ];
|
||||
"Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = [ ];
|
||||
"Mod+Ctrl+U".action.move-column-to-workspace-down = [ ];
|
||||
"Mod+Ctrl+I".action.move-column-to-workspace-up = [ ];
|
||||
# Move columns between adjacent workspaces
|
||||
"Mod+Alt+Page_Down".action.move-column-to-workspace-down = [ ];
|
||||
"Mod+Alt+Page_Up".action.move-column-to-workspace-up = [ ];
|
||||
"Mod+Alt+U".action.move-column-to-workspace-down = [ ];
|
||||
"Mod+Alt+I".action.move-column-to-workspace-up = [ ];
|
||||
|
||||
# Reorder workspaces
|
||||
"Mod+Shift+Page_Down".action.move-workspace-down = [ ];
|
||||
"Mod+Shift+Page_Up".action.move-workspace-up = [ ];
|
||||
"Mod+Shift+U".action.move-workspace-down = [ ];
|
||||
"Mod+Shift+I".action.move-workspace-up = [ ];
|
||||
|
||||
# Mouse workspace navigation
|
||||
"Mod+WheelScrollDown" = {
|
||||
action.focus-workspace-down = [ ];
|
||||
cooldown-ms = 150;
|
||||
@@ -148,24 +184,24 @@
|
||||
action.focus-workspace-up = [ ];
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollDown" = {
|
||||
"Mod+Alt+WheelScrollDown" = {
|
||||
action.move-column-to-workspace-down = [ ];
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollUp" = {
|
||||
"Mod+Alt+WheelScrollUp" = {
|
||||
action.move-column-to-workspace-up = [ ];
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
|
||||
"Mod+WheelScrollRight".action.focus-column-right = [ ];
|
||||
"Mod+WheelScrollLeft".action.focus-column-left = [ ];
|
||||
"Mod+Ctrl+WheelScrollRight".action.move-column-right = [ ];
|
||||
"Mod+Ctrl+WheelScrollLeft".action.move-column-left = [ ];
|
||||
"Mod+Shift+WheelScrollDown".action.focus-column-right = [ ];
|
||||
"Mod+Shift+WheelScrollUp".action.focus-column-left = [ ];
|
||||
"Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = [ ];
|
||||
"Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = [ ];
|
||||
# Mouse column navigation and movement
|
||||
"Mod+WheelScrollRight".action.focus-column-or-monitor-right = [ ];
|
||||
"Mod+WheelScrollLeft".action.focus-column-or-monitor-left = [ ];
|
||||
"Mod+Alt+WheelScrollRight".action.move-column-right-or-to-monitor-right = [ ];
|
||||
"Mod+Alt+WheelScrollLeft".action.move-column-left-or-to-monitor-left = [ ];
|
||||
"Mod+Shift+WheelScrollDown".action.focus-column-or-monitor-right = [ ];
|
||||
"Mod+Shift+WheelScrollUp".action.focus-column-or-monitor-left = [ ];
|
||||
|
||||
# Direct workspace focus
|
||||
"Mod+1".action.focus-workspace = 1;
|
||||
"Mod+2".action.focus-workspace = 2;
|
||||
"Mod+3".action.focus-workspace = 3;
|
||||
@@ -176,6 +212,7 @@
|
||||
"Mod+8".action.focus-workspace = 8;
|
||||
"Mod+9".action.focus-workspace = 9;
|
||||
|
||||
# Move columns to numbered workspaces
|
||||
"Mod+Ctrl+1".action.move-column-to-workspace = 1;
|
||||
"Mod+Ctrl+2".action.move-column-to-workspace = 2;
|
||||
"Mod+Ctrl+3".action.move-column-to-workspace = 3;
|
||||
@@ -186,27 +223,34 @@
|
||||
"Mod+Ctrl+8".action.move-column-to-workspace = 8;
|
||||
"Mod+Ctrl+9".action.move-column-to-workspace = 9;
|
||||
|
||||
# Add and remove windows from columns
|
||||
"Mod+BracketLeft".action.consume-or-expel-window-left = [ ];
|
||||
"Mod+BracketRight".action.consume-or-expel-window-right = [ ];
|
||||
"Mod+Comma".action.consume-window-into-column = [ ];
|
||||
"Mod+Period".action.expel-window-from-column = [ ];
|
||||
|
||||
# Column and window presentation modes
|
||||
"Mod+R".action.switch-preset-column-width = [ ];
|
||||
"Mod+Shift+R".action.switch-preset-window-height = [ ];
|
||||
"Mod+Shift+R".action.switch-preset-column-width-back = [ ];
|
||||
"Mod+Ctrl+R".action.reset-window-height = [ ];
|
||||
"Mod+Ctrl+Shift+R".action.switch-preset-window-height = [ ];
|
||||
"Mod+F".action.maximize-column = [ ];
|
||||
"Mod+Shift+F".action.fullscreen-window = [ ];
|
||||
"Mod+M".action.maximize-window-to-edges = [ ];
|
||||
"Mod+Ctrl+F".action.expand-column-to-available-width = [ ];
|
||||
"Mod+C".action.center-column = [ ];
|
||||
"Mod+Ctrl+C".action.center-visible-columns = [ ];
|
||||
|
||||
# Manual column width and window height adjustments
|
||||
"Mod+Shift+H".action.set-column-width = "-10%";
|
||||
"Mod+Shift+L".action.set-column-width = "+10%";
|
||||
"Mod+Shift+J".action.set-window-height = "+10%";
|
||||
"Mod+Shift+K".action.set-window-height = "-10%";
|
||||
"Mod+Minus".action.set-column-width = "-10%";
|
||||
"Mod+Equal".action.set-column-width = "+10%";
|
||||
"Mod+Shift+Minus".action.set-window-height = "-10%";
|
||||
"Mod+Shift+Equal".action.set-window-height = "+10%";
|
||||
|
||||
"Mod+V".action.toggle-window-floating = [ ];
|
||||
# Floating and tabbed layout toggles
|
||||
"Mod+Alt+V".action.toggle-window-floating = [ ];
|
||||
"Mod+Shift+V".action.switch-focus-between-floating-and-tiling = [ ];
|
||||
"Mod+W".action.toggle-column-tabbed-display = [ ];
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
repo,
|
||||
}:
|
||||
let
|
||||
nixosConfigDir = repo.account.nixosConfigurationPath;
|
||||
mkTerminalScript =
|
||||
{
|
||||
name,
|
||||
workdir ? nixosConfigDir,
|
||||
command ? null,
|
||||
runtimeInputs ? [ ],
|
||||
}:
|
||||
let
|
||||
args = lib.optionals (command != null) [
|
||||
"--"
|
||||
"${pkgs.bash}/bin/bash"
|
||||
"-lc"
|
||||
command
|
||||
];
|
||||
argString = lib.concatMapStringsSep " " lib.escapeShellArg args;
|
||||
in
|
||||
pkgs.writeShellApplication {
|
||||
inherit name runtimeInputs;
|
||||
checkPhase = "";
|
||||
text = lib.concatStringsSep "\n" [
|
||||
"# shellcheck disable=SC2016"
|
||||
"cd ${lib.escapeShellArg workdir}"
|
||||
"exec ${lib.escapeShellArg config.facts.desktop.terminalCommand} ${argString}"
|
||||
];
|
||||
};
|
||||
in
|
||||
rec {
|
||||
scripts = {
|
||||
nixosTerminal = mkTerminalScript {
|
||||
name = "niri-shortcut-nixos-terminal";
|
||||
};
|
||||
|
||||
nixosSwitch = mkTerminalScript {
|
||||
name = "niri-shortcut-nixos-switch";
|
||||
runtimeInputs = [
|
||||
pkgs.coreutils
|
||||
pkgs.nh
|
||||
];
|
||||
command = ''
|
||||
set -o pipefail
|
||||
|
||||
log_dir="''${XDG_STATE_HOME:-$HOME/.local/state}/nixos-switch"
|
||||
mkdir -p "$log_dir"
|
||||
log="$log_dir/$(date +%Y%m%d-%H%M%S).log"
|
||||
status_file="$(mktemp)"
|
||||
|
||||
printf 'Running nh os switch in %s\n\n' ${lib.escapeShellArg nixosConfigDir}
|
||||
(
|
||||
cd ${lib.escapeShellArg nixosConfigDir}
|
||||
nh os switch
|
||||
printf '%s' "$?" > "$status_file"
|
||||
) 2>&1 | tee "$log"
|
||||
|
||||
status="$(cat "$status_file")"
|
||||
rm -f "$status_file"
|
||||
|
||||
printf '\nLog: %s\n' "$log"
|
||||
if [ "$status" -eq 0 ]; then
|
||||
printf 'NixOS switch completed successfully.\n'
|
||||
else
|
||||
printf 'NixOS switch failed with exit code %s.\n' "$status"
|
||||
fi
|
||||
|
||||
printf 'Press Enter to close...'
|
||||
read -r _
|
||||
exit "$status"
|
||||
'';
|
||||
};
|
||||
|
||||
editSecrets = mkTerminalScript {
|
||||
name = "niri-shortcut-edit-secrets";
|
||||
runtimeInputs = [ pkgs.sops ];
|
||||
command = ''
|
||||
sops edit ${lib.escapeShellArg "${nixosConfigDir}/modules/secrets/secrets.yaml"}
|
||||
'';
|
||||
};
|
||||
|
||||
neovimProjects = mkTerminalScript {
|
||||
name = "niri-shortcut-neovim-projects";
|
||||
command = ''
|
||||
nvim -c 'Telescope projects'
|
||||
'';
|
||||
};
|
||||
|
||||
pickColor = pkgs.writeShellApplication {
|
||||
name = "niri-shortcut-pick-color";
|
||||
runtimeInputs = [
|
||||
pkgs.libnotify
|
||||
pkgs.niri
|
||||
pkgs.wl-clipboard
|
||||
];
|
||||
text = ''
|
||||
color="$(niri msg pick-color)"
|
||||
printf '%s' "$color" | wl-copy
|
||||
notify-send 'Color picked' "$color"
|
||||
'';
|
||||
};
|
||||
|
||||
swapMonitorWorkspaces = pkgs.writeShellApplication {
|
||||
name = "niri-shortcut-swap-monitor-workspaces";
|
||||
runtimeInputs = [
|
||||
pkgs.jq
|
||||
pkgs.niri
|
||||
];
|
||||
text = ''
|
||||
focused_output="$(niri msg --json focused-output | jq -r '.name // empty')"
|
||||
if [ -z "$focused_output" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
niri msg action focus-monitor-next
|
||||
|
||||
target_output="$(niri msg --json focused-output | jq -r '.name // empty')"
|
||||
if [ -z "$target_output" ] || [ "$target_output" = "$focused_output" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
target_workspace_idx="$(
|
||||
niri msg --json workspaces \
|
||||
| jq -r --arg output "$target_output" '
|
||||
first(.[] | select(.output == $output and .is_active) | .idx) // empty
|
||||
'
|
||||
)"
|
||||
if [ -z "$target_workspace_idx" ]; then
|
||||
niri msg action focus-monitor "$focused_output"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
niri msg action focus-monitor "$focused_output"
|
||||
niri msg action move-workspace-to-monitor "$target_output"
|
||||
niri msg action focus-workspace "$target_workspace_idx"
|
||||
niri msg action move-workspace-to-monitor "$focused_output"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
commands = lib.mapAttrs (_: lib.getExe) scripts;
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.niri =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ inputs.niri.nixosModules.niri ];
|
||||
|
||||
home-manager.sharedModules = [ hmModules.niri ];
|
||||
|
||||
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
|
||||
|
||||
programs = {
|
||||
dconf.enable = true;
|
||||
niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri-unstable;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
gvfs.enable = true;
|
||||
udisks2.enable = true;
|
||||
};
|
||||
|
||||
xdg.portal.enable = true;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.niri =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
borderPalette = repo.theme.kanagawa.palette.niri.border;
|
||||
shortcuts = import ./_shortcuts.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
repo
|
||||
;
|
||||
};
|
||||
machine = osConfig.facts.machine;
|
||||
in
|
||||
{
|
||||
home = {
|
||||
sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
packages =
|
||||
with pkgs;
|
||||
[
|
||||
playerctl
|
||||
brightnessctl
|
||||
xwayland-satellite
|
||||
]
|
||||
++ lib.attrValues shortcuts.scripts;
|
||||
};
|
||||
|
||||
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
|
||||
|
||||
programs.niri.settings = {
|
||||
outputs = lib.mapAttrs (
|
||||
_: display:
|
||||
let
|
||||
scale = display.scale or null;
|
||||
width = display.width or null;
|
||||
height = display.height or null;
|
||||
refresh = display.refresh or null;
|
||||
in
|
||||
{
|
||||
position = {
|
||||
x = display.x or 0;
|
||||
y = display.y or 0;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (display.primary or false) {
|
||||
"focus-at-startup" = true;
|
||||
}
|
||||
// lib.optionalAttrs (scale != null) {
|
||||
inherit scale;
|
||||
}
|
||||
// lib.optionalAttrs (width != null && height != null && refresh != null) {
|
||||
mode = {
|
||||
inherit
|
||||
width
|
||||
height
|
||||
refresh
|
||||
;
|
||||
};
|
||||
}
|
||||
) (machine.displays or { });
|
||||
|
||||
environment.DISPLAY = ":0";
|
||||
spawn-at-startup = [
|
||||
{ command = [ "xwayland-satellite" ]; }
|
||||
{ command = [ "noctalia-shell" ]; }
|
||||
];
|
||||
prefer-no-csd = true;
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%dT%H:%M:%S.png";
|
||||
|
||||
animations.slowdown = 0.6;
|
||||
|
||||
cursor = {
|
||||
inherit (config.home.pointerCursor) size;
|
||||
theme = config.home.pointerCursor.name;
|
||||
hide-after-inactive-ms = 3000;
|
||||
hide-when-typing = true;
|
||||
};
|
||||
|
||||
layout = {
|
||||
always-center-single-column = true;
|
||||
gaps = 14;
|
||||
focus-ring.enable = false;
|
||||
default-column-width.proportion = 1. / 2.;
|
||||
|
||||
border = {
|
||||
enable = true;
|
||||
width = 3;
|
||||
active.color = borderPalette.active;
|
||||
inactive.color = borderPalette.inactive;
|
||||
urgent.color = borderPalette.urgent;
|
||||
};
|
||||
};
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
geometry-corner-radius =
|
||||
let
|
||||
radius = 10.0;
|
||||
in
|
||||
{
|
||||
bottom-left = radius;
|
||||
bottom-right = radius;
|
||||
top-left = radius;
|
||||
top-right = radius;
|
||||
};
|
||||
clip-to-geometry = true;
|
||||
}
|
||||
];
|
||||
|
||||
debug.honor-xdg-activation-with-invalid-serial = true;
|
||||
gestures.hot-corners.enable = false;
|
||||
|
||||
input = {
|
||||
focus-follows-mouse.enable = true;
|
||||
mouse."accel-speed" = 0.4;
|
||||
keyboard = {
|
||||
repeat-delay = 300;
|
||||
repeat-rate = 50;
|
||||
xkb.options = "caps:escape";
|
||||
};
|
||||
touchpad.dwt = true;
|
||||
};
|
||||
|
||||
binds = import ./_bindings.nix {
|
||||
browserCommand = config.facts.desktop.browserCommand;
|
||||
launcherCommand = config.facts.desktop.launcherCommand;
|
||||
terminalCommand = config.facts.desktop.terminalCommand;
|
||||
shortcutCommands = shortcuts.commands;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
{ inputs, ... }:
|
||||
{ inputs, config, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.nix =
|
||||
{ ... }:
|
||||
@@ -42,6 +45,7 @@
|
||||
})
|
||||
];
|
||||
|
||||
programs.nix-index.enableZshIntegration = false;
|
||||
programs.nix-index-database.comma.enable = true;
|
||||
|
||||
programs.television = {
|
||||
@@ -53,5 +57,10 @@
|
||||
enable = true;
|
||||
enableTelevisionIntegration = true;
|
||||
};
|
||||
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = account.nixosConfigurationPath;
|
||||
};
|
||||
};
|
||||
}
|
||||
+7
-6
@@ -1,6 +1,7 @@
|
||||
{
|
||||
homeDirectory,
|
||||
lib,
|
||||
terminalPackage,
|
||||
terminalCommand,
|
||||
}:
|
||||
{
|
||||
settingsVersion = 53;
|
||||
@@ -102,7 +103,7 @@
|
||||
screenOverrides = [ ];
|
||||
};
|
||||
general = {
|
||||
avatarImage = "/home/kiri/.face";
|
||||
avatarImage = "${homeDirectory}/.face";
|
||||
dimmerOpacity = 0;
|
||||
showScreenCorners = false;
|
||||
forceBlackScreenCorners = false;
|
||||
@@ -213,7 +214,7 @@
|
||||
wallpaper = {
|
||||
enabled = true;
|
||||
overviewEnabled = false;
|
||||
directory = "/home/kiri/media/images/wallpapers";
|
||||
directory = "${homeDirectory}/media/images/wallpapers";
|
||||
monitorDirectories = [ ];
|
||||
enableMultiMonitorDirectories = false;
|
||||
showHiddenFiles = false;
|
||||
@@ -259,7 +260,7 @@
|
||||
pinnedApps = [ ];
|
||||
useApp2Unit = false;
|
||||
sortByMostUsed = true;
|
||||
terminalCommand = "${lib.getExe terminalPackage} -e";
|
||||
inherit terminalCommand;
|
||||
customLaunchPrefixEnabled = false;
|
||||
customLaunchPrefix = "";
|
||||
viewMode = "grid";
|
||||
@@ -457,9 +458,9 @@
|
||||
notifications = {
|
||||
enabled = true;
|
||||
enableMarkdown = false;
|
||||
density = "default";
|
||||
density = "compact";
|
||||
monitors = [ ];
|
||||
location = "top_right";
|
||||
location = "bottom_right";
|
||||
overlayLayer = true;
|
||||
backgroundOpacity = 1;
|
||||
respectExpireTimeout = false;
|
||||
@@ -4,38 +4,33 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
|
||||
mkNoctaliaSettings =
|
||||
{
|
||||
homeDirectory,
|
||||
lib,
|
||||
terminalPackage,
|
||||
terminalCommand,
|
||||
}:
|
||||
import ./_noctalia-config.nix {
|
||||
inherit
|
||||
homeDirectory
|
||||
lib
|
||||
terminalPackage
|
||||
terminalCommand
|
||||
;
|
||||
};
|
||||
|
||||
mkBaseSettings =
|
||||
{
|
||||
homeDirectory,
|
||||
lib,
|
||||
pkgs,
|
||||
terminalCommand,
|
||||
}:
|
||||
let
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
};
|
||||
in
|
||||
if terminalPackage == null then
|
||||
{ }
|
||||
else
|
||||
mkNoctaliaSettings {
|
||||
inherit lib terminalPackage;
|
||||
};
|
||||
mkNoctaliaSettings {
|
||||
inherit
|
||||
homeDirectory
|
||||
lib
|
||||
terminalCommand
|
||||
;
|
||||
};
|
||||
|
||||
mkPortableSettings =
|
||||
baseSettings:
|
||||
@@ -62,15 +57,24 @@ in
|
||||
{
|
||||
flake.modules.homeManager.noctalia =
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
baseSettings = mkBaseSettings {
|
||||
inherit lib pkgs;
|
||||
inherit lib;
|
||||
homeDirectory = config.home.homeDirectory;
|
||||
terminalCommand = lib.getExe pkgs.xdg-terminal-exec;
|
||||
};
|
||||
settings =
|
||||
if baseSettings == { } || !(osConfig.facts.machine.portable or false) then
|
||||
baseSettings
|
||||
else
|
||||
mkPortableSettings baseSettings;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.noctalia.homeModules.default ];
|
||||
@@ -82,34 +86,7 @@ in
|
||||
calendarSupport = true;
|
||||
}
|
||||
);
|
||||
|
||||
settings = baseSettings;
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.noctalia-portable =
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
baseSettings = mkBaseSettings {
|
||||
inherit lib pkgs;
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ inputs.noctalia.homeModules.default ];
|
||||
|
||||
programs.noctalia-shell = {
|
||||
enable = true;
|
||||
package = lib.mkForce (
|
||||
inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
|
||||
calendarSupport = true;
|
||||
}
|
||||
);
|
||||
settings = if baseSettings == { } then { } else mkPortableSettings baseSettings;
|
||||
inherit settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -4,16 +4,16 @@
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
account = repo.account;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.bitwarden =
|
||||
flake.modules.homeManager.passwords =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
account = config.meta.user.account;
|
||||
pinentryPackage = pkgs.pinentry-gnome3;
|
||||
in
|
||||
{
|
||||
programs.rbw = {
|
||||
@@ -21,7 +21,7 @@ in
|
||||
settings = {
|
||||
base_url = repo.services.vaultwarden.url;
|
||||
email = account.primaryEmail.address;
|
||||
pinentry = pkgs.pinentry-gnome3;
|
||||
pinentry = pinentryPackage;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -1,4 +1,11 @@
|
||||
{ ... }:
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
account = repo.account;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.email =
|
||||
{
|
||||
@@ -7,11 +14,10 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
account = config.meta.user.account;
|
||||
mkOffice365Account =
|
||||
{
|
||||
address,
|
||||
primary,
|
||||
primary ? false,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -31,7 +37,7 @@
|
||||
mkMxrouteAccount =
|
||||
{
|
||||
address,
|
||||
primary,
|
||||
primary ? false,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -83,4 +89,80 @@
|
||||
|
||||
accounts.email.accounts = lib.mapAttrs (_: mkEmailAccount) account.emails;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.calendar-tasks =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
calendarsPath = "${config.xdg.dataHome}/calendars";
|
||||
in
|
||||
{
|
||||
programs.pimsync.enable = true;
|
||||
services.pimsync.enable = true;
|
||||
|
||||
sops.secrets."radicale-pass" = { };
|
||||
|
||||
programs.khal = {
|
||||
enable = true;
|
||||
locale = {
|
||||
timeformat = "%H:%M";
|
||||
dateformat = "$m-$d";
|
||||
};
|
||||
};
|
||||
|
||||
programs.todoman = {
|
||||
enable = true;
|
||||
glob = "*/*";
|
||||
extraConfig = ''
|
||||
date_format = "%Y-%m-%d"
|
||||
time_format = "%H:%M"
|
||||
default_list = "personal"
|
||||
default_due = 0
|
||||
default_command = "list --sort priority,due"
|
||||
humanize = True
|
||||
'';
|
||||
};
|
||||
|
||||
accounts.calendar = {
|
||||
basePath = calendarsPath;
|
||||
accounts.radicale = {
|
||||
primary = true;
|
||||
primaryCollection = "personal";
|
||||
|
||||
local = {
|
||||
type = "filesystem";
|
||||
fileExt = ".ics";
|
||||
};
|
||||
|
||||
remote = {
|
||||
url = repo.services.radicale.url;
|
||||
type = "caldav";
|
||||
userName = config.home.username;
|
||||
passwordCommand = [
|
||||
"${pkgs.coreutils}/bin/cat"
|
||||
config.sops.secrets."radicale-pass".path
|
||||
];
|
||||
};
|
||||
|
||||
pimsync = {
|
||||
enable = true;
|
||||
extraPairDirectives = [
|
||||
{
|
||||
name = "collections";
|
||||
params = [ "from b" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
khal = {
|
||||
enable = true;
|
||||
type = "discover";
|
||||
color = "light blue";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,13 @@ let
|
||||
service = repo.services.actual;
|
||||
in
|
||||
{
|
||||
repo.services.actual = {
|
||||
domain = "finance.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 3000;
|
||||
url = "https://finance.jelles.net";
|
||||
};
|
||||
|
||||
flake.modules.nixos.actual =
|
||||
{ lib, ... }:
|
||||
lib.mkMerge [
|
||||
@@ -6,7 +6,7 @@ in
|
||||
flake.modules.nixos.caddy = {
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
email = repo.contact.email;
|
||||
email = repo.account.primaryEmail.address;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
@@ -5,6 +5,13 @@ let
|
||||
service = repo.services.gitea;
|
||||
in
|
||||
{
|
||||
repo.services.gitea = {
|
||||
domain = "git.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 3001;
|
||||
url = "https://git.jelles.net/";
|
||||
};
|
||||
|
||||
flake.modules.nixos.gitea =
|
||||
{ lib, ... }:
|
||||
lib.mkMerge [
|
||||
@@ -0,0 +1,34 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
personalPublicKeys =
|
||||
machines:
|
||||
map (machine: (machine.sshKeys or { }).personal.publicKey) (
|
||||
lib.filter (machine: (machine.sshKeys or { }) ? personal) (builtins.attrValues machines)
|
||||
);
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.sudo-ssh-agent-auth = {
|
||||
security.pam = {
|
||||
rssh.enable = true;
|
||||
services.sudo.rssh = true;
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.nixos.openssh =
|
||||
{ ... }:
|
||||
{
|
||||
services.openssh.openFirewall = true;
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
AllowUsers = [ account.name ];
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${account.name}.openssh.authorizedKeys.keys = personalPublicKeys config.repo.machines;
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,13 @@ let
|
||||
service = repo.services.radicale;
|
||||
in
|
||||
{
|
||||
repo.services.radicale = {
|
||||
domain = "radicale.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 5232;
|
||||
url = "https://radicale.jelles.net/";
|
||||
};
|
||||
|
||||
flake.modules.nixos.radicale =
|
||||
{ lib, ... }:
|
||||
lib.mkMerge [
|
||||
@@ -0,0 +1,28 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.transmission =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
services.transmission = {
|
||||
enable = true;
|
||||
package = pkgs.transmission_4;
|
||||
openPeerPorts = true;
|
||||
downloadDirPermissions = "775";
|
||||
|
||||
settings = {
|
||||
download-dir = "${account.homeDirectory}/torrents";
|
||||
incomplete-dir = "${account.homeDirectory}/torrents/.incomplete";
|
||||
peer-port = 43864;
|
||||
umask = "002";
|
||||
};
|
||||
};
|
||||
|
||||
# NOTE: Upstream bug?
|
||||
systemd.services.transmission-setup.requiredBy = [ "transmission.service" ];
|
||||
|
||||
users.users.${account.name}.extraGroups = [ config.services.transmission.group ];
|
||||
};
|
||||
}
|
||||
+7
@@ -5,6 +5,13 @@ let
|
||||
service = repo.services.vaultwarden;
|
||||
in
|
||||
{
|
||||
repo.services.vaultwarden = {
|
||||
domain = "vault.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 8100;
|
||||
url = "https://vault.jelles.net";
|
||||
};
|
||||
|
||||
flake.modules.nixos.vaultwarden =
|
||||
{ lib, ... }:
|
||||
lib.mkMerge [
|
||||
@@ -0,0 +1,215 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.modules.nixos.vps-insights =
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
localAddress = "127.0.0.1";
|
||||
grafanaDataDir = config.services.grafana.dataDir;
|
||||
lokiDataDir = config.services.loki.dataDir;
|
||||
lokiUrl = "http://${localAddress}:3100";
|
||||
prometheusUrl = "http://${localAddress}:9090";
|
||||
in
|
||||
{
|
||||
environment = {
|
||||
etc."alloy/config.alloy".text = ''
|
||||
loki.relabel "journal" {
|
||||
forward_to = []
|
||||
|
||||
rule {
|
||||
source_labels = ["__journal__systemd_unit"]
|
||||
target_label = "unit"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__journal_syslog_identifier"]
|
||||
target_label = "syslog_identifier"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__journal_priority_keyword"]
|
||||
target_label = "level"
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.journal "system" {
|
||||
forward_to = [loki.write.local.receiver]
|
||||
relabel_rules = loki.relabel.journal.rules
|
||||
max_age = "24h"
|
||||
labels = {
|
||||
host = "${config.networking.hostName}",
|
||||
}
|
||||
}
|
||||
|
||||
loki.write "local" {
|
||||
endpoint {
|
||||
url = "${lokiUrl}/loki/api/v1/push"
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
||||
systemPackages = with pkgs; [
|
||||
goaccess
|
||||
lynis
|
||||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
# Keep local system logs available for Loki and manual inspection.
|
||||
journald.extraConfig = ''
|
||||
Storage=persistent
|
||||
SystemMaxUse=1G
|
||||
MaxRetentionSec=30day
|
||||
'';
|
||||
|
||||
# Detect and block common attacks against SSH and Caddy.
|
||||
crowdsec = {
|
||||
enable = true;
|
||||
hub.collections = [
|
||||
"crowdsecurity/linux"
|
||||
"crowdsecurity/caddy"
|
||||
];
|
||||
localConfig.acquisitions = [
|
||||
{
|
||||
source = "journalctl";
|
||||
journalctl_filter = [ "_SYSTEMD_UNIT=sshd.service" ];
|
||||
labels.type = "syslog";
|
||||
}
|
||||
{
|
||||
filenames = [ "/var/log/caddy/*.log" ];
|
||||
labels.type = "caddy";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
crowdsec-firewall-bouncer = {
|
||||
enable = true;
|
||||
registerBouncer.bouncerName = "${config.networking.hostName}-firewall-bouncer";
|
||||
};
|
||||
|
||||
# Grafana defaults to 127.0.0.1:3000; add secrets and datasources only.
|
||||
grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
analytics.reporting_enabled = false;
|
||||
security = {
|
||||
admin_password = "$__file{${grafanaDataDir}/admin-password}";
|
||||
secret_key = "$__file{${grafanaDataDir}/secret-key}";
|
||||
};
|
||||
};
|
||||
provision.datasources.settings = {
|
||||
prune = true;
|
||||
datasources = [
|
||||
{
|
||||
name = "Prometheus";
|
||||
type = "prometheus";
|
||||
uid = "prometheus";
|
||||
url = prometheusUrl;
|
||||
isDefault = true;
|
||||
}
|
||||
{
|
||||
name = "Loki";
|
||||
type = "loki";
|
||||
uid = "loki";
|
||||
url = lokiUrl;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Store local logs in Loki and feed them from journald through Alloy.
|
||||
loki = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
analytics.reporting_enabled = false;
|
||||
auth_enabled = false;
|
||||
|
||||
server = {
|
||||
http_listen_address = localAddress;
|
||||
http_listen_port = 3100;
|
||||
grpc_listen_address = localAddress;
|
||||
grpc_listen_port = 9096;
|
||||
};
|
||||
|
||||
common = {
|
||||
path_prefix = lokiDataDir;
|
||||
replication_factor = 1;
|
||||
instance_interface_names = [ "lo" ];
|
||||
ring = {
|
||||
instance_addr = localAddress;
|
||||
kvstore.store = "inmemory";
|
||||
};
|
||||
};
|
||||
|
||||
schema_config.configs = [
|
||||
{
|
||||
from = "2025-01-01";
|
||||
store = "tsdb";
|
||||
object_store = "filesystem";
|
||||
schema = "v13";
|
||||
index = {
|
||||
prefix = "index_";
|
||||
period = "24h";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
storage_config.filesystem.directory = "${lokiDataDir}/chunks";
|
||||
|
||||
compactor = {
|
||||
working_directory = "${lokiDataDir}/compactor";
|
||||
retention_enabled = true;
|
||||
delete_request_store = "filesystem";
|
||||
};
|
||||
|
||||
limits_config.retention_period = "720h";
|
||||
};
|
||||
};
|
||||
|
||||
alloy = {
|
||||
enable = true;
|
||||
extraFlags = [ "--server.http.listen-addr=${localAddress}:12345" ];
|
||||
};
|
||||
|
||||
# Collect basic VPS health metrics for Grafana.
|
||||
prometheus = {
|
||||
enable = true;
|
||||
listenAddress = localAddress;
|
||||
retentionTime = "30d";
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "prometheus";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "${localAddress}:9090" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "node";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "${localAddress}:9100" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
exporters.node = {
|
||||
enable = true;
|
||||
listenAddress = localAddress;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.grafana.preStart = ''
|
||||
umask 077
|
||||
|
||||
if [ ! -s ${grafanaDataDir}/admin-password ]; then
|
||||
${pkgs.openssl}/bin/openssl rand -base64 32 > ${grafanaDataDir}/admin-password
|
||||
fi
|
||||
|
||||
if [ ! -s ${grafanaDataDir}/secret-key ]; then
|
||||
${pkgs.openssl}/bin/openssl rand -hex 32 > ${grafanaDataDir}/secret-key
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -65,12 +65,21 @@
|
||||
bindkey -v
|
||||
|
||||
export KEYTIMEOUT=1
|
||||
setopt MENU_COMPLETE
|
||||
zmodload zsh/complist
|
||||
|
||||
autoload -U history-search-end
|
||||
zle -N history-beginning-search-backward-end history-search-end
|
||||
zle -N history-beginning-search-forward-end history-search-end
|
||||
bindkey "^[OA" history-beginning-search-backward-end
|
||||
bindkey "^[OB" history-beginning-search-forward-end
|
||||
if [[ -n "''${terminfo[kcbt]}" ]]; then
|
||||
bindkey "''${terminfo[kcbt]}" reverse-menu-complete
|
||||
bindkey -M menuselect "''${terminfo[kcbt]}" reverse-menu-complete
|
||||
fi
|
||||
bindkey "^[[Z" reverse-menu-complete
|
||||
bindkey -M menuselect "^[[Z" reverse-menu-complete
|
||||
bindkey -M menuselect "^[" send-break
|
||||
|
||||
zstyle ':completion:*' completer _extensions _complete _approximate
|
||||
zstyle ':completion:*' use-cache on
|
||||
@@ -79,7 +88,7 @@
|
||||
zstyle ':completion:*' complete-options true
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||
zstyle ':completion:*' keep-prefix true
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' menu yes select=1
|
||||
zstyle ':completion:*' list-grouped false
|
||||
zstyle ':completion:*' list-separator '''
|
||||
zstyle ':completion:*' group-name '''
|
||||
@@ -117,7 +126,6 @@
|
||||
"$directory"
|
||||
"$git_branch"
|
||||
"$git_state"
|
||||
"$git_status"
|
||||
"$line_break"
|
||||
"$character"
|
||||
];
|
||||
@@ -133,15 +141,6 @@
|
||||
style = "";
|
||||
};
|
||||
|
||||
git_status = {
|
||||
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)";
|
||||
style = "cyan";
|
||||
conflicted = "";
|
||||
renamed = "";
|
||||
deleted = "";
|
||||
stashed = "≡";
|
||||
};
|
||||
|
||||
git_state = {
|
||||
format = "([$state( $progress_current/$progress_total)]($style)) ";
|
||||
style = "bright-black";
|
||||
@@ -179,7 +178,7 @@
|
||||
pkgs.tlrc
|
||||
pkgs.sd
|
||||
pkgs.procs
|
||||
pkgs.dust
|
||||
pkgs.dua
|
||||
pkgs.duf
|
||||
pkgs.systemctl-tui
|
||||
pkgs.xh
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
syncMachines = lib.listToAttrs (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (
|
||||
machineName: machine:
|
||||
let
|
||||
syncthingId = machine.syncthingId or null;
|
||||
in
|
||||
lib.optional (syncthingId != null) (
|
||||
let
|
||||
name = "${config.repo.account.name}@${machineName}";
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
value = {
|
||||
inherit name;
|
||||
id = syncthingId;
|
||||
};
|
||||
}
|
||||
)
|
||||
) config.repo.machines
|
||||
)
|
||||
);
|
||||
|
||||
syncPhones = {
|
||||
"pixel-10" = {
|
||||
name = "pixel-10";
|
||||
id = "MTJHEHA-UMZDQZ7-BTMRRLQ-Y7BFPUJ-ZTY6LZX-PDXV3IS-XVJCU7B-EPETBQZ";
|
||||
};
|
||||
};
|
||||
|
||||
syncDevices = syncMachines // syncPhones;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.syncthing =
|
||||
{ ... }:
|
||||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
|
||||
settings = {
|
||||
folders = {
|
||||
sync = {
|
||||
path = "~/sync";
|
||||
label = "sync";
|
||||
devices = builtins.attrNames syncDevices;
|
||||
};
|
||||
calibre = {
|
||||
path = "~/calibre";
|
||||
label = "calibre";
|
||||
devices = builtins.attrNames syncMachines;
|
||||
};
|
||||
};
|
||||
devices = syncDevices;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.modules.nixos.standard-boot =
|
||||
flake.modules.nixos.systemd-boot =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
boot = {
|
||||
@@ -0,0 +1,198 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
repo = config.repo;
|
||||
|
||||
kittySingleInstance =
|
||||
pkgs:
|
||||
pkgs.symlinkJoin {
|
||||
name = "kitty-single";
|
||||
paths = [ pkgs.kitty ];
|
||||
meta = pkgs.kitty.meta;
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
# Wrap the binary to always launch as a single instance
|
||||
wrapProgram $out/bin/kitty --add-flags "-1"
|
||||
|
||||
# Patch the .desktop file for strict app launchers like Vicinae
|
||||
rm $out/share/applications/kitty.desktop
|
||||
sed 's/Exec=kitty/Exec=kitty -1/g' ${pkgs.kitty}/share/applications/kitty.desktop > $out/share/applications/kitty.desktop
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.terminal-foot =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
palette = repoTheme.palette;
|
||||
hex = lib.removePrefix "#";
|
||||
in
|
||||
{
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
package = pkgs.foot;
|
||||
settings = {
|
||||
main = {
|
||||
font = "JetBrains Mono:style=Medium:size=11:fontfeatures=-liga:fontfeatures=-calt";
|
||||
font-bold = "JetBrains Mono:style=Bold:size=11:fontfeatures=-liga:fontfeatures=-calt";
|
||||
font-italic = "JetBrains Mono:style=Medium Italic:size=11:fontfeatures=-liga:fontfeatures=-calt";
|
||||
font-bold-italic = "JetBrains Mono:style=Bold Italic:size=11:fontfeatures=-liga:fontfeatures=-calt";
|
||||
gamma-correct-blending = "yes";
|
||||
pad = "3x3";
|
||||
# vertical-letter-offset = -1;
|
||||
# letter-spacing = -0.2;
|
||||
};
|
||||
|
||||
tweak.box-drawing-base-thickness = 0.1;
|
||||
|
||||
bell.system = "no";
|
||||
|
||||
scrollback.lines = 10000;
|
||||
|
||||
text-bindings."\\x0a" = "Shift+Return Shift+KP_Enter";
|
||||
|
||||
colors-dark = {
|
||||
background = hex palette.background;
|
||||
foreground = hex palette.foreground;
|
||||
selection-background = hex palette.selectionBackground;
|
||||
selection-foreground = hex palette.selectionForeground;
|
||||
urls = hex palette.url;
|
||||
cursor = "${hex palette.background} ${hex palette.cursor}";
|
||||
|
||||
regular0 = hex palette.terminal.color0;
|
||||
regular1 = hex palette.terminal.color1;
|
||||
regular2 = hex palette.terminal.color2;
|
||||
regular3 = hex palette.terminal.color3;
|
||||
regular4 = hex palette.terminal.color4;
|
||||
regular5 = hex palette.terminal.color5;
|
||||
regular6 = hex palette.terminal.color6;
|
||||
regular7 = hex palette.terminal.color7;
|
||||
|
||||
bright0 = hex palette.terminal.color8;
|
||||
bright1 = hex palette.terminal.color9;
|
||||
bright2 = hex palette.terminal.color10;
|
||||
bright3 = hex palette.terminal.color11;
|
||||
bright4 = hex palette.terminal.color12;
|
||||
bright5 = hex palette.terminal.color13;
|
||||
bright6 = hex palette.terminal.color14;
|
||||
bright7 = hex palette.terminal.color15;
|
||||
|
||||
"16" = hex palette.terminal.color16;
|
||||
"17" = hex palette.terminal.color17;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.terminal-kitty =
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
palette = repoTheme.palette;
|
||||
in
|
||||
{
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
package = kittySingleInstance pkgs;
|
||||
font = {
|
||||
name = "JetBrains Mono";
|
||||
size = 11;
|
||||
};
|
||||
settings = {
|
||||
disable_ligatures = "always";
|
||||
scrollback_lines = 10000;
|
||||
enable_audio_bell = false;
|
||||
confirm_os_window_close = 0;
|
||||
window_padding_width = 3;
|
||||
update_check_interval = 0;
|
||||
};
|
||||
keybindings."shift+enter" = "send_text all \\x0a";
|
||||
extraConfig = ''
|
||||
## name: ${repoTheme.displayName}
|
||||
## license: MIT
|
||||
## author: Tommaso Laurenzi
|
||||
## upstream: https://github.com/rebelot/kanagawa.nvim/
|
||||
|
||||
background ${palette.background}
|
||||
foreground ${palette.foreground}
|
||||
selection_background ${palette.selectionBackground}
|
||||
selection_foreground ${palette.selectionForeground}
|
||||
url_color ${palette.url}
|
||||
cursor ${palette.cursor}
|
||||
|
||||
active_tab_background ${palette.background}
|
||||
active_tab_foreground ${palette.selectionForeground}
|
||||
inactive_tab_background ${palette.background}
|
||||
inactive_tab_foreground ${palette.muted}
|
||||
|
||||
color0 ${palette.terminal.color0}
|
||||
color1 ${palette.terminal.color1}
|
||||
color2 ${palette.terminal.color2}
|
||||
color3 ${palette.terminal.color3}
|
||||
color4 ${palette.terminal.color4}
|
||||
color5 ${palette.terminal.color5}
|
||||
color6 ${palette.terminal.color6}
|
||||
color7 ${palette.terminal.color7}
|
||||
|
||||
color8 ${palette.terminal.color8}
|
||||
color9 ${palette.terminal.color9}
|
||||
color10 ${palette.terminal.color10}
|
||||
color11 ${palette.terminal.color11}
|
||||
color12 ${palette.terminal.color12}
|
||||
color13 ${palette.terminal.color13}
|
||||
color14 ${palette.terminal.color14}
|
||||
color15 ${palette.terminal.color15}
|
||||
|
||||
color16 ${palette.terminal.color16}
|
||||
color17 ${palette.terminal.color17}
|
||||
'';
|
||||
};
|
||||
systemd.user.services.kitty-daemon = {
|
||||
Unit = {
|
||||
Description = "Kitty Terminal Daemon";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
# Use the wrapped package (which already includes -1)
|
||||
# Start it hidden and run an infinite dummy process so the instance stays alive
|
||||
ExecStart = "${lib.getExe (kittySingleInstance pkgs)} --start-as=hidden ${pkgs.coreutils}/bin/tail -f /dev/null";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.primary-terminal-foot =
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
imports = [ config.flake.modules.homeManager.terminal-foot ];
|
||||
|
||||
facts.desktop.terminalCommand = lib.getExe pkgs.foot;
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
settings.default = [ "foot.desktop" ];
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.primary-terminal-kitty =
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
imports = [ config.flake.modules.homeManager.terminal-kitty ];
|
||||
|
||||
facts.desktop.terminalCommand = lib.getExe (kittySingleInstance pkgs);
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
settings.default = [ "kitty.desktop" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -5,8 +5,11 @@
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
repo.theme = import ./_theme.nix;
|
||||
|
||||
flake.modules.nixos.theme =
|
||||
{
|
||||
pkgs,
|
||||
@@ -22,6 +25,8 @@ in
|
||||
};
|
||||
in
|
||||
{
|
||||
home-manager.sharedModules = [ hmModules.theme ];
|
||||
|
||||
environment.systemPackages = [ cursorTheme.package ];
|
||||
|
||||
services.displayManager.sddm.settings = {
|
||||
@@ -64,6 +69,7 @@ in
|
||||
package
|
||||
size
|
||||
;
|
||||
dotIcons.enable = false;
|
||||
gtk.enable = true;
|
||||
};
|
||||
|
||||
@@ -76,9 +82,7 @@ in
|
||||
name = repoTheme.kanagawa.gtkThemeName;
|
||||
package = pkgs.kanagawa-gtk-theme.overrideAttrs (_: kanagawaOverride);
|
||||
};
|
||||
gtk4.theme = {
|
||||
inherit (config.gtk.theme) name package;
|
||||
};
|
||||
gtk4.theme = null;
|
||||
iconTheme = {
|
||||
name = repoTheme.kanagawa.iconThemeName;
|
||||
package = pkgs.kanagawa-icon-theme.overrideAttrs (_: kanagawaOverride);
|
||||
@@ -5,8 +5,10 @@ in
|
||||
{
|
||||
flake.modules.homeManager.vicinae =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -70,5 +72,7 @@ in
|
||||
ssh
|
||||
];
|
||||
};
|
||||
|
||||
facts.desktop.launcherCommand = lib.getExe config.programs.vicinae.package;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
{ config, inputs, ... }:
|
||||
let
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.walker-cache = {
|
||||
nix.settings = {
|
||||
extra-substituters = [
|
||||
"https://walker.cachix.org"
|
||||
"https://walker-git.cachix.org"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"walker.cachix.org-1:fG8q+uAaMqhsMxWjwvk0IMb4mFPFLqHjuvfwQxE4oJM="
|
||||
"walker-git.cachix.org-1:vmC0ocfPWh0S/vRAQGtChuiZBTAe4wiKDeyyXM0/7pM="
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.walker-base =
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.walker.homeManagerModules.default ];
|
||||
|
||||
programs.walker = {
|
||||
enable = true;
|
||||
runAsService = true;
|
||||
|
||||
config.providers.prefixes = [
|
||||
{
|
||||
provider = "bitwarden";
|
||||
prefix = "?";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.primary-launcher-walker =
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [ homeModules.walker-base ];
|
||||
|
||||
facts.desktop.launcherCommand = lib.getExe config.programs.walker.package;
|
||||
};
|
||||
}
|
||||
+24
-115
@@ -1,123 +1,32 @@
|
||||
{
|
||||
repo = {
|
||||
contact.email = "mail@jelles.net";
|
||||
account = rec {
|
||||
name = "kiri";
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
homeDirectory = "/home/${name}";
|
||||
nixosConfigurationPath = "${homeDirectory}/.config/nixos";
|
||||
|
||||
desktop = {
|
||||
browser = {
|
||||
command = "vivaldi";
|
||||
packagePath = [ "vivaldi" ];
|
||||
};
|
||||
|
||||
fileManager = {
|
||||
command = "nautilus";
|
||||
packagePath = [ "nautilus" ];
|
||||
};
|
||||
|
||||
terminal = {
|
||||
command = "kitty";
|
||||
desktopId = "kitty.desktop";
|
||||
packagePath = [ "kitty" ];
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
actual = {
|
||||
domain = "finance.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 3000;
|
||||
url = "https://finance.jelles.net";
|
||||
};
|
||||
|
||||
gitea = {
|
||||
domain = "git.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 3001;
|
||||
url = "https://git.jelles.net/";
|
||||
};
|
||||
|
||||
radicale = {
|
||||
domain = "radicale.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 5232;
|
||||
url = "https://radicale.jelles.net/";
|
||||
};
|
||||
|
||||
vaultwarden = {
|
||||
domain = "vault.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 8100;
|
||||
url = "https://vault.jelles.net";
|
||||
};
|
||||
};
|
||||
|
||||
theme = {
|
||||
cursor = {
|
||||
name = "phinger-cursors-light";
|
||||
packagePath = [ "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";
|
||||
};
|
||||
emails = {
|
||||
personal = {
|
||||
address = "mail@jelles.net";
|
||||
primary = true;
|
||||
type = "mxrouting";
|
||||
};
|
||||
old = {
|
||||
address = "mail@jellespreeuwenberg.nl";
|
||||
type = "mxrouting";
|
||||
};
|
||||
uni = {
|
||||
address = "j.spreeuwenberg@student.tue.nl";
|
||||
type = "office365";
|
||||
};
|
||||
work = {
|
||||
address = "jelle.spreeuwenberg@yookr.org";
|
||||
type = "office365";
|
||||
};
|
||||
};
|
||||
|
||||
primaryEmail = emails.personal;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.modules.homeManager.git =
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
account = config.meta.user.account;
|
||||
in
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
signing.format = "ssh";
|
||||
ignores = [
|
||||
".claude/"
|
||||
".codex"
|
||||
];
|
||||
settings = {
|
||||
init.defaultBranch = "main";
|
||||
user = {
|
||||
name = account.realName;
|
||||
email = account.primaryEmail.address;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.local-apps =
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
browserPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.browser.packagePath;
|
||||
};
|
||||
in
|
||||
{
|
||||
home.sessionVariables.BROWSER = repo.desktop.browser.command;
|
||||
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
postman
|
||||
spotify
|
||||
calcure
|
||||
planify
|
||||
unzip
|
||||
gimp
|
||||
dbeaver-bin
|
||||
]
|
||||
++ [ browserPackage ];
|
||||
|
||||
programs.imv.enable = true;
|
||||
programs.sioyek.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
-- Set <space> as the leader key
|
||||
-- See `:help mapleader`
|
||||
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
-- NOTE: You can change these options as you wish!
|
||||
-- For more options, you can see `:help option-list`
|
||||
|
||||
vim.o.expandtab = true
|
||||
vim.o.shiftwidth = 2
|
||||
vim.o.tabstop = 2
|
||||
vim.o.softtabstop = 2
|
||||
|
||||
-- Make line numbers default
|
||||
vim.o.number = true
|
||||
-- You can also add relative line numbers, to help with jumping.
|
||||
-- Experiment for yourself to see if you like it!
|
||||
-- vim.o.relativenumber = true
|
||||
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
vim.o.mouse = "a"
|
||||
|
||||
-- Don't show the mode, since it's already in the status line
|
||||
vim.o.showmode = false
|
||||
|
||||
vim.opt.shortmess:append("Wc")
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- See `:help 'clipboard'`
|
||||
vim.schedule(function()
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
end)
|
||||
|
||||
-- Enable break indent
|
||||
vim.o.breakindent = true
|
||||
|
||||
-- Save undo history
|
||||
vim.o.undofile = true
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
-- Keep signcolumn on by default
|
||||
vim.o.signcolumn = "yes"
|
||||
|
||||
-- Decrease update time
|
||||
vim.o.updatetime = 250
|
||||
|
||||
-- Decrease mapped sequence wait time
|
||||
vim.o.timeoutlen = 300
|
||||
|
||||
-- Configure how new splits should be opened
|
||||
vim.o.splitright = true
|
||||
vim.o.splitbelow = true
|
||||
|
||||
-- Sets how neovim will display certain whitespace characters in the editor.
|
||||
-- See `:help 'list'`
|
||||
-- and `:help 'listchars'`
|
||||
--
|
||||
-- Notice listchars is set using `vim.opt` instead of `vim.o`.
|
||||
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
|
||||
-- See `:help lua-options`
|
||||
-- and `:help lua-options-guide`
|
||||
vim.o.list = true
|
||||
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||
|
||||
-- Preview substitutions live, as you type!
|
||||
vim.o.inccommand = "split"
|
||||
|
||||
-- Show which line your cursor is on
|
||||
vim.o.cursorline = true
|
||||
|
||||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
vim.o.scrolloff = 10
|
||||
|
||||
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
|
||||
-- instead raise a dialog asking if you wish to save the current file(s)
|
||||
-- See `:help 'confirm'`
|
||||
vim.o.confirm = true
|
||||
|
||||
-- [[ Basic Keymaps ]]
|
||||
-- See `:help vim.keymap.set()`
|
||||
|
||||
-- Clear highlights on search when pressing <Esc> in normal mode
|
||||
-- See `:help hlsearch`
|
||||
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
|
||||
|
||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
||||
-- is not what someone will guess without a bit more experience.
|
||||
--
|
||||
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
||||
-- or just use <C-\><C-n> to exit terminal mode
|
||||
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
||||
|
||||
-- TIP: Disable arrow keys in normal mode
|
||||
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
-- Keybinds to make split navigation easier.
|
||||
-- Use CTRL+<hjkl> to switch between windows
|
||||
--
|
||||
-- See `:help wincmd` for a list of all window commands
|
||||
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
|
||||
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
|
||||
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
||||
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
||||
|
||||
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
||||
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
||||
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
||||
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
||||
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.hl.on_yank()`
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
desc = "Highlight when yanking (copying) text",
|
||||
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.hl.on_yank()
|
||||
end,
|
||||
})
|
||||
@@ -1,72 +0,0 @@
|
||||
require("lz.n").load({
|
||||
{
|
||||
"copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
after = function()
|
||||
require("copilot").setup({
|
||||
-- Disable inline suggestions, let CodeCompanion (or blink) handle interactions
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"codecompanion.nvim",
|
||||
cmd = { "CodeCompanion", "CodeCompanionChat", "CodeCompanionActions" },
|
||||
keys = {
|
||||
{ "<leader>aa", "<cmd>CodeCompanionChat Toggle<cr>", mode = { "n", "v" }, desc = "[A]I [A]ssistant" },
|
||||
{ "<leader>ac", "<cmd>CodeCompanionActions<cr>", mode = { "n", "v" }, desc = "[A]I [C]ode Actions" },
|
||||
},
|
||||
after = function()
|
||||
require("codecompanion").setup({
|
||||
-- Set Gemini as the default strategy
|
||||
strategies = {
|
||||
chat = {
|
||||
adapter = "gemini",
|
||||
},
|
||||
inline = {
|
||||
adapter = "gemini",
|
||||
},
|
||||
},
|
||||
-- Configure all available adapters
|
||||
adapters = {
|
||||
copilot = function()
|
||||
return require("codecompanion.adapters").extend("copilot", {
|
||||
schema = {
|
||||
model = {
|
||||
default = "claude-3.5-sonnet", -- Good default for Copilot chat
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
gemini = function()
|
||||
return require("codecompanion.adapters").extend("gemini", {
|
||||
env = {
|
||||
api_key = "GEMINI_API_KEY",
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = "gemini-3.1-pro-preview",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
gemini_cli = function()
|
||||
return require("codecompanion.adapters").extend("gemini_cli", {
|
||||
-- Pass the model as a CLI argument
|
||||
args = {
|
||||
"--model",
|
||||
"gemini-3.1-pro-preview",
|
||||
},
|
||||
-- Set authentication to use standard Google Login
|
||||
env = {
|
||||
auth_method = "oauth-personal",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -1,101 +0,0 @@
|
||||
require("lz.n").load({
|
||||
{
|
||||
"project.nvim",
|
||||
event = { "VimEnter" }, -- Load early to set root correctly
|
||||
after = function()
|
||||
require("project").setup({
|
||||
-- 1. Automagically change directory to project root
|
||||
manual_mode = false,
|
||||
|
||||
-- LSP detection
|
||||
lsp = { enabled = true },
|
||||
|
||||
-- Files/folders that indicate a root
|
||||
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", "flake.nix" },
|
||||
|
||||
-- Show hidden files in telescope
|
||||
show_hidden = true,
|
||||
|
||||
-- When the project scope changes, change the directory
|
||||
scope_chdir = "global",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"telescope.nvim",
|
||||
event = "VimEnter",
|
||||
before = function()
|
||||
require("lz.n").trigger_load("project.nvim")
|
||||
end,
|
||||
after = function()
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
path_display = { "truncate" },
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
prompt_position = "top",
|
||||
},
|
||||
sorting_strategy = "ascending",
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- Move up with Ctrl-k
|
||||
["<C-j>"] = actions.move_selection_next, -- Move down with Ctrl-j
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- Send to quickfix
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Enable Telescope extensions if they are installed
|
||||
pcall(require("telescope").load_extension, "projects")
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "ui-select")
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
|
||||
vim.keymap.set("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
|
||||
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" })
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]esume" })
|
||||
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
|
||||
vim.keymap.set("n", "<leader>sp", function()
|
||||
require("telescope").extensions.projects.projects({})
|
||||
end, { desc = "[S]earch [P]rojects" })
|
||||
|
||||
-- Slightly advanced example of overriding default behavior and theme
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
||||
|
||||
-- It's also possible to pass additional configuration options.
|
||||
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
||||
vim.keymap.set("n", "<leader>s/", function()
|
||||
builtin.live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]earch [/] in Open Files" })
|
||||
|
||||
-- Shortcut for searching your Neovim configuration files
|
||||
vim.keymap.set("n", "<leader>sn", function()
|
||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end, { desc = "[S]earch [N]eovim files" })
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -1 +0,0 @@
|
||||
require("lz.n").load({})
|
||||
@@ -1,81 +0,0 @@
|
||||
require("lz.n").load({
|
||||
{
|
||||
"theme-loader",
|
||||
event = "VimEnter",
|
||||
load = function()
|
||||
local settings = require("nix-info").settings
|
||||
local theme_code = settings.themeSetup
|
||||
|
||||
local func, err = loadstring(theme_code)
|
||||
if func then
|
||||
func()
|
||||
else
|
||||
print("Error loading theme code: " .. err)
|
||||
end
|
||||
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lualine.nvim",
|
||||
event = "VimEnter",
|
||||
after = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
globalstatus = true,
|
||||
component_separators = "",
|
||||
section_separators = "",
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
|
||||
lualine_x = { "lsp_status" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"zen-mode.nvim",
|
||||
cmd = "ZenMode",
|
||||
after = function()
|
||||
require("zen-mode").setup({
|
||||
window = {
|
||||
options = {
|
||||
linebreak = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"which-key.nvim",
|
||||
event = "VimEnter",
|
||||
before = function()
|
||||
require("lz.n").trigger_load("mini.nvim")
|
||||
end,
|
||||
after = function()
|
||||
require("which-key").setup({
|
||||
preset = "modern",
|
||||
delay = 200,
|
||||
icons = {
|
||||
-- set icon mappings to true if you have a Nerd Font
|
||||
mappings = true,
|
||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
||||
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
|
||||
keys = {},
|
||||
},
|
||||
|
||||
-- Document existing key chains
|
||||
spec = {
|
||||
{ "<leader>s", group = "[S]earch" },
|
||||
{ "<leader>t", group = "[T]oggle" },
|
||||
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
flake.modules.nixos.server-firewall = {
|
||||
networking = {
|
||||
firewall.enable = true;
|
||||
firewall.allowPing = false;
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.nixos.networking = {
|
||||
networking = {
|
||||
nftables.enable = true;
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
flake.modules.homeManager.nh =
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = config.meta.user.account.nixosConfigurationPath;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.niri =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ inputs.niri.nixosModules.niri ];
|
||||
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
|
||||
|
||||
programs.niri.enable = true;
|
||||
programs.niri.package = pkgs.niri-unstable;
|
||||
programs.dconf.enable = true;
|
||||
|
||||
services.gvfs.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
xdg.portal.enable = true;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.niri =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
browserCommand = repo.desktop.browser.command;
|
||||
fileManagerPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.fileManager.packagePath;
|
||||
};
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
};
|
||||
outputs = lib.mapAttrs (
|
||||
_: display:
|
||||
{
|
||||
position = {
|
||||
x = display.x;
|
||||
y = display.y;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (display.primary or false) {
|
||||
"focus-at-startup" = true;
|
||||
}
|
||||
// lib.optionalAttrs (display.scale != null) {
|
||||
inherit (display) scale;
|
||||
}
|
||||
// lib.optionalAttrs (display.width != null && display.height != null && display.refresh != null) {
|
||||
mode = {
|
||||
inherit (display)
|
||||
width
|
||||
height
|
||||
refresh
|
||||
;
|
||||
};
|
||||
}
|
||||
) config.meta.machine.displays;
|
||||
in
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = fileManagerPackage != null;
|
||||
message = "Unknown file manager package `${lib.showAttrPath repo.desktop.fileManager.packagePath}`.";
|
||||
}
|
||||
];
|
||||
|
||||
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
playerctl
|
||||
brightnessctl
|
||||
xwayland-satellite
|
||||
]
|
||||
++ [ fileManagerPackage ];
|
||||
|
||||
programs.niri.settings = {
|
||||
inherit outputs;
|
||||
environment.DISPLAY = ":0";
|
||||
spawn-at-startup = [
|
||||
{ command = [ "xwayland-satellite" ]; }
|
||||
{ command = [ "noctalia-shell" ]; }
|
||||
];
|
||||
prefer-no-csd = true;
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%dT%H:%M:%S.png";
|
||||
|
||||
animations.slowdown = 0.6;
|
||||
|
||||
cursor = with config.home.pointerCursor; {
|
||||
size = size;
|
||||
theme = name;
|
||||
hide-after-inactive-ms = 3000;
|
||||
hide-when-typing = true;
|
||||
};
|
||||
|
||||
layout = {
|
||||
always-center-single-column = true;
|
||||
gaps = 14;
|
||||
focus-ring.enable = false;
|
||||
|
||||
default-column-width.proportion = 1. / 2.;
|
||||
|
||||
border = {
|
||||
enable = true;
|
||||
width = 3;
|
||||
active.color = repoTheme.palette.niri.border.active;
|
||||
inactive.color = repoTheme.palette.niri.border.inactive;
|
||||
urgent.color = repoTheme.palette.niri.border.urgent;
|
||||
};
|
||||
};
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
geometry-corner-radius =
|
||||
let
|
||||
radius = 10.0;
|
||||
in
|
||||
{
|
||||
bottom-left = radius;
|
||||
bottom-right = radius;
|
||||
top-left = radius;
|
||||
top-right = radius;
|
||||
};
|
||||
clip-to-geometry = true;
|
||||
}
|
||||
];
|
||||
|
||||
debug.honor-xdg-activation-with-invalid-serial = true;
|
||||
|
||||
input = {
|
||||
focus-follows-mouse.enable = true;
|
||||
mouse."accel-speed" = 0.4;
|
||||
keyboard = {
|
||||
repeat-delay = 300;
|
||||
repeat-rate = 50;
|
||||
xkb.options = "caps:escape";
|
||||
};
|
||||
};
|
||||
|
||||
binds =
|
||||
if terminalPackage != null then
|
||||
import ./_bindings.nix {
|
||||
inherit
|
||||
browserCommand
|
||||
lib
|
||||
;
|
||||
terminalPackage = terminalPackage;
|
||||
}
|
||||
else
|
||||
{ };
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.pim =
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
calendarsPath = "${config.xdg.dataHome}/calendars";
|
||||
in
|
||||
{
|
||||
programs.pimsync.enable = true;
|
||||
services.pimsync.enable = true;
|
||||
|
||||
programs.khal = {
|
||||
enable = false;
|
||||
locale = {
|
||||
timeformat = "%H:%M";
|
||||
dateformat = "$m-$d";
|
||||
};
|
||||
};
|
||||
|
||||
programs.todoman = {
|
||||
enable = true;
|
||||
glob = "*/*";
|
||||
extraConfig = ''
|
||||
date_format = "%Y-%m-%d"
|
||||
time_format = "%H:%M"
|
||||
default_list = "personal"
|
||||
default_due = 0
|
||||
default_command = "list --sort priority,due"
|
||||
humanize = True
|
||||
'';
|
||||
};
|
||||
|
||||
accounts.calendar = {
|
||||
basePath = calendarsPath;
|
||||
accounts.radicale = {
|
||||
primary = true;
|
||||
primaryCollection = "personal";
|
||||
|
||||
local = {
|
||||
type = "filesystem";
|
||||
fileExt = ".ics";
|
||||
};
|
||||
|
||||
remote = {
|
||||
url = repo.services.radicale.url;
|
||||
type = "caldav";
|
||||
userName = config.home.username;
|
||||
passwordCommand = [
|
||||
"rbw"
|
||||
"get"
|
||||
"Radicale"
|
||||
];
|
||||
};
|
||||
|
||||
pimsync = {
|
||||
enable = true;
|
||||
extraPairDirectives = [
|
||||
{
|
||||
name = "collections";
|
||||
params = [ "from b" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
khal = {
|
||||
enable = true;
|
||||
type = "discover";
|
||||
color = "light blue";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
flake.modules.nixos.qbittorrent-client = {
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 43864 ];
|
||||
allowedUDPPorts = [ 43864 ];
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.qbittorrent-client =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = [ pkgs.qbittorrent ];
|
||||
|
||||
programs.niri.settings.spawn-at-startup = lib.mkAfter [
|
||||
{ command = [ "qbittorrent" ]; }
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.modules.nixos.ssh-agent-auth = {
|
||||
security.pam = {
|
||||
sshAgentAuth.enable = true;
|
||||
services.sudo.sshAgentAuth = true;
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.nixos.openssh =
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.openssh.openFirewall = true;
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
AllowUsers = builtins.attrNames config.meta.machine.users;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
flake.modules.nixos.sops-password =
|
||||
{ config, ... }:
|
||||
{
|
||||
sops.secrets = lib.mapAttrs' (
|
||||
userName: _:
|
||||
lib.nameValuePair "hashed-password-${userName}" {
|
||||
neededForUsers = true;
|
||||
}
|
||||
) config.meta.machine.users;
|
||||
|
||||
users.users = lib.mapAttrs (userName: _: {
|
||||
hashedPasswordFile = config.sops.secrets."hashed-password-${userName}".path;
|
||||
}) config.meta.machine.users;
|
||||
};
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.source-control =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
machine = config.meta.machine;
|
||||
user = config.meta.user;
|
||||
account = user.account;
|
||||
sourceControl = account.sourceControl;
|
||||
|
||||
scopeConfig = scope: user.sourceControl.${scope} or null;
|
||||
|
||||
emailForScope =
|
||||
scope:
|
||||
let
|
||||
scopedEmails = lib.filter (email: email.scope == scope) (builtins.attrValues account.emails);
|
||||
in
|
||||
if builtins.length scopedEmails == 1 then (builtins.head scopedEmails).address else null;
|
||||
|
||||
scopeHasSigningKey =
|
||||
scope:
|
||||
let
|
||||
keyConfig = scopeConfig scope;
|
||||
in
|
||||
keyConfig != null && keyConfig.publicKey != null;
|
||||
|
||||
privateKeyPathForScope =
|
||||
scope:
|
||||
let
|
||||
keyConfig = scopeConfig scope;
|
||||
in
|
||||
if keyConfig == null || keyConfig.privateKeyPath == null then
|
||||
"~/.ssh/id_${scope}"
|
||||
else
|
||||
keyConfig.privateKeyPath;
|
||||
|
||||
publicKeyForScope =
|
||||
scope:
|
||||
let
|
||||
keyConfig = scopeConfig scope;
|
||||
in
|
||||
if keyConfig == null then null else keyConfig.publicKey;
|
||||
|
||||
scopesInUse = lib.unique [
|
||||
"personal"
|
||||
sourceControl.projectScope
|
||||
];
|
||||
|
||||
missingEmailScopes = builtins.filter (scope: emailForScope scope == null) scopesInUse;
|
||||
|
||||
allowedSignersLines = map (scope: "${emailForScope scope} ${publicKeyForScope scope}") (
|
||||
builtins.filter (scope: emailForScope scope != null && scopeHasSigningKey scope) scopesInUse
|
||||
);
|
||||
|
||||
gitConfigForScope =
|
||||
scope:
|
||||
lib.recursiveUpdate
|
||||
{
|
||||
user = {
|
||||
name = account.realName;
|
||||
email = emailForScope scope;
|
||||
};
|
||||
}
|
||||
(
|
||||
lib.optionalAttrs (scopeHasSigningKey scope) {
|
||||
gpg.ssh.allowedSignersFile = "${config.xdg.configHome}/git/allowed_signers";
|
||||
user.signingKey = "${privateKeyPathForScope scope}.pub";
|
||||
}
|
||||
);
|
||||
|
||||
gitRoots = [
|
||||
{
|
||||
root = account.nixosConfigurationPath;
|
||||
scope = "personal";
|
||||
}
|
||||
{
|
||||
root = config.xdg.userDirs.projects;
|
||||
scope = sourceControl.projectScope;
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = [ homeModules.git ];
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = missingEmailScopes == [ ];
|
||||
message = "Missing source-control email scope for `${account.name}`: ${lib.concatStringsSep ", " missingEmailScopes}.";
|
||||
}
|
||||
];
|
||||
|
||||
xdg.configFile."git/allowed_signers".text = lib.concatStringsSep "\n" (
|
||||
allowedSignersLines ++ [ "" ]
|
||||
);
|
||||
|
||||
programs.git.includes = map (gitRoot: {
|
||||
condition = "gitdir:${gitRoot.root}/";
|
||||
contents = gitConfigForScope gitRoot.scope;
|
||||
}) gitRoots;
|
||||
};
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
syncthingMesh = lib.listToAttrs (
|
||||
lib.concatMap (
|
||||
machine:
|
||||
lib.mapAttrsToList (
|
||||
userName: user:
|
||||
let
|
||||
name = "${userName}@${machine.name}";
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
value = {
|
||||
inherit name;
|
||||
id = user.syncthingId;
|
||||
};
|
||||
}
|
||||
) (lib.filterAttrs (_: user: user.syncthingId != null) machine.users)
|
||||
) (builtins.attrValues config.repo.machines)
|
||||
);
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.syncthing =
|
||||
{ ... }:
|
||||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
|
||||
settings = {
|
||||
folders = {
|
||||
sync = {
|
||||
path = "~/sync";
|
||||
label = "sync";
|
||||
devices = builtins.attrNames syncthingMesh;
|
||||
};
|
||||
calibre = {
|
||||
path = "~/calibre";
|
||||
label = "calibre";
|
||||
devices = builtins.attrNames syncthingMesh;
|
||||
};
|
||||
};
|
||||
devices = syncthingMesh;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.terminal =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
palette = repoTheme.palette;
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
};
|
||||
terminalDesktopId = repo.desktop.terminal.desktopId;
|
||||
in
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = terminalPackage != null;
|
||||
message = "Unknown terminal package `${lib.showAttrPath repo.desktop.terminal.packagePath}`.";
|
||||
}
|
||||
{
|
||||
assertion = repo.desktop.terminal.command == "kitty";
|
||||
message = "The terminal feature currently only supports kitty.";
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
terminalPackage == null
|
||||
|| terminalDesktopId == null
|
||||
|| builtins.pathExists "${terminalPackage}/share/applications/${terminalDesktopId}";
|
||||
message = "Terminal package `${lib.showAttrPath repo.desktop.terminal.packagePath}` must provide `${terminalDesktopId}`.";
|
||||
}
|
||||
];
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
settings.default = lib.optional (terminalDesktopId != null) terminalDesktopId;
|
||||
};
|
||||
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
font = {
|
||||
name = "JetBrains Mono";
|
||||
size = 11;
|
||||
};
|
||||
settings = {
|
||||
disable_ligatures = "always";
|
||||
scrollback_lines = 10000;
|
||||
enable_audio_bell = false;
|
||||
confirm_os_window_close = 0;
|
||||
window_padding_width = 3;
|
||||
update_check_interval = 0;
|
||||
};
|
||||
extraConfig = ''
|
||||
## name: ${repoTheme.displayName}
|
||||
## license: MIT
|
||||
## author: Tommaso Laurenzi
|
||||
## upstream: https://github.com/rebelot/kanagawa.nvim/
|
||||
|
||||
background ${palette.background}
|
||||
foreground ${palette.foreground}
|
||||
selection_background ${palette.selectionBackground}
|
||||
selection_foreground ${palette.selectionForeground}
|
||||
url_color ${palette.url}
|
||||
cursor ${palette.cursor}
|
||||
|
||||
active_tab_background ${palette.background}
|
||||
active_tab_foreground ${palette.selectionForeground}
|
||||
inactive_tab_background ${palette.background}
|
||||
inactive_tab_foreground ${palette.muted}
|
||||
|
||||
color0 ${palette.terminal.color0}
|
||||
color1 ${palette.terminal.color1}
|
||||
color2 ${palette.terminal.color2}
|
||||
color3 ${palette.terminal.color3}
|
||||
color4 ${palette.terminal.color4}
|
||||
color5 ${palette.terminal.color5}
|
||||
color6 ${palette.terminal.color6}
|
||||
color7 ${palette.terminal.color7}
|
||||
|
||||
color8 ${palette.terminal.color8}
|
||||
color9 ${palette.terminal.color9}
|
||||
color10 ${palette.terminal.color10}
|
||||
color11 ${palette.terminal.color11}
|
||||
color12 ${palette.terminal.color12}
|
||||
color13 ${palette.terminal.color13}
|
||||
color14 ${palette.terminal.color14}
|
||||
color15 ${palette.terminal.color15}
|
||||
|
||||
color16 ${palette.terminal.color16}
|
||||
color17 ${palette.terminal.color17}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.workstation-base = {
|
||||
imports = [
|
||||
nixosModules.audio
|
||||
nixosModules.bluetooth
|
||||
nixosModules.flatpak
|
||||
nixosModules.fonts
|
||||
nixosModules.networking
|
||||
nixosModules.niri
|
||||
nixosModules.plymouth
|
||||
nixosModules.printing
|
||||
nixosModules.sops-password
|
||||
nixosModules.sddm
|
||||
nixosModules.sops-admin-key-file
|
||||
nixosModules.standard-boot
|
||||
nixosModules.theme
|
||||
];
|
||||
|
||||
users.mutableUsers = false;
|
||||
|
||||
services.dbus.implementation = "broker";
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
environment.localBinInPath = true;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.workstation-base = {
|
||||
imports = [
|
||||
homeModules.ai
|
||||
homeModules.bitwarden
|
||||
homeModules.clipboard
|
||||
homeModules.dev-tools
|
||||
homeModules.email
|
||||
homeModules.local-apps
|
||||
homeModules.mpv
|
||||
homeModules.neovim
|
||||
homeModules.nh
|
||||
homeModules.niri
|
||||
homeModules.nix
|
||||
homeModules.pim
|
||||
homeModules.podman
|
||||
homeModules.shell
|
||||
homeModules.sops
|
||||
homeModules.source-control
|
||||
homeModules.ssh-client
|
||||
homeModules.terminal
|
||||
homeModules.theme
|
||||
homeModules.vicinae
|
||||
homeModules.xdg
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.xdg =
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
browserPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.browser.packagePath;
|
||||
};
|
||||
fileManagerPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.fileManager.packagePath;
|
||||
};
|
||||
homeDir = config.home.homeDirectory;
|
||||
localDir = "${homeDir}/.local";
|
||||
mediaDir = "${homeDir}/media";
|
||||
in
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
|
||||
cacheHome = "${localDir}/cache";
|
||||
configHome = "${homeDir}/.config";
|
||||
dataHome = "${localDir}/share";
|
||||
stateHome = "${localDir}/state";
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
setSessionVariables = true;
|
||||
|
||||
download = "${homeDir}/downloads";
|
||||
documents = "${homeDir}/documents";
|
||||
projects = "${homeDir}/dev";
|
||||
music = "${mediaDir}/music";
|
||||
pictures = "${mediaDir}/images";
|
||||
videos = "${mediaDir}/videos";
|
||||
desktop = "${localDir}/desktop";
|
||||
publicShare = "${localDir}/public";
|
||||
templates = "${localDir}/templates";
|
||||
};
|
||||
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
defaultApplicationPackages =
|
||||
with pkgs;
|
||||
[
|
||||
sioyek
|
||||
imv
|
||||
neovim
|
||||
]
|
||||
++ [
|
||||
browserPackage
|
||||
fileManagerPackage
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -12,10 +12,10 @@
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
flake.nixosConfigurations = builtins.mapAttrs (
|
||||
_: machine:
|
||||
name: machine:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [ (machine.buildFunction machine) ];
|
||||
modules = [ (config.repo.helpers.mkHost name machine) ];
|
||||
}
|
||||
) config.repo.machines;
|
||||
|
||||
|
||||
@@ -5,31 +5,27 @@
|
||||
}:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
accounts = config.repo.accounts;
|
||||
account = config.repo.account;
|
||||
in
|
||||
{
|
||||
repo.machines.orion = {
|
||||
buildFunction = config.repo.helpers.mkHost;
|
||||
module = nixosModules.orion;
|
||||
|
||||
users.kiri = {
|
||||
account = accounts.kiri;
|
||||
syncthingId = "NNRNQKZ-OWPHSVA-B6KKBHE-SDYLSTV-7SVHGPR-NEWLKPL-4MWNJG4-G5FHUAI";
|
||||
};
|
||||
syncthingId = "NNRNQKZ-OWPHSVA-B6KKBHE-SDYLSTV-7SVHGPR-NEWLKPL-4MWNJG4-G5FHUAI";
|
||||
|
||||
stateVersion = "24.05";
|
||||
hmStateVersion = "24.05";
|
||||
};
|
||||
|
||||
flake.modules.nixos.orion =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
nixosModules.host-base
|
||||
|
||||
nixosModules.sops-host-ssh-key
|
||||
nixosModules.openssh
|
||||
nixosModules.caddy
|
||||
nixosModules.server-firewall
|
||||
nixosModules.ssh-agent-auth
|
||||
nixosModules.sudo-ssh-agent-auth
|
||||
nixosModules.vps-insights
|
||||
nixosModules.vaultwarden
|
||||
nixosModules.radicale
|
||||
nixosModules.actual
|
||||
@@ -38,11 +34,8 @@ in
|
||||
./_disk.nix
|
||||
];
|
||||
|
||||
users.users.kiri = {
|
||||
linger = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAU2LydkXRTtNFY7oyX8JQURwXLVhB71DeK8XzrXeFX1 openpgp:0xA490D93A"
|
||||
];
|
||||
};
|
||||
environment.enableAllTerminfo = true;
|
||||
|
||||
users.users.${account.name}.linger = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,25 +5,17 @@
|
||||
}:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
accounts = config.repo.accounts;
|
||||
in
|
||||
{
|
||||
repo.machines.polaris = {
|
||||
buildFunction = config.repo.helpers.mkWorkstationHost;
|
||||
module = nixosModules.polaris;
|
||||
|
||||
users = {
|
||||
kiri = {
|
||||
account = accounts.kiri;
|
||||
syncthingId = "6HBAKXB-DB3B4H2-BODCAXF-KD23H5W-6X5LGLC-ZJHZHLG-7U7YMGO-BB6IXQ3";
|
||||
};
|
||||
|
||||
ergon.account = accounts.ergon;
|
||||
sshKeys = {
|
||||
personal.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEVORk45HKkX7gaGGp90KsVyUy6t+fKhbWN/grjkf3cQ kiri@polaris";
|
||||
work.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM5DMV6EQzsscgEOE0912mNglUHTEl+LPnaWYjj0y57B kiri@polaris#work";
|
||||
};
|
||||
|
||||
syncthingId = "6HBAKXB-DB3B4H2-BODCAXF-KD23H5W-6X5LGLC-ZJHZHLG-7U7YMGO-BB6IXQ3";
|
||||
|
||||
stateVersion = "24.05";
|
||||
hmStateVersion = "24.05";
|
||||
|
||||
displays = {
|
||||
"LG Electronics LG ULTRAGEAR 103NTYT8R290" = {
|
||||
@@ -43,7 +35,8 @@ in
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
nixosModules.qbittorrent-client
|
||||
nixosModules.workstation-base
|
||||
nixosModules.transmission
|
||||
nixosModules.steam
|
||||
./_hardware.nix
|
||||
]
|
||||
@@ -53,10 +46,5 @@ in
|
||||
common-cpu-amd
|
||||
common-gpu-amd
|
||||
]);
|
||||
|
||||
home-manager.users = {
|
||||
kiri.imports = [ homeModules.noctalia ];
|
||||
ergon.imports = [ homeModules.noctalia ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,25 +5,18 @@
|
||||
}:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
accounts = config.repo.accounts;
|
||||
in
|
||||
{
|
||||
repo.machines.zenith = {
|
||||
buildFunction = config.repo.helpers.mkWorkstationHost;
|
||||
module = nixosModules.zenith;
|
||||
portable = true;
|
||||
|
||||
users = {
|
||||
kiri.account = accounts.kiri;
|
||||
ergon = {
|
||||
account = accounts.ergon;
|
||||
sourceControl = {
|
||||
personal.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdR3KP2U84i7f7MlRqcML/3YyMw8JL3hdm637SkMUwO ergon@zenith#personal";
|
||||
work.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIHJz5uHKm0/TiMNh/cmzrODHNZ8NgEEZe+47XnJwQGk ergon@zenith#work";
|
||||
};
|
||||
};
|
||||
sshKeys = {
|
||||
personal.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIQy4k04gU7UpjBgyUQ57kUwxOdt79LvMCiCekXZeZhd kiri@zenith";
|
||||
work.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIHJz5uHKm0/TiMNh/cmzrODHNZ8NgEEZe+47XnJwQGk kiri@zenith#work";
|
||||
};
|
||||
|
||||
syncthingId = "5VMGBZJ-NNAVCLY-YWHCJLM-EJ3SCFC-EOGCECD-DGXC7EL-J5NXAAG-4JDEMQG";
|
||||
|
||||
displays = {
|
||||
"California Institute of Technology 0x1410 Unknown" = {
|
||||
primary = true;
|
||||
@@ -35,14 +28,14 @@ in
|
||||
};
|
||||
|
||||
stateVersion = "24.05";
|
||||
hmStateVersion = "24.05";
|
||||
};
|
||||
|
||||
flake.modules.nixos.zenith =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
nixosModules.qbittorrent-client
|
||||
nixosModules.workstation-base
|
||||
nixosModules.transmission
|
||||
nixosModules.laptop-power
|
||||
{
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
@@ -51,7 +44,5 @@ in
|
||||
./_hardware.nix
|
||||
inputs.nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7-amdgpu
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [ homeModules.noctalia-portable ];
|
||||
};
|
||||
}
|
||||
|
||||
+24
-48
@@ -1,7 +1,6 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
|
||||
resolvePackagePath =
|
||||
{
|
||||
@@ -38,79 +37,56 @@ let
|
||||
};
|
||||
|
||||
mkHost =
|
||||
machine:
|
||||
name: machine:
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
accountHome = account.homeDirectory or "/home/${account.name}";
|
||||
normalizedMachine = machine // {
|
||||
inherit name;
|
||||
displays = machine.displays or { };
|
||||
hmStateVersion = machine.hmStateVersion or machine.stateVersion;
|
||||
portable = machine.portable or false;
|
||||
sshKeys = machine.sshKeys or { };
|
||||
syncthingId = machine.syncthingId or null;
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
nixosModules.host-base
|
||||
machine.module
|
||||
nixosModules.${name}
|
||||
];
|
||||
|
||||
meta.machine = machine;
|
||||
facts.machine = normalizedMachine;
|
||||
|
||||
networking.hostName = machine.name;
|
||||
networking.hostName = name;
|
||||
system.stateVersion = machine.stateVersion;
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
users.users = lib.mapAttrs (_: user: {
|
||||
users.users.${account.name} = {
|
||||
isNormalUser = true;
|
||||
home = user.account.homeDirectory;
|
||||
home = accountHome;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
}) machine.users;
|
||||
|
||||
home-manager.users = lib.mapAttrs (name: user: {
|
||||
imports = [ user.account.baseModule ];
|
||||
|
||||
meta = {
|
||||
inherit machine user;
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.${account.name} = {
|
||||
home = {
|
||||
username = name;
|
||||
homeDirectory = user.account.homeDirectory;
|
||||
stateVersion = machine.hmStateVersion;
|
||||
username = account.name;
|
||||
homeDirectory = accountHome;
|
||||
stateVersion = normalizedMachine.hmStateVersion;
|
||||
};
|
||||
}) machine.users;
|
||||
};
|
||||
|
||||
mkWorkstationHost =
|
||||
machine:
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
(mkHost machine)
|
||||
nixosModules.workstation-base
|
||||
];
|
||||
|
||||
users.users = lib.mapAttrs (_: _: {
|
||||
extraGroups = [ "networkmanager" ];
|
||||
}) machine.users;
|
||||
|
||||
home-manager.users = lib.mapAttrs (_: user: {
|
||||
imports = [
|
||||
hmModules.workstation-base
|
||||
user.account.workstationModule
|
||||
];
|
||||
}) machine.users;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.repo.helpers = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.raw;
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
config.repo.helpers = {
|
||||
inherit
|
||||
mkCaddyReverseProxy
|
||||
mkHost
|
||||
mkWorkstationHost
|
||||
resolvePackagePath
|
||||
;
|
||||
};
|
||||
|
||||
+19
-281
@@ -1,295 +1,33 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
sourceControlScopeType = lib.types.enum [
|
||||
"personal"
|
||||
"work"
|
||||
];
|
||||
|
||||
emailProviderType = lib.types.enum [
|
||||
"mxrouting"
|
||||
"office365"
|
||||
];
|
||||
|
||||
emailType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
address = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
primary = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
type = lib.mkOption {
|
||||
type = emailProviderType;
|
||||
};
|
||||
|
||||
scope = lib.mkOption {
|
||||
type = lib.types.nullOr sourceControlScopeType;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
sourceControlAccountType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options.projectScope = lib.mkOption {
|
||||
type = sourceControlScopeType;
|
||||
default = "personal";
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
accountType = lib.types.submodule (
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
};
|
||||
|
||||
realName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
homeDirectory = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/${config.name}";
|
||||
};
|
||||
|
||||
nixosConfigurationPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "${config.homeDirectory}/.config/nixos";
|
||||
};
|
||||
|
||||
emails = lib.mkOption {
|
||||
type = lib.types.attrsOf emailType;
|
||||
default = { };
|
||||
};
|
||||
|
||||
baseModule = lib.mkOption {
|
||||
type = lib.types.deferredModule;
|
||||
default = { };
|
||||
};
|
||||
|
||||
workstationModule = lib.mkOption {
|
||||
type = lib.types.deferredModule;
|
||||
default = { };
|
||||
};
|
||||
|
||||
sourceControl = lib.mkOption {
|
||||
type = sourceControlAccountType;
|
||||
default = { };
|
||||
};
|
||||
|
||||
primaryEmail = lib.mkOption {
|
||||
type = lib.types.nullOr emailType;
|
||||
description = "Derived primary email entry for this user.";
|
||||
default =
|
||||
let
|
||||
emails = builtins.attrValues config.emails;
|
||||
in
|
||||
lib.findFirst (email: email.primary) null emails;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
displayType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
primary = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
x = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
};
|
||||
|
||||
y = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
};
|
||||
|
||||
scale = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.float;
|
||||
default = null;
|
||||
};
|
||||
|
||||
width = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
|
||||
height = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
|
||||
refresh = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.float;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
sourceControlMachineKeyType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
publicKey = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
privateKeyPath = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
sourceControlMachineUserType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
personal = lib.mkOption {
|
||||
type = lib.types.nullOr sourceControlMachineKeyType;
|
||||
default = null;
|
||||
};
|
||||
|
||||
work = lib.mkOption {
|
||||
type = lib.types.nullOr sourceControlMachineKeyType;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
machineUserType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
account = lib.mkOption {
|
||||
type = accountType;
|
||||
};
|
||||
|
||||
sourceControl = lib.mkOption {
|
||||
type = sourceControlMachineUserType;
|
||||
default = { };
|
||||
};
|
||||
|
||||
syncthingId = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
machineType = lib.types.submodule (
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
};
|
||||
|
||||
module = lib.mkOption {
|
||||
type = lib.types.deferredModule;
|
||||
default = { };
|
||||
};
|
||||
|
||||
buildFunction = lib.mkOption {
|
||||
type = lib.types.functionTo lib.types.deferredModule;
|
||||
};
|
||||
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
hmStateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = config.stateVersion;
|
||||
};
|
||||
|
||||
displays = lib.mkOption {
|
||||
type = lib.types.attrsOf displayType;
|
||||
default = { };
|
||||
};
|
||||
|
||||
users = lib.mkOption {
|
||||
type = lib.types.attrsOf machineUserType;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
options.repo = {
|
||||
accounts = lib.mkOption {
|
||||
type = lib.types.attrsOf accountType;
|
||||
default = { };
|
||||
};
|
||||
options.repo = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
freeformType = lib.types.attrsOf lib.types.anything;
|
||||
|
||||
machines = lib.mkOption {
|
||||
type = lib.types.attrsOf machineType;
|
||||
default = { };
|
||||
};
|
||||
|
||||
contact = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
default = { };
|
||||
};
|
||||
|
||||
desktop = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
default = { };
|
||||
};
|
||||
|
||||
services = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
default = { };
|
||||
};
|
||||
|
||||
theme = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
default = { };
|
||||
options.helpers = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.raw;
|
||||
default = { };
|
||||
internal = true;
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
};
|
||||
|
||||
config.flake.modules.nixos.meta =
|
||||
{ ... }:
|
||||
config.flake.modules.nixos.facts =
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.meta.machine = lib.mkOption {
|
||||
type = machineType;
|
||||
options.facts.machine = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config.flake.modules.homeManager.meta =
|
||||
{ ... }:
|
||||
config.flake.modules.homeManager.facts =
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.meta = {
|
||||
machine = lib.mkOption {
|
||||
type = machineType;
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = machineUserType;
|
||||
};
|
||||
options.facts.desktop = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,25 +5,32 @@
|
||||
}:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.host-base = {
|
||||
imports = [
|
||||
nixosModules.meta
|
||||
nixosModules.facts
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
nixosModules.ai
|
||||
nixosModules.nix
|
||||
nixosModules.region-nl
|
||||
nixosModules.locale-nl
|
||||
nixosModules.sops-password
|
||||
];
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
backupFileExtension = "bak";
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
sharedModules = [ homeModules.meta ];
|
||||
sharedModules = [
|
||||
hmModules.facts
|
||||
hmModules.syncthing
|
||||
hmModules.shell
|
||||
hmModules.neovim
|
||||
];
|
||||
};
|
||||
|
||||
users.mutableUsers = false;
|
||||
|
||||
security.sudo.extraConfig = ''
|
||||
Defaults env_keep+=SSH_AUTH_SOCK
|
||||
'';
|
||||
@@ -0,0 +1,71 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
account = config.repo.account;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.workstation-base = {
|
||||
imports = [
|
||||
nixosModules.host-base
|
||||
|
||||
nixosModules.audio
|
||||
nixosModules.bluetooth
|
||||
nixosModules.flatpak
|
||||
nixosModules.fonts
|
||||
nixosModules.network-manager
|
||||
nixosModules.nftables-firewall
|
||||
nixosModules.niri
|
||||
nixosModules.plymouth
|
||||
nixosModules.printing
|
||||
nixosModules.sddm
|
||||
nixosModules.sops-admin-key-file
|
||||
nixosModules.limine
|
||||
nixosModules.theme
|
||||
nixosModules.ai
|
||||
nixosModules.hidraw-access
|
||||
nixosModules.walker-cache
|
||||
];
|
||||
|
||||
services.dbus.implementation = "broker";
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
environment.localBinInPath = true;
|
||||
|
||||
home-manager.users.${account.name}.imports = [
|
||||
homeModules.workstation-base
|
||||
];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.workstation-base = {
|
||||
imports = [
|
||||
homeModules.passwords
|
||||
homeModules.clipboard
|
||||
homeModules.dev-tools
|
||||
homeModules.xdg
|
||||
homeModules.workstation-apps
|
||||
homeModules.primary-browser-vivaldi
|
||||
homeModules.primary-file-manager-nautilus
|
||||
homeModules.primary-launcher-walker
|
||||
homeModules.default-image-viewer-imv
|
||||
homeModules.default-document-viewer-sioyek
|
||||
homeModules.default-editor-neovim
|
||||
homeModules.email
|
||||
homeModules.mpv
|
||||
homeModules.nix
|
||||
homeModules.calendar-tasks
|
||||
homeModules.podman
|
||||
homeModules.git
|
||||
homeModules.ssh-client
|
||||
homeModules.primary-terminal-kitty
|
||||
homeModules.terminal-foot
|
||||
homeModules.noctalia
|
||||
{
|
||||
programs.discord = {
|
||||
enable = true;
|
||||
settings.SKIP_HOST_UPDATE = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
keys:
|
||||
- &admin age122w85pqj508ukv0rd388mahecgfckmpgnsgz0zcyec37ljae2epsdnvxpl
|
||||
- &orion age1l49tm85prcpm4q8e0hxxetv08jqv3gfty3pvzte956dng4h0xaeq0he5yd
|
||||
- &orion age1upsxyevxdv3xax8jhnffclryuve70k63cjrca69ffds4h2m3nvuql59ufw
|
||||
creation_rules:
|
||||
- path_regex: secrets.yaml$
|
||||
key_groups:
|
||||
|
||||
@@ -2,32 +2,31 @@ radicale-pass: ENC[AES256_GCM,data:3CpCnSibLWeZUJRBMuc=,iv:3J9x4ejcsYXCjRRGP5lOe
|
||||
university-calendar-url: ENC[AES256_GCM,data:oGP1BdF3YxdRRr061LaC4HaaiPXoyZq7ZALqU+cv8wb2GgYT+jgshgx9LRjM3jsIjPXolkG5bCZi46r/rpEk3mWSskQ3YnCXcwM1BN+PPVapdtQgkRSWriAOUXPnRpaZzpMs5WaJTnkOrJJqfAoy+jGIE0Nhul/CRw5tOeRkwPbDxfA/dY9MT80ciHWHscHb1w9R,iv:1JqN80OnrIjOl4LGmk99LsJMmoT3hGjlCet6mYeRb5o=,tag:9GhVQIa1BXAEjdOxswHH/A==,type:str]
|
||||
ssh-config-orion: ENC[AES256_GCM,data:8vrbtuHCLlMDtMAfnJuf+DcWmPZwFFpyGag8l32JAFUMmWyEEEvDctNDHNahw8fiQzwN0+9atjY=,iv:UKWqjZ4D3+McASovEaE5jt4TAkmlwR26chFvWblgc1k=,tag:oZJKwLDPQEbfa4CPHn9lVQ==,type:str]
|
||||
orion-ip: ENC[AES256_GCM,data:S6fpCWnD8dvchvrHlEo=,iv:72+oRxHUEJ7imJ+sWjGbG+TUrSqYL8hbyHl3ChwFYwA=,tag:Rj6msje87+Ve+M6kcZd4Jw==,type:str]
|
||||
hashed-password-kiri: ENC[AES256_GCM,data:xubN5stH4RPlHYl+Jzcu2BCepz3Hra3TxjiSspktzjgpEWrU79h3NbcPMrYC0MSjsv3oaWio/S7nBV3Tes3WBlI9EC9vq+6tyTVPynUqpB7c9CvvYSmqc9bAHOnIOBb+gP2RR6JB395UoQ==,iv:uN83RNTfCJdBDhFhywV5NbVBp4xcptqzoKVAoAnaiQk=,tag:x9yufiPdSJwBADT6QymExA==,type:str]
|
||||
hashed-password: ENC[AES256_GCM,data:mhYvALF/VrPMFFYEIGiML1MoRxdOI/J9akZPD+OF5drDTR4J5LBn3EejlbzP8CTCRsyoIF6tigMBxF8ZLz9W7hOVwT70Hr/yXfLWJ2lfBsf7l/SPZ+6NglKppCeQQktm4QKIHTVj7CkbRw==,iv:0RxXkb+vz/QK9dvecCZpWCWCsoPhi2F3OCt6CwUDqX4=,tag:j7QO8xUfWUnSpk4mMQUYmA==,type:str]
|
||||
gemini-api-key-neovim: ENC[AES256_GCM,data:B8FeFt45FsU3aagyLDKXiwmx0mRrsw4C8RQ3EWXwZ+YfWLMvwJad,iv:1HqBD6vc07Ke/PMYXfHqFrWDGw/UMjiiBjLRN33/xHI=,tag:czcrYGbJFi41rYtIPM4qTQ==,type:str]
|
||||
booklore-db-pass: ENC[AES256_GCM,data:dlPGXQ24itEaBRJSJ9WOogWCdF3atFQ2ZtlLGyGq8Tin5OmSZI6lZUzSE+femBW5SBTIlKQvzHEPCs9MT5tyMIqetzGLm+mMN3FDW7si684Cuv9z9Uq5gjAZWh14KQMWYPI=,iv:oLnqu2EDFBVcBpswVRXXeF617YolPxOUx9CscHRRn/8=,tag:Si6gF1EXhcHalk11D3Exlw==,type:str]
|
||||
deluge-auth-file: ENC[AES256_GCM,data:uJME7CAC5OOJZLPdu9MNkg8ZDZZ64Wsytg==,iv:5l4eTSbdSKtOwjXGr7D1Teud5TON1+lcjWeI8W4bCuQ=,tag:ND8+cOUef1fwAGjmvWXEUQ==,type:str]
|
||||
hashed-password-ergon: ENC[AES256_GCM,data:ZmqrOb9dGNzZe5rJRHTImgPkNDFzNlyMLRrnz1KgUsIyh3/VsiIB/pPa98vli83FBrRFWdB/KPjEt1/V71qalTcA7seMccPiCQ==,iv:Fzkjfz+T3F18b5nqjZ986kx28HrqQaJqq8Ng419TnRA=,tag:xIenh0oOlrFog9Hon+nsDQ==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- recipient: age122w85pqj508ukv0rd388mahecgfckmpgnsgz0zcyec37ljae2epsdnvxpl
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBMQXRVTlRjZDRMWksvc200
|
||||
T2lUN0d6eXZJZ2k2aXZHVUY4M2hSWFZEeVNBCkkxMTZQbGlZRFRHeW9wSFdwbXc0
|
||||
bHdWYVZucGlXTkYvSFRWNW83RUNCRDAKLS0tIG9ha2psQVhwY3NMS21mOUNkeEFx
|
||||
M3p6Nm9mY2RNVUp3ZW5KUGwvdm1rV2sKFygdzZgjTuG2JMzMnGuyE6qv4IvjHsIu
|
||||
Sv0PpSC9wgJQhoOCHUQVaPzn/Zv7llFlU3GBRqk8FLCj/IVaYVoc1g==
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBSV0R5Wnh4SzkrVnduU2dX
|
||||
WlFPWDlTZkRkSHRmYi9GNG5ubFhiZklLKzFVCkNUVzNhZGJNRDdJMVZ4dHpkaDJY
|
||||
dWRlaTc5THFCVXFBSEowM3Yzd2FiemMKLS0tIDR4U2psWXk4dDFnOUhVUnN6TGNB
|
||||
ZVgzMERBR0ZTZTdtVTBVLzZBSGVmdEEKxGLHho8v7bBZUIY4TRblgK81NooDrk9D
|
||||
c7MmBMpBkPfXGKjwI+WcXtZfiotJZojEnb4doMpWJiBy8f1t7C1FGQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
- recipient: age1l49tm85prcpm4q8e0hxxetv08jqv3gfty3pvzte956dng4h0xaeq0he5yd
|
||||
- recipient: age1upsxyevxdv3xax8jhnffclryuve70k63cjrca69ffds4h2m3nvuql59ufw
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBaWXVtMHBpMWtGOU03OGlH
|
||||
NW9WYVNkYWxBcEErUy91dW5VSWtBRGcxY2dNCm5ZTDhBT1U1TjZrdnBKVi85QkRD
|
||||
QkQwSDBock5MVGRwMmFkcjFxaXFZR0EKLS0tIHovWC9TREFxSjdTcjVTM3VnczJX
|
||||
aW8vM0IwQ243TnNPdnlkeHE4bTFLR00KaJhbOxdbIUJSzn4lOt2OO1HOTNaOoiSE
|
||||
+pKjsYZZQBdcYFPREjffEL+oiyxHwoLi95noHad9AGmygLqwboUkWg==
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBRSXljc3A4UXRHbGJTTHIz
|
||||
bG1GQ3ZrUmRoc29lekhld2FtTDhrVTNtZGhjCnJVRGxmalUrVEIyTEF4WVRORk5D
|
||||
TXU1Tm5IVlpJWlhJSU9PMFJiamJyMGMKLS0tIGFlSlhrOVBCQ1ZnRU0zQTBJSjhi
|
||||
WUh0MmdSSEFiRXZCeVZoMnZMT3Flc0EKsqLtLFr9eXYiZV7/Wai2/2VB2pbBL1Wp
|
||||
sWu/+CcQDpUu4tAeBSCUZ/BV2nTvfb94DZGK2dWUFniJaZit5tRZlg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2026-04-17T00:35:34Z"
|
||||
mac: ENC[AES256_GCM,data:pjtjsc9uATZo7GnauAguMwVCDnSnoZhkxAShuUrDT6/enURYp4UB9tIwPH54PAc2UpU23vgv5XJNJ2ah4nAgOse2iyfm84b0S+bOfXKCd5gQTf8beOFCOT+xrQmURMN9q/RAA47RBT7qZFu4J/b+EkNeY9lJM1rmYjcOygxXd58=,iv:2IYY0GmCQOZnwsnPHsAmC4CBjyS6e/DNTCQa3AkSTxc=,tag:ZtBvvMDqb851Tzg26p7NhQ==,type:str]
|
||||
lastmodified: "2026-04-26T15:37:24Z"
|
||||
mac: ENC[AES256_GCM,data:AR1PRP/zFzCoggCoUUCM5ZzIsOh0DSPJoAgkeZTaJAgFq9QbAI1cHPuk4qVPGyY7HZYDabhtvDSADbsbgkQOavct1Z/fFW6Sow1rLW3tkv1ENKv2lPiM2I8BK2olgH/blEa86vBE24jCS7qE0j2/ak69hWYH/bkKnyUrOCC/AUE=,iv:U0Q1jGlzY/WxbV3eNPtlMhVGiWXTOG9ft5j8U1ZacCQ=,tag:YpNUkifz0b6aoxv33pq1pw==,type:str]
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.12.2
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.sops-password =
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [ nixosModules.sops ];
|
||||
|
||||
sops.secrets.hashed-password.neededForUsers = true;
|
||||
|
||||
users.users.${account.name}.hashedPasswordFile = config.sops.secrets.hashed-password.path;
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
}:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
sopsAdminKeyPath = "/var/lib/sops/keys.txt";
|
||||
in
|
||||
{
|
||||
@@ -22,6 +23,8 @@ in
|
||||
{
|
||||
imports = [ nixosModules.sops ];
|
||||
|
||||
home-manager.sharedModules = [ hmModules.sops ];
|
||||
|
||||
sops.age.keyFile = sopsAdminKeyPath;
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
repo.accounts.ergon = {
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
sourceControl.projectScope = "work";
|
||||
emails = {
|
||||
personal = {
|
||||
address = "mail@jelles.net";
|
||||
scope = "personal";
|
||||
type = "mxrouting";
|
||||
};
|
||||
work = {
|
||||
address = "jelle.spreeuwenberg@yookr.org";
|
||||
primary = true;
|
||||
scope = "work";
|
||||
type = "office365";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
repo.accounts.kiri = {
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
workstationModule = {
|
||||
imports = [
|
||||
hmModules.syncthing
|
||||
hmModules.qbittorrent-client
|
||||
];
|
||||
};
|
||||
emails = {
|
||||
personal = {
|
||||
address = "mail@jelles.net";
|
||||
primary = true;
|
||||
scope = "personal";
|
||||
type = "mxrouting";
|
||||
};
|
||||
old = {
|
||||
address = "mail@jellespreeuwenberg.nl";
|
||||
scope = null;
|
||||
type = "mxrouting";
|
||||
};
|
||||
uni = {
|
||||
address = "j.spreeuwenberg@student.tue.nl";
|
||||
scope = null;
|
||||
type = "office365";
|
||||
};
|
||||
work = {
|
||||
address = "jelle.spreeuwenberg@yookr.org";
|
||||
scope = "work";
|
||||
type = "office365";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user