mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-10 16:20:13 +00:00
Compare commits
55 Commits
platform
...
5d539abe21
Author | SHA1 | Date | |
---|---|---|---|
5d539abe21 | |||
cea08761bb | |||
eea972492e | |||
9014ca226e | |||
515859d22d | |||
aa6c91b65c | |||
d59692c813 | |||
88266c9f8d | |||
a1dfc77790 | |||
b3a7b280b5 | |||
e803e6a02a | |||
61c4e68fef | |||
faac8f3c8b | |||
9b30f91b1d | |||
5966368620 | |||
820f5afe0b | |||
bfbacbe93e | |||
54a073b946 | |||
8eede16bcd | |||
11e0992d99 | |||
562295edb1 | |||
a719dc4309 | |||
0aecbd85cd | |||
28ac5523f8 | |||
645454cb9a | |||
b30893d968 | |||
0ec67df9a3 | |||
7182ca7cd4 | |||
fbaa6f8894 | |||
3873ab7296 | |||
7b32216684 | |||
2f042713cc | |||
011fb57347 | |||
ce308a6347 | |||
31e93606f4 | |||
b7317a721b | |||
3684ce4b39 | |||
b8337f1295 | |||
b78bc5b3bb | |||
5869e4a6b4 | |||
2c55912abf | |||
0be5c026a7 | |||
d427ccc577 | |||
3852551ebe | |||
9727fd6a56 | |||
e233a2e354 | |||
5b32f1f211 | |||
eace1ff3cf | |||
5397e4e23f | |||
956fa3184b | |||
b73867ea27 | |||
37427204de | |||
6ee5ade2bc | |||
043cd8ce5c | |||
07a0d5185b |
288
flake.lock
generated
288
flake.lock
generated
@ -22,11 +22,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742013980,
|
"lastModified": 1746254942,
|
||||||
"narHash": "sha256-34YbfwABU5nb0F5eaaJE3ujldaNDhmyxw7CWqhXJV08=",
|
"narHash": "sha256-Y062AuRx6l+TJNX8wxZcT59SSLsqD9EedAY0mqgTtQE=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "9175b4bb5f127fb7b5784b14f7e01abff24c378f",
|
"rev": "760a11c87009155afa0140d55c40e7c336d62d7a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -43,11 +43,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741786315,
|
"lastModified": 1745812220,
|
||||||
"narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=",
|
"narHash": "sha256-hotBG0EJ9VmAHJYF0yhWuTVZpENHvwcJ2SxvIPrXm+g=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de",
|
"rev": "d0c543d740fad42fe2c035b43c9d41127e073c78",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -111,6 +111,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"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_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": [
|
"systems": [
|
||||||
"mac-app-util",
|
"mac-app-util",
|
||||||
@ -130,9 +148,9 @@
|
|||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
"flake-utils_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_2"
|
"systems": "systems_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705309234,
|
"lastModified": 1705309234,
|
||||||
@ -148,6 +166,46 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"helix": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1746193606,
|
||||||
|
"narHash": "sha256-LD3ce/SlIY8Wr8XG52EI5t9bNa/peBCXykIJBvcGmO8=",
|
||||||
|
"owner": "helix-editor",
|
||||||
|
"repo": "helix",
|
||||||
|
"rev": "12139a4c30ad20d9a1b181de69532a57601cf96f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "helix-editor",
|
||||||
|
"repo": "helix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -155,11 +213,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741955947,
|
"lastModified": 1746243165,
|
||||||
"narHash": "sha256-2lbURKclgKqBNm7hVRtWh0A7NrdsibD0EaWhahUVhhY=",
|
"narHash": "sha256-DQycVmlyLQNLjLJ/FzpokVmbxGQ8HjQQ4zN4nyq2vII=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "4e12151c9e014e2449e0beca2c0e9534b96a26b4",
|
"rev": "c0962eeeabfb8127713f859ec8a5f0e86dead0f2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -173,18 +231,18 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"cl-nix-lite": "cl-nix-lite",
|
"cl-nix-lite": "cl-nix-lite",
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"systems": "systems"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739821351,
|
"lastModified": 1742156590,
|
||||||
"narHash": "sha256-QlVtMzAhECs9Esq3txqVW7/vM78ipB5IcI8uyCbTP7A=",
|
"narHash": "sha256-aTM/2CrNN5utdVEQGsOA+kl4UozgH7VPLBQL5OXtBrg=",
|
||||||
"owner": "hraban",
|
"owner": "hraban",
|
||||||
"repo": "mac-app-util",
|
"repo": "mac-app-util",
|
||||||
"rev": "c00d5b21ca1fdab8acef65e696795f0f15ec1158",
|
"rev": "341ede93f290df7957047682482c298e47291b4d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -193,71 +251,19 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nextcloud-cookbook": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1726214817,
|
|
||||||
"narHash": "sha256-Pfa+Xbopg20os+pnGgg+wpEX1MI5fz5JMb0K4a8rBhs=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.2/cookbook-0.11.2.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.2/cookbook-0.11.2.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nextcloud-external": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1729501365,
|
|
||||||
"narHash": "sha256-OV6HhFBzmnQBO5btGEnqmKlaUMY7/t2Qm3XebclpBlM=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.5.2/external-v5.5.2.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.5.2/external-v5.5.2.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nextcloud-news": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1729667622,
|
|
||||||
"narHash": "sha256-pnvyMZQ+NYMgH0Unfh5S19HdZSjnghgoUDAoi2KIXNI=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nextcloud/news/releases/download/25.0.0-alpha12/news.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nextcloud/news/releases/download/25.0.0-alpha12/news.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nextcloud-snappymail": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1728502660,
|
|
||||||
"narHash": "sha256-oCw6Brs85rINBHvz3UJXheyLVqvA3RgPXG03b30Fx7E=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.38.2-nextcloud.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.38.2-nextcloud.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix2vim": {
|
"nix2vim": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1740943170,
|
"lastModified": 1745846717,
|
||||||
"narHash": "sha256-A0F7T/euSMen004cVQN/ZkMpLkgLXDs+mq/merhd+0Y=",
|
"narHash": "sha256-GjwZEjCrI1/tQYylAQ+hU5JYD2hJI+rZmfICCIniWuE=",
|
||||||
"owner": "gytis-ivaskevicius",
|
"owner": "gytis-ivaskevicius",
|
||||||
"repo": "nix2vim",
|
"repo": "nix2vim",
|
||||||
"rev": "a562f32ff2393d0ed198103c65a3035bcdf83d4d",
|
"rev": "0cd899a39b56d665115f72ffc7c37e0f4cf41dbe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -289,11 +295,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1740947705,
|
"lastModified": 1742568034,
|
||||||
"narHash": "sha256-Co2kAD2SZalOm+5zoxmzEVZNvZ17TyafuFsD46BwSdY=",
|
"narHash": "sha256-QaMEhcnscfF2MqB7flZr+sLJMMYZPnvqO4NYf9B4G38=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-generators",
|
"repo": "nixos-generators",
|
||||||
"rev": "507911df8c35939050ae324caccc7cf4ffb76565",
|
"rev": "42ee229088490e3777ed7d1162cb9e9d8c3dbb11",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -304,11 +310,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742069588,
|
"lastModified": 1746141548,
|
||||||
"narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=",
|
"narHash": "sha256-IgBWhX7A2oJmZFIrpRuMnw5RAufVnfvOgHWgIdds+hc=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5",
|
"rev": "f02fddb8acef29a8b32f10a335d44828d7825b78",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -359,11 +365,11 @@
|
|||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742145955,
|
"lastModified": 1746282980,
|
||||||
"narHash": "sha256-ju1J45e22ebpLH3eSm0ZZYg7WHkN01ryTFv+4UNwCOA=",
|
"narHash": "sha256-KOkO6aDwI8FOmMMv3MdO2WL95lMOJR4qDMUHPOoFtyM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nur",
|
"repo": "nur",
|
||||||
"rev": "d6ba59dd58ebe6c184f955e1d3a4bbca9484c018",
|
"rev": "e4be6680a4b231e712fef9c1cd5714f08a1ce51b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -376,23 +382,63 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
|
"helix": "helix",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"mac-app-util": "mac-app-util",
|
"mac-app-util": "mac-app-util",
|
||||||
"nextcloud-cookbook": "nextcloud-cookbook",
|
|
||||||
"nextcloud-external": "nextcloud-external",
|
|
||||||
"nextcloud-news": "nextcloud-news",
|
|
||||||
"nextcloud-snappymail": "nextcloud-snappymail",
|
|
||||||
"nix2vim": "nix2vim",
|
"nix2vim": "nix2vim",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"wsl": "wsl",
|
"wsl": "wsl",
|
||||||
|
"yazi": "yazi",
|
||||||
"zellij-switch": "zellij-switch",
|
"zellij-switch": "zellij-switch",
|
||||||
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
|
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"helix",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1740623427,
|
||||||
|
"narHash": "sha256-3SdPQrZoa4odlScFDUHd4CUPQ/R1gtH4Mq9u8CBiK8M=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "d342e8b5fd88421ff982f383c853f0fc78a847ab",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-overlay_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"yazi",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1745116541,
|
||||||
|
"narHash": "sha256-5xzA6dTfqCfTTDCo3ipPZzrg3wp01xmcr73y4cTNMP8=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "e2142ef330a61c02f274ac9a9cb6f8487a5d0080",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-overlay_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
@ -411,6 +457,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
"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": {
|
"locked": {
|
||||||
"lastModified": 1689347925,
|
"lastModified": 1689347925,
|
||||||
"narHash": "sha256-ozenz5bFe1UUqOn7f60HRmgc01BgTGIKZ4Xl+HbocGQ=",
|
"narHash": "sha256-ozenz5bFe1UUqOn7f60HRmgc01BgTGIKZ4Xl+HbocGQ=",
|
||||||
@ -425,7 +486,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems_2": {
|
"systems_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1681028828,
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
@ -440,7 +501,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems_3": {
|
"systems_4": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1681028828,
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
@ -484,11 +560,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741870048,
|
"lastModified": 1744290088,
|
||||||
"narHash": "sha256-odXRdNZGdXg1LmwlAeWL85kgy/FVHsgKlDwrvbR2BsU=",
|
"narHash": "sha256-/X9XVEl0EiyisNbF5srrxXRSVoRqdwExuqyspYqqEjQ=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NixOS-WSL",
|
"repo": "NixOS-WSL",
|
||||||
"rev": "5d76001e33ee19644a598ad80e7318ab0957b122",
|
"rev": "60b4904a1390ac4c89e93d95f6ed928975e525ed",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -497,20 +573,42 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"yazi": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_4",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": "rust-overlay_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1746209831,
|
||||||
|
"narHash": "sha256-1R1MRxHmTbNUASTCdJTaaIEUevx18+XpVVxEcb0q7VM=",
|
||||||
|
"owner": "sxyazi",
|
||||||
|
"repo": "yazi",
|
||||||
|
"rev": "a201c93419bede1f35c69a6b8b21ebbf4a752e6e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "sxyazi",
|
||||||
|
"repo": "yazi",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"zellij-switch": {
|
"zellij-switch": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"rust-overlay": "rust-overlay",
|
"rust-overlay": "rust-overlay_3",
|
||||||
"systems": "systems_3"
|
"systems": "systems_5"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737011317,
|
"lastModified": 1742588229,
|
||||||
"narHash": "sha256-A8VGuw/jIw+NCo5aCYy8MFrWpKzZLf77RApGGMzHxCY=",
|
"narHash": "sha256-IPg0pBw0ciF+xl6viq3nK+dvZoDZrfBDui7dkPLz258=",
|
||||||
"owner": "mostafaqanbaryan",
|
"owner": "mostafaqanbaryan",
|
||||||
"repo": "zellij-switch",
|
"repo": "zellij-switch",
|
||||||
"rev": "15b02834c8be735fca0d9fb41f48709f97cc9afc",
|
"rev": "0e3c303c19890ccb03589230ac5a7c4307e573e4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
102
flake.nix
102
flake.nix
@ -70,29 +70,41 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Nextcloud Apps
|
# Text editor
|
||||||
nextcloud-news = {
|
helix = {
|
||||||
# https://github.com/nextcloud/news/releases
|
url = "github:helix-editor/helix";
|
||||||
url = "https://github.com/nextcloud/news/releases/download/25.0.0-alpha12/news.tar.gz";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
flake = false;
|
|
||||||
};
|
};
|
||||||
nextcloud-external = {
|
|
||||||
# https://github.com/nextcloud-releases/external/releases
|
# Terminal file manager
|
||||||
url = "https://github.com/nextcloud-releases/external/releases/download/v5.5.2/external-v5.5.2.tar.gz";
|
yazi = {
|
||||||
flake = false;
|
url = "github:sxyazi/yazi";
|
||||||
};
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nextcloud-cookbook = {
|
|
||||||
# https://github.com/christianlupus-nextcloud/cookbook-releases/releases/
|
|
||||||
url = "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.2/cookbook-0.11.2.tar.gz";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
nextcloud-snappymail = {
|
|
||||||
# https://github.com/the-djmaze/snappymail/releases
|
|
||||||
# https://snappymail.eu/repository/nextcloud
|
|
||||||
url = "https://snappymail.eu/repository/nextcloud/snappymail-2.38.2-nextcloud.tar.gz";
|
|
||||||
# url = "https://github.com/nmasur/snappymail-nextcloud/releases/download/v2.36.3/snappymail-2.36.3-nextcloud.tar.gz";
|
|
||||||
flake = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# # Nextcloud Apps
|
||||||
|
# nextcloud-news = {
|
||||||
|
# # https://github.com/nextcloud/news/releases
|
||||||
|
# url = "https://github.com/nextcloud/news/releases/download/25.0.0-alpha12/news.tar.gz";
|
||||||
|
# flake = false;
|
||||||
|
# };
|
||||||
|
# nextcloud-external = {
|
||||||
|
# # https://github.com/nextcloud-releases/external/releases
|
||||||
|
# url = "https://github.com/nextcloud-releases/external/releases/download/v5.5.2/external-v5.5.2.tar.gz";
|
||||||
|
# flake = false;
|
||||||
|
# };
|
||||||
|
# nextcloud-cookbook = {
|
||||||
|
# # https://github.com/christianlupus-nextcloud/cookbook-releases/releases/
|
||||||
|
# url = "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.2/cookbook-0.11.2.tar.gz";
|
||||||
|
# flake = false;
|
||||||
|
# };
|
||||||
|
# nextcloud-snappymail = {
|
||||||
|
# # https://github.com/the-djmaze/snappymail/releases
|
||||||
|
# # https://snappymail.eu/repository/nextcloud
|
||||||
|
# url = "https://snappymail.eu/repository/nextcloud/snappymail-2.38.2-nextcloud.tar.gz";
|
||||||
|
# # url = "https://github.com/nmasur/snappymail-nextcloud/releases/download/v2.36.3/snappymail-2.36.3-nextcloud.tar.gz";
|
||||||
|
# flake = false;
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
@ -115,12 +127,14 @@
|
|||||||
influxdb = "influxdb.${baseName}";
|
influxdb = "influxdb.${baseName}";
|
||||||
irc = "irc.${baseName}";
|
irc = "irc.${baseName}";
|
||||||
mail = "noahmasur.com";
|
mail = "noahmasur.com";
|
||||||
|
mathesar = "mathesar.${baseName}";
|
||||||
metrics = "metrics.${baseName}";
|
metrics = "metrics.${baseName}";
|
||||||
minecraft = "minecraft.${baseName}";
|
minecraft = "minecraft.${baseName}";
|
||||||
n8n = "n8n.${baseName}";
|
n8n = "n8n.${baseName}";
|
||||||
notifications = "ntfy.${baseName}";
|
notifications = "ntfy.${baseName}";
|
||||||
paperless = "paper.${baseName}";
|
paperless = "paper.${baseName}";
|
||||||
photos = "photos.${baseName}";
|
photos = "photos.${baseName}";
|
||||||
|
postgresql = "pg.${baseName}";
|
||||||
prometheus = "prom.${baseName}";
|
prometheus = "prom.${baseName}";
|
||||||
secrets = "vault.${baseName}";
|
secrets = "vault.${baseName}";
|
||||||
smtp = "smtp.purelymail.com";
|
smtp = "smtp.purelymail.com";
|
||||||
@ -133,28 +147,33 @@
|
|||||||
rec {
|
rec {
|
||||||
|
|
||||||
lib = import ./lib inputs;
|
lib = import ./lib inputs;
|
||||||
|
flattenAttrset = attrs: builtins.foldl' lib.mergeAttrs { } (builtins.attrValues attrs);
|
||||||
|
|
||||||
nixosConfigurations = builtins.mapAttrs (
|
nixosConfigurations = flattenAttrset (
|
||||||
system: hosts:
|
|
||||||
builtins.mapAttrs (
|
builtins.mapAttrs (
|
||||||
name: module:
|
system: hosts:
|
||||||
lib.buildNixos {
|
builtins.mapAttrs (
|
||||||
inherit system module;
|
name: module:
|
||||||
specialArgs = { inherit hostnames; };
|
lib.buildNixos {
|
||||||
}
|
inherit system module;
|
||||||
) hosts
|
specialArgs = { inherit hostnames; };
|
||||||
) lib.linuxHosts;
|
}
|
||||||
|
) hosts
|
||||||
|
) lib.linuxHosts
|
||||||
|
);
|
||||||
|
|
||||||
darwinConfigurations = builtins.mapAttrs (
|
darwinConfigurations = flattenAttrset (
|
||||||
system: hosts:
|
|
||||||
builtins.mapAttrs (
|
builtins.mapAttrs (
|
||||||
name: module:
|
system: hosts:
|
||||||
lib.buildDarwin {
|
builtins.mapAttrs (
|
||||||
inherit system module;
|
name: module:
|
||||||
specialArgs = { inherit hostnames; };
|
lib.buildDarwin {
|
||||||
}
|
inherit system module;
|
||||||
) hosts
|
specialArgs = { inherit hostnames; };
|
||||||
) lib.darwinHosts;
|
}
|
||||||
|
) hosts
|
||||||
|
) lib.darwinHosts
|
||||||
|
);
|
||||||
|
|
||||||
homeModules = builtins.mapAttrs (
|
homeModules = builtins.mapAttrs (
|
||||||
system: hosts:
|
system: hosts:
|
||||||
@ -199,13 +218,12 @@
|
|||||||
system:
|
system:
|
||||||
# Get the configurations that we normally use
|
# Get the configurations that we normally use
|
||||||
{
|
{
|
||||||
nixosConfigurations = nixosConfigurations.${system};
|
inherit nixosConfigurations darwinConfigurations;
|
||||||
darwinConfigurations = darwinConfigurations.${system};
|
|
||||||
homeConfigurations = homeConfigurations.${system};
|
homeConfigurations = homeConfigurations.${system};
|
||||||
generators = generators.${system};
|
generators = generators.${system};
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
# Get the custom packages that I have placed under the nmasur namespace
|
# Share the custom packages that I have placed under the nmasur namespace
|
||||||
lib.pkgsBySystem.${system}.nmasur
|
lib.pkgsBySystem.${system}.nmasur
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ rec {
|
|||||||
linux-base.enable = true;
|
linux-base.enable = true;
|
||||||
power-user.enable = true;
|
power-user.enable = true;
|
||||||
};
|
};
|
||||||
|
nmasur.presets.programs.helix.enable = true;
|
||||||
home.stateVersion = "23.05";
|
home.stateVersion = "23.05";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
1
hosts/x86_64-darwin/readme.md
Normal file
1
hosts/x86_64-darwin/readme.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# No x86 Darwin Hosts Currently
|
@ -29,4 +29,18 @@ rec {
|
|||||||
|
|
||||||
system.stateVersion = "23.05";
|
system.stateVersion = "23.05";
|
||||||
|
|
||||||
|
# These filesystems are ignored by nixos-generators
|
||||||
|
|
||||||
|
# This is the root filesystem containing NixOS
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
# This is the boot filesystem for Grub
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-label/boot";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,9 @@ rec {
|
|||||||
# Not sure what's necessary but too afraid to remove anything
|
# Not sure what's necessary but too afraid to remove anything
|
||||||
# File systems must be declared in order to boot
|
# File systems must be declared in order to boot
|
||||||
|
|
||||||
|
# Required to have a boot loader to work
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
# This is the root filesystem containing NixOS
|
# This is the root filesystem containing NixOS
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
@ -67,6 +67,8 @@ lib
|
|||||||
inputs.nur.overlays.default
|
inputs.nur.overlays.default
|
||||||
inputs.nix2vim.overlay
|
inputs.nix2vim.overlay
|
||||||
inputs.zellij-switch.overlays.default
|
inputs.zellij-switch.overlays.default
|
||||||
|
inputs.helix.overlays.default
|
||||||
|
inputs.yazi.overlays.default
|
||||||
] ++ (importOverlays ../overlays);
|
] ++ (importOverlays ../overlays);
|
||||||
|
|
||||||
# System types to support.
|
# System types to support.
|
||||||
|
67
modules/common/shell/work.nix
Normal file
67
modules/common/shell/work.nix
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
|
home.packages =
|
||||||
|
let
|
||||||
|
ldap_scheme = "ldaps";
|
||||||
|
magic_prefix = "take";
|
||||||
|
ldap_port = 3269;
|
||||||
|
jq_parse = pkgs.writeShellScriptBin "ljq" ''
|
||||||
|
jq --slurp \
|
||||||
|
--raw-input 'split("\n\n")|map(split("\n")|map(select(.[0:1]!="#" and length>0)) |select(length > 0)|map(capture("^(?<key>[^:]*:?): *(?<value>.*)") |if .key[-1:.key|length] == ":" then .key=.key[0:-1]|.value=(.value|@base64d) else . end)| group_by(.key) | map({key:.[0].key,value:(if .|length > 1 then [.[].value] else .[].value end)}) | from_entries)' | jq -r 'del(.[].thumbnailPhoto)'
|
||||||
|
'';
|
||||||
|
ldap_script = pkgs.writeShellScriptBin "ldap" ''
|
||||||
|
if ! [ "$LDAP_HOST" ]; then
|
||||||
|
echo "No LDAP_HOST specified!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
SEARCH_FILTER="$@"
|
||||||
|
ldapsearch -LLL \
|
||||||
|
-B -o ldif-wrap=no \
|
||||||
|
-E pr=5000/prompt \
|
||||||
|
-H "${ldap_scheme}://''${LDAP_HOST}:${builtins.toString ldap_port}" \
|
||||||
|
-D "${pkgs.lib.toUpper magic_prefix}2\\${pkgs.lib.toLower config.user}" \
|
||||||
|
-w "$(${pkgs._1password-cli}/bin/op item get T2 --fields label=password --reveal)" \
|
||||||
|
-b "dc=''${LDAP_HOST//./,dc=}" \
|
||||||
|
-s "sub" -x "(cn=''${SEARCH_FILTER})" \
|
||||||
|
| ${jq_parse}/bin/ljq
|
||||||
|
'';
|
||||||
|
ldapm_script = pkgs.writeShellScriptBin "ldapm" ''
|
||||||
|
if ! [ "$LDAP_HOST" ]; then
|
||||||
|
echo "No LDAP_HOST specified!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
${ldap_script}/bin/ldap "$@" | jq '[ .[].memberOf] | add'
|
||||||
|
'';
|
||||||
|
ldapg_script = pkgs.writeShellScriptBin "ldapg" ''
|
||||||
|
if ! [ "$LDAP_HOST" ]; then
|
||||||
|
echo "No LDAP_HOST specified!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
${ldap_script}/bin/ldap "$@" | jq '[ .[].member] | add'
|
||||||
|
'';
|
||||||
|
ldapl_script = pkgs.writeShellScriptBin "ldapl" ''
|
||||||
|
if ! [ "$LDAP_HOST" ]; then
|
||||||
|
echo "No LDAP_HOST specified!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
${ldap_script}/bin/ldap "*$@*" | jq -r '.[].name'
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
[
|
||||||
|
ldap_script
|
||||||
|
ldapm_script
|
||||||
|
ldapg_script
|
||||||
|
ldapl_script
|
||||||
|
jq_parse
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
56
modules/darwin/homebrew.nix
Normal file
56
modules/darwin/homebrew.nix
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
|
||||||
|
# Homebrew - Mac-specific packages that aren't in Nix
|
||||||
|
config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
|
# Requires Homebrew to be installed
|
||||||
|
system.activationScripts.preUserActivation.text = ''
|
||||||
|
if ! xcode-select --version 2>/dev/null; then
|
||||||
|
$DRY_RUN_CMD xcode-select --install
|
||||||
|
fi
|
||||||
|
if ! /opt/homebrew/bin/brew --version 2>/dev/null; then
|
||||||
|
$DRY_RUN_CMD /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Add homebrew paths to CLI path
|
||||||
|
home-manager.users.${config.user}.home.sessionPath = [
|
||||||
|
"/opt/homebrew/bin/"
|
||||||
|
"/opt/homebrew/opt/trash/bin/"
|
||||||
|
];
|
||||||
|
|
||||||
|
homebrew = {
|
||||||
|
enable = true;
|
||||||
|
onActivation = {
|
||||||
|
autoUpdate = false; # Don't update during rebuild
|
||||||
|
cleanup = "zap"; # Uninstall all programs not declared
|
||||||
|
upgrade = true;
|
||||||
|
};
|
||||||
|
global = {
|
||||||
|
brewfile = true; # Run brew bundle from anywhere
|
||||||
|
lockfiles = false; # Don't save lockfile (since running from anywhere)
|
||||||
|
};
|
||||||
|
brews = [
|
||||||
|
"trash" # Delete files and folders to trash instead of rm
|
||||||
|
];
|
||||||
|
casks = [
|
||||||
|
"1password" # 1Password will not launch from Nix on macOS
|
||||||
|
# "gitify" # Git notifications in menu bar (downgrade manually from 4.6.1)
|
||||||
|
"keybase" # GUI on Nix not available for macOS
|
||||||
|
# "logitech-g-hub" # Mouse and keyboard management
|
||||||
|
"logitune" # Logitech webcam firmware
|
||||||
|
"meetingbar" # Show meetings in menu bar
|
||||||
|
"scroll-reverser" # Different scroll style for mouse vs. trackpad
|
||||||
|
"notunes" # Don't launch Apple Music with the play button
|
||||||
|
"steam" # Not packaged for Nixon macOS
|
||||||
|
"epic-games" # Not packaged for Nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
295
pkgs/mathesar/package.nix
Normal file
295
pkgs/mathesar/package.nix
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
{
|
||||||
|
runtimeShell,
|
||||||
|
python313,
|
||||||
|
python313Packages,
|
||||||
|
fetchFromGitHub,
|
||||||
|
fetchPypi,
|
||||||
|
fetchurl,
|
||||||
|
gettext,
|
||||||
|
unzip,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
|
||||||
|
django-modern-rpc = python313Packages.buildPythonPackage rec {
|
||||||
|
pname = "django_modern_rpc";
|
||||||
|
version = "1.1.0";
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
hash = "sha256-+LBIfkBxe9lvfZIqPI2lFSshTZBL1NpmCWBAgToyJns=";
|
||||||
|
};
|
||||||
|
doCheck = false;
|
||||||
|
pyproject = true;
|
||||||
|
build-system = [
|
||||||
|
python313Packages.setuptools
|
||||||
|
python313Packages.wheel
|
||||||
|
python313Packages.poetry-core
|
||||||
|
];
|
||||||
|
};
|
||||||
|
django-property-filter = python313Packages.buildPythonPackage rec {
|
||||||
|
pname = "django_property_filter";
|
||||||
|
version = "1.3.0";
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
hash = "sha256-dpsF4hm0S4lQ6tIRJ0bXgPjWTr1fq1NSCZP0M6L4Efk=";
|
||||||
|
};
|
||||||
|
doCheck = false;
|
||||||
|
pyproject = true;
|
||||||
|
build-system = [
|
||||||
|
python313Packages.setuptools
|
||||||
|
python313Packages.wheel
|
||||||
|
python313Packages.django
|
||||||
|
python313Packages.django-filter
|
||||||
|
];
|
||||||
|
};
|
||||||
|
django-fernet-encrypted-fields = python313Packages.buildPythonPackage rec {
|
||||||
|
pname = "django-fernet-encrypted-fields";
|
||||||
|
version = "0.3.0";
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
hash = "sha256-OAMb2vFySm6IXuE3zGaivX3DcmxDjhiep+RHmewLqbM=";
|
||||||
|
};
|
||||||
|
doCheck = false;
|
||||||
|
pyproject = true;
|
||||||
|
build-system = [
|
||||||
|
python313Packages.setuptools
|
||||||
|
python313Packages.wheel
|
||||||
|
];
|
||||||
|
propagatedBuildInputs = with python313Packages; [
|
||||||
|
django
|
||||||
|
cryptography
|
||||||
|
];
|
||||||
|
};
|
||||||
|
drf-access-policy = python313Packages.buildPythonPackage rec {
|
||||||
|
pname = "drf-access-policy";
|
||||||
|
version = "1.5.0";
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
hash = "sha256-EsahQYIgjUBUSi/W8GXbc7pvYLPRJ6kpJg6A3RkrjL8=";
|
||||||
|
};
|
||||||
|
doCheck = false;
|
||||||
|
pyproject = true;
|
||||||
|
build-system = [
|
||||||
|
python313Packages.setuptools
|
||||||
|
python313Packages.wheel
|
||||||
|
];
|
||||||
|
propagatedBuildInputs = with python313Packages; [
|
||||||
|
pyparsing
|
||||||
|
djangorestframework
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
pythonPkg = python313.override {
|
||||||
|
self = python313;
|
||||||
|
packageOverrides = pyfinal: pyprev: {
|
||||||
|
inherit
|
||||||
|
django-modern-rpc
|
||||||
|
django-property-filter
|
||||||
|
django-fernet-encrypted-fields
|
||||||
|
drf-access-policy
|
||||||
|
# psycopg-binary
|
||||||
|
;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
python = pythonPkg.withPackages (
|
||||||
|
ps: with ps; [
|
||||||
|
gunicorn
|
||||||
|
django
|
||||||
|
clevercsv
|
||||||
|
django
|
||||||
|
dj-database-url
|
||||||
|
django-filter
|
||||||
|
django-modern-rpc
|
||||||
|
django-property-filter
|
||||||
|
djangorestframework
|
||||||
|
django-fernet-encrypted-fields
|
||||||
|
drf-access-policy
|
||||||
|
frozendict
|
||||||
|
gunicorn
|
||||||
|
psycopg
|
||||||
|
# psycopg-binary
|
||||||
|
psycopg2-binary
|
||||||
|
requests
|
||||||
|
sqlalchemy
|
||||||
|
whitenoise
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
staticAssets = fetchurl {
|
||||||
|
url = "https://github.com/mathesar-foundation/mathesar/releases/download/0.2.2/static_files.zip";
|
||||||
|
sha256 = "sha256-1X2zFpCSwilUxhqHlCw/tg8C5zVcVL6CxDa9yh0ylGA=";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
python313Packages.buildPythonApplication rec {
|
||||||
|
pname = "mathesar";
|
||||||
|
version = "0.2.2";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "mathesar-foundation";
|
||||||
|
repo = "mathesar";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "sha256-LHxFJpPV0GJfokSPzfZQO44bBg/+QjXsk04Ry9uhUAs=";
|
||||||
|
};
|
||||||
|
format = "other";
|
||||||
|
nativeBuildInputs = [ unzip ];
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
python.pkgs.gunicorn
|
||||||
|
python.pkgs.django
|
||||||
|
];
|
||||||
|
buildInputs = [
|
||||||
|
gettext
|
||||||
|
];
|
||||||
|
dependencies = [
|
||||||
|
pythonPkg.pkgs.clevercsv
|
||||||
|
pythonPkg.pkgs.django
|
||||||
|
pythonPkg.pkgs.dj-database-url
|
||||||
|
pythonPkg.pkgs.django-filter
|
||||||
|
pythonPkg.pkgs.django-modern-rpc
|
||||||
|
pythonPkg.pkgs.django-property-filter
|
||||||
|
pythonPkg.pkgs.djangorestframework
|
||||||
|
pythonPkg.pkgs.django-fernet-encrypted-fields
|
||||||
|
pythonPkg.pkgs.drf-access-policy
|
||||||
|
pythonPkg.pkgs.frozendict
|
||||||
|
pythonPkg.pkgs.gunicorn
|
||||||
|
pythonPkg.pkgs.psycopg
|
||||||
|
pythonPkg.pkgs.psycopg2-binary
|
||||||
|
pythonPkg.pkgs.requests
|
||||||
|
pythonPkg.pkgs.sqlalchemy
|
||||||
|
pythonPkg.pkgs.whitenoise
|
||||||
|
];
|
||||||
|
|
||||||
|
# Manually unzip the extra zip file into a temporary directory
|
||||||
|
postUnpack = ''
|
||||||
|
mkdir -p $TMPDIR/unzipped
|
||||||
|
unzip ${staticAssets} -d $TMPDIR/unzipped
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Override the default build phase to prevent it from looking for setup.py
|
||||||
|
# Add any non-Python build commands here if needed (e.g., building frontend assets)
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
echo "Skipping standard Python build phase; application files copied in installPhase."
|
||||||
|
# If you had frontend assets to build, you'd run the command here, e.g.:
|
||||||
|
# npm install
|
||||||
|
# npm run build
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
# This copies the application code into the Nix store output
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
# Destination: python's site-packages directory within $out
|
||||||
|
# This makes 'import mathesar', 'import db', etc. work more easily.
|
||||||
|
INSTALL_PATH="$out/lib/${python.libPrefix}/site-packages/${pname}"
|
||||||
|
mkdir -p "$INSTALL_PATH"
|
||||||
|
|
||||||
|
echo "Copying application code to $INSTALL_PATH"
|
||||||
|
|
||||||
|
# Copy all essential source directories needed at runtime
|
||||||
|
# Adjust this list based on mathesar's actual structure and runtime needs!
|
||||||
|
cp -r mathesar "$INSTALL_PATH/"
|
||||||
|
cp -r db "$INSTALL_PATH/"
|
||||||
|
cp -r config "$INSTALL_PATH/"
|
||||||
|
cp -r translations "$INSTALL_PATH/"
|
||||||
|
cp -r mathesar_ui "$INSTALL_PATH/" # If needed
|
||||||
|
|
||||||
|
# Copy the management script
|
||||||
|
cp manage.py "$INSTALL_PATH/"
|
||||||
|
|
||||||
|
# Copy assets from unzipped directory
|
||||||
|
mkdir -p "$INSTALL_PATH/mathesar/static/mathesar"
|
||||||
|
cp -r $TMPDIR/unzipped/static_files/* "$INSTALL_PATH/mathesar/static/mathesar"
|
||||||
|
|
||||||
|
# Create wrapper scripts in $out/bin for easy execution
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
|
||||||
|
# Wrapper for manage.py
|
||||||
|
# It ensures the app code is in PYTHONPATH and runs manage.py
|
||||||
|
echo "Creating manage.py wrapper..."
|
||||||
|
cat <<EOF > $out/bin/mathesar-manage
|
||||||
|
#!${python.interpreter}
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# Add the installation path to the Python path
|
||||||
|
sys.path.insert(0, "$INSTALL_PATH")
|
||||||
|
|
||||||
|
# Set DJANGO_SETTINGS_MODULE environment variable if required by mathesar
|
||||||
|
# You might need to adjust 'config.settings.production' to the actual settings file used
|
||||||
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.production')
|
||||||
|
|
||||||
|
# Change directory to where manage.py is, if necessary for relative paths
|
||||||
|
# os.chdir("$INSTALL_PATH")
|
||||||
|
|
||||||
|
print(f"Running manage.py from: $INSTALL_PATH/manage.py")
|
||||||
|
print(f"Python path includes: $INSTALL_PATH")
|
||||||
|
print(f"Executing with args: {sys.argv[1:]}")
|
||||||
|
|
||||||
|
# Find manage.py and execute it
|
||||||
|
manage_py_path = os.path.join("$INSTALL_PATH", "manage.py")
|
||||||
|
if not os.path.exists(manage_py_path):
|
||||||
|
print(f"Error: manage.py not found at {manage_py_path}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Prepare arguments for execute_from_command_line
|
||||||
|
# The first argument should be the script name itself
|
||||||
|
argv = [manage_py_path] + sys.argv[1:]
|
||||||
|
|
||||||
|
try:
|
||||||
|
from django.core.management import execute_from_command_line
|
||||||
|
execute_from_command_line(argv)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error executing manage.py: {e}", file=sys.stderr)
|
||||||
|
# Optionally re-raise or exit with error
|
||||||
|
import traceback
|
||||||
|
traceback.print_exc()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
EOF
|
||||||
|
chmod +x $out/bin/mathesar-manage
|
||||||
|
|
||||||
|
# Wrapper for install
|
||||||
|
echo "Creating install wrapper..."
|
||||||
|
cat <<EOF > $out/bin/mathesar-install
|
||||||
|
#!${runtimeShell}
|
||||||
|
# Add the app to the Python Path
|
||||||
|
export PYTHONPATH="$INSTALL_PATH:\${"PYTHONPATH:-"}"
|
||||||
|
|
||||||
|
# Set Django settings module if needed
|
||||||
|
export DJANGO_SETTINGS_MODULE='config.settings.production'
|
||||||
|
|
||||||
|
# Change to the app directory
|
||||||
|
cd "$INSTALL_PATH"
|
||||||
|
${python}/bin/python -m mathesar.install
|
||||||
|
EOF
|
||||||
|
chmod +x $out/bin/mathesar-install
|
||||||
|
|
||||||
|
# Wrapper for gunicorn (example)
|
||||||
|
# Assumes mathesar uses a standard wsgi entry point, e.g., config/wsgi.py
|
||||||
|
# Adjust 'config.wsgi:application' if necessary
|
||||||
|
echo "Creating gunicorn wrapper..."
|
||||||
|
cat <<EOF > $out/bin/mathesar-gunicorn
|
||||||
|
#!${runtimeShell}
|
||||||
|
# Add the app to the Python Path
|
||||||
|
export PYTHONPATH="$INSTALL_PATH:\${"PYTHONPATH:-"}"
|
||||||
|
|
||||||
|
# Set Django settings module if needed
|
||||||
|
export DJANGO_SETTINGS_MODULE='config.settings.production'
|
||||||
|
|
||||||
|
# Change to the app directory if gunicorn needs it
|
||||||
|
# cd "$INSTALL_PATH"
|
||||||
|
|
||||||
|
# Execute gunicorn, passing along any arguments
|
||||||
|
# Ensure the gunicorn package is in propagatedBuildInputs
|
||||||
|
exec ${python}/bin/gunicorn config.wsgi:application "\$@"
|
||||||
|
EOF
|
||||||
|
chmod +x $out/bin/mathesar-gunicorn
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
}
|
@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation rec {
|
||||||
pname = "bypass-paywalls-clean";
|
pname = "bypass-paywalls-clean";
|
||||||
version = "4.0.6.1";
|
version = "4.1.1.4";
|
||||||
src = builtins.fetchGit {
|
src = builtins.fetchGit {
|
||||||
url = "https://gitflic.ru/project/magnolia1234/bpc_uploads.git";
|
url = "https://git.masu.rs/noah/bpc-uploads.git";
|
||||||
ref = "main";
|
ref = "main";
|
||||||
rev = "85a367220f5ae2181354f65fb1093e2f1ac9e417";
|
rev = "9166b13355721b047878f259e04c2e9b476b4210";
|
||||||
};
|
};
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
allowSubstitutes = true;
|
allowSubstitutes = true;
|
||||||
|
91
pkgs/prometheus-actual-exporter/package.nix
Normal file
91
pkgs/prometheus-actual-exporter/package.nix
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
nodejs_18,
|
||||||
|
buildNpmPackage,
|
||||||
|
nodePackages,
|
||||||
|
python3,
|
||||||
|
gcc,
|
||||||
|
gnumake,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
buildNpmPackage (finalAttrs: rec {
|
||||||
|
pname = "prometheus-actual-exporter";
|
||||||
|
|
||||||
|
version = "1.1.5";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "sakowicz";
|
||||||
|
repo = "actual-budget-prometheus-exporter";
|
||||||
|
tag = version;
|
||||||
|
hash = "sha256-DAmWr1HngxAjhOJW9OnMfDqpxBcZT+Tpew/w/YYJIYU=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [ ./tsconfig.patch ];
|
||||||
|
|
||||||
|
npmDepsHash = "sha256-N8xqRYFelolNGTEhG22M7KJ7B5U/uW7o+/XfLF8rHMg=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
nodejs_18
|
||||||
|
nodePackages.typescript
|
||||||
|
python3
|
||||||
|
nodePackages.node-gyp
|
||||||
|
gcc
|
||||||
|
gnumake
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
echo "Removing better-sqlite3 install script before npm install"
|
||||||
|
sed -i '/"install"/d' node_modules/better-sqlite3/package.json || true
|
||||||
|
sed -i '/"install"/d' package.json || true
|
||||||
|
'';
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
echo "Disabling prebuilt install script from better-sqlite3"
|
||||||
|
find node_modules/better-sqlite3 -name package.json -exec sed -i '/"install"/d' {} +
|
||||||
|
rm -f node_modules/better-sqlite3/build/Release/better_sqlite3.node || true
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
# export npm_config_build_from_source=true
|
||||||
|
# export npm_config_unsafe_perm=true
|
||||||
|
# export BINARY_SITE=none
|
||||||
|
# export PATH=${nodePackages.node-gyp}/bin:$PATH
|
||||||
|
# export npm_config_node_gyp=${nodePackages.node-gyp}/bin/node-gyp
|
||||||
|
|
||||||
|
# npm rebuild better-sqlite3 --build-from-source --verbose
|
||||||
|
|
||||||
|
npm run build
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/{bin,lib}
|
||||||
|
cp -r . $out/lib/prometheus-actual-exporter
|
||||||
|
makeWrapper ${lib.getExe nodejs_18} $out/bin/prometheus-actual-exporter \
|
||||||
|
--add-flags "$out/lib/prometheus-actual-exporter/dist/app.js"
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
echo "Removing prebuilt .node and rebuilding better-sqlite3"
|
||||||
|
|
||||||
|
export npm_config_build_from_source=true
|
||||||
|
export npm_config_unsafe_perm=true
|
||||||
|
export BINARY_SITE=none
|
||||||
|
export PATH=${nodePackages.node-gyp}/bin:$PATH
|
||||||
|
export npm_config_node_gyp=${nodePackages.node-gyp}/bin/node-gyp
|
||||||
|
|
||||||
|
sed -i '/"install"/d' node_modules/better-sqlite3/package.json
|
||||||
|
rm -f node_modules/better-sqlite3/build/Release/better_sqlite3.node || true
|
||||||
|
|
||||||
|
npm rebuild better-sqlite3 --build-from-source --verbose
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Prometheus exporter for Actual Budget";
|
||||||
|
homepage = "https://github.com/sakowicz/actual-budget-prometheus-exporter";
|
||||||
|
mainProgram = "prometheus-actual-exporter";
|
||||||
|
};
|
||||||
|
})
|
12
pkgs/prometheus-actual-exporter/tsconfig.patch
Normal file
12
pkgs/prometheus-actual-exporter/tsconfig.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/tsconfig.json b/tsconfig.json
|
||||||
|
index 5106135..3a340f6 100644
|
||||||
|
--- a/tsconfig.json
|
||||||
|
+++ b/tsconfig.json
|
||||||
|
@@ -8,5 +8,6 @@
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"lib": ["es2020"],
|
||||||
|
"outDir": "./dist"
|
||||||
|
- }
|
||||||
|
+ },
|
||||||
|
+ "include": ["src/**/*", "app.ts"]
|
||||||
|
}
|
@ -199,19 +199,28 @@ in
|
|||||||
exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} aerc %u";
|
exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} aerc %u";
|
||||||
};
|
};
|
||||||
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
|
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
"${config.xsession.windowManager.i3.config.modifier}+Shift+e" = "exec ${
|
"${config.xsession.windowManager.i3.config.modifier}+Shift+e" =
|
||||||
# Don't name the script `aerc` or it will affect grep
|
let
|
||||||
builtins.toString (
|
terminal = config.nmasur.presets.services.i3.terminal;
|
||||||
pkgs.writeShellScript "focus-mail.sh" ''
|
startupCommand =
|
||||||
count=$(ps aux | grep -c aerc)
|
if terminal == pkgs.wezterm then
|
||||||
if [ "$count" -eq 1 ]; then
|
"start --class com.noah.aerc -- aerc"
|
||||||
i3-msg "exec --no-startup-id ${lib.getExe config.nmasur.presets.services.i3.terminal} start --class aerc -- aerc"
|
else
|
||||||
sleep 0.25
|
"--class=com.noah.aerc --command=aerc";
|
||||||
fi
|
in
|
||||||
i3-msg "[class=aerc] focus"
|
"exec ${
|
||||||
''
|
# Don't name the script `aerc` or it will affect grep
|
||||||
)
|
builtins.toString (
|
||||||
}";
|
pkgs.writeShellScript "focus-mail.sh" ''
|
||||||
|
count=$(ps aux | grep -c aerc)
|
||||||
|
if [ "$count" -eq 1 ]; then
|
||||||
|
i3-msg "exec --no-startup-id ${lib.getExe terminal} ${startupCommand}"
|
||||||
|
sleep 0.25
|
||||||
|
fi
|
||||||
|
i3-msg "[class=com.noah.aerc] focus"
|
||||||
|
''
|
||||||
|
)
|
||||||
|
}";
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.fish.shellAbbrs = {
|
programs.fish.shellAbbrs = {
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.aws-ssh;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.nmasur.presets.programs.aws-ssh.enable = lib.mkEnableOption "AWS SSH tools";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
# Ignore wine directories in searches
|
||||||
|
home.file.".ssh/aws-ssm-ssh-proxy-command.sh" = {
|
||||||
|
text = builtins.readFile ./aws-ssm-ssh-proxy-command.sh;
|
||||||
|
executable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# For documentation see https://github.com/qoomon/aws-ssm-ssh-proxy-command
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
getInstanceId() {
|
||||||
|
local instance_name="$1"
|
||||||
|
local instance_id=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=${instance_name}" --query "Reservations[].Instances[?State.Name == 'running'].InstanceId" --output text)
|
||||||
|
|
||||||
|
echo "${instance_id}"
|
||||||
|
}
|
||||||
|
|
||||||
|
instance_name="$1"
|
||||||
|
ssh_user="$2"
|
||||||
|
ssh_port="$3"
|
||||||
|
ssh_public_key_path="$4"
|
||||||
|
|
||||||
|
ec2InstanceIdPattern='^m?i-[0-9a-f]{8,17}$'
|
||||||
|
if [[ $instance_name =~ $ec2InstanceIdPattern ]]; then
|
||||||
|
instance_id=$instance_name
|
||||||
|
else
|
||||||
|
instance_id=$(getInstanceId "$instance_name")
|
||||||
|
|
||||||
|
if [[ -z $instance_id ]]; then
|
||||||
|
echo "Found no running instances with name \"${instance_name}\"."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Instance ID for \"${instance_name}\": \"${instance_id}\""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
REGION_SEPARATOR='--'
|
||||||
|
if echo "$instance_id" | grep -q -e "${REGION_SEPARATOR}"; then
|
||||||
|
export AWS_REGION="${instance_id##*"${REGION_SEPARATOR}"}"
|
||||||
|
instance_id="${instance_id%%"$REGION_SEPARATOR"*}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
>/dev/stderr echo "Add public key ${ssh_public_key_path} for ${ssh_user} at instance ${instance_id} for 10 seconds"
|
||||||
|
ssh_public_key="$(cat "${ssh_public_key_path}")"
|
||||||
|
aws ssm send-command \
|
||||||
|
--instance-ids "${instance_id}" \
|
||||||
|
--document-name 'AWS-RunShellScript' \
|
||||||
|
--comment "Add an SSH public key to authorized_keys for 10 seconds" \
|
||||||
|
--parameters commands="
|
||||||
|
\"
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
mkdir -p ~${ssh_user}/.ssh && cd ~${ssh_user}/.ssh
|
||||||
|
|
||||||
|
authorized_key='${ssh_public_key} ssm-session'
|
||||||
|
|
||||||
|
echo \\\"\${authorized_key}\\\" >> authorized_keys
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
|
||||||
|
(grep -v -F \\\"\${authorized_key}\\\" authorized_keys || true) > authorized_keys~
|
||||||
|
mv authorized_keys~ authorized_keys
|
||||||
|
\"
|
||||||
|
"
|
||||||
|
|
||||||
|
>/dev/stderr echo "Start ssm session to instance ${instance_id}"
|
||||||
|
aws ssm start-session \
|
||||||
|
--target "${instance_id}" \
|
||||||
|
--document-name 'AWS-StartSSHSession' \
|
||||||
|
--parameters "portNumber=${ssh_port}"
|
@ -23,7 +23,7 @@ in
|
|||||||
|
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = if pkgs.stdenv.isDarwin then pkgs.firefox-unwrapped else pkgs.firefox;
|
package = pkgs.firefox;
|
||||||
profiles.default = {
|
profiles.default = {
|
||||||
id = 0;
|
id = 0;
|
||||||
name = "default";
|
name = "default";
|
||||||
|
@ -14,6 +14,10 @@ in
|
|||||||
options.nmasur.presets.programs.ghostty.enable = lib.mkEnableOption "Ghostty terminal";
|
options.nmasur.presets.programs.ghostty.enable = lib.mkEnableOption "Ghostty terminal";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
# Set the i3 terminal
|
||||||
|
nmasur.presets.services.i3.terminal = config.programs.ghostty.package;
|
||||||
|
|
||||||
programs.ghostty = {
|
programs.ghostty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@ -29,13 +33,17 @@ in
|
|||||||
macos-titlebar-style = "hidden";
|
macos-titlebar-style = "hidden";
|
||||||
window-decoration = false;
|
window-decoration = false;
|
||||||
macos-non-native-fullscreen = true;
|
macos-non-native-fullscreen = true;
|
||||||
fullscreen = true;
|
fullscreen = if pkgs.stdenv.isDarwin then true else false;
|
||||||
keybind = [
|
keybind = [
|
||||||
"super+t=unbind" # Pass super-t to underlying tool (e.g. zellij tabs)
|
"super+t=unbind" # Pass super-t to underlying tool (e.g. zellij tabs)
|
||||||
"super+shift+]=unbind"
|
"super+shift+]=unbind"
|
||||||
"super+shift+[=unbind"
|
"super+shift+[=unbind"
|
||||||
"ctrl+tab=unbind"
|
"ctrl+tab=unbind"
|
||||||
"ctrl+shift+tab=unbind"
|
"ctrl+shift+tab=unbind"
|
||||||
|
"ctrl+tab=text:\\x1b[9;5u"
|
||||||
|
"ctrl+shift+tab=text:\\x1b[9;6u"
|
||||||
|
"super+k=unbind"
|
||||||
|
"super+shift+e=unbind"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
themes."gruvbox" = {
|
themes."gruvbox" = {
|
||||||
|
@ -22,6 +22,9 @@ in
|
|||||||
# Set Neovim as the default app for text editing and manual pages
|
# Set Neovim as the default app for text editing and manual pages
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = lib.mkForce "${lib.getExe pkgs.helix}";
|
EDITOR = lib.mkForce "${lib.getExe pkgs.helix}";
|
||||||
|
MANPAGER = lib.mkForce "sh -c 'col -bx | ${lib.getExe pkgs.helix}'";
|
||||||
|
MANWIDTH = 87;
|
||||||
|
MANROFFOPT = "-c";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Create quick aliases for launching Helix
|
# Create quick aliases for launching Helix
|
||||||
@ -78,12 +81,20 @@ in
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "markdown";
|
name = "markdown";
|
||||||
auto-format = true;
|
auto-format = false;
|
||||||
language-servers = [ "marksman" ];
|
language-servers = [ "marksman" ];
|
||||||
formatter = {
|
formatter = {
|
||||||
command = lib.getExe pkgs.mdformat;
|
command = lib.getExe pkgs.mdformat;
|
||||||
args = [ "-" ];
|
args = [ "-" ];
|
||||||
};
|
};
|
||||||
|
# Allows return key to continue the token on the next line
|
||||||
|
comment-tokens = [
|
||||||
|
"-"
|
||||||
|
"+"
|
||||||
|
"*"
|
||||||
|
"- [ ]"
|
||||||
|
">"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "tfvars";
|
name = "tfvars";
|
||||||
@ -117,13 +128,57 @@ in
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ignores = [
|
||||||
|
"content/.obsidian/**"
|
||||||
|
];
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
theme = "base16";
|
theme = "base16";
|
||||||
|
|
||||||
keys.normal = {
|
keys.normal = {
|
||||||
|
|
||||||
|
# Use the enter key to save the file
|
||||||
|
ret = ":write";
|
||||||
|
|
||||||
|
# Get out of multiple cursors and selection
|
||||||
|
esc = [
|
||||||
|
"collapse_selection"
|
||||||
|
"keep_primary_selection"
|
||||||
|
];
|
||||||
|
|
||||||
# Enable and disable inlay hints
|
# Enable and disable inlay hints
|
||||||
space.H = ":toggle lsp.display-inlay-hints";
|
space.H = ":toggle lsp.display-inlay-hints";
|
||||||
|
|
||||||
|
# Toggle floating pane
|
||||||
|
space.t = ":sh zellij action toggle-floating-panes";
|
||||||
|
|
||||||
|
# Today's note
|
||||||
|
space.n = ":vsplit %sh{fish -c 'generate-today'}";
|
||||||
|
|
||||||
|
# Open lazygit
|
||||||
|
# Unfortunately, this breaks mouse input and the terminal after quitting Helix
|
||||||
|
space.l = [
|
||||||
|
":write-all"
|
||||||
|
":new"
|
||||||
|
":insert-output ${lib.getExe pkgs.lazygit}"
|
||||||
|
":buffer-close!"
|
||||||
|
":redraw"
|
||||||
|
":reload-all"
|
||||||
|
":set mouse false"
|
||||||
|
":set mouse true"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Open yazi
|
||||||
|
# https://github.com/sxyazi/yazi/pull/2461
|
||||||
|
# Won't work until next Helix release
|
||||||
|
C-y = [
|
||||||
|
":sh rm -f /tmp/unique-file"
|
||||||
|
":insert-output ${lib.getExe pkgs.yazi} %{buffer_name} --chooser-file=/tmp/unique-file"
|
||||||
|
":insert-output echo \\x1b[?1049h\\x1b[?2004h > /dev/tty"
|
||||||
|
":open %sh{cat /tmp/unique-file}"
|
||||||
|
":redraw"
|
||||||
|
];
|
||||||
|
|
||||||
# Extend selection above
|
# Extend selection above
|
||||||
X = "select_line_above";
|
X = "select_line_above";
|
||||||
|
|
||||||
@ -140,19 +195,6 @@ in
|
|||||||
"paste_before"
|
"paste_before"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Copy lines up or down
|
|
||||||
A-J = [
|
|
||||||
"extend_to_line_bounds"
|
|
||||||
"yank"
|
|
||||||
"paste_after"
|
|
||||||
];
|
|
||||||
|
|
||||||
A-K = [
|
|
||||||
"extend_to_line_bounds"
|
|
||||||
"yank"
|
|
||||||
"paste_before"
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
editor = {
|
editor = {
|
||||||
@ -193,6 +235,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
themes."${config.programs.helix.settings.theme}" = {
|
themes."${config.programs.helix.settings.theme}" = {
|
||||||
|
@ -0,0 +1,96 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.lazygit;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.nmasur.presets.programs.lazygit.enable = lib.mkEnableOption "Lazygit git TUI";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.lazygit = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
git.paging = {
|
||||||
|
# useConfig = true;
|
||||||
|
pager = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight";
|
||||||
|
};
|
||||||
|
os = {
|
||||||
|
edit = "${config.home.sessionVariables.EDITOR} {{filename}}";
|
||||||
|
editAtLine = "${config.home.sessionVariables.EDITOR} {{filename}}:{{line}}";
|
||||||
|
editAtLineAndWait = "${config.home.sessionVariables.EDITOR} {{filename}}:{{line}}";
|
||||||
|
openDirInEditor = "${config.home.sessionVariables.EDITOR}";
|
||||||
|
open = "${config.home.sessionVariables.EDITOR} {{filename}}";
|
||||||
|
};
|
||||||
|
customCommands = [
|
||||||
|
{
|
||||||
|
key = "N";
|
||||||
|
context = "files";
|
||||||
|
command = "git add -N {{.SelectedFile.Name}}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<a-enter>";
|
||||||
|
context = "global";
|
||||||
|
command =
|
||||||
|
let
|
||||||
|
openGitUrl = pkgs.writeShellScriptBin "open-git-url" ''
|
||||||
|
# Try to get the remote URL using two common methods; suppress stderr for individual commands.
|
||||||
|
# "git remote get-url origin" is generally preferred.
|
||||||
|
# "git config --get remote.origin.url" is a fallback.
|
||||||
|
URL=$(git remote get-url origin 2>/dev/null || git config --get remote.origin.url 2>/dev/null);
|
||||||
|
|
||||||
|
# Check if a URL was actually found.
|
||||||
|
if [ -z "$URL" ]; then
|
||||||
|
# Send error message to stderr so it might appear in lazygit logs or notifications.
|
||||||
|
echo "Lazygit: Could not determine remote URL for 'origin'." >&2;
|
||||||
|
# Exit with an error code.
|
||||||
|
exit 1;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Check if the URL is a GitHub SSH URL and convert it to HTTPS.
|
||||||
|
# This uses echo and grep to check for "@github.com" and then sed for transformation.
|
||||||
|
if echo "$URL" | grep -q "@github.com:"; then
|
||||||
|
# Transform git@github.com:user/repo.git to https://github.com/user/repo
|
||||||
|
# The first sed handles the main transformation.
|
||||||
|
# The second sed removes a trailing .git if present, for a cleaner URL.
|
||||||
|
URL=$(echo "$URL" | sed "s|git@github.com:|https://github.com/|" | sed "s|\.git$||");
|
||||||
|
# Optional: Log the transformation for debugging.
|
||||||
|
# echo "Lazygit: Transformed GitHub SSH URL to '$URL'" >&2;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Determine the operating system.
|
||||||
|
OS="$(uname -s)";
|
||||||
|
|
||||||
|
# Optional: Echo for debugging. This might appear in lazygit logs or as a brief message.
|
||||||
|
# Remove " >&2" if you want to see it as a potential success message in lazygit UI (if it shows stdout).
|
||||||
|
# echo "Lazygit: Opening URL '$URL' on '$OS'" >&2;
|
||||||
|
|
||||||
|
# Execute the appropriate command to open the URL based on the OS.
|
||||||
|
case "$OS" in
|
||||||
|
Darwin*) # macOS
|
||||||
|
open "$URL";;
|
||||||
|
Linux*) # Linux
|
||||||
|
xdg-open "$URL";;
|
||||||
|
*) # Unsupported OS
|
||||||
|
echo "Lazygit: Unsupported OS ('$OS'). Could not open URL." >&2;
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
lib.getExe openGitUrl;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.fish.shellAbbrs = {
|
||||||
|
lg = "lazygit";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
@ -31,5 +31,9 @@ in
|
|||||||
pkgs.mpvScripts.mpv-delete-file
|
pkgs.mpvScripts.mpv-delete-file
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.fish.shellAbbrs = {
|
||||||
|
mpvs = "mpv --shuffle=yes";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -44,21 +44,22 @@ in
|
|||||||
programs.fish.functions = {
|
programs.fish.functions = {
|
||||||
syncnotes = {
|
syncnotes = {
|
||||||
description = "Full git commit on notes";
|
description = "Full git commit on notes";
|
||||||
body = builtins.readFile lib.getExe (
|
body =
|
||||||
pkgs.writers.writeFishBin "syncnotes" {
|
let
|
||||||
makeWrapperArgs = [
|
git = lib.getExe pkgs.git;
|
||||||
"--prefix"
|
in
|
||||||
"PATH"
|
# fish
|
||||||
":"
|
''
|
||||||
"${lib.makeBinPath [ pkgs.git ]}"
|
${git} -C ${cfg.path} pull
|
||||||
];
|
${git} -C ${cfg.path} add -A
|
||||||
} builtins.readFile ./syncnotes.fish
|
${git} -C ${cfg.path} commit -m autosync
|
||||||
);
|
${git} -C ${cfg.path} push
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
note = {
|
note = {
|
||||||
description = "Edit or create a note";
|
description = "Edit or create a note";
|
||||||
argumentNames = "filename";
|
argumentNames = "filename";
|
||||||
body = builtins.readFile lib.getExe (
|
body = lib.getExe (
|
||||||
pkgs.writers.writeFishBin "note" {
|
pkgs.writers.writeFishBin "note" {
|
||||||
makeWrapperArgs = [
|
makeWrapperArgs = [
|
||||||
"--prefix"
|
"--prefix"
|
||||||
@ -69,7 +70,44 @@ in
|
|||||||
pkgs.fzf
|
pkgs.fzf
|
||||||
]}"
|
]}"
|
||||||
];
|
];
|
||||||
} builtins.readFile ./note.fish
|
} (builtins.readFile ./note.fish)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
generate-today = {
|
||||||
|
description = "Create today's note";
|
||||||
|
body = # fish
|
||||||
|
''
|
||||||
|
set filename $(date +%Y-%m-%d_%a)
|
||||||
|
set filepath "${cfg.path}/content/journal/$filename.md"
|
||||||
|
if ! test -e "$filepath"
|
||||||
|
echo -e "---\ntitle: $(date +"%A, %B %e %Y") - $(curl "https://wttr.in/New+York+City?u&format=1")\ntags: [ journal ]\n---\n\n" > "$filepath"
|
||||||
|
end
|
||||||
|
echo "$filepath"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
today = {
|
||||||
|
description = "Edit or create today's note";
|
||||||
|
body = lib.getExe (
|
||||||
|
pkgs.writers.writeFishBin "today"
|
||||||
|
{
|
||||||
|
makeWrapperArgs = [
|
||||||
|
"--prefix"
|
||||||
|
"PATH"
|
||||||
|
":"
|
||||||
|
"${lib.makeBinPath [
|
||||||
|
pkgs.curl
|
||||||
|
pkgs.helix
|
||||||
|
]}"
|
||||||
|
];
|
||||||
|
} # fish
|
||||||
|
''
|
||||||
|
set filename $(date +%Y-%m-%d_%a)
|
||||||
|
set filepath "${cfg.path}/content/journal/$filename.md"
|
||||||
|
if ! test -e "$filepath"
|
||||||
|
echo -e "---\ntitle: $(date +"%A, %B %e %Y") - $(curl "https://wttr.in/New+York+City?u&format=1")\ntags: [ journal ]\n---\n\n" > "$filepath"
|
||||||
|
end
|
||||||
|
hx "$filepath"
|
||||||
|
''
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -24,7 +24,14 @@ in
|
|||||||
# description = "Open a session in Zellij";
|
# description = "Open a session in Zellij";
|
||||||
body = # fish
|
body = # fish
|
||||||
''
|
''
|
||||||
zoxide query --interactive | xargs -I {} sh -c 'zellij pipe --plugin file:$(which zellij-switch.wasm) -- "--cwd {} --layout default --session $(basename {})"' \\;
|
set TARGET_DIR $(zoxide query --interactive)
|
||||||
|
if test -z $TARGET_DIR
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
if test "$TARGET_DIR" = $(pwd)
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
zellij pipe --plugin file:$(which zellij-switch.wasm) -- "--cwd $TARGET_DIR --layout default --session $(basename $TARGET_DIR)"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -65,39 +72,41 @@ in
|
|||||||
# exitShellOnExit = true;
|
# exitShellOnExit = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
default_mode = "locked";
|
||||||
# default_layout = "compact-top";
|
# default_layout = "compact-top";
|
||||||
# Remove border
|
# Remove border
|
||||||
pane_frames = false;
|
pane_frames = false;
|
||||||
# Scrollback
|
# Scrollback
|
||||||
scrollback_editor = config.home.sessionVariables.EDITOR;
|
scrollback_editor = config.home.sessionVariables.EDITOR;
|
||||||
# plugins = {
|
|
||||||
# autolock = {
|
show_startup_tips = false;
|
||||||
# _props = {
|
|
||||||
# location = "https://github.com/fresh2dev/zellij-autolock/releases/download/0.2.2/zellij-autolock.wasm";
|
|
||||||
# };
|
|
||||||
# is_enabled = {
|
|
||||||
# _args = [ true ];
|
|
||||||
# };
|
|
||||||
# triggers = {
|
|
||||||
# _args = [ "vim|nvim|hx|git|fzf|zoxide|atuin|gh" ];
|
|
||||||
# };
|
|
||||||
# reaction_seconds = {
|
|
||||||
# _args = [ "0.3" ];
|
|
||||||
# };
|
|
||||||
# print_to_log = {
|
|
||||||
# _args = [ true ];
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# load_plugins = {
|
|
||||||
# autolock = { };
|
|
||||||
# };
|
|
||||||
keybinds = {
|
keybinds = {
|
||||||
normal = {
|
normal = {
|
||||||
};
|
};
|
||||||
|
session = {
|
||||||
|
"bind \"w\"" = {
|
||||||
|
LaunchOrFocusPlugin = {
|
||||||
|
_args = [ "session-manager" ];
|
||||||
|
floating = true;
|
||||||
|
move_to_focused_tab = true;
|
||||||
|
};
|
||||||
|
SwitchToMode = {
|
||||||
|
_args = [ "locked" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scroll = {
|
||||||
|
"bind \"e\"" = {
|
||||||
|
EditScrollback = { };
|
||||||
|
SwitchToMode = {
|
||||||
|
_args = [ "locked" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
shared = {
|
shared = {
|
||||||
"bind \"Alt Shift p\"" = {
|
"bind \"Alt Shift p\"" = {
|
||||||
"Run" = {
|
Run = {
|
||||||
_args = [
|
_args = [
|
||||||
"${pkgs.fish}/bin/fish"
|
"${pkgs.fish}/bin/fish"
|
||||||
"-c"
|
"-c"
|
||||||
@ -107,29 +116,70 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
"bind \"Super Shift ]\"" = {
|
"bind \"Super Shift ]\"" = {
|
||||||
"GoToNextTab" = { };
|
GoToNextTab = { };
|
||||||
};
|
};
|
||||||
"bind \"Super Shift [\"" = {
|
"bind \"Super Shift [\"" = {
|
||||||
"GoToPreviousTab" = { };
|
GoToPreviousTab = { };
|
||||||
};
|
};
|
||||||
"bind \"Super t\"" = {
|
"bind \"Ctrl Tab\"" = {
|
||||||
"NewTab" = { };
|
GoToNextTab = { };
|
||||||
|
};
|
||||||
|
"bind \"Ctrl Shift Tab\"" = {
|
||||||
|
GoToPreviousTab = { };
|
||||||
|
};
|
||||||
|
"bind \"Super t\"" = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
NewTab = { };
|
||||||
|
};
|
||||||
|
"bind \"Alt t\"" = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
|
NewTab = { };
|
||||||
|
};
|
||||||
|
"bind \"Super k\"" = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
SwitchToMode = {
|
||||||
|
_args = [ "scroll" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"bind \"Alt k\"" = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
|
SwitchToMode = {
|
||||||
|
_args = [ "scroll" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"bind \"Super Shift e\"" = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
EditScrollback = { };
|
||||||
|
SwitchToMode = {
|
||||||
|
_args = [ "locked" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"bind \"Alt Shift e\"" = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
|
EditScrollback = { };
|
||||||
|
SwitchToMode = {
|
||||||
|
_args = [ "locked" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"bind \"Alt l\"" = {
|
||||||
|
MoveFocusOrTab = {
|
||||||
|
_args = [ "Right" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"bind \"Alt h\"" = {
|
||||||
|
MoveFocusOrTab = {
|
||||||
|
_args = [ "Left" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
theme = "custom";
|
theme = "custom";
|
||||||
themes.custom = {
|
themes.custom = {
|
||||||
fg = "${config.theme.colors.base05}";
|
fg = "${config.theme.colors.base03}";
|
||||||
bg = "${config.theme.colors.base02}";
|
bg = "${config.theme.colors.base02}";
|
||||||
black = "${config.theme.colors.base00}";
|
black = "${config.theme.colors.base00}";
|
||||||
red = "${config.theme.colors.base08}";
|
red = "${config.theme.colors.base08}";
|
||||||
green = "${config.theme.colors.base0B}";
|
green = "${config.theme.colors.base04}";
|
||||||
yellow = "${config.theme.colors.base0A}";
|
yellow = "${config.theme.colors.base0A}";
|
||||||
blue = "${config.theme.colors.base0D}";
|
blue = "${config.theme.colors.base0D}";
|
||||||
magenta = "${config.theme.colors.base0E}";
|
magenta = "${config.theme.colors.base0E}";
|
||||||
cyan = "${config.theme.colors.base0C}";
|
cyan = "${config.theme.colors.base0C}";
|
||||||
white = "${config.theme.colors.base05}";
|
white = "${config.theme.colors.base04}";
|
||||||
orange = "${config.theme.colors.base09}";
|
orange = "${config.theme.colors.base09}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -105,6 +105,9 @@ function obj:init()
|
|||||||
self.launcher:bind("", "Z", function()
|
self.launcher:bind("", "Z", function()
|
||||||
self:switch("zoom.us.app")
|
self:switch("zoom.us.app")
|
||||||
end)
|
end)
|
||||||
|
self.launcher:bind("shift", "Z", function()
|
||||||
|
self:switch("@zed@")
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function obj:switch(app)
|
function obj:switch(app)
|
||||||
|
@ -26,6 +26,7 @@ in
|
|||||||
obsidian = "${pkgs.obsidian}/Applications/Obsidian.app";
|
obsidian = "${pkgs.obsidian}/Applications/Obsidian.app";
|
||||||
slack = "${pkgs.slack}/Applications/Slack.app";
|
slack = "${pkgs.slack}/Applications/Slack.app";
|
||||||
wezterm = "${pkgs.wezterm}/Applications/WezTerm.app";
|
wezterm = "${pkgs.wezterm}/Applications/WezTerm.app";
|
||||||
|
zed = "${pkgs.zed-editor}/Applications/Zed.app";
|
||||||
};
|
};
|
||||||
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source = ./Spoons/MoveWindow.spoon;
|
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source = ./Spoons/MoveWindow.spoon;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ in
|
|||||||
ws10 = "10:X";
|
ws10 = "10:X";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
terminal = cfg.terminal.meta.mainProgram;
|
# terminal = cfg.terminal.meta.mainProgram;
|
||||||
modifier = modifier;
|
modifier = modifier;
|
||||||
assigns = {
|
assigns = {
|
||||||
"${ws1}" = [ { class = "Firefox"; } ];
|
"${ws1}" = [ { class = "Firefox"; } ];
|
||||||
@ -103,6 +103,7 @@ in
|
|||||||
{ class = "kitty"; }
|
{ class = "kitty"; }
|
||||||
{ class = "obsidian"; }
|
{ class = "obsidian"; }
|
||||||
{ class = "wezterm"; }
|
{ class = "wezterm"; }
|
||||||
|
{ class = "ghostty"; }
|
||||||
];
|
];
|
||||||
"${ws3}" = [ { class = "discord"; } ];
|
"${ws3}" = [ { class = "discord"; } ];
|
||||||
"${ws4}" = [
|
"${ws4}" = [
|
||||||
@ -213,9 +214,9 @@ in
|
|||||||
cfg.commands.lockScreen != null
|
cfg.commands.lockScreen != null
|
||||||
) "exec ${cfg.commands.lockScreen}";
|
) "exec ${cfg.commands.lockScreen}";
|
||||||
"${modifier}+Mod1+h" =
|
"${modifier}+Mod1+h" =
|
||||||
"exec --no-startup-id ${lib.getExe cfg.terminal} -e sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'";
|
"exec --no-startup-id ${lib.getExe cfg.terminal} --command sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'";
|
||||||
"${modifier}+Mod1+r" =
|
"${modifier}+Mod1+r" =
|
||||||
"exec --no-startup-id ${lib.getExe cfg.terminal} -e sh -c 'doas nixos-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'";
|
"exec --no-startup-id ${lib.getExe cfg.terminal} --command sh -c 'doas nixos-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'";
|
||||||
|
|
||||||
# Window options
|
# Window options
|
||||||
"${modifier}+q" = "kill";
|
"${modifier}+q" = "kill";
|
||||||
|
@ -35,5 +35,9 @@ in
|
|||||||
".rgignore".text = ignorePatterns;
|
".rgignore".text = ignorePatterns;
|
||||||
".fdignore".text = ignorePatterns;
|
".fdignore".text = ignorePatterns;
|
||||||
};
|
};
|
||||||
|
# Ignore in zoxide
|
||||||
|
home.sessionVariables = {
|
||||||
|
_ZO_EXCLUDE_DIRS = "$HOME/keybase/*";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,15 @@ in
|
|||||||
fi
|
fi
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
click-left = "i3-msg 'exec --no-startup-id kitty --class aerc aerc'; sleep 0.15; i3-msg '[class=aerc] focus'";
|
click-left =
|
||||||
|
let
|
||||||
|
startupCommand =
|
||||||
|
if config.nmasur.presets.services.i3.terminal == pkgs.wezterm then
|
||||||
|
"start --class aerc -- aerc"
|
||||||
|
else
|
||||||
|
"--class=aerc --command=aerc";
|
||||||
|
in
|
||||||
|
"i3-msg 'exec --no-startup-id ${config.nmasur.presets.services.i3.terminal} ${startupCommand}'; sleep 0.15; i3-msg '[class=aerc] focus'";
|
||||||
};
|
};
|
||||||
"module/network" = {
|
"module/network" = {
|
||||||
type = "internal/network";
|
type = "internal/network";
|
||||||
|
@ -41,6 +41,7 @@ in
|
|||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
pkgs.noti # Create notifications programmatically
|
pkgs.noti # Create notifications programmatically
|
||||||
|
pkgs.ice-bar # Menu bar hiding
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ in
|
|||||||
ghostty.enable = lib.mkDefault true;
|
ghostty.enable = lib.mkDefault true;
|
||||||
helix.enable = lib.mkDefault true;
|
helix.enable = lib.mkDefault true;
|
||||||
zellij.enable = lib.mkDefault true;
|
zellij.enable = lib.mkDefault true;
|
||||||
|
lazygit.enable = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
@ -37,7 +38,6 @@ in
|
|||||||
|
|
||||||
programs.gh-dash.enable = lib.mkDefault true;
|
programs.gh-dash.enable = lib.mkDefault true;
|
||||||
programs.himalaya.enable = lib.mkDefault true;
|
programs.himalaya.enable = lib.mkDefault true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,13 +24,13 @@ in
|
|||||||
discord.enable = lib.mkDefault true;
|
discord.enable = lib.mkDefault true;
|
||||||
dotfiles.enable = lib.mkDefault true;
|
dotfiles.enable = lib.mkDefault true;
|
||||||
firefox.enable = lib.mkDefault true;
|
firefox.enable = lib.mkDefault true;
|
||||||
|
ghostty.enable = lib.mkDefault true;
|
||||||
mpv.enable = lib.mkDefault true;
|
mpv.enable = lib.mkDefault true;
|
||||||
nautilus.enable = lib.mkDefault true;
|
nautilus.enable = lib.mkDefault true;
|
||||||
notmuch.enable = lib.mkDefault true;
|
notmuch.enable = lib.mkDefault true;
|
||||||
nsxiv.enable = lib.mkDefault true;
|
nsxiv.enable = lib.mkDefault true;
|
||||||
obsidian.enable = lib.mkDefault true;
|
obsidian.enable = lib.mkDefault true;
|
||||||
rofi.enable = lib.mkDefault true;
|
rofi.enable = lib.mkDefault true;
|
||||||
wezterm.enable = lib.mkDefault true;
|
|
||||||
xclip.enable = lib.mkDefault true;
|
xclip.enable = lib.mkDefault true;
|
||||||
zathura.enable = lib.mkDefault true;
|
zathura.enable = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
|
@ -61,6 +61,7 @@ in
|
|||||||
neovim.enable = lib.mkDefault true;
|
neovim.enable = lib.mkDefault true;
|
||||||
nix-index.enable = lib.mkDefault true;
|
nix-index.enable = lib.mkDefault true;
|
||||||
nixpkgs.enable = lib.mkDefault true;
|
nixpkgs.enable = lib.mkDefault true;
|
||||||
|
notes.enable = lib.mkDefault true;
|
||||||
prettyping.enable = lib.mkDefault true;
|
prettyping.enable = lib.mkDefault true;
|
||||||
ripgrep.enable = lib.mkDefault true;
|
ripgrep.enable = lib.mkDefault true;
|
||||||
weather.enable = lib.mkDefault true;
|
weather.enable = lib.mkDefault true;
|
||||||
|
@ -39,11 +39,14 @@ in
|
|||||||
pkgs.nmasur.terraform-init # Quick shortcut for initializing Terraform backend
|
pkgs.nmasur.terraform-init # Quick shortcut for initializing Terraform backend
|
||||||
];
|
];
|
||||||
|
|
||||||
|
programs.fish.shellAliases.ec2 = "aws-ec2";
|
||||||
|
|
||||||
nmasur.presets = {
|
nmasur.presets = {
|
||||||
fonts.enable = lib.mkDefault true;
|
fonts.enable = lib.mkDefault true;
|
||||||
programs = {
|
programs = {
|
||||||
_1password.enable = lib.mkDefault true;
|
_1password.enable = lib.mkDefault true;
|
||||||
atuin.enable = lib.mkDefault true;
|
atuin.enable = lib.mkDefault true;
|
||||||
|
aws-ssh.enable = lib.mkDefault true;
|
||||||
bash.enable = lib.mkDefault true;
|
bash.enable = lib.mkDefault true;
|
||||||
bat.enable = lib.mkDefault true;
|
bat.enable = lib.mkDefault true;
|
||||||
direnv.enable = lib.mkDefault true;
|
direnv.enable = lib.mkDefault true;
|
||||||
@ -52,6 +55,7 @@ in
|
|||||||
firefox.enable = lib.mkDefault true;
|
firefox.enable = lib.mkDefault true;
|
||||||
fish.enable = lib.mkDefault true;
|
fish.enable = lib.mkDefault true;
|
||||||
fzf.enable = lib.mkDefault true;
|
fzf.enable = lib.mkDefault true;
|
||||||
|
ghostty.enable = lib.mkDefault true;
|
||||||
git-work.enable = lib.mkDefault true;
|
git-work.enable = lib.mkDefault true;
|
||||||
git.enable = lib.mkDefault true;
|
git.enable = lib.mkDefault true;
|
||||||
github.enable = lib.mkDefault true;
|
github.enable = lib.mkDefault true;
|
||||||
@ -64,7 +68,6 @@ in
|
|||||||
starship.enable = lib.mkDefault true;
|
starship.enable = lib.mkDefault true;
|
||||||
terraform.enable = lib.mkDefault true;
|
terraform.enable = lib.mkDefault true;
|
||||||
weather.enable = lib.mkDefault true;
|
weather.enable = lib.mkDefault true;
|
||||||
wezterm.enable = lib.mkDefault true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,85 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
|
||||||
cfg = config.nmasur.presets.services.actualbudget;
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
options.nmasur.presets.services.actualbudget = {
|
|
||||||
enable = lib.mkEnableOption "ActualBudget budgeting service";
|
|
||||||
port = lib.mkOption {
|
|
||||||
type = lib.types.port;
|
|
||||||
description = "Port to use for the localhost";
|
|
||||||
default = 5006;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
|
|
||||||
virtualisation.podman.enable = true;
|
|
||||||
|
|
||||||
# Create a shared group for generic services
|
|
||||||
users.groups.shared = { };
|
|
||||||
|
|
||||||
users.users.actualbudget = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "shared";
|
|
||||||
uid = 980;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Create budget directory, allowing others to manage it
|
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
"d /var/lib/actualbudget 0770 actualbudget shared"
|
|
||||||
];
|
|
||||||
|
|
||||||
virtualisation.oci-containers.containers.actualbudget = {
|
|
||||||
workdir = null;
|
|
||||||
volumes = [ "/var/lib/actualbudget:/data" ];
|
|
||||||
user = "${toString (builtins.toString config.users.users.actualbudget.uid)}";
|
|
||||||
pull = "missing";
|
|
||||||
privileged = false;
|
|
||||||
ports = [ "127.0.0.1:${builtins.toString cfg.port}:5006" ];
|
|
||||||
networks = [ ];
|
|
||||||
log-driver = "journald";
|
|
||||||
labels = {
|
|
||||||
app = "actualbudget";
|
|
||||||
};
|
|
||||||
image = "ghcr.io/actualbudget/actual-server:25.1.0";
|
|
||||||
hostname = null;
|
|
||||||
environmentFiles = [ ];
|
|
||||||
environment = {
|
|
||||||
DEBUG = "actual:config"; # Enable debug logging
|
|
||||||
ACTUAL_TRUSTED_PROXIES = builtins.concatStringsSep "," [ "127.0.0.1" ];
|
|
||||||
};
|
|
||||||
dependsOn = [ ];
|
|
||||||
autoStart = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Allow web traffic to Caddy
|
|
||||||
nmasur.presets.services.caddy.routes = [
|
|
||||||
{
|
|
||||||
match = [ { host = [ hostnames.budget ]; } ];
|
|
||||||
handle = [
|
|
||||||
{
|
|
||||||
handler = "reverse_proxy";
|
|
||||||
upstreams = [ { dial = "localhost:${builtins.toString cfg.port}"; } ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
# Configure Cloudflare DNS to point to this machine
|
|
||||||
services.cloudflare-dyndns.domains = [ hostnames.budget ];
|
|
||||||
|
|
||||||
# Backups
|
|
||||||
services.restic.backups.default.paths = [ "/var/lib/actualbudget" ];
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,17 @@
|
|||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyA0VjJk
|
||||||
|
a2c0Q1pVcEVCdjd3OE1xZ2s2a29YdjdWTUZkK1hnMFNwVTRVMVFVCkhpY2tjQmFz
|
||||||
|
K3dzVEgrcnBuRlgyZzYwWGtiQzh6RjNtNmNUb2FSVCsxMTAKLT4gc3NoLWVkMjU1
|
||||||
|
MTkgWXlTVU1RIFM3cVpTaVFYK1NEYitaSEtLUE5yVDhXTGNHSnN3UjdROTVDeXND
|
||||||
|
VjFUQjAKYnF6RWtjaFZNM1cxSTJUV0p4UExoenhicGpESEk0R2Q0VncrUldwSndi
|
||||||
|
UQotPiBzc2gtZWQyNTUxOSBuanZYNUEgOTltRmlNNFQzTWpsVVdHUXBqS1lKRldJ
|
||||||
|
dW9kVHJqZFRrQWFTK2ZDMi8zZwpTUlRqZUkzSWlibGhMVzRwQmdldVREeGpsRTRr
|
||||||
|
L1FUZHowdVprNlEvVVJ3Ci0+IHNzaC1lZDI1NTE5IENxSU9VQSBjeUZRdmtENUQw
|
||||||
|
Ukoxb3NNYU5JeE1OSVBGcWhPZS9mY1BEb0tVbnB3bVdNCnRHRXhpd0dEbWZuNEg0
|
||||||
|
a1BMdk5yc2x6Y0EzQXo1U1hwZnJuUzJ1ckt1VDAKLT4gc3NoLWVkMjU1MTkgejFP
|
||||||
|
Y1p3IExJeHhnTlgrSXpVYkxWdnZldlR4Q1JzZE9PWFowbWJSQ1pTbkp3YWFoUzgK
|
||||||
|
L1ErSnZ3cWVXeVU0TThPaFVsVjBTdHh1YlQ3cTduQ2xIejZScEJSZGp6MAotLS0g
|
||||||
|
SFJpT2JlSktBaFZhdjlyOWRhLzJiT21OditjczZJcU9iMFJMUzhNdzVZMAp0yAab
|
||||||
|
89wcmBqmuQLoFYRs/Tj+UvWa4UaXvNFGZM9zIH8WEJDxO+QviDL1NETOuI4T9X1q
|
||||||
|
JYa7c4PAwV8KgMkdKpHVJ3sN1+Kg82UXXSCTjpRHa33OBZTC
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
@ -0,0 +1,17 @@
|
|||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBQY3lv
|
||||||
|
SG9kNkN1S3RZdE80cWJTd0k0UkdiNmZXT085Um9Vd0FGYWpObHc0CnQvVjF4L0xu
|
||||||
|
ajNvQkFueVREaWxLWFhyNGkvL2ZlOHdEYXdTRkowbk9WUUUKLT4gc3NoLWVkMjU1
|
||||||
|
MTkgWXlTVU1RIE5aT3ZlMDJjNkJaZmFDV3ZKSHo5UEhnTlM5dHk1R0dYSXFNOWxJ
|
||||||
|
OThEaGcKcmNsMVUxaTI1b0FtbFdtMzlVYVZxcnllVmlwaDRuUkR4d3BNbm12eU5x
|
||||||
|
OAotPiBzc2gtZWQyNTUxOSBuanZYNUEgR3BmQk5Nd0E3RC9UQ1ZoWmxTNlhubjVZ
|
||||||
|
Vi8xL3V3YTNqUVh2ZVZrRkNtawpLaWhxY1FQajJZeGJzakd3ZDhrbmd4T2JNVlUy
|
||||||
|
dzFOMGcwRmJML3hPTzRBCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBDNTQzZ0syVHNS
|
||||||
|
TTJPUm9OMUcyNTY5VGZkNEVESmt2eVQrSzJlUEgwS0E4ClRqbk9FTGZNRG9zSHlC
|
||||||
|
UXQyN0N1WDN4MHNrNFgrUjdQQUc4aU8xajRVdkEKLT4gc3NoLWVkMjU1MTkgejFP
|
||||||
|
Y1p3IHpiaEsvbCtwMlkyMWpJMS9XWExudDRpaE4xMmQ4eXIzU2RaTGd3TUg3eHMK
|
||||||
|
anpIV01KVDdvZGI5M1dmME1KaC9jcFkrVlN4TmlXN21tUnhIYnlEMEdHcwotLS0g
|
||||||
|
dy9LeGpiNkowQkNwOFNFeHUveGRveDRhajVtNEU3SWE0MEhOYTl6ZHM0QQq/Dg+2
|
||||||
|
OrqL8yCAai3J8djSktSmhAc/jdbEnHVdl3943Enyrn+Zz2HcUe96RySrleCt+QxL
|
||||||
|
Dezprhehi7jK7KmIAGOspicA0e/4GQ8txsb2fQ==
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
@ -0,0 +1,132 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.actualbudget;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.services.actualbudget = {
|
||||||
|
enable = lib.mkEnableOption "ActualBudget budgeting service";
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
description = "Port to use for the localhost";
|
||||||
|
default = 5006;
|
||||||
|
};
|
||||||
|
prometheusPort = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
description = "Port to use for prometheus actual exporter";
|
||||||
|
default = 5007;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
services.actual = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
port = cfg.port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# systemd.services.prometheus-actual-exporter = {
|
||||||
|
# enable = true;
|
||||||
|
# description = "Prometheus exporter for Actual budget";
|
||||||
|
# serviceConfig = {
|
||||||
|
# DynamicUser = true;
|
||||||
|
# Environment = [
|
||||||
|
# "ACTUAL_SERVER_URL=https://${hostnames.budget}:443"
|
||||||
|
# "PORT=${builtins.toString cfg.prometheusPort}"
|
||||||
|
# ];
|
||||||
|
# EnvironmentFile = [
|
||||||
|
# config.secrets.actualbudget-password.dest
|
||||||
|
# config.secrets.actualbudget-budget-id.dest
|
||||||
|
# ];
|
||||||
|
# ExecStart = lib.getExe pkgs.nmasur.prometheus-actual-exporter;
|
||||||
|
# };
|
||||||
|
# wantedBy = [
|
||||||
|
# "multi-user.target"
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Used for prometheus exporter
|
||||||
|
virtualisation.podman.enable = true;
|
||||||
|
|
||||||
|
# Create a shared group for generic services
|
||||||
|
users.groups.shared = { };
|
||||||
|
|
||||||
|
users.users.actualbudget = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "shared";
|
||||||
|
uid = 980;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualisation.oci-containers.containers.actualbudget-prometheus-exporter = {
|
||||||
|
workdir = null;
|
||||||
|
user = builtins.toString config.users.users.actualbudget.uid;
|
||||||
|
pull = "missing";
|
||||||
|
privileged = false;
|
||||||
|
ports = [ "127.0.0.1:5007:3001" ];
|
||||||
|
networks = [ ];
|
||||||
|
log-driver = "journald";
|
||||||
|
labels = {
|
||||||
|
app = "actualbudget-prometheus-exporter";
|
||||||
|
};
|
||||||
|
image = "docker.io/sakowicz/actual-budget-prometheus-exporter:1.1.5";
|
||||||
|
hostname = null;
|
||||||
|
environmentFiles = [
|
||||||
|
config.secrets.actualbudget-password.dest
|
||||||
|
config.secrets.actualbudget-budget-id.dest
|
||||||
|
];
|
||||||
|
environment = {
|
||||||
|
ACTUAL_SERVER_URL = "https://${hostnames.budget}:443";
|
||||||
|
};
|
||||||
|
# dependsOn = [ "actualbudget" ];
|
||||||
|
autoStart = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nmasur.presets.services.prometheus-exporters.scrapeTargets = [
|
||||||
|
"127.0.0.1:${builtins.toString cfg.prometheusPort}"
|
||||||
|
];
|
||||||
|
|
||||||
|
secrets.actualbudget-password = {
|
||||||
|
source = ./actualbudget-password.age;
|
||||||
|
dest = "${config.secretsDirectory}/actualbudget-password";
|
||||||
|
owner = builtins.toString config.users.users.actualbudget.uid;
|
||||||
|
group = builtins.toString config.users.users.actualbudget.uid;
|
||||||
|
};
|
||||||
|
secrets.actualbudget-budget-id = {
|
||||||
|
source = ./actualbudget-budget-id.age;
|
||||||
|
dest = "${config.secretsDirectory}/actualbudget-budget-id";
|
||||||
|
owner = builtins.toString config.users.users.actualbudget.uid;
|
||||||
|
group = builtins.toString config.users.users.actualbudget.uid;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow web traffic to Caddy
|
||||||
|
nmasur.presets.services.caddy.routes = [
|
||||||
|
{
|
||||||
|
match = [ { host = [ hostnames.budget ]; } ];
|
||||||
|
handle = [
|
||||||
|
{
|
||||||
|
handler = "reverse_proxy";
|
||||||
|
upstreams = [ { dial = "localhost:${builtins.toString cfg.port}"; } ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
# Configure Cloudflare DNS to point to this machine
|
||||||
|
services.cloudflare-dyndns.domains = [ hostnames.budget ];
|
||||||
|
|
||||||
|
# Backups
|
||||||
|
services.restic.backups.default.paths = [ "/var/lib/actual" ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -103,8 +103,9 @@ in
|
|||||||
value = name;
|
value = name;
|
||||||
}) hostname_map;
|
}) hostname_map;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
metrics = { }; # Enables Prometheus metrics
|
||||||
};
|
};
|
||||||
apps.http.servers.metrics = { }; # Enables Prometheus metrics
|
|
||||||
apps.tls.automation.policies = cfg.tlsPolicies;
|
apps.tls.automation.policies = cfg.tlsPolicies;
|
||||||
|
|
||||||
# Setup logging to journal and files
|
# Setup logging to journal and files
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBkckt3
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBKNXVz
|
||||||
c1NtVEo1bm1XREk2ZE9PL1FkOFd0LzQ1R0J4TXN4VGd2clVrZ25NCjZKenFTdHFK
|
RCtWVURFT2JmbUk1dXdWQjJuSVBoamVGaHZUWDNJL1pyREZyTFN3CnVpTnRKSDR5
|
||||||
MWVZSXI0NXdVTkhJQXRFRFBRRnIxRHZaOHY1UWVDYW9vTm8KLT4gc3NoLWVkMjU1
|
U0N3QWZ6L3hpcEVEampWSUlDTVFvWmRuWEFKVUE0bmVDZ0UKLT4gc3NoLWVkMjU1
|
||||||
MTkgWXlTVU1RIHBmRERwcXdGanBVV0JOczg0Q0hOa1dVM09EeGMxWmJDMm9YU2Mx
|
MTkgWXlTVU1RIGJ2czRsU2RWN2RaMnc5NEZNbEhxWTNTdkEydWpjd1NVQ0k2RHFC
|
||||||
djhxQkUKS2U2aHVza2JNdzltRW5wcWhqaTVPUEZoZGNWN2szQXlVYjZ3eXpwc2ZE
|
anVubU0KQkhxL1kwSGt3N21OSVJwcHJCM2p0TnlOQVJ5c2VTejJoL2ZZUGk4REtL
|
||||||
OAotPiBzc2gtZWQyNTUxOSBuanZYNUEgbWU0WXA4RjVZWFdPcXZ5M1UwT3lON1JD
|
bwotPiBzc2gtZWQyNTUxOSBuanZYNUEgaXFJR3IrVHVNQVhjNFFmN1d3ZHhZS04r
|
||||||
cGhlRXZ2NEhWMHdEMitLWERqRQpKRGgwMUhISWE1Uk1ka1dteGo0dlhZcmNjVjN6
|
K0FGRXppQkE4MHZhVUI5SHBWRQpxbDdqc2RYZmo0ejBOYUFCcGtrbXVZbDBJVVRJ
|
||||||
QmJBQWo0Mko4aE5jUm9rCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBLaU9sSmRzMlFG
|
Q2ZlQlFtYmQ4Z3dqcGIwCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBzNlQxNGxDRlNz
|
||||||
NjBYYTBYeFErNXJwZGVtZ1kvVmVCOXBDZWVoNWhDZ2hrCnE2dkJJSk8rbDRvSHYy
|
amVMWjI2WFhIYTFIMDQxY1NDRXYvWU9LaUFQMVZMZjMwCm15a3lPVkkyMnZoOGx0
|
||||||
bEVTdXg0VTg1RzZUNi84K1ZvOVB2aUJzNHVPRkEKLT4gc3NoLWVkMjU1MTkgejFP
|
bTdYbWtZWGQzTVBJb2g4WmM5Z25tcHhKWDNZencKLT4gc3NoLWVkMjU1MTkgejFP
|
||||||
Y1p3IEM0Mnlockc2SlA1bXJhdnpQNXFnQ2w5bzFSTWpIajJybTBIM3VuNTN5bFUK
|
Y1p3IG1VWm1JRUUwUWhnWVMvdjdmaUZNN1F1eExXRU1xaXpzY2VFMTE3SWE3dzQK
|
||||||
bXNIUVVhTzlRMUJTSEpJUURUMXZjRU5zczNjYnBUVVFmMDVEZllONjFjWQotLS0g
|
SWN5b3llVU5WSk1HNW1Wc1dvVm82a1NyQVQ4NmhjRExuQzB2UGpPSGFDcwotLS0g
|
||||||
NXdIUWduN2Q2eXFzNlFueFR6OWxITVBranpsNTdXaktiSFZ0TTBxRFNlNAr9JzVO
|
ZkdtZ1o4KzlveDBCdkx4eFc2RGNjUjFrb1ZyZXdjZHpLVWtkN2ZaenlKOArVhdOP
|
||||||
Rhx5rG7CSGdYfeMcuzye4jyE2yiVKi5TVr/qp3vbDpyDQKZLlAUSF/K0rTY9K7Rm
|
2ifpmAQNOfBbQyY9UPhxPxrF7jnZ8B5jumaip8QJuh6xEYkF17tSEzTPVf6ER9wr
|
||||||
ocY+y/V9ffh3LO2m1Y6BkRqWRJ7v4wcsc3jNGjDHlSB7EqnOwMCXyQAg
|
OrND9IR2kbZVFAxb3/uUD9I3jegJ
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
|
@ -67,8 +67,8 @@ in
|
|||||||
|
|
||||||
# Tell Caddy to use Cloudflare DNS for ACME challenge validation
|
# Tell Caddy to use Cloudflare DNS for ACME challenge validation
|
||||||
services.caddy.package = pkgs.caddy.withPlugins {
|
services.caddy.package = pkgs.caddy.withPlugins {
|
||||||
plugins = [ "github.com/caddy-dns/cloudflare@v0.0.0-20250228175314-1fb64108d4de" ];
|
plugins = [ "github.com/caddy-dns/cloudflare@v0.2.1" ];
|
||||||
hash = "sha256-YYpsf8HMONR1teMiSymo2y+HrKoxuJMKIea5/NEykGc=";
|
hash = "sha256-saKJatiBZ4775IV2C5JLOmZ4BwHKFtRZan94aS5pO90=";
|
||||||
};
|
};
|
||||||
nmasur.presets.services.caddy.tlsPolicies = [
|
nmasur.presets.services.caddy.tlsPolicies = [
|
||||||
{
|
{
|
||||||
@ -90,11 +90,14 @@ in
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
# Allow Caddy to read Cloudflare API key for DNS validation
|
systemd.services.caddy.serviceConfig = {
|
||||||
systemd.services.caddy.serviceConfig.EnvironmentFile = [
|
# Allow Caddy to read Cloudflare API key for DNS validation
|
||||||
config.secrets.cloudflare-api.dest
|
# Allow Caddy to use letsencrypt account key for TLS verification
|
||||||
config.secrets.letsencrypt-key.dest
|
EnvironmentFile = [
|
||||||
];
|
config.secrets.letsencrypt-key.dest
|
||||||
|
config.secrets.cloudflare-api-prefixed.dest
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# Private key is used for LetsEncrypt
|
# Private key is used for LetsEncrypt
|
||||||
secrets.letsencrypt-key = {
|
secrets.letsencrypt-key = {
|
||||||
@ -111,15 +114,21 @@ in
|
|||||||
owner = "caddy";
|
owner = "caddy";
|
||||||
group = "caddy";
|
group = "caddy";
|
||||||
};
|
};
|
||||||
|
secrets.cloudflare-api-prefixed = {
|
||||||
|
source = ./cloudflare-api.age;
|
||||||
|
dest = "${config.secretsDirectory}/cloudflare-api-prefixed";
|
||||||
|
owner = "caddy";
|
||||||
|
group = "caddy";
|
||||||
|
prefix = "CLOUDFLARE_API_TOKEN=";
|
||||||
|
};
|
||||||
# Wait for secret to exist
|
# Wait for secret to exist
|
||||||
systemd.services.caddy = {
|
systemd.services.caddy = {
|
||||||
after = [
|
after = [
|
||||||
"cloudflare-api-secret.service"
|
"cloudflare-api-prefixed-secret.service"
|
||||||
"letsencrypt-key-secret.service"
|
"letsencrypt-key-secret.service"
|
||||||
];
|
];
|
||||||
requires = [
|
requires = [
|
||||||
"cloudflare-api-secret.service"
|
"cloudflare-api-prefixed-secret.service"
|
||||||
"letsencrypt-key-secret.service"
|
"letsencrypt-key-secret.service"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -148,7 +157,23 @@ in
|
|||||||
systemd.services.cloudflare-dyndns = lib.mkIf config.services.cloudflare-dyndns.enable {
|
systemd.services.cloudflare-dyndns = lib.mkIf config.services.cloudflare-dyndns.enable {
|
||||||
after = [ "cloudflare-api-secret.service" ];
|
after = [ "cloudflare-api-secret.service" ];
|
||||||
requires = [ "cloudflare-api-secret.service" ];
|
requires = [ "cloudflare-api-secret.service" ];
|
||||||
|
script =
|
||||||
|
let
|
||||||
|
args =
|
||||||
|
[ "--cache-file /var/lib/cloudflare-dyndns/ip.cache" ]
|
||||||
|
++ (if config.services.cloudflare-dyndns.ipv4 then [ "-4" ] else [ "-no-4" ])
|
||||||
|
++ (if config.services.cloudflare-dyndns.ipv6 then [ "-6" ] else [ "-no-6" ])
|
||||||
|
++ lib.optional config.services.cloudflare-dyndns.deleteMissing "--delete-missing"
|
||||||
|
++ lib.optional config.services.cloudflare-dyndns.proxied "--proxied";
|
||||||
|
in
|
||||||
|
lib.mkForce ''
|
||||||
|
export CLOUDFLARE_API_TOKEN=$(cat ''${CREDENTIALS_DIRECTORY}/apiToken)
|
||||||
|
exec ${lib.getExe pkgs.cloudflare-dyndns} ${toString args}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Enable the home-made service that we created for non-proxied records
|
||||||
|
services.cloudflare-dyndns-noproxy.enable = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,9 @@ in
|
|||||||
# Configure Cloudflare DNS to point to this machine
|
# Configure Cloudflare DNS to point to this machine
|
||||||
services.cloudflare-dyndns.domains = [ hostnames.git ];
|
services.cloudflare-dyndns.domains = [ hostnames.git ];
|
||||||
|
|
||||||
|
# Configure DNS to point to this machine without a proxy
|
||||||
|
nmasur.presets.services.cloudflare.noProxyDomains = [ "ssh.${hostnames.git}" ];
|
||||||
|
|
||||||
# Scrape the metrics endpoint for Prometheus.
|
# Scrape the metrics endpoint for Prometheus.
|
||||||
nmasur.presets.services.prometheus-exporters.scrapeTargets = [
|
nmasur.presets.services.prometheus-exporters.scrapeTargets = [
|
||||||
"127.0.0.1:${builtins.toString config.services.gitea.settings.server.HTTP_PORT}"
|
"127.0.0.1:${builtins.toString config.services.gitea.settings.server.HTTP_PORT}"
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyA2SUsv
|
||||||
|
d1R3Slo3UDhDUWNiTDcybU9mTzhycDNKVCtteHhwRXU4M0x5UVF3CkUvZHdISzE4
|
||||||
|
NU9qdy9sUGxTeTJxY2huWS9zVnRzd2o0UFpxc0FjT2lDTGMKLT4gc3NoLWVkMjU1
|
||||||
|
MTkgWXlTVU1RIG1SM3gxRzJ5RllOTXhHZC9sc1Z6U1VCc3ptTWZRYzNJQ1g4ZjRI
|
||||||
|
d3U3RVUKekNYc0VpSUw4TVJsSGNYNElxUUcwS25oczVUWnNlUTd2SXlvYlEvcE01
|
||||||
|
ZwotPiBzc2gtZWQyNTUxOSBuanZYNUEgc0JUZlkyY0dKWjhzVlMwTi8zS1VrVGt1
|
||||||
|
UGJzeURtbEZ3ZWpncWZNK2x5SQpJdVNSV2NLdHBEVThtWVBhUm1GSEEvV2s0bGZB
|
||||||
|
WFJTK0xIa01ucHBxcm1jCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBrRitXVzdvRmgz
|
||||||
|
VW5HMHpBRStuTnRDZmlCdVRra09JNE85Wkl4bkJJWkFzCkZUeTRWK0VmL21VRlpW
|
||||||
|
SWg5dnJ4UGw4aXZteUxyaXZUaGpxQkdQL0hXK0kKLT4gc3NoLWVkMjU1MTkgejFP
|
||||||
|
Y1p3IE4xSlZYbmFWZlhCQ3RibFN5Z3gzMDN5cXNDQzA4UnViUk9IclBTdE4valkK
|
||||||
|
MGx3Nkhac3NEZGh2SExUMU94NExiRlMvRndobUlJdmhBWU1CM0diL0V3ZwotLS0g
|
||||||
|
SDhvSzRFUFdGN0ZLUm9hWWV2T2tHMVdvTHlWOEZWTkZjLzd0VE12SU9kNAp2wHsq
|
||||||
|
uKxlrH9xXj17Zd3FAjRlSMjjVVOYZOVyiPMWY7MD7V5XVY0hCPnKpzX4RyYeTfqf
|
||||||
|
3W2LaWecMcRtTdRLOyCqVC+1DXtCAL/DqxIWcu3Q+zDQog==
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
@ -0,0 +1,17 @@
|
|||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBJZjI5
|
||||||
|
Y0pMd01IdVJIa2RtU3BrajNGblczeUdkWUgxdFliQmJGK2RDclhVCjVlbmRpV1Bj
|
||||||
|
K1hMTm1HZ0pnYm05YmZ0Tm9UZjVoQ3FMM2dhVkRtV1FBZWsKLT4gc3NoLWVkMjU1
|
||||||
|
MTkgWXlTVU1RIGxzbXA2NVRXbGxsY05hU0ZGWlU2MTNGVGozN2dycnBaNUZ4Ykxx
|
||||||
|
UjB0d3MKcUdRampFeTdGek9FaHVrV3Y1ay8rMGh6M2NRZjVpUHdWYVJYZENmOGty
|
||||||
|
RQotPiBzc2gtZWQyNTUxOSBuanZYNUEgamdMKzRnRldKYW9sYzJGWmR2TjRYVlRZ
|
||||||
|
SXhKT3BrNC9XdHhpUVFQSXVROApoM3BUajhmR01VeDR1MHJhMnJFUkxCOW9DckZF
|
||||||
|
TkhMd1BYODMrVm5PSGFJCi0+IHNzaC1lZDI1NTE5IENxSU9VQSAzbVJsT2pBTENF
|
||||||
|
eGUrOEdHakZzb3ExMGwyMW91TEZORmpxdUJJMUJlZEJFClV2UlFlNVBxSmlaMnNs
|
||||||
|
MTlFNzVOSjVqMVp5a1dwUVJqR3ZPRkdnY0w5dXMKLT4gc3NoLWVkMjU1MTkgejFP
|
||||||
|
Y1p3IDcrZzhhWjh4UFVSM1loTTV1UXp2NDF1cGlLUWZ2bTN0NHJiOFhESFdJQWcK
|
||||||
|
UFZzT2hmSTFlR0VNenVobktDN2xaZElwTWFZVklscFAvQmQyZjJiTU4wawotLS0g
|
||||||
|
UW8vRlpmcGV1SmR1blZRK3c0eVpGeUlZMEc5eGlRcVpnbXI5UkNUelJEYwo8Na+w
|
||||||
|
XzVV1/LPzA3kl0yDvF2b0nn1TmR903ralFbjmT2Rv/HNDVyVklIz1Jycaje8W8uV
|
||||||
|
vZGGicSNIIZbGLEYT9fMUzY1KPoU6LUx0mgGUK2PZssHmG9mbW/Jx3R6
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
@ -0,0 +1,97 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.mathesar;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.services.mathesar = {
|
||||||
|
enable = lib.mkEnableOption "Postgres web UI";
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
description = "Port to use for the localhost";
|
||||||
|
default = 8099;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
systemd.services.mathesar = {
|
||||||
|
description = "Postgres web UI";
|
||||||
|
after = [
|
||||||
|
"network.target"
|
||||||
|
"postgresql.target"
|
||||||
|
];
|
||||||
|
requires = [
|
||||||
|
"mathesar-secret.service"
|
||||||
|
"mathesar-postgres-secret.service"
|
||||||
|
];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
environment = {
|
||||||
|
POSTGRES_HOST = "127.0.0.1";
|
||||||
|
POSTGRES_DB = "mathesar_django";
|
||||||
|
POSTGRES_USER = "mathesar";
|
||||||
|
# POSTGRES_PASSWORD = "none";
|
||||||
|
POSTGRES_PORT = "5432";
|
||||||
|
ALLOWED_HOSTS = "*";
|
||||||
|
SKIP_STATIC_COLLECTION = "true";
|
||||||
|
DEBUG = "true";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
DynamicUser = true;
|
||||||
|
StateDirectory = "mathesar";
|
||||||
|
|
||||||
|
EnvironmentFile = [
|
||||||
|
config.secrets.mathesar.dest
|
||||||
|
config.secrets.mathesar-postgres.dest
|
||||||
|
];
|
||||||
|
};
|
||||||
|
preStart = "exec ${pkgs.nmasur.mathesar}/bin/mathesar-install";
|
||||||
|
script =
|
||||||
|
let
|
||||||
|
args = [ "--bind=127.0.0.1:${builtins.toString cfg.port}" ];
|
||||||
|
in
|
||||||
|
''
|
||||||
|
exec ${pkgs.nmasur.mathesar}/bin/mathesar-gunicorn ${toString args}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
secrets.mathesar = {
|
||||||
|
source = ./mathesar.age;
|
||||||
|
dest = "${config.secretsDirectory}/mathesar";
|
||||||
|
owner = builtins.toString config.users.users.postgres.uid;
|
||||||
|
group = builtins.toString config.users.users.postgres.uid;
|
||||||
|
};
|
||||||
|
secrets.mathesar-postgres = {
|
||||||
|
source = ./mathesar-postgres.age;
|
||||||
|
dest = "${config.secretsDirectory}/mathesar-postgres";
|
||||||
|
owner = builtins.toString config.users.users.postgres.uid;
|
||||||
|
group = builtins.toString config.users.users.postgres.uid;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow web traffic to Caddy
|
||||||
|
nmasur.presets.services.caddy.routes = [
|
||||||
|
{
|
||||||
|
match = [ { host = [ hostnames.mathesar ]; } ];
|
||||||
|
handle = [
|
||||||
|
{
|
||||||
|
handler = "reverse_proxy";
|
||||||
|
upstreams = [ { dial = "localhost:${builtins.toString cfg.port}"; } ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
# Configure Cloudflare DNS to point to this machine
|
||||||
|
services.cloudflare-dyndns.domains = [ hostnames.mathesar ];
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
@ -53,6 +53,9 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Don't enable vmagent because we already have victoriametrics running anyway
|
||||||
|
services.vmagent.enable = lib.mkForce false;
|
||||||
|
|
||||||
systemd.services.vmauth = lib.mkIf config.services.victoriametrics.enable {
|
systemd.services.vmauth = lib.mkIf config.services.victoriametrics.enable {
|
||||||
description = "VictoriaMetrics basic auth proxy";
|
description = "VictoriaMetrics basic auth proxy";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
let
|
let
|
||||||
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
cfg = config.nmasur.presets.services.vm-agent;
|
cfg = config.nmasur.presets.services.vmagent;
|
||||||
|
|
||||||
username = "prometheus";
|
username = "prometheus";
|
||||||
|
|
||||||
@ -30,8 +30,8 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.services.vm-agent.enable =
|
options.nmasur.presets.services.vmagent.enable =
|
||||||
lib.mkEnableOption "vm-agent VictoriaMetrics collector";
|
lib.mkEnableOption "vmagent VictoriaMetrics collector";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
82
platforms/nixos/modules/nmasur/presets/services/pgweb.nix
Normal file
82
platforms/nixos/modules/nmasur/presets/services/pgweb.nix
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (config.nmasur.settings) username hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.pgweb;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.services.pgweb = {
|
||||||
|
enable = lib.mkEnableOption "Postgres web UI";
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
description = "Port to use for the localhost";
|
||||||
|
default = 8081;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
systemd.services.pgweb = {
|
||||||
|
description = "Postgres web UI";
|
||||||
|
after = [
|
||||||
|
"postgresql.target"
|
||||||
|
];
|
||||||
|
# requires = [ "pgweb-secret.service" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
DynamicUser = false;
|
||||||
|
User = "postgres";
|
||||||
|
Group = "postgres";
|
||||||
|
StateDirectory = "pgweb";
|
||||||
|
ExecStart =
|
||||||
|
let
|
||||||
|
args = [
|
||||||
|
"--url postgres:///hippocampus?host=/run/postgresql"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
"${lib.getExe pkgs.pgweb} ${toString args}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow web traffic to Caddy
|
||||||
|
nmasur.presets.services.caddy.routes = [
|
||||||
|
{
|
||||||
|
match = [ { host = [ hostnames.postgresql ]; } ];
|
||||||
|
handle = [
|
||||||
|
{
|
||||||
|
handler = "authentication";
|
||||||
|
providers = {
|
||||||
|
http_basic = {
|
||||||
|
hash = {
|
||||||
|
algorithm = "bcrypt";
|
||||||
|
};
|
||||||
|
accounts = [
|
||||||
|
{
|
||||||
|
username = username;
|
||||||
|
password = "$2a$14$dtzWBh7ZDNgqFIJTJO7Rxe15Y189agBiWKZFJbs4sZz7QhqGQAwJS";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
handler = "reverse_proxy";
|
||||||
|
upstreams = [ { dial = "localhost:${builtins.toString cfg.port}"; } ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
# Configure Cloudflare DNS to point to this machine
|
||||||
|
services.cloudflare-dyndns.domains = [ hostnames.postgresql ];
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
@ -27,7 +27,7 @@ in
|
|||||||
# These aren't necessary, but helpful for the user
|
# These aren't necessary, but helpful for the user
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
pamixer # Audio control
|
pamixer # Audio control
|
||||||
volnoti # Volume notifications
|
nmasur.volnoti # Volume notifications
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,9 @@ in
|
|||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
nix.enable = lib.mkDefault true;
|
nix.enable = lib.mkDefault true;
|
||||||
|
openssh.enable = lib.mkDefault true;
|
||||||
prometheus-exporters.enable = lib.mkDefault true;
|
prometheus-exporters.enable = lib.mkDefault true;
|
||||||
|
vmagent.enable = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -28,10 +28,12 @@ in
|
|||||||
grafana.enable = lib.mkDefault true;
|
grafana.enable = lib.mkDefault true;
|
||||||
influxdb2.enable = lib.mkDefault true;
|
influxdb2.enable = lib.mkDefault true;
|
||||||
litestream.enable = lib.mkDefault true;
|
litestream.enable = lib.mkDefault true;
|
||||||
|
mathesar.enable = lib.mkDefault true;
|
||||||
minecraft-server.enable = lib.mkDefault true;
|
minecraft-server.enable = lib.mkDefault true;
|
||||||
n8n.enable = lib.mkDefault true;
|
n8n.enable = lib.mkDefault true;
|
||||||
nix-autoupgrade.enable = lib.mkDefault false; # On by default for communications
|
nix-autoupgrade.enable = lib.mkDefault false; # On by default for communications
|
||||||
ntfy-sh.enable = lib.mkDefault true;
|
ntfy-sh.enable = lib.mkDefault true;
|
||||||
|
pgweb.enable = lib.mkDefault true;
|
||||||
postgresql.enable = lib.mkDefault true;
|
postgresql.enable = lib.mkDefault true;
|
||||||
thelounge.enable = lib.mkDefault true;
|
thelounge.enable = lib.mkDefault true;
|
||||||
uptime-kuma.enable = lib.mkDefault true;
|
uptime-kuma.enable = lib.mkDefault true;
|
||||||
|
@ -18,6 +18,11 @@ in
|
|||||||
|
|
||||||
nmasur.presets.services.kanata.enable = lib.mkDefault true;
|
nmasur.presets.services.kanata.enable = lib.mkDefault true;
|
||||||
nmasur.presets.services.lightdm.enable = lib.mkDefault true;
|
nmasur.presets.services.lightdm.enable = lib.mkDefault true;
|
||||||
|
nmasur.presets.programs.nautilus.enable = lib.mkDefault true;
|
||||||
|
nmasur.presets.services.pipewire.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
# Lock the system
|
||||||
|
services.betterlockscreen.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# Mouse customization
|
# Mouse customization
|
||||||
services.ratbagd.enable = lib.mkDefault true;
|
services.ratbagd.enable = lib.mkDefault true;
|
||||||
|
@ -36,7 +36,6 @@ in
|
|||||||
paperless.enable = lib.mkDefault true;
|
paperless.enable = lib.mkDefault true;
|
||||||
postgresql.enable = lib.mkDefault true;
|
postgresql.enable = lib.mkDefault true;
|
||||||
samba.enable = lib.mkDefault true;
|
samba.enable = lib.mkDefault true;
|
||||||
vm-agent.enable = lib.mkDefault true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ in
|
|||||||
wslConf.automount.root = lib.mkDefault "/mnt";
|
wslConf.automount.root = lib.mkDefault "/mnt";
|
||||||
defaultUser = lib.mkDefault username;
|
defaultUser = lib.mkDefault username;
|
||||||
startMenuLaunchers = lib.mkDefault true;
|
startMenuLaunchers = lib.mkDefault true;
|
||||||
nativeSystemd = lib.mkDefault true;
|
|
||||||
wslConf.network.generateResolvConf = lib.mkDefault true; # Turn off if it breaks VPN
|
wslConf.network.generateResolvConf = lib.mkDefault true; # Turn off if it breaks VPN
|
||||||
interop.includePath = lib.mkDefault false; # Including Windows PATH will slow down Neovim command mode
|
interop.includePath = lib.mkDefault false; # Including Windows PATH will slow down Neovim command mode
|
||||||
};
|
};
|
||||||
|
@ -21,6 +21,8 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
programs.i3lock.enable = true; # Required for unlocking to work
|
||||||
|
|
||||||
# Ref: https://github.com/betterlockscreen/betterlockscreen/blob/next/system/betterlockscreen%40.service
|
# Ref: https://github.com/betterlockscreen/betterlockscreen/blob/next/system/betterlockscreen%40.service
|
||||||
systemd.services.lock = {
|
systemd.services.lock = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -6,12 +6,12 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.cloudflare-dyndns-no-proxy;
|
cfg = config.services.cloudflare-dyndns-noproxy;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.services.cloudflare-dyndns-no-proxy.enable = lib.mkEnableOption "Cloudflare dyndns client without proxying";
|
options.services.cloudflare-dyndns-noproxy.enable = lib.mkEnableOption "Cloudflare dyndns client without proxying";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
@ -37,17 +37,24 @@ in
|
|||||||
Type = "simple";
|
Type = "simple";
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
StateDirectory = "cloudflare-dyndns-noproxy";
|
StateDirectory = "cloudflare-dyndns-noproxy";
|
||||||
EnvironmentFile = config.services.cloudflare-dyndns.apiTokenFile;
|
Environment = [ "XDG_CACHE_HOME=%S/cloudflare-dyndns-noproxy/.cache" ];
|
||||||
ExecStart =
|
LoadCredential = [
|
||||||
let
|
"apiToken:${config.services.cloudflare-dyndns.apiTokenFile}"
|
||||||
args =
|
];
|
||||||
[ "--cache-file /var/lib/cloudflare-dyndns-noproxy/ip.cache" ]
|
|
||||||
++ (if config.services.cloudflare-dyndns.ipv4 then [ "-4" ] else [ "-no-4" ])
|
|
||||||
++ (if config.services.cloudflare-dyndns.ipv6 then [ "-6" ] else [ "-no-6" ])
|
|
||||||
++ lib.optional config.services.cloudflare-dyndns.deleteMissing "--delete-missing";
|
|
||||||
in
|
|
||||||
"${pkgs.cloudflare-dyndns}/bin/cloudflare-dyndns ${toString args}";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
script =
|
||||||
|
let
|
||||||
|
args =
|
||||||
|
[ "--cache-file /var/lib/cloudflare-dyndns-noproxy/ip.cache" ]
|
||||||
|
++ (if config.services.cloudflare-dyndns.ipv4 then [ "-4" ] else [ "-no-4" ])
|
||||||
|
++ (if config.services.cloudflare-dyndns.ipv6 then [ "-6" ] else [ "-no-6" ])
|
||||||
|
++ lib.optional config.services.cloudflare-dyndns.deleteMissing "--delete-missing";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
export CLOUDFLARE_API_TOKEN=$(cat ''${CREDENTIALS_DIRECTORY}/apiToken)
|
||||||
|
exec ${lib.getExe pkgs.cloudflare-dyndns} ${toString args}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user