From 36ad62c101ce87dd697051fda4e58a5fc814a490 Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 15:28:21 +0300 Subject: [PATCH 01/10] feat(flake)!: add `lix` Set as `nix.package` for `limonka` and default `devShell` Also update `flake.lock` --- flake.lock | 254 ++++++++++++++------- flake.nix | 5 + hosts/nix-darwin/limonka/configuration.nix | 2 +- overlays/modifications/default.nix | 5 + shells/default/default.nix | 2 +- 5 files changed, 181 insertions(+), 87 deletions(-) diff --git a/flake.lock b/flake.lock index 246f642..60b8667 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1722597419, - "narHash": "sha256-YbMzll0Dh2ln/TryDP+S3IGm8nRHkzcSQIubI4ZEOAw=", + "lastModified": 1726360516, + "narHash": "sha256-PcnbNb6SFg/y1zE36vRdhuWd50nLM4Hu2DKmtsrLHmA=", "owner": "oddlama", "repo": "agenix-rekey", - "rev": "126b4a5133eb361cbf5bf90e44c71b6f830845ec", + "rev": "524425f44b1f9717bfabf483ec9c990c3712e6df", "type": "github" }, "original": { @@ -83,11 +83,11 @@ }, "crane": { "locked": { - "lastModified": 1725125250, - "narHash": "sha256-CB20rDD5eHikF6mMTTJdwPP1qvyoiyyw1RDUzwIaIF8=", + "lastModified": 1725409566, + "narHash": "sha256-PrtLmqhM6UtJP7v7IGyzjBFhbG4eOAHT6LPYOFmYfbk=", "owner": "ipetkov", "repo": "crane", - "rev": "96fd12c7100e9e05fa1a0a5bd108525600ce282f", + "rev": "7e4586bad4e3f8f97a9271def747cf58c4b68f3c", "type": "github" }, "original": { @@ -142,7 +142,7 @@ }, "devshell_2": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nix-topology", "nixpkgs" @@ -169,11 +169,11 @@ ] }, "locked": { - "lastModified": 1725377834, - "narHash": "sha256-tqoAO8oT6zEUDXte98cvA1saU9+1dLJQe3pMKLXv8ps=", + "lastModified": 1726396892, + "narHash": "sha256-KRGuT5nGRAOT3heigRWg41tbYpTpapGhsWc+XjnIx0w=", "owner": "nix-community", "repo": "disko", - "rev": "e55f9a8678adc02024a4877c2a403e3f6daf24fe", + "rev": "51e3a7e51279fedfb6669a00d21dc5936c78a6ce", "type": "github" }, "original": { @@ -340,11 +340,11 @@ ] }, "locked": { - "lastModified": 1725234343, - "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", + "lastModified": 1726153070, + "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", + "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", "type": "github" }, "original": { @@ -361,11 +361,11 @@ ] }, "locked": { - "lastModified": 1725234343, - "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", + "lastModified": 1726153070, + "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", + "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", "type": "github" }, "original": { @@ -444,8 +444,9 @@ "type": "github" }, "original": { - "id": "flake-utils", - "type": "indirect" + "owner": "numtide", + "repo": "flake-utils", + "type": "github" } }, "flake-utils_3": { @@ -453,17 +454,16 @@ "systems": "systems_6" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" + "id": "flake-utils", + "type": "indirect" } }, "flake-utils_4": { @@ -471,11 +471,11 @@ "systems": "systems_7" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -506,6 +506,24 @@ "inputs": { "systems": "systems_9" }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_7": { + "inputs": { + "systems": "systems_10" + }, "locked": { "lastModified": 1685518550, "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", @@ -520,9 +538,9 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_8": { "inputs": { - "systems": "systems_10" + "systems": "systems_11" }, "locked": { "lastModified": 1705309234, @@ -538,9 +556,9 @@ "type": "github" } }, - "flake-utils_8": { + "flake-utils_9": { "inputs": { - "systems": "systems_11" + "systems": "systems_12" }, "locked": { "lastModified": 1710146030, @@ -556,6 +574,21 @@ "type": "github" } }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, "git-hooks": { "inputs": { "flake-compat": "flake-compat_6", @@ -570,11 +603,11 @@ ] }, "locked": { - "lastModified": 1724857454, - "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=", + "lastModified": 1725513492, + "narHash": "sha256-tyMUA6NgJSvvQuzB7A1Sf8+0XCHyfSPRx/b00o6K0uo=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6", + "rev": "7570de7b9b504cfe92025dd1be797bf546f66528", "type": "github" }, "original": { @@ -672,11 +705,11 @@ }, "hardware": { "locked": { - "lastModified": 1725477728, - "narHash": "sha256-ahej1VRqKmWbG7gewty+GlrSBEeGY/J2Zy8Nt8+3fdg=", + "lastModified": 1725885300, + "narHash": "sha256-5RLEnou1/GJQl+Wd+Bxaj7QY7FFQ9wjnFq1VNEaxTmc=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "880be1ab837e1e9fe0449dae41ac4d034694d4ce", + "rev": "166dee4f88a7e3ba1b7a243edb1aca822f00680e", "type": "github" }, "original": { @@ -714,11 +747,11 @@ ] }, "locked": { - "lastModified": 1725180166, - "narHash": "sha256-fzssXuGR/mCeGbzM1ExaTqDz7QDGta3WA4jJsZyRruo=", + "lastModified": 1726357542, + "narHash": "sha256-p4OrJL2weh0TRtaeu1fmNYP6+TOp/W2qdaIJxxQay4c=", "owner": "nix-community", "repo": "home-manager", - "rev": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb", + "rev": "e524c57b1fa55d6ca9d8354c6ce1e538d2a1f47f", "type": "github" }, "original": { @@ -729,11 +762,11 @@ }, "impermanence": { "locked": { - "lastModified": 1724489415, - "narHash": "sha256-ey8vhwY/6XCKoh7fyTn3aIQs7WeYSYtLbYEG87VCzX4=", + "lastModified": 1725690722, + "narHash": "sha256-4qWg9sNh5g1qPGO6d/GV2ktY+eDikkBTbWSg5/iD2nY=", "owner": "nix-community", "repo": "impermanence", - "rev": "c7f5b394397398c023000cf843986ee2571a1fd7", + "rev": "63f4d0443e32b0dd7189001ee1894066765d18a5", "type": "github" }, "original": { @@ -750,11 +783,11 @@ ] }, "locked": { - "lastModified": 1725559615, - "narHash": "sha256-q24lAKpBubomTHcNKLoVyvnNwVJJyBwcb/Gkhl0LLbs=", + "lastModified": 1726115155, + "narHash": "sha256-VDylz5VX4JD4/TZv6xUJDwuvNdgLRGoOpue1dlZGdIQ=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "45e6dcff8489d75941468462c41fad0948a2c94b", + "rev": "02cf60ce20b6034fc0459e5116cec7016aaff6e4", "type": "github" }, "original": { @@ -776,11 +809,46 @@ "url": "https://gist.github.com/duairc/5c9bb3c922e5d501a1edb9e7b3b845ba/archive/3885f7cd9ed0a746a9d675da6f265d41e9fd6704.tar.gz" } }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1723503926, + "narHash": "sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s=", + "rev": "bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2.tar.gz?rev=bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz" + } + }, + "lix-module": { + "inputs": { + "flake-utils": "flake-utils_2", + "flakey-profile": "flakey-profile", + "lix": "lix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723510904, + "narHash": "sha256-zNW/rqNJwhq2lYmQf19wJerRuNimjhxHKmzrWWFJYts=", + "rev": "622a2253a071a1fb97a4d3c8103a91114acc1140", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/622a2253a071a1fb97a4d3c8103a91114acc1140.tar.gz?rev=622a2253a071a1fb97a4d3c8103a91114acc1140" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz" + } + }, "mac-app-util": { "inputs": { "cl-nix-lite": "cl-nix-lite", "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": "nixpkgs" }, "locked": { @@ -809,11 +877,11 @@ ] }, "locked": { - "lastModified": 1725515460, - "narHash": "sha256-ybr3YTmjhVOuCWdacABUPxfUlVNqy0ya3s2sZ8zgyTw=", + "lastModified": 1726396311, + "narHash": "sha256-+5XiPehXPmVym1LGgd8bK3VRSX5TRdku639TNA/H3VY=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "e8df4bbcb3a2d18a32d8a50bd72c3175227f7468", + "rev": "a97833a4f127d2723032afa6661adb15a020bbe1", "type": "github" }, "original": { @@ -825,11 +893,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1725446059, - "narHash": "sha256-N+XyobzJsFXVivL/uu8lHSc9vxlM3j5SSOc4G9B0SyA=", + "lastModified": 1726314671, + "narHash": "sha256-KwsP2EVfcKexBaqrt3QGUX7GRFieDKEP/bx521dUOso=", "owner": "neovim", "repo": "neovim", - "rev": "b6e350a6b4df40fcc99931c460668c36fadc9989", + "rev": "3b54adc6c6d25dd146fa1eac21321f6bd612f50a", "type": "github" }, "original": { @@ -864,11 +932,11 @@ ] }, "locked": { - "lastModified": 1725544312, - "narHash": "sha256-ETyDNLOF5YvFO2lVlKttXgdHTqSGdp9ZCRRCjv2gaoM=", + "lastModified": 1726188813, + "narHash": "sha256-Vop/VRi6uCiScg/Ic+YlwsdIrLabWUJc57dNczp0eBc=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "a55b3f1ab41bb6d5025ebeebb4da5fd240b9b3b3", + "rev": "21fe31f26473c180390cfa81e3ea81aca0204c80", "type": "github" }, "original": { @@ -960,11 +1028,11 @@ "nmd": "nmd" }, "locked": { - "lastModified": 1721670745, - "narHash": "sha256-rjTQ14dqQ90EaHQy4g/mGylrJ1aZJYc3wCXc4A3GHJg=", + "lastModified": 1725658585, + "narHash": "sha256-P29z4Gt89n5ps1U7+qmIrj0BuRXGZQSIaOe2+tsPgfw=", "owner": "t184256", "repo": "nix-on-droid", - "rev": "248cc0806120fac9214f503dee0eaf0f47740dd0", + "rev": "5d88ff2519e4952f8d22472b52c531bb5f1635fc", "type": "github" }, "original": { @@ -976,7 +1044,7 @@ "nix-topology": { "inputs": { "devshell": "devshell_2", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": [ "nixpkgs" ], @@ -1105,11 +1173,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1725432240, - "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", + "lastModified": 1726062873, + "narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ad416d066ca1222956472ab7d0555a6946746a80", + "rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f", "type": "github" }, "original": { @@ -1121,11 +1189,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1725103162, - "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", "type": "github" }, "original": { @@ -1207,11 +1275,11 @@ }, "nur": { "locked": { - "lastModified": 1725568280, - "narHash": "sha256-CqrpCr0WQPtDR8lX+KF1iqv1KW3w1fT08zlAssIdpMQ=", + "lastModified": 1726393490, + "narHash": "sha256-LVGtTtPzF0rxy3nKzegvaLVsTKSM0IMLjfbxnh7FKP0=", "owner": "nix-community", "repo": "NUR", - "rev": "0899f7e1d8fd4646c1ccd524e333c05907c1b40a", + "rev": "1a4d47c6fc08986702c185ef0409d59dd42269a1", "type": "github" }, "original": { @@ -1321,16 +1389,16 @@ "agenix" ], "crane": "crane", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1725344070, - "narHash": "sha256-YX2npWHeTV9SxfI7P4IcPqxkO7sp/twYpdo/SGxNTbk=", + "lastModified": 1725794804, + "narHash": "sha256-QJvZDYfbcOM1Pt6YUPl+Xmw+JDJQtokdYj4P7sXuF7U=", "owner": "yaxitech", "repo": "ragenix", - "rev": "e977cf6d792e7959c8bb24d62a6b4bea14daa00f", + "rev": "7f6c227f86c5b4e6e7f6d2d62c614acd28d25627", "type": "github" }, "original": { @@ -1353,6 +1421,7 @@ "impermanence": "impermanence", "jovian-nixos": "jovian-nixos", "lib-net": "lib-net", + "lix-module": "lix-module", "mac-app-util": "mac-app-util", "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-colors": "nix-colors", @@ -1377,11 +1446,11 @@ ] }, "locked": { - "lastModified": 1725330199, - "narHash": "sha256-oUkdPJIxP3r3YyVOBLkDVLIJiQV9YlrVqA+jNcdpCvM=", + "lastModified": 1725675754, + "narHash": "sha256-hXW3csqePOcF2e/PYnpXj72KEYyNj2HzTrVNmS/F7Ug=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a562172c72d00350f9f2ff830e6515b6e7bee6d5", + "rev": "8cc45e678e914a16c8e224c3237fb07cf21e5e54", "type": "github" }, "original": { @@ -1448,7 +1517,7 @@ }, "spicetify-nix": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_7", "nixpkgs": "nixpkgs_4" }, "locked": { @@ -1510,6 +1579,21 @@ "type": "github" } }, + "systems_12": { + "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, @@ -1673,17 +1757,17 @@ "zig-overlay": { "inputs": { "flake-compat": "flake-compat_8", - "flake-utils": "flake-utils_7", + "flake-utils": "flake-utils_8", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1725538257, - "narHash": "sha256-J8UYDbHm8zSU+MruQ0VGEFL7eOJUkYsi7O4rCc0EcCk=", + "lastModified": 1726360294, + "narHash": "sha256-YhSxws05ILQzwIdzy2Mc6lPicS9yAFDhSrza6Kfeew4=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "5848c57bc396697ae4ed69f5e1295fe655c3ffae", + "rev": "2f41d3cc1c2f71210f98e524e10a20ad4bcf17df", "type": "github" }, "original": { @@ -1694,7 +1778,7 @@ }, "zls-overlay": { "inputs": { - "flake-utils": "flake-utils_8", + "flake-utils": "flake-utils_9", "gitignore": "gitignore_4", "nixpkgs": [ "nixpkgs" @@ -1704,11 +1788,11 @@ ] }, "locked": { - "lastModified": 1725202623, - "narHash": "sha256-+UdfnVQIMYEBNN5lVK/Pn6fs2YMohP+f/4XAU7qTTHo=", + "lastModified": 1725812318, + "narHash": "sha256-kqPJwnlhGByYBE1gqr7WI7O/Em8LmLPTBhPEST8OA8s=", "owner": "zigtools", "repo": "zls", - "rev": "ace6f6da90a4420cd6632363b30762e577e2b922", + "rev": "dd78968d4c8deefd33addc2b1cc14f60d89ec1a9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a869d5d..d5f9179 100644 --- a/flake.nix +++ b/flake.nix @@ -69,6 +69,11 @@ url = "github:nixos/nixpkgs/nixos-unstable"; }; + lix-module = { + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; diff --git a/hosts/nix-darwin/limonka/configuration.nix b/hosts/nix-darwin/limonka/configuration.nix index e75912c..88d490b 100644 --- a/hosts/nix-darwin/limonka/configuration.nix +++ b/hosts/nix-darwin/limonka/configuration.nix @@ -14,7 +14,7 @@ # Ensure we can work with flakes # TODO: add to `README.md` # NOTE: run `sudo -i nix-env --uninstall nix` to uninstall the global `nix` - package = pkgs.nixVersions.monitored.latest; + package = pkgs.lix-monitored; # This will add each flake input as a registry # To make nix3 commands consistent with your flake diff --git a/overlays/modifications/default.nix b/overlays/modifications/default.nix index 1281a8e..66f708d 100644 --- a/overlays/modifications/default.nix +++ b/overlays/modifications/default.nix @@ -23,6 +23,11 @@ final: prev: nix-output-monitor = prev.nix-output-monitor; }; + lix-monitored = inputs.nix-monitored.packages.${prev.system}.default.override { + nix = inputs.lix-module.packages.${prev.system}.default; + nix-output-monitor = prev.nix-output-monitor; + }; + nixVersions = prev.nixVersions // { monitored = final.lib.flip final.lib.concatMapAttrs prev.nixVersions (version: package: diff --git a/shells/default/default.nix b/shells/default/default.nix index 462ea5d..76a8833 100644 --- a/shells/default/default.nix +++ b/shells/default/default.nix @@ -7,7 +7,7 @@ extra-experimental-features = nix-command flakes ''; nativeBuildInputs = with pkgs; [ - nixVersions.monitored.latest + lix-monitored home-manager git wireguard-tools From 93717bf1a9dc19ceaed6525d28fee70de53d54ef Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 15:42:51 +0300 Subject: [PATCH 02/10] feat(jeeves): add `anki-sync-server` module --- hosts/nixos/jeeves/anki.nix | 31 ++++++++++++++++++ hosts/nixos/jeeves/configuration.nix | 1 + secrets/home/jeeves/anki/reo101.age | 8 +++++ ...0557c68a559523792483734f7c-anki.reo101.age | Bin 0 -> 275 bytes 4 files changed, 40 insertions(+) create mode 100644 hosts/nixos/jeeves/anki.nix create mode 100644 secrets/home/jeeves/anki/reo101.age create mode 100644 secrets/rekeyed/jeeves/07da270557c68a559523792483734f7c-anki.reo101.age diff --git a/hosts/nixos/jeeves/anki.nix b/hosts/nixos/jeeves/anki.nix new file mode 100644 index 0000000..41d3b4f --- /dev/null +++ b/hosts/nixos/jeeves/anki.nix @@ -0,0 +1,31 @@ +{ inputs, lib, pkgs, config, ... }: + +{ + age.secrets."anki.reo101" = { + rekeyFile = "${inputs.self}/secrets/home/jeeves/anki/reo101.age"; + mode = "400"; + }; + + services.anki-sync-server = { + enable = true; + package = pkgs.anki-sync-server; + users = [ + { + username = "reo101"; + passwordFile = config.age.secrets."anki.reo101".path; + } + ]; + address = "0.0.0.0"; + port = 27701; + }; + + services.nginx = { + virtualHosts."anki.jeeves.local" = { + enableACME = false; + forceSSL = false; + locations."/" = { + proxyPass = "http://127.0.0.1:${builtins.toString config.services.anki-sync-server.port}"; + }; + }; + }; +} diff --git a/hosts/nixos/jeeves/configuration.nix b/hosts/nixos/jeeves/configuration.nix index df5e3c6..fa3e568 100644 --- a/hosts/nixos/jeeves/configuration.nix +++ b/hosts/nixos/jeeves/configuration.nix @@ -20,6 +20,7 @@ # ./nextcloud.nix ./paperless.nix ./podman.nix + ./anki.nix ]; # services.kanidm = { }; diff --git a/secrets/home/jeeves/anki/reo101.age b/secrets/home/jeeves/anki/reo101.age new file mode 100644 index 0000000..736029c --- /dev/null +++ b/secrets/home/jeeves/anki/reo101.age @@ -0,0 +1,8 @@ +age-encryption.org/v1 +-> X25519 jROnYoLUU52v0VQuZVBUlfa/U1+LxqaaHXJkWLqis1Q +tDZKi1bq3h08JOyobEZq7fqAbe/Pyf1YPQj3y9CY8cM +-> KWa-grease bQ\#u] +XzYchZjVfR7y1kZp2PmXyZXyrYqGwZd5iKPERhSdc+3Pd2qU1pxVNJEZcAwcwpyM +/+x8jADcUcWs9+MzgW0qHKzM4vcpLCE +--- 0znfnFvlzrqKXsKHkbH5K7fS+vLMSfEKc84Wm0hFVGg +=$ /ݜz˻P2yg# ?7Qcsq \ No newline at end of file diff --git a/secrets/rekeyed/jeeves/07da270557c68a559523792483734f7c-anki.reo101.age b/secrets/rekeyed/jeeves/07da270557c68a559523792483734f7c-anki.reo101.age new file mode 100644 index 0000000000000000000000000000000000000000..f7312c64ce2160e788eda767678a9a3bd57090e6 GIT binary patch literal 275 zcmYdHPt{G$OD?J`D9Oyv)5|YP*Do{V(zR14F3!+RO))YxHMCSH^UX`jNmp~{ zUf>ttQCb*Sq#YcR Date: Sun, 15 Sep 2024 15:43:09 +0300 Subject: [PATCH 03/10] chore(jeeves)!: update `samba` config Now (as of last `nix flake update`) using more structured `Nix` --- hosts/nixos/jeeves/samba.nix | 54 +++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/hosts/nixos/jeeves/samba.nix b/hosts/nixos/jeeves/samba.nix index 4f1ae52..a0f68b6 100644 --- a/hosts/nixos/jeeves/samba.nix +++ b/hosts/nixos/jeeves/samba.nix @@ -15,33 +15,35 @@ enable = true; package = pkgs.sambaFull; openFirewall = true; - securityType = "user"; - extraConfig = '' - # Files - workgroup = WORKGROUP - server string = Jeeves - netbios name = jeeves - security = user - #use sendfile = yes - #max protocol = smb2 - # NOTE: localhost is the ipv6 localhost ::1 - hosts allow = 192.168.0. 192.168.1. 10.100.0. 127.0.0.1 localhost - hosts deny = 0.0.0.0/0 - guest account = nobody - map to guest = bad user + settings = { + global = { + # Files + "workgroup" = "WORKGROUP"; + "server string" = "Jeeves"; + "netbios name" = "jeeves"; + "security" = "user"; + # "use sendfile" = "yes"; + # "max protocol" = "smb2"; + # NOTE: localhost is the ipv6 localhost ::1 + # TODO: keep glogal network metadata somehow + "hosts allow" = "192.168.0. 192.168.1. 10.100.0. 127.0.0.1 localhost"; + "hosts deny" = "0.0.0.0/0"; + "guest account" = "nobody"; + "map to guest" = "bad user"; - # Symlinks - allow insecure wide links = yes + # Symlinks; + "allow insecure wide links" = "yes"; - # Printers - load printers = yes - printing = cups - printcap name = cups - ''; - shares = { + # Printers; + "load printers" = "yes"; + "printing" = "cups"; + "printcap name" = "cups"; + }; + + # Shares public = { - path = "/data/samba/public"; - browseable = "yes"; + "path" = "/data/samba/public"; + "browseable" = "yes"; "read only" = "no"; "guest ok" = "yes"; "create mask" = "0644"; @@ -50,8 +52,8 @@ "force group" = "users"; }; private = { - path = "/data/samba/private"; - browseable = "yes"; + "path" = "/data/samba/private"; + "browseable" = "yes"; "read only" = "no"; "guest ok" = "no"; "create mask" = "0644"; From 21bcbdb89364380857d1db8f8b8bad7131c51ef6 Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 16:00:10 +0300 Subject: [PATCH 04/10] style(jeeves): improve nix usage in `ollama` and `wireguard` modules - Update `OLLAMA_API_BASE_URL` to use the port from `config.services.ollama.port` in `ollama` module - Replace direct calls to `wg` command with `lib.getExe'` to in `wireguard` module --- hosts/nixos/jeeves/ollama.nix | 2 +- hosts/nixos/jeeves/wireguard.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/nixos/jeeves/ollama.nix b/hosts/nixos/jeeves/ollama.nix index 87ac9ac..5f3a822 100644 --- a/hosts/nixos/jeeves/ollama.nix +++ b/hosts/nixos/jeeves/ollama.nix @@ -32,7 +32,7 @@ DO_NOT_TRACK = "True"; SCARF_NO_ANALYTICS = "True"; TRANSFORMERS_CACHE = "${config.services.open-webui.stateDir}/cache"; - OLLAMA_API_BASE_URL = "http://127.0.0.1:11434"; + OLLAMA_API_BASE_URL = "http://127.0.0.1:${builtins.toString config.services.ollama.port}"; # Disable authentication WEBUI_AUTH = "False"; }; diff --git a/hosts/nixos/jeeves/wireguard.nix b/hosts/nixos/jeeves/wireguard.nix index 35c31ec..7a6e164 100644 --- a/hosts/nixos/jeeves/wireguard.nix +++ b/hosts/nixos/jeeves/wireguard.nix @@ -15,8 +15,8 @@ rekeyFile = "${inputs.self}/secrets/home/jeeves/wireguard/key.age"; generator = { script = { lib, pkgs, file, ... }: /* bash */ '' - priv=$(${pkgs.wireguard-tools}/bin/wg genkey) - ${pkgs.wireguard-tools}/bin/wg pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")} + priv=$(${lib.getExe' pkgs.wireguard-tools "wg"} genkey) + ${lib.getExe' pkgs.wireguard-tools "wg"} pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")} echo "$priv" ''; }; From 87e3cf2c3b50a4341f31629e5e15d263fd82d5f1 Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 16:51:30 +0300 Subject: [PATCH 05/10] feat(jeeves)!: use `lix` Also remove `nix.registry` and `nix.nixPath`, not working --- hosts/nixos/jeeves/configuration.nix | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/hosts/nixos/jeeves/configuration.nix b/hosts/nixos/jeeves/configuration.nix index fa3e568..9225d3d 100644 --- a/hosts/nixos/jeeves/configuration.nix +++ b/hosts/nixos/jeeves/configuration.nix @@ -44,16 +44,8 @@ hardware.enableRedistributableFirmware = true; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - nix = let - flakeInputs = lib.filterAttrs (lib.const (lib.isType "flake")) inputs; - in { - # This will add each flake input as a registry - # To make nix3 commands consistent with your flake - registry = lib.mapAttrs (_: value: { flake = value; }) flakeInputs; - - # This will additionally add your inputs to the system's legacy channels - # Making legacy nix commands consistent as well, awesome! - nixPath = lib.mapAttrsToList (key: value: "${key}=flake:${key}") flakeInputs; + nix = { + package = pkgs.lix-monitored; settings = { trusted-users = [ From e33df45bf6406d7f3b114caaf6690d4817c3f076 Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 17:08:20 +0300 Subject: [PATCH 06/10] feat(limonka)!: remove `nix.registry` and `nix.nixPath`, not working --- hosts/nix-darwin/limonka/configuration.nix | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/hosts/nix-darwin/limonka/configuration.nix b/hosts/nix-darwin/limonka/configuration.nix index 88d490b..8bafc86 100644 --- a/hosts/nix-darwin/limonka/configuration.nix +++ b/hosts/nix-darwin/limonka/configuration.nix @@ -8,33 +8,12 @@ # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; - nix = let - flakeInputs = lib.filterAttrs (lib.const (lib.isType "flake")) inputs; - in { + nix = { # Ensure we can work with flakes # TODO: add to `README.md` # NOTE: run `sudo -i nix-env --uninstall nix` to uninstall the global `nix` package = pkgs.lix-monitored; - # This will add each flake input as a registry - # To make nix3 commands consistent with your flake - registry = lib.mapAttrs (_: value: { flake = value; }) flakeInputs; - - # This will additionally add your inputs to the system's legacy channels - # Making legacy nix commands consistent as well, awesome! - nixPath = lib.mapAttrsToList (key: value: "${key}=flake:${key}") flakeInputs; - - # extraOptions = '' - # # Enable flakes and new 'nix' command - # experimental-features = nix-command flakes - # # Allow building multiple derivations in parallel - # max-jobs = auto - # # Deduplicate and optimize nix store - # auto-optimise-store = true - # # Keep outputs and derivations - # keep-outputs = true - # keep-derivations = true - # ''; settings = { # Enable flakes and new 'nix' command From 5868b5885f815aa5bf9ad8d9fdbfa8a2545b92b0 Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 17:10:19 +0300 Subject: [PATCH 07/10] feat(flake)!: add some `TODO`s --- modules/flake/packages/default.nix | 1 + modules/home-manager/reo101-scm/default.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/flake/packages/default.nix b/modules/flake/packages/default.nix index 40d74ba..a8b85b4 100644 --- a/modules/flake/packages/default.nix +++ b/modules/flake/packages/default.nix @@ -74,6 +74,7 @@ (name: { package, systems }: let # TODO: put in `autoThings` `handle`? + # TODO: keep source `dream2nix` module for overriding? isDream2Nix = lib.pipe package [ builtins.functionArgs diff --git a/modules/home-manager/reo101-scm/default.nix b/modules/home-manager/reo101-scm/default.nix index f45a202..94568b0 100644 --- a/modules/home-manager/reo101-scm/default.nix +++ b/modules/home-manager/reo101-scm/default.nix @@ -29,6 +29,7 @@ in config = let # TODO: agenix??? + # TODO: module options??? name = "reo101"; email = "pavel.atanasov2001@gmail.com"; key = "675AA7EF13964ACB"; From 8abd11e0a71f710b3a8a33f27877171971fd4b8a Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 17:10:39 +0300 Subject: [PATCH 08/10] fix(wezterm)!: set `front_end` to `WebGpu` --- modules/home-manager/reo101-wezterm/wezterm.fnl | 3 +++ modules/home-manager/reo101-wezterm/wezterm.lua | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/home-manager/reo101-wezterm/wezterm.fnl b/modules/home-manager/reo101-wezterm/wezterm.fnl index a7ad8f7..5ff4327 100644 --- a/modules/home-manager/reo101-wezterm/wezterm.fnl +++ b/modules/home-manager/reo101-wezterm/wezterm.fnl @@ -3,6 +3,9 @@ (wezterm.config_builder) {})) +;; https://github.com/NixOS/nixpkgs/issues/336069 +(set config.front_end "WebGpu") + ;;;;;;;;;;;;;;;;;;;; ;;; Font Options ;;; ;;;;;;;;;;;;;;;;;;;; diff --git a/modules/home-manager/reo101-wezterm/wezterm.lua b/modules/home-manager/reo101-wezterm/wezterm.lua index 59ffeb5..715cb3c 100644 --- a/modules/home-manager/reo101-wezterm/wezterm.lua +++ b/modules/home-manager/reo101-wezterm/wezterm.lua @@ -2,6 +2,9 @@ local M = {} local wezterm = require("wezterm") +-- https://github.com/NixOS/nixpkgs/issues/336069 +M.front_end = "WebGpu" + ---------- -- Font -- ---------- From 55b94c53aa19b8a680cb9f70f3fa9e122e355b11 Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 17:11:27 +0300 Subject: [PATCH 09/10] feat(cheetah)!: set `neovim` as `defaultEditor` --- hosts/nix-on-droid/cheetah/home.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/nix-on-droid/cheetah/home.nix b/hosts/nix-on-droid/cheetah/home.nix index dc68e59..31dba5f 100644 --- a/hosts/nix-on-droid/cheetah/home.nix +++ b/hosts/nix-on-droid/cheetah/home.nix @@ -70,7 +70,7 @@ programs.neovim = { enable = true; package = pkgs.neovim; - # defaultEditor = true; + defaultEditor = true; viAlias = true; vimAlias = true; From 75152ae5ab16171804b3dd3538ef10135a431a3a Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 17:35:59 +0300 Subject: [PATCH 10/10] feat(README): update Fix `Nix` links Add more `automatic` stuff --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b1ce70e..16dc2c7 100644 --- a/README.md +++ b/README.md @@ -47,25 +47,30 @@ # Structure -- Everything is built upon [flake-parts](https://flake.parts/), with [flake modules](./modules/flake/) for automatic packages, modules && configurations extraction +- Everything is built upon [flake-parts](https://flake.parts/), with [flake modules](./modules/flake/) for automatic *stuff* extraction - Automatic classic (`callPackage`) and `dream2nix` packages extraction - Automatic `nixos`, `nix-darwin`, `nix-on-droid`, `home-manager` and `flake` modules extraction - Automatic `nixos`, `nix-darwin`, `nix-on-droid` and `home-manager` configurations extraction + - Automatic overlays extraction + - Automatic devShells extraction - Hosts can be found under `./hosts/${config-type}/${system}/${hostname}/...` - - Check [`./modules/flake/configurations.nix`](./modules/flake/configurations.nix) for more info on what is extracted from those directories + - Check [`./modules/flake/configurations`](./modules/flake/configurations) for more info on what is extracted from those directories - Modules can be found under `./modules/${config-type}/...` - - Check [`./modules/flake/modules.nix`](./modules/flake/modules.nix) for more info on what is extracted from that directory + - Check [`./modules/flake/modules`](./modules/flake/modules) for more info on what is extracted from that directory - Packages can be found under `./pkgs/...` + - Check [`./modules/flake/packages`](./modules/flake/packages) for more info on what is extracted from that directory - Overlays can be found under `./overlays/...` + - Check [`./modules/flake/overlays`](./modules/flake/overlays) for more info on what is extracted from that directory - Shells can be found under `./shells/...` - - Default one puts a recent `nix` together with some other useful tools for working with the repo (`deploy-rs`, `rage`, `agenix-rekey`, etc.), see [`./shells/default/default.nix`](./shells/default/default.nix) for more info + - Check [`./modules/flake/shells`](./modules/flake/shells) for more info on what is extracted from that directory + - Default one puts a recent `nix` (as of recently - `lix`) together with some other useful tools for working with the repo (`deploy-rs`, `rage`, `agenix-rekey`, etc.), see [`./shells/default/default.nix`](./shells/default/default.nix) for more info # Topology You can see the overall topology of the hosts by running ```sh -nix build .#topology +nix build ".#topology" ``` And opening the resulting `./result/main.svg` and `./result/network.svg`