From ef29bdf5aa5aba03ef0a456c8547116057100130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Sun, 22 Feb 2026 17:33:58 +0100 Subject: [PATCH 1/9] update some niri --- flake.lock | 271 +++++++++++++++++++++------------ flake.nix | 2 +- hosts/fili/services/immich.nix | 18 ++- hosts/kili/configuration.nix | 4 + programs/default.nix | 2 +- programs/niri/default.nix | 73 ++++++--- programs/zed/default.nix | 3 + users/default.nix | 10 ++ 8 files changed, 254 insertions(+), 129 deletions(-) diff --git a/flake.lock b/flake.lock index e9a545d..80d814f 100644 --- a/flake.lock +++ b/flake.lock @@ -12,7 +12,7 @@ "ragenix", "nixpkgs" ], - "systems": "systems_12" + "systems": "systems_13" }, "locked": { "lastModified": 1761656077, @@ -70,11 +70,11 @@ ] }, "locked": { - "lastModified": 1767967164, - "narHash": "sha256-Cx4VETh9dGoQYDtWhre7g66d7SAr+h1h6f+SSHxVrck=", + "lastModified": 1771587924, + "narHash": "sha256-eVYOGmF8nQBhudJyU6lHdgJI87kvGz8JyCq5/Vi9Mjk=", "owner": "catppuccin", "repo": "nix", - "rev": "e973584280e3b0e1d5b5a1a5e9948dc222c54af7", + "rev": "b0c65edbf31c2ad3d84438d82c2310f2c28373f3", "type": "github" }, "original": { @@ -280,11 +280,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1768881817, - "narHash": "sha256-yEG418W8a7C/bcmRI5Lgd03XbBc8K2yV0kp1WUHTYbA=", + "lastModified": 1771918157, + "narHash": "sha256-MU/9oxyXCRKyAskjSgku8P7r0XpQiE50tvDKkNDveJg=", "owner": "rycee", "repo": "nur-expressions", - "rev": "bbd2046d41083954fd28c31cb4f2d3510c9e2b1e", + "rev": "921c0db962c553e972d59c3563d29fd575437f03", "type": "gitlab" }, "original": { @@ -326,6 +326,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -334,11 +350,11 @@ ] }, "locked": { - "lastModified": 1765835352, - "narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=", + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "a34fae9c08a15ad73f295041fec82323541400a9", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", "type": "github" }, "original": { @@ -364,7 +380,7 @@ }, "flake-utils_10": { "inputs": { - "systems": "systems_13" + "systems": "systems_11" }, "locked": { "lastModified": 1731533236, @@ -385,11 +401,11 @@ "systems": "systems_14" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -403,11 +419,11 @@ "systems": "systems_15" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -456,6 +472,24 @@ "inputs": { "systems": "systems_18" }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_16": { + "inputs": { + "systems": "systems_19" + }, "locked": { "lastModified": 1710146030, "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", @@ -639,11 +673,11 @@ ] }, "locked": { - "lastModified": 1768836546, - "narHash": "sha256-nJZkTamcXXMW+SMYiGFB6lB8l0aJw0xjssfN8xYd/Fs=", + "lastModified": 1771851181, + "narHash": "sha256-gFgE6mGUftwseV3DUENMb0k0EiHd739lZexPo5O/sdQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "b56c5ad14fcf8b5bc887463552483bf000ca562a", + "rev": "9a4b494b1aa1b93d8edf167f46dc8e0c0011280c", "type": "github" }, "original": { @@ -660,11 +694,11 @@ ] }, "locked": { - "lastModified": 1768512489, - "narHash": "sha256-jZi945d3e6DYhrw3K5Pew+QaL3qSgq3O6xiVaEVLgXs=", + "lastModified": 1771851181, + "narHash": "sha256-gFgE6mGUftwseV3DUENMb0k0EiHd739lZexPo5O/sdQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "bba859cd85b90dd9e4e6fd44b2af4aa64ae801a1", + "rev": "9a4b494b1aa1b93d8edf167f46dc8e0c0011280c", "type": "github" }, "original": { @@ -739,11 +773,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1768781827, - "narHash": "sha256-IbWOHI/IlGC43Mg7AZUu6jCHjIEzFIPAoSlFDJG43A4=", + "lastModified": 1771879754, + "narHash": "sha256-X0DpLExFW+/0o+cNCnIJuQZUZGRuBC0Tr9QsbNVXQ1U=", "owner": "martinvonz", "repo": "jj", - "rev": "de8531b018a08fd1e2ee67b5c8848146c62be5f4", + "rev": "f89aebceb3a327e33c5ac732b7af548d32ba8199", "type": "github" }, "original": { @@ -795,16 +829,16 @@ "systems": "systems_7" }, "locked": { - "lastModified": 1768585282, - "narHash": "sha256-JTH+wQTt8pyS5iPb7+r/70pYfLgi/OFTzimcRmMcs2g=", + "lastModified": 1770927856, + "narHash": "sha256-2jcqAU8QutF8AE15LYwd8cy7KjayGxUGHxvWnqAiS5M=", "owner": "InioX", "repo": "matugen", - "rev": "5905cae968e02d3c1d23ee556e9a0719e5231227", + "rev": "e65259d68edc034905da477b6c1a349e89e2aa8d", "type": "github" }, "original": { "owner": "InioX", - "ref": "main", + "ref": "v4.0.0", "repo": "matugen", "type": "github" } @@ -817,11 +851,11 @@ "nixpkgs-mozilla": "nixpkgs-mozilla" }, "locked": { - "lastModified": 1768926700, - "narHash": "sha256-/bANzWLzVAzdRDXua/p9wIDS/RGIHSBHqyduXoCd+P8=", + "lastModified": 1770456722, + "narHash": "sha256-2zjh754j9iCkhJiYIQgQhwkaDiXo+K8AfGCayJoQLDI=", "ref": "refs/heads/main", - "rev": "7c883e02e2a77061bfa048d249df0d39b362a5cf", - "revCount": 72, + "rev": "204bf6ed1f899f788c025c7dfc79ce82d3e32002", + "revCount": 74, "type": "git", "url": "ssh://forgejo@git.donsz.nl/jana/money.is.fckn.gay.git" }, @@ -880,11 +914,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1768767453, - "narHash": "sha256-Omq1UHEJ1oxkTo2j8l6qQtmyPR7Uj+k7HC5Khd3jVVA=", + "lastModified": 1771917018, + "narHash": "sha256-igOZoXdb9wDhBtADaa8AfANZRgKzhW2lIq0mtqLVT0U=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "8eab7c21ef4edc97cc56ddb8e76a842e0818d6d7", + "rev": "1f65cd89e65431c64b492e505033c4b48c94b20e", "type": "github" }, "original": { @@ -916,11 +950,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1768678265, - "narHash": "sha256-Ub8eed4DsfIDWyg30xEe+8bSxL/z5Af/gCjmvJ0V/Hs=", + "lastModified": 1771849386, + "narHash": "sha256-CFvjBjS2LxbBMR3Lu6wZhME6ck3CXyKUufRoJA5tlmw=", "owner": "YaLTeR", "repo": "niri", - "rev": "d7184a04b904e07113f4623610775ae78d32394c", + "rev": "2dc6f4482c4eeed75ea8b133d89cad8658d38429", "type": "github" }, "original": { @@ -958,11 +992,11 @@ ] }, "locked": { - "lastModified": 1765267181, - "narHash": "sha256-d3NBA9zEtBu2JFMnTBqWj7Tmi7R5OikoU2ycrdhQEws=", + "lastModified": 1771734689, + "narHash": "sha256-/phvMgr1yutyAMjKnZlxkVplzxHiz60i4rc+gKzpwhg=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "82befcf7dc77c909b0f2a09f5da910ec95c5b78f", + "rev": "8f590b832326ab9699444f3a48240595954a4b10", "type": "github" }, "original": { @@ -993,13 +1027,36 @@ "type": "github" } }, + "nix-minecraft": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_10", + "nixpkgs": [ + "p1n3appl3", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769912969, + "narHash": "sha256-RtH34gy6R12oXcmBlUWXygdNeC+KuX3beEsLBXV44Qs=", + "owner": "Yeshey", + "repo": "nix-minecraft", + "rev": "7e3a114dd267e9303d092e29af67ca30c1db86ca", + "type": "github" + }, + "original": { + "owner": "Yeshey", + "repo": "nix-minecraft", + "type": "github" + } + }, "nixos-hardware": { "locked": { - "lastModified": 1768499669, - "narHash": "sha256-jJr/zDxu5evfQxlXtMrFFF68/RNj1UrctS/eIsay4k0=", + "lastModified": 1771423359, + "narHash": "sha256-yRKJ7gpVmXbX2ZcA8nFi6CMPkJXZGjie2unsiMzj3Ig=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "7297dfc69ae9b06e984a6f69900ce25e67c76f46", + "rev": "740a22363033e9f1bb6270fbfb5a9574067af15b", "type": "github" }, "original": { @@ -1074,11 +1131,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1768621446, - "narHash": "sha256-6YwHV1cjv6arXdF/PQc365h1j+Qje3Pydk501Rm4Q+4=", + "lastModified": 1771714954, + "narHash": "sha256-nhZJPnBavtu40/L2aqpljrfUNb2rxmWTmSjK2c9UKds=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "72ac591e737060deab2b86d6952babd1f896d7c5", + "rev": "afbbf774e2087c3d734266c22f96fca2e78d3620", "type": "github" }, "original": { @@ -1090,16 +1147,16 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1767313136, - "narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", + "lastModified": 1771714954, + "narHash": "sha256-nhZJPnBavtu40/L2aqpljrfUNb2rxmWTmSjK2c9UKds=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", + "rev": "afbbf774e2087c3d734266c22f96fca2e78d3620", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-25.05", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } @@ -1122,11 +1179,11 @@ }, "nixpkgs_11": { "locked": { - "lastModified": 1771067046, - "narHash": "sha256-fYZMOngn9UX4dyhKcMEqqLjjw3x8T3v3hlYnnbEZh2E=", + "lastModified": 1771932323, + "narHash": "sha256-3PadsTzuMJT/x0KmiD/Me1GG6rW8kaHoWVduSs0ue7o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "75c4807ebe5f9cad5622862f4f26ca73c069be06", + "rev": "89bb5c5da7a857869cc88ef9b856bffdff8af264", "type": "github" }, "original": { @@ -1137,11 +1194,11 @@ }, "nixpkgs_12": { "locked": { - "lastModified": 1768305791, - "narHash": "sha256-AIdl6WAn9aymeaH/NvBj0H9qM+XuAuYbGMZaP0zcXAQ=", + "lastModified": 1771369470, + "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1412caf7bf9e660f2f962917c14b1ea1c3bc695e", + "rev": "0182a361324364ae3f436a63005877674cf45efb", "type": "github" }, "original": { @@ -1185,11 +1242,11 @@ }, "nixpkgs_15": { "locked": { - "lastModified": 1767379071, - "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", + "lastModified": 1768564909, + "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fb7944c166a3b630f177938e478f0378e64ce108", + "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", "type": "github" }, "original": { @@ -1231,11 +1288,11 @@ }, "nixpkgs_18": { "locked": { - "lastModified": 1769248673, - "narHash": "sha256-oyxrDiV2yFToXpzwiJUYkxCjFHvL21tMQ2BpQMyMDTw=", + "lastModified": 1771931193, + "narHash": "sha256-IRPLf3y0HxdLirCVYoOYXQyoUBIM8llw7/96OHvyQoM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c0301d62ba146fee37e79fbc4b6323af52a2834e", + "rev": "12e7188b8c774804377e7b82f45fa95ee87836cb", "type": "github" }, "original": { @@ -1247,11 +1304,11 @@ }, "nixpkgs_19": { "locked": { - "lastModified": 1768569498, - "narHash": "sha256-bB6Nt99Cj8Nu5nIUq0GLmpiErIT5KFshMQJGMZwgqUo=", + "lastModified": 1771207753, + "narHash": "sha256-b9uG8yN50DRQ6A7JdZBfzq718ryYrlmGgqkRm9OOwCE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "be5afa0fcb31f0a96bf9ecba05a516c66fcd8114", + "rev": "d1c15b7d5806069da59e819999d70e1cec0760bf", "type": "github" }, "original": { @@ -1405,11 +1462,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1768564909, - "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", "type": "github" }, "original": { @@ -1428,11 +1485,11 @@ "systems": "systems_9" }, "locked": { - "lastModified": 1768795384, - "narHash": "sha256-gZIXLzhupxAwRMMRTFgrl669ciYiiPmnA3PwocJ+6jQ=", + "lastModified": 1771135771, + "narHash": "sha256-wyvBIhDuyCRyjB3yPg77qoyxrlgQtBR1rVW3c9knV3E=", "owner": "nix-community", "repo": "nixvim", - "rev": "57d393deb53af1b28b14973d3e3885c3d17e7bbe", + "rev": "ed0424f0b08d303a7348f52f7850ad1b2704f9ba", "type": "github" }, "original": { @@ -1448,11 +1505,11 @@ ] }, "locked": { - "lastModified": 1768845494, - "narHash": "sha256-PKlKrQMhk+ygsVPny9iOcttZRic870ZbFLTpZEz3MUg=", + "lastModified": 1771872869, + "narHash": "sha256-evn+p0+T9yNtjdRr5UnYwXnhlHgFB8ilzhGQoYvgXhs=", "owner": "noctalia-dev", "repo": "noctalia-shell", - "rev": "77aaf6923d19ec824ea142ce02018bfe9a967da4", + "rev": "90e44d6edd604a0877310b01ff20006abcf67e77", "type": "github" }, "original": { @@ -1489,6 +1546,7 @@ "flake-utils": "flake-utils_9", "home-manager": "home-manager_2", "nix-index-database": "nix-index-database", + "nix-minecraft": "nix-minecraft", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_12", "nixpkgs-stable": "nixpkgs-stable_2", @@ -1500,11 +1558,11 @@ "slippi": "slippi" }, "locked": { - "lastModified": 1768515258, - "narHash": "sha256-MBDxLHOIIminP+BPP74UQ3WBDnkbFguoW6MV6WXaepE=", + "lastModified": 1771898420, + "narHash": "sha256-8EhIWQZRL55RpAgydge71fk+frXroDdWX1Smt5E0MBI=", "owner": "p1n3appl3", "repo": "config", - "rev": "e6de5bc3c0a67c2a0ed51231df0cd9e0adcfac60", + "rev": "cf988820ffaaa44d0f8607f2417f9527d142b52c", "type": "github" }, "original": { @@ -1515,7 +1573,7 @@ }, "pipethon": { "inputs": { - "flake-utils": "flake-utils_10", + "flake-utils": "flake-utils_11", "nixpkgs": "nixpkgs_13" }, "locked": { @@ -1595,7 +1653,7 @@ "inputs": { "agenix": "agenix_2", "darwin": "darwin_2", - "flake-utils": "flake-utils_11", + "flake-utils": "flake-utils_12", "home-manager": "home-manager_3", "impermanence": "impermanence", "nix-index-database": "nix-index-database_2", @@ -1619,7 +1677,7 @@ }, "raw-data": { "inputs": { - "flake-utils": "flake-utils_12", + "flake-utils": "flake-utils_13", "nixpkgs": "nixpkgs_15" }, "locked": { @@ -1638,7 +1696,7 @@ }, "reviewqueue": { "inputs": { - "flake-utils": "flake-utils_13", + "flake-utils": "flake-utils_14", "naersk": "naersk_2", "nixpkgs": "nixpkgs_17", "nixpkgs-mozilla": "nixpkgs-mozilla_2" @@ -1732,11 +1790,11 @@ ] }, "locked": { - "lastModified": 1762915112, - "narHash": "sha256-d9j1g8nKmYDHy+/bIOPQTh9IwjRliqaTM0QLHMV92Ic=", + "lastModified": 1769482338, + "narHash": "sha256-SVwjMqR981PEdEdRvYj5Mefnd61GLinWmIr7GMu7LW8=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "aa1e85921cfa04de7b6914982a94621fbec5cc02", + "rev": "dc9c76a75a6d382613cdcb1a3f95640e9cedcdea", "type": "github" }, "original": { @@ -1817,7 +1875,7 @@ }, "secrets": { "inputs": { - "flake-utils": "flake-utils_14", + "flake-utils": "flake-utils_15", "nixpkgs": "nixpkgs_18" }, "locked": { @@ -1849,11 +1907,11 @@ ] }, "locked": { - "lastModified": 1760294822, - "narHash": "sha256-VSzDcCkS/kGrALPv81x5yjqjt5o7n4lVjE/gknlz+1w=", + "lastModified": 1768682904, + "narHash": "sha256-d4VEGrKHx9EisLHdGDN15w1PsuS5ZImvewwucTM3rUo=", "owner": "lytedev", "repo": "slippi-nix", - "rev": "abee78f6ad931c2a2f18dae102f51abcaf1a26c6", + "rev": "1f309afd4be00afedf34add3645ba2c1b97bdb40", "type": "github" }, "original": { @@ -1867,11 +1925,11 @@ "nixpkgs": "nixpkgs_19" }, "locked": { - "lastModified": 1768709255, - "narHash": "sha256-aigyBfxI20FRtqajVMYXHtj5gHXENY2gLAXEhfJ8/WM=", + "lastModified": 1771889317, + "narHash": "sha256-YV17Q5lEU0S9ppw08Y+cs4eEQJBuc79AzblFoHORLMU=", "owner": "Mic92", "repo": "sops-nix", - "rev": "5e8fae80726b66e9fec023d21cd3b3e638597aa9", + "rev": "b027513c32e5b39b59f64626b87fbe168ae02094", "type": "github" }, "original": { @@ -2046,6 +2104,21 @@ "type": "github" } }, + "systems_19": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -2168,7 +2241,7 @@ }, "t": { "inputs": { - "flake-utils": "flake-utils_15", + "flake-utils": "flake-utils_16", "nixpkgs": "nixpkgs_20" }, "locked": { @@ -2205,7 +2278,7 @@ }, "utils": { "inputs": { - "systems": "systems_11" + "systems": "systems_12" }, "locked": { "lastModified": 1731533236, @@ -2256,11 +2329,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1768765571, - "narHash": "sha256-C1JbyJ3ftogmN3vmLNfyPtnJw2wY64TiUTIhFtk1Leg=", + "lastModified": 1771787042, + "narHash": "sha256-7bM6Y4KldhKnfopSALF8XALxcX7ehkomXH9sPl4MXp0=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "ed1cef792b4def3321ff9ab5479df09609f17a69", + "rev": "33c344fee50504089a447a8fef5878cf4f6215fc", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0d7fbe1..025fd47 100644 --- a/flake.nix +++ b/flake.nix @@ -57,7 +57,7 @@ inputs.niri-unstable.follows = "niri-unstable"; }; matugen = { - url = "github:/InioX/matugen/main"; + url = "github:/InioX/matugen/v4.0.0"; inputs.nixpkgs.follows = "nixpkgs"; }; noctalia = { diff --git a/hosts/fili/services/immich.nix b/hosts/fili/services/immich.nix index 00553d1..304feb7 100644 --- a/hosts/fili/services/immich.nix +++ b/hosts/fili/services/immich.nix @@ -68,10 +68,21 @@ settings = { server.externalDomain = "https://photos.donsz.nl"; - logging.level = "verbose"; + logging.level = "log"; passwordLogin.enabled = false; + storageTemplate = { + enabled = true; + # year / album name or "Other" / y m d / filename + template = "{{y}}/{{#if album}}{{album}}{{else}}Other{{/if}}/{{y}}-{{MM}}-{{dd}}/{{filename}}"; + hashVerificationEnabled = true; + }; + + reverseGeocoding = { + enabled = true; + }; + oauth = { enabled = true; @@ -84,10 +95,7 @@ roleClaim = "immich_role"; scope = "openid email profile groups"; tokenEndpointAuthMethod = "client_secret_post"; - # storageLabelClaim: "", - # "mobileOverrideEnabled": false, - # "mobileRedirectUri": "", - + storageLabelClaim = "preferred_username"; }; }; mediaLocation = "/storage/storage/media-server/photos"; diff --git a/hosts/kili/configuration.nix b/hosts/kili/configuration.nix index 07b9cdc..89ec9e7 100644 --- a/hosts/kili/configuration.nix +++ b/hosts/kili/configuration.nix @@ -61,6 +61,7 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ + gcc firefox kitty @@ -87,6 +88,9 @@ ''; } ) { }) + + config.boot.kernelPackages.perf + rr ]; services.xserver.enable = true; diff --git a/programs/default.nix b/programs/default.nix index 9d21ca5..f7b039d 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -21,7 +21,7 @@ _: { spotify obsidian element-desktop - chromium + # chromium bind.dnsutils mpv vlc diff --git a/programs/niri/default.nix b/programs/niri/default.nix index b99944f..e3c2b5a 100644 --- a/programs/niri/default.nix +++ b/programs/niri/default.nix @@ -45,6 +45,7 @@ _: { playerctl # brightness control brightnessctl + pavucontrol fira jetbrains-mono @@ -112,6 +113,13 @@ _: { click-method = "clickfinger"; natural-scroll = false; }; + + focus-follows-mouse = { + enable = true; + max-scroll-amount = "0%"; + }; + + workspace-auto-back-and-forth = true; }; debug = { @@ -123,10 +131,10 @@ _: { size = 10; }; - gestures.hot-corners.enable = false; + gestures.hot-corners.enable = true; layout = { - gaps = 5; + gaps = 8; center-focused-column = "never"; always-center-single-column = true; @@ -152,29 +160,29 @@ _: { focus-ring = { width = 1; - active.color = "#${config.programs.matugen.theme.colors.primary.default}"; - inactive.color = "#${config.programs.matugen.theme.colors.surface.default}"; - urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; + active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; + inactive.color = "${config.programs.matugen.theme.colors.surface.default.color}"; + urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; }; border = { - active.color = "#${config.programs.matugen.theme.colors.primary.default}"; - inactive.color = "#${config.programs.matugen.theme.colors.surface.default}"; - urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; + active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; + inactive.color = "${config.programs.matugen.theme.colors.surface.default.color}"; + urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; }; shadow = { - color = "#${config.programs.matugen.theme.colors.shadow.default}70"; + color = "${config.programs.matugen.theme.colors.shadow.default.color}70"; }; tab-indicator = { - active.color = "#${config.programs.matugen.theme.colors.primary.default}"; - inactive.color = "#${config.programs.matugen.theme.colors.primary_container.default}"; - urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; + active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; + inactive.color = "${config.programs.matugen.theme.colors.primary_container.default.color}"; + urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; }; insert-hint = { - display.color = "#${config.programs.matugen.theme.colors.primary.default}80"; + display.color = "${config.programs.matugen.theme.colors.primary.default.color}80"; }; }; @@ -194,11 +202,26 @@ _: { window-rules = [ { - matches = [ { title = "Extension: (Bitwarden Password Manager).*"; } ]; + matches = [ + { + + app-id = "firefox$"; + title = "Extension: (Bitwarden Password Manager)"; + } + ]; open-floating = true; open-focused = true; block-out-from = "screen-capture"; } + { + matches = [ + { + app-id = "firefox$"; + title = "^Picture-in-Picture$"; + } + ]; + open-floating = true; + } { matches = [ { app-id = "firefox"; } ]; @@ -215,6 +238,7 @@ _: { app-id = "steam"; title = "Steam Settings"; } + { app-id = "pavucontrol"; } ]; open-floating = true; } @@ -289,11 +313,11 @@ _: { "XF86AudioRaiseVolume" = { allow-when-locked = true; - action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; + action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; }; "XF86AudioLowerVolume" = { allow-when-locked = true; - action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; + action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; }; "XF86AudioMute" = { allow-when-locked = true; @@ -321,15 +345,15 @@ _: { }; "Mod+Period" = { allow-when-locked = true; - action.spawn-sh = "playerctl previous"; + action.spawn-sh = "playerctl nest"; }; "Mod+Comma" = { allow-when-locked = true; - action.spawn-sh = "playerctl next"; + action.spawn-sh = "playerctl previous"; }; "Mod+Slash" = { allow-when-locked = true; - action.spawn-sh = "playerctl next"; + action.spawn-sh = "playerctl play-pause"; }; # TODO @@ -532,9 +556,6 @@ _: { { id = "plugin:catwalk"; } - { - id = "plugin:brightness"; - } ]; center = [ { @@ -554,6 +575,12 @@ _: { { id = "Bluetooth"; } + { + id = "Brightness"; + } + { + id = "Volume"; + } ] ++ [ { id = "Battery"; } ] ++ [ @@ -613,7 +640,7 @@ _: { # appearance "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; - enable-hot-corners = false; + enable-hot-corners = true; gtk-enable-primary-paste = false; }; }; diff --git a/programs/zed/default.nix b/programs/zed/default.nix index 051c56d..f028d5a 100644 --- a/programs/zed/default.nix +++ b/programs/zed/default.nix @@ -125,6 +125,9 @@ _: { refreshSupport = true; }; }; + binary = { + path_lookup = true; + }; }; nil = { binary = { diff --git a/users/default.nix b/users/default.nix index e22a5f8..8b87d45 100644 --- a/users/default.nix +++ b/users/default.nix @@ -19,6 +19,16 @@ ]; }; + mara = { + shell = pkgs.zsh; + keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAzf3UCwTWJlF878EWqlrLUOBsxw/b/6PoLjbKkA8Xh" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIHi5YnRt1VgK8tt6oSPsKo1X+0gcBXVyvCKXM03/vEh" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFWF1MtDV5HJT+GhD8wrKICyDwQK8ZPQTxZdnsfaqWcs" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIHi1EEGRry1aD6uPmdlcRqdiTiIty0JlnfoXeM0qKBC" + ]; + }; + jana = { shell = pkgs.fish; keys = [ From 1d06352181e90a6b20a7ebd59e61916bf4af3e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Tue, 3 Mar 2026 11:10:24 +0100 Subject: [PATCH 2/9] kanata --- programs/kanata/default.nix | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/programs/kanata/default.nix b/programs/kanata/default.nix index 7e6a3b4..984d120 100644 --- a/programs/kanata/default.nix +++ b/programs/kanata/default.nix @@ -26,25 +26,29 @@ let (deflayer control @esc - grv 1 2 3 4 5 6 7 8 9 0 - = bspc - tab q w e @replay t y u i o p @wup @wdown \ - @cap a s d f g left down up right ; ' bspc + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab @mcleft @mup @mcright @replay t y u i o p @wup @wdown \ + @cap @mleft @mdown @mright f g left down up right ; ' bspc lsft z x C-c v bspc n @macro , . C-f rsft lctl lmet lalt spc ralt @rctl ) - (deflayermap (programming) - f (macro f n spc) - w (macro w h e r e spc) - l (macro l o o p { ret) - u (macro u s e spc) - i (macro i m p o r t spc) - s (macro s e l f spc) + (deflayermap (other) + w @mup + a @mleft + s @mdown + d @mright + + q @mcleft + e @mcright + + [ @wup + ] @wdown ) (defalias ;; hold esc - esc (tap-hold 800 800 esc caps) + esc (tap-hold 200 200 C-k (macro C-f esc)) ;; control cap (tap-hold-release 200 200 @@ -58,6 +62,14 @@ let lmet ) + mup (movemouse-up 1 1) + mleft (movemouse-left 1 1) + mdown (movemouse-down 1 1) + mright (movemouse-right 1 1) + + mcleft mlft + mcright mrgt + macro (dynamic-macro-record 0) replay (dynamic-macro-play 0) @@ -68,7 +80,7 @@ let rctl ( tap-hold-release 200 200 - C-k (layer-while-held programming) + C-k (layer-while-held other) ) ) ''; From 05928785b01777f7af9b6e7a48d7aa15410fffda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Tue, 3 Mar 2026 11:10:24 +0100 Subject: [PATCH 3/9] switch to deploy --- flake.lock | 292 +++++++++++++++++++++----------- flake.nix | 86 ++++++++-- hosts/fili/services/metrics.nix | 2 +- modules/users.nix | 29 ++-- 4 files changed, 274 insertions(+), 135 deletions(-) diff --git a/flake.lock b/flake.lock index 80d814f..61363b6 100644 --- a/flake.lock +++ b/flake.lock @@ -12,7 +12,7 @@ "ragenix", "nixpkgs" ], - "systems": "systems_13" + "systems": "systems_14" }, "locked": { "lastModified": 1761656077, @@ -207,10 +207,30 @@ "type": "github" } }, + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": "nixpkgs_3", + "utils": "utils" + }, + "locked": { + "lastModified": 1770019181, + "narHash": "sha256-hwsYgDnby50JNVpTRYlF3UR/Rrpt01OrxVuryF40CFY=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "77c906c0ba56aabdbc72041bf9111b565cdd6171", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, "dumpasm": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1732916787, @@ -327,6 +347,22 @@ } }, "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1747046372, @@ -380,7 +416,7 @@ }, "flake-utils_10": { "inputs": { - "systems": "systems_11" + "systems": "systems_12" }, "locked": { "lastModified": 1731533236, @@ -398,7 +434,7 @@ }, "flake-utils_11": { "inputs": { - "systems": "systems_14" + "systems": "systems_15" }, "locked": { "lastModified": 1731533236, @@ -416,7 +452,7 @@ }, "flake-utils_12": { "inputs": { - "systems": "systems_15" + "systems": "systems_16" }, "locked": { "lastModified": 1710146030, @@ -434,7 +470,7 @@ }, "flake-utils_13": { "inputs": { - "systems": "systems_16" + "systems": "systems_17" }, "locked": { "lastModified": 1731533236, @@ -452,7 +488,7 @@ }, "flake-utils_14": { "inputs": { - "systems": "systems_17" + "systems": "systems_18" }, "locked": { "lastModified": 1731533236, @@ -470,7 +506,7 @@ }, "flake-utils_15": { "inputs": { - "systems": "systems_18" + "systems": "systems_19" }, "locked": { "lastModified": 1731533236, @@ -488,7 +524,7 @@ }, "flake-utils_16": { "inputs": { - "systems": "systems_19" + "systems": "systems_20" }, "locked": { "lastModified": 1710146030, @@ -524,7 +560,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1731533236, @@ -542,7 +578,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1731533236, @@ -560,7 +596,7 @@ }, "flake-utils_5": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1710146030, @@ -578,7 +614,7 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1731533236, @@ -596,7 +632,7 @@ }, "flake-utils_7": { "inputs": { - "systems": "systems_6" + "systems": "systems_7" }, "locked": { "lastModified": 1710146030, @@ -614,7 +650,7 @@ }, "flake-utils_8": { "inputs": { - "systems": "systems_8" + "systems": "systems_9" }, "locked": { "lastModified": 1731533236, @@ -632,7 +668,7 @@ }, "flake-utils_9": { "inputs": { - "systems": "systems_10" + "systems": "systems_11" }, "locked": { "lastModified": 1731533236, @@ -650,7 +686,7 @@ }, "harmonica": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1738890519, @@ -732,14 +768,14 @@ "homepage": { "inputs": { "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1770464309, - "narHash": "sha256-GQh77HwhXATPkWCB10oDeb1q6qZ7KJrPqttNy9NTtLk=", + "lastModified": 1772058280, + "narHash": "sha256-8gZ6wh++43JAe6PH0hmm4Q8gPEScf0S7rkb0MmIxu2U=", "owner": "jdonszelmann", "repo": "homepage", - "rev": "72b2a7932aad8a896f52b788cece4379eefa6663", + "rev": "ead7bebdfa71b207d2513d7f002e164d0b17a264", "type": "github" }, "original": { @@ -805,7 +841,7 @@ "mapf": { "inputs": { "flake-utils": "flake-utils_7", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1757529600, @@ -826,7 +862,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_7" + "systems": "systems_8" }, "locked": { "lastModified": 1770927856, @@ -847,7 +883,7 @@ "inputs": { "flake-utils": "flake-utils_8", "naersk": "naersk", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "nixpkgs-mozilla": "nixpkgs-mozilla" }, "locked": { @@ -867,7 +903,7 @@ "naersk": { "inputs": { "fenix": "fenix", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1763384566, @@ -886,7 +922,7 @@ "naersk_2": { "inputs": { "fenix": "fenix_2", - "nixpkgs": "nixpkgs_16" + "nixpkgs": "nixpkgs_17" }, "locked": { "lastModified": 1752689277, @@ -908,7 +944,7 @@ "niri-unstable": [ "niri-unstable" ], - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_10", "nixpkgs-stable": "nixpkgs-stable", "xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-unstable": "xwayland-satellite-unstable" @@ -946,7 +982,7 @@ }, "niri-unstable": { "inputs": { - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_11", "rust-overlay": "rust-overlay_2" }, "locked": { @@ -1029,7 +1065,7 @@ }, "nix-minecraft": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-utils": "flake-utils_10", "nixpkgs": [ "p1n3appl3", @@ -1162,6 +1198,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1757967192, "narHash": "sha256-/aA9A/OBmnuOMgwfzdsXRusqzUpd8rQnQY8jtrHK+To=", @@ -1177,7 +1229,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1771932323, "narHash": "sha256-3PadsTzuMJT/x0KmiD/Me1GG6rW8kaHoWVduSs0ue7o=", @@ -1192,7 +1244,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_13": { "locked": { "lastModified": 1771369470, "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", @@ -1208,7 +1260,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_14": { "locked": { "lastModified": 1767379071, "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", @@ -1224,7 +1276,7 @@ "type": "github" } }, - "nixpkgs_14": { + "nixpkgs_15": { "locked": { "lastModified": 1722062969, "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", @@ -1240,7 +1292,7 @@ "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_16": { "locked": { "lastModified": 1768564909, "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", @@ -1256,7 +1308,7 @@ "type": "github" } }, - "nixpkgs_16": { + "nixpkgs_17": { "locked": { "lastModified": 1752077645, "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", @@ -1272,7 +1324,7 @@ "type": "github" } }, - "nixpkgs_17": { + "nixpkgs_18": { "locked": { "lastModified": 1755020227, "narHash": "sha256-gGmm+h0t6rY88RPTaIm3su95QvQIVjAJx558YUG4Id8=", @@ -1286,7 +1338,7 @@ "type": "indirect" } }, - "nixpkgs_18": { + "nixpkgs_19": { "locked": { "lastModified": 1771931193, "narHash": "sha256-IRPLf3y0HxdLirCVYoOYXQyoUBIM8llw7/96OHvyQoM=", @@ -1302,22 +1354,6 @@ "type": "github" } }, - "nixpkgs_19": { - "locked": { - "lastModified": 1771207753, - "narHash": "sha256-b9uG8yN50DRQ6A7JdZBfzq718ryYrlmGgqkRm9OOwCE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d1c15b7d5806069da59e819999d70e1cec0760bf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1759036355, @@ -1335,6 +1371,22 @@ } }, "nixpkgs_20": { + "locked": { + "lastModified": 1771207753, + "narHash": "sha256-b9uG8yN50DRQ6A7JdZBfzq718ryYrlmGgqkRm9OOwCE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d1c15b7d5806069da59e819999d70e1cec0760bf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_21": { "locked": { "lastModified": 1710377395, "narHash": "sha256-KMubsUWtVr7L55pXMBibBDBdmk3xrjbBPduc0E8z28c=", @@ -1348,7 +1400,7 @@ "type": "indirect" } }, - "nixpkgs_21": { + "nixpkgs_22": { "locked": { "lastModified": 1732014248, "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", @@ -1365,6 +1417,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1743014863, + "narHash": "sha256-jAIUqsiN2r3hCuHji80U7NNEafpIMBXiwKlSrjWMlpg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bd3bac8bfb542dbde7ffffb6987a1a1f9d41699f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1732521221, "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", @@ -1380,7 +1448,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1738680400, "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", @@ -1396,7 +1464,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1716137900, "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", @@ -1412,7 +1480,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1721379653, "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", @@ -1428,7 +1496,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1752077645, "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", @@ -1444,7 +1512,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1766070988, "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", @@ -1460,29 +1528,13 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1771848320, - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixvim": { "inputs": { "flake-parts": "flake-parts", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_9" + "systems": "systems_10" }, "locked": { "lastModified": 1771135771, @@ -1524,7 +1576,7 @@ "p1n3appl3", "nixpkgs" ], - "utils": "utils" + "utils": "utils_2" }, "locked": { "lastModified": 1760151712, @@ -1548,7 +1600,7 @@ "nix-index-database": "nix-index-database", "nix-minecraft": "nix-minecraft", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_12", + "nixpkgs": "nixpkgs_13", "nixpkgs-stable": "nixpkgs-stable_2", "obs-gamepad": "obs-gamepad", "ragenix": "ragenix", @@ -1574,7 +1626,7 @@ "pipethon": { "inputs": { "flake-utils": "flake-utils_11", - "nixpkgs": "nixpkgs_13" + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1767634075, @@ -1658,7 +1710,7 @@ "impermanence": "impermanence", "nix-index-database": "nix-index-database_2", "nixos-hardware": "nixos-hardware_2", - "nixpkgs": "nixpkgs_14", + "nixpkgs": "nixpkgs_15", "ragenix": "ragenix_2" }, "locked": { @@ -1678,7 +1730,7 @@ "raw-data": { "inputs": { "flake-utils": "flake-utils_13", - "nixpkgs": "nixpkgs_15" + "nixpkgs": "nixpkgs_16" }, "locked": { "lastModified": 1768919451, @@ -1698,7 +1750,7 @@ "inputs": { "flake-utils": "flake-utils_14", "naersk": "naersk_2", - "nixpkgs": "nixpkgs_17", + "nixpkgs": "nixpkgs_18", "nixpkgs-mozilla": "nixpkgs-mozilla_2" }, "locked": { @@ -1719,6 +1771,7 @@ "inputs": { "colmena": "colmena", "compiler-construction-2021": "compiler-construction-2021", + "deploy-rs": "deploy-rs", "dumpasm": "dumpasm", "firefox-addons": "firefox-addons", "firefox-sidebar-css": "firefox-sidebar-css", @@ -1733,7 +1786,7 @@ "mifg": "mifg", "niri": "niri", "niri-unstable": "niri-unstable", - "nixpkgs": "nixpkgs_11", + "nixpkgs": "nixpkgs_12", "nixvim": "nixvim", "noctalia": "noctalia", "p1n3appl3": "p1n3appl3", @@ -1876,7 +1929,7 @@ "secrets": { "inputs": { "flake-utils": "flake-utils_15", - "nixpkgs": "nixpkgs_18" + "nixpkgs": "nixpkgs_19" }, "locked": { "lastModified": 1769256063, @@ -1922,7 +1975,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_19" + "nixpkgs": "nixpkgs_20" }, "locked": { "lastModified": 1771889317, @@ -2134,6 +2187,21 @@ "type": "github" } }, + "systems_20": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_3": { "locked": { "lastModified": 1681028828, @@ -2195,21 +2263,6 @@ } }, "systems_7": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_8": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -2224,6 +2277,21 @@ "type": "github" } }, + "systems_8": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "systems_9": { "locked": { "lastModified": 1681028828, @@ -2242,7 +2310,7 @@ "t": { "inputs": { "flake-utils": "flake-utils_16", - "nixpkgs": "nixpkgs_20" + "nixpkgs": "nixpkgs_21" }, "locked": { "lastModified": 1710410762, @@ -2260,7 +2328,7 @@ }, "totpal": { "inputs": { - "nixpkgs": "nixpkgs_21" + "nixpkgs": "nixpkgs_22" }, "locked": { "lastModified": 1737322813, @@ -2278,7 +2346,25 @@ }, "utils": { "inputs": { - "systems": "systems_12" + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { + "inputs": { + "systems": "systems_13" }, "locked": { "lastModified": 1731533236, diff --git a/flake.nix b/flake.nix index 025fd47..268c210 100644 --- a/flake.nix +++ b/flake.nix @@ -2,21 +2,17 @@ description = "jana's server infrastructure"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs"; - colmena.url = "github:zhaofengli/colmena"; flake-utils.url = "github:numtide/flake-utils"; - sops-nix.url = "github:Mic92/sops-nix"; - vpn-confinement.url = "github:Maroka-chan/VPN-Confinement"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - firefox-addons = { - url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + + # deployment + colmena.url = "github:zhaofengli/colmena"; + deploy-rs.url = "github:serokell/deploy-rs"; # websites - homepage.url = "github:jdonszelmann/homepage"; totpal.url = "github:jdonszelmann/totpal"; harmonica.url = "git+ssh://git@github.com/jdonszelmann/harmonica-tabs"; @@ -25,32 +21,32 @@ compiler-construction-2021.url = "git+ssh://forgejo@git.donsz.nl/jana/eelco-visser-compiler-construction.git"; mifg.url = "git+ssh://forgejo@git.donsz.nl/jana/money.is.fckn.gay.git"; + # server + raw-data.url = "git+ssh://forgejo@git.donsz.nl/jana/raw-data.git"; secrets.url = "git+ssh://forgejo@git.donsz.nl/jana/server-secrets.git"; + sops-nix.url = "github:Mic92/sops-nix"; + vpn-confinement.url = "github:Maroka-chan/VPN-Confinement"; + # home nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; - t.url = "github:jdonszelmann/t-rs"; dumpasm.url = "github:jdonszelmann/dumpasm"; - kitty-search = { url = "github:trygveaa/kitty-kitten-search"; flake = false; }; - jujutsu = { url = "github:martinvonz/jj"; inputs.nixpkgs.follows = "nixpkgs"; }; - p1n3appl3 = { url = "github:p1n3appl3/config"; inputs.rahul-config.follows = "rahul-config"; }; rahul-config.url = "github:jdonszelmann/nix-config"; - niri-unstable.url = "github:YaLTeR/niri"; niri = { url = "github:sodiboo/niri-flake"; @@ -65,11 +61,15 @@ inputs.nixpkgs.follows = "nixpkgs"; }; pipethon.url = "git+ssh://forgejo@git.donsz.nl/jana/pipethon.git"; + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; firefox-sidebar-css = { url = "github:drannex/FirefoxSidebar"; flake = false; }; - raw-data.url = "git+ssh://forgejo@git.donsz.nl/jana/raw-data.git"; + }; outputs = { @@ -80,6 +80,7 @@ sops-nix, vpn-confinement, home-manager, + deploy-rs, ... }@inputs: let @@ -95,8 +96,62 @@ }) ]; }; + + specialArgsForSystem = system: { + pkgs = pkgsForSystem system; + flakes = inputs; + inherit inputs; + inherit (inputs.secrets.packages.${system}) secrets; + }; in { + nixosConfigurations.fili = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [ + inputs.home-manager.nixosModules.default + { home-manager.extraSpecialArgs = specialArgs; } + + ./hosts/fili/configuration.nix + ./users + ./default-machine-config.nix + + sops-nix.nixosModules.sops + vpn-confinement.nixosModules.default + ]; + specialArgs = specialArgsForSystem system; + }; + nixosConfigurations.kili = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [ + inputs.home-manager.nixosModules.default + { home-manager.extraSpecialArgs = specialArgs; } + + ./hosts/kili/configuration.nix + ./users + ]; + specialArgs = specialArgsForSystem system; + }; + + deploy.nodes.fili = { + hostname = "fili"; + fastConnection = true; + profiles.system = { + user = "root"; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.fili; + sshUser = "jana"; + }; + }; + + deploy.nodes.kili = { + hostname = "localhost"; + fastConnection = true; + profiles.system = { + user = "root"; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.kili; + sshUser = "jana"; + }; + }; + colmenaHive = colmena.lib.makeHive self.outputs.colmena; colmena = { @@ -166,10 +221,11 @@ (pkgs.writeShellScriptBin "apply-local" '' colmena apply-local --sudo '') + deploy-rs.packages.${system}.deploy-rs ]; shellHook = "exec $NIX_BUILD_SHELL"; }; - packages = custom pkgs; + custom-packages = custom pkgs; formatter = pkgs.nixfmt; } ); diff --git a/hosts/fili/services/metrics.nix b/hosts/fili/services/metrics.nix index 48841ec..1626cc7 100644 --- a/hosts/fili/services/metrics.nix +++ b/hosts/fili/services/metrics.nix @@ -259,7 +259,7 @@ in }; }; services.grafana = { - enable = true; + enable = false; settings = { server = { diff --git a/modules/users.nix b/modules/users.nix index 00d80c7..6dcb25a 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -86,23 +86,20 @@ in }) users; home-manager.users = lib.mapAttrs ( name: value: - ( - { pkgs, lib, ... }: - { - imports = ( - [ - ./home-info.nix - ] - ++ (map (program: program.home-config) valid-programs) - ); + (_: { + imports = ( + [ + ./home-info.nix + ] + ++ (map (program: program.home-config) valid-programs) + ); - home = { - inherit stateVersion; - username = name; - homeDirectory = "/home/${name}"; - }; - } - ) + home = { + inherit stateVersion; + username = name; + homeDirectory = "/home/${name}"; + }; + }) ) home-users; } ]); From 397fb19e0be76ee62b58b5692eff33e2c7d49641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Fri, 23 Jan 2026 13:27:58 +0100 Subject: [PATCH 4/9] niri --- hosts/kili/configuration.nix | 7 +++++++ no current target | 2 +- programs/default.nix | 1 + programs/fish/default.nix | 10 ++++++++++ programs/jj/default.nix | 4 ++-- programs/niri/default.nix | 15 +++++++++++++++ 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/hosts/kili/configuration.nix b/hosts/kili/configuration.nix index 89ec9e7..07db5ef 100644 --- a/hosts/kili/configuration.nix +++ b/hosts/kili/configuration.nix @@ -161,6 +161,13 @@ }; }; + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers + }; + # programs.mtr.enable = true; # programs.gnupg.agent = { # enable = true; diff --git a/no current target b/no current target index 5ce4b79..19fa523 100644 --- a/no current target +++ b/no current target @@ -1 +1 @@ -Ptmux;_Gq=2,a=d,d=a\\ \ No newline at end of file +Ptmux;_Ga=d,d=a,q=2\\ \ No newline at end of file diff --git a/programs/default.nix b/programs/default.nix index f7b039d..5cab805 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -182,6 +182,7 @@ _: { comma unzip pciutils + difftastic # dev tools gdb diff --git a/programs/fish/default.nix b/programs/fish/default.nix index 217f897..1c489c1 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -175,6 +175,16 @@ _: { interactiveShellInit = '' fish_vi_key_bindings + bind \e\[3\;5~ kill-word + bind \cH backward-kill-word + bind \cV beginning-of-line + bind \f end-of-line + + bind -M insert \e\[3\;5~ kill-word + bind -M insert \cH backward-kill-word + bind -M insert \cV beginning-of-line + bind -M insert \f end-of-line + set -g sponge_successful_exit_codes 0 set -g sponge_allow_previously_successful false set -g sponge_delay 10 diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 476313f..91b624a 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -45,9 +45,9 @@ _: { fsmonitor.backend = "watchman"; fsmonitor.watchman.register-snapshot-trigger = true; - # revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"; + revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"; # revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)"; - revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)"; + # revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)"; revset-aliases = { "my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")"; diff --git a/programs/niri/default.nix b/programs/niri/default.nix index e3c2b5a..8afa33f 100644 --- a/programs/niri/default.nix +++ b/programs/niri/default.nix @@ -82,6 +82,21 @@ _: { # focus the external screen first focus-at-startup = true; }; + + outputs."LG Electronics LG ULTRAWIDE 409NTAB3P496" = { + mode = { + width = 3440; + height = 1440; + refresh = 59.987; + }; + position = { + x = -3440; + y = 240; + }; + + # focus the external screen first + focus-at-startup = true; + }; }; home.sessionVariables = { From 5f5daf1047dffa41ba0ef4c92405e0ee128fc18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Tue, 10 Mar 2026 20:47:24 +0100 Subject: [PATCH 5/9] vim again, and tmux too --- default-machine-config.nix | 2 + hosts/kili/configuration.nix | 4 + no current target | 1 - programs/default.nix | 39 ++------- programs/fish/default.nix | 2 + programs/kitty/default.nix | 6 +- programs/niri/default.nix | 2 +- programs/nvim/config.lua | 132 ++++------------------------- programs/nvim/default.nix | 55 +++++++++++- programs/nvim/editor-hax.py | 119 ++++++++++++++++++++++++++ programs/nvim/keys.nix | 48 ++++------- programs/nvim/options.nix | 4 + programs/nvim/plugins.nix | 44 ++++------ programs/tmux/default.nix | 68 +++++++++++---- programs/xdg.nix | 156 +++++++++++++++++++++++++++++++++++ 15 files changed, 451 insertions(+), 231 deletions(-) delete mode 100644 no current target create mode 100755 programs/nvim/editor-hax.py create mode 100644 programs/xdg.nix diff --git a/default-machine-config.nix b/default-machine-config.nix index 3f05995..913d7f1 100644 --- a/default-machine-config.nix +++ b/default-machine-config.nix @@ -12,6 +12,8 @@ (inputs.self + /programs) ]; + xdg.mime.enable = lib.mkForce false; + system.stateVersion = "26.05"; services.resolved.enable = false; diff --git a/hosts/kili/configuration.nix b/hosts/kili/configuration.nix index 07db5ef..cd5b820 100644 --- a/hosts/kili/configuration.nix +++ b/hosts/kili/configuration.nix @@ -52,6 +52,7 @@ extraGroups = [ "networkmanager" "wheel" + "docker" ]; packages = with pkgs; [ ]; }; @@ -62,6 +63,7 @@ # $ nix search wget environment.systemPackages = with pkgs; [ gcc + docker firefox kitty @@ -93,6 +95,8 @@ rr ]; + virtualisation.docker.enable = true; + services.xserver.enable = true; services.displayManager.gdm.enable = true; services.desktopManager.gnome.enable = true; diff --git a/no current target b/no current target deleted file mode 100644 index 19fa523..0000000 --- a/no current target +++ /dev/null @@ -1 +0,0 @@ -Ptmux;_Ga=d,d=a,q=2\\ \ No newline at end of file diff --git a/programs/default.nix b/programs/default.nix index 5cab805..2d14e5e 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -1,4 +1,5 @@ -_: { +{ ... }@inputs: +{ imports = [ ./nvim ./fish @@ -10,6 +11,7 @@ _: { ./niri ./zed ./firefox + ./xdg.nix ]; custom.program.graphcial-packages = { @@ -25,6 +27,9 @@ _: { bind.dnsutils mpv vlc + libreoffice-qt + hunspell + hunspellDicts.en_US ]; }; }; @@ -223,36 +228,4 @@ _: { }; }; - custom.program.homedirs = { - home-config = - { config, ... }: - { - home.file = { - "dl".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.download}"; - "doc".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.documents}"; - }; - }; - }; - - custom.program.xdg = { - home-config = - { config, ... }: - { - xdg = { - enable = true; - - configHome = "${config.home.homeDirectory}/.config"; - userDirs = { - enable = true; - documents = "${config.home.homeDirectory}/Documents"; - desktop = "${config.home.homeDirectory}/Documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/Documents/personal/music"; - pictures = "${config.home.homeDirectory}/Documents/personal/pictures"; - }; - - mime.enable = true; - }; - }; - }; } diff --git a/programs/fish/default.nix b/programs/fish/default.nix index 1c489c1..ece1740 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -185,6 +185,8 @@ _: { bind -M insert \cV beginning-of-line bind -M insert \f end-of-line + bind \cl 'clear; commandline -f repaint' + set -g sponge_successful_exit_codes 0 set -g sponge_allow_previously_successful false set -g sponge_delay 10 diff --git a/programs/kitty/default.nix b/programs/kitty/default.nix index 4cff031..05b44c7 100644 --- a/programs/kitty/default.nix +++ b/programs/kitty/default.nix @@ -9,7 +9,7 @@ _: { enable = true; font = { name = "Maple Mono NF"; - size = 13.0; + size = 11.0; package = pkgs.jetbrains-mono; }; @@ -49,6 +49,10 @@ _: { "ctrl+0" = "change_font_size all 0"; # "ctrl+/" = "send_text all "; "super+~" = "no_op"; + + # required for vim!! + # terminals map ctrl+i to tab. I want them to do different things in vim. + "ctrl+i" = "send_text all \\x01"; }; extraConfig = '' diff --git a/programs/niri/default.nix b/programs/niri/default.nix index 8afa33f..04ae0f6 100644 --- a/programs/niri/default.nix +++ b/programs/niri/default.nix @@ -309,7 +309,7 @@ _: { action.spawn = noctalia "sessionMenu toggle"; }; - "Mod+O" = { + "Mod+P" = { hotkey-overlay.title = "Run an Application"; action.spawn = noctalia "launcher toggle"; }; diff --git a/programs/nvim/config.lua b/programs/nvim/config.lua index 0507bae..fa9219b 100644 --- a/programs/nvim/config.lua +++ b/programs/nvim/config.lua @@ -19,134 +19,32 @@ local esc = vim.api.nvim_replace_termcodes( ) local api = require('Comment.api') -vim.keymap.set("n", "", ":lua require('Comment.api').toggle.linewise.current() j", { remap = true }) +vim.keymap.set("n", "", ":lua require('Comment.api').toggle.linewise.current()j", { remap = true }) vim.keymap.set("i", "", ":lua require('Comment.api').toggle.linewise.current()", { remap = true }) vim.keymap.set("x", "", function() vim.api.nvim_feedkeys(esc, 'nx', false) api.toggle.linewise(vim.fn.visualmode()) end, { remap = true }) -vim.keymap.set('n', 'gr', (function() builtin.lsp_references({jump_type="vsplit"}) end), {}) -vim.keymap.set('n', 'gd', (function() builtin.lsp_definitions({jump_type="vsplit"}) end), {}) -vim.keymap.set('n', 'gt', (function() builtin.lsp_type_definitions({jump_type="vsplit"}) end), {}) -local barbar_state = require("barbar.state") -function find_windows_with_buffer(bufnum) - windows = {} - local window_list = vim.api.nvim_list_wins() +-- vim.keymap.set('n', 'gr', (function() builtin.lsp_references({jump_type="vsplit"}) end), {}) +-- vim.keymap.set('n', 'gd', (function() builtin.lsp_definitions({jump_type="vsplit"}) end), {}) +-- vim.keymap.set('n', 'gt', (function() builtin.lsp_type_definitions({jump_type="vsplit"}) end), {}) +-- vim.keymap.set('n', 'gt', (function() builtin.lsp_type_definitions({jump_type="vsplit"}) end), {}) - for _, window in ipairs(window_list) do - local win_info = vim.fn.getwininfo(window) - if win_info ~= nil then - for _, buf in ipairs(win_info) do - if buf.bufnr == bufnum then - table.insert(windows, window) - end - end - end - end - return windows -end - -function num_useful_windows() - local window_list = vim.api.nvim_tabpage_list_wins(0) - local num = 0 - - for _, window in ipairs(window_list) do - local win_info = vim.fn.getwininfo(window) - - if win_info ~= nil then - for _, win_info in ipairs(win_info) do - if buf_is_useful(win_info.bufnr) then - num = num + 1 - end - end - end - end - - return num -end - -function buf_is_useful(bufnr) - local bufname = vim.api.nvim_buf_get_name(bufnr) - - -- if the window's buffer has no name, it's not useful - if bufname == '' then - return false - end - - -- print("bufname: ", bufname) - - -- if the window's buffer is read only, it's not useful - local readonly = vim.api.nvim_buf_get_option(bufnr, 'readonly') - if readonly then - -- print("=readonly") - return false - end - - -- -- if the buffer is not listed, it's not useful - local listed = vim.api.nvim_buf_get_option(bufnr, 'buflisted') - if not listed then - -- print("=unlisted") - return false - end - - local buftype = vim.api.nvim_buf_get_option(bufnr, 'buftype') - if buftype == "quickfix" then - -- print("=readonly") - return false - end - - local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) - if #lines > 1 or (#lines == 1 and #lines[1] > 0) then - return true -- If the buffer has content, return false - else - return false - end - - -- the window contains a useful buffer - return true -end - -function quit_window(window) - vim.api.nvim_win_call(window, function() - vim.cmd "quit" - end) -end - -vim.api.nvim_create_user_command('CloseBuffer', function (opts) - if num_useful_windows() > 1 then - vim.cmd { - cmd = "quit", - bang = opts.bang, - } - else - vim.cmd { - cmd = "BufferDelete", - bang = opts.bang, - } - if not buf_is_useful(vim.api.nvim_get_current_buf()) then - vim.cmd { - cmd = "quit", - bang = opts.bang, - } - end - end -end, { desc = "Close Current Buffer", bang = true, }) - -local function close_floating() - for _, win in ipairs(vim.api.nvim_list_wins()) do - local config = vim.api.nvim_win_get_config(win) - if config.relative ~= "" then - vim.api.nvim_win_close(win, false) - end - end -end - -vim.keymap.set("n", "", close_floating, { desc = "Close floats, clear highlights" }) +-- local function close_floating() +-- for _, win in ipairs(vim.api.nvim_list_wins()) do +-- local config = vim.api.nvim_win_get_config(win) +-- if config.relative ~= "" then +-- vim.api.nvim_win_close(win, false) +-- end +-- end +-- end +-- +-- vim.keymap.set("n", "", close_floating, { desc = "Close floats, clear highlights" }) local builtin = require('telescope.builtin') diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index e733593..b2bfdbf 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -1,15 +1,64 @@ _: { custom.program.nvim.requirements = [ "cli" ]; custom.program.nvim.home-config = - { pkgs, flakes, ... }: { - + pkgs, + flakes, + lib, + ... + }: + let + nvim_mime_types = [ + "application/x-zerosize" + "text/english" + "text/plain" + "text/x-makefile" + "text/x-c++hdr" + "text/x-c++src" + "text/x-chdr" + "text/x-csrc" + "text/x-java" + "text/x-moc" + "text/x-pascal" + "text/x-tcl" + "text/x-tex" + "application/x-shellscript" + "text/x-c" + "text/x-c++" + ]; + desktop-entry-name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanvim"; + desktop-entry = pkgs.makeDesktopItem { + name = desktop-entry-name; + desktopName = "neovim"; + exec = "${./editor-hax.py} %F"; + tryExec = "${./editor-hax.py}"; + terminal = false; + type = "Application"; + categories = [ + "Utility" + "TextEditor" + ]; + icon = "terminal"; + mimeTypes = nvim_mime_types; + }; + in + { home = { sessionVariables = { EDITOR = "nvim"; }; }; + home.file.".local/share/applications/${desktop-entry-name}.desktop" = { + source = "${desktop-entry}/share/applications/${desktop-entry-name}.desktop"; + }; + + xdg.mimeApps.associations.added = lib.mergeAttrsList ( + map (mime: { + ${mime} = [ "${desktop-entry-name}.desktop" ]; + }) nvim_mime_types + ); + imports = [ flakes.nixvim.homeModules.nixvim ./options.nix @@ -98,7 +147,9 @@ _: { # lspconfig.noteslsp.setup{} # '' + (builtins.readFile ./config.lua); + extraConfigLuaPost = '' + ''; }; }; } diff --git a/programs/nvim/editor-hax.py b/programs/nvim/editor-hax.py new file mode 100755 index 0000000..a35f59e --- /dev/null +++ b/programs/nvim/editor-hax.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python +import subprocess +import os +import sys +import re +from urllib.parse import urlsplit + +extract_line_regex = re.compile(r"(.*?)(?::([0-9]+))?(?::([0-9]+))?(:)?$") + +main_editor = "nvim" +editors = [main_editor, "vim", "vi"] +real_editor = os.environ.get("REAL_EDITOR", None) +editor_command = main_editor +if real_editor is not None: + editors.append(real_editor) + editor_command = real_editor + +def run(cmd, only_stdout=True): + res = subprocess.run(cmd, capture_output=True, text=True, shell=True) + if only_stdout: + return str(res.stdout) + else: + return res + +def find_pane(window): + for editor in editors: + pane = run(f"tmux list-panes -a -f '#{{&&:#{{==:#{{window_id}},{window}}},#{{==:#{{pane_current_command}},{editor}}}}}' -F '#{{pane_id}}'").strip(); + if pane != "": + return pane + +def create_pane(args): + run(f'tmux split-window -h -P -F "#{{pane_id}}" {editor_command} {args}') + +def find_or_create_pane(window, args): + if pane := find_pane(window): + # exit copy mode so we don't send these commands directly to tmux + run(f"tmux send-keys -t {pane} -X cancel") + # Escape for some reason doesn't get sent as the escape key if it shows up next to any other keys??? + run(f"tmux send-keys -t {pane} Escape") + + # note the space, this tells nvim not to save it in history + run(f"tmux send-keys -t {pane} \": drop {args}\" Enter") + run(f"tmux select-pane -t {pane} -Z") + else: + create_pane(args) + +def split_line(filename): + mtch = extract_line_regex.match(filename) + file = mtch.group(1) + line = mtch.group(2) + column = mtch.group(3) + + url = urlsplit(line) + if url.scheme == "file" and url.path != file: + file = url.path + + file = os.path.abspath(file) + + print(f"opening {file}:{line}:{column}") + return file, line, column + +def join_line(filename, maybe_line, maybe_column): + assert not (maybe_line is None and maybe_column is not None) + + if maybe_line is None: + return filename + + if maybe_column is None: + maybe_column = "0" + + return f"+normal!{maybe_line}G{maybe_column} {filename}" + +def trim(arg): + if arg.startswith("\"") and not arg.endswith("\""): + arg = arg.lstrip("\"") + if arg.endswith("\"") and not arg.startswith("\""): + arg = arg.rstrip("\"") + return arg.strip() + +def editor_hax(filename): + args = split_line(trim(filename)) + current_window = run("tmux display-message -p \"#{window_id}\"").strip(); + find_or_create_pane(current_window, join_line(*args)) + +def xdg_open(arg): + subprocess.run(f"xdg-open {trim(arg)}", shell=True) + +def xdg_open_proxy(*args): + for arg in args: + try: + _file, line, _column = split_line(arg) + if line is not None: + editor_hax(arg) + else: + xdg_open(arg) + except: + xdg_open(arg) + + +def usage(): + print(f"usage: {sys.argv[0]} filename:(line):(column)") + print(" Opens a file with line number and colum in the editor in another pane of the current tmux window") + print(f"usage: {sys.argv[0]} xdg-open-proxy filename:(line):(column)") + print(" Calls xdg-open on the given parameters. However, if any part contains a line number and or column, opens in nvim like editor-hax") + exit(1) + +if __name__ == "__main__": + if len(sys.argv) < 2: + usage() + elif sys.argv[1] == "xdg-open-proxy": + if len(sys.argv) < 3: + usage() + else: + xdg_open_proxy(*sys.argv[1:]) + elif len(sys.argv) > 2: + usage() + else: + editor_hax(sys.argv[1]) + diff --git a/programs/nvim/keys.nix b/programs/nvim/keys.nix index 0080355..679ecbd 100644 --- a/programs/nvim/keys.nix +++ b/programs/nvim/keys.nix @@ -17,39 +17,23 @@ in # splitting (map "n" "s" "vertical sb") - # closing - (map "n" "w" "BufferClose") # single buffer - (map "n" "cb" "BufferClose") # single buffer - - (map "n" "ct" "CloseBuffer") # buffer or extra tab - (map "n" "q" "CloseBuffer") # buffer or extra tab - - (map "n" "co" "silent! BufferCloseAllButVisible") # other buffers - (map "n" "cl" "silent! BufferCloseBuffersLeft") # other buffers (left) - (map "n" "cr" "silent! BufferCloseBuffersRight") # other buffers (right) - - # moving - (map "n" "mL" "BufferMovePrevious") # left - (map "n" "mr" "BufferMoveNext") # right - (map "n" "m0" "BufferMoveStart") # start - (map "n" "m$" "BufferMoveEnd") # end - - (map "n" "jb" "BufferPick") # jump to tab - # jumplist - # (map "n" "" "") - # (map "n" "" "") + (map "" "" "") # note: C-a is actually C-i, remapped through kitty. (luamap "n" "r" "${telescope}.jumplist()") + (luamap "n" "R" "${telescope}.loclist()") # pickers (luamap "n" "" "${telescope}.find_files()") (luamap "n" "f" "${telescope}.live_grep()") (luamap "n" "t" "${telescope}.lsp_document_symbols()") (luamap "n" "T" "${telescope}.lsp_dynamic_workspace_symbols()") + (luamap "n" "/" "${telescope}.current_buffer_fuzzy_find()") # last used pickers/searches - (luamap "n" "h" "${telescope}.pickers()") + (luamap "n" "p" "${telescope}.pickers()") + (luamap "n" "m" "${telescope}.search_history()") # open buffers (luamap "n" "b" "${telescope}.buffers({sort_mru = true})") + (luamap "n" "" "${telescope}.buffers({sort_mru = true})") # diagnostics (map "n" "d" "Trouble diagnostics toggle filter.buf=0") @@ -69,26 +53,25 @@ in # expand macro (map "n" "em" "RustLsp expandMacro") - # easier quitting etc - (map "ca" "W" "w") - (map "ca" "X" "x") - - (map "ca" "Q" "CloseBuffer") - (map "ca" "q" "CloseBuffer") - # navigation (map "" "" "") (map "" "" "") (map "" "" "") (map "" "" "") - (map "" "" "") + (map "" "h" "") + (map "" "l" "") + (map "" "k" "") + (map "" "j" "") + + # close buffer + (map "" "c" "bd") # { # key = "/"; # action = "lua require('spectre').open_file_search({select_word=true})"; # } - (map "n" "t" "Neotree toggle") + # (map "n" "t" "Neotree toggle") # tab for indent/dedent (map "n" "" ">>_") @@ -98,6 +81,9 @@ in (map "v" "" "" = "cmp.mapping.complete()"; "" = "cmp.mapping.confirm({ select = true })"; "" = '' - function() - if cmp.visible_docs() then - cmp.close_docs() + function(fallback) + if cmp.visible() then + if cmp.visible_docs() then + cmp.close_docs() + else + cmp.open_docs() + end else - cmp.open_docs() + fallback() end end ''; @@ -270,7 +269,7 @@ in }; auto-session = { - enable = true; + enable = false; settings = { auto_save_enabled = true; auto_restore_enabled = true; @@ -288,7 +287,7 @@ in }; neo-tree = { - enable = true; + enable = false; settings = { close_if_last_window = true; enable_git_status = false; @@ -660,7 +659,7 @@ in return wilder.renderer_mux({ [':'] = popupmenu_renderer, ['/'] = wildmenu_renderer, - substitute = wildmenu_renderer, + substitute = wildmenu_enderer, }) end)() ''; @@ -695,7 +694,7 @@ in ]; defaults = { path_display = [ "smart" ]; - layout_strategy = "horizontal"; + layout_strategy = "flex"; layout_config = { width = 0.99; height = 0.99; @@ -709,15 +708,6 @@ in enable = true; }; - # tabs - barbar = { - enable = true; - settings = { - options.diagnostics = "nvim_lsp"; - focus_on_close = "previous"; - }; - }; - # for lsp/cmp inside markdown code blocks otter = { enable = true; diff --git a/programs/tmux/default.nix b/programs/tmux/default.nix index 8d18280..dc6d148 100644 --- a/programs/tmux/default.nix +++ b/programs/tmux/default.nix @@ -35,6 +35,8 @@ _: { # unbind every single normal keybinding unbind-key -a + set -g status-left "#{?client_prefix,#[bg=colour2],#[bg=colour1]}#[fg=colour0] #S " + # for special characters to work right # like # set-window-option -g xterm-keys on @@ -93,18 +95,30 @@ _: { bind j select-pane -D bind k select-pane -U bind l select-pane -R + bind Left select-pane -L + bind Down select-pane -D + bind Up select-pane -U + bind Right select-pane -R bind L split-window -h -c "#{pane_current_path}" bind J split-window -v -c "#{pane_current_path}" bind H split-window -h -b -c "#{pane_current_path}" bind K split-window -v -b -c "#{pane_current_path}" + bind S-Left split-window -h -c "#{pane_current_path}" + bind S-Down split-window -v -c "#{pane_current_path}" + bind S-Up split-window -h -b -c "#{pane_current_path}" + bind S-Right split-window -v -b -c "#{pane_current_path}" + bind-key -r -T prefix M-h resize-pane -L 5 + bind-key -r -T prefix M-j resize-pane -D 5 + bind-key -r -T prefix M-k resize-pane -U 5 + bind-key -r -T prefix M-l resize-pane -R 5 bind x swap-pane -D # double-click ^k (or lshift with kanata) for previous pane like ^w in vim bind -r ^k select-pane -l bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane - bind-key o choose-tree -wZ - bind-key O choose-tree -sZ + # bind-key o choose-tree -wZ + # bind-key O choose-tree -sZ # get back command mode and some other basics... bind : command-prompt @@ -148,23 +162,41 @@ _: { bind d select-pane -l \; send-keys [ + # f: file search + # unbound: git files + # g: git hashes + # u: urls + # C-d: numbers + # M-i: ips + # include line and column numbers in file search + # rebind `f` so we can reuse it here + bind-key -T prefix C-f command-prompt { find-window -Z "%%" } + # jyn is so sorry, and so am I now + # https://github.com/jyn514/dotfiles/blob/65be3c004113290f41f858f4d7f1a6799fabab19/config/tmux.conf#L203-L212 + # see `search-regex.sh` for wtf this means + # TODO: include shell variable names + bind-key f copy-mode \; send-keys -X search-backward '(^|/|\<|[[:space:]"])((\.|\.\.)|[[:alnum:]~_"-]*)((/[][[:alnum:]_.#$%&+=@"-]+)+([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)|(/[][[:alnum:]_.#$%&+=@"-]+){2,}([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)?|(\.|\.\.)/([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?))' + # urls + bind-key u copy-mode \; send-keys -X search-backward '(https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&*+-]*' + # hashes + bind-key g copy-mode \; send-keys -X search-backward '[[:<:]]([0-9a-f]{7,40}|[[:alnum:]]{52}|[0-9a-f]{64})[[:>:]]' + # ips + bind-key M-i copy-mode \; send-keys -X search-backward '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' + + bind-key -T copy-mode-vi o send-keys -X copy-pipe \ + 'cd #{pane_current_path}; xargs -I {} echo "echo {}" | bash | xargs ${../nvim/editor-hax.py} xdg-open-proxy' \; \ + if -F "#{alternate_on}" { send-keys -X cancel } + # save the buffer, then open an editor in the current pane + bind-key -T copy-mode-vi O send-keys -X copy-pipe-and-cancel \ + 'tmux send-keys "C-q"; xargs -I {} tmux send-keys "vim {}"; tmux send-keys "C-m"' + # search for the highlighted text + bind-key -T copy-mode-vi s send-keys -X copy-pipe \ + "cd #{pane_current_path}; xargs -I {} open 'https://www.google.com/search?q={}'" \; \ + if -F "#{alternate_on}" { send-keys -X cancel } + # save buffer and retype into the shell + bind-key -T copy-mode-vi Tab send-keys -X copy-selection-and-cancel \; paste-buffer -p + ''; }; - # bind-key -T root DoubleClick1Pane run-shell "cd '#{pane_current_path}'; echo '#{mouse_line}' | ${pkgs.writeScriptBin "open-file" '' - # open_file () { - # input=`cat` - # link=$(echo "$input" | grep -Po '[^ \\]*/[^ \\]*\.[^ \\]*\:[0-9]+' | sed 's/\:/|/g') - # - # if [ ! -z "$link" ]; then - # echo "LINK = $link" - # vim_proc=$(pgrep vim | xargs pwdx | grep $(pwd -P) | awk '{print $1}' | sed 's/\:*$//g' | xargs -I{} find /run/user/1000 -depth -maxdepth 1 -name "nvim.{}.0") - # - # nvim --server "$vim_proc" --remote-send ":e $link" - # fi - # } - # - # open_file 2>&1 >> ~/open-file.log - # - # ''}/bin/open-file" }; } diff --git a/programs/xdg.nix b/programs/xdg.nix new file mode 100644 index 0000000..7339c2a --- /dev/null +++ b/programs/xdg.nix @@ -0,0 +1,156 @@ +{ ... }@inputs: +let + browsers = [ + "firefox.desktop" + ]; + + defaultApps = { + text = [ + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanvim.desktop" + ]; + image = [ "org.gnome.Loupe.desktop" ]; + audio = [ "mpv.desktop" ]; + video = [ "mpv.desktop" ]; + directory = [ + "nautilus.desktop" + "org.gnome.Nautilus.desktop" + ]; + mail = [ ] ++ browsers; + calendar = [ ] ++ browsers; + browser = [ ] ++ browsers; + office = [ "libreoffice.desktop" ]; + pdf = [ ] ++ browsers; + ebook = [ ]; + magnet = [ ]; + signal = [ "signal.desktop" ]; + }; + + mimeMap = { + text = [ + "text/plain" + "text/english" + "application/x-zerosize" + "text/x-makefile" + "text/x-c++hdr" + "text/x-c++src" + "text/x-chdr" + "text/x-csrc" + "text/x-java" + "text/x-moc" + "text/x-pascal" + "text/x-tcl" + "text/x-tex" + "application/x-shellscript" + "text/x-c" + "text/x-c++" + ]; + image = [ + "image/bmp" + "image/gif" + "image/jpeg" + "image/jpg" + "image/png" + "image/svg+xml" + "image/tiff" + "image/vnd.microsoft.icon" + "image/webp" + ]; + audio = [ + "audio/aac" + "audio/mpeg" + "audio/ogg" + "audio/opus" + "audio/wav" + "audio/webm" + "audio/x-matroska" + ]; + video = [ + "video/mp2t" + "video/mp4" + "video/mpeg" + "video/ogg" + "video/webm" + "video/x-flv" + "video/x-matroska" + "video/x-msvideo" + ]; + directory = [ "inode/directory" ]; + mail = [ "x-scheme-handler/mailto" ]; + calendar = [ + "text/calendar" + "x-scheme-handler/webcal" + ]; + browser = [ + "text/html" + "x-scheme-handler/about" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/unknown" + ]; + office = [ + "application/vnd.oasis.opendocument.text" + "application/vnd.oasis.opendocument.spreadsheet" + "application/vnd.oasis.opendocument.presentation" + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + "application/vnd.openxmlformats-officedocument.presentationml.presentation" + "application/msword" + "application/vnd.ms-excel" + "application/vnd.ms-powerpoint" + "application/rtf" + ]; + pdf = [ "application/pdf" ]; + ebook = [ "application/epub+zip" ]; + magnet = [ "x-scheme-handler/magnet" ]; + signal = [ "signal.desktop" ]; + }; + + associations = + with inputs.lib; + with builtins; + listToAttrs ( + flatten (mapAttrsToList (key: map (type: attrsets.nameValuePair type defaultApps."${key}")) mimeMap) + ); + removedAssociations = { + "text/plain" = "dev.zed.Zed.desktop"; + "application/x-zerosize" = "dev.zed.Zed.desktop"; + }; +in +{ + custom.program.homedirs = { + home-config = + { config, ... }: + { + xdg = { + enable = true; + mime.enable = true; + configHome = "${config.home.homeDirectory}/.config"; + userDirs = { + enable = true; + documents = "${config.home.homeDirectory}/Documents"; + desktop = "${config.home.homeDirectory}/Documents"; + download = "${config.home.homeDirectory}/Downloads"; + music = "${config.home.homeDirectory}/Documents/personal/music"; + pictures = "${config.home.homeDirectory}/Documents/personal/pictures"; + }; + configFile."mimeapps.list".force = true; + mimeApps = { + enable = true; + associations.added = associations; + associations.removed = removedAssociations; + defaultApplications = associations; + }; + }; + }; + }; + + xdg = { + mime = { + enable = true; + defaultApplications = associations; + addedAssociations = associations; + inherit removedAssociations; + }; + }; + +} From 91ba0212b2b4aff1f2470e296da201a218518fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Fri, 23 Jan 2026 13:27:58 +0100 Subject: [PATCH 6/9] edit fish --- programs/fish/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/fish/default.nix b/programs/fish/default.nix index ece1740..1e10839 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -186,6 +186,7 @@ _: { bind -M insert \f end-of-line bind \cl 'clear; commandline -f repaint' + bind -M insert \cl 'clear; commandline -f repaint' set -g sponge_successful_exit_codes 0 set -g sponge_allow_previously_successful false From f0c21b2e79e8b407e30ceefe3c8d6d7ecf5ff448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Fri, 23 Jan 2026 10:50:19 +0100 Subject: [PATCH 7/9] icecube config and new colmena --- default-machine-config.nix | 1 + flake.lock | 349 ++++++++--------------- flake.nix | 90 +++--- hosts/ragdoll/configuration.nix | 18 ++ hosts/ragdoll/hardware-configuration.nix | 16 ++ 5 files changed, 189 insertions(+), 285 deletions(-) create mode 100644 hosts/ragdoll/configuration.nix create mode 100644 hosts/ragdoll/hardware-configuration.nix diff --git a/default-machine-config.nix b/default-machine-config.nix index 913d7f1..be13758 100644 --- a/default-machine-config.nix +++ b/default-machine-config.nix @@ -10,6 +10,7 @@ (inputs.self + /modules/machine-type.nix) (inputs.self + /modules/program.nix) (inputs.self + /programs) + (inputs.self + /users) ]; xdg.mime.enable = lib.mkForce false; diff --git a/flake.lock b/flake.lock index 61363b6..44aa71e 100644 --- a/flake.lock +++ b/flake.lock @@ -83,32 +83,10 @@ "type": "github" } }, - "colmena": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nix-github-actions": "nix-github-actions", - "nixpkgs": "nixpkgs", - "stable": "stable" - }, - "locked": { - "lastModified": 1762034856, - "narHash": "sha256-QVey3iP3UEoiFVXgypyjTvCrsIlA4ecx6Acaz5C8/PQ=", - "owner": "zhaofengli", - "repo": "colmena", - "rev": "349b035a5027f23d88eeb3bc41085d7ee29f18ed", - "type": "github" - }, - "original": { - "owner": "zhaofengli", - "repo": "colmena", - "type": "github" - } - }, "compiler-construction-2021": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1759157554, @@ -209,8 +187,8 @@ }, "deploy-rs": { "inputs": { - "flake-compat": "flake-compat_2", - "nixpkgs": "nixpkgs_3", + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs_2", "utils": "utils" }, "locked": { @@ -229,8 +207,8 @@ }, "dumpasm": { "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_4" + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1732916787, @@ -331,22 +309,6 @@ } }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1733328505, @@ -362,7 +324,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1747046372, @@ -400,23 +362,8 @@ } }, "flake-utils": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_10": { "inputs": { - "systems": "systems_12" + "systems": "systems" }, "locked": { "lastModified": 1731533236, @@ -432,7 +379,7 @@ "type": "github" } }, - "flake-utils_11": { + "flake-utils_10": { "inputs": { "systems": "systems_15" }, @@ -450,7 +397,7 @@ "type": "github" } }, - "flake-utils_12": { + "flake-utils_11": { "inputs": { "systems": "systems_16" }, @@ -468,7 +415,7 @@ "type": "github" } }, - "flake-utils_13": { + "flake-utils_12": { "inputs": { "systems": "systems_17" }, @@ -486,7 +433,7 @@ "type": "github" } }, - "flake-utils_14": { + "flake-utils_13": { "inputs": { "systems": "systems_18" }, @@ -504,7 +451,7 @@ "type": "github" } }, - "flake-utils_15": { + "flake-utils_14": { "inputs": { "systems": "systems_19" }, @@ -522,7 +469,7 @@ "type": "github" } }, - "flake-utils_16": { + "flake-utils_15": { "inputs": { "systems": "systems_20" }, @@ -542,7 +489,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems" + "systems": "systems_3" }, "locked": { "lastModified": 1731533236, @@ -560,7 +507,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1731533236, @@ -577,24 +524,6 @@ } }, "flake-utils_4": { - "inputs": { - "systems": "systems_4" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { "inputs": { "systems": "systems_5" }, @@ -612,7 +541,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_5": { "inputs": { "systems": "systems_6" }, @@ -630,7 +559,7 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_6": { "inputs": { "systems": "systems_7" }, @@ -648,7 +577,7 @@ "type": "github" } }, - "flake-utils_8": { + "flake-utils_7": { "inputs": { "systems": "systems_9" }, @@ -666,7 +595,7 @@ "type": "github" } }, - "flake-utils_9": { + "flake-utils_8": { "inputs": { "systems": "systems_11" }, @@ -684,9 +613,27 @@ "type": "github" } }, + "flake-utils_9": { + "inputs": { + "systems": "systems_12" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "harmonica": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1738890519, @@ -767,8 +714,8 @@ }, "homepage": { "inputs": { - "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_6" + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1772058280, @@ -802,7 +749,7 @@ }, "jujutsu": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_5", "nixpkgs": [ "nixpkgs" ], @@ -840,8 +787,8 @@ }, "mapf": { "inputs": { - "flake-utils": "flake-utils_7", - "nixpkgs": "nixpkgs_7" + "flake-utils": "flake-utils_6", + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1757529600, @@ -881,9 +828,9 @@ }, "mifg": { "inputs": { - "flake-utils": "flake-utils_8", + "flake-utils": "flake-utils_7", "naersk": "naersk", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_8", "nixpkgs-mozilla": "nixpkgs-mozilla" }, "locked": { @@ -903,7 +850,7 @@ "naersk": { "inputs": { "fenix": "fenix", - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1763384566, @@ -922,7 +869,7 @@ "naersk_2": { "inputs": { "fenix": "fenix_2", - "nixpkgs": "nixpkgs_17" + "nixpkgs": "nixpkgs_16" }, "locked": { "lastModified": 1752689277, @@ -944,7 +891,7 @@ "niri-unstable": [ "niri-unstable" ], - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_9", "nixpkgs-stable": "nixpkgs-stable", "xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-unstable": "xwayland-satellite-unstable" @@ -982,7 +929,7 @@ }, "niri-unstable": { "inputs": { - "nixpkgs": "nixpkgs_11", + "nixpkgs": "nixpkgs_10", "rust-overlay": "rust-overlay_2" }, "locked": { @@ -999,27 +946,6 @@ "type": "github" } }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "colmena", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1729742964, - "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", - "owner": "nix-community", - "repo": "nix-github-actions", - "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-github-actions", - "type": "github" - } - }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -1065,8 +991,8 @@ }, "nix-minecraft": { "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_10", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_9", "nixpkgs": [ "p1n3appl3", "nixpkgs" @@ -1119,11 +1045,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1750134718, - "narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=", + "lastModified": 1759036355, + "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c", + "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", "type": "github" }, "original": { @@ -1198,22 +1124,6 @@ } }, "nixpkgs_10": { - "locked": { - "lastModified": 1771848320, - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_11": { "locked": { "lastModified": 1757967192, "narHash": "sha256-/aA9A/OBmnuOMgwfzdsXRusqzUpd8rQnQY8jtrHK+To=", @@ -1229,7 +1139,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_11": { "locked": { "lastModified": 1771932323, "narHash": "sha256-3PadsTzuMJT/x0KmiD/Me1GG6rW8kaHoWVduSs0ue7o=", @@ -1244,7 +1154,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_12": { "locked": { "lastModified": 1771369470, "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", @@ -1260,7 +1170,7 @@ "type": "github" } }, - "nixpkgs_14": { + "nixpkgs_13": { "locked": { "lastModified": 1767379071, "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", @@ -1276,7 +1186,7 @@ "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_14": { "locked": { "lastModified": 1722062969, "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", @@ -1292,7 +1202,7 @@ "type": "github" } }, - "nixpkgs_16": { + "nixpkgs_15": { "locked": { "lastModified": 1768564909, "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", @@ -1308,7 +1218,7 @@ "type": "github" } }, - "nixpkgs_17": { + "nixpkgs_16": { "locked": { "lastModified": 1752077645, "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", @@ -1324,7 +1234,7 @@ "type": "github" } }, - "nixpkgs_18": { + "nixpkgs_17": { "locked": { "lastModified": 1755020227, "narHash": "sha256-gGmm+h0t6rY88RPTaIm3su95QvQIVjAJx558YUG4Id8=", @@ -1338,7 +1248,7 @@ "type": "indirect" } }, - "nixpkgs_19": { + "nixpkgs_18": { "locked": { "lastModified": 1771931193, "narHash": "sha256-IRPLf3y0HxdLirCVYoOYXQyoUBIM8llw7/96OHvyQoM=", @@ -1354,23 +1264,7 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1759036355, - "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_20": { + "nixpkgs_19": { "locked": { "lastModified": 1771207753, "narHash": "sha256-b9uG8yN50DRQ6A7JdZBfzq718ryYrlmGgqkRm9OOwCE=", @@ -1386,7 +1280,23 @@ "type": "github" } }, - "nixpkgs_21": { + "nixpkgs_2": { + "locked": { + "lastModified": 1743014863, + "narHash": "sha256-jAIUqsiN2r3hCuHji80U7NNEafpIMBXiwKlSrjWMlpg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bd3bac8bfb542dbde7ffffb6987a1a1f9d41699f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_20": { "locked": { "lastModified": 1710377395, "narHash": "sha256-KMubsUWtVr7L55pXMBibBDBdmk3xrjbBPduc0E8z28c=", @@ -1400,7 +1310,7 @@ "type": "indirect" } }, - "nixpkgs_22": { + "nixpkgs_21": { "locked": { "lastModified": 1732014248, "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", @@ -1417,22 +1327,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1743014863, - "narHash": "sha256-jAIUqsiN2r3hCuHji80U7NNEafpIMBXiwKlSrjWMlpg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "bd3bac8bfb542dbde7ffffb6987a1a1f9d41699f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1732521221, "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", @@ -1448,7 +1342,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1738680400, "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", @@ -1464,7 +1358,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { "lastModified": 1716137900, "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", @@ -1480,7 +1374,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { "lastModified": 1721379653, "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", @@ -1496,7 +1390,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { "lastModified": 1752077645, "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", @@ -1512,7 +1406,7 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_8": { "locked": { "lastModified": 1766070988, "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", @@ -1528,6 +1422,22 @@ "type": "github" } }, + "nixpkgs_9": { + "locked": { + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixvim": { "inputs": { "flake-parts": "flake-parts", @@ -1595,12 +1505,12 @@ "p1n3appl3": { "inputs": { "catppuccin": "catppuccin", - "flake-utils": "flake-utils_9", + "flake-utils": "flake-utils_8", "home-manager": "home-manager_2", "nix-index-database": "nix-index-database", "nix-minecraft": "nix-minecraft", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_13", + "nixpkgs": "nixpkgs_12", "nixpkgs-stable": "nixpkgs-stable_2", "obs-gamepad": "obs-gamepad", "ragenix": "ragenix", @@ -1625,8 +1535,8 @@ }, "pipethon": { "inputs": { - "flake-utils": "flake-utils_11", - "nixpkgs": "nixpkgs_14" + "flake-utils": "flake-utils_10", + "nixpkgs": "nixpkgs_13" }, "locked": { "lastModified": 1767634075, @@ -1705,12 +1615,12 @@ "inputs": { "agenix": "agenix_2", "darwin": "darwin_2", - "flake-utils": "flake-utils_12", + "flake-utils": "flake-utils_11", "home-manager": "home-manager_3", "impermanence": "impermanence", "nix-index-database": "nix-index-database_2", "nixos-hardware": "nixos-hardware_2", - "nixpkgs": "nixpkgs_15", + "nixpkgs": "nixpkgs_14", "ragenix": "ragenix_2" }, "locked": { @@ -1729,8 +1639,8 @@ }, "raw-data": { "inputs": { - "flake-utils": "flake-utils_13", - "nixpkgs": "nixpkgs_16" + "flake-utils": "flake-utils_12", + "nixpkgs": "nixpkgs_15" }, "locked": { "lastModified": 1768919451, @@ -1748,9 +1658,9 @@ }, "reviewqueue": { "inputs": { - "flake-utils": "flake-utils_14", + "flake-utils": "flake-utils_13", "naersk": "naersk_2", - "nixpkgs": "nixpkgs_18", + "nixpkgs": "nixpkgs_17", "nixpkgs-mozilla": "nixpkgs-mozilla_2" }, "locked": { @@ -1769,13 +1679,12 @@ }, "root": { "inputs": { - "colmena": "colmena", "compiler-construction-2021": "compiler-construction-2021", "deploy-rs": "deploy-rs", "dumpasm": "dumpasm", "firefox-addons": "firefox-addons", "firefox-sidebar-css": "firefox-sidebar-css", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_3", "harmonica": "harmonica", "home-manager": "home-manager", "homepage": "homepage", @@ -1786,7 +1695,7 @@ "mifg": "mifg", "niri": "niri", "niri-unstable": "niri-unstable", - "nixpkgs": "nixpkgs_12", + "nixpkgs": "nixpkgs_11", "nixvim": "nixvim", "noctalia": "noctalia", "p1n3appl3": "p1n3appl3", @@ -1928,8 +1837,8 @@ }, "secrets": { "inputs": { - "flake-utils": "flake-utils_15", - "nixpkgs": "nixpkgs_19" + "flake-utils": "flake-utils_14", + "nixpkgs": "nixpkgs_18" }, "locked": { "lastModified": 1769256063, @@ -1975,7 +1884,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_20" + "nixpkgs": "nixpkgs_19" }, "locked": { "lastModified": 1771889317, @@ -1991,22 +1900,6 @@ "type": "github" } }, - "stable": { - "locked": { - "lastModified": 1750133334, - "narHash": "sha256-urV51uWH7fVnhIvsZIELIYalMYsyr2FCalvlRTzqWRw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "36ab78dab7da2e4e27911007033713bab534187b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -2309,8 +2202,8 @@ }, "t": { "inputs": { - "flake-utils": "flake-utils_16", - "nixpkgs": "nixpkgs_21" + "flake-utils": "flake-utils_15", + "nixpkgs": "nixpkgs_20" }, "locked": { "lastModified": 1710410762, @@ -2328,7 +2221,7 @@ }, "totpal": { "inputs": { - "nixpkgs": "nixpkgs_22" + "nixpkgs": "nixpkgs_21" }, "locked": { "lastModified": 1737322813, diff --git a/flake.nix b/flake.nix index 268c210..e45c282 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,6 @@ }; # deployment - colmena.url = "github:zhaofengli/colmena"; deploy-rs.url = "github:serokell/deploy-rs"; # websites @@ -75,7 +74,6 @@ { self, nixpkgs, - colmena, flake-utils, sops-nix, vpn-confinement, @@ -131,6 +129,21 @@ ]; specialArgs = specialArgsForSystem system; }; + nixosConfigurations.ragdoll = home-manager.lib.homeManagerConfiguration ( + let + system = "x86_64-linux"; + in + { + modules = [ + inputs.home-manager.nixosModules.default + { home-manager.extraSpecialArgs = specialArgsForSystem system; } + + ./hosts/ragdoll/configuration.nix + ./default-machine-config.nix + ]; + pkgs = pkgsForSystem system; + } + ); deploy.nodes.fili = { hostname = "fili"; @@ -152,56 +165,13 @@ }; }; - colmenaHive = colmena.lib.makeHive self.outputs.colmena; - - colmena = { - meta = - let - system = "x86_64-linux"; - in - { - nixpkgs = pkgsForSystem system; - specialArgs = { - flakes = inputs; - inherit inputs; - inherit (inputs.secrets.packages.${system}) secrets; - }; - }; - - fili = { - deployment = { - targetHost = "donsz.nl"; - targetPort = 22; - replaceUnknownProfiles = false; - tags = [ "server" ]; - # buildOnTarget = true; - targetUser = "jana"; - }; - - imports = [ - home-manager.nixosModules.home-manager - ./hosts/fili/configuration.nix - ./users - ./default-machine-config.nix - sops-nix.nixosModules.sops - vpn-confinement.nixosModules.default - ]; - }; - - kili = { - deployment = { - allowLocalDeployment = true; - targetHost = null; - replaceUnknownProfiles = false; - tags = [ "laptop" ]; - # buildOnTarget = true; - targetUser = "jana"; - }; - imports = [ - home-manager.nixosModules.home-manager - ./hosts/kili/configuration.nix - ./users - ]; + deploy.nodes.ragdoll = { + hostname = "ragdoll"; + fastConnection = true; + profiles.system = { + user = "jana"; + path = deploy-rs.lib.x86_64-linux.activate.home-manager self.nixosConfigurations.ragdoll; + sshUser = "jana"; }; }; } @@ -214,12 +184,18 @@ devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ lix - colmena.packages.${system}.colmena (pkgs.writeShellScriptBin "apply" '' - colmena apply --no-substitute - '') - (pkgs.writeShellScriptBin "apply-local" '' - colmena apply-local --sudo + set -e + if [ $# -eq 0 ] + then + deploy + elif [ $# -eq 1 ] + then + deploy ".#$@" + else + echo "too many parameters" + exit 1 + fi '') deploy-rs.packages.${system}.deploy-rs ]; diff --git a/hosts/ragdoll/configuration.nix b/hosts/ragdoll/configuration.nix new file mode 100644 index 0000000..fb18624 --- /dev/null +++ b/hosts/ragdoll/configuration.nix @@ -0,0 +1,18 @@ +{ + pkgs, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ../../default-machine-config.nix + ]; + + custom.machine = { + type = "pc"; + capabilities = [ + "cli" + ]; + homeOnly = "jana"; + }; +} diff --git a/hosts/ragdoll/hardware-configuration.nix b/hosts/ragdoll/hardware-configuration.nix new file mode 100644 index 0000000..7245e61 --- /dev/null +++ b/hosts/ragdoll/hardware-configuration.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + + fileSystems."/" = { + device = "/dev/disk/by-uuid/4919727e-d114-4d57-b206-522b5df5fccc"; + fsType = "ext4"; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} From 30f81b2b795cc0840470a6fcf19e52045d99522d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Fri, 23 Jan 2026 13:27:58 +0100 Subject: [PATCH 8/9] make home configs work --- ; | 33 + config.nix | 124 ++ .../machine-config.nix | 14 +- defaults/machine-or-home-config.nix | 9 + {programs => defaults}/xdg.nix | 0 flake.nix | 112 +- hosts/fili/configuration.nix | 9 +- hosts/fili/services/forgejo.nix | 2 +- hosts/kili/configuration.nix | 12 +- hosts/kili/hardware-configuration.nix | 44 +- hosts/kili/kanata.nix | 13 + hosts/ragdoll/configuration.nix | 13 +- hosts/ragdoll/hardware-configuration.nix | 16 - modules/home-info.nix | 16 - modules/machine-type.nix | 25 - modules/program.nix | 9 +- modules/users.nix | 98 +- programs/default.nix | 11 +- programs/firefox/default.nix | 311 ++-- programs/fish/default.nix | 463 +++--- programs/git/default.nix | 65 +- programs/jj/default.nix | 365 ++--- programs/kanata/default.nix | 57 +- programs/kitty/default.nix | 121 +- programs/niri/default.nix | 1261 +++++++++-------- programs/nvim/default.nix | 285 ++-- programs/tmux/default.nix | 347 ++--- programs/zed/default.nix | 324 ++--- users/default.nix | 5 +- 29 files changed, 2131 insertions(+), 2033 deletions(-) create mode 100644 ; create mode 100644 config.nix rename default-machine-config.nix => defaults/machine-config.nix (91%) create mode 100644 defaults/machine-or-home-config.nix rename {programs => defaults}/xdg.nix (100%) create mode 100644 hosts/kili/kanata.nix delete mode 100644 hosts/ragdoll/hardware-configuration.nix delete mode 100644 modules/home-info.nix delete mode 100644 modules/machine-type.nix diff --git a/; b/; new file mode 100644 index 0000000..dad5d18 --- /dev/null +++ b/; @@ -0,0 +1,33 @@ +{ + lib, + options, + machine, + ... +}: +with lib; +{ + options = { + custom.program = mkOption { + type = types.attrsOf ( + types.submodule ( + { config, ... }: + { + options = { + name = mkOption { + type = types.string; + }; + home-config = mkOption { + type = types.deferredModule; + }; + system-config = mkOption { + type = types.deferredModule; + default = _: { }; + }; + }; + config = if builtins.isNull machine.home-only then config.system-config else config.home-config; + } + ) + ); + }; + }; +} diff --git a/config.nix b/config.nix new file mode 100644 index 0000000..22f414e --- /dev/null +++ b/config.nix @@ -0,0 +1,124 @@ +inputs@{ + nixpkgs, + deploy-rs, + self, + pkgsForSystem, + ... +}: + +rec { + configs = + configs: builtins.foldl' (acc: val: nixpkgs.lib.recursiveUpdate (config val) acc) { } configs; + config = + { + hostname, + capabilities, + type, + home-only ? null, + extra-modules ? [ ], + system ? "x86_64-linux", + deploy-hostname ? hostname, + deploy-options ? { + user = if builtins.isNull home-only then "root" else home-only; + sshUser = if builtins.isNull home-only then "jana" else home-only; + }, + home-manager ? builtins.isNull home-only, + stateVersion ? "26.05", + }: + with nixpkgs.lib; + let + inherit (nixpkgs) lib; + matches-capabilities = + # all requirements are contained in the machine capabilities + requirements: lib.all (req: builtins.elem req capabilities) requirements; + program = + { + requirements ? [ ], + home-config, + system-config ? { }, + }: + # if (matches-capabilities requirements) then + if (true) then + { + inherit home-config system-config; + } + else + { + # home-config = _: { }; + }; + specialArgsForHomeSystem = + { + system, + type, + capabilities, + }: + home-only: { + pkgs = pkgsForSystem system; + flakes = inputs; + inherit inputs; + inherit (inputs.secrets.packages.${system}) secrets; + machine = { + inherit + type + capabilities + stateVersion + home-only + program + ; + }; + }; + specialArgsForSystem = system: specialArgsForHomeSystem system null; + + specialArgs = specialArgsForSystem { + inherit system type capabilities; + }; + modules = + extra-modules + ++ [ ./hosts/${hostname}/configuration.nix ] + ++ ( + if builtins.isNull home-only then + [ ./defaults/machine-config.nix ] + else + [ ./defaults/machine-or-home-config.nix ] + ) + ++ ( + if home-manager then + [ + inputs.home-manager.nixosModules.default + { + home-manager.extraSpecialArgs = specialArgs; + } + ] + else + [ ] + ); + in + { + deploy.nodes.${hostname} = { + hostname = deploy-hostname; + fastConnection = true; + profiles.system = { + path = + if (builtins.isNull home-only) then + deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${hostname} + else + deploy-rs.lib.x86_64-linux.activate.home-manager self.nixosConfigurations.${hostname}; + } + // deploy-options; + }; + + nixosConfigurations.${hostname} = + if builtins.isNull home-only then + (nixosSystem { + inherit system modules specialArgs; + }) + else + inputs.home-manager.lib.homeManagerConfiguration { + extraSpecialArgs = specialArgsForHomeSystem { + inherit system type capabilities; + } home-only; + inherit modules; + pkgs = pkgsForSystem system; + }; + }; +} diff --git a/default-machine-config.nix b/defaults/machine-config.nix similarity index 91% rename from default-machine-config.nix rename to defaults/machine-config.nix index be13758..5ff6d5f 100644 --- a/default-machine-config.nix +++ b/defaults/machine-config.nix @@ -1,23 +1,21 @@ { lib, pkgs, - inputs, flakes, + machine, ... }: { imports = [ - (inputs.self + /modules/machine-type.nix) - (inputs.self + /modules/program.nix) - (inputs.self + /programs) - (inputs.self + /users) + ./machine-or-home-config.nix + ./xdg.nix ]; - xdg.mime.enable = lib.mkForce false; - - system.stateVersion = "26.05"; + system.stateVersion = machine.stateVersion; services.resolved.enable = false; + xdg.mime.enable = lib.mkForce false; + # Enable SSH services.openssh = { enable = true; diff --git a/defaults/machine-or-home-config.nix b/defaults/machine-or-home-config.nix new file mode 100644 index 0000000..ccda0c0 --- /dev/null +++ b/defaults/machine-or-home-config.nix @@ -0,0 +1,9 @@ +{ inputs, ... }: +{ + imports = [ + (../modules/program.nix) + (../programs) + (../users) + ]; + +} diff --git a/programs/xdg.nix b/defaults/xdg.nix similarity index 100% rename from programs/xdg.nix rename to defaults/xdg.nix diff --git a/flake.nix b/flake.nix index e45c282..3f9ad6c 100644 --- a/flake.nix +++ b/flake.nix @@ -72,12 +72,10 @@ }; outputs = { - self, nixpkgs, flake-utils, sops-nix, vpn-confinement, - home-manager, deploy-rs, ... }@inputs: @@ -94,87 +92,40 @@ }) ]; }; - - specialArgsForSystem = system: { - pkgs = pkgsForSystem system; - flakes = inputs; - inherit inputs; - inherit (inputs.secrets.packages.${system}) secrets; - }; + configs = import ./config.nix (inputs // { inherit pkgsForSystem; }); in - { - nixosConfigurations.fili = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = [ - inputs.home-manager.nixosModules.default - { home-manager.extraSpecialArgs = specialArgs; } - - ./hosts/fili/configuration.nix - ./users - ./default-machine-config.nix - + (configs.configs [ + { + hostname = "fili"; + capabilities = [ "cli" ]; + type = "server"; + extra-modules = [ sops-nix.nixosModules.sops vpn-confinement.nixosModules.default ]; - specialArgs = specialArgsForSystem system; - }; - nixosConfigurations.kili = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = [ - inputs.home-manager.nixosModules.default - { home-manager.extraSpecialArgs = specialArgs; } - - ./hosts/kili/configuration.nix - ./users + } + { + hostname = "kili"; + deploy-hostname = "localhost"; + capabilities = [ + "cli" + "graphical" + "work" + "fun" ]; - specialArgs = specialArgsForSystem system; - }; - nixosConfigurations.ragdoll = home-manager.lib.homeManagerConfiguration ( - let - system = "x86_64-linux"; - in - { - modules = [ - inputs.home-manager.nixosModules.default - { home-manager.extraSpecialArgs = specialArgsForSystem system; } - - ./hosts/ragdoll/configuration.nix - ./default-machine-config.nix - ]; - pkgs = pkgsForSystem system; - } - ); - - deploy.nodes.fili = { - hostname = "fili"; - fastConnection = true; - profiles.system = { - user = "root"; - path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.fili; - sshUser = "jana"; - }; - }; - - deploy.nodes.kili = { - hostname = "localhost"; - fastConnection = true; - profiles.system = { - user = "root"; - path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.kili; - sshUser = "jana"; - }; - }; - - deploy.nodes.ragdoll = { + type = "pc"; + } + { hostname = "ragdoll"; - fastConnection = true; - profiles.system = { - user = "jana"; - path = deploy-rs.lib.x86_64-linux.activate.home-manager self.nixosConfigurations.ragdoll; - sshUser = "jana"; - }; - }; - } + deploy-hostname = "ragdoll"; + home-only = "jana"; + capabilities = [ + "cli" + "work" + ]; + type = "pc"; + } + ]) // flake-utils.lib.eachDefaultSystem ( system: let @@ -184,14 +135,17 @@ devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ lix + (pkgs.writeShellScriptBin "apply-local" '' + apply $(hostname) + '') (pkgs.writeShellScriptBin "apply" '' set -e if [ $# -eq 0 ] then - deploy + deploy -s elif [ $# -eq 1 ] then - deploy ".#$@" + deploy -s ".#$@" else echo "too many parameters" exit 1 diff --git a/hosts/fili/configuration.nix b/hosts/fili/configuration.nix index 81eab81..12fcf36 100644 --- a/hosts/fili/configuration.nix +++ b/hosts/fili/configuration.nix @@ -6,13 +6,6 @@ _: { ./services ]; - custom.machine = { - type = "server"; - capabilities = [ - "cli" - ]; - }; - networking.nameservers = [ "1.1.1.1" "9.9.9.9" @@ -50,4 +43,6 @@ _: { "media" "nginx" ]; + + users.groups.media = { }; } diff --git a/hosts/fili/services/forgejo.nix b/hosts/fili/services/forgejo.nix index 4efb2c2..7bb631d 100644 --- a/hosts/fili/services/forgejo.nix +++ b/hosts/fili/services/forgejo.nix @@ -150,7 +150,7 @@ wget # used in deployments - flakes.colmena.defaultPackage."x86_64-linux" + # flakes.deploy.defaultPackage."x86_64-linux" lix openssh ]; diff --git a/hosts/kili/configuration.nix b/hosts/kili/configuration.nix index cd5b820..0387ab2 100644 --- a/hosts/kili/configuration.nix +++ b/hosts/kili/configuration.nix @@ -6,19 +6,9 @@ { imports = [ ./hardware-configuration.nix - ../../default-machine-config.nix + ./kanata.nix ]; - custom.machine = { - type = "pc"; - capabilities = [ - "cli" - "graphical" - "work" - "fun" - ]; - }; - boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/hosts/kili/hardware-configuration.nix b/hosts/kili/hardware-configuration.nix index a64dd08..70fc4f9 100644 --- a/hosts/kili/hardware-configuration.nix +++ b/hosts/kili/hardware-configuration.nix @@ -1,28 +1,44 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/4919727e-d114-4d57-b206-522b5df5fccc"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/4919727e-d114-4d57-b206-522b5df5fccc"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/26CD-373C"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/26CD-373C"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; swapDevices = [ ]; diff --git a/hosts/kili/kanata.nix b/hosts/kili/kanata.nix new file mode 100644 index 0000000..504185b --- /dev/null +++ b/hosts/kili/kanata.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + # TODO: make kanata system pkgs only + users.groups.uinput = { }; + users.extraUsers.jana.extraGroups = [ + "uinput" + "input" + ]; + environment.systemPackages = [ pkgs.kanata-with-cmd ]; + services.udev.extraRules = '' + KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput" + ''; +} diff --git a/hosts/ragdoll/configuration.nix b/hosts/ragdoll/configuration.nix index fb18624..1c551fe 100644 --- a/hosts/ragdoll/configuration.nix +++ b/hosts/ragdoll/configuration.nix @@ -1,18 +1,7 @@ { - pkgs, ... }: { - imports = [ - ./hardware-configuration.nix - ../../default-machine-config.nix - ]; + imports = [ ]; - custom.machine = { - type = "pc"; - capabilities = [ - "cli" - ]; - homeOnly = "jana"; - }; } diff --git a/hosts/ragdoll/hardware-configuration.nix b/hosts/ragdoll/hardware-configuration.nix deleted file mode 100644 index 7245e61..0000000 --- a/hosts/ragdoll/hardware-configuration.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: -{ - - fileSystems."/" = { - device = "/dev/disk/by-uuid/4919727e-d114-4d57-b206-522b5df5fccc"; - fsType = "ext4"; - }; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/modules/home-info.nix b/modules/home-info.nix deleted file mode 100644 index 251ab1e..0000000 --- a/modules/home-info.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - lib, - ... -}: -with lib; -{ - options = { - custom.home-info = mkOption { - type = types.submodule { - options = { - - }; - }; - }; - }; -} diff --git a/modules/machine-type.nix b/modules/machine-type.nix deleted file mode 100644 index 75d4542..0000000 --- a/modules/machine-type.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - ... -}: -with lib; -{ - options = { - custom.machine = mkOption { - type = types.submodule { - options = { - type = mkOption { - type = types.enum [ - "server" - "pc" - ]; - }; - capabilities = mkOption { - type = types.listOf (types.enum (import ./capabilities.nix)); - default = [ "cli" ]; - }; - }; - }; - }; - }; -} diff --git a/modules/program.nix b/modules/program.nix index a791eb1..dad5d18 100644 --- a/modules/program.nix +++ b/modules/program.nix @@ -1,6 +1,7 @@ { lib, options, + machine, ... }: with lib; @@ -15,19 +16,15 @@ with lib; name = mkOption { type = types.string; }; - requirements = mkOption { - type = types.listOf (types.enum (import ./capabilities.nix)); - default = [ "cli" ]; - }; home-config = mkOption { type = types.deferredModule; }; system-config = mkOption { - # type = types.attrs; type = types.deferredModule; - default = { }; + default = _: { }; }; }; + config = if builtins.isNull machine.home-only then config.system-config else config.home-config; } ) ); diff --git a/modules/users.nix b/modules/users.nix index 6dcb25a..aea828d 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -1,30 +1,31 @@ -{ +args@{ lib, pkgs, config, + machine, ... }: with lib; let cfg = config.custom.users; - machine = config.custom.machine; + inherit (machine) home-only; + inherit (machine) stateVersion; + valid-on-machine = on: # TODO: iterate over possibilities - if machine.type == "server" then - on.server - else if machine.type == "pc" then - on.pc - else - false; - matches-capabilities = - # all requirements are contained in the machine capabilities - requirements: lib.all (req: builtins.elem req machine.capabilities) requirements; + ( + if machine.type == "server" then + on.server + else if machine.type == "pc" then + on.pc + else + false + ); + users = lib.filterAttrs (_: value: valid-on-machine value.on) cfg; home-users = lib.filterAttrs (_: value: value.apply-home-configs) users; - stateVersion = config.system.stateVersion; programs = lib.attrsets.attrValues config.custom.program; - valid-programs = builtins.filter (program: matches-capabilities program.requirements) programs; in { options = @@ -75,32 +76,47 @@ in }; }; - config = lib.mkMerge ([ - { - users.extraUsers = lib.mapAttrs (name: value: { - isNormalUser = true; - extraGroups = value.groups; - openssh.authorizedKeys.keys = value.keys; - shell = value.shell; - description = name; - }) users; - home-manager.users = lib.mapAttrs ( - name: value: - (_: { - imports = ( - [ - ./home-info.nix - ] - ++ (map (program: program.home-config) valid-programs) - ); - - home = { - inherit stateVersion; - username = name; - homeDirectory = "/home/${name}"; - }; - }) - ) home-users; - } - ]); + config = lib.mkMerge [ + ( + if (!builtins.isNull home-only) then + lib.mkMerge ([ + { + home = { + inherit stateVersion; + username = toString home-only; + homeDirectory = "/home/${toString home-only}"; + }; + } + ] + # ++ map (program: program.home-config) programs + ) + else + (lib.mkMerge ([ + { + users.extraUsers = lib.mapAttrs (name: value: { + isNormalUser = true; + extraGroups = value.groups; + openssh.authorizedKeys.keys = value.keys; + inherit (value) shell; + description = name; + }) users; + home-manager.users = lib.mapAttrs ( + name: value: + (_: { + imports = ( + [ + ] + ++ (map (program: program.home-config) programs) + ); + home = { + inherit stateVersion; + username = name; + homeDirectory = "/home/${name}"; + }; + }) + ) home-users; + } + ])) + ) + ]; } diff --git a/programs/default.nix b/programs/default.nix index 2d14e5e..4c94d65 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -1,4 +1,4 @@ -{ ... }@inputs: +{ machine, ... }@inputs: { imports = [ ./nvim @@ -11,10 +11,9 @@ ./niri ./zed ./firefox - ./xdg.nix ]; - custom.program.graphcial-packages = { + custom.program.graphcial-packages = machine.program { requirements = [ "graphical" ]; home-config = { pkgs, ... }: @@ -34,7 +33,7 @@ }; }; - custom.program.discord = { + custom.program.discord = machine.program { requirements = [ "graphical" ]; home-config = { @@ -150,7 +149,7 @@ }; }; - custom.program.fun-packages = { + custom.program.fun-packages = machine.program { requirements = [ "fun" ]; home-config = { pkgs, ... }: @@ -162,7 +161,7 @@ }; }; - custom.program.cli-packages = { + custom.program.cli-packages = machine.program { requirements = [ "cli" ]; home-config = { config, pkgs, ... }: diff --git a/programs/firefox/default.nix b/programs/firefox/default.nix index e08a14a..d59a55e 100644 --- a/programs/firefox/default.nix +++ b/programs/firefox/default.nix @@ -1,165 +1,168 @@ -_: { - custom.program.firefox.requirements = [ "graphical" ]; - custom.program.firefox.home-config = - { - config, - flakes, - pkgs, - ... - }: - let - ff-pkgs = flakes.firefox-addons.packages.${pkgs.system}; - lock-false = { - Value = false; - Status = "locked"; - }; - # lock-true = { - # Value = true; - # Status = "locked"; - # }; - in - { - programs.firefox = { - enable = true; - package = pkgs.wrapFirefox pkgs.firefox-unwrapped { - extraPolicies = { - DisableFormHistory = true; - OfferToSaveLogins = false; - PasswordManagerEnabled = false; - AppAutoUpdate = false; - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - UserMessaging = { - WhatsNew = true; - ExtensionRecommendations = false; - FeatureRecommendations = false; - UrlbarInterventions = false; - SkipOnboarding = true; - MoreFromMozilla = false; - Locked = true; - }; - FirefoxHome = { - Search = true; - TopSites = false; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - Locked = false; - }; - FirefoxSuggest = { - WebSuggestions = false; - SponsoredSuggestions = false; - ImproveSuggest = false; - Locked = true; - }; - # TODO: https://github.com/TheRealGramdalf/nixos/blob/83f4339b121175f47940314bf5811080ac42c316/users/games/firefox/privacy.nix - }; - +{ machine, ... }: +{ + custom.program.firefox = machine.program { + requirements = [ "graphical" ]; + home-config = + { + config, + flakes, + pkgs, + ... + }: + let + ff-pkgs = flakes.firefox-addons.packages.${pkgs.system}; + lock-false = { + Value = false; + Status = "locked"; }; + # lock-true = { + # Value = true; + # Status = "locked"; + # }; + in + { + programs.firefox = { + enable = true; + package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + extraPolicies = { + DisableFormHistory = true; + OfferToSaveLogins = false; + PasswordManagerEnabled = false; + AppAutoUpdate = false; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + UserMessaging = { + WhatsNew = true; + ExtensionRecommendations = false; + FeatureRecommendations = false; + UrlbarInterventions = false; + SkipOnboarding = true; + MoreFromMozilla = false; + Locked = true; + }; + FirefoxHome = { + Search = true; + TopSites = false; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = false; + }; + FirefoxSuggest = { + WebSuggestions = false; + SponsoredSuggestions = false; + ImproveSuggest = false; + Locked = true; + }; + # TODO: https://github.com/TheRealGramdalf/nixos/blob/83f4339b121175f47940314bf5811080ac42c316/users/games/firefox/privacy.nix + }; - profiles.default = { - id = 0; - name = "profile_0"; - isDefault = true; - settings = { - # specify profile-specific preferences here; check about:config for options - "browser.newtabpage.activity-stream.feeds.section.highlights" = false; - "browser.startup.page" = 3; # Restore previous tabs - "extensions.autoDisableScopes" = 0; - "extensions.pocket.enabled" = lock-false; - "browser.tabs.closeWindowWithLastTab" = lock-false; - "sidebar.position_start" = false; # sidebar on the right - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "browser.toolbars.bookmarks.visibility" = "always"; }; - userChrome = builtins.readFile ./userChrome.css; - userContent = builtins.readFile ./userChrome.css; + profiles.default = { + id = 0; + name = "profile_0"; + isDefault = true; + settings = { + # specify profile-specific preferences here; check about:config for options + "browser.newtabpage.activity-stream.feeds.section.highlights" = false; + "browser.startup.page" = 3; # Restore previous tabs + "extensions.autoDisableScopes" = 0; + "extensions.pocket.enabled" = lock-false; + "browser.tabs.closeWindowWithLastTab" = lock-false; + "sidebar.position_start" = false; # sidebar on the right + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "browser.toolbars.bookmarks.visibility" = "always"; + }; - extensions.packages = with ff-pkgs; [ - bitwarden - ublock-origin - sidebery - sponsorblock - # vimium - ]; + userChrome = builtins.readFile ./userChrome.css; + userContent = builtins.readFile ./userChrome.css; - bookmarks = { - force = true; - settings = [ - { - keyword = "!w"; - url = "https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s"; - } - { - keyword = "!m"; - url = "https://www.google.com/maps?q=%s"; - } - { - keyword = "!git"; - url = "https://github.com/search?q=%s&type=code"; - } - { - keyword = "!std"; - url = "https://std.rs%s"; - } - { - keyword = "!rust"; - url = "https://docs.rs/releases/search?query=%s"; - } - { - keyword = "!np"; - url = "https://search.nixos.org/packages?query=%s"; - } - { - keyword = "!hmo"; - url = "https://home-manager-options.extranix.com/?query=%s"; - } - { - keyword = "!no"; - url = "https://search.nixos.org/options?query=%s"; - } - - # { - # name = "bank"; - # toolbar = true; - # url = "https://web.bunq.com/user"; - # } + extensions.packages = with ff-pkgs; [ + bitwarden + ublock-origin + sidebery + sponsorblock + # vimium ]; - }; - # extensions.settings = { - # "${ff-pkgs.sidebery.addonId}".settings = { - # sidebar = { - # # panels = with builtins; with lib; listToAttrs (map ffContainerToSideberryPanel (attrsToList containers)); - # # nav = [ "Personal" "Programming"]; - # }; - # # https://github.com/Dash-L/nixconfig/blob/c30f6d1486a3fe2b3793ab0cb13a88edefe83b7a/home/firefox.nix#L82 - # settings = { - # pinnedTabsPosition = "top"; - # hideEmptyPanels = false; - # activateAfterClosing = "prev"; - # activateAfterClosingStayInPanel = true; - # newTabCtxReopen = true; - # }; - # }; - # }; + bookmarks = { + force = true; + settings = [ + { + keyword = "!w"; + url = "https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s"; + } + { + keyword = "!m"; + url = "https://www.google.com/maps?q=%s"; + } + { + keyword = "!git"; + url = "https://github.com/search?q=%s&type=code"; + } + { + keyword = "!std"; + url = "https://std.rs%s"; + } + { + keyword = "!rust"; + url = "https://docs.rs/releases/search?query=%s"; + } + { + keyword = "!np"; + url = "https://search.nixos.org/packages?query=%s"; + } + { + keyword = "!hmo"; + url = "https://home-manager-options.extranix.com/?query=%s"; + } + { + keyword = "!no"; + url = "https://search.nixos.org/options?query=%s"; + } + + # { + # name = "bank"; + # toolbar = true; + # url = "https://web.bunq.com/user"; + # } + ]; + }; + + # extensions.settings = { + # "${ff-pkgs.sidebery.addonId}".settings = { + # sidebar = { + # # panels = with builtins; with lib; listToAttrs (map ffContainerToSideberryPanel (attrsToList containers)); + # # nav = [ "Personal" "Programming"]; + # }; + # # https://github.com/Dash-L/nixconfig/blob/c30f6d1486a3fe2b3793ab0cb13a88edefe83b7a/home/firefox.nix#L82 + # settings = { + # pinnedTabsPosition = "top"; + # hideEmptyPanels = false; + # activateAfterClosing = "prev"; + # activateAfterClosingStayInPanel = true; + # newTabCtxReopen = true; + # }; + # }; + # }; + }; + }; + + xdg.mimeApps = { + defaultApplications."x-scheme-handler/http" = [ + "firefox.desktop" + ]; + defaultApplications."x-scheme-handler/https" = [ + "firefox.desktop" + ]; + defaultApplications."text/html" = [ "firefox.desktop" ]; + defaultApplications."x-scheme-handler/about" = [ "firefox.desktop" ]; + defaultApplications."x-scheme-handler/unknown" = [ "firefox.desktop" ]; }; }; - - xdg.mimeApps = { - defaultApplications."x-scheme-handler/http" = [ - "firefox.desktop" - ]; - defaultApplications."x-scheme-handler/https" = [ - "firefox.desktop" - ]; - defaultApplications."text/html" = [ "firefox.desktop" ]; - defaultApplications."x-scheme-handler/about" = [ "firefox.desktop" ]; - defaultApplications."x-scheme-handler/unknown" = [ "firefox.desktop" ]; - }; - }; + }; } diff --git a/programs/fish/default.nix b/programs/fish/default.nix index 1e10839..b7acb77 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -1,254 +1,257 @@ -_: { - custom.program.fish.requirements = [ "cli" ]; - custom.program.fish.home-config = - { - config, - pkgs, - lib, - ... - }: - with builtins; - with lib.attrsets; - let - scripts = (import ./scripts.nix) pkgs; - aliases = with scripts; { - "cp-mov" = cp-media "mov" "movies"; - "cp-ser" = cp-media "ser" "shows"; - "cp-ani" = cp-media "ani" "anime"; - "dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm"; - "p" = builtins.trace calc calc; - "s" = "systemctl"; - "j" = "journalctl"; - "ju" = "journalctl -u"; - "jfu" = "journalctl -fu"; - "ls" = "${pkgs.eza}/bin/eza --git"; - "ll" = "${pkgs.eza}/bin/eza --git"; - "lt" = "${pkgs.eza}/bin/eza --long --tree -L 3"; - "open" = "${pkgs.xdg-utils}/bin/xdg-open"; - "cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy"; - "cat" = "${pkgs.bat}/bin/bat"; +{ machine, ... }: +{ + custom.program.fish = machine.program { + requirements = [ "cli" ]; + home-config = + { + config, + pkgs, + lib, + ... + }: + with builtins; + with lib.attrsets; + let + scripts = (import ./scripts.nix) pkgs; + aliases = with scripts; { + "cp-mov" = cp-media "mov" "movies"; + "cp-ser" = cp-media "ser" "shows"; + "cp-ani" = cp-media "ani" "anime"; + "dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm"; + "p" = builtins.trace calc calc; + "s" = "systemctl"; + "j" = "journalctl"; + "ju" = "journalctl -u"; + "jfu" = "journalctl -fu"; + "ls" = "${pkgs.eza}/bin/eza --git"; + "ll" = "${pkgs.eza}/bin/eza --git"; + "lt" = "${pkgs.eza}/bin/eza --long --tree -L 3"; + "open" = "${pkgs.xdg-utils}/bin/xdg-open"; + "cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy"; + "cat" = "${pkgs.bat}/bin/bat"; - # "pull" = "${pkgs.git}/bin/git pull"; - # "push" = "${pkgs.git}/bin/git push"; - # "commit" = "${pkgs.git}/bin/git commit"; - # "add" = "${pkgs.git}/bin/git add"; - # "patch" = "${pkgs.git}/bin/git add -p"; - # "amend" = "${pkgs.git}/bin/git commit --amend"; - # "log" = "${pkgs.git}/bin/git log --all --graph --decorate"; - # "st" = "${pkgs.git}/bin/git status"; - # "checkout" = "${pkgs.git}/bin/git checkout"; - # "rebase" = "${pkgs.git}/bin/git rebase"; - # "stash" = "${pkgs.git}/bin/git stash"; + # "pull" = "${pkgs.git}/bin/git pull"; + # "push" = "${pkgs.git}/bin/git push"; + # "commit" = "${pkgs.git}/bin/git commit"; + # "add" = "${pkgs.git}/bin/git add"; + # "patch" = "${pkgs.git}/bin/git add -p"; + # "amend" = "${pkgs.git}/bin/git commit --amend"; + # "log" = "${pkgs.git}/bin/git log --all --graph --decorate"; + # "st" = "${pkgs.git}/bin/git status"; + # "checkout" = "${pkgs.git}/bin/git checkout"; + # "rebase" = "${pkgs.git}/bin/git rebase"; + # "stash" = "${pkgs.git}/bin/git stash"; - "edit" = "jj edit"; - "old" = "jj edit @-"; - "new" = "jj edit @+"; - "rebase" = "jj rebase"; - "pull" = "jj git fetch; jj catchup"; - "msg" = "jj describe -m"; - "branch" = "jj bookmark set"; - "stat" = "jj status"; - "push" = "jj git push"; + "edit" = "jj edit"; + "old" = "jj edit @-"; + "new" = "jj edit @+"; + "rebase" = "jj rebase"; + "pull" = "jj git fetch; jj catchup"; + "msg" = "jj describe -m"; + "branch" = "jj bookmark set"; + "stat" = "jj status"; + "push" = "jj git push"; - "tidy" = "x test tidy --bless"; - "ui" = "x test tests/ui/"; + "tidy" = "x test tidy --bless"; + "ui" = "x test tests/ui/"; - "f" = "nautilus --no-desktop . &"; - }; - # extracting any compressed format - extract = '' - function extract -a file -d "decompress a file" - if not test -f $file - echo "'$file' is not a valid file" - return 1 - end - switch $file - # tar can automatically figure out how to decompress - case '*.{tar,tar.{bz2,zst,gz,xz},tbz2,tgz'; ${pkgs.gnutar}/bin/tar xf $file; end - case '*.bz2'; bunzip2 $file; end - case '*.rar'; unrar e $file; end - case '*.gz'; gunzip $file; end - case '*.zip'; ${pkgs.unzip}/bin/unzip $file; end - case '*.Z'; uncompress $file; end - case '*.7z'; 7z x $file; end - case '*'; - echo "'$file' cannot be extracted" + "f" = "nautilus --no-desktop . &"; + }; + # extracting any compressed format + extract = '' + function extract -a file -d "decompress a file" + if not test -f $file + echo "'$file' is not a valid file" return 1 + end + switch $file + # tar can automatically figure out how to decompress + case '*.{tar,tar.{bz2,zst,gz,xz},tbz2,tgz'; ${pkgs.gnutar}/bin/tar xf $file; end + case '*.bz2'; bunzip2 $file; end + case '*.rar'; unrar e $file; end + case '*.gz'; gunzip $file; end + case '*.zip'; ${pkgs.unzip}/bin/unzip $file; end + case '*.Z'; uncompress $file; end + case '*.7z'; 7z x $file; end + case '*'; + echo "'$file' cannot be extracted" + return 1 + end end - end - ''; - in - { - programs = { - atuin = { - enable = true; - enableFishIntegration = true; + ''; + in + { + programs = { + atuin = { + enable = true; + enableFishIntegration = true; - settings = { - filter_mode_shell_up_key_binding = "workspace"; - exit_mode = "return-original"; - inline_height = 20; - workspaces = true; + settings = { + filter_mode_shell_up_key_binding = "workspace"; + exit_mode = "return-original"; + inline_height = 20; + workspaces = true; + }; }; - }; - zoxide = { - enable = true; - enableFishIntegration = true; - }; + zoxide = { + enable = true; + enableFishIntegration = true; + }; - direnv = { - enable = true; - # enableFishIntegration = lib.mkDefault true; - }; + direnv = { + enable = true; + # enableFishIntegration = lib.mkDefault true; + }; - fzf = { - enable = true; - enableFishIntegration = true; - }; + fzf = { + enable = true; + enableFishIntegration = true; + }; - fish = { - enable = true; - shellAliases = aliases; - plugins = with pkgs.fishPlugins; [ - { - name = "bang-bang"; - src = pkgs.fetchFromGitHub { - owner = "oh-my-fish"; - repo = "plugin-bang-bang"; - rev = "ec991b80ba7d4dda7a962167b036efc5c2d79419"; - hash = "sha256-oPPCtFN2DPuM//c48SXb4TrFRjJtccg0YPXcAo0Lxq0="; + fish = { + enable = true; + shellAliases = aliases; + plugins = with pkgs.fishPlugins; [ + { + name = "bang-bang"; + src = pkgs.fetchFromGitHub { + owner = "oh-my-fish"; + repo = "plugin-bang-bang"; + rev = "ec991b80ba7d4dda7a962167b036efc5c2d79419"; + hash = "sha256-oPPCtFN2DPuM//c48SXb4TrFRjJtccg0YPXcAo0Lxq0="; + }; + } + { + name = "tide"; + inherit (tide) src; + } + { + name = "sponge"; + inherit (sponge) src; + } + { + name = "autopair"; + inherit (autopair) src; + } + ]; + + functions = { + fish_jj_prompt = { + body = '' + if not ${config.programs.jujutsu.package}/bin/jj root --quiet &>/dev/null + return 1 + end + + ${config.programs.jujutsu.package}/bin/jj log --ignore-working-copy --no-graph --color always -r @ -T ' + separate( + " ", + bookmarks.join(", "), + change_id.shortest(), + commit_id.shortest(), + if(conflict, "conflict"), + if(empty, "empty"), + if(divergent, "divergent"), + if(hidden, "hidden"), + ) + ' + ''; }; - } - { - name = "tide"; - inherit (tide) src; - } - { - name = "sponge"; - inherit (sponge) src; - } - { - name = "autopair"; - inherit (autopair) src; - } - ]; - functions = { - fish_jj_prompt = { - body = '' - if not ${config.programs.jujutsu.package}/bin/jj root --quiet &>/dev/null - return 1 - end + _tide_item_jj = { + body = '' + set -l _tide_item_jj_color $_tide_location_color + echo -ns $_tide_item_jj_color" ("(fish_jj_prompt)$_tide_item_jj_color")" + ''; + }; - ${config.programs.jujutsu.package}/bin/jj log --ignore-working-copy --no-graph --color always -r @ -T ' - separate( - " ", - bookmarks.join(", "), - change_id.shortest(), - commit_id.shortest(), - if(conflict, "conflict"), - if(empty, "empty"), - if(divergent, "divergent"), - if(hidden, "hidden"), - ) - ' - ''; + _tide_item_git = { + body = '' + if not test -d .jj + fish_git_prompt '%s' + end + ''; + }; }; - _tide_item_jj = { - body = '' - set -l _tide_item_jj_color $_tide_location_color - echo -ns $_tide_item_jj_color" ("(fish_jj_prompt)$_tide_item_jj_color")" - ''; - }; + interactiveShellInit = '' + fish_vi_key_bindings - _tide_item_git = { - body = '' - if not test -d .jj - fish_git_prompt '%s' - end - ''; - }; + bind \e\[3\;5~ kill-word + bind \cH backward-kill-word + bind \cV beginning-of-line + bind \f end-of-line + + bind -M insert \e\[3\;5~ kill-word + bind -M insert \cH backward-kill-word + bind -M insert \cV beginning-of-line + bind -M insert \f end-of-line + + bind \cl 'clear; commandline -f repaint' + bind -M insert \cl 'clear; commandline -f repaint' + + set -g sponge_successful_exit_codes 0 + set -g sponge_allow_previously_successful false + set -g sponge_delay 10 + + ${config.programs.jujutsu.package}/bin/jj util completion fish | source + + # if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items + # set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items) + # if test $tide_item_jj_idx + # set tide_left_prompt_items \ + # $tide_left_prompt_items[1..$tide_item_jj_idx] \ + # jj \ + # $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1] + # end + # end + + function t + cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" + end + + function temp + t $argv + end + + function rs + cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" + cargo init . --bin --name $(basename "$PWD") + vim src/main.rs + end + + fish_add_path "$HOME/.cargo/bin" + fish_add_path "$HOME/.local/bin" + fish_add_path "$HOME/Documents/scripts" + fish_add_path "$HOME/.nix-profile/bin" + + function fish_greeting + ${pkgs.blahaj}/bin/blahaj -s + end + ''; }; + }; - interactiveShellInit = '' - fish_vi_key_bindings - - bind \e\[3\;5~ kill-word - bind \cH backward-kill-word - bind \cV beginning-of-line - bind \f end-of-line - - bind -M insert \e\[3\;5~ kill-word - bind -M insert \cH backward-kill-word - bind -M insert \cV beginning-of-line - bind -M insert \f end-of-line - - bind \cl 'clear; commandline -f repaint' - bind -M insert \cl 'clear; commandline -f repaint' - - set -g sponge_successful_exit_codes 0 - set -g sponge_allow_previously_successful false - set -g sponge_delay 10 - - ${config.programs.jujutsu.package}/bin/jj util completion fish | source - - # if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items - # set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items) - # if test $tide_item_jj_idx - # set tide_left_prompt_items \ - # $tide_left_prompt_items[1..$tide_item_jj_idx] \ - # jj \ - # $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1] - # end - # end - - function t - cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" - end - - function temp - t $argv - end - - function rs - cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" - cargo init . --bin --name $(basename "$PWD") - vim src/main.rs - end - - fish_add_path "$HOME/.cargo/bin" - fish_add_path "$HOME/.local/bin" - fish_add_path "$HOME/Documents/scripts" - fish_add_path "$HOME/.nix-profile/bin" - - function fish_greeting - ${pkgs.blahaj}/bin/blahaj -s - end + home.activation = { + setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + setupTide() { + ${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${ + lib.cli.toGNUCommandLineShell { } { + auto = true; + style = "Lean"; + prompt_colors = "True color"; + show_time = "No"; + lean_prompt_height = "Two lines"; + prompt_connection = "Disconnected"; + prompt_spacing = "Compact"; + icons = "Few icons"; + transient = "Yes"; + } + }"} >/dev/null 2>&1 + } + setupTide ''; }; }; - - home.activation = { - setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - setupTide() { - ${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${ - lib.cli.toGNUCommandLineShell { } { - auto = true; - style = "Lean"; - prompt_colors = "True color"; - show_time = "No"; - lean_prompt_height = "Two lines"; - prompt_connection = "Disconnected"; - prompt_spacing = "Compact"; - icons = "Few icons"; - transient = "Yes"; - } - }"} >/dev/null 2>&1 - } - setupTide - ''; - }; - }; + }; } diff --git a/programs/git/default.nix b/programs/git/default.nix index e364ce9..3de79e5 100644 --- a/programs/git/default.nix +++ b/programs/git/default.nix @@ -1,39 +1,42 @@ -_: { - custom.program.git.requirements = [ "cli" ]; - custom.program.git.home-config = _: { - programs.git = { - enable = true; - signing.key = "/home/jana/.ssh/id_ed25519.pub"; - signing.signByDefault = true; +{ machine, ... }: +{ + custom.program.git = machine.program { + requirements = [ "cli" ]; + home-config = _: { + programs.git = { + enable = true; + signing.key = "/home/jana/.ssh/id_ed25519.pub"; + signing.signByDefault = true; - settings = { - user.email = "jana@donsz.nl"; - user.name = "Jana Dönszelmann"; + settings = { + user.email = "jana@donsz.nl"; + user.name = "Jana Dönszelmann"; - push.autoSetupRemote = true; - pull.rebase = true; - init.defaultBranch = "main"; - gpg.format = "ssh"; - diff.colorMoved = "default"; - rerere.enabled = true; + push.autoSetupRemote = true; + pull.rebase = true; + init.defaultBranch = "main"; + gpg.format = "ssh"; + diff.colorMoved = "default"; + rerere.enabled = true; - alias.conflicts = "diff --check"; - }; - - }; - - programs.delta = { - enable = true; - options = { - navigate = true; - light = false; - side-by-side = true; - features = "decorations interactive"; - interactive = { - keep-plus-minus-markers = false; + alias.conflicts = "diff --check"; }; + + }; + + programs.delta = { + enable = true; + options = { + navigate = true; + light = false; + side-by-side = true; + features = "decorations interactive"; + interactive = { + keep-plus-minus-markers = false; + }; + }; + enableGitIntegration = true; }; - enableGitIntegration = true; }; }; } diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 91b624a..0a3aa54 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -1,193 +1,196 @@ -_: { - custom.program.jujutsu.requirements = [ "cli" ]; - custom.program.jujutsu.home-config = - { config, pkgs, ... }: - { - programs.jujutsu = { - enable = true; - # package = pkgs.custom.jujutsu; +{ machine, ... }: +{ + custom.program.jujutsu = machine.program { + requirements = [ "cli" ]; + home-config = + { config, pkgs, ... }: + { + programs.jujutsu = { + enable = true; + # package = pkgs.custom.jujutsu; - settings = { - user = { - email = config.programs.git.settings.user.email; - name = config.programs.git.settings.user.name; - }; - - ui = { - paginate = "never"; - # pager = "${pkgs.delta}/bin/delta"; - # for delta - # diff-formatter = ":git"; - diff-formatter = [ - "${pkgs.difftastic}/bin/difft" - "--color=always" - "$left" - "$right" - ]; - - default-command = [ - "log" - "--reversed" - "--no-pager" - ]; - merge-editor = [ - "${pkgs.meld}/bin/meld" - "$left" - "$base" - "$right" - "-o" - "$output" - "--auto-merge" - ]; - # diff-editor = "${pkgs.meld}/bin/meld"; - }; - - fsmonitor.backend = "watchman"; - fsmonitor.watchman.register-snapshot-trigger = true; - - revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"; - # revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)"; - # revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)"; - - revset-aliases = { - "my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")"; - "user(x)" = "author(x) | committer(x)"; - current = "bookmarks() & my() & ~immutable()"; - "closest_bookmark(to)" = "heads(::to & bookmarks())"; - }; - - template-aliases = { - "format_timestamp(timestamp)" = "timestamp.ago()"; - log_oneline = '' - if(root, - format_root_commit(self), - label(if(current_working_copy, "working_copy"), - concat( - separate(" ", - format_short_change_id_with_change_offset(self), - if(empty, label("empty", "(empty)")), - if(description, - description.first_line(), - label(if(empty, "empty"), description_placeholder), - ), - bookmarks, - tags, - working_copies, - if(conflict, label("conflict", "conflict")), - if(config("ui.show-cryptographic-signatures").as_boolean(), - format_short_cryptographic_signature(signature)), - ) ++ "\n", - ), - ) - ) - ''; - # if(.contained_in('first_parent(@)'), label("git_head", "HEAD")), - status_summary = "'\n' ++ self.diff().summary() ++ '\n'"; - log_oneline_with_status_summary = "log_oneline ++ if(self.current_working_copy() && self.diff().files().len() > 0, status_summary)"; - }; - - aliases = - let - util = script: [ - "util" - "exec" - "--" - "bash" - "-c" - script - ]; - in - { - tug = [ - "bookmark" - "move" - "--from" - "heads(@- & bookmarks())" - "--to" - "coalesce(@ & ~empty(), @-)" - ]; - fuck = [ - "bookmark" - "move" - "--from" - "heads(@ & bookmarks())" - "--to" - "@-" - "--allow-backwards" - ]; - catchup = [ - "rebase" - "-b" - "bookmarks() & mine() & ~immutable()" - "-d" - "trunk()" - "--skip-emptied" - ]; - pull = util '' - jj git fetch - jj catchup - ''; - ch = [ - "show" - "--stat" - ]; - move = [ - "rebase" - "-r" - ]; - push = [ - "git" - "push" - ]; - ll = [ - "log" - "-T" - "builtin_log_compact" - ]; - mdiff = [ - "diff" - "--from" - "trunk()" - ]; + settings = { + user = { + email = config.programs.git.settings.user.email; + name = config.programs.git.settings.user.name; }; - templates = { - log_node = '' - label("node", - coalesce( - if(!self, label("elided", "~")), - if(current_working_copy, label("working_copy", "@")), - if(conflict, label("conflict", "×")), - if(immutable, label("immutable", "*")), - label("normal", "·") + ui = { + paginate = "never"; + # pager = "${pkgs.delta}/bin/delta"; + # for delta + # diff-formatter = ":git"; + diff-formatter = [ + "${pkgs.difftastic}/bin/difft" + "--color=always" + "$left" + "$right" + ]; + + default-command = [ + "log" + "--reversed" + "--no-pager" + ]; + merge-editor = [ + "${pkgs.meld}/bin/meld" + "$left" + "$base" + "$right" + "-o" + "$output" + "--auto-merge" + ]; + # diff-editor = "${pkgs.meld}/bin/meld"; + }; + + fsmonitor.backend = "watchman"; + fsmonitor.watchman.register-snapshot-trigger = true; + + revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"; + # revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)"; + # revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)"; + + revset-aliases = { + "my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")"; + "user(x)" = "author(x) | committer(x)"; + current = "bookmarks() & my() & ~immutable()"; + "closest_bookmark(to)" = "heads(::to & bookmarks())"; + }; + + template-aliases = { + "format_timestamp(timestamp)" = "timestamp.ago()"; + log_oneline = '' + if(root, + format_root_commit(self), + label(if(current_working_copy, "working_copy"), + concat( + separate(" ", + format_short_change_id_with_change_offset(self), + if(empty, label("empty", "(empty)")), + if(description, + description.first_line(), + label(if(empty, "empty"), description_placeholder), + ), + bookmarks, + tags, + working_copies, + if(conflict, label("conflict", "conflict")), + if(config("ui.show-cryptographic-signatures").as_boolean(), + format_short_cryptographic_signature(signature)), + ) ++ "\n", + ), + ) ) - ) - ''; - log = "log_oneline_with_status_summary"; - git_push_bookmark = ''"jdonszelmann/" ++ change_id.short()''; - }; + ''; + # if(.contained_in('first_parent(@)'), label("git_head", "HEAD")), + status_summary = "'\n' ++ self.diff().summary() ++ '\n'"; + log_oneline_with_status_summary = "log_oneline ++ if(self.current_working_copy() && self.diff().files().len() > 0, status_summary)"; + }; - signing = { - # sign-all = true; - behavior = "own"; - backend = "ssh"; - key = "~/.ssh/id_ed25519.pub"; - }; + aliases = + let + util = script: [ + "util" + "exec" + "--" + "bash" + "-c" + script + ]; + in + { + tug = [ + "bookmark" + "move" + "--from" + "heads(@- & bookmarks())" + "--to" + "coalesce(@ & ~empty(), @-)" + ]; + fuck = [ + "bookmark" + "move" + "--from" + "heads(@ & bookmarks())" + "--to" + "@-" + "--allow-backwards" + ]; + catchup = [ + "rebase" + "-b" + "bookmarks() & mine() & ~immutable()" + "-d" + "trunk()" + "--skip-emptied" + ]; + pull = util '' + jj git fetch + jj catchup + ''; + ch = [ + "show" + "--stat" + ]; + move = [ + "rebase" + "-r" + ]; + push = [ + "git" + "push" + ]; + ll = [ + "log" + "-T" + "builtin_log_compact" + ]; + mdiff = [ + "diff" + "--from" + "trunk()" + ]; + }; - # remotes.origin.auto-track-bookmarks = true; - # remotes.upstream.auto-track-bookmarks = true; + templates = { + log_node = '' + label("node", + coalesce( + if(!self, label("elided", "~")), + if(current_working_copy, label("working_copy", "@")), + if(conflict, label("conflict", "×")), + if(immutable, label("immutable", "*")), + label("normal", "·") + ) + ) + ''; + log = "log_oneline_with_status_summary"; + git_push_bookmark = ''"jdonszelmann/" ++ change_id.short()''; + }; - git = { - private-commits = "description(glob:'wip:*') | description(glob:'trial:*')"; - write-change-id-header = true; + signing = { + # sign-all = true; + behavior = "own"; + backend = "ssh"; + key = "~/.ssh/id_ed25519.pub"; + }; - fetch = [ - "upstream" - "origin" - ]; - push = "origin"; + # remotes.origin.auto-track-bookmarks = true; + # remotes.upstream.auto-track-bookmarks = true; + + git = { + private-commits = "description(glob:'wip:*') | description(glob:'trial:*')"; + write-change-id-header = true; + + fetch = [ + "upstream" + "origin" + ]; + push = "origin"; + }; }; }; }; - }; + }; } diff --git a/programs/kanata/default.nix b/programs/kanata/default.nix index 984d120..0794676 100644 --- a/programs/kanata/default.nix +++ b/programs/kanata/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ machine, pkgs, ... }: let kanata-config = '' (defcfg @@ -86,32 +86,34 @@ let ''; in { - custom.program.kanata.requirements = [ "graphical" ]; - custom.program.kanata.home-config = - { pkgs, config, ... }: - { - systemd.user.services.kanata = { - Unit = { - Description = "kanata"; + custom.program.kanata = machine.program { + requirements = [ "graphical" ]; + home-config = + { pkgs, ... }: + { + systemd.user.services.kanata = { + Unit = { + Description = "kanata"; + }; + + Service = { + Restart = "always"; + RestartSec = "3"; + ExecStart = "${pkgs.kanata-with-cmd}/bin/kanata --cfg ${pkgs.writeText "kanata.kbd" kanata-config}"; + Nice = "-20"; + }; + + Install = { + WantedBy = [ "default.target" ]; + }; }; - Service = { - Restart = "always"; - RestartSec = "3"; - ExecStart = "${pkgs.kanata-with-cmd}/bin/kanata --cfg ${pkgs.writeText "kanata.kbd" kanata-config}"; - Nice = "-20"; - }; - - Install = { - WantedBy = [ "default.target" ]; + home.file.kanata = { + target = ".config/kanata/kanata.kbd"; + text = kanata-config; }; }; - - home.file.kanata = { - target = ".config/kanata/kanata.kbd"; - text = kanata-config; - }; - }; + }; # custom.program.kanata.system-config = # { pkgs, ... }: @@ -123,15 +125,6 @@ in # reboot or sudo udevadm control --reload-rules && sudo udevadm trigger # sudo modprobe uinput - users.groups.uinput = { }; - users.extraUsers.jana.extraGroups = [ - "uinput" - "input" - ]; - environment.systemPackages = [ pkgs.kanata-with-cmd ]; - services.udev.extraRules = '' - KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput" - ''; # }; } diff --git a/programs/kitty/default.nix b/programs/kitty/default.nix index 05b44c7..78651ba 100644 --- a/programs/kitty/default.nix +++ b/programs/kitty/default.nix @@ -1,63 +1,66 @@ -_: { - custom.program.kitty.requirements = [ "graphical" ]; - custom.program.kitty.home-config = - { pkgs, flakes, ... }: - { - home.packages = pkgs.custom.maple-fonts-pack; +{ machine, ... }: +{ + custom.program.kitty = machine.program { + requirements = [ "graphical" ]; + home-config = + { pkgs, flakes, ... }: + { + home.packages = pkgs.custom.maple-fonts-pack; - programs.kitty = { - enable = true; - font = { - name = "Maple Mono NF"; - size = 11.0; - package = pkgs.jetbrains-mono; + programs.kitty = { + enable = true; + font = { + name = "Maple Mono NF"; + size = 11.0; + package = pkgs.jetbrains-mono; + }; + + settings = { + scrollback_lines = 20000; + allow_hyperlinks = true; + + repaint_delay = 10; + input_delay = 3; + + enable_audio_bell = false; + update_check_interval = 0; + + initial_window_width = "95c"; + initial_window_height = "30c"; + remember_window_size = "no"; + + draw_minimal_borders = false; + hide_window_decorations = true; + + shell = "${pkgs.tmux}/bin/tmux"; + clipboard_control = "write-clipboard write-primary read-clipboard read-primary"; + + foreground = "#fcfcfc"; + background = "#232627"; + linux_display_server = "auto"; + }; + + keybindings = { + "ctrl+f" = + "launch --location=hsplit --allow-remote-control kitty +kitten ${flakes.kitty-search}/search.py @active-kitty-window-id"; + "ctrl+alt+r" = "load_config_file"; + "ctrl+shift+r" = "no_op"; + "super+`" = "no_op"; + "ctrl+EQUAL" = "change_font_size all +2.0"; + "ctrl+minus" = "change_font_size all -2.0"; + "ctrl+0" = "change_font_size all 0"; + # "ctrl+/" = "send_text all "; + "super+~" = "no_op"; + + # required for vim!! + # terminals map ctrl+i to tab. I want them to do different things in vim. + "ctrl+i" = "send_text all \\x01"; + }; + + extraConfig = '' + mouse_map left click ungrabbed no-op + ''; }; - - settings = { - scrollback_lines = 20000; - allow_hyperlinks = true; - - repaint_delay = 10; - input_delay = 3; - - enable_audio_bell = false; - update_check_interval = 0; - - initial_window_width = "95c"; - initial_window_height = "30c"; - remember_window_size = "no"; - - draw_minimal_borders = false; - hide_window_decorations = true; - - shell = "${pkgs.tmux}/bin/tmux"; - clipboard_control = "write-clipboard write-primary read-clipboard read-primary"; - - foreground = "#fcfcfc"; - background = "#232627"; - linux_display_server = "auto"; - }; - - keybindings = { - "ctrl+f" = - "launch --location=hsplit --allow-remote-control kitty +kitten ${flakes.kitty-search}/search.py @active-kitty-window-id"; - "ctrl+alt+r" = "load_config_file"; - "ctrl+shift+r" = "no_op"; - "super+`" = "no_op"; - "ctrl+EQUAL" = "change_font_size all +2.0"; - "ctrl+minus" = "change_font_size all -2.0"; - "ctrl+0" = "change_font_size all 0"; - # "ctrl+/" = "send_text all "; - "super+~" = "no_op"; - - # required for vim!! - # terminals map ctrl+i to tab. I want them to do different things in vim. - "ctrl+i" = "send_text all \\x01"; - }; - - extraConfig = '' - mouse_map left click ungrabbed no-op - ''; }; - }; + }; } diff --git a/programs/niri/default.nix b/programs/niri/default.nix index 04ae0f6..d36528e 100644 --- a/programs/niri/default.nix +++ b/programs/niri/default.nix @@ -1,663 +1,666 @@ -_: { - custom.program.niri.requirements = [ "graphical" ]; - custom.program.niri.home-config = - { - config, - pkgs, - flakes, - lib, - ... - }: - let - noctalia = - cmd: - [ - "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" - "ipc" - "call" - ] - ++ (pkgs.lib.splitString " " cmd); +{ machine, ... }: +{ + custom.program.niri = machine.program { + requirements = [ "graphical" ]; + home-config = + { + config, + pkgs, + flakes, + lib, + ... + }: + let + noctalia = + cmd: + [ + "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" + "ipc" + "call" + ] + ++ (pkgs.lib.splitString " " cmd); - wallpaper = ("${pkgs.custom.raw-data}/pacific.png"); - matugenSchemeType = "scheme-tonal-spot"; - in - { - imports = [ - flakes.niri.homeModules.niri - flakes.matugen.nixosModules.default - flakes.noctalia.homeModules.default - ]; + wallpaper = ("${pkgs.custom.raw-data}/pacific.png"); + matugenSchemeType = "scheme-tonal-spot"; + in + { + imports = [ + flakes.niri.homeModules.niri + flakes.matugen.nixosModules.default + flakes.noctalia.homeModules.default + ]; - home.packages = - with pkgs; - [ - matugen - glib - dconf - gsettings-desktop-schemas - xwayland-satellite - # gtk - nwg-look - # qt config tool - kdePackages.qt6ct + home.packages = + with pkgs; + [ + matugen + glib + dconf + gsettings-desktop-schemas + xwayland-satellite + # gtk + nwg-look + # qt config tool + kdePackages.qt6ct - # media control - playerctl - # brightness control - brightnessctl - pavucontrol + # media control + playerctl + # brightness control + brightnessctl + pavucontrol - fira - jetbrains-mono - fira-mono - noto-fonts - ] - ++ custom.maple-fonts-pack; + fira + jetbrains-mono + fira-mono + noto-fonts + ] + ++ custom.maple-fonts-pack; - programs.niri.settings = { - # main laptop screen - outputs."eDP-1" = { - mode = { - width = 1928; - height = 1200; - refresh = 59.987; - }; - position = { - x = 0; - y = 0; - }; - }; - - outputs."LG Electronics LG ULTRAWIDE 411NTBK28189" = { - mode = { - width = 3440; - height = 1440; - refresh = 59.987; - }; - position = { - x = -3440; - y = 240; - }; - - # focus the external screen first - focus-at-startup = true; - }; - - outputs."LG Electronics LG ULTRAWIDE 409NTAB3P496" = { - mode = { - width = 3440; - height = 1440; - refresh = 59.987; - }; - position = { - x = -3440; - y = 240; - }; - - # focus the external screen first - focus-at-startup = true; - }; - }; - - home.sessionVariables = { - QT_QPA_PLATFORMTHEME = "qt6ct"; - XCURSOR_THEME = "Adwaita"; - XCURSOR_SIZE = "10"; - DEFAULT_BROWSER = "${config.programs.firefox.package}/bin/firefox"; - BROWSER = "${config.programs.firefox.package}/bin/firefox"; - }; - - programs.niri.settings = { - input = { - keyboard = { - xkb = { - layout = "us"; - options = "grp:win_space_toggle,compose:ralt"; + programs.niri.settings = { + # main laptop screen + outputs."eDP-1" = { + mode = { + width = 1928; + height = 1200; + refresh = 59.987; + }; + position = { + x = 0; + y = 0; }; - numlock = true; }; - mouse = { - accel-speed = 0.5; + outputs."LG Electronics LG ULTRAWIDE 411NTBK28189" = { + mode = { + width = 3440; + height = 1440; + refresh = 59.987; + }; + position = { + x = -3440; + y = 240; + }; + + # focus the external screen first + focus-at-startup = true; }; - touchpad = { - dwt = true; - tap = true; - tap-button-map = "left-right-middle"; - click-method = "clickfinger"; - natural-scroll = false; - }; + outputs."LG Electronics LG ULTRAWIDE 409NTAB3P496" = { + mode = { + width = 3440; + height = 1440; + refresh = 59.987; + }; + position = { + x = -3440; + y = 240; + }; - focus-follows-mouse = { - enable = true; - max-scroll-amount = "0%"; + # focus the external screen first + focus-at-startup = true; }; - - workspace-auto-back-and-forth = true; }; - debug = { - render-drm-device = "/dev/dri/by-path/pci-0000:00:02.0-render"; + home.sessionVariables = { + QT_QPA_PLATFORMTHEME = "qt6ct"; + XCURSOR_THEME = "Adwaita"; + XCURSOR_SIZE = "10"; + DEFAULT_BROWSER = "${config.programs.firefox.package}/bin/firefox"; + BROWSER = "${config.programs.firefox.package}/bin/firefox"; }; - cursor = { - theme = "Adwaita"; - size = 10; - }; + programs.niri.settings = { + input = { + keyboard = { + xkb = { + layout = "us"; + options = "grp:win_space_toggle,compose:ralt"; + }; + numlock = true; + }; - gestures.hot-corners.enable = true; + mouse = { + accel-speed = 0.5; + }; - layout = { - gaps = 8; - center-focused-column = "never"; - always-center-single-column = true; + touchpad = { + dwt = true; + tap = true; + tap-button-map = "left-right-middle"; + click-method = "clickfinger"; + natural-scroll = false; + }; - preset-column-widths = [ - { proportion = 0.33333; } - { proportion = 0.5; } - { proportion = 0.66667; } - { proportion = 1.0; } + focus-follows-mouse = { + enable = true; + max-scroll-amount = "0%"; + }; + + workspace-auto-back-and-forth = true; + }; + + debug = { + render-drm-device = "/dev/dri/by-path/pci-0000:00:02.0-render"; + }; + + cursor = { + theme = "Adwaita"; + size = 10; + }; + + gestures.hot-corners.enable = true; + + layout = { + gaps = 8; + center-focused-column = "never"; + always-center-single-column = true; + + preset-column-widths = [ + { proportion = 0.33333; } + { proportion = 0.5; } + { proportion = 0.66667; } + { proportion = 1.0; } + ]; + + default-column-width = { + proportion = 0.5; + }; + + shadow = { + softness = 20; + spread = 5; + offset = { + x = 0; + y = 5; + }; + }; + + focus-ring = { + width = 1; + active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; + inactive.color = "${config.programs.matugen.theme.colors.surface.default.color}"; + urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; + }; + + border = { + active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; + inactive.color = "${config.programs.matugen.theme.colors.surface.default.color}"; + urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; + }; + + shadow = { + color = "${config.programs.matugen.theme.colors.shadow.default.color}70"; + }; + + tab-indicator = { + active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; + inactive.color = "${config.programs.matugen.theme.colors.primary_container.default.color}"; + urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; + }; + + insert-hint = { + display.color = "${config.programs.matugen.theme.colors.primary.default.color}80"; + }; + }; + + hotkey-overlay.skip-at-startup = true; + + screenshot-path = "~/Documents/personal/pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; + + workspaces."01-browser" = { + name = "browser"; + }; + workspaces."02-programming" = { + name = "programming"; + }; + workspaces."03-chat" = { + name = "chat"; + }; + + window-rules = [ + { + matches = [ + { + + app-id = "firefox$"; + title = "Extension: (Bitwarden Password Manager)"; + } + ]; + open-floating = true; + open-focused = true; + block-out-from = "screen-capture"; + } + { + matches = [ + { + app-id = "firefox$"; + title = "^Picture-in-Picture$"; + } + ]; + open-floating = true; + } + + { + matches = [ { app-id = "firefox"; } ]; + open-on-workspace = "browser"; + } + + { + matches = [ + { + app-id = "org.gnome.Nautilus"; + title = "Open Files"; + } + { + app-id = "steam"; + title = "Steam Settings"; + } + { app-id = "pavucontrol"; } + ]; + open-floating = true; + } + + { + matches = [ + { app-id = "discord"; } + { app-id = "org.element.desktop"; } # TODO + { app-id = "signal"; } # TODO + ]; + open-on-workspace = "chat"; + } + + { + matches = [ + { app-id = "dev.zed.Zed"; } + ]; + open-on-workspace = "programming"; + } + + { + geometry-corner-radius = { + top-left = 8.0; + top-right = 8.0; + bottom-right = 8.0; + bottom-left = 8.0; + }; + clip-to-geometry = true; + } ]; - default-column-width = { - proportion = 0.5; - }; + spawn-at-startup = [ + { argv = [ "firefox" ]; } + { argv = [ "discord" ]; } + { argv = [ "signal-desktop" ]; } + { argv = [ "zeditor" ]; } + { + argv = [ "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" ]; + } + { + sh = '' + systemctl --user import-environment NIRI_SOCKET + systemctl --user restart kanata + ''; + } + ]; - shadow = { - softness = 20; - spread = 5; - offset = { - x = 0; - y = 5; + animations = { }; + + binds = { + "Ctrl+Alt+Delete" = { + hotkey-overlay.title = "Power menu"; + action.spawn = noctalia "sessionMenu toggle"; }; - }; - focus-ring = { - width = 1; - active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; - inactive.color = "${config.programs.matugen.theme.colors.surface.default.color}"; - urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; - }; - - border = { - active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; - inactive.color = "${config.programs.matugen.theme.colors.surface.default.color}"; - urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; - }; - - shadow = { - color = "${config.programs.matugen.theme.colors.shadow.default.color}70"; - }; - - tab-indicator = { - active.color = "${config.programs.matugen.theme.colors.primary.default.color}"; - inactive.color = "${config.programs.matugen.theme.colors.primary_container.default.color}"; - urgent.color = "${config.programs.matugen.theme.colors.error.default.color}"; - }; - - insert-hint = { - display.color = "${config.programs.matugen.theme.colors.primary.default.color}80"; - }; - }; - - hotkey-overlay.skip-at-startup = true; - - screenshot-path = "~/Documents/personal/pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; - - workspaces."01-browser" = { - name = "browser"; - }; - workspaces."02-programming" = { - name = "programming"; - }; - workspaces."03-chat" = { - name = "chat"; - }; - - window-rules = [ - { - matches = [ - { - - app-id = "firefox$"; - title = "Extension: (Bitwarden Password Manager)"; - } - ]; - open-floating = true; - open-focused = true; - block-out-from = "screen-capture"; - } - { - matches = [ - { - app-id = "firefox$"; - title = "^Picture-in-Picture$"; - } - ]; - open-floating = true; - } - - { - matches = [ { app-id = "firefox"; } ]; - open-on-workspace = "browser"; - } - - { - matches = [ - { - app-id = "org.gnome.Nautilus"; - title = "Open Files"; - } - { - app-id = "steam"; - title = "Steam Settings"; - } - { app-id = "pavucontrol"; } - ]; - open-floating = true; - } - - { - matches = [ - { app-id = "discord"; } - { app-id = "org.element.desktop"; } # TODO - { app-id = "signal"; } # TODO - ]; - open-on-workspace = "chat"; - } - - { - matches = [ - { app-id = "dev.zed.Zed"; } - ]; - open-on-workspace = "programming"; - } - - { - geometry-corner-radius = { - top-left = 8.0; - top-right = 8.0; - bottom-right = 8.0; - bottom-left = 8.0; + "Mod+P" = { + hotkey-overlay.title = "Run an Application"; + action.spawn = noctalia "launcher toggle"; }; - clip-to-geometry = true; - } - ]; - spawn-at-startup = [ - { argv = [ "firefox" ]; } - { argv = [ "discord" ]; } - { argv = [ "signal-desktop" ]; } - { argv = [ "zeditor" ]; } - { - argv = [ "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" ]; - } - { - sh = '' - systemctl --user import-environment NIRI_SOCKET - systemctl --user restart kanata - ''; - } - ]; - - animations = { }; - - binds = { - "Ctrl+Alt+Delete" = { - hotkey-overlay.title = "Power menu"; - action.spawn = noctalia "sessionMenu toggle"; - }; - - "Mod+P" = { - hotkey-overlay.title = "Run an Application"; - action.spawn = noctalia "launcher toggle"; - }; - - "Mod+L" = { - hotkey-overlay.title = "Lock the Screen"; - action.spawn = noctalia "lockScreen lock"; - }; - - "Mod+Shift+Slash".action.show-hotkey-overlay = { }; - - "Mod+Return" = { - hotkey-overlay.title = "Open a Terminal"; - action.spawn = "kitty"; - }; - - "XF86AudioRaiseVolume" = { - allow-when-locked = true; - action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; - }; - "XF86AudioLowerVolume" = { - allow-when-locked = true; - action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; - }; - "XF86AudioMute" = { - allow-when-locked = true; - action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - }; - "XF86AudioMicMute" = { - allow-when-locked = true; - action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; - }; - "XF86AudioPlay" = { - allow-when-locked = true; - action.spawn-sh = "playerctl play-pause"; - }; - "XF86AudioStop" = { - allow-when-locked = true; - action.spawn-sh = "playerctl stop"; - }; - "XF86AudioPrev" = { - allow-when-locked = true; - action.spawn-sh = "playerctl previous"; - }; - "XF86AudioNext" = { - allow-when-locked = true; - action.spawn-sh = "playerctl next"; - }; - "Mod+Period" = { - allow-when-locked = true; - action.spawn-sh = "playerctl nest"; - }; - "Mod+Comma" = { - allow-when-locked = true; - action.spawn-sh = "playerctl previous"; - }; - "Mod+Slash" = { - allow-when-locked = true; - action.spawn-sh = "playerctl play-pause"; - }; - - # TODO - "XF86MonBrightnessUp" = { - allow-when-locked = true; - action.spawn = [ - "brightnessctl" - "--device=amdgpu_bl1" - "--class=backlight" - "set" - "+10%" - ]; - }; - "XF86MonBrightnessDown" = { - allow-when-locked = true; - action.spawn = [ - "brightnessctl" - "--device=amdgpu_bl1" - "--class=backlight" - "set" - "10%-" - ]; - }; - - "Mod+Q" = { - repeat = false; - action.close-window = { }; - }; - - "Mod+Left".action.focus-column-left = { }; - "Mod+Down".action.focus-window-or-workspace-down = { }; - "Mod+Up".action.focus-window-or-workspace-up = { }; - "Mod+Right".action.focus-column-right = { }; - - "Mod+Shift+Left".action.move-column-left = { }; - "Mod+Shift+Down".action.move-window-down-or-to-workspace-down = { }; - "Mod+Shift+Up".action.move-window-up-or-to-workspace-up = { }; - "Mod+Shift+Right".action.move-column-right = { }; - - "Mod+Home".action.focus-column-first = { }; - "Mod+End".action.focus-column-last = { }; - "Mod+Shift+Home".action.move-column-to-first = { }; - "Mod+Shift+End".action.move-column-to-last = { }; - - "Mod+Ctrl+Left".action.focus-monitor-left = { }; - "Mod+Ctrl+Down".action.focus-monitor-down = { }; - "Mod+Ctrl+Up".action.focus-monitor-up = { }; - "Mod+Ctrl+Right".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+1".action.focus-workspace = 1; - "Mod+2".action.focus-workspace = 2; - "Mod+3".action.focus-workspace = 3; - "Mod+4".action.focus-workspace = 4; - "Mod+5".action.focus-workspace = 5; - "Mod+6".action.focus-workspace = 6; - "Mod+7".action.focus-workspace = 7; - "Mod+8".action.focus-workspace = 8; - "Mod+9".action.focus-workspace = 9; - "Mod+Shift+1".action.move-column-to-workspace = 1; - "Mod+Shift+2".action.move-column-to-workspace = 2; - "Mod+Shift+3".action.move-column-to-workspace = 3; - "Mod+Shift+4".action.move-column-to-workspace = 4; - "Mod+Shift+5".action.move-column-to-workspace = 5; - "Mod+Shift+6".action.move-column-to-workspace = 6; - "Mod+Shift+7".action.move-column-to-workspace = 7; - "Mod+Shift+8".action.move-column-to-workspace = 8; - "Mod+Shift+9".action.move-column-to-workspace = 9; - - "Mod+WheelScrollDown" = { - cooldown-ms = 150; - action.focus-workspace-down = { }; - }; - "Mod+WheelScrollUp" = { - cooldown-ms = 150; - action.focus-workspace-up = { }; - }; - "Mod+Shift+WheelScrollDown".action.focus-column-left = { }; - "Mod+Shift+WheelScrollUp".action.focus-column-right = { }; - - # "Mod+Shift+WheelScrollDown" = { - # cooldown-ms = 150; - # action.move-column-to-workspace-down = { }; - # }; - # "Mod+Shift+WheelScrollUp" = { - # cooldown-ms = 150; - # action.move-column-to-workspace-up = { }; - # }; - - # "Mod+WheelScrollRight".action.focus-column-right = { }; - # "Mod+WheelScrollLeft".action.focus-column-left = { }; - # "Mod+Shift+WheelScrollRight".action.move-column-right = { }; - # "Mod+Shift+WheelScrollLeft".action.move-column-left = { }; - - "Mod+BracketLeft".action.consume-or-expel-window-left = { }; - "Mod+BracketRight".action.consume-or-expel-window-right = { }; - - "Mod+Shift+BracketLeft".action.consume-window-into-column = { }; - "Mod+Shift+BracketRight".action.expel-window-from-column = { }; - - "Mod+R".action.switch-preset-column-width = { }; - "Mod+Shift+R".action.switch-preset-window-height = { }; - "Mod+Ctrl+R".action.reset-window-height = { }; - - "Mod+D".action.maximize-column = { }; - "Mod+F".action.fullscreen-window = { }; - "Mod+S".action.expand-column-to-available-width = { }; - "Mod+C".action.center-column = { }; - "Mod+Shift+C".action.center-visible-columns = { }; - - "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+E".action.toggle-window-floating = { }; - "Mod+Shift+E".action.switch-focus-between-floating-and-tiling = { }; - - "Mod+W".action.toggle-column-tabbed-display = { }; - - "Mod+Shift+S".action.screenshot = { }; - - "Mod+Escape" = { - allow-inhibiting = false; - action.toggle-keyboard-shortcuts-inhibit = { }; - }; - - "Mod+Shift+P".action.power-off-monitors = { }; - }; - }; - - programs.noctalia-shell = { - enable = true; - systemd.enable = false; - settings = { - general = { - # avatarImage = cfg.pfp; - }; - colorSchemes = { - darkMode = true; - generateTemplatesForPredefined = true; - inherit matugenSchemeType; - predefinedScheme = "Noctalia (default)"; - useWallpaperColors = true; - }; - location = { - monthBeforeDay = false; - name = "Amsterdam"; - }; - wallpaper = { - enabled = true; - setWallpaperOnAllMonitors = true; - fillMode = "crop"; - }; - appLauncher = { - enableClipboardHistory = true; - terminalCommand = "kitty -e"; - }; - sessionMenu = { - enableCountdown = true; - countdownDuration = 5000; - }; - controlCenter = { - position = "close_to_bar_button"; - shortcuts = { - left = [ - { - id = "WiFi"; - } - { - id = "Bluetooth"; - } - { - id = "PowerProfile"; - } - { - id = "KeepAwake"; - } - ]; - right = [ ]; + "Mod+L" = { + hotkey-overlay.title = "Lock the Screen"; + action.spawn = noctalia "lockScreen lock"; }; - }; - bar = { - density = "compact"; - position = "right"; - backgroundOpacity = 0.5; - widgets = { - left = [ - { - id = "ControlCenter"; - useDistroLogo = true; - } - { - id = "NotificationHistory"; - } - { - id = "plugin:catwalk"; - } - ]; - center = [ - { - hideUnoccupied = false; - id = "Workspace"; - labelMode = "none"; - } - ]; - right = [ - { - id = "Tray"; - drawerEnabled = false; - } - { - id = "WiFi"; - } - { - id = "Bluetooth"; - } - { - id = "Brightness"; - } - { - id = "Volume"; - } - ] - ++ [ { id = "Battery"; } ] - ++ [ - { - id = "KeyboardLayout"; - displayMode = "forceOpen"; - } - { - formatHorizontal = "HH:mm"; - formatVertical = "HH mm"; - id = "Clock"; - useMonospacedFont = true; - usePrimaryColor = true; - } + + "Mod+Shift+Slash".action.show-hotkey-overlay = { }; + + "Mod+Return" = { + hotkey-overlay.title = "Open a Terminal"; + action.spawn = "kitty"; + }; + + "XF86AudioRaiseVolume" = { + allow-when-locked = true; + action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; + }; + "XF86AudioLowerVolume" = { + allow-when-locked = true; + action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; + }; + "XF86AudioMute" = { + allow-when-locked = true; + action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + }; + "XF86AudioMicMute" = { + allow-when-locked = true; + action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; + }; + "XF86AudioPlay" = { + allow-when-locked = true; + action.spawn-sh = "playerctl play-pause"; + }; + "XF86AudioStop" = { + allow-when-locked = true; + action.spawn-sh = "playerctl stop"; + }; + "XF86AudioPrev" = { + allow-when-locked = true; + action.spawn-sh = "playerctl previous"; + }; + "XF86AudioNext" = { + allow-when-locked = true; + action.spawn-sh = "playerctl next"; + }; + "Mod+Period" = { + allow-when-locked = true; + action.spawn-sh = "playerctl nest"; + }; + "Mod+Comma" = { + allow-when-locked = true; + action.spawn-sh = "playerctl previous"; + }; + "Mod+Slash" = { + allow-when-locked = true; + action.spawn-sh = "playerctl play-pause"; + }; + + # TODO + "XF86MonBrightnessUp" = { + allow-when-locked = true; + action.spawn = [ + "brightnessctl" + "--device=amdgpu_bl1" + "--class=backlight" + "set" + "+10%" ]; }; + "XF86MonBrightnessDown" = { + allow-when-locked = true; + action.spawn = [ + "brightnessctl" + "--device=amdgpu_bl1" + "--class=backlight" + "set" + "10%-" + ]; + }; + + "Mod+Q" = { + repeat = false; + action.close-window = { }; + }; + + "Mod+Left".action.focus-column-left = { }; + "Mod+Down".action.focus-window-or-workspace-down = { }; + "Mod+Up".action.focus-window-or-workspace-up = { }; + "Mod+Right".action.focus-column-right = { }; + + "Mod+Shift+Left".action.move-column-left = { }; + "Mod+Shift+Down".action.move-window-down-or-to-workspace-down = { }; + "Mod+Shift+Up".action.move-window-up-or-to-workspace-up = { }; + "Mod+Shift+Right".action.move-column-right = { }; + + "Mod+Home".action.focus-column-first = { }; + "Mod+End".action.focus-column-last = { }; + "Mod+Shift+Home".action.move-column-to-first = { }; + "Mod+Shift+End".action.move-column-to-last = { }; + + "Mod+Ctrl+Left".action.focus-monitor-left = { }; + "Mod+Ctrl+Down".action.focus-monitor-down = { }; + "Mod+Ctrl+Up".action.focus-monitor-up = { }; + "Mod+Ctrl+Right".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+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+Shift+1".action.move-column-to-workspace = 1; + "Mod+Shift+2".action.move-column-to-workspace = 2; + "Mod+Shift+3".action.move-column-to-workspace = 3; + "Mod+Shift+4".action.move-column-to-workspace = 4; + "Mod+Shift+5".action.move-column-to-workspace = 5; + "Mod+Shift+6".action.move-column-to-workspace = 6; + "Mod+Shift+7".action.move-column-to-workspace = 7; + "Mod+Shift+8".action.move-column-to-workspace = 8; + "Mod+Shift+9".action.move-column-to-workspace = 9; + + "Mod+WheelScrollDown" = { + cooldown-ms = 150; + action.focus-workspace-down = { }; + }; + "Mod+WheelScrollUp" = { + cooldown-ms = 150; + action.focus-workspace-up = { }; + }; + "Mod+Shift+WheelScrollDown".action.focus-column-left = { }; + "Mod+Shift+WheelScrollUp".action.focus-column-right = { }; + + # "Mod+Shift+WheelScrollDown" = { + # cooldown-ms = 150; + # action.move-column-to-workspace-down = { }; + # }; + # "Mod+Shift+WheelScrollUp" = { + # cooldown-ms = 150; + # action.move-column-to-workspace-up = { }; + # }; + + # "Mod+WheelScrollRight".action.focus-column-right = { }; + # "Mod+WheelScrollLeft".action.focus-column-left = { }; + # "Mod+Shift+WheelScrollRight".action.move-column-right = { }; + # "Mod+Shift+WheelScrollLeft".action.move-column-left = { }; + + "Mod+BracketLeft".action.consume-or-expel-window-left = { }; + "Mod+BracketRight".action.consume-or-expel-window-right = { }; + + "Mod+Shift+BracketLeft".action.consume-window-into-column = { }; + "Mod+Shift+BracketRight".action.expel-window-from-column = { }; + + "Mod+R".action.switch-preset-column-width = { }; + "Mod+Shift+R".action.switch-preset-window-height = { }; + "Mod+Ctrl+R".action.reset-window-height = { }; + + "Mod+D".action.maximize-column = { }; + "Mod+F".action.fullscreen-window = { }; + "Mod+S".action.expand-column-to-available-width = { }; + "Mod+C".action.center-column = { }; + "Mod+Shift+C".action.center-visible-columns = { }; + + "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+E".action.toggle-window-floating = { }; + "Mod+Shift+E".action.switch-focus-between-floating-and-tiling = { }; + + "Mod+W".action.toggle-column-tabbed-display = { }; + + "Mod+Shift+S".action.screenshot = { }; + + "Mod+Escape" = { + allow-inhibiting = false; + action.toggle-keyboard-shortcuts-inhibit = { }; + }; + + "Mod+Shift+P".action.power-off-monitors = { }; }; - templates = { - gtk = true; - qt = true; - niri = true; + }; + + programs.noctalia-shell = { + enable = true; + systemd.enable = false; + settings = { + general = { + # avatarImage = cfg.pfp; + }; + colorSchemes = { + darkMode = true; + generateTemplatesForPredefined = true; + inherit matugenSchemeType; + predefinedScheme = "Noctalia (default)"; + useWallpaperColors = true; + }; + location = { + monthBeforeDay = false; + name = "Amsterdam"; + }; + wallpaper = { + enabled = true; + setWallpaperOnAllMonitors = true; + fillMode = "crop"; + }; + appLauncher = { + enableClipboardHistory = true; + terminalCommand = "kitty -e"; + }; + sessionMenu = { + enableCountdown = true; + countdownDuration = 5000; + }; + controlCenter = { + position = "close_to_bar_button"; + shortcuts = { + left = [ + { + id = "WiFi"; + } + { + id = "Bluetooth"; + } + { + id = "PowerProfile"; + } + { + id = "KeepAwake"; + } + ]; + right = [ ]; + }; + }; + bar = { + density = "compact"; + position = "right"; + backgroundOpacity = 0.5; + widgets = { + left = [ + { + id = "ControlCenter"; + useDistroLogo = true; + } + { + id = "NotificationHistory"; + } + { + id = "plugin:catwalk"; + } + ]; + center = [ + { + hideUnoccupied = false; + id = "Workspace"; + labelMode = "none"; + } + ]; + right = [ + { + id = "Tray"; + drawerEnabled = false; + } + { + id = "WiFi"; + } + { + id = "Bluetooth"; + } + { + id = "Brightness"; + } + { + id = "Volume"; + } + ] + ++ [ { id = "Battery"; } ] + ++ [ + { + id = "KeyboardLayout"; + displayMode = "forceOpen"; + } + { + formatHorizontal = "HH:mm"; + formatVertical = "HH mm"; + id = "Clock"; + useMonospacedFont = true; + usePrimaryColor = true; + } + ]; + }; + }; + templates = { + gtk = true; + qt = true; + niri = true; + }; + }; + }; + + home.file.".cache/noctalia/wallpapers.json" = { + text = builtins.toJSON { + defaultWallpaper = wallpaper; + }; + }; + + home.activation.themeFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + mkdir -p ${config.xdg.configHome}/gtk-4.0 + mkdir -p ${config.xdg.configHome}/gtk-3.0 + mkdir -p ${config.xdg.configHome}/qt5ct/colors + mkdir -p ${config.xdg.configHome}/qt6ct/colors + + touch ${config.xdg.configHome}/gtk-4.0/gtk.css + touch ${config.xdg.configHome}/gtk-3.0/gtk.css + touch ${config.xdg.configHome}/qt5ct/colors/noctalia.conf + touch ${config.xdg.configHome}/qt6ct/colors/noctalia.conf + ''; + + programs.matugen = { + enable = true; + wallpaper = wallpaper; + type = matugenSchemeType; + }; + + gtk.cursorTheme = { + package = pkgs.adwaita-icon-theme; + name = "Adwaita"; + size = 24; + }; + + dconf.settings = { + # appearance + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + enable-hot-corners = true; + gtk-enable-primary-paste = false; }; }; }; - - home.file.".cache/noctalia/wallpapers.json" = { - text = builtins.toJSON { - defaultWallpaper = wallpaper; - }; - }; - - home.activation.themeFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - mkdir -p ${config.xdg.configHome}/gtk-4.0 - mkdir -p ${config.xdg.configHome}/gtk-3.0 - mkdir -p ${config.xdg.configHome}/qt5ct/colors - mkdir -p ${config.xdg.configHome}/qt6ct/colors - - touch ${config.xdg.configHome}/gtk-4.0/gtk.css - touch ${config.xdg.configHome}/gtk-3.0/gtk.css - touch ${config.xdg.configHome}/qt5ct/colors/noctalia.conf - touch ${config.xdg.configHome}/qt6ct/colors/noctalia.conf - ''; - - programs.matugen = { - enable = true; - wallpaper = wallpaper; - type = matugenSchemeType; - }; - - gtk.cursorTheme = { - package = pkgs.adwaita-icon-theme; - name = "Adwaita"; - size = 24; - }; - - dconf.settings = { - # appearance - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - enable-hot-corners = true; - gtk-enable-primary-paste = false; - }; - }; - }; + }; } diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index b2bfdbf..8f850b2 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -1,155 +1,158 @@ -_: { - custom.program.nvim.requirements = [ "cli" ]; - custom.program.nvim.home-config = - { - pkgs, - flakes, - lib, - ... - }: - let - nvim_mime_types = [ - "application/x-zerosize" - "text/english" - "text/plain" - "text/x-makefile" - "text/x-c++hdr" - "text/x-c++src" - "text/x-chdr" - "text/x-csrc" - "text/x-java" - "text/x-moc" - "text/x-pascal" - "text/x-tcl" - "text/x-tex" - "application/x-shellscript" - "text/x-c" - "text/x-c++" - ]; - desktop-entry-name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanvim"; - desktop-entry = pkgs.makeDesktopItem { - name = desktop-entry-name; - desktopName = "neovim"; - exec = "${./editor-hax.py} %F"; - tryExec = "${./editor-hax.py}"; - terminal = false; - type = "Application"; - categories = [ - "Utility" - "TextEditor" +{ machine, ... }: +{ + custom.program.nvim = machine.program { + requirements = [ "cli" ]; + home-config = + { + pkgs, + flakes, + lib, + ... + }: + let + nvim_mime_types = [ + "application/x-zerosize" + "text/english" + "text/plain" + "text/x-makefile" + "text/x-c++hdr" + "text/x-c++src" + "text/x-chdr" + "text/x-csrc" + "text/x-java" + "text/x-moc" + "text/x-pascal" + "text/x-tcl" + "text/x-tex" + "application/x-shellscript" + "text/x-c" + "text/x-c++" ]; - icon = "terminal"; - mimeTypes = nvim_mime_types; - }; - in - { - home = { - sessionVariables = { - EDITOR = "nvim"; + desktop-entry-name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanvim"; + desktop-entry = pkgs.makeDesktopItem { + name = desktop-entry-name; + desktopName = "neovim"; + exec = "${./editor-hax.py} %F"; + tryExec = "${./editor-hax.py}"; + terminal = false; + type = "Application"; + categories = [ + "Utility" + "TextEditor" + ]; + icon = "terminal"; + mimeTypes = nvim_mime_types; }; - }; - - home.file.".local/share/applications/${desktop-entry-name}.desktop" = { - source = "${desktop-entry}/share/applications/${desktop-entry-name}.desktop"; - }; - - xdg.mimeApps.associations.added = lib.mergeAttrsList ( - map (mime: { - ${mime} = [ "${desktop-entry-name}.desktop" ]; - }) nvim_mime_types - ); - - imports = [ - flakes.nixvim.homeModules.nixvim - ./options.nix - ./plugins.nix - ./keys.nix - ]; - - programs.nixvim = { - enable = true; - globals.mapleader = " "; - globals.maplocalleader = " "; - - viAlias = true; - vimAlias = true; - - # Highlight and remove extra white spaces - # same color as cursorline as per - # https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim - highlight.ExtraWhitespace.bg = "#2C323C"; - match.ExtraWhitespace = "\\s\\+$"; - - clipboard.providers.wl-copy.enable = true; - - performance = { - byteCompileLua.enable = true; - combinePlugins = { - enable = true; - - standalonePlugins = [ - # clashes with lualine - "onedark.nvim" - ]; + in + { + home = { + sessionVariables = { + EDITOR = "nvim"; }; }; - extraLuaPackages = ps: [ ps.magick ]; - extraPackages = [ pkgs.imagemagick ]; + home.file.".local/share/applications/${desktop-entry-name}.desktop" = { + source = "${desktop-entry}/share/applications/${desktop-entry-name}.desktop"; + }; - # package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped; - package = pkgs.neovim-unwrapped; + xdg.mimeApps.associations.added = lib.mergeAttrsList ( + map (mime: { + ${mime} = [ "${desktop-entry-name}.desktop" ]; + }) nvim_mime_types + ); - colorschemes.onedark = { + imports = [ + flakes.nixvim.homeModules.nixvim + ./options.nix + ./plugins.nix + ./keys.nix + ]; + + programs.nixvim = { enable = true; - settings = { - style = "deep"; + globals.mapleader = " "; + globals.maplocalleader = " "; - highlights = { - # bright green doccomments - "@lsp.type.comment".fg = "#77B767"; - "@comment.documentation.rust".fg = "#77B767"; - "@comment.documentation".fg = "#77B767"; - "@comment".fg = "#426639"; - # "Visual".bg = "#2a2e36"; - # "Cursorline".bg = "#2a2e36"; + viAlias = true; + vimAlias = true; + + # Highlight and remove extra white spaces + # same color as cursorline as per + # https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim + highlight.ExtraWhitespace.bg = "#2C323C"; + match.ExtraWhitespace = "\\s\\+$"; + + clipboard.providers.wl-copy.enable = true; + + performance = { + byteCompileLua.enable = true; + combinePlugins = { + enable = true; + + standalonePlugins = [ + # clashes with lualine + "onedark.nvim" + ]; }; - }; + + extraLuaPackages = ps: [ ps.magick ]; + extraPackages = [ pkgs.imagemagick ]; + + # package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped; + package = pkgs.neovim-unwrapped; + + colorschemes.onedark = { + enable = true; + settings = { + style = "deep"; + + highlights = { + # bright green doccomments + "@lsp.type.comment".fg = "#77B767"; + "@comment.documentation.rust".fg = "#77B767"; + "@comment.documentation".fg = "#77B767"; + "@comment".fg = "#426639"; + # "Visual".bg = "#2a2e36"; + # "Cursorline".bg = "#2a2e36"; + }; + + }; + }; + + extraConfigLuaPre = '' + require("neoconf").setup({}) + ''; + extraConfigLua = '' + require("render-markdown").setup { + latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text', + } + '' + + # local lspconfig = require 'lspconfig' + # local configs = require 'lspconfig.configs' + # if not configs.foo_lsp then + # configs.noteslsp = { + # default_config = { + # -- cmd = {'${pkgs.custom.noteslsp}/bin/noteslsp'}, + # cmd = {'./noteslsp/target/debug/noteslsp'}, + # filetypes = {'markdown'}, + # root_dir = function(fname) + # return lspconfig.util.find_git_ancestor(fname) + # end, + # settings = {} + # , + # }, + # } + # end + # + # lspconfig.noteslsp.setup{} + # '' + + (builtins.readFile ./config.lua); + extraConfigLuaPost = '' + + ''; }; - - extraConfigLuaPre = '' - require("neoconf").setup({}) - ''; - extraConfigLua = '' - require("render-markdown").setup { - latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text', - } - '' - - # local lspconfig = require 'lspconfig' - # local configs = require 'lspconfig.configs' - # if not configs.foo_lsp then - # configs.noteslsp = { - # default_config = { - # -- cmd = {'${pkgs.custom.noteslsp}/bin/noteslsp'}, - # cmd = {'./noteslsp/target/debug/noteslsp'}, - # filetypes = {'markdown'}, - # root_dir = function(fname) - # return lspconfig.util.find_git_ancestor(fname) - # end, - # settings = {} - # , - # }, - # } - # end - # - # lspconfig.noteslsp.setup{} - # '' - + (builtins.readFile ./config.lua); - extraConfigLuaPost = '' - - ''; }; - }; + }; } diff --git a/programs/tmux/default.nix b/programs/tmux/default.nix index dc6d148..d00d05a 100644 --- a/programs/tmux/default.nix +++ b/programs/tmux/default.nix @@ -1,202 +1,205 @@ -_: { - custom.program.tmux.requirements = [ "cli" ]; - custom.program.tmux.home-config = - { pkgs, ... }: - { - programs.tmux = { - enable = true; - mouse = true; - clock24 = true; +{ machine, ... }: +{ + custom.program.tmux = machine.program { + requirements = [ "cli" ]; + home-config = + { pkgs, ... }: + { + programs.tmux = { + enable = true; + mouse = true; + clock24 = true; - shortcut = "k"; + shortcut = "k"; - plugins = with pkgs; [ - { - plugin = tmuxPlugins.mkTmuxPlugin { - pluginName = "suspend"; - version = "1a2f806"; - src = pkgs.fetchFromGitHub { - owner = "MunifTanjim"; - repo = "tmux-suspend"; - rev = "1a2f806666e0bfed37535372279fa00d27d50d14"; - sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv"; + plugins = with pkgs; [ + { + plugin = tmuxPlugins.mkTmuxPlugin { + pluginName = "suspend"; + version = "1a2f806"; + src = pkgs.fetchFromGitHub { + owner = "MunifTanjim"; + repo = "tmux-suspend"; + rev = "1a2f806666e0bfed37535372279fa00d27d50d14"; + sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv"; + }; }; - }; - extraConfig = '' - set -g @suspend_key 'F11' - ''; - } - { - plugin = tmuxPlugins.mode-indicator; - } - ]; + extraConfig = '' + set -g @suspend_key 'F11' + ''; + } + { + plugin = tmuxPlugins.mode-indicator; + } + ]; - extraConfig = '' - # unbind every single normal keybinding - unbind-key -a + extraConfig = '' + # unbind every single normal keybinding + unbind-key -a - set -g status-left "#{?client_prefix,#[bg=colour2],#[bg=colour1]}#[fg=colour0] #S " + set -g status-left "#{?client_prefix,#[bg=colour2],#[bg=colour1]}#[fg=colour0] #S " - # for special characters to work right - # like - # set-window-option -g xterm-keys on - set -g default-terminal "screen-256color" + # for special characters to work right + # like + # set-window-option -g xterm-keys on + set -g default-terminal "screen-256color" - set -g set-titles on - set -g allow-passthrough on - set -s escape-time 0 + set -g set-titles on + set -g allow-passthrough on + set -s escape-time 0 - set-option -g default-shell ${pkgs.fish}/bin/fish - set -ga terminal-features "\*:hyperlinks" + set-option -g default-shell ${pkgs.fish}/bin/fish + set -ga terminal-features "\*:hyperlinks" - set-window-option -g mode-keys vi + set-window-option -g mode-keys vi - # clipboard stuff - bind -T copy-mode-vi v send-keys -X begin-selection - bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel - bind v copy-mode - bind p paste-buffer -p - set -s set-clipboard on + # clipboard stuff + bind -T copy-mode-vi v send-keys -X begin-selection + bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel + bind v copy-mode + bind p paste-buffer -p + set -s set-clipboard on - # get back normal terminal emulator bindings - bind-key -n S-PPage copy-mode -u - bind-key -T copy-mode -n S-NPage send-keys -X page-down + # get back normal terminal emulator bindings + bind-key -n S-PPage copy-mode -u + bind-key -T copy-mode -n S-NPage send-keys -X page-down - # don't scroll to end when copying with mouse - bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe - bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe - bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe - bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe - bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe - bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe + # don't scroll to end when copying with mouse + bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe + bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe + bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe + bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe + bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe + bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe - # window control - bind t new-window -c "#{pane_current_path}" - bind-key Tab next-window - bind-key BTab previous-window - set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})" - set -g renumber-windows on - bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window - bind A last-window + # window control + bind t new-window -c "#{pane_current_path}" + bind-key Tab next-window + bind-key BTab previous-window + set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})" + set -g renumber-windows on + bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window + bind A last-window - bind-key 1 select-window -t :0 - bind-key 2 select-window -t :1 - bind-key 3 select-window -t :2 - bind-key 4 select-window -t :3 - bind-key 5 select-window -t :4 - bind-key 6 select-window -t :5 - bind-key 7 select-window -t :6 - bind-key 8 select-window -t :7 - bind-key 9 select-window -t :8 - bind-key 0 select-window -t :9 + bind-key 1 select-window -t :0 + bind-key 2 select-window -t :1 + bind-key 3 select-window -t :2 + bind-key 4 select-window -t :3 + bind-key 5 select-window -t :4 + bind-key 6 select-window -t :5 + bind-key 7 select-window -t :6 + bind-key 8 select-window -t :7 + bind-key 9 select-window -t :8 + bind-key 0 select-window -t :9 - # pane control - bind h select-pane -L - bind j select-pane -D - bind k select-pane -U - bind l select-pane -R - bind Left select-pane -L - bind Down select-pane -D - bind Up select-pane -U - bind Right select-pane -R - bind L split-window -h -c "#{pane_current_path}" - bind J split-window -v -c "#{pane_current_path}" - bind H split-window -h -b -c "#{pane_current_path}" - bind K split-window -v -b -c "#{pane_current_path}" - bind S-Left split-window -h -c "#{pane_current_path}" - bind S-Down split-window -v -c "#{pane_current_path}" - bind S-Up split-window -h -b -c "#{pane_current_path}" - bind S-Right split-window -v -b -c "#{pane_current_path}" - bind-key -r -T prefix M-h resize-pane -L 5 - bind-key -r -T prefix M-j resize-pane -D 5 - bind-key -r -T prefix M-k resize-pane -U 5 - bind-key -r -T prefix M-l resize-pane -R 5 - bind x swap-pane -D + # pane control + bind h select-pane -L + bind j select-pane -D + bind k select-pane -U + bind l select-pane -R + bind Left select-pane -L + bind Down select-pane -D + bind Up select-pane -U + bind Right select-pane -R + bind L split-window -h -c "#{pane_current_path}" + bind J split-window -v -c "#{pane_current_path}" + bind H split-window -h -b -c "#{pane_current_path}" + bind K split-window -v -b -c "#{pane_current_path}" + bind S-Left split-window -h -c "#{pane_current_path}" + bind S-Down split-window -v -c "#{pane_current_path}" + bind S-Up split-window -h -b -c "#{pane_current_path}" + bind S-Right split-window -v -b -c "#{pane_current_path}" + bind-key -r -T prefix M-h resize-pane -L 5 + bind-key -r -T prefix M-j resize-pane -D 5 + bind-key -r -T prefix M-k resize-pane -U 5 + bind-key -r -T prefix M-l resize-pane -R 5 + bind x swap-pane -D - # double-click ^k (or lshift with kanata) for previous pane like ^w in vim - bind -r ^k select-pane -l - bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane + # double-click ^k (or lshift with kanata) for previous pane like ^w in vim + bind -r ^k select-pane -l + bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane - # bind-key o choose-tree -wZ - # bind-key O choose-tree -sZ + # bind-key o choose-tree -wZ + # bind-key O choose-tree -sZ - # get back command mode and some other basics... - bind : command-prompt - bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded" - bind-key ? list-keys + # get back command mode and some other basics... + bind : command-prompt + bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded" + bind-key ? list-keys - # Scroll oin man etc - tmux_commands_with_legacy_scroll="nano less more man git" + # Scroll oin man etc + tmux_commands_with_legacy_scroll="nano less more man git" - bind-key -T root WheelUpPane \ - if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \ - 'send -Mt=' \ - 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ - "send -t= Up" "copy-mode -et="' + bind-key -T root WheelUpPane \ + if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \ + 'send -Mt=' \ + 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ + "send -t= Up" "copy-mode -et="' - bind-key -T root WheelDownPane \ - if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \ - 'send -Mt=' \ - 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ - "send -t= Down" "send -Mt="' + bind-key -T root WheelDownPane \ + if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \ + 'send -Mt=' \ + 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ + "send -t= Down" "send -Mt="' - bind-key -T copy-mode-vi ] \ - send-keys -X clear-selection \; \ - send-keys -X search-forward "--> " \; \ - send-keys -X next-word \; \ - send-keys -X begin-selection \; \ - send-keys -X jump-forward ":" \; \ - send-keys -X jump-to-forward ":" \; + bind-key -T copy-mode-vi ] \ + send-keys -X clear-selection \; \ + send-keys -X search-forward "--> " \; \ + send-keys -X next-word \; \ + send-keys -X begin-selection \; \ + send-keys -X jump-forward ":" \; \ + send-keys -X jump-to-forward ":" \; - bind-key -T copy-mode-vi [ \ - send-keys -X clear-selection \; \ - send-keys -X start-of-line \; \ - send-keys -X search-backward "--> " \; \ - send-keys -X next-word \; \ - send-keys -X begin-selection \; \ - send-keys -X jump-forward ":" \; \ - send-keys -X jump-to-forward ":" \; + bind-key -T copy-mode-vi [ \ + send-keys -X clear-selection \; \ + send-keys -X start-of-line \; \ + send-keys -X search-backward "--> " \; \ + send-keys -X next-word \; \ + send-keys -X begin-selection \; \ + send-keys -X jump-forward ":" \; \ + send-keys -X jump-to-forward ":" \; - bind-key [ copy-mode \; send-keys [ - bind-key ] copy-mode \; send-keys ] + bind-key [ copy-mode \; send-keys [ + bind-key ] copy-mode \; send-keys ] - bind d select-pane -l \; send-keys [ + bind d select-pane -l \; send-keys [ - # f: file search - # unbound: git files - # g: git hashes - # u: urls - # C-d: numbers - # M-i: ips - # include line and column numbers in file search - # rebind `f` so we can reuse it here - bind-key -T prefix C-f command-prompt { find-window -Z "%%" } - # jyn is so sorry, and so am I now - # https://github.com/jyn514/dotfiles/blob/65be3c004113290f41f858f4d7f1a6799fabab19/config/tmux.conf#L203-L212 - # see `search-regex.sh` for wtf this means - # TODO: include shell variable names - bind-key f copy-mode \; send-keys -X search-backward '(^|/|\<|[[:space:]"])((\.|\.\.)|[[:alnum:]~_"-]*)((/[][[:alnum:]_.#$%&+=@"-]+)+([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)|(/[][[:alnum:]_.#$%&+=@"-]+){2,}([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)?|(\.|\.\.)/([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?))' - # urls - bind-key u copy-mode \; send-keys -X search-backward '(https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&*+-]*' - # hashes - bind-key g copy-mode \; send-keys -X search-backward '[[:<:]]([0-9a-f]{7,40}|[[:alnum:]]{52}|[0-9a-f]{64})[[:>:]]' - # ips - bind-key M-i copy-mode \; send-keys -X search-backward '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' + # f: file search + # unbound: git files + # g: git hashes + # u: urls + # C-d: numbers + # M-i: ips + # include line and column numbers in file search + # rebind `f` so we can reuse it here + bind-key -T prefix C-f command-prompt { find-window -Z "%%" } + # jyn is so sorry, and so am I now + # https://github.com/jyn514/dotfiles/blob/65be3c004113290f41f858f4d7f1a6799fabab19/config/tmux.conf#L203-L212 + # see `search-regex.sh` for wtf this means + # TODO: include shell variable names + bind-key f copy-mode \; send-keys -X search-backward '(^|/|\<|[[:space:]"])((\.|\.\.)|[[:alnum:]~_"-]*)((/[][[:alnum:]_.#$%&+=@"-]+)+([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)|(/[][[:alnum:]_.#$%&+=@"-]+){2,}([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)?|(\.|\.\.)/([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?))' + # urls + bind-key u copy-mode \; send-keys -X search-backward '(https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&*+-]*' + # hashes + bind-key g copy-mode \; send-keys -X search-backward '[[:<:]]([0-9a-f]{7,40}|[[:alnum:]]{52}|[0-9a-f]{64})[[:>:]]' + # ips + bind-key M-i copy-mode \; send-keys -X search-backward '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' - bind-key -T copy-mode-vi o send-keys -X copy-pipe \ - 'cd #{pane_current_path}; xargs -I {} echo "echo {}" | bash | xargs ${../nvim/editor-hax.py} xdg-open-proxy' \; \ - if -F "#{alternate_on}" { send-keys -X cancel } - # save the buffer, then open an editor in the current pane - bind-key -T copy-mode-vi O send-keys -X copy-pipe-and-cancel \ - 'tmux send-keys "C-q"; xargs -I {} tmux send-keys "vim {}"; tmux send-keys "C-m"' - # search for the highlighted text - bind-key -T copy-mode-vi s send-keys -X copy-pipe \ - "cd #{pane_current_path}; xargs -I {} open 'https://www.google.com/search?q={}'" \; \ - if -F "#{alternate_on}" { send-keys -X cancel } - # save buffer and retype into the shell - bind-key -T copy-mode-vi Tab send-keys -X copy-selection-and-cancel \; paste-buffer -p + bind-key -T copy-mode-vi o send-keys -X copy-pipe \ + 'cd #{pane_current_path}; xargs -I {} echo "echo {}" | bash | xargs ${../nvim/editor-hax.py} xdg-open-proxy' \; \ + if -F "#{alternate_on}" { send-keys -X cancel } + # save the buffer, then open an editor in the current pane + bind-key -T copy-mode-vi O send-keys -X copy-pipe-and-cancel \ + 'tmux send-keys "C-q"; xargs -I {} tmux send-keys "vim {}"; tmux send-keys "C-m"' + # search for the highlighted text + bind-key -T copy-mode-vi s send-keys -X copy-pipe \ + "cd #{pane_current_path}; xargs -I {} open 'https://www.google.com/search?q={}'" \; \ + if -F "#{alternate_on}" { send-keys -X cancel } + # save buffer and retype into the shell + bind-key -T copy-mode-vi Tab send-keys -X copy-selection-and-cancel \; paste-buffer -p - ''; + ''; + }; }; - }; + }; } diff --git a/programs/zed/default.nix b/programs/zed/default.nix index f028d5a..d47f4ca 100644 --- a/programs/zed/default.nix +++ b/programs/zed/default.nix @@ -1,176 +1,182 @@ -_: { - custom.program.zed.requirements = [ "work" ]; - custom.program.zed.home-config = - { pkgs, ... }: - { - home.packages = pkgs.custom.maple-fonts-pack; +{ machine, ... }: +{ + custom.program.zed = machine.program { + requirements = [ + "work" + "graphical" + ]; + home-config = + { pkgs, ... }: + { + home.packages = pkgs.custom.maple-fonts-pack; - programs.zed-editor = { - enable = true; - extensions = [ - "nix" - "intellij-newui-theme" - "charmed-icons" - "astro" - ]; - userSettings = { - - ssh_connections = [ - { - host = "icecube"; - args = [ ]; - projects = [ - { - paths = [ - "/home/jana/src/eii-test" - ]; - } - { - paths = [ - "/home/jana/src/example" - ]; - } - { - paths = [ - "/home/jana/src/fitgirl-ddl" - ]; - } - { - paths = [ - "/home/jana/src/libs-team/tools/unstable-api" - ]; - } - { - paths = [ - "/home/jana/src/ml-kem-hang" - ]; - } - { - paths = [ - "/home/jana/src/opendal/core" - ]; - } - { - paths = [ - "/home/jana/src/rust" - ]; - } - { - paths = [ - "/home/jana/src/span-lowering-tests" - ]; - } - ]; - } + programs.zed-editor = { + enable = true; + extensions = [ + "nix" + "intellij-newui-theme" + "charmed-icons" + "astro" ]; - icon_theme = "Warm Charmed Icons"; - ui_font_size = 16; - buffer_font_size = 16; - theme = { - mode = "system"; - light = "One Light"; - dark = "JetBrains New Dark"; - }; - disable_ai = true; + userSettings = { - preview_tabs = { - enabled = true; - enable_preview_from_file_finder = true; - }; - - close_on_file_delete = true; - confirm_quit = true; - - edit_predictions_disabled_in = [ - "comment" - "string" - ]; - - vim_mode = true; - cursor_blink = false; - vertical_scroll_margin = 0; - - inlay_hints = { - enabled = true; - }; - - project_panel = { - dock = "right"; - git_status = false; - }; - minimap = { - show = "auto"; - thumb = "always"; - thumb_border = "left_open"; - }; - tab_bar = { - show = true; - show_nav_history_buttons = false; - show_tab_bar_buttons = false; - }; - tabs = { - file_icons = true; - git_status = false; - activate_on_close = "history"; - show_close_button = "hover"; - }; - lsp = { - rust-analyzer = { - initialization_options = { - inlayHints = { - lifetimeElisionHints = "always"; - discriminantHints = "always"; - }; - diagnostic = { - refreshSupport = true; - }; - }; - binary = { - path_lookup = true; - }; + ssh_connections = [ + { + host = "icecube"; + args = [ ]; + projects = [ + { + paths = [ + "/home/jana/src/eii-test" + ]; + } + { + paths = [ + "/home/jana/src/example" + ]; + } + { + paths = [ + "/home/jana/src/fitgirl-ddl" + ]; + } + { + paths = [ + "/home/jana/src/libs-team/tools/unstable-api" + ]; + } + { + paths = [ + "/home/jana/src/ml-kem-hang" + ]; + } + { + paths = [ + "/home/jana/src/opendal/core" + ]; + } + { + paths = [ + "/home/jana/src/rust" + ]; + } + { + paths = [ + "/home/jana/src/span-lowering-tests" + ]; + } + ]; + } + ]; + icon_theme = "Warm Charmed Icons"; + ui_font_size = 16; + buffer_font_size = 16; + theme = { + mode = "system"; + light = "One Light"; + dark = "JetBrains New Dark"; }; - nil = { - binary = { - ignore_system_version = false; - path = "${pkgs.lib.getExe' pkgs.nil "nil"}"; - }; + disable_ai = true; - initialization_options = { - formatting = { - command = [ "${pkgs.lib.getExe' pkgs.nixfmt "nixfmt"}" ]; - }; - }; + preview_tabs = { + enabled = true; + enable_preview_from_file_finder = true; }; - }; - diagnostics = { - button = false; - include_warnings = true; - inline = { + + close_on_file_delete = true; + confirm_quit = true; + + edit_predictions_disabled_in = [ + "comment" + "string" + ]; + + vim_mode = true; + cursor_blink = false; + vertical_scroll_margin = 0; + + inlay_hints = { enabled = true; }; - }; - terminal = { - "dock" = "left"; - "env" = { - # "EDITOR": "zeditor --wait" - "EDITOR" = "vim"; + + project_panel = { + dock = "right"; + git_status = false; }; - "font_size" = 12; - "font_family" = "Maple Mono NF"; - "line_height" = "standard"; - }; - buffer_font_family = "Maple Mono NF"; + minimap = { + show = "auto"; + thumb = "always"; + thumb_border = "left_open"; + }; + tab_bar = { + show = true; + show_nav_history_buttons = false; + show_tab_bar_buttons = false; + }; + tabs = { + file_icons = true; + git_status = false; + activate_on_close = "history"; + show_close_button = "hover"; + }; + lsp = { + rust-analyzer = { + initialization_options = { + inlayHints = { + lifetimeElisionHints = "always"; + discriminantHints = "always"; + }; + diagnostic = { + refreshSupport = true; + }; + }; + binary = { + path_lookup = true; + }; + }; + nil = { + binary = { + ignore_system_version = false; + path = "${pkgs.lib.getExe' pkgs.nil "nil"}"; + }; - # "diagnostics_max_severity": "off", + initialization_options = { + formatting = { + command = [ "${pkgs.lib.getExe' pkgs.nixfmt "nixfmt"}" ]; + }; + }; + }; + }; + diagnostics = { + button = false; + include_warnings = true; + inline = { + enabled = true; + }; + }; + terminal = { + "dock" = "left"; + "env" = { + # "EDITOR": "zeditor --wait" + "EDITOR" = "vim"; + }; + "font_size" = 12; + "font_family" = "Maple Mono NF"; + "line_height" = "standard"; + }; + buffer_font_family = "Maple Mono NF"; - "experimental.theme_overrides" = { - "syntax" = { - "comment.doc" = { - "color" = "#77B767"; + # "diagnostics_max_severity": "off", + + "experimental.theme_overrides" = { + "syntax" = { + "comment.doc" = { + "color" = "#77B767"; + }; }; }; }; }; }; - }; + }; } diff --git a/users/default.nix b/users/default.nix index 8b87d45..bde2b12 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1,9 +1,8 @@ -{ pkgs, inputs, ... }: +{ pkgs, ... }: { imports = [ - (inputs.self + /modules/users.nix) + (../modules/users.nix) ]; - users.groups.media = { }; custom.users = { vivian = { From d9d4e43c35987ae4fdba307ce3357c940936bde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Sun, 15 Mar 2026 17:57:07 +0100 Subject: [PATCH 9/9] finally share with ragdoll --- config.nix | 27 +- defaults/machine-config.nix | 1 - hosts/fili/services/factorio/default.nix | 2 +- modules/program.nix | 28 +- modules/users.nix | 2 +- programs/default.nix | 425 ++++++++++++----------- programs/firefox/default.nix | 6 +- programs/fish/default.nix | 7 +- programs/git/default.nix | 6 +- programs/jj/default.nix | 6 +- programs/kanata/default.nix | 6 +- programs/kitty/default.nix | 6 +- programs/niri/default.nix | 21 +- programs/nvim/default.nix | 6 +- programs/tmux/default.nix | 6 +- {defaults => programs}/xdg.nix | 25 +- programs/zed/default.nix | 6 +- 17 files changed, 310 insertions(+), 276 deletions(-) rename {defaults => programs}/xdg.nix (91%) diff --git a/config.nix b/config.nix index 22f414e..53750c1 100644 --- a/config.nix +++ b/config.nix @@ -33,19 +33,28 @@ rec { requirements: lib.all (req: builtins.elem req capabilities) requirements; program = { + inputs, + name, requirements ? [ ], home-config, - system-config ? { }, + system-config ? (_: { }), }: - # if (matches-capabilities requirements) then - if (true) then - { - inherit home-config system-config; - } + if (matches-capabilities requirements) then + [ (if builtins.isNull home-only then (system-config inputs) else (home-config inputs)) ] + ++ + + ( + if builtins.isNull home-only then + [ + (_: { + custom.program.${name}.defered-config = home-config; + }) + ] + else + [ ] + ) else - { - # home-config = _: { }; - }; + [ ]; specialArgsForHomeSystem = { system, diff --git a/defaults/machine-config.nix b/defaults/machine-config.nix index 5ff6d5f..4bb2850 100644 --- a/defaults/machine-config.nix +++ b/defaults/machine-config.nix @@ -8,7 +8,6 @@ { imports = [ ./machine-or-home-config.nix - ./xdg.nix ]; system.stateVersion = machine.stateVersion; diff --git a/hosts/fili/services/factorio/default.nix b/hosts/fili/services/factorio/default.nix index 7ad9399..80815ba 100644 --- a/hosts/fili/services/factorio/default.nix +++ b/hosts/fili/services/factorio/default.nix @@ -61,7 +61,7 @@ let }; privateUsers = "no"; - config = + imports = { config, pkgs, diff --git a/modules/program.nix b/modules/program.nix index dad5d18..f843d1a 100644 --- a/modules/program.nix +++ b/modules/program.nix @@ -1,4 +1,4 @@ -{ +inputs@{ lib, options, machine, @@ -9,24 +9,16 @@ with lib; options = { custom.program = mkOption { type = types.attrsOf ( - types.submodule ( - { config, ... }: - { - options = { - name = mkOption { - type = types.string; - }; - home-config = mkOption { - type = types.deferredModule; - }; - system-config = mkOption { - type = types.deferredModule; - default = _: { }; - }; + types.submodule (_: { + options = { + name = mkOption { + type = types.string; }; - config = if builtins.isNull machine.home-only then config.system-config else config.home-config; - } - ) + defered-config = mkOption { + type = types.deferredModule; + }; + }; + }) ); }; }; diff --git a/modules/users.nix b/modules/users.nix index aea828d..1590821 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -106,7 +106,7 @@ in imports = ( [ ] - ++ (map (program: program.home-config) programs) + ++ (map (program: program.defered-config) programs) ); home = { inherit stateVersion; diff --git a/programs/default.nix b/programs/default.nix index 4c94d65..fb72b37 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -1,230 +1,241 @@ -{ machine, ... }@inputs: +{ machine, lib, ... }@inputs: { - imports = [ - ./nvim - ./fish - ./kanata - ./kitty - ./tmux - ./git - ./jj - ./niri - ./zed - ./firefox - ]; - custom.program.graphcial-packages = machine.program { - requirements = [ "graphical" ]; - home-config = - { pkgs, ... }: - { - home.packages = with pkgs; [ - spotify - obsidian - element-desktop - # chromium - bind.dnsutils - mpv - vlc - libreoffice-qt - hunspell - hunspellDicts.en_US - ]; - }; - }; + imports = lib.concatLists [ + [ + ./xdg.nix + ./nvim + ./fish + ./kanata + ./kitty + ./tmux + ./git + ./jj + ./niri + ./zed + ./firefox + ] - custom.program.discord = machine.program { - requirements = [ "graphical" ]; - home-config = - { - config, - pkgs, - lib, - ... - }: - let - disableFeatures = [ - "WebRtcAllowInputVolumeAdjustment" - "ChromeWideEchoCancellation" - ]; - enableFeatures = [ ]; - commandLineArgs = - lib.optionals (enableFeatures != [ ]) [ - "--enable-features=${lib.concatStringsSep "," enableFeatures}" - ] - ++ lib.optionals (disableFeatures != [ ]) [ - "--disable-features=${lib.concatStringsSep "," disableFeatures}" + (machine.program { + name = "graphcial-packages"; + inherit inputs; + requirements = [ "graphical" ]; + home-config = + { pkgs, ... }: + { + home.packages = with pkgs; [ + spotify + obsidian + element-desktop + # chromium + bind.dnsutils + mpv + vlc + libreoffice-qt + hunspell + hunspellDicts.en_US ]; - joinedArgs = lib.concatStringsSep " " commandLineArgs; - in - { - home.file."${config.xdg.configHome}/discord/settings.json".source = pkgs.writeText "settings.json" ( - lib.strings.toJSON ( - let - endpoint = "https://inject.shelter.uwu.network/shelter+yt_ad_block+yt_embed_fix"; - in - { - SKIP_HOST_UPDATE = true; - MINIMIZE_TO_TRAY = false; - OPEN_ON_STARTUP = false; - DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING = true; - enableHardwareAcceleration = true; - UPDATE_ENDPOINT = endpoint; - NEW_UPDATE_ENDPOINT = "${endpoint}/"; - BACKGROUND_COLOR = "#2c2d32"; + }; + }) - openasar = { - setup = true; - # using the performance preset breaks vaapi - cmdPreset = "balanced"; - # quickstart is buggy and breaks discord sometimes. - quickstart = false; - # this css is made for discord compact mode. if you're not using that, stuff won't align!! - css = - # css - '' - /* Hide nitro begging */ - @import url("https://raw.codeberg.page/AllPurposeMat/Disblock-Origin/DisblockOrigin.theme.css"); + (machine.program { + name = "discord"; + inherit inputs; + requirements = [ "graphical" ]; + home-config = + { + config, + pkgs, + lib, + ... + }: + let + disableFeatures = [ + "WebRtcAllowInputVolumeAdjustment" + "ChromeWideEchoCancellation" + ]; + enableFeatures = [ ]; + commandLineArgs = + lib.optionals (enableFeatures != [ ]) [ + "--enable-features=${lib.concatStringsSep "," enableFeatures}" + ] + ++ lib.optionals (disableFeatures != [ ]) [ + "--disable-features=${lib.concatStringsSep "," disableFeatures}" + ]; + joinedArgs = lib.concatStringsSep " " commandLineArgs; + in + { + home.file."${config.xdg.configHome}/discord/settings.json".source = pkgs.writeText "settings.json" ( + lib.strings.toJSON ( + let + endpoint = "https://inject.shelter.uwu.network/shelter+yt_ad_block+yt_embed_fix"; + in + { + SKIP_HOST_UPDATE = true; + MINIMIZE_TO_TRAY = false; + OPEN_ON_STARTUP = false; + DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING = true; + enableHardwareAcceleration = true; + UPDATE_ENDPOINT = endpoint; + NEW_UPDATE_ENDPOINT = "${endpoint}/"; + BACKGROUND_COLOR = "#2c2d32"; - /* Hide the Visual Refresh title bar */ - .visual-refresh { - /* Hide the bar itself */ - --custom-app-top-bar-height: 0px !important; + openasar = { + setup = true; + # using the performance preset breaks vaapi + cmdPreset = "balanced"; + # quickstart is buggy and breaks discord sometimes. + quickstart = false; + # this css is made for discord compact mode. if you're not using that, stuff won't align!! + css = + # css + '' + /* Hide nitro begging */ + @import url("https://raw.codeberg.page/AllPurposeMat/Disblock-Origin/DisblockOrigin.theme.css"); - /* Title bar buttons are still visible so hide them too */ - div.base__5e434 > div.bar_c38106 { - display: none; + /* Hide the Visual Refresh title bar */ + .visual-refresh { + /* Hide the bar itself */ + --custom-app-top-bar-height: 0px !important; + + /* Title bar buttons are still visible so hide them too */ + div.base__5e434 > div.bar_c38106 { + display: none; + } + + /* Bring the server list down a few pixels */ + ul[data-list-id="guildsnav"] > div.itemsContainer_ef3116 { + margin-top: 8px; + } } - /* Bring the server list down a few pixels */ - ul[data-list-id="guildsnav"] > div.itemsContainer_ef3116 { - margin-top: 8px; + :root { + /* Disblock settings */ + --display-clan-tags: none; + --display-active-now: none; + --display-hover-reaction-emoji: none; + --bool-show-name-gradients: false; } - } - :root { - /* Disblock settings */ - --display-clan-tags: none; - --display-active-now: none; - --display-hover-reaction-emoji: none; - --bool-show-name-gradients: false; - } + /* Make "Read All" vencord button text smaller */ + button.vc-ranb-button { + font-size: 9.5pt; + font-weight: normal; + } - /* Make "Read All" vencord button text smaller */ - button.vc-ranb-button { - font-size: 9.5pt; - font-weight: normal; - } + /* Hide Discover button */ + div[data-list-item-id="guildsnav___guild-discover-button"] { + display: none !important; + } - /* Hide Discover button */ - div[data-list-item-id="guildsnav___guild-discover-button"] { - display: none !important; - } + /* Hide voice settings menus in user panel */ + div[class^="micButtonParent__"] button[role="switch"] { + border-radius: var(--radius-sm); + & ~ button { display: none; } + } + /* Also reduce the gap between the buttons */ + div.container__37e49 > div.buttons__37e49 { + gap: 1px; + } + ''; + }; + } + ) + ); - /* Hide voice settings menus in user panel */ - div[class^="micButtonParent__"] button[role="switch"] { - border-radius: var(--radius-sm); - & ~ button { display: none; } - } - /* Also reduce the gap between the buttons */ - div.container__37e49 > div.buttons__37e49 { - gap: 1px; - } - ''; - }; - } - ) - ); + home.packages = with pkgs; [ + (discord.override { + # we disable updates in settings.json + disableUpdates = false; + commandLineArgs = joinedArgs; + withTTS = false; + enableAutoscroll = true; + withOpenASAR = true; + }) + ]; + }; + }) - home.packages = with pkgs; [ - (discord.override { - # we disable updates in settings.json - disableUpdates = false; - commandLineArgs = joinedArgs; - withTTS = false; - enableAutoscroll = true; - withOpenASAR = true; - }) - ]; - }; - }; + (machine.program { + name = "fun-packages"; + inherit inputs; + requirements = [ "fun" ]; + home-config = + { pkgs, ... }: + { + home.packages = with pkgs; [ + custom.p1n3appl3.tab + prismlauncher + ]; + }; + }) - custom.program.fun-packages = machine.program { - requirements = [ "fun" ]; - home-config = - { pkgs, ... }: - { - home.packages = with pkgs; [ - custom.p1n3appl3.tab - prismlauncher - ]; - }; - }; + (machine.program { + name = "cli-packages"; + inherit inputs; + requirements = [ "cli" ]; + home-config = + { config, pkgs, ... }: + { + home.packages = with pkgs; [ + # general cli tools + sops + fzf + htop + ncdu + psmisc + ripgrep + rsync + zoxide + tmux + direnv + atuin + rcon + lix + nix-output-monitor + wget + comma + unzip + pciutils + difftastic - custom.program.cli-packages = machine.program { - requirements = [ "cli" ]; - home-config = - { config, pkgs, ... }: - { - home.packages = with pkgs; [ - # general cli tools - sops - fzf - htop - ncdu - psmisc - ripgrep - rsync - zoxide - tmux - direnv - atuin - rcon - lix - nix-output-monitor - wget - comma - unzip - pciutils - difftastic + # dev tools + gdb + clang-tools + rustup + git + python3 + unixtools.xxd + net-tools + sqlite-interactive + tokei + just + uv + llvmPackages.bintools - # dev tools - gdb - clang-tools - rustup - git - python3 - unixtools.xxd - net-tools - sqlite-interactive - tokei - just - uv - llvmPackages.bintools + (writeShellScriptBin "nas" '' + mkdir -p ~/Documents/nas + ${sshfs}/bin/sshfs fili:/storage/storage/data/ ~/Documents/nas + cd ~/Documents/nas + '') + ]; - (writeShellScriptBin "nas" '' - mkdir -p ~/Documents/nas - ${sshfs}/bin/sshfs fili:/storage/storage/data/ ~/Documents/nas - cd ~/Documents/nas - '') - ]; + # Set up direnv + programs.direnv = { + package = pkgs.direnv; + silent = false; + nix-direnv = { + enable = true; + package = pkgs.nix-direnv; + }; + }; - # Set up direnv - programs.direnv = { - package = pkgs.direnv; - silent = false; - nix-direnv = { - enable = true; - package = pkgs.nix-direnv; + home.file = { + "${config.xdg.configHome}/sqlite3/sqliterc".source = pkgs.writeText ".sqliterc" '' + .mode box + ''; }; }; - - home.file = { - "${config.xdg.configHome}/sqlite3/sqliterc".source = pkgs.writeText ".sqliterc" '' - .mode box - ''; - }; - }; - }; - + }) + ]; } diff --git a/programs/firefox/default.nix b/programs/firefox/default.nix index d59a55e..186fc2f 100644 --- a/programs/firefox/default.nix +++ b/programs/firefox/default.nix @@ -1,6 +1,8 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.firefox = machine.program { + imports = machine.program { + name = "firefox"; + inherit inputs; requirements = [ "graphical" ]; home-config = { diff --git a/programs/fish/default.nix b/programs/fish/default.nix index b7acb77..9e505d0 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -1,6 +1,8 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.fish = machine.program { + imports = machine.program { + name = "fish"; + inherit inputs; requirements = [ "cli" ]; home-config = { @@ -227,6 +229,7 @@ function fish_greeting ${pkgs.blahaj}/bin/blahaj -s + echo "welcome to $(uname -n), $(whoami)!" end ''; }; diff --git a/programs/git/default.nix b/programs/git/default.nix index 3de79e5..3ef0743 100644 --- a/programs/git/default.nix +++ b/programs/git/default.nix @@ -1,6 +1,8 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.git = machine.program { + imports = machine.program { + name = "git"; + inherit inputs; requirements = [ "cli" ]; home-config = _: { programs.git = { diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 0a3aa54..18c1e79 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -1,6 +1,8 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.jujutsu = machine.program { + imports = machine.program { + name = "jujutsu"; + inherit inputs; requirements = [ "cli" ]; home-config = { config, pkgs, ... }: diff --git a/programs/kanata/default.nix b/programs/kanata/default.nix index 0794676..7b9b465 100644 --- a/programs/kanata/default.nix +++ b/programs/kanata/default.nix @@ -1,4 +1,4 @@ -{ machine, pkgs, ... }: +inputs@{ machine, pkgs, ... }: let kanata-config = '' (defcfg @@ -86,7 +86,9 @@ let ''; in { - custom.program.kanata = machine.program { + imports = machine.program { + name = "kanata"; + inherit inputs; requirements = [ "graphical" ]; home-config = { pkgs, ... }: diff --git a/programs/kitty/default.nix b/programs/kitty/default.nix index 78651ba..9f37d8f 100644 --- a/programs/kitty/default.nix +++ b/programs/kitty/default.nix @@ -1,6 +1,8 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.kitty = machine.program { + imports = machine.program { + name = "kitty"; + inherit inputs; requirements = [ "graphical" ]; home-config = { pkgs, flakes, ... }: diff --git a/programs/niri/default.nix b/programs/niri/default.nix index d36528e..087f962 100644 --- a/programs/niri/default.nix +++ b/programs/niri/default.nix @@ -1,14 +1,15 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.niri = machine.program { + imports = machine.program { + name = "niri"; + inherit inputs; requirements = [ "graphical" ]; home-config = - { - config, - pkgs, - flakes, - lib, - ... + { config + , pkgs + , flakes + , lib + , ... }: let noctalia = @@ -241,7 +242,7 @@ } { - matches = [ { app-id = "firefox"; } ]; + matches = [{ app-id = "firefox"; }]; open-on-workspace = "browser"; } @@ -599,7 +600,7 @@ id = "Volume"; } ] - ++ [ { id = "Battery"; } ] + ++ [{ id = "Battery"; }] ++ [ { id = "KeyboardLayout"; diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index 8f850b2..915b743 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -1,6 +1,8 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.nvim = machine.program { + imports = machine.program { + name = "nvim"; + inherit inputs; requirements = [ "cli" ]; home-config = { diff --git a/programs/tmux/default.nix b/programs/tmux/default.nix index d00d05a..2154216 100644 --- a/programs/tmux/default.nix +++ b/programs/tmux/default.nix @@ -1,6 +1,8 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.tmux = machine.program { + imports = machine.program { + name = "tmux"; + inherit inputs; requirements = [ "cli" ]; home-config = { pkgs, ... }: diff --git a/defaults/xdg.nix b/programs/xdg.nix similarity index 91% rename from defaults/xdg.nix rename to programs/xdg.nix index 7339c2a..0fad6fa 100644 --- a/defaults/xdg.nix +++ b/programs/xdg.nix @@ -1,4 +1,4 @@ -{ ... }@inputs: +{ machine, ... }@inputs: let browsers = [ "firefox.desktop" @@ -117,7 +117,10 @@ let }; in { - custom.program.homedirs = { + imports = machine.program { + name = "xdg"; + inherit inputs; + requirements = [ ]; home-config = { config, ... }: { @@ -142,15 +145,15 @@ in }; }; }; - }; - - xdg = { - mime = { - enable = true; - defaultApplications = associations; - addedAssociations = associations; - inherit removedAssociations; + system-config = _: { + xdg = { + mime = { + enable = true; + defaultApplications = associations; + addedAssociations = associations; + inherit removedAssociations; + }; + }; }; }; - } diff --git a/programs/zed/default.nix b/programs/zed/default.nix index d47f4ca..0686ffa 100644 --- a/programs/zed/default.nix +++ b/programs/zed/default.nix @@ -1,6 +1,8 @@ -{ machine, ... }: +inputs@{ machine, ... }: { - custom.program.zed = machine.program { + imports = machine.program { + name = "zed"; + inherit inputs; requirements = [ "work" "graphical"