Compare commits
88 Commits
d47394d4cc
..
omen
| Author | SHA1 | Date | |
|---|---|---|---|
| 021ca1ba83 | |||
| 4bd11e1047 | |||
| ff80098418 | |||
| 3265669503 | |||
| 7294e04ae2 | |||
| 3e1d438453 | |||
| 2f653b95ce | |||
| 1c1515678a | |||
| ee4839877c | |||
| fc2325e70b | |||
| 2ae5eb9547 | |||
| ba305e29fd | |||
| deda2c9bbc | |||
| 10c8c887db | |||
| 7b2dffbccf | |||
| 95f382107d | |||
| 3cd3099987 | |||
| 775543224e | |||
| aff608c1ce | |||
| ecb640fa45 | |||
| ceeba1c786 | |||
| b8153f0ebc | |||
| e9ec34f15c | |||
| 6c8ca29751 | |||
| bcd07532db | |||
| 2861c460c2 | |||
| 6e27e92f89 | |||
| 1002e6e0da | |||
| 24eeb5967c | |||
| b7f5474893 | |||
| 1667e362aa | |||
| cd5a49c4a6 | |||
| 244c60d9cd | |||
| f2254e5dc7 | |||
| a337ce6f2c | |||
| 278796f47c | |||
| 1ab00f286e | |||
| 771813a064 | |||
| 722cb78737 | |||
| 6bb73959c6 | |||
| fcff43adb1 | |||
| 65751a14c5 | |||
| 05f92d1f59 | |||
| 7c4ce8a637 | |||
| bb4fa7b82b | |||
| dc4df3af29 | |||
| 6b8727b29d | |||
| d64ce644c3 | |||
| 4746468a94 | |||
| 12e7d290a1 | |||
| 24f43872ce | |||
| 35bd80424d | |||
| 3447b28af1 | |||
| 2fea8238d1 | |||
| cf1174d36b | |||
| bae2b3027e | |||
| 68483c0231 | |||
| f0eba76e49 | |||
| 8357372b39 | |||
| 3c4aa74b0f | |||
| ed473ddfae | |||
| 133bad5aef | |||
| 3fc08793fe | |||
| 7f4fdcf4b9 | |||
| bfc5da791a | |||
| 9a09399ca3 | |||
| cf90d3e876 | |||
| 443020df4d | |||
| 3fc3beb4ed | |||
| 43ae292f39 | |||
| 026bf541e1 | |||
| e75951318d | |||
| bd236ed977 | |||
| b07bf102a4 | |||
| 9bfe140367 | |||
| 545a17586e | |||
| 685c1bc05a | |||
| a4f988c223 | |||
| a05de7df1f | |||
| aace1776d5 | |||
| 03965917ea | |||
| dac6b70445 | |||
| 932616177a | |||
| c1bfa64cc8 | |||
| 235cd297c5 | |||
| 0c91b1d493 | |||
| 9825270d64 | |||
| ee9573fc97 |
@@ -0,0 +1,2 @@
|
|||||||
|
result/
|
||||||
|
.devenv/
|
||||||
@@ -12,6 +12,10 @@ home-manager switch --flake .#desktop
|
|||||||
nix flake show --all-systems
|
nix flake show --all-systems
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
nix run nixpkgs#nh home switch -- --configuration john@john-pc-ubuntu .
|
||||||
|
```
|
||||||
|
|
||||||
## Layout
|
## Layout
|
||||||
|
|
||||||
- Everything under `./modules` gets auto-imported by `import-tree`
|
- Everything under `./modules` gets auto-imported by `import-tree`
|
||||||
|
|||||||
Generated
+380
-59
@@ -1,13 +1,106 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"cachix": {
|
||||||
|
"inputs": {
|
||||||
|
"devenv": [
|
||||||
|
"devenv"
|
||||||
|
],
|
||||||
|
"flake-compat": [
|
||||||
|
"devenv",
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
|
"git-hooks": [
|
||||||
|
"devenv",
|
||||||
|
"git-hooks"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1777487137,
|
||||||
|
"narHash": "sha256-TuvKVBX60mqyMT6OB5JqVEh1YIWtFMR/igLCaCdC9tw=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "cachix",
|
||||||
|
"rev": "a66a440c321d35f7193472c317f42a55ccd1cb93",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "latest",
|
||||||
|
"repo": "cachix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"crate2nix": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1772186516,
|
||||||
|
"narHash": "sha256-8s28pzmQ6TOIUzznwFibtW1CMieMUl1rYJIxoQYor58=",
|
||||||
|
"owner": "rossng",
|
||||||
|
"repo": "crate2nix",
|
||||||
|
"rev": "ba5dd398e31ee422fbe021767eb83b0650303a6e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rossng",
|
||||||
|
"repo": "crate2nix",
|
||||||
|
"rev": "ba5dd398e31ee422fbe021767eb83b0650303a6e",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"devenv": {
|
||||||
|
"inputs": {
|
||||||
|
"cachix": "cachix",
|
||||||
|
"crate2nix": "crate2nix",
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"ghostty": "ghostty",
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
|
"nix": "nix",
|
||||||
|
"nixd": "nixd",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1781195293,
|
||||||
|
"narHash": "sha256-C9OFghpvf3RzK2rGsZjjNNrTrHgFOecEkpDhFnU4QGs=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv",
|
||||||
|
"rev": "5f5109c83854577191634f7b86fc6e0c8fd44964",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751685974,
|
"lastModified": 1767039857,
|
||||||
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
|
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_2": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1777699697,
|
||||||
|
"narHash": "sha256-Eg9b/rq/ECYwNwEXs5i9wHyhxNI0JrYx2srdI2uZMaQ=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
|
"rev": "382052b74656a369c5408822af3f2501e9b1af81",
|
||||||
"revCount": 92,
|
"revCount": 94,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||||
},
|
},
|
||||||
@@ -18,11 +111,11 @@
|
|||||||
},
|
},
|
||||||
"flake-file": {
|
"flake-file": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776202746,
|
"lastModified": 1781217157,
|
||||||
"narHash": "sha256-RZVtJefKKy3Z2UvKWSbtRF3cUxt/2fHga2adN6MZQ1U=",
|
"narHash": "sha256-N3q/SP2Ropk336e9KSgLh7kpROY6P70dprYdbPIfd5c=",
|
||||||
"owner": "vic",
|
"owner": "vic",
|
||||||
"repo": "flake-file",
|
"repo": "flake-file",
|
||||||
"rev": "7d16dfaeb912d5efdff0d0eda2aabc0c934168dd",
|
"rev": "ce63eaf7ebfe04a176653f66385a7f0a36380cee",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -34,15 +127,16 @@
|
|||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"nixpkgs-lib"
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775087534,
|
"lastModified": 1778716662,
|
||||||
"narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
|
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
|
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -52,6 +146,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts_2": {
|
"flake-parts_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1778716662,
|
||||||
|
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"nvf",
|
"nvf",
|
||||||
@@ -59,11 +173,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1769996383,
|
"lastModified": 1778716662,
|
||||||
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
|
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
|
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -90,16 +204,80 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager": {
|
"ghostty": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1779069789,
|
||||||
|
"narHash": "sha256-ojo+gso45/6CVSuqfSVnlWpQ4d0QeLgwok+v/g3yu0E=",
|
||||||
|
"owner": "ghostty-org",
|
||||||
|
"repo": "ghostty",
|
||||||
|
"rev": "4b7bf0b20e3baf9c1ba10c63f2ad1fd853faea8f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "ghostty-org",
|
||||||
|
"repo": "ghostty",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"flake-compat": [
|
||||||
|
"devenv",
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776562531,
|
"lastModified": 1778507602,
|
||||||
"narHash": "sha256-Lh5Ns9DI67E+lSMOCGK0S+mFPy0mz0yOGiJTUXiR9JI=",
|
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"git-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1781365335,
|
||||||
|
"narHash": "sha256-zqDBhXMzfbdlO7F2bGHe7MOtB3xngd/+4ieMHDC+ZXo=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "5b56ad02dc643808b8af6d5f3ff179e2ce9593f4",
|
"rev": "5b6f5733726a1b2ccafb5dec6ac4ca7299fad66c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -110,11 +288,11 @@
|
|||||||
},
|
},
|
||||||
"import-tree": {
|
"import-tree": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773693634,
|
"lastModified": 1778781969,
|
||||||
"narHash": "sha256-BtZ2dtkBdSUnFPPFc+n0kcMbgaTxzFNPv2iaO326Ffg=",
|
"narHash": "sha256-Jjuz5CmSkur8KvLDoGa+vylEp+RkQtv4mt/qcMznpH0=",
|
||||||
"owner": "vic",
|
"owner": "vic",
|
||||||
"repo": "import-tree",
|
"repo": "import-tree",
|
||||||
"rev": "c41e7d58045f9057880b0d85e1152d6a4430dbf1",
|
"rev": "d321337efd0f23a9eb14a42adb7b2c29313ab274",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -125,11 +303,11 @@
|
|||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770419553,
|
"lastModified": 1780772958,
|
||||||
"narHash": "sha256-b1XqsH7AtVf2dXmq2iyRr2NC1yG7skY7Z6N2MpWHlK4=",
|
"narHash": "sha256-VKKe8r4pwCGWZ3Yr9CPN129R4S3CKLSrlYqdYz3vKpM=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "2aaffa8030d0b262176146adbb6b0e6374ce2957",
|
"rev": "0871dbf63a53610c95db04439ed8ea4d6ec9c160",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -146,20 +324,86 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1768214250,
|
"lastModified": 1779233504,
|
||||||
"narHash": "sha256-hnBZDQWUxJV3KbtvyGW5BKLO/fAwydrxm5WHCWMQTbw=",
|
"narHash": "sha256-YIKEyzh0NFQlD0O92LQQNMoVCDwV8yw1Xz0Iu+4ZC5U=",
|
||||||
"owner": "feel-co",
|
"owner": "feel-co",
|
||||||
"repo": "ndg",
|
"repo": "ndg",
|
||||||
"rev": "a6bd3c1ce2668d096e4fdaaa03ad7f03ba1fbca8",
|
"rev": "86f6644411a64d5413711895b7cf6e0e1be465b6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "feel-co",
|
"owner": "feel-co",
|
||||||
"ref": "refs/tags/v2.6.0",
|
"ref": "refs/tags/v2.8.0",
|
||||||
"repo": "ndg",
|
"repo": "ndg",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": [
|
||||||
|
"devenv",
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
|
"flake-parts": [
|
||||||
|
"devenv",
|
||||||
|
"flake-parts"
|
||||||
|
],
|
||||||
|
"git-hooks-nix": [
|
||||||
|
"devenv",
|
||||||
|
"git-hooks"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-23-11": [
|
||||||
|
"devenv"
|
||||||
|
],
|
||||||
|
"nixpkgs-regression": [
|
||||||
|
"devenv"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1779748925,
|
||||||
|
"narHash": "sha256-meIhqGC04O5VXbKSFXSQoOKp+XCq5RMnwAk1Guo0VQo=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "nix",
|
||||||
|
"rev": "0bc443c8ff235c3547d09327b48aaa2ab98b15f2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "devenv-2.34",
|
||||||
|
"repo": "nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixd": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": [
|
||||||
|
"devenv",
|
||||||
|
"flake-parts"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1778381404,
|
||||||
|
"narHash": "sha256-FqhdOTA8vyoIpkHhbs2cCT7h6EWM7nsLeOYJc1ifQLE=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixd",
|
||||||
|
"rev": "e3e45eb76663f522e196b7f0cf34cab201db7779",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixd",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixgl": {
|
"nixgl": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
@@ -184,11 +428,11 @@
|
|||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775490113,
|
"lastModified": 1781168557,
|
||||||
"narHash": "sha256-2ZBhDNZZwYkRmefK5XLOusCJHnoeKkoN95hoSGgMxWM=",
|
"narHash": "sha256-LOnLQ2tpYF9gqIDDr3+j3DbpJJr/QCH6zPRT2GzEUOE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "c775c2772ba56e906cbeb4e0b2db19079ef11ff7",
|
"rev": "6358ff76821101c178e3ab4919a62799bfe3652e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -198,28 +442,64 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-src": "nixpkgs-src"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775423009,
|
"lastModified": 1778507786,
|
||||||
"narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=",
|
"narHash": "sha256-HzSQCKMsMr8r55LwM1JuzIOB+8bzk0FEv6sItKvsfoY=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv-nixpkgs",
|
||||||
|
"rev": "8f24a228a782e24576b155d1e39f0d914b380691",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "rolling",
|
||||||
|
"repo": "devenv-nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1778274207,
|
||||||
|
"narHash": "sha256-I4puXmX1iovcCHZlRmztO3vW0mAbbRvq4F8wgIMQ1MM=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9",
|
"rev": "b3da656039dc7a6240f27b2ef8cc6a3ef3bccae7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixpkgs-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776329215,
|
"lastModified": 1780365719,
|
||||||
"narHash": "sha256-mBqzkn7oJti2hqeO8iTbDxKw+1ifxpP53feQ0CEXies=",
|
"narHash": "sha256-QfWfccTN+70ZQ4m2qlU9PiKfz2Yppq94058iJyARNwc=",
|
||||||
"rev": "b86751bc4085f48661017fa226dee99fab6c651b",
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "ffa10e26ae11d676b2db836259889f1f571cb14f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1781359544,
|
||||||
|
"narHash": "sha256-X8fdRtvrm8OHLZ6Lkg3ZAQm5N6we5mLkdYd92vAw4c8=",
|
||||||
|
"rev": "9f11f828c213641c2369a9f1fa31fe31557e3156",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre981196.b86751bc4085/nixexprs.tar.xz"
|
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1015979.9f11f828c213/nixexprs.tar.xz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
@@ -228,8 +508,8 @@
|
|||||||
},
|
},
|
||||||
"nvf": {
|
"nvf": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat_2",
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_3",
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"ndg": "ndg",
|
"ndg": "ndg",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -238,11 +518,11 @@
|
|||||||
"systems": "systems_2"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776608870,
|
"lastModified": 1781440932,
|
||||||
"narHash": "sha256-lBKrueFu15TdmtMF6GsiSVCifwdrUBYFoa3+zZjYTFM=",
|
"narHash": "sha256-aPOboQRLIpNe5XiNE6z3Bo0ra/l9Bgh1/vNy+wlw2v4=",
|
||||||
"owner": "notashelf",
|
"owner": "notashelf",
|
||||||
"repo": "nvf",
|
"repo": "nvf",
|
||||||
"rev": "d9ba7f0a9ed6c016dc9e526cc606d1a2f7898cd4",
|
"rev": "cc5fe0bdf72aad87a140b16a65296db92a9ecffb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -253,22 +533,41 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"devenv": "devenv",
|
||||||
"flake-file": "flake-file",
|
"flake-file": "flake-file",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts_2",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"import-tree": "import-tree",
|
"import-tree": "import-tree",
|
||||||
"nixgl": "nixgl",
|
"nixgl": "nixgl",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_3",
|
||||||
"nixpkgs-lib": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"nvf": "nvf",
|
"nvf": "nvf",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"wrapper-modules": "wrapper-modules",
|
"wrapper-modules": "wrapper-modules",
|
||||||
"wrappers": "wrappers"
|
"wrappers": "wrappers"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1779074409,
|
||||||
|
"narHash": "sha256-6aXy8Ga41iLVM8ibddFU1O5+wYWcBGNEfZzZuL91eIc=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "2a77b5b1dc952f214e8102acdef1622b68515560",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sops-nix": {
|
"sops-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -276,11 +575,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776119890,
|
"lastModified": 1780547341,
|
||||||
"narHash": "sha256-Zm6bxLNnEOYuS/SzrAGsYuXSwk3cbkRQZY0fJnk8a5M=",
|
"narHash": "sha256-Gq8KNx5A7hBB3uGJaj6eQfLDIz5YdLu92gqBcvHvoUo=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "d4971dd58c6627bfee52a1ad4237637c0a2fb0cd",
|
"rev": "9ed65852b6257fbeae4355bc24ecfea307ca759a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -319,6 +618,28 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixd",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1775636079,
|
||||||
|
"narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"wrapper-modules": {
|
"wrapper-modules": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -326,11 +647,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776464146,
|
"lastModified": 1780661205,
|
||||||
"narHash": "sha256-XwLFfJDz71vIF7BAhnbLhrzQjmDC2uXdo7N0oHUrYzA=",
|
"narHash": "sha256-3F5DixT3Gk91lBI9E+TGMm0ko5HrRbDiL23di16TJGA=",
|
||||||
"owner": "BirdeeHub",
|
"owner": "BirdeeHub",
|
||||||
"repo": "nix-wrapper-modules",
|
"repo": "nix-wrapper-modules",
|
||||||
"rev": "75febede14a0845f4ef429da692a0698bf433600",
|
"rev": "8dd304c3582ddd339217e1cc5fb53f50acb63c2d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -346,11 +667,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776505856,
|
"lastModified": 1780428045,
|
||||||
"narHash": "sha256-VbnOijrn4EdYYJwiNQFxQNXECKBa60U66UPxUQAGkBE=",
|
"narHash": "sha256-pMJOun/oYhXqes+B3khzRDGWuiCNiWJ25+SVW0OwzNY=",
|
||||||
"owner": "lassulus",
|
"owner": "lassulus",
|
||||||
"repo": "wrappers",
|
"repo": "wrappers",
|
||||||
"rev": "738d4bf81cbf306f6917c540a5b798110e3cf1e8",
|
"rev": "ce9122bf06697ade7c5087940e0c280b89dd0208",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
|
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
|
devenv.url = "github:cachix/devenv";
|
||||||
flake-file.url = "github:vic/flake-file";
|
flake-file.url = "github:vic/flake-file";
|
||||||
flake-parts = {
|
flake-parts = {
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs-lib";
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
import-tree.url = "github:vic/import-tree";
|
import-tree.url = "github:vic/import-tree";
|
||||||
@@ -20,7 +21,6 @@
|
|||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
|
nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
|
||||||
nixpkgs-lib.follows = "nixpkgs";
|
|
||||||
nvf = {
|
nvf = {
|
||||||
url = "github:notashelf/nvf";
|
url = "github:notashelf/nvf";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
desktopManager.gnome.enable = true;
|
desktopManager.gnome.enable = true;
|
||||||
displayManager.gdm = {
|
displayManager.gdm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wayland = true;
|
|
||||||
banner = "Welcome to John's NixOS implementation";
|
banner = "Welcome to John's NixOS implementation";
|
||||||
};
|
};
|
||||||
udev.packages = [
|
udev.packages = [
|
||||||
|
|||||||
@@ -1,11 +1,24 @@
|
|||||||
# https://github.com/glabrie/dotfiles/blob/main/modules/system/settings/greetd.nix
|
# https://github.com/glabrie/dotfiles/blob/main/modules/system/settings/greetd.nix
|
||||||
{ inputs, ... }: {
|
{ inputs, ... }: {
|
||||||
flake.modules.nixos.greetd = { pkgs, lib, ... }: {
|
flake.modules.nixos.greetd = { pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
niriPackage = if config.programs.niri.enable then config.programs.niri.package else pkgs.niri;
|
||||||
|
niriExe = lib.getExe niriPackage;
|
||||||
|
regreetExe = lib.getExe config.programs.regreet.package;
|
||||||
|
greeterNiriConfig = pkgs.writeText "niri-greeter.kdl" ''
|
||||||
|
spawn-at-startup "${regreetExe}"
|
||||||
|
hotkey-overlay {
|
||||||
|
skip-at-startup
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
programs.regreet.enable = true;
|
||||||
|
|
||||||
services.greetd = {
|
services.greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
default_session = {
|
default_session = {
|
||||||
command = "${lib.getExe pkgs.tuigreet} --time --remember --cmd niri-session";
|
command = "${pkgs.dbus}/bin/dbus-run-session -- ${niriExe} --config ${greeterNiriConfig}";
|
||||||
user = "greeter";
|
user = "greeter";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
+252
-159
@@ -48,7 +48,7 @@ let
|
|||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
description = "Enable automatic mTLS certificate renewal using a systemd timer.";
|
description = "Enable automatic mTLS certificate renewal using a systemd timer.";
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = true;
|
default = cfg.enable;
|
||||||
};
|
};
|
||||||
onCalendar = lib.mkOption {
|
onCalendar = lib.mkOption {
|
||||||
description = "systemd OnCalendar schedule for mTLS certificate renewal checks.";
|
description = "systemd OnCalendar schedule for mTLS certificate renewal checks.";
|
||||||
@@ -115,154 +115,27 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
mkMtlsCheckScript = { pkgs, bundleFile }: pkgs.writeShellApplication {
|
|
||||||
name = "mtls-check";
|
|
||||||
runtimeInputs = with pkgs; [ openssl ];
|
|
||||||
text = ''
|
|
||||||
openssl x509 -noout -in ${bundleFile} \
|
|
||||||
-subject -issuer \
|
|
||||||
-ext subjectAltName,extendedKeyUsage \
|
|
||||||
-enddate
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
mkMtlsRenewScript = {
|
|
||||||
pkgs,
|
|
||||||
cfg,
|
|
||||||
systemctlArgs ? [ ],
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
systemctlCmd = "systemctl ${lib.escapeShellArgs systemctlArgs}";
|
|
||||||
|
|
||||||
hasReloadUnits = cfg.renew.reloadUnits != [ ];
|
|
||||||
renewReloadScript = lib.concatMapStringsSep "\n" (unit: ''
|
|
||||||
if ${systemctlCmd} --quiet is-active "${unit}"; then
|
|
||||||
${systemctlCmd} try-reload-or-restart "${unit}"
|
|
||||||
fi
|
|
||||||
'') cfg.renew.reloadUnits;
|
|
||||||
|
|
||||||
hasPostCommands = cfg.renew.postCommands != [ ];
|
|
||||||
renewPostCommands = lib.concatStringsSep "\n" cfg.renew.postCommands;
|
|
||||||
|
|
||||||
fileOwner = "${cfg.renew.user}:${cfg.renew.group}";
|
|
||||||
in
|
in
|
||||||
pkgs.writeShellApplication {
|
|
||||||
name = "mtls-renew";
|
|
||||||
runtimeInputs = with pkgs; [ coreutils step-cli systemd ];
|
|
||||||
text = ''
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
YELLOW_BANG="\e[33m!\e[0m"
|
|
||||||
|
|
||||||
force=0
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
case $1 in
|
|
||||||
--force)
|
|
||||||
force=1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo -e "$YELLOW_BANG Warning: ignoring unrecognized argument '$1'"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $force -eq 0 ]] && ! step certificate needs-renewal "${cfg.certFile}"; then
|
|
||||||
echo "Skipping renew"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Renewing mTLS certificate"
|
|
||||||
step ca renew --force "${cfg.certFile}" "${cfg.keyFile}"
|
|
||||||
(umask 077; cat "${cfg.certFile}" "${cfg.keyFile}" > "${cfg.bundleFile}")
|
|
||||||
chown ${fileOwner} ${cfg.certFile} ${cfg.keyFile} ${cfg.bundleFile}
|
|
||||||
chmod 640 ${cfg.certFile} ${cfg.keyFile} ${cfg.bundleFile}
|
|
||||||
|
|
||||||
${lib.optionalString hasReloadUnits ''
|
|
||||||
echo "Reloading units: ${lib.concatStringsSep ", " cfg.renew.reloadUnits}"
|
|
||||||
${renewReloadScript}
|
|
||||||
''}
|
|
||||||
|
|
||||||
${lib.optionalString hasPostCommands ''echo "Post commands:" ${renewPostCommands}''}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
mkNixosMtlsRenewService = { pkgs, cfg, ... }:
|
|
||||||
{
|
{
|
||||||
description = "Renew the mTLS certificate when Smallstep marks it ready";
|
flake.modules.nixos.mtls = { config, lib, pkgs, ... }:
|
||||||
wantedBy = [ ];
|
let
|
||||||
|
cfg = config.mtls;
|
||||||
|
mtlsRenewWrapper = inputs.self.wrappers.mtlsRenew.apply {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit (cfg) certDir keyFile certFile bundleFile;
|
||||||
|
inherit (cfg.renew) user group reloadUnits postCommands;
|
||||||
|
systemd = {
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
User = cfg.renew.user;
|
User = cfg.renew.user;
|
||||||
Group = cfg.renew.group;
|
Group = cfg.renew.group;
|
||||||
ExecStart = lib.getExe (mkMtlsRenewScript { inherit pkgs cfg; });
|
};
|
||||||
|
} // lib.optionalAttrs cfg.renew.enable {
|
||||||
|
startAt = cfg.renew.onCalendar;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkNixosMtlsRenewTimer = {
|
|
||||||
onCalendar,
|
|
||||||
randomizedDelaySec,
|
|
||||||
unit ? "mtls-renew.service",
|
|
||||||
}: {
|
|
||||||
description = "Periodic Smallstep renewal for the mTLS certificate";
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
timerConfig = {
|
|
||||||
Persistent = true;
|
|
||||||
OnCalendar = onCalendar;
|
|
||||||
AccuracySec = "1us";
|
|
||||||
RandomizedDelaySec = randomizedDelaySec;
|
|
||||||
Unit = unit;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkHomeManagerMtlsRenewService = { pkgs, cfg, ... }:
|
|
||||||
let
|
|
||||||
renewScript = mkMtlsRenewScript {
|
|
||||||
inherit pkgs cfg;
|
|
||||||
systemctlArgs = [ "--user" ];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
Unit = {
|
|
||||||
Description = "Renew the mTLS certificate when Smallstep marks it ready";
|
|
||||||
After = [ "network-online.target" ];
|
|
||||||
Wants = [ "network-online.target" ];
|
|
||||||
};
|
|
||||||
Service = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = lib.getExe renewScript;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkHomeManagerMtlsRenewTimer = {
|
|
||||||
onCalendar,
|
|
||||||
randomizedDelaySec,
|
|
||||||
unit ? "mtls-renew.service",
|
|
||||||
}: {
|
|
||||||
Unit = {
|
|
||||||
Description = "Periodic Smallstep renewal for the mTLS certificate";
|
|
||||||
};
|
|
||||||
Timer = {
|
|
||||||
Persistent = true;
|
|
||||||
OnCalendar = onCalendar;
|
|
||||||
AccuracySec = "1us";
|
|
||||||
RandomizedDelaySec = randomizedDelaySec;
|
|
||||||
Unit = unit;
|
|
||||||
};
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "timers.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules.nixos.mtls = { config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.mtls;
|
|
||||||
sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.mtls = (mkOpts config) // {
|
options.mtls = (mkOpts config) // {
|
||||||
@@ -291,30 +164,44 @@ in
|
|||||||
inherit (cfg) subject provisioner san certFile keyFile bundleFile lifetime;
|
inherit (cfg) subject provisioner san certFile keyFile bundleFile lifetime;
|
||||||
inherit (cfg.renew) user group;
|
inherit (cfg.renew) user group;
|
||||||
})
|
})
|
||||||
(mkMtlsCheckScript { inherit pkgs; inherit (cfg) bundleFile; })
|
(inputs.self.wrappers.mtlsCheck.apply {
|
||||||
(mkMtlsRenewScript { inherit pkgs cfg; })
|
inherit pkgs;
|
||||||
|
inherit (cfg) bundleFile;
|
||||||
|
}).wrapper
|
||||||
|
mtlsRenewWrapper.wrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d ${cfg.certDir} 0750 ${cfg.renew.user} ${cfg.renew.group} -"
|
"d ${cfg.certDir} 0750 ${cfg.renew.user} ${cfg.renew.group} -"
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.mtls-renew = lib.mkIf cfg.renew.enable
|
systemd.packages = lib.mkIf cfg.renew.enable [
|
||||||
(mkNixosMtlsRenewService { inherit pkgs cfg; });
|
mtlsRenewWrapper.outputs.systemd-system
|
||||||
|
];
|
||||||
|
|
||||||
systemd.timers.mtls-renew = lib.mkIf cfg.renew.enable (mkNixosMtlsRenewTimer {
|
systemd.timers.mtls-renew = lib.mkIf cfg.renew.enable {
|
||||||
inherit (cfg.renew) onCalendar randomizedDelaySec;
|
wantedBy = [ "timers.target" ];
|
||||||
});
|
timerConfig = {
|
||||||
|
Persistent = true;
|
||||||
|
AccuracySec = "1us";
|
||||||
|
RandomizedDelaySec = cfg.renew.randomizedDelaySec;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.modules.homeManager.mtls = { config, lib, pkgs, ... }:
|
flake.modules.homeManager.mtls = { config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.mtls;
|
cfg = config.mtls;
|
||||||
keyFile = cfg.keyFile;
|
mtlsRenewWrapper = inputs.self.wrappers.mtlsRenew.apply {
|
||||||
certFile = cfg.certFile;
|
inherit pkgs;
|
||||||
bundleFile = cfg.bundleFile;
|
inherit (cfg) certDir keyFile certFile bundleFile;
|
||||||
sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san;
|
inherit (cfg.renew) reloadUnits postCommands;
|
||||||
|
systemctlArgs = [ "--user" ];
|
||||||
|
systemd = lib.optionalAttrs cfg.renew.enable {
|
||||||
|
startAt = cfg.renew.onCalendar;
|
||||||
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.mtls = (mkOpts config) // {
|
options.mtls = (mkOpts config) // {
|
||||||
@@ -329,24 +216,230 @@ in
|
|||||||
home.packages = with pkgs; lib.optionals cfg.enable [
|
home.packages = with pkgs; lib.optionals cfg.enable [
|
||||||
# step-cli
|
# step-cli
|
||||||
(mkMtlsGenerateScript {
|
(mkMtlsGenerateScript {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit (cfg) keyFile certFile bundleFile;
|
||||||
inherit (cfg) subject provisioner san lifetime;
|
inherit (cfg) subject provisioner san lifetime;
|
||||||
inherit (cfg.renew) user group;
|
inherit (cfg.renew) user group;
|
||||||
inherit pkgs certFile keyFile bundleFile;
|
|
||||||
})
|
})
|
||||||
(mkMtlsCheckScript { inherit pkgs bundleFile; })
|
(inputs.self.wrappers.mtlsCheck.apply {
|
||||||
(mkMtlsRenewScript { inherit pkgs cfg; systemctlArgs = [ "--user" ]; })
|
inherit pkgs;
|
||||||
|
inherit (cfg) bundleFile;
|
||||||
|
}).wrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.user.tmpfiles.rules = lib.mkIf cfg.enable [
|
systemd.user.tmpfiles.rules = lib.mkIf cfg.enable [
|
||||||
"d ${cfg.certDir} 0700 - - -"
|
"d ${cfg.certDir} 0700 - - -" # Ensure the cert directory exists and is writable by the user
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.user.services.mtls-renew = lib.mkIf cfg.renew.enable
|
# Create the systemd service files for the user.
|
||||||
(mkHomeManagerMtlsRenewService { inherit pkgs cfg; });
|
xdg.configFile = lib.mkIf cfg.renew.enable {
|
||||||
|
"systemd/user/mtls-renew.service".source =
|
||||||
|
"${mtlsRenewWrapper.outputs.systemd-user}/systemd/user/mtls-renew.service";
|
||||||
|
"systemd/user/mtls-renew.timer".source =
|
||||||
|
"${mtlsRenewWrapper.outputs.systemd-user}/systemd/user/mtls-renew.timer";
|
||||||
|
"systemd/user/mtls-renew.timer.d/override.conf".text = ''
|
||||||
|
[Timer]
|
||||||
|
Persistent=true
|
||||||
|
AccuracySec=1us
|
||||||
|
RandomizedDelaySec=${cfg.renew.randomizedDelaySec}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
systemd.user.timers.mtls-renew = lib.mkIf cfg.renew.enable (mkHomeManagerMtlsRenewTimer {
|
# Ensure the timer gets started
|
||||||
inherit (cfg.renew) onCalendar randomizedDelaySec;
|
home.activation.mtlsRenewTimer = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
if [ -n "$XDG_RUNTIME_DIR" ] && [ -S "$XDG_RUNTIME_DIR/systemd/private" ]; then
|
||||||
|
if [ "${lib.boolToString (cfg.enable && cfg.renew.enable)}" = "true" ]; then
|
||||||
|
run ${pkgs.systemd}/bin/systemctl --user daemon-reload
|
||||||
|
if ${pkgs.systemd}/bin/systemctl --user cat mtls-renew.timer >/dev/null 2>&1; then
|
||||||
|
run ${pkgs.systemd}/bin/systemctl --user enable --now mtls-renew.timer
|
||||||
|
else
|
||||||
|
verboseEcho "mtls-renew.timer unit file is not available; skipping enable"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
run ${pkgs.systemd}/bin/systemctl --user disable --now mtls-renew.timer || true
|
||||||
|
run ${pkgs.systemd}/bin/systemctl --user daemon-reload || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.wrappers = {
|
||||||
|
mtlsCheck = inputs.wrappers.lib.wrapModule ({ config, lib, wlib, ... }: {
|
||||||
|
options = {
|
||||||
|
bundleFile = lib.mkOption {
|
||||||
|
description = "String path for the mTLS key bundle";
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
binName = "mtls-check";
|
||||||
|
# This pattern is necessary to wrap packages like openssl that provide more than one binary
|
||||||
|
package = config.pkgs.symlinkJoin {
|
||||||
|
name = "openssl";
|
||||||
|
paths = [ config.pkgs.openssl.bin config.pkgs.openssl.man ];
|
||||||
|
meta.mainProgram = "openssl";
|
||||||
|
};
|
||||||
|
args = [
|
||||||
|
"x509"
|
||||||
|
"-noout"
|
||||||
|
"-in" config.bundleFile
|
||||||
|
"-subject"
|
||||||
|
"-issuer"
|
||||||
|
"-ext" "subjectAltName,extendedKeyUsage"
|
||||||
|
"-enddate"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
mtlsNeedsRenewal = inputs.wrappers.lib.wrapModule ({ config, lib, wlib, ... }: {
|
||||||
|
options = {
|
||||||
|
certFile = lib.mkOption {
|
||||||
|
description = "String path for the public cert";
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
binName = "mtls-needs-renewal";
|
||||||
|
package = config.pkgs.step-cli;
|
||||||
|
preHook = ''
|
||||||
|
echo "Checking renewal status..."
|
||||||
|
'';
|
||||||
|
args = [ "certificate" "needs-renewal" "${config.certFile}" ];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
mtlsRenew = inputs.wrappers.lib.wrapModule ({ config, lib, wlib, ... }: {
|
||||||
|
imports = [ wlib.modules.systemd ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
certDir = lib.mkOption {
|
||||||
|
description = "String path to the directory where the certs will be stored";
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
keyFile = lib.mkOption {
|
||||||
|
description = "String path for the private key";
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "${config.certDir}/key.pem";
|
||||||
|
};
|
||||||
|
certFile = lib.mkOption {
|
||||||
|
description = "String path for the public cert";
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "${config.certDir}/cert.pem";
|
||||||
|
};
|
||||||
|
bundleFile = lib.mkOption {
|
||||||
|
description = "String path for the mTLS key bundle";
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "${config.certDir}/mtls.pem";
|
||||||
|
};
|
||||||
|
user = lib.mkOption {
|
||||||
|
description = "User that should own the renewed certificate files.";
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
group = lib.mkOption {
|
||||||
|
description = "Group that should own the renewed certificate files.";
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
reloadUnits = lib.mkOption {
|
||||||
|
description = "systemd units to try-reload-or-restart after a successful renewal.";
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
postCommands = lib.mkOption {
|
||||||
|
description = "Shell commands to run after a successful renewal.";
|
||||||
|
type = lib.types.listOf lib.types.lines;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
systemctlArgs = lib.mkOption {
|
||||||
|
description = "Additional arguments to pass to systemctl when reloading units.";
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
binName = "mtls-renew";
|
||||||
|
package = let
|
||||||
|
systemctlCmd = "systemctl ${lib.escapeShellArgs config.systemctlArgs}";
|
||||||
|
|
||||||
|
hasReloadUnits = config.reloadUnits != [ ];
|
||||||
|
renewReloadScript = lib.concatMapStringsSep "\n" (unit: ''
|
||||||
|
if ${systemctlCmd} --quiet is-active "${unit}"; then
|
||||||
|
${systemctlCmd} try-reload-or-restart "${unit}"
|
||||||
|
fi
|
||||||
|
'') config.reloadUnits;
|
||||||
|
|
||||||
|
hasPostCommands = config.postCommands != [ ];
|
||||||
|
renewPostCommands = lib.concatStringsSep "\n" config.postCommands;
|
||||||
|
|
||||||
|
hasOwnership = config.user != null && config.group != null;
|
||||||
|
in
|
||||||
|
config.pkgs.writeShellApplication {
|
||||||
|
name = "mtls-renew";
|
||||||
|
runtimeInputs = with config.pkgs; [ coreutils step-cli systemd ];
|
||||||
|
text = ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
YELLOW_BANG="\e[33m!\e[0m"
|
||||||
|
|
||||||
|
force=0
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
--force)
|
||||||
|
force=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "$YELLOW_BANG Warning: ignoring unrecognized argument '$1'"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $force -eq 0 ]] && ! step certificate needs-renewal "${config.certFile}"; then
|
||||||
|
echo "Skipping renew"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Renewing mTLS certificate"
|
||||||
|
step ca renew --force "${config.certFile}" "${config.keyFile}"
|
||||||
|
(umask 077; cat "${config.certFile}" "${config.keyFile}" > "${config.bundleFile}")
|
||||||
|
|
||||||
|
${lib.optionalString hasOwnership ''
|
||||||
|
chown ${config.user}:${config.group} ${config.certFile} ${config.keyFile} ${config.bundleFile}
|
||||||
|
chmod 640 ${config.certFile} ${config.keyFile} ${config.bundleFile}
|
||||||
|
''}
|
||||||
|
|
||||||
|
${lib.optionalString hasReloadUnits ''
|
||||||
|
echo "Reloading units: ${lib.concatStringsSep ", " config.reloadUnits}"
|
||||||
|
${renewReloadScript}
|
||||||
|
''}
|
||||||
|
|
||||||
|
${lib.optionalString hasPostCommands ''
|
||||||
|
echo "Running post commands"
|
||||||
|
${renewPostCommands}
|
||||||
|
''}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
extraPackages = [
|
||||||
|
config.pkgs.step-cli
|
||||||
|
];
|
||||||
|
systemd = {
|
||||||
|
description = "Renew the mTLS certificate when Smallstep marks it ready";
|
||||||
|
documentation = [
|
||||||
|
"https://smallstep.com/docs/step-ca/certificate-authority-server-production"
|
||||||
|
];
|
||||||
|
startLimitIntervalSec = 0;
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
serviceConfig.Type = lib.mkDefault "oneshot";
|
||||||
|
# serviceConfig.ExecCondition = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
flake.modules.nixos.niri = { pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
niriPkg = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.niri = {
|
||||||
|
enable = true;
|
||||||
|
package = niriPkg;
|
||||||
|
};
|
||||||
|
systemd.user.services.niri.enableDefaultPath = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
perSystem = { pkgs, lib, self', ... }:
|
||||||
|
let
|
||||||
|
nixGLPackage = inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system}.nixGLIntel;
|
||||||
|
noctaliaPkg = self'.packages.myNoctaliaNixGL;
|
||||||
|
terminalPkg = pkgs.ghostty;
|
||||||
|
myNiriUnwrapped = inputs.wrapper-modules.wrappers.niri.wrap {
|
||||||
|
inherit pkgs;
|
||||||
|
settings = {
|
||||||
|
spawn-at-startup = [
|
||||||
|
(lib.getExe noctaliaPkg)
|
||||||
|
];
|
||||||
|
|
||||||
|
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
|
||||||
|
|
||||||
|
input.keyboard.xkb.layout = "us,ua";
|
||||||
|
|
||||||
|
layout.gaps = 5;
|
||||||
|
|
||||||
|
binds = {
|
||||||
|
"Mod+Return".spawn-sh = lib.getExe terminalPkg;
|
||||||
|
# "Mod+Ctrl+Return".spawn-sh = "${lib.getExe noctaliaPkg} ipc call launcher toggle";
|
||||||
|
"Mod+Space".spawn-sh = "${lib.getExe noctaliaPkg} ipc call launcher toggle";
|
||||||
|
"Mod+B".spawn-sh = "${lib.getExe pkgs.brave}";
|
||||||
|
"Mod+E".spawn-sh = "xdg-open .";
|
||||||
|
"Mod+Alt+L".spawn-sh = "loginctl lock-session";
|
||||||
|
|
||||||
|
"Alt+F4".spawn-sh = "${lib.getExe' pkgs.coreutils "true"}";
|
||||||
|
"Mod+Shift+Q".close-window = { };
|
||||||
|
"Mod+S".spawn-sh = "${lib.getExe noctaliaPkg} ipc call launcher toggle";
|
||||||
|
|
||||||
|
"Mod+1".focus-workspace = 1;
|
||||||
|
"Mod+2".focus-workspace = 2;
|
||||||
|
"Mod+3".focus-workspace = 3;
|
||||||
|
"Mod+4".focus-workspace = 4;
|
||||||
|
"Mod+5".focus-workspace = 5;
|
||||||
|
"Mod+6".focus-workspace = 6;
|
||||||
|
"Mod+7".focus-workspace = 7;
|
||||||
|
"Mod+8".focus-workspace = 8;
|
||||||
|
"Mod+9".focus-workspace = 9;
|
||||||
|
|
||||||
|
"Mod+Tab".focus-workspace-previous = { };
|
||||||
|
|
||||||
|
# "Mod+WheelScrollDown".focus-workspace-down = { };
|
||||||
|
# "Mod+WheelScrollUp".focus-workspace-up = { };
|
||||||
|
|
||||||
|
# "Mod+Up".focus-window-up = { };
|
||||||
|
# "Mod+Down".focus-window-down = { };
|
||||||
|
"Mod+Up".focus-workspace-up = { };
|
||||||
|
"Mod+Down".focus-workspace-down = { };
|
||||||
|
"Mod+Left".focus-column-left = { };
|
||||||
|
"Mod+Right".focus-column-right = { };
|
||||||
|
"Mod+K".focus-window-up = { };
|
||||||
|
"Mod+J".focus-window-down = { };
|
||||||
|
"Mod+H".focus-column-left = { };
|
||||||
|
"Mod+L".focus-column-right = { };
|
||||||
|
"Mod+Home".focus-column-first = { };
|
||||||
|
"Mod+End".focus-column-last = { };
|
||||||
|
|
||||||
|
# "Mod+Shift+Left".focus-monitor-left = { };
|
||||||
|
# "Mod+Shift+Right".focus-monitor-right = { };
|
||||||
|
# "Mod+Shift+Up".focus-monitor-up = { };
|
||||||
|
# "Mod+Shift+Down".focus-monitor-down = { };
|
||||||
|
|
||||||
|
"Mod+Shift+1".move-column-to-workspace = 1;
|
||||||
|
"Mod+Shift+2".move-column-to-workspace = 2;
|
||||||
|
"Mod+Shift+3".move-column-to-workspace = 3;
|
||||||
|
"Mod+Shift+4".move-column-to-workspace = 4;
|
||||||
|
"Mod+Shift+5".move-column-to-workspace = 5;
|
||||||
|
"Mod+Shift+6".move-column-to-workspace = 6;
|
||||||
|
"Mod+Shift+7".move-column-to-workspace = 7;
|
||||||
|
"Mod+Shift+8".move-column-to-workspace = 8;
|
||||||
|
"Mod+Shift+9".move-column-to-workspace = 9;
|
||||||
|
|
||||||
|
"Mod+Ctrl+Up".move-window-up = { };
|
||||||
|
"Mod+Ctrl+Down".move-window-down = { };
|
||||||
|
"Mod+Ctrl+Left".move-column-left = { };
|
||||||
|
"Mod+Ctrl+Right".move-column-right = { };
|
||||||
|
"Mod+Ctrl+K".move-window-up = { };
|
||||||
|
"Mod+Ctrl+J".move-window-down = { };
|
||||||
|
"Mod+Ctrl+H".move-column-left = { };
|
||||||
|
"Mod+Ctrl+L".move-column-right = { };
|
||||||
|
"Mod+Ctrl+Home".move-column-to-first = { };
|
||||||
|
"Mod+Ctrl+End".move-column-to-last = { };
|
||||||
|
|
||||||
|
"Mod+Shift+Ctrl+Left".move-column-to-monitor-left = { };
|
||||||
|
"Mod+Shift+Ctrl+Right".move-column-to-monitor-right = { };
|
||||||
|
"Mod+Shift+Ctrl+Up".move-column-to-monitor-up = { };
|
||||||
|
"Mod+Shift+Ctrl+Down".move-column-to-monitor-down = { };
|
||||||
|
|
||||||
|
"Mod+Ctrl+F".expand-column-to-available-width = { };
|
||||||
|
"Mod+C".center-column = { };
|
||||||
|
"Mod+Ctrl+C".center-visible-columns = { };
|
||||||
|
"Mod+Minus".set-column-width = "-10%";
|
||||||
|
"Mod+Equal".set-column-width = "+10%";
|
||||||
|
"Mod+Shift+Minus".set-window-height = "-10%";
|
||||||
|
"Mod+Shift+Equal".set-window-height = "+10%";
|
||||||
|
|
||||||
|
"Mod+T".toggle-window-floating = { };
|
||||||
|
"Mod+F".fullscreen-window = { };
|
||||||
|
"Mod+W".toggle-column-tabbed-display = { };
|
||||||
|
"Mod+O".toggle-overview = { };
|
||||||
|
|
||||||
|
"Ctrl+Shift+1".screenshot = { };
|
||||||
|
"Ctrl+Shift+2".screenshot-screen = { };
|
||||||
|
"Ctrl+Shift+3".screenshot-window = { };
|
||||||
|
|
||||||
|
"Mod+Shift+Slash".show-hotkey-overlay = { };
|
||||||
|
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = { };
|
||||||
|
"Mod+Shift+P".power-off-monitors = { };
|
||||||
|
"Ctrl+Alt+Delete".quit = { };
|
||||||
|
|
||||||
|
"Mod+WheelScrollRight".focus-column-right = { };
|
||||||
|
"Mod+WheelScrollLeft".focus-column-left = { };
|
||||||
|
"Mod+Ctrl+WheelScrollRight".move-column-right = { };
|
||||||
|
"Mod+Ctrl+WheelScrollLeft".move-column-left = { };
|
||||||
|
"Mod+Shift+WheelScrollDown".focus-column-right = { };
|
||||||
|
"Mod+Shift+WheelScrollUp".focus-column-left = { };
|
||||||
|
# "Mod+Ctrl+Shift+WheelScrollDown".move-column-right = { };
|
||||||
|
# "Mod+Ctrl+Shift+WheelScrollUp".move-column-left = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
packages.myNiri = myNiriUnwrapped;
|
||||||
|
|
||||||
|
packages.myNiriNixGL = pkgs.symlinkJoin {
|
||||||
|
name = "my-niri-nixgl";
|
||||||
|
paths = [ myNiriUnwrapped ];
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
meta.mainProgram = "niri";
|
||||||
|
postBuild = ''
|
||||||
|
for exe in "$out"/bin/*; do
|
||||||
|
if [[ -f "$exe" ]]; then
|
||||||
|
base="$(basename "$exe")"
|
||||||
|
mv "$exe" "$out/bin/.''${base}-real"
|
||||||
|
makeWrapper ${lib.getExe nixGLPackage} "$exe" \
|
||||||
|
--add-flags "$out/bin/.''${base}-real"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
flake.modules.nixos.base = { config, pkgs, lib, ... }: {
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
nixpkgs.config = {
|
||||||
|
permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "US/Central";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n = {
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "en_US.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||||
|
LC_MEASUREMENT = "en_US.UTF-8";
|
||||||
|
LC_MONETARY = "en_US.UTF-8";
|
||||||
|
LC_NAME = "en_US.UTF-8";
|
||||||
|
LC_NUMERIC = "en_US.UTF-8";
|
||||||
|
LC_PAPER = "en_US.UTF-8";
|
||||||
|
LC_TELEPHONE = "en_US.UTF-8";
|
||||||
|
LC_TIME = "en_US.UTF-8";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
nerd-fonts.hack
|
||||||
|
nerd-fonts.sauce-code-pro
|
||||||
|
];
|
||||||
|
|
||||||
|
# Need for less pain-in-the-ass for doing normal-ish stuff
|
||||||
|
# This is needed for VSCode remote support. Read: https://nixos.wiki/wiki/Visual_Studio_Code
|
||||||
|
programs.nix-ld.enable = true;
|
||||||
|
|
||||||
|
# Configure network connections interactively with nmcli or nmtui.
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
security.polkit.enable = true; # polkit
|
||||||
|
services.gnome.gnome-keyring.enable = true; # secret service
|
||||||
|
security.pam.services.swaylock = {};
|
||||||
|
|
||||||
|
# Enable sound with pipewire.
|
||||||
|
services.pulseaudio.enable = false;
|
||||||
|
security.rtkit.enable = true; # PulseAudio server uses this to acquire realtime priority.
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
# If you want to use JACK applications, uncomment this
|
||||||
|
#jack.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
perSystem = { pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
nixGLPackage = inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system}.nixGLIntel;
|
||||||
|
myNoctaliaUnwrapped = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
|
||||||
|
inherit pkgs;
|
||||||
|
runtimePkgs = [
|
||||||
|
pkgs.qt6.qtwebsockets
|
||||||
|
];
|
||||||
|
# settings =
|
||||||
|
# (builtins.fromJSON
|
||||||
|
# (builtins.readFile ./noctalia.json)).settings;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
packages.myNoctalia = myNoctaliaUnwrapped;
|
||||||
|
|
||||||
|
packages.myNoctaliaNixGL = pkgs.symlinkJoin {
|
||||||
|
name = "my-noctalia-nixgl";
|
||||||
|
paths = [ myNoctaliaUnwrapped ];
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
meta.mainProgram = "noctalia-shell";
|
||||||
|
postBuild = ''
|
||||||
|
for exe in "$out"/bin/*; do
|
||||||
|
if [[ -f "$exe" ]]; then
|
||||||
|
base="$(basename "$exe")"
|
||||||
|
mv "$exe" "$out/bin/.''${base}-real"
|
||||||
|
makeWrapper ${lib.getExe nixGLPackage} "$exe" \
|
||||||
|
--add-flags "$out/bin/.''${base}-real"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,36 +1,40 @@
|
|||||||
# This module provides all the shell options
|
# This module provides all the shell options
|
||||||
{ inputs, lib, ... }:
|
{ self, inputs, ... }:
|
||||||
|
{
|
||||||
|
flake.modules.homeManager.shell-tools =
|
||||||
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
flake.modules.homeManager.shell-tools = { config, pkgs, ... }: {
|
|
||||||
options.shell.program = lib.mkOption {
|
|
||||||
type = lib.types.enum [ "bash" "zsh" ];
|
|
||||||
default = "zsh";
|
|
||||||
description = "Which interactive shell configuration to enable.";
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
bash
|
# bash
|
||||||
zsh
|
zsh
|
||||||
files
|
files
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
|
||||||
home.shell.enableShellIntegration = true;
|
|
||||||
programs.zsh.enable = lib.mkForce (config.shell.program == "zsh");
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
btop
|
btop
|
||||||
uv
|
uv
|
||||||
xclip
|
xclip
|
||||||
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools
|
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools
|
||||||
];
|
];
|
||||||
};
|
|
||||||
|
home.shell.enableShellIntegration = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = { system, pkgs, self', ... }: {
|
perSystem =
|
||||||
|
{
|
||||||
|
system,
|
||||||
|
pkgs,
|
||||||
|
self',
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
packages.shell-tools = inputs.wrappers.lib.wrapPackage {
|
packages.shell-tools = inputs.wrappers.lib.wrapPackage {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
package = (pkgs.symlinkJoin {
|
# binName = "show-tools";
|
||||||
name = "shell-tools";
|
package = (
|
||||||
|
pkgs.symlinkJoin {
|
||||||
|
name = "show-tools";
|
||||||
|
meta.mainProgram = "show-tools";
|
||||||
paths = with pkgs; [
|
paths = with pkgs; [
|
||||||
nh
|
nh
|
||||||
ripgrep
|
ripgrep
|
||||||
@@ -39,19 +43,41 @@
|
|||||||
wget
|
wget
|
||||||
curl
|
curl
|
||||||
dig
|
dig
|
||||||
|
bat
|
||||||
self'.packages.gdu
|
self'.packages.gdu
|
||||||
self'.packages.my-eza
|
self'.packages.my-eza
|
||||||
|
self'.packages.yazi
|
||||||
hostname
|
hostname
|
||||||
iproute2
|
iproute2
|
||||||
direnv
|
direnv
|
||||||
|
(writeShellApplication {
|
||||||
|
name = "show-tools";
|
||||||
|
text = ''
|
||||||
|
IFS=':' read -r -a path_dirs <<< "''${PATH:-}"
|
||||||
|
|
||||||
|
for dir in "''${path_dirs[@]}"; do
|
||||||
|
[[ "$dir" == */bin ]] || continue
|
||||||
|
[[ -d "$dir" ]] || continue
|
||||||
|
|
||||||
|
printf '%s\n' "$dir"/*
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
})
|
||||||
];
|
];
|
||||||
});
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
packages.gdu = inputs.wrappers.lib.wrapPackage {
|
packages.gdu = inputs.wrappers.lib.wrapPackage {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
package = pkgs.gdu;
|
package = pkgs.gdu;
|
||||||
args = [ "-x" "--si" "--collapse-path" "--mouse" "$@" ];
|
args = [
|
||||||
|
"-x"
|
||||||
|
"--si"
|
||||||
|
"--collapse-path"
|
||||||
|
"--mouse"
|
||||||
|
"$@"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
{ self, inputs, ... }:
|
||||||
|
let
|
||||||
|
mkPrincipalArgs = principals:
|
||||||
|
builtins.concatLists (map (principal: [ "--principal" principal ]) principals);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
perSystem = { system, self', pkgs, lib, ... }: {
|
||||||
|
packages.ssh-certs = inputs.wrappers.lib.wrapPackage {
|
||||||
|
inherit pkgs;
|
||||||
|
package = (pkgs.symlinkJoin {
|
||||||
|
name = "ssh-certs";
|
||||||
|
meta.mainProgram = "sign-ssh-user-cert";
|
||||||
|
paths = [
|
||||||
|
(inputs.self.wrappers.signUserWrapper.apply {
|
||||||
|
inherit pkgs;
|
||||||
|
provisioner = "admin";
|
||||||
|
overwrite = true;
|
||||||
|
validUsers = [ "john" "root" "appdaemon" ];
|
||||||
|
}).wrapper
|
||||||
|
|
||||||
|
(inputs.self.wrappers.signHostWrapper.apply {
|
||||||
|
inherit pkgs;
|
||||||
|
provisioner = "admin";
|
||||||
|
overwrite = true;
|
||||||
|
# extraPrincipals = [ "home-pc" ];
|
||||||
|
}).wrapper
|
||||||
|
];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.wrappers.signHostWrapper = inputs.wrappers.lib.wrapModule ({config, lib, wlib, ... }: {
|
||||||
|
options = {
|
||||||
|
provisioner = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = "admin";
|
||||||
|
};
|
||||||
|
extraPrincipals = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
overwrite = lib.mkEnableOption "Overwrite existing cert file?";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
binName = "sign-ssh-host-cert";
|
||||||
|
package = config.pkgs.step-cli;
|
||||||
|
extraPackages = with config.pkgs; [ hostname iproute2 systemd ];
|
||||||
|
preHook = ''
|
||||||
|
HOSTNAME=$(hostname -s)
|
||||||
|
IP_ADDRESS=$(ip -4 -o addr show scope global | while read -r _ _ _ addr _; do
|
||||||
|
case "$addr" in
|
||||||
|
192.168.1.*/*)
|
||||||
|
printf '%s\n' "''${addr%%/*}"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done)
|
||||||
|
echo "Signing SSH host cert for $HOSTNAME at $IP_ADDRESS"
|
||||||
|
'';
|
||||||
|
args =
|
||||||
|
[
|
||||||
|
"ssh" "certificate"
|
||||||
|
"--host" "--sign"
|
||||||
|
"--principal" "$HOSTNAME"
|
||||||
|
"--principal" "$IP_ADDRESS"
|
||||||
|
]
|
||||||
|
++ lib.optionals (config.provisioner != null) [ "--provisioner" "${config.provisioner}" ]
|
||||||
|
++ lib.optionals config.overwrite [ "-f" ]
|
||||||
|
++ mkPrincipalArgs config.extraPrincipals;
|
||||||
|
postHook = ''
|
||||||
|
systemctl reload-or-restart sshd
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
flake.wrappers.signUserWrapper = inputs.wrappers.lib.wrapModule ({config, lib, wlib, ... }: {
|
||||||
|
options = {
|
||||||
|
provisioner = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = "admin";
|
||||||
|
};
|
||||||
|
validUsers = lib.mkOption {
|
||||||
|
description = "A list of the user names that this cert will be valid for";
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
overwrite = lib.mkEnableOption "Overwrite existing cert file?";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
binName = "sign-ssh-user-cert";
|
||||||
|
package = config.pkgs.step-cli;
|
||||||
|
args = [ "ssh" "certificate" "--sign" ]
|
||||||
|
++ lib.optionals (config.provisioner != null) [ "--provisioner" "${config.provisioner}" ]
|
||||||
|
++ lib.optionals config.overwrite [ "-f" ]
|
||||||
|
++ mkPrincipalArgs config.validUsers;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
flake.modules.homeManager.step-client = { config, pkgs, lib, ... }: {
|
||||||
|
home.file.".step/config/defaults.json".text = builtins.toJSON {
|
||||||
|
ca-url = "https://janus.john-stream.com/";
|
||||||
|
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
|
||||||
|
root = ../hosts/janus/root_ca.crt;
|
||||||
|
};
|
||||||
|
home.packages = [
|
||||||
|
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.step-bootstrap
|
||||||
|
];
|
||||||
|
# sops.secrets."step-ca-defaults" = {
|
||||||
|
# sopsFile = ../hosts/janus/defaults.json;
|
||||||
|
# format = "json";
|
||||||
|
# key = ""; # This causes it to decode the whole file
|
||||||
|
# path = "${config.home.homeDirectory}/defaults.json";
|
||||||
|
# mode = "0400";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
|
||||||
|
perSystem = { system, pkgs, lib, ... }: {
|
||||||
|
packages.step-bootstrap = (inputs.self.wrappers.stepBootstrap.apply {
|
||||||
|
inherit pkgs;
|
||||||
|
ca-url = "https://janus.john-stream.com";
|
||||||
|
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
|
||||||
|
install = true;
|
||||||
|
}).wrapper;
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.wrappers.stepBootstrap = inputs.wrappers.lib.wrapModule ({config, lib, wlib, ... }: {
|
||||||
|
options = {
|
||||||
|
ca-url = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
fingerprint = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
install = lib.mkEnableOption "Install the cert to the system trust store";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
binName = "step-bootstrap";
|
||||||
|
package = config.pkgs.step-cli;
|
||||||
|
args = [
|
||||||
|
"ca" "bootstrap"
|
||||||
|
"--ca-url" config.ca-url
|
||||||
|
"--fingerprint" config.fingerprint
|
||||||
|
]
|
||||||
|
++ lib.optional config.install "--install";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
let
|
let
|
||||||
username = "john";
|
username = "john";
|
||||||
hostname = "janus";
|
hostname = "janus";
|
||||||
ca-url = "https://janus.john-stream.com/";
|
|
||||||
fingerprint = builtins.readFile ./fingerprint;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.nixos.janus-ca =
|
flake.modules.nixos.janus-ca =
|
||||||
@@ -39,7 +37,8 @@ in
|
|||||||
config = {
|
config = {
|
||||||
environment.etc = lib.mkIf cfgInEtc {
|
environment.etc = lib.mkIf cfgInEtc {
|
||||||
"step-ca/defaults.json".text = builtins.toJSON {
|
"step-ca/defaults.json".text = builtins.toJSON {
|
||||||
inherit ca-url fingerprint;
|
ca-url = "https://janus.john-stream.com/";
|
||||||
|
fingerprint = builtins.readFile ./fingerprint;
|
||||||
root = "/etc/${certRootEtcPath}";
|
root = "/etc/${certRootEtcPath}";
|
||||||
};
|
};
|
||||||
"${certRootEtcPath}".source = ./root_ca.crt;
|
"${certRootEtcPath}".source = ./root_ca.crt;
|
||||||
@@ -52,10 +51,10 @@ in
|
|||||||
|
|
||||||
flake.modules.homeManager.janus-ca = { config, ... }: {
|
flake.modules.homeManager.janus-ca = { config, ... }: {
|
||||||
home.file.".step/config/defaults.json".text = builtins.toJSON {
|
home.file.".step/config/defaults.json".text = builtins.toJSON {
|
||||||
inherit ca-url fingerprint;
|
ca-url = "https://janus.john-stream.com/";
|
||||||
root = "${config.home.homeDirectory}/.step/certs/root_ca.crt";
|
fingerprint = builtins.readFile ./fingerprint;
|
||||||
|
root = ./root_ca.crt;
|
||||||
};
|
};
|
||||||
home.file.".step/certs/root_ca.crt".source = ./root_ca.crt;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
|
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
|
||||||
@@ -86,7 +85,6 @@ in
|
|||||||
home-manager.users."${username}" = {
|
home-manager.users."${username}" = {
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
mysops
|
mysops
|
||||||
step-ssh-user
|
|
||||||
];
|
];
|
||||||
shell.program = "zsh";
|
shell.program = "zsh";
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
@@ -94,16 +92,4 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = { system, pkgs, lib, ... }: {
|
|
||||||
packages.janus-ca = inputs.wrappers.lib.wrapPackage {
|
|
||||||
inherit pkgs;
|
|
||||||
package = pkgs.step-cli;
|
|
||||||
binName = "janus-cert";
|
|
||||||
args = [
|
|
||||||
"ca" "certificate"
|
|
||||||
"--ca-url=${ca-url}"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
{ withSystem, self, inputs, ... }:
|
||||||
|
let
|
||||||
|
username = "john";
|
||||||
|
hostname = "omen";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
selfPkgs = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
||||||
|
flakeDir = "${config.xdg.configHome}/home-manager";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = with inputs.self.modules.homeManager; [
|
||||||
|
rebuild
|
||||||
|
john
|
||||||
|
# mtls
|
||||||
|
# restic
|
||||||
|
docker
|
||||||
|
desktop
|
||||||
|
step-client
|
||||||
|
# mysops
|
||||||
|
# myPackage
|
||||||
|
# myStepClient
|
||||||
|
];
|
||||||
|
# TODO: make this more restrictive, rather than allowing all unfree packages
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
||||||
|
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
|
||||||
|
home.username = "${username}";
|
||||||
|
home.homeDirectory = "/home/${username}";
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
selfPkgs.jsl-zsh
|
||||||
|
selfPkgs.my-neovim
|
||||||
|
selfPkgs.ssh-certs
|
||||||
|
# selfPkgs.step-bootstrap
|
||||||
|
# selfPkgs.wg-platform
|
||||||
|
# self'.packages.myWrappedPackage
|
||||||
|
# (inputs.self.wrappers.test-push.apply {
|
||||||
|
# inherit pkgs flakeDir;
|
||||||
|
# host = testHost;
|
||||||
|
# target = testTarget;
|
||||||
|
# }).wrapper
|
||||||
|
];
|
||||||
|
|
||||||
|
homeManagerFlakeDir = flakeDir;
|
||||||
|
docker.enable = true;
|
||||||
|
|
||||||
|
ssh = {
|
||||||
|
certificates.enable = true;
|
||||||
|
knownHosts = [
|
||||||
|
"fded:fb16:653e:25da:be24:11ff:fea0:753f ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ9ZqiWPrCwHjxFCiu0lT4rlQs7KyMapxKJQQ5PJP1eh"
|
||||||
|
];
|
||||||
|
matchSets = {
|
||||||
|
certs = true;
|
||||||
|
appdaemon = true;
|
||||||
|
homelab = true;
|
||||||
|
dev = true;
|
||||||
|
tailscale = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.homeConfigurations."john@omen" = withSystem "x86_64-linux" (ctx@{ system, inputs', ... }:
|
||||||
|
inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = inputs'.nixpkgs.legacyPackages;
|
||||||
|
modules = [ inputs.self.modules.homeManager."${hostname}" ]; # Uses the module defined above
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -9,28 +9,16 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
self.modules.nixos.base
|
||||||
self.modules.nixos.p14sHardware
|
self.modules.nixos.p14sHardware
|
||||||
|
self.modules.nixos.onepassword
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
nixpkgs.config = {
|
|
||||||
permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
rebuild.flakeDir = flakeDir;
|
rebuild.flakeDir = flakeDir;
|
||||||
|
|
||||||
networking = {
|
networking.hostname = hostname;
|
||||||
hostName = hostname;
|
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable automatic login for the user.
|
|
||||||
# services.displayManager.autoLogin.enable = true;
|
|
||||||
# services.displayManager.autoLogin.user = "john";
|
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
services.openssh.enable = true;
|
|
||||||
services.tailscale.enable = true;
|
services.tailscale.enable = true;
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
# List packages installed in system profile. To search, run:
|
||||||
@@ -39,23 +27,12 @@
|
|||||||
samba
|
samba
|
||||||
selfPkgs.my-neovim
|
selfPkgs.my-neovim
|
||||||
selfPkgs.wg-platform
|
selfPkgs.wg-platform
|
||||||
|
selfPkgs.jsl-zsh
|
||||||
];
|
];
|
||||||
|
|
||||||
security.pam.services.swaylock = {};
|
security.pam.services.swaylock = {};
|
||||||
security.pam.services.swaylock.fprintAuth = true;
|
security.pam.services.swaylock.fprintAuth = true;
|
||||||
|
|
||||||
programs._1password.enable = true;
|
|
||||||
programs._1password-gui = {
|
|
||||||
enable = true;
|
|
||||||
# Certain features, including CLI integration and system authentication support,
|
|
||||||
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
|
|
||||||
polkitPolicyOwners = [ "john" ];
|
|
||||||
# TODO this should not be a hardcoded username
|
|
||||||
};
|
|
||||||
|
|
||||||
# This is needed for VSCode remote support. Read: https://nixos.wiki/wiki/Visual_Studio_Code
|
|
||||||
programs.nix-ld.enable = true;
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
# on your system were taken. It's perfectly fine and recommended to leave
|
# on your system were taken. It's perfectly fine and recommended to leave
|
||||||
@@ -64,44 +41,9 @@
|
|||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "24.05"; # Did you read the comment?
|
system.stateVersion = "24.05"; # Did you read the comment?
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
time.timeZone = "America/Chicago";
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n = {
|
|
||||||
defaultLocale = "en_US.UTF-8";
|
|
||||||
extraLocaleSettings = {
|
|
||||||
LC_ADDRESS = "en_US.UTF-8";
|
|
||||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
|
||||||
LC_MEASUREMENT = "en_US.UTF-8";
|
|
||||||
LC_MONETARY = "en_US.UTF-8";
|
|
||||||
LC_NAME = "en_US.UTF-8";
|
|
||||||
LC_NUMERIC = "en_US.UTF-8";
|
|
||||||
LC_PAPER = "en_US.UTF-8";
|
|
||||||
LC_TELEPHONE = "en_US.UTF-8";
|
|
||||||
LC_TIME = "en_US.UTF-8";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.libinput.enable = true; # Enable touchpad support (enabled default in most desktopManager).
|
services.libinput.enable = true; # Enable touchpad support (enabled default in most desktopManager).
|
||||||
services.fprintd.enable = true; # Enables fingerprint sensor
|
services.fprintd.enable = true; # Enables fingerprint sensor
|
||||||
|
|
||||||
# Enable sound with pipewire.
|
|
||||||
services.pulseaudio.enable = false;
|
|
||||||
security.rtkit.enable = true; # PulseAudio server uses this to acquire realtime priority.
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa.enable = true;
|
|
||||||
alsa.support32Bit = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
# If you want to use JACK applications, uncomment this
|
|
||||||
#jack.enable = true;
|
|
||||||
|
|
||||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
|
||||||
# no need to redefine it in your config for now)
|
|
||||||
# media-session.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.root = {
|
home-manager.users.root = {
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
rebuild
|
rebuild
|
||||||
@@ -117,11 +59,9 @@
|
|||||||
my-vscode.enable = true;
|
my-vscode.enable = true;
|
||||||
mysops.hostSecretFile = "${flakeDir}/modules/hosts/john-p14s/secrets.yaml";
|
mysops.hostSecretFile = "${flakeDir}/modules/hosts/john-p14s/secrets.yaml";
|
||||||
homeManagerFlakeDir = "${flakeDir}";
|
homeManagerFlakeDir = "${flakeDir}";
|
||||||
shell.program = "zsh";
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
bash
|
bash
|
||||||
discord
|
discord
|
||||||
my-neovim
|
|
||||||
proton-vpn
|
proton-vpn
|
||||||
joplin-desktop
|
joplin-desktop
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -15,23 +15,19 @@ in
|
|||||||
selfPkgs = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
selfPkgs = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
||||||
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
|
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
|
||||||
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
||||||
test-push = with pkgs; writeShellApplication {
|
|
||||||
name = "test-push";
|
|
||||||
runtimeInputs = [ nh ];
|
|
||||||
text = ''nh os switch ${flakeDir}#${testHost} --target-host root@${testTarget} -e none'';
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
rebuild
|
rebuild
|
||||||
john
|
john
|
||||||
mysops
|
|
||||||
janus-ca
|
|
||||||
step-ssh-user
|
|
||||||
mtls
|
mtls
|
||||||
restic
|
restic
|
||||||
docker
|
docker
|
||||||
desktop
|
desktop
|
||||||
|
step-client
|
||||||
|
mysops
|
||||||
|
# myPackage
|
||||||
|
# myStepClient
|
||||||
];
|
];
|
||||||
# TODO: make this more restrictive, rather than allowing all unfree packages
|
# TODO: make this more restrictive, rather than allowing all unfree packages
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
@@ -42,24 +38,22 @@ in
|
|||||||
home.username = "${username}";
|
home.username = "${username}";
|
||||||
home.homeDirectory = "/home/${username}";
|
home.homeDirectory = "/home/${username}";
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
nixos-rebuild
|
selfPkgs.jsl-zsh
|
||||||
test-push
|
# selfPkgs.my-neovim
|
||||||
selfPkgs.neovim-min
|
selfPkgs.ssh-certs
|
||||||
# ${selfPkgs}.my-neovim
|
# selfPkgs.step-bootstrap
|
||||||
# selfPkgs.richPrinter
|
# selfPkgs.wg-platform
|
||||||
selfPkgs.janus-ca
|
# self'.packages.myWrappedPackage
|
||||||
|
(inputs.self.wrappers.test-push.apply {
|
||||||
|
inherit pkgs flakeDir;
|
||||||
|
host = testHost;
|
||||||
|
target = testTarget;
|
||||||
|
}).wrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
shell.program = "zsh";
|
|
||||||
|
|
||||||
homeManagerFlakeDir = flakeDir;
|
homeManagerFlakeDir = flakeDir;
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
|
|
||||||
step-ssh-user = {
|
|
||||||
enable = true;
|
|
||||||
principals = ["root" "${username}" "appdaemon"];
|
|
||||||
provisioner = "admin";
|
|
||||||
};
|
|
||||||
ssh = {
|
ssh = {
|
||||||
certificates.enable = true;
|
certificates.enable = true;
|
||||||
knownHosts = [
|
knownHosts = [
|
||||||
@@ -70,6 +64,7 @@ in
|
|||||||
appdaemon = true;
|
appdaemon = true;
|
||||||
homelab = true;
|
homelab = true;
|
||||||
dev = true;
|
dev = true;
|
||||||
|
tailscale = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -96,21 +91,25 @@ in
|
|||||||
"/home/john/john-nas"
|
"/home/john/john-nas"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
mtls = {
|
# mtls = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
subject = hostname;
|
# subject = hostname;
|
||||||
san = [
|
# san = [
|
||||||
"${hostname}"
|
# "${hostname}"
|
||||||
"192.168.1.85"
|
# "192.168.1.85"
|
||||||
"spiffe://john-stream.com/ubuntu"
|
# "spiffe://john-stream.com/ubuntu"
|
||||||
];
|
# ];
|
||||||
lifetime = "1h";
|
# lifetime = "1h";
|
||||||
renew.onCalendar = "*:1/10";
|
# renew.onCalendar = "*:1/10";
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeConfigurations."john@john-pc-ubuntu" = withSystem "x86_64-linux" (ctx@{ config, inputs', ...}:
|
flake.homeConfigurations."john@john-pc-ubuntu" = withSystem "x86_64-linux" (ctx@{ system, inputs', ... }:
|
||||||
inputs.home-manager.lib.homeManagerConfiguration {
|
inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
# pkgs = import inputs.nixpkgs {
|
||||||
|
# inherit system;
|
||||||
|
# overlays = [ inputs.self.overlays.default ];
|
||||||
|
# };
|
||||||
pkgs = inputs'.nixpkgs.legacyPackages;
|
pkgs = inputs'.nixpkgs.legacyPackages;
|
||||||
modules = [ inputs.self.modules.homeManager."${hostname}" ];
|
modules = [ inputs.self.modules.homeManager."${hostname}" ];
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
flake.wrappers.test-push = inputs.wrappers.lib.wrapModule ({config, lib, wlib, ... }: {
|
||||||
|
options = {
|
||||||
|
flakeDir = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
host = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
target = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
sshUser = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "root";
|
||||||
|
};
|
||||||
|
elevationStrategy = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "none";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
binName = "test-push";
|
||||||
|
package = config.pkgs.nh;
|
||||||
|
args = [
|
||||||
|
"os" "switch" "${config.flakeDir}#${config.host}"
|
||||||
|
"--target-host" "${config.sshUser}@${config.target}"
|
||||||
|
"--elevation-strategy" "${config.elevationStrategy}"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
|
||||||
|
flake.modules.nixos.omen = { pkgs, lib, ... }: {
|
||||||
|
# import any other modules from here
|
||||||
|
imports = [
|
||||||
|
self.modules.nixos.omenHardware
|
||||||
|
self.modules.nixos.base
|
||||||
|
self.modules.nixos.greetd
|
||||||
|
self.modules.nixos.niri
|
||||||
|
self.modules.nixos.onepassword
|
||||||
|
self.modules.nixos.steam
|
||||||
|
];
|
||||||
|
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
# Use latest kernel.
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
networking.hostName = "nixos-omen"; # Define your hostname.
|
||||||
|
|
||||||
|
# Configure network proxy if necessary
|
||||||
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
# i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
# console = {
|
||||||
|
# font = "Lat2-Terminus16";
|
||||||
|
# keyMap = "us";
|
||||||
|
# useXkbConfig = true; # use xkb.options in tty.
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
# services.printing.enable = true;
|
||||||
|
|
||||||
|
# Enable sound.
|
||||||
|
# services.pulseaudio.enable = true;
|
||||||
|
# OR
|
||||||
|
# services.pipewire = {
|
||||||
|
# enable = true;
|
||||||
|
# pulse.enable = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
|
# services.libinput.enable = true;
|
||||||
|
|
||||||
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
|
# users.users.alice = {
|
||||||
|
# isNormalUser = true;
|
||||||
|
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||||
|
# packages = with pkgs; [
|
||||||
|
# tree
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
# programs.firefox.enable = true;
|
||||||
|
|
||||||
|
# List packages installed in system profile.
|
||||||
|
# You can use https://search.nixos.org/ to find more packages (and options).
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||||
|
wget
|
||||||
|
git
|
||||||
|
micro
|
||||||
|
nh
|
||||||
|
];
|
||||||
|
|
||||||
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
|
# started in user sessions.
|
||||||
|
# programs.mtr.enable = true;
|
||||||
|
# programs.gnupg.agent = {
|
||||||
|
# enable = true;
|
||||||
|
# enableSSHSupport = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
# Or disable the firewall altogether.
|
||||||
|
# networking.firewall.enable = false;
|
||||||
|
|
||||||
|
# Copy the NixOS configuration file and link it from the resulting system
|
||||||
|
# (/run/current-system/configuration.nix). This is useful in case you
|
||||||
|
# accidentally delete configuration.nix.
|
||||||
|
# system.copySystemConfiguration = true;
|
||||||
|
|
||||||
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
#
|
||||||
|
# Most users should NEVER change this value after the initial install, for any reason,
|
||||||
|
# even if you've upgraded your system to a new NixOS release.
|
||||||
|
#
|
||||||
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||||
|
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||||
|
# to actually do that.
|
||||||
|
#
|
||||||
|
# This value being lower than the current NixOS release does NOT mean your system is
|
||||||
|
# out of date, out of support, or vulnerable.
|
||||||
|
#
|
||||||
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||||
|
# and migrated your data accordingly.
|
||||||
|
#
|
||||||
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
|
system.stateVersion = "26.05"; # Did you read the comment?
|
||||||
|
# ...
|
||||||
|
|
||||||
|
home-manager.users.john.imports = with inputs.self.modules.homeManager; [
|
||||||
|
desktop
|
||||||
|
# rebuild
|
||||||
|
{
|
||||||
|
my-vscode.enable = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
flake.nixosConfigurations.omen = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
|
self.modules.nixos.omen
|
||||||
|
self.modules.nixos.john
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
flake.modules.nixos.omenHardware = { config, lib, pkgs, modulesPath, ... }: {
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-uuid/35f77d1a-346c-4c52-83b2-7d25e2ac9fe1";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
"/mnt/shared" = {
|
||||||
|
device = "/dev/disk/by-uuid/216e8dca-170d-4377-bf1a-69b574e1778c";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ self, inputs, lib, ... }:
|
{ withSystem, self, inputs, lib, ... }:
|
||||||
let
|
let
|
||||||
username = "john";
|
username = "john";
|
||||||
hostname = "soteria";
|
hostname = "soteria";
|
||||||
@@ -84,14 +84,10 @@ in
|
|||||||
sops.defaultSopsFile = ./secrets.yaml;
|
sops.defaultSopsFile = ./secrets.yaml;
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
home-manager.users."${username}" = {
|
|
||||||
imports = with inputs.self.modules; [
|
home-manager.users."${username}".imports = [ inputs.self.modules.homeManager.soteria ];
|
||||||
homeManager."${hostname}"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.janus-ca
|
|
||||||
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-neovim
|
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-neovim
|
||||||
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh
|
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh
|
||||||
];
|
];
|
||||||
@@ -99,25 +95,26 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }: {
|
flake.modules.homeManager.soteria = { config, pkgs, lib, ... }: {
|
||||||
imports = with inputs.self.modules; [
|
imports = [
|
||||||
homeManager.rebuild
|
inputs.self.modules.homeManager.rebuild
|
||||||
homeManager.mysops
|
inputs.self.modules.homeManager.mysops
|
||||||
];
|
({ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
homeManagerFlakeDir = "${config.xdg.configHome}/home-manager";
|
homeManagerFlakeDir = "${config.xdg.configHome}/home-manager";
|
||||||
shell.program = "zsh";
|
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
|
|
||||||
# This will provide the edit-secrets script targeting this file
|
# This will provide the edit-secrets script targeting this file
|
||||||
mysops.hostSecretFile = "${config.homeManagerFlakeDir}/modules/hosts/soteria/secrets.yaml";
|
mysops.hostSecretFile = "${config.homeManagerFlakeDir}/modules/hosts/soteria/secrets.yaml";
|
||||||
};
|
})
|
||||||
|
|
||||||
flake.homeConfigurations."${hostname}" = inputs.home-manager.lib.homeManagerConfiguration {
|
|
||||||
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
|
|
||||||
modules = with inputs.self.modules; [
|
|
||||||
homeManager."${username}"
|
|
||||||
homeManager."${hostname}"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
flake.homeConfigurations.soteria = withSystem "x86_64-linux" (ctx@{ config, inputs', ...}:
|
||||||
|
inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = inputs'.nixpkgs.legacyPackages;
|
||||||
|
modules = [
|
||||||
|
inputs.self.modules.homeManager."${username}"
|
||||||
|
inputs.self.modules.homeManager.soteria
|
||||||
|
];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,6 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
flakeDir = config.homeManagerFlakeDir;
|
flakeDir = config.homeManagerFlakeDir;
|
||||||
hostnameCmd = "$(${lib.getExe pkgs.hostname} -s)";
|
|
||||||
|
|
||||||
flake-parts-check = with pkgs; writeShellApplication {
|
flake-parts-check = with pkgs; writeShellApplication {
|
||||||
name = "flake-parts-check";
|
name = "flake-parts-check";
|
||||||
@@ -52,23 +51,6 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nhms = with pkgs; writeShellApplication {
|
|
||||||
name = "nhms";
|
|
||||||
runtimeInputs = [ coreutils hostname nh ];
|
|
||||||
text = ''
|
|
||||||
USERNAME=''${USER:-$(whoami)}
|
|
||||||
HOSTNAME=$(hostname -s)
|
|
||||||
echo "Switching to the $HOSTNAME home-manager profile"
|
|
||||||
nh home switch ${flakeDir} -c "$USERNAME@$HOSTNAME" "$@"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
nhmu = with pkgs; writeShellApplication {
|
|
||||||
name = "nhmu";
|
|
||||||
runtimeInputs = [ nhms ];
|
|
||||||
text = ''nhms --update'';
|
|
||||||
};
|
|
||||||
|
|
||||||
test-build = with pkgs; writeShellApplication {
|
test-build = with pkgs; writeShellApplication {
|
||||||
name = "test-build";
|
name = "test-build";
|
||||||
runtimeInputs = [ coreutils nix hostname ];
|
runtimeInputs = [ coreutils nix hostname ];
|
||||||
@@ -82,24 +64,6 @@
|
|||||||
nix eval "${flakeDir}#nixosConfigurations.$HOSTNAME.config.system.build.toplevel.drvPath"
|
nix eval "${flakeDir}#nixosConfigurations.$HOSTNAME.config.system.build.toplevel.drvPath"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
cleanup = with pkgs; writeShellApplication {
|
|
||||||
name = "cleanup";
|
|
||||||
runtimeInputs = [ coreutils home-manager nix ];
|
|
||||||
text = ''
|
|
||||||
set -e
|
|
||||||
DAYS=$1
|
|
||||||
if [ -z "$DAYS" ]; then
|
|
||||||
echo "usage: cleanup <days>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
home-manager expire-generations "-$DAYS days"
|
|
||||||
nix profile wipe-history --older-than "''${DAYS}d"
|
|
||||||
nix store gc
|
|
||||||
nix store optimise
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
@@ -121,13 +85,64 @@
|
|||||||
name = "build-tools";
|
name = "build-tools";
|
||||||
paths = [
|
paths = [
|
||||||
flake-parts-check
|
flake-parts-check
|
||||||
nhms
|
|
||||||
nhmu
|
|
||||||
test-build
|
test-build
|
||||||
cleanup
|
(inputs.self.wrappers.home-switch.apply {
|
||||||
|
inherit pkgs flakeDir;
|
||||||
|
}).wrapper
|
||||||
|
(inputs.self.wrappers.home-switch.apply {
|
||||||
|
binName = lib.mkForce "nhmu";
|
||||||
|
inherit pkgs flakeDir;
|
||||||
|
extraOptions = [ "--update" ];
|
||||||
|
}).wrapper
|
||||||
|
(inputs.wrappers.lib.wrapPackage {
|
||||||
|
binName = "cleanup";
|
||||||
|
inherit pkgs;
|
||||||
|
package = nh;
|
||||||
|
args = [ "clean" "user" "--keep-since" "3days" ];
|
||||||
|
})
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
flake.wrappers.home-switch = inputs.wrappers.lib.wrapModule ({config, lib, wlib, ... }: {
|
||||||
|
options = {
|
||||||
|
flakeDir = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
};
|
||||||
|
user = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "$(whoami)";
|
||||||
|
};
|
||||||
|
hostname = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "$(hostname -s)";
|
||||||
|
};
|
||||||
|
configuration = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "${config.user}@${config.hostname}";
|
||||||
|
};
|
||||||
|
extraOptions = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
binName = "nhms";
|
||||||
|
extraPackages = with config.pkgs; [ coreutils hostname nh ];
|
||||||
|
preHook = ''
|
||||||
|
CONFIG=${config.configuration}
|
||||||
|
echo "Switching to $CONFIG from ${config.flakeDir}"
|
||||||
|
'';
|
||||||
|
package = config.pkgs.nh;
|
||||||
|
args = [
|
||||||
|
"home" "switch"
|
||||||
|
"--configuration" "${config.configuration}"
|
||||||
|
"$@"
|
||||||
|
"${config.flakeDir}"
|
||||||
|
] ++ config.extraOptions;
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,17 +14,27 @@
|
|||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
|
environment.shells = [
|
||||||
|
"${lib.getExe pkgs.zsh}"
|
||||||
|
"${lib.getExe inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh}"
|
||||||
|
];
|
||||||
|
|
||||||
|
users.groups."${username}" = {};
|
||||||
|
|
||||||
users.users."${username}" = {
|
users.users."${username}" = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
group = username;
|
||||||
home = "/home/${username}";
|
home = "/home/${username}";
|
||||||
shell = lib.mkIf config.programs.zsh.enable pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
extraGroups = [ "input" "networkmanager" ]
|
extraGroups = [ "input" "networkmanager" "video" "render" ]
|
||||||
++ lib.optional isAdmin "wheel"
|
++ lib.optional isAdmin "wheel"
|
||||||
++ lib.optional config.virtualisation.docker.enable "docker"
|
++ lib.optional config.virtualisation.docker.enable "docker"
|
||||||
++ lib.optional (isAdmin && config.services.forgejo.enable) config.services.forgejo.group
|
++ lib.optional (isAdmin && config.services.forgejo.enable) config.services.forgejo.group
|
||||||
++ lib.optional (isAdmin && config.services.postgresql.enable) "postgres";
|
++ lib.optional (isAdmin && config.services.postgresql.enable) "postgres";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
security.sudo-rs.enable = lib.mkIf isAdmin true;
|
security.sudo-rs.enable = lib.mkIf isAdmin true;
|
||||||
|
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
@@ -33,7 +43,9 @@
|
|||||||
imports = [ self.modules.homeManager."${username}" ];
|
imports = [ self.modules.homeManager."${username}" ];
|
||||||
home.username = "${username}";
|
home.username = "${username}";
|
||||||
home.homeDirectory = "/home/${username}";
|
home.homeDirectory = "/home/${username}";
|
||||||
# home.packages = homePackages;
|
home.packages = with pkgs; [
|
||||||
|
# fzf zoxide starship
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
flake-file.inputs = {
|
config.flake-file.inputs = {
|
||||||
wrapper-modules = {
|
wrapper-modules = {
|
||||||
url = "github:BirdeeHub/nix-wrapper-modules";
|
url = "github:BirdeeHub/nix-wrapper-modules";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -9,4 +9,13 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
options = {
|
||||||
|
# This is what allows wrappers to be defined in flake.wrappers.<wrapper-name> throughout different flake-parts modules
|
||||||
|
flake = inputs.flake-parts.lib.mkSubmoduleOptions {
|
||||||
|
wrappers = inputs.nixpkgs.lib.mkOption {
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
{
|
{
|
||||||
flake.modules.homeManager.bash = { pkgs, lib, config, ... }:
|
flake.modules.homeManager.bash = { pkgs, lib, config, ... }:
|
||||||
{
|
{
|
||||||
programs.bash = lib.mkIf (config.shell.program == "bash") {
|
programs.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
package = pkgs.bash;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
flake.modules.homeManager.ghostty = { config, pkgs, lib, ... }:
|
flake.modules.homeManager.ghostty = { config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
ghosttyPackage = pkgs.symlinkJoin {
|
ghosttyX11 = pkgs.symlinkJoin {
|
||||||
name = "ghostty-x11";
|
name = "ghostty-x11";
|
||||||
paths = [ (config.lib.nixGL.wrap pkgs.ghostty) ];
|
paths = [ (config.lib.nixGL.wrap pkgs.ghostty) ];
|
||||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
@@ -24,6 +24,10 @@
|
|||||||
TERMINAL = "ghostty";
|
TERMINAL = "ghostty";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
inputs.self.packages.${system}.ghosttyGPUCheck
|
||||||
|
];
|
||||||
|
|
||||||
targets.genericLinux.nixGL = {
|
targets.genericLinux.nixGL = {
|
||||||
packages = inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system};
|
packages = inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system};
|
||||||
defaultWrapper = "mesa";
|
defaultWrapper = "mesa";
|
||||||
@@ -33,7 +37,7 @@
|
|||||||
programs.ghostty = {
|
programs.ghostty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
package = ghosttyPackage;
|
package = ghosttyX11;
|
||||||
settings = {
|
settings = {
|
||||||
command = "TERM=xterm-256color ${lib.getExe pkgs.zsh}";
|
command = "TERM=xterm-256color ${lib.getExe pkgs.zsh}";
|
||||||
font-size = 12;
|
font-size = 12;
|
||||||
@@ -72,7 +76,7 @@
|
|||||||
# https://github.com/ghostty-org/ghostty/discussions/3763#discussioncomment-11699970
|
# https://github.com/ghostty-org/ghostty/discussions/3763#discussioncomment-11699970
|
||||||
xdg.desktopEntries."com.mitchellh.ghostty" =
|
xdg.desktopEntries."com.mitchellh.ghostty" =
|
||||||
let
|
let
|
||||||
ghosttyCmd = lib.getExe ghosttyPackage;
|
ghosttyCmd = lib.getExe ghosttyX11;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
name = "Ghostty";
|
name = "Ghostty";
|
||||||
@@ -100,4 +104,16 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
perSystem = { system, pkgs, lib, ... }: {
|
||||||
|
packages.ghosttyGPUCheck = pkgs.writeShellApplication {
|
||||||
|
name = "ghostty-gpu-check";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
bash
|
||||||
|
gnugrep
|
||||||
|
procps # for pgrep, pidof, etc.
|
||||||
|
];
|
||||||
|
text = builtins.readFile ../../scripts/ghostty-gpu-check.sh;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+104
-79
@@ -6,12 +6,9 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = { system, pkgs, config, ... }: {
|
perSystem = { system, pkgs, config, ... }:
|
||||||
packages.my-neovim = ((inputs.nvf.lib.neovimConfiguration {
|
let
|
||||||
inherit pkgs;
|
commonNeovimModule = {
|
||||||
modules = [
|
|
||||||
{
|
|
||||||
# https://nvf.notashelf.dev/search.html
|
|
||||||
config.vim = {
|
config.vim = {
|
||||||
options = {
|
options = {
|
||||||
number = true;
|
number = true;
|
||||||
@@ -27,7 +24,6 @@
|
|||||||
|
|
||||||
syntaxHighlighting = true;
|
syntaxHighlighting = true;
|
||||||
|
|
||||||
# Enable custom theming options
|
|
||||||
theme.enable = true;
|
theme.enable = true;
|
||||||
theme.name = "catppuccin";
|
theme.name = "catppuccin";
|
||||||
theme.style = "mocha";
|
theme.style = "mocha";
|
||||||
@@ -36,81 +32,63 @@
|
|||||||
# git.neogit.enable = true;
|
# git.neogit.enable = true;
|
||||||
|
|
||||||
# https://github.com/akinsho/toggleterm.nvim
|
# https://github.com/akinsho/toggleterm.nvim
|
||||||
terminal.toggleterm.enable = true;
|
terminal.toggleterm = {
|
||||||
terminal.toggleterm.lazygit.enable = true;
|
|
||||||
terminal.toggleterm.lazygit.direction = "float";
|
|
||||||
terminal.toggleterm.lazygit.mappings.open = "<C-g>";
|
|
||||||
|
|
||||||
|
|
||||||
utility.nix-develop.enable = true;
|
|
||||||
|
|
||||||
utility.oil-nvim.enable = true;
|
|
||||||
utility.oil-nvim.gitStatus.enable = true;
|
|
||||||
|
|
||||||
filetree.neo-tree = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
|
lazygit = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.lazygit;
|
||||||
|
direction = "float";
|
||||||
|
mappings.open = "<C-g>";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# lazy = {
|
languages = {
|
||||||
# enable = true;
|
enableTreesitter = true;
|
||||||
# };
|
enableFormat = true;
|
||||||
|
|
||||||
# globals = {
|
nix.enable = true;
|
||||||
# SimpylFold_docstring_preview = 1;
|
yaml.enable = true;
|
||||||
# SimpylFold_fold_blank = 0;
|
toml.enable = true;
|
||||||
# };
|
};
|
||||||
|
};
|
||||||
# extraPlugins = with pkgs.vimPlugins; {
|
};
|
||||||
# SimpylFold.package = SimpylFold;
|
|
||||||
# };
|
|
||||||
|
|
||||||
|
telescopeModule = {
|
||||||
|
config.vim = {
|
||||||
telescope = {
|
telescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extensions = [
|
extensions = [
|
||||||
{
|
{
|
||||||
name = "fzf";
|
name = "fzf";
|
||||||
packages = [ pkgs.vimPlugins.telescope-fzf-native-nvim ];
|
packages = [ pkgs.vimPlugins.telescope-fzf-native-nvim ];
|
||||||
setup = {fzf = {fuzzy = true;};};
|
setup = {
|
||||||
|
fzf.fuzzy = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable Treesitter
|
keymaps = [
|
||||||
treesitter = {
|
{
|
||||||
enable = true;
|
desc = "Key Maps [Telescope]";
|
||||||
grammars = with pkgs.vimPlugins.nvim-treesitter-parsers; [ python ];
|
key = "<leader>fkm";
|
||||||
};
|
mode = "n";
|
||||||
|
silent = false;
|
||||||
lsp.enable = true;
|
action = "<cmd>:Telescope keymaps<CR>";
|
||||||
|
}
|
||||||
languages = {
|
{
|
||||||
enableTreesitter = true;
|
desc = "Toggle Filesystem Tree [NeoTree]";
|
||||||
enableFormat = true;
|
key = "<C-b>";
|
||||||
|
mode = [ "n" "v" "t" ];
|
||||||
markdown = {
|
silent = false;
|
||||||
enable = true;
|
action = "<cmd>:Neotree toggle filesystem left action=show<CR>";
|
||||||
extensions = {
|
}
|
||||||
# render-markdown-nvim.enable = true;
|
];
|
||||||
markview-nvim.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
bash.enable = true;
|
|
||||||
css.enable = true;
|
|
||||||
yaml.enable = true;
|
|
||||||
toml.enable = true;
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
python = {
|
|
||||||
enable = true;
|
|
||||||
dap.enable = true;
|
|
||||||
format.type = [ "ruff" ];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
keymapsModule = {
|
||||||
|
config.vim = {
|
||||||
keymaps = [
|
keymaps = [
|
||||||
{
|
{
|
||||||
desc = "Edit key mappings";
|
desc = "Edit key mappings";
|
||||||
@@ -126,20 +104,6 @@
|
|||||||
silent = false;
|
silent = false;
|
||||||
action = "<cmd>:TermExec cmd='clear && nhms && exit' name='Nix Home Manager Switch' direction=float<CR>";
|
action = "<cmd>:TermExec cmd='clear && nhms && exit' name='Nix Home Manager Switch' direction=float<CR>";
|
||||||
}
|
}
|
||||||
{
|
|
||||||
desc = "Key Maps [Telescope]";
|
|
||||||
key = "<leader>fkm";
|
|
||||||
mode = "n";
|
|
||||||
silent = false;
|
|
||||||
action = "<cmd>:Telescope keymaps<CR>";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
desc = "Toggle Filesystem Tree [NeoTree]";
|
|
||||||
key = "<C-b>";
|
|
||||||
mode = [ "n" "v" "t" ];
|
|
||||||
silent = false;
|
|
||||||
action = "<cmd>:Neotree toggle filesystem left action=show<CR>";
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
key = "<C-`>";
|
key = "<C-`>";
|
||||||
mode = [ "n" "v" "t" ];
|
mode = [ "n" "v" "t" ];
|
||||||
@@ -148,11 +112,72 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
packages.my-neovim = ((inputs.nvf.lib.neovimConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [
|
||||||
|
commonNeovimModule
|
||||||
|
telescopeModule
|
||||||
|
keymapsModule
|
||||||
|
{
|
||||||
|
# https://nvf.notashelf.dev/search.html
|
||||||
|
config.vim = {
|
||||||
|
utility.nix-develop.enable = true;
|
||||||
|
|
||||||
|
utility.oil-nvim.enable = true;
|
||||||
|
utility.oil-nvim.gitStatus.enable = true;
|
||||||
|
|
||||||
|
filetree.neo-tree = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable Treesitter
|
||||||
|
treesitter = {
|
||||||
|
enable = true;
|
||||||
|
grammars = with pkgs.vimPlugins.nvim-treesitter-parsers; [ python ];
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp.enable = true;
|
||||||
|
|
||||||
|
languages = {
|
||||||
|
markdown = {
|
||||||
|
enable = true;
|
||||||
|
extensions = {
|
||||||
|
# render-markdown-nvim.enable = true;
|
||||||
|
markview-nvim.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
bash.enable = true;
|
||||||
|
css.enable = true;
|
||||||
|
yaml.enable = true;
|
||||||
|
toml.enable = true;
|
||||||
|
|
||||||
|
python = {
|
||||||
|
enable = true;
|
||||||
|
dap.enable = true;
|
||||||
|
format.type = [ "ruff" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}).neovim).overrideAttrs (old: {
|
}).neovim).overrideAttrs (old: {
|
||||||
pname = "my-neovim";
|
pname = "my-neovim";
|
||||||
version = "custom";
|
version = "1.0.0";
|
||||||
|
});
|
||||||
|
|
||||||
|
packages.neovim-min = ((inputs.nvf.lib.neovimConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [
|
||||||
|
commonNeovimModule
|
||||||
|
telescopeModule
|
||||||
|
keymapsModule
|
||||||
|
];
|
||||||
|
}).neovim).overrideAttrs (old: {
|
||||||
|
pname = "neovim-min";
|
||||||
|
version = "1.0.0";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
{ self, inputs, ... }: {
|
|
||||||
flake.modules.nixos.niri = { pkgs, lib, ... }: {
|
|
||||||
programs.niri = {
|
|
||||||
enable = true;
|
|
||||||
package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
perSystem = { pkgs, lib, self', ... }: {
|
|
||||||
packages.myNiri = inputs.wrapper-modules.wrappers.niri.wrap {
|
|
||||||
inherit pkgs;
|
|
||||||
env.RUST_BACKTRACE = "full";
|
|
||||||
settings = {
|
|
||||||
spawn-at-startup = [
|
|
||||||
"${lib.getExe self'.packages.myNoctalia}"
|
|
||||||
];
|
|
||||||
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
|
|
||||||
input.keyboard.xkb.layout = "us,ua";
|
|
||||||
layout.gaps = 5;
|
|
||||||
binds = {
|
|
||||||
"Mod+Return".spawn-sh = lib.getExe pkgs.ghostty;
|
|
||||||
"Mod+Q".close-window = null;
|
|
||||||
"Mod+S".spawn-sh = "${lib.getExe self'.packages.myNoctalia} ipc call launcher toggle";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{ self, inputs, ... }: {
|
|
||||||
perSystem = { pkgs, ... }: {
|
|
||||||
packages.myNoctalia = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
|
|
||||||
inherit pkgs;
|
|
||||||
# settings = (builtins.fromJSON (builtins.readFile ./noctalia.json)).settings;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,20 @@
|
|||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
|
flake.modules.nixos.onepassword = { config, ... }: {
|
||||||
|
programs._1password.enable = true;
|
||||||
|
programs._1password-gui = {
|
||||||
|
enable = true;
|
||||||
|
# Certain features, including CLI integration and system authentication support,
|
||||||
|
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
|
||||||
|
polkitPolicyOwners = [ "john" ];
|
||||||
|
# TODO this should not be a hardcoded username
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
flake.modules.homeManager.onepassword = { config, ... }: {
|
flake.modules.homeManager.onepassword = { config, ... }: {
|
||||||
home.file.".config/1Password/ssh/agent.toml".text = ''
|
home.file.".config/1Password/ssh/agent.toml".text = ''
|
||||||
# https://developer.1password.com/docs/ssh/agent/config
|
# https://developer.1password.com/docs/ssh/agent/config
|
||||||
[[ssh-keys]]
|
[[ssh-keys]]
|
||||||
vault = "Private"
|
vault = "Private"
|
||||||
'';
|
'';
|
||||||
programs.ssh.matchBlocks."*".identityAgent = "${config.home.homeDirectory}/.1password/agent.sock";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+52
-51
@@ -1,4 +1,4 @@
|
|||||||
{ inputs, ... }:
|
{ self, inputs, ... }:
|
||||||
let
|
let
|
||||||
inputs' = inputs; # save a reference before it's shadowed
|
inputs' = inputs; # save a reference before it's shadowed
|
||||||
in
|
in
|
||||||
@@ -14,18 +14,10 @@ in
|
|||||||
imports = [ inputs.sops-nix.nixosModules.sops ];
|
imports = [ inputs.sops-nix.nixosModules.sops ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Define the homeModules that are used by flake-parts
|
flake.modules.homeManager.mysops =
|
||||||
# https://flake.parts/options/home-manager.html#opt-flake.modules.homeManager
|
{ config, pkgs, lib, ... }:
|
||||||
flake.modules.homeManager.mysops = { inputs, config, pkgs, lib, ... }:
|
|
||||||
let
|
let
|
||||||
cfg = config.mysops;
|
cfg = config.mysops;
|
||||||
sopsBin = lib.getExe pkgs.sops;
|
|
||||||
sopsConfigPath = ../../.sops.yaml;
|
|
||||||
sopsSecretsPath = ../../keys/secrets.yaml;
|
|
||||||
|
|
||||||
editScript = lib.optional (cfg.hostSecretFile != null) (pkgs.writeShellScriptBin "edit-secrets" ''
|
|
||||||
${sopsBin} --config ${sopsConfigPath} ${cfg.hostSecretFile}
|
|
||||||
'');
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -34,11 +26,6 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
options.mysops = {
|
options.mysops = {
|
||||||
ageKeyFile = lib.mkOption {
|
|
||||||
description = "Default location for the age key";
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "${config.xdg.configHome}/sops/age/keys.txt";
|
|
||||||
};
|
|
||||||
hostSecretFile = lib.mkOption {
|
hostSecretFile = lib.mkOption {
|
||||||
description = "Path to the secrets file for this host. Used to create the edit-secrets script";
|
description = "Path to the secrets file for this host. Used to create the edit-secrets script";
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
@@ -48,49 +35,63 @@ in
|
|||||||
|
|
||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
echo = lib.getExe' pkgs.coreutils "echo";
|
my-sops = (inputs.self.wrappers.mySops.apply {
|
||||||
dirname = lib.getExe' pkgs.coreutils "dirname";
|
inherit pkgs;
|
||||||
mkdir = lib.getExe' pkgs.coreutils "mkdir";
|
sshKey = config.ssh.identityFile;
|
||||||
show-age-key = (pkgs.writeShellScriptBin "show-age-key" ''
|
}).wrapper;
|
||||||
${lib.getExe' pkgs.age "age-keygen"} -y ${cfg.ageKeyFile}
|
|
||||||
'');
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
|
||||||
age
|
|
||||||
sops # This is necessary to make the sops binary available
|
|
||||||
ssh-to-age
|
|
||||||
(writeShellScriptBin "gen-age-key" ''
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
if [ ! -f "${config.ssh.identityFile}" ]; then
|
|
||||||
${echo} "SSH identity file not found: ${config.ssh.identityFile}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "${cfg.ageKeyFile}" ]; then
|
|
||||||
${echo} "Refusing to overwrite existing age key file: ${cfg.ageKeyFile}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
${mkdir} -p "$(${dirname} "${cfg.ageKeyFile}")"
|
|
||||||
${lib.getExe pkgs.ssh-to-age} -i ${config.ssh.identityFile} -private-key > ${cfg.ageKeyFile}
|
|
||||||
${echo} -n "Created ${cfg.ageKeyFile}: "
|
|
||||||
${echo} $(${lib.getExe show-age-key})
|
|
||||||
'')
|
|
||||||
show-age-key
|
|
||||||
(writeShellScriptBin "ls-secrets" "${lib.getExe pkgs.eza} -alT --follow-symlinks ~/.config/sops-nix/secrets")
|
|
||||||
] ++ editScript;
|
|
||||||
|
|
||||||
home.shellAliases.sops = "${sopsBin} --config ${sopsConfigPath}";
|
|
||||||
|
|
||||||
# Option definitions for the sops home-manager module:
|
# Option definitions for the sops home-manager module:
|
||||||
# https://github.com/Mic92/sops-nix/blob/master/modules/home-manager/sops.nix
|
# https://github.com/Mic92/sops-nix/blob/master/modules/home-manager/sops.nix
|
||||||
sops = {
|
sops = {
|
||||||
defaultSopsFile = sopsSecretsPath;
|
defaultSopsFile = ../../keys/secrets.yaml;
|
||||||
defaultSopsFormat = "yaml";
|
defaultSopsFormat = "yaml";
|
||||||
age.sshKeyPaths = [ "${config.ssh.identityFile}" ];
|
age.sshKeyPaths = [ "${config.ssh.identityFile}" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
my-sops
|
||||||
|
(inputs.wrappers.lib.wrapPackage {
|
||||||
|
binName = "ls-secrets";
|
||||||
|
inherit pkgs;
|
||||||
|
package = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-eza;
|
||||||
|
args = [
|
||||||
|
"-T" "--follow-symlinks"
|
||||||
|
"${config.xdg.configHome}/sops-nix/secrets"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
]
|
||||||
|
++ lib.optional (cfg.hostSecretFile != null) (inputs.wrappers.lib.wrapPackage {
|
||||||
|
binName = "edit-secrets";
|
||||||
|
inherit pkgs;
|
||||||
|
package = my-sops;
|
||||||
|
args = [ cfg.hostSecretFile ];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
flake.wrappers.mySops = inputs.wrappers.lib.wrapModule ({config, lib, wlib, ... }: {
|
||||||
|
options = {
|
||||||
|
sshKey = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "String path to the SSH key to use for creating an AGE key at runtime";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
# binName = "my-sops";
|
||||||
|
package = config.pkgs.sops;
|
||||||
|
extraPackages = with config.pkgs; [ coreutils ssh-to-age ];
|
||||||
|
preHook = ''
|
||||||
|
AGE_KEY=$(umask 077; mktemp)
|
||||||
|
ssh-to-age -private-key -i ${config.sshKey} > "$AGE_KEY"
|
||||||
|
'';
|
||||||
|
flags."--config" = "${../../.sops.yaml}";
|
||||||
|
postHook = ''
|
||||||
|
rm "$AGE_KEY"
|
||||||
|
echo "Removed $AGE_KEY"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
perSystem = { system, pkgs, lib, ... }: {
|
||||||
|
packages.starship = (inputs.wrappers.wrapperModules.starship.apply {
|
||||||
|
inherit pkgs;
|
||||||
|
settings = lib.recursiveUpdate (lib.importTOML (pkgs.fetchurl {
|
||||||
|
url = https://starship.rs/presets/toml/catppuccin-powerline.toml;
|
||||||
|
sha256 = "1jzbbzm3nwdlldq43aj3csp0ps23fsa6x2225z85l0s9qbj4cdy2";
|
||||||
|
})) {
|
||||||
|
palette = "catppuccin_mocha";
|
||||||
|
add_newline = true;
|
||||||
|
line_break.disabled = false;
|
||||||
|
git_status.diverged = "⇕⇡\${ahead_count}⇣\${behind_count}";
|
||||||
|
cmd_duration.format = " $duration";
|
||||||
|
cmd_duration.show_notifications = false;
|
||||||
|
hostname = {
|
||||||
|
disabled = false;
|
||||||
|
ssh_symbol = "🌐";
|
||||||
|
format = "[$ssh_symbol$hostname]($style)";
|
||||||
|
style = "bg:red fg:crust";
|
||||||
|
};
|
||||||
|
os.symbols.NixOS = " ";
|
||||||
|
format = lib.replaceStrings ["\n"] [""] ''
|
||||||
|
[](red)
|
||||||
|
$os
|
||||||
|
$username
|
||||||
|
$hostname
|
||||||
|
[](bg:peach fg:red)
|
||||||
|
$directory
|
||||||
|
[](bg:yellow fg:peach)
|
||||||
|
$git_branch
|
||||||
|
$git_status
|
||||||
|
[](fg:yellow bg:green)
|
||||||
|
$c
|
||||||
|
$rust
|
||||||
|
$golang
|
||||||
|
$nodejs
|
||||||
|
$php
|
||||||
|
$java
|
||||||
|
$kotlin
|
||||||
|
$haskell
|
||||||
|
$python
|
||||||
|
[](fg:green bg:sapphire)
|
||||||
|
$conda
|
||||||
|
[](fg:sapphire bg:lavender)
|
||||||
|
$time
|
||||||
|
[ ](fg:lavender)
|
||||||
|
$cmd_duration
|
||||||
|
$line_break
|
||||||
|
$character
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}).wrapper;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
{ self, inputs, ... }: {
|
|
||||||
#
|
|
||||||
# Home Manager Module
|
|
||||||
#
|
|
||||||
flake.modules.homeManager.step-ssh-user = { config, pkgs, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.step-ssh-user;
|
|
||||||
firstPrincipal = lib.head cfg.principals;
|
|
||||||
principalArgs = lib.concatMapStringsSep " "
|
|
||||||
(principal: "--principal \"${principal}\"") cfg.principals;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.step-ssh-user = {
|
|
||||||
enable = lib.mkEnableOption "opionated step client config for SSH certs";
|
|
||||||
provisioner = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "admin";
|
|
||||||
};
|
|
||||||
principals = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
sops.secrets."janus/admin_jwk".mode = "0400";
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
(writeShellScriptBin "sign-ssh-cert" ''
|
|
||||||
${lib.getExe pkgs.step-cli} ssh certificate \
|
|
||||||
--sign \
|
|
||||||
${principalArgs} \
|
|
||||||
--provisioner "${cfg.provisioner}" \
|
|
||||||
--provisioner-password-file "${config.sops.secrets."janus/admin_jwk".path}" \
|
|
||||||
"${firstPrincipal}" "${config.ssh.identityFile}.pub"
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
runtimeInputs = with pkgs; [ coreutils systemd wireguard-tools ];
|
runtimeInputs = with pkgs; [ coreutils systemd wireguard-tools ];
|
||||||
package = pkgs.symlinkJoin {
|
package = pkgs.symlinkJoin {
|
||||||
name = "wg-platform";
|
name = "wg-platform";
|
||||||
|
meta.mainProgram = "wg-platform-connect";
|
||||||
paths = [
|
paths = [
|
||||||
connect
|
connect
|
||||||
disconnect
|
disconnect
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
# https://github.com/Lassulus/wrappers/blob/main/modules/yazi/module.nix
|
||||||
|
perSystem = { system, pkgs, lib, ... }: {
|
||||||
|
packages.yazi = (inputs.wrappers.wrapperModules.yazi.apply {
|
||||||
|
inherit pkgs;
|
||||||
|
settings = {
|
||||||
|
mgr.ratio = [ 1 4 3 ];
|
||||||
|
};
|
||||||
|
}).wrapper;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
{ self, ... }:
|
||||||
|
let
|
||||||
|
packageName = "zed-editor";
|
||||||
|
vulkanIcd = "/usr/share/vulkan/icd.d/nvidia_icd.json";
|
||||||
|
eglVendor = "/usr/share/glvnd/egl_vendor.d/10_nvidia.json";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
perSystem = { pkgs, ... }: {
|
||||||
|
packages."${packageName}" = pkgs.symlinkJoin {
|
||||||
|
name = "zed-editor-host-gpu";
|
||||||
|
paths = [ pkgs.zed-editor ];
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
meta = pkgs.zed-editor.meta // {
|
||||||
|
mainProgram = "zeditor";
|
||||||
|
};
|
||||||
|
postBuild = ''
|
||||||
|
for exe in $out/bin/*; do
|
||||||
|
wrapProgram "$exe" \
|
||||||
|
--unset WAYLAND_DISPLAY \
|
||||||
|
--unset GDK_BACKEND \
|
||||||
|
--set VK_DRIVER_FILES ${vulkanIcd} \
|
||||||
|
--set VK_ICD_FILENAMES ${vulkanIcd} \
|
||||||
|
--set __EGL_VENDOR_LIBRARY_FILENAMES ${eglVendor} \
|
||||||
|
--set __GLX_VENDOR_LIBRARY_NAME nvidia
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.homeManager.zed-editor = { pkgs, ... }: {
|
||||||
|
home.packages = [ pkgs.vulkan-tools ];
|
||||||
|
|
||||||
|
programs.zed-editor = {
|
||||||
|
enable = true;
|
||||||
|
package = self.packages.${pkgs.stdenv.hostPlatform.system}."${packageName}";
|
||||||
|
installRemoteServer = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
+13
-55
@@ -1,6 +1,7 @@
|
|||||||
{ self, inputs, ... }:
|
{ self, inputs, ... }:
|
||||||
let
|
let
|
||||||
username = "john";
|
username = "john";
|
||||||
|
historySize = 10000;
|
||||||
homeEndKeyBindings = ''
|
homeEndKeyBindings = ''
|
||||||
# Normalize common Home/End escape sequences across terminal emulators.
|
# Normalize common Home/End escape sequences across terminal emulators.
|
||||||
bindkey "^[[H" beginning-of-line
|
bindkey "^[[H" beginning-of-line
|
||||||
@@ -11,6 +12,7 @@ let
|
|||||||
bindkey "^[[8~" end-of-line
|
bindkey "^[[8~" end-of-line
|
||||||
bindkey "^[OH" beginning-of-line
|
bindkey "^[OH" beginning-of-line
|
||||||
bindkey "^[OF" end-of-line
|
bindkey "^[OF" end-of-line
|
||||||
|
bindkey "^[[3~" delete-char
|
||||||
|
|
||||||
# Normalize common Ctrl+Arrow sequences for word-wise movement.
|
# Normalize common Ctrl+Arrow sequences for word-wise movement.
|
||||||
bindkey "^[[1;5D" backward-word
|
bindkey "^[[1;5D" backward-word
|
||||||
@@ -33,7 +35,7 @@ in
|
|||||||
homeManager.zsh = { pkgs, config, ... }: {
|
homeManager.zsh = { pkgs, config, ... }: {
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.zsh;
|
package = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
autosuggestion.enable = true;
|
autosuggestion.enable = true;
|
||||||
# syntaxHighlighting.enable = true;
|
# syntaxHighlighting.enable = true;
|
||||||
@@ -51,8 +53,8 @@ in
|
|||||||
"eza"
|
"eza"
|
||||||
"clear"
|
"clear"
|
||||||
];
|
];
|
||||||
save = 1000;
|
save = historySize;
|
||||||
size = 1000;
|
size = historySize;
|
||||||
share = true;
|
share = true;
|
||||||
};
|
};
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
@@ -94,6 +96,7 @@ in
|
|||||||
env = {
|
env = {
|
||||||
LANG = "en_US.UTF-8";
|
LANG = "en_US.UTF-8";
|
||||||
COLORTERM = "truecolor";
|
COLORTERM = "truecolor";
|
||||||
|
DEVENV_SHELL_TYPE = "zsh";
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
completion = {
|
completion = {
|
||||||
@@ -125,67 +128,22 @@ in
|
|||||||
extraRC = ''
|
extraRC = ''
|
||||||
${homeEndKeyBindings}
|
${homeEndKeyBindings}
|
||||||
|
|
||||||
eval "$(direnv hook zsh)"
|
HISTFILE=$HOME/.config/zsh/.zsh_history
|
||||||
|
SAVEHIST=${toString historySize}
|
||||||
HISTFILE=$HOME/.zsh_history
|
|
||||||
HISTORY_IGNORE=${lib.escapeShellArg "(${lib.concatStringsSep "|" ignorePatterns})"}
|
HISTORY_IGNORE=${lib.escapeShellArg "(${lib.concatStringsSep "|" ignorePatterns})"}
|
||||||
|
|
||||||
HOSTNAME=$(hostname -s)
|
HOSTNAME=$(hostname -s)
|
||||||
${aliasStr}
|
${aliasStr}
|
||||||
|
|
||||||
|
eval "$(devenv hook zsh)"
|
||||||
'';
|
'';
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
|
lazygit
|
||||||
lazydocker
|
lazydocker
|
||||||
|
devenv
|
||||||
self'.packages.shell-tools
|
self'.packages.shell-tools
|
||||||
|
self'.packages.neovim-min
|
||||||
];
|
];
|
||||||
}).wrapper;
|
}).wrapper;
|
||||||
|
|
||||||
packages.starship = (inputs.wrappers.wrapperModules.starship.apply {
|
|
||||||
inherit pkgs;
|
|
||||||
settings = lib.recursiveUpdate (lib.importTOML (pkgs.fetchurl {
|
|
||||||
url = https://starship.rs/presets/toml/catppuccin-powerline.toml;
|
|
||||||
sha256 = "0bd8zx0bpri63rnb9dva0rav75d3i2wrzw44h63m75hq5220r26g";
|
|
||||||
})) {
|
|
||||||
palette = "catppuccin_mocha";
|
|
||||||
add_newline = true;
|
|
||||||
line_break.disabled = false;
|
|
||||||
git_status.diverged = "⇕⇡\${ahead_count}⇣\${behind_count}";
|
|
||||||
cmd_duration.format = " $duration";
|
|
||||||
hostname = {
|
|
||||||
disabled = false;
|
|
||||||
ssh_symbol = "🌐";
|
|
||||||
format = "[$ssh_symbol$hostname]($style)";
|
|
||||||
style = "bg:red fg:crust";
|
|
||||||
};
|
|
||||||
format = lib.replaceStrings ["\n"] [""] ''
|
|
||||||
[](red)
|
|
||||||
$os
|
|
||||||
$username
|
|
||||||
$hostname
|
|
||||||
[](bg:peach fg:red)
|
|
||||||
$directory
|
|
||||||
[](bg:yellow fg:peach)
|
|
||||||
$git_branch
|
|
||||||
$git_status
|
|
||||||
[](fg:yellow bg:green)
|
|
||||||
$c
|
|
||||||
$rust
|
|
||||||
$golang
|
|
||||||
$nodejs
|
|
||||||
$php
|
|
||||||
$java
|
|
||||||
$kotlin
|
|
||||||
$haskell
|
|
||||||
$python
|
|
||||||
[](fg:green bg:sapphire)
|
|
||||||
$conda
|
|
||||||
[](fg:sapphire bg:lavender)
|
|
||||||
$time
|
|
||||||
[ ](fg:lavender)
|
|
||||||
$cmd_duration
|
|
||||||
$line_break
|
|
||||||
$character
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}).wrapper;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
+46
-33
@@ -102,6 +102,7 @@ in
|
|||||||
certs = mkEnableOption "Enable Janus and Soteria SSH targets";
|
certs = mkEnableOption "Enable Janus and Soteria SSH targets";
|
||||||
homelab = mkEnableOption "Enable various Homelab targets";
|
homelab = mkEnableOption "Enable various Homelab targets";
|
||||||
dev = mkEnableOption "Enable development targets";
|
dev = mkEnableOption "Enable development targets";
|
||||||
|
tailscale = mkEnableOption "Enable tailscale targets";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -125,78 +126,90 @@ in
|
|||||||
SetEnv TERM="xterm-256color"
|
SetEnv TERM="xterm-256color"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
matchBlocks = lib.mkMerge [
|
settings = lib.mkMerge [
|
||||||
{
|
{
|
||||||
"john-pc-ubuntu" = {
|
"john-pc-ubuntu" = {
|
||||||
hostname = "192.168.1.85";
|
HostName = "192.168.1.85";
|
||||||
};
|
};
|
||||||
|
|
||||||
"*" = lib.mkMerge [
|
"*" = lib.mkMerge [
|
||||||
{
|
{
|
||||||
user = "john";
|
User = "john";
|
||||||
|
IdentityAgent = "${config.home.homeDirectory}/.1password/agent.sock";
|
||||||
|
|
||||||
compression = false;
|
Compression = false;
|
||||||
serverAliveInterval = 0;
|
ServerAliveInterval = 0;
|
||||||
serverAliveCountMax = 3;
|
ServerAliveCountMax = 3;
|
||||||
|
|
||||||
identitiesOnly = true;
|
IdentitiesOnly = true;
|
||||||
inherit identityFile;
|
IdentityFile = identityFile;
|
||||||
|
|
||||||
hashKnownHosts = false;
|
HashKnownHosts = false;
|
||||||
userKnownHostsFile = cfg.knownHostsFile;
|
UserKnownHostsFile = cfg.knownHostsFile;
|
||||||
|
|
||||||
addKeysToAgent = "yes";
|
AddKeysToAgent = "yes";
|
||||||
forwardAgent = false;
|
ForwardAgent = false;
|
||||||
}
|
}
|
||||||
(lib.mkIf cfg.certificates.enable { inherit certificateFile; })
|
(lib.mkIf cfg.certificates.enable { CertificateFile = certificateFile; })
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
(lib.mkIf cfg.matchSets.appdaemon {
|
(lib.mkIf cfg.matchSets.appdaemon {
|
||||||
"appdaemon" = {
|
"appdaemon" = {
|
||||||
hostname = "192.168.1.242";
|
HostName = "192.168.1.242";
|
||||||
user = "appdaemon";
|
User = "appdaemon";
|
||||||
};
|
};
|
||||||
"ad-nix" = {
|
"ad-nix" = {
|
||||||
hostname = "192.168.1.201";
|
HostName = "192.168.1.201";
|
||||||
user = "appdaemon";
|
User = "appdaemon";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf cfg.matchSets.certs {
|
(lib.mkIf cfg.matchSets.certs {
|
||||||
"janus" = {
|
"janus" = {
|
||||||
hostname = "janus.john-stream.com";
|
HostName = "janus.john-stream.com";
|
||||||
user = "root";
|
User = "root";
|
||||||
};
|
};
|
||||||
"soteria" = {
|
"soteria" = {
|
||||||
hostname = "soteria.john-stream.com";
|
HostName = "soteria.john-stream.com";
|
||||||
user = "john";
|
User = "john";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf cfg.matchSets.homelab {
|
(lib.mkIf cfg.matchSets.homelab {
|
||||||
"docs" = {
|
"docs" = {
|
||||||
hostname = "192.168.1.110";
|
HostName = "192.168.1.110";
|
||||||
user = "root";
|
User = "root";
|
||||||
extraOptions = {
|
|
||||||
RequestTTY = "force";
|
RequestTTY = "force";
|
||||||
RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
|
RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
|
||||||
};
|
};
|
||||||
};
|
|
||||||
"gitea" = {
|
"gitea" = {
|
||||||
hostname = "192.168.1.104";
|
HostName = "192.168.1.104";
|
||||||
user = "john";
|
User = "john";
|
||||||
};
|
};
|
||||||
"hermes" = {
|
"hermes" = {
|
||||||
hostname = "192.168.1.150";
|
HostName = "192.168.1.150";
|
||||||
user = "root";
|
User = "root";
|
||||||
|
# Enabling this breaks the ability of Zed to install its remote stuff
|
||||||
|
# RequestTTY = "force";
|
||||||
|
# RemoteCommand = "/root/.nix-profile/bin/jsl-zsh";
|
||||||
};
|
};
|
||||||
"panoptes" = {
|
"panoptes" = {
|
||||||
hostname = "192.168.1.107";
|
HostName = "192.168.1.107";
|
||||||
user = "panoptes";
|
User = "panoptes";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf cfg.matchSets.dev {
|
(lib.mkIf cfg.matchSets.dev {
|
||||||
"test-nix" = {
|
"test-nix" = {
|
||||||
hostname = "fded:fb16:653e:25da:be24:11ff:fea0:753f";
|
HostName = "fded:fb16:653e:25da:be24:11ff:fea0:753f";
|
||||||
user = "john";
|
User = "john";
|
||||||
|
RequestTTY = "auto";
|
||||||
|
# RemoteCommand = "/run/current-system/sw/bin/jsl-zsh";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf cfg.matchSets.tailscale {
|
||||||
|
"jdl-docker" = {
|
||||||
|
HostName = "jdl-docker.tailcf205.ts.net";
|
||||||
|
User = "john";
|
||||||
|
RequestTTY = "auto";
|
||||||
|
# RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
+19
-18
@@ -1,6 +1,10 @@
|
|||||||
{ self, inputs, lib, ... }:
|
{ self, inputs, lib, ... }:
|
||||||
let
|
let
|
||||||
username = "john";
|
username = "john";
|
||||||
|
baseUserModules = self.factory.user {
|
||||||
|
username = username;
|
||||||
|
isAdmin = true;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.meta.users."${username}" = {
|
flake.meta.users."${username}" = {
|
||||||
@@ -8,23 +12,17 @@ in
|
|||||||
name = "John Lancaster";
|
name = "John Lancaster";
|
||||||
inherit username;
|
inherit username;
|
||||||
key = "";
|
key = "";
|
||||||
keygrip = [
|
keygrip = [ ];
|
||||||
];
|
|
||||||
authorizedKeys = [
|
authorizedKeys = [
|
||||||
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAUa4dcg1TWc4pW++uodyhX4eOqrX/QYIxFWtEP7HFJ john@john-pc-ubuntu"
|
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAUa4dcg1TWc4pW++uodyhX4eOqrX/QYIxFWtEP7HFJ john@john-pc-ubuntu"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOkGLo4N/L3RYvaIZ1FmePlxa1HK0fMciZxKtRhN58F root@janus"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOkGLo4N/L3RYvaIZ1FmePlxa1HK0fMciZxKtRhN58F root@janus"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.modules = lib.mkMerge [
|
flake.modules = {
|
||||||
(self.factory.user {
|
nixos."${username}" = { ... }: {
|
||||||
username = username;
|
|
||||||
isAdmin = true;
|
|
||||||
})
|
|
||||||
{
|
|
||||||
nixos."${username}" = {
|
|
||||||
imports = [
|
imports = [
|
||||||
inputs.home-manager.nixosModules.home-manager
|
baseUserModules.nixos."${username}"
|
||||||
];
|
];
|
||||||
users.users."${username}" = {
|
users.users."${username}" = {
|
||||||
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
|
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
|
||||||
@@ -32,17 +30,20 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# This module will be imported by the user factory
|
# This module will be imported by the user factory
|
||||||
homeManager."${username}" = with inputs.self.meta.users."${username}"; {
|
homeManager."${username}" = { pkgs, ... }:
|
||||||
|
with inputs.self.meta.users."${username}"; {
|
||||||
home.stateVersion = "25.11";
|
home.stateVersion = "25.11";
|
||||||
|
imports = [
|
||||||
|
inputs.self.modules.homeManager.shell-tools
|
||||||
|
inputs.self.modules.homeManager.ssh
|
||||||
|
inputs.self.modules.homeManager.git
|
||||||
|
];
|
||||||
|
# home.packages = [
|
||||||
|
# inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools
|
||||||
|
# ];
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
programs.git.settings.user.name = name;
|
programs.git.settings.user.name = name;
|
||||||
programs.git.settings.user.email = email;
|
programs.git.settings.user.email = email;
|
||||||
imports = with inputs.self.modules.homeManager; [
|
};
|
||||||
ssh
|
|
||||||
shell-tools
|
|
||||||
git
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|||||||
Executable
+212
@@ -0,0 +1,212 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -u
|
||||||
|
|
||||||
|
# --- pretty output helpers ---
|
||||||
|
BOLD="\033[1m"
|
||||||
|
DIM="\033[2m"
|
||||||
|
GREEN="\033[32m"
|
||||||
|
YELLOW="\033[33m"
|
||||||
|
RED="\033[31m"
|
||||||
|
CYAN="\033[36m"
|
||||||
|
RESET="\033[0m"
|
||||||
|
|
||||||
|
section() {
|
||||||
|
echo
|
||||||
|
echo -e "${BOLD}${CYAN}==> $1${RESET}"
|
||||||
|
}
|
||||||
|
|
||||||
|
ok() { echo -e "${GREEN}[OK]${RESET} $1"; }
|
||||||
|
warn() { echo -e "${YELLOW}[WARN]${RESET} $1"; }
|
||||||
|
err() { echo -e "${RED}[ERR]${RESET} $1"; }
|
||||||
|
info() { echo -e "${DIM}$1${RESET}"; }
|
||||||
|
|
||||||
|
has_cmd() {
|
||||||
|
command -v "$1" >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
found_process=0
|
||||||
|
found_render_node=0
|
||||||
|
found_gpu_libs=0
|
||||||
|
software_rasterizer=0
|
||||||
|
|
||||||
|
section "1) Find a running Ghostty process"
|
||||||
|
info "What this does: tries the same two process lookups you ran (pgrep and pidof)."
|
||||||
|
info "Good outcome: at least one PID is returned."
|
||||||
|
|
||||||
|
echo -e "${DIM}\$ pgrep -x ghostty${RESET}"
|
||||||
|
PGREP_OUT="$(pgrep -x ghostty || true)"
|
||||||
|
if [[ -n "${PGREP_OUT}" ]]; then
|
||||||
|
echo "${PGREP_OUT}"
|
||||||
|
else
|
||||||
|
echo "<no output>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${DIM}\$ pidof ghostty${RESET}"
|
||||||
|
PIDOF_OUT="$(pidof ghostty || true)"
|
||||||
|
if [[ -n "${PIDOF_OUT}" ]]; then
|
||||||
|
echo "${PIDOF_OUT}"
|
||||||
|
else
|
||||||
|
echo "<no output>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${PGREP_OUT}" || -n "${PIDOF_OUT}" ]]; then
|
||||||
|
found_process=1
|
||||||
|
ok "Ghostty process detected."
|
||||||
|
else
|
||||||
|
warn "No Ghostty process found yet by either command."
|
||||||
|
fi
|
||||||
|
|
||||||
|
section "2) Set GHOSTTY_PID"
|
||||||
|
info "What this does: picks one Ghostty PID for all later checks."
|
||||||
|
info "Good outcome: GHOSTTY_PID is set to a valid running Ghostty process."
|
||||||
|
|
||||||
|
# Prefer step-1 outputs first (avoids re-running lookups that may block on some systems).
|
||||||
|
GHOSTTY_PID=""
|
||||||
|
if [[ -n "${PGREP_OUT}" ]]; then
|
||||||
|
GHOSTTY_PID="$(printf '%s\n' "${PGREP_OUT}" | head -n1)"
|
||||||
|
info "Using PID from step-1 pgrep output."
|
||||||
|
elif [[ -n "${PIDOF_OUT}" ]]; then
|
||||||
|
GHOSTTY_PID="$(printf '%s\n' "${PIDOF_OUT}" | awk '{print $1}')"
|
||||||
|
info "Using PID from step-1 pidof output."
|
||||||
|
else
|
||||||
|
echo -e "${DIM}\$ pgrep -xo ghostty${RESET}"
|
||||||
|
if has_cmd timeout; then
|
||||||
|
PGREP_RAW="$(timeout 3s pgrep -xo ghostty 2>&1)"
|
||||||
|
pgrep_status=$?
|
||||||
|
if (( pgrep_status == 124 )); then
|
||||||
|
warn "pgrep timed out after 3 seconds."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
PGREP_RAW="$(pgrep -xo ghostty 2>&1)"
|
||||||
|
pgrep_status=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( pgrep_status == 0 )); then
|
||||||
|
GHOSTTY_PID="$(printf '%s\n' "${PGREP_RAW}" | head -n1)"
|
||||||
|
else
|
||||||
|
if [[ -n "${PGREP_RAW}" ]]; then
|
||||||
|
warn "[pgrep] ${PGREP_RAW}"
|
||||||
|
fi
|
||||||
|
warn "pgrep exit code: ${pgrep_status} (1 usually means no matching process)."
|
||||||
|
|
||||||
|
echo -e "${DIM}\$ pidof ghostty${RESET}"
|
||||||
|
PIDOF_RAW="$(pidof ghostty 2>&1)"
|
||||||
|
pidof_status=$?
|
||||||
|
|
||||||
|
if (( pidof_status == 0 )); then
|
||||||
|
GHOSTTY_PID="$(printf '%s\n' "${PIDOF_RAW}" | awk '{print $1}')"
|
||||||
|
else
|
||||||
|
if [[ -n "${PIDOF_RAW}" ]]; then
|
||||||
|
warn "[pidof] ${PIDOF_RAW}"
|
||||||
|
fi
|
||||||
|
warn "pidof exit code: ${pidof_status}"
|
||||||
|
GHOSTTY_PID=""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${GHOSTTY_PID}" ]]; then
|
||||||
|
err "Could not find a running Ghostty process to inspect."
|
||||||
|
echo "Open Ghostty, then run this script again."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export GHOSTTY_PID
|
||||||
|
ok "Using GHOSTTY_PID=${GHOSTTY_PID}"
|
||||||
|
|
||||||
|
section "3) Check for an open GPU render device"
|
||||||
|
info "What this does: inspects /proc/<pid>/fd for /dev/dri entries used for rendering."
|
||||||
|
info "Good outcome: see /dev/dri/renderD* (for example renderD128)."
|
||||||
|
|
||||||
|
if has_cmd rg; then
|
||||||
|
echo -e "${DIM}\$ sudo ls -l /proc/\$GHOSTTY_PID/fd | rg dri${RESET}"
|
||||||
|
DRI_LINES="$(sudo ls -l "/proc/${GHOSTTY_PID}/fd" | rg dri || true)"
|
||||||
|
else
|
||||||
|
warn "'rg' not found; using grep instead"
|
||||||
|
echo -e "${DIM}\$ sudo ls -l /proc/\$GHOSTTY_PID/fd | grep dri${RESET}"
|
||||||
|
DRI_LINES="$(sudo ls -l "/proc/${GHOSTTY_PID}/fd" | grep dri || true)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${DRI_LINES}" ]]; then
|
||||||
|
echo "${DRI_LINES}"
|
||||||
|
else
|
||||||
|
echo "<no dri-related file descriptors found>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if echo "${DRI_LINES}" | grep -q '/dev/dri/renderD'; then
|
||||||
|
found_render_node=1
|
||||||
|
ok "Found /dev/dri/renderD*: strong sign Ghostty is using GPU render infrastructure."
|
||||||
|
elif [[ -n "${DRI_LINES}" ]]; then
|
||||||
|
warn "Found /dev/dri entries, but no renderD node in this output."
|
||||||
|
else
|
||||||
|
warn "No /dev/dri entries seen for this process."
|
||||||
|
fi
|
||||||
|
|
||||||
|
section "4) Check mapped graphics libraries"
|
||||||
|
info "What this does: reads process memory mappings for GL/EGL/Vulkan/Mesa libraries."
|
||||||
|
info "Good outcome: matches like libGL, libEGL, libvulkan, mesa, libgbm, libgallium appear."
|
||||||
|
|
||||||
|
echo -e "${DIM}\$ sudo grep -E 'libEGL|libGL|libvulkan|mesa' /proc/\$GHOSTTY_PID/maps | head -n 30${RESET}"
|
||||||
|
LIB_LINES="$(sudo grep -E 'libEGL|libGL|libvulkan|mesa' "/proc/${GHOSTTY_PID}/maps" | head -n 30 || true)"
|
||||||
|
|
||||||
|
if [[ -n "${LIB_LINES}" ]]; then
|
||||||
|
echo "${LIB_LINES}"
|
||||||
|
found_gpu_libs=1
|
||||||
|
ok "Graphics stack libraries are mapped into Ghostty."
|
||||||
|
else
|
||||||
|
echo "<no matches>"
|
||||||
|
warn "No GL/EGL/Vulkan/Mesa mappings matched this filter."
|
||||||
|
fi
|
||||||
|
|
||||||
|
section "5) Optional probe for software rasterizer vs hardware driver hints"
|
||||||
|
info "What this does: scans for common software rasterizer strings (llvmpipe/swrast) and driver names."
|
||||||
|
info "Good outcome: no llvmpipe/swrast matches. Driver-name matches can vary by stack."
|
||||||
|
|
||||||
|
echo -e "${DIM}\$ sudo grep -Ei 'llvmpipe|swrast|iris|radeonsi|nouveau|zink|nvidia|_dri\\.so' /proc/\$GHOSTTY_PID/maps${RESET}"
|
||||||
|
PROBE_LINES="$(sudo grep -Ei 'llvmpipe|swrast|iris|radeonsi|nouveau|zink|nvidia|_dri\.so' "/proc/${GHOSTTY_PID}/maps" || true)"
|
||||||
|
|
||||||
|
if [[ -n "${PROBE_LINES}" ]]; then
|
||||||
|
echo "${PROBE_LINES}"
|
||||||
|
if echo "${PROBE_LINES}" | grep -Eiq 'llvmpipe|swrast'; then
|
||||||
|
software_rasterizer=1
|
||||||
|
warn "Software rasterizer markers detected (llvmpipe/swrast)."
|
||||||
|
else
|
||||||
|
ok "Driver-related markers detected and no software rasterizer markers found."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ok "No probe matches found. This is often fine; absence of llvmpipe/swrast is usually good."
|
||||||
|
fi
|
||||||
|
|
||||||
|
section "Final interpretation"
|
||||||
|
if (( found_process == 1 )); then
|
||||||
|
ok "Process check: PASS"
|
||||||
|
else
|
||||||
|
warn "Process check: no process found initially (script still proceeded once PID was resolved)."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( found_render_node == 1 )); then
|
||||||
|
ok "Render node check: PASS (/dev/dri/renderD* present)"
|
||||||
|
else
|
||||||
|
warn "Render node check: no explicit renderD node found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( found_gpu_libs == 1 )); then
|
||||||
|
ok "Graphics library check: PASS"
|
||||||
|
else
|
||||||
|
warn "Graphics library check: no matches"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( software_rasterizer == 1 )); then
|
||||||
|
warn "Software rasterizer check: POSSIBLE software rendering path"
|
||||||
|
else
|
||||||
|
ok "Software rasterizer check: no llvmpipe/swrast markers detected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
if (( found_render_node == 1 && found_gpu_libs == 1 && software_rasterizer == 0 )); then
|
||||||
|
ok "Overall: strong evidence Ghostty is using GPU acceleration."
|
||||||
|
else
|
||||||
|
warn "Overall: mixed signals. Consider running a live GPU activity monitor during terminal redraw stress."
|
||||||
|
fi
|
||||||
|
|
||||||
|
ok "Summary complete for PID ${GHOSTTY_PID}"
|
||||||
Reference in New Issue
Block a user