Compare commits
No commits in common. "main" and "nats" have entirely different histories.
33 changed files with 306 additions and 831 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
flake.lock
|
flake.lock
|
||||||
.DS_STORE
|
.DS_STORE
|
||||||
|
**/.DS_STORE
|
||||||
result
|
result
|
||||||
result-*
|
result-*
|
||||||
|
|
|
@ -1,114 +0,0 @@
|
||||||
float getSdfRectangle(in vec2 p, in vec2 xy, in vec2 b)
|
|
||||||
{
|
|
||||||
vec2 d = abs(p - xy) - b;
|
|
||||||
return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Based on Inigo Quilez's 2D distance functions article: https://iquilezles.org/articles/distfunctions2d/
|
|
||||||
// Potencially optimized by eliminating conditionals and loops to enhance performance and reduce branching
|
|
||||||
|
|
||||||
float seg(in vec2 p, in vec2 a, in vec2 b, inout float s, float d) {
|
|
||||||
vec2 e = b - a;
|
|
||||||
vec2 w = p - a;
|
|
||||||
vec2 proj = a + e * clamp(dot(w, e) / dot(e, e), 0.0, 1.0);
|
|
||||||
float segd = dot(p - proj, p - proj);
|
|
||||||
d = min(d, segd);
|
|
||||||
|
|
||||||
float c0 = step(0.0, p.y - a.y);
|
|
||||||
float c1 = 1.0 - step(0.0, p.y - b.y);
|
|
||||||
float c2 = 1.0 - step(0.0, e.x * w.y - e.y * w.x);
|
|
||||||
float allCond = c0 * c1 * c2;
|
|
||||||
float noneCond = (1.0 - c0) * (1.0 - c1) * (1.0 - c2);
|
|
||||||
float flip = mix(1.0, -1.0, step(0.5, allCond + noneCond));
|
|
||||||
s *= flip;
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
float getSdfParallelogram(in vec2 p, in vec2 v0, in vec2 v1, in vec2 v2, in vec2 v3) {
|
|
||||||
float s = 1.0;
|
|
||||||
float d = dot(p - v0, p - v0);
|
|
||||||
|
|
||||||
d = seg(p, v0, v3, s, d);
|
|
||||||
d = seg(p, v1, v0, s, d);
|
|
||||||
d = seg(p, v2, v1, s, d);
|
|
||||||
d = seg(p, v3, v2, s, d);
|
|
||||||
|
|
||||||
return s * sqrt(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 normalize(vec2 value, float isPosition) {
|
|
||||||
return (value * 2.0 - (iResolution.xy * isPosition)) / iResolution.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
float antialising(float distance) {
|
|
||||||
return 1. - smoothstep(0., normalize(vec2(2., 2.), 0.).x, distance);
|
|
||||||
}
|
|
||||||
|
|
||||||
float determineStartVertexFactor(vec2 a, vec2 b) {
|
|
||||||
// Conditions using step
|
|
||||||
float condition1 = step(b.x, a.x) * step(a.y, b.y); // a.x < b.x && a.y > b.y
|
|
||||||
float condition2 = step(a.x, b.x) * step(b.y, a.y); // a.x > b.x && a.y < b.y
|
|
||||||
|
|
||||||
// If neither condition is met, return 1 (else case)
|
|
||||||
return 1.0 - max(condition1, condition2);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 getRectangleCenter(vec4 rectangle) {
|
|
||||||
return vec2(rectangle.x + (rectangle.z / 2.), rectangle.y - (rectangle.w / 2.));
|
|
||||||
}
|
|
||||||
float ease(float x) {
|
|
||||||
return pow(1.0 - x, 3.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
const vec4 TRAIL_COLOR = vec4(0.0, 0.2, 0.5, 0.1);
|
|
||||||
const float DURATION = 0.15; //IN SECONDS
|
|
||||||
|
|
||||||
void mainImage(out vec4 fragColor, in vec2 fragCoord)
|
|
||||||
{
|
|
||||||
#if !defined(WEB)
|
|
||||||
fragColor = texture(iChannel0, fragCoord.xy / iResolution.xy);
|
|
||||||
#endif
|
|
||||||
// Normalization for fragCoord to a space of -1 to 1;
|
|
||||||
vec2 vu = normalize(fragCoord, 1.);
|
|
||||||
vec2 offsetFactor = vec2(-.5, 0.5);
|
|
||||||
|
|
||||||
// Normalization for cursor position and size;
|
|
||||||
// cursor xy has the postion in a space of -1 to 1;
|
|
||||||
// zw has the width and height
|
|
||||||
vec4 currentCursor = vec4(normalize(iCurrentCursor.xy, 1.), normalize(iCurrentCursor.zw, 0.));
|
|
||||||
vec4 previousCursor = vec4(normalize(iPreviousCursor.xy, 1.), normalize(iPreviousCursor.zw, 0.));
|
|
||||||
|
|
||||||
// When drawing a parellelogram between cursors for the trail i need to determine where to start at the top-left or top-right vertex of the cursor
|
|
||||||
float vertexFactor = determineStartVertexFactor(currentCursor.xy, previousCursor.xy);
|
|
||||||
float invertedVertexFactor = 1.0 - vertexFactor;
|
|
||||||
|
|
||||||
// Set every vertex of my parellogram
|
|
||||||
vec2 v0 = vec2(currentCursor.x + currentCursor.z * vertexFactor, currentCursor.y - currentCursor.w);
|
|
||||||
vec2 v1 = vec2(currentCursor.x + currentCursor.z * invertedVertexFactor, currentCursor.y);
|
|
||||||
vec2 v2 = vec2(previousCursor.x + currentCursor.z * invertedVertexFactor, previousCursor.y);
|
|
||||||
vec2 v3 = vec2(previousCursor.x + currentCursor.z * vertexFactor, previousCursor.y - previousCursor.w);
|
|
||||||
|
|
||||||
float sdfCurrentCursor = getSdfRectangle(vu, currentCursor.xy - (currentCursor.zw * offsetFactor), currentCursor.zw * 0.5);
|
|
||||||
float sdfTrail = getSdfParallelogram(vu, v0, v1, v2, v3);
|
|
||||||
|
|
||||||
float progress = clamp((iTime - iTimeCursorChange) / DURATION, 0.0, 1.0);
|
|
||||||
float easedProgress = ease(progress);
|
|
||||||
// Distance between cursors determine the total length of the parallelogram;
|
|
||||||
vec2 centerCC = getRectangleCenter(currentCursor);
|
|
||||||
vec2 centerCP = getRectangleCenter(previousCursor);
|
|
||||||
float lineLength = distance(centerCC, centerCP);
|
|
||||||
|
|
||||||
vec4 newColor = vec4(fragColor);
|
|
||||||
// Compute fade factor based on distance along the trail
|
|
||||||
float fadeFactor = 1.0 - smoothstep(lineLength, sdfCurrentCursor, easedProgress * lineLength);
|
|
||||||
|
|
||||||
// Apply fading effect to trail color
|
|
||||||
vec4 fadedTrailColor = TRAIL_COLOR * fadeFactor;
|
|
||||||
|
|
||||||
// Blend trail with fade effect
|
|
||||||
newColor = mix(newColor, fadedTrailColor, antialising(sdfTrail));
|
|
||||||
// Draw current cursor
|
|
||||||
newColor = mix(newColor, TRAIL_COLOR, antialising(sdfCurrentCursor));
|
|
||||||
newColor = mix(newColor, fragColor, step(sdfCurrentCursor, 0.));
|
|
||||||
fragColor = mix(fragColor, newColor, step(sdfCurrentCursor, easedProgress * lineLength));
|
|
||||||
}
|
|
|
@ -1,114 +0,0 @@
|
||||||
float getSdfRectangle(in vec2 p, in vec2 xy, in vec2 b)
|
|
||||||
{
|
|
||||||
vec2 d = abs(p - xy) - b;
|
|
||||||
return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Based on Inigo Quilez's 2D distance functions article: https://iquilezles.org/articles/distfunctions2d/
|
|
||||||
// Potencially optimized by eliminating conditionals and loops to enhance performance and reduce branching
|
|
||||||
|
|
||||||
float seg(in vec2 p, in vec2 a, in vec2 b, inout float s, float d) {
|
|
||||||
vec2 e = b - a;
|
|
||||||
vec2 w = p - a;
|
|
||||||
vec2 proj = a + e * clamp(dot(w, e) / dot(e, e), 0.0, 1.0);
|
|
||||||
float segd = dot(p - proj, p - proj);
|
|
||||||
d = min(d, segd);
|
|
||||||
|
|
||||||
float c0 = step(0.0, p.y - a.y);
|
|
||||||
float c1 = 1.0 - step(0.0, p.y - b.y);
|
|
||||||
float c2 = 1.0 - step(0.0, e.x * w.y - e.y * w.x);
|
|
||||||
float allCond = c0 * c1 * c2;
|
|
||||||
float noneCond = (1.0 - c0) * (1.0 - c1) * (1.0 - c2);
|
|
||||||
float flip = mix(1.0, -1.0, step(0.5, allCond + noneCond));
|
|
||||||
s *= flip;
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
float getSdfParallelogram(in vec2 p, in vec2 v0, in vec2 v1, in vec2 v2, in vec2 v3) {
|
|
||||||
float s = 1.0;
|
|
||||||
float d = dot(p - v0, p - v0);
|
|
||||||
|
|
||||||
d = seg(p, v0, v3, s, d);
|
|
||||||
d = seg(p, v1, v0, s, d);
|
|
||||||
d = seg(p, v2, v1, s, d);
|
|
||||||
d = seg(p, v3, v2, s, d);
|
|
||||||
|
|
||||||
return s * sqrt(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 normalize(vec2 value, float isPosition) {
|
|
||||||
return (value * 2.0 - (iResolution.xy * isPosition)) / iResolution.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
float antialising(float distance) {
|
|
||||||
return 1. - smoothstep(0., normalize(vec2(2., 2.), 0.).x, distance);
|
|
||||||
}
|
|
||||||
|
|
||||||
float determineStartVertexFactor(vec2 a, vec2 b) {
|
|
||||||
// Conditions using step
|
|
||||||
float condition1 = step(b.x, a.x) * step(a.y, b.y); // a.x < b.x && a.y > b.y
|
|
||||||
float condition2 = step(a.x, b.x) * step(b.y, a.y); // a.x > b.x && a.y < b.y
|
|
||||||
|
|
||||||
// If neither condition is met, return 1 (else case)
|
|
||||||
return 1.0 - max(condition1, condition2);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 getRectangleCenter(vec4 rectangle) {
|
|
||||||
return vec2(rectangle.x + (rectangle.z / 2.), rectangle.y - (rectangle.w / 2.));
|
|
||||||
}
|
|
||||||
float ease(float x) {
|
|
||||||
return pow(1.0 - x, 3.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
const vec4 TRAIL_COLOR = vec4(0.8, 1.0, 1.0, 0.1);
|
|
||||||
const float DURATION = 0.1; //IN SECONDS
|
|
||||||
|
|
||||||
void mainImage(out vec4 fragColor, in vec2 fragCoord)
|
|
||||||
{
|
|
||||||
#if !defined(WEB)
|
|
||||||
fragColor = texture(iChannel0, fragCoord.xy / iResolution.xy);
|
|
||||||
#endif
|
|
||||||
// Normalization for fragCoord to a space of -1 to 1;
|
|
||||||
vec2 vu = normalize(fragCoord, 1.);
|
|
||||||
vec2 offsetFactor = vec2(-.5, 0.5);
|
|
||||||
|
|
||||||
// Normalization for cursor position and size;
|
|
||||||
// cursor xy has the postion in a space of -1 to 1;
|
|
||||||
// zw has the width and height
|
|
||||||
vec4 currentCursor = vec4(normalize(iCurrentCursor.xy, 1.), normalize(iCurrentCursor.zw, 0.));
|
|
||||||
vec4 previousCursor = vec4(normalize(iPreviousCursor.xy, 1.), normalize(iPreviousCursor.zw, 0.));
|
|
||||||
|
|
||||||
// When drawing a parellelogram between cursors for the trail i need to determine where to start at the top-left or top-right vertex of the cursor
|
|
||||||
float vertexFactor = determineStartVertexFactor(currentCursor.xy, previousCursor.xy);
|
|
||||||
float invertedVertexFactor = 1.0 - vertexFactor;
|
|
||||||
|
|
||||||
// Set every vertex of my parellogram
|
|
||||||
vec2 v0 = vec2(currentCursor.x + currentCursor.z * vertexFactor, currentCursor.y - currentCursor.w);
|
|
||||||
vec2 v1 = vec2(currentCursor.x + currentCursor.z * invertedVertexFactor, currentCursor.y);
|
|
||||||
vec2 v2 = vec2(previousCursor.x + currentCursor.z * invertedVertexFactor, previousCursor.y);
|
|
||||||
vec2 v3 = vec2(previousCursor.x + currentCursor.z * vertexFactor, previousCursor.y - previousCursor.w);
|
|
||||||
|
|
||||||
float sdfCurrentCursor = getSdfRectangle(vu, currentCursor.xy - (currentCursor.zw * offsetFactor), currentCursor.zw * 0.5);
|
|
||||||
float sdfTrail = getSdfParallelogram(vu, v0, v1, v2, v3);
|
|
||||||
|
|
||||||
float progress = clamp((iTime - iTimeCursorChange) / DURATION, 0.0, 1.0);
|
|
||||||
float easedProgress = ease(progress);
|
|
||||||
// Distance between cursors determine the total length of the parallelogram;
|
|
||||||
vec2 centerCC = getRectangleCenter(currentCursor);
|
|
||||||
vec2 centerCP = getRectangleCenter(previousCursor);
|
|
||||||
float lineLength = distance(centerCC, centerCP);
|
|
||||||
|
|
||||||
vec4 newColor = vec4(fragColor);
|
|
||||||
// Compute fade factor based on distance along the trail
|
|
||||||
float fadeFactor = 1.0 - smoothstep(lineLength, sdfCurrentCursor, easedProgress * lineLength);
|
|
||||||
|
|
||||||
// Apply fading effect to trail color
|
|
||||||
vec4 fadedTrailColor = TRAIL_COLOR * fadeFactor;
|
|
||||||
|
|
||||||
// Blend trail with fade effect
|
|
||||||
newColor = mix(newColor, fadedTrailColor, antialising(sdfTrail));
|
|
||||||
// Draw current cursor
|
|
||||||
newColor = mix(newColor, TRAIL_COLOR, antialising(sdfCurrentCursor));
|
|
||||||
newColor = mix(newColor, fragColor, step(sdfCurrentCursor, 0.));
|
|
||||||
fragColor = mix(fragColor, newColor, step(sdfCurrentCursor, easedProgress * lineLength));
|
|
||||||
}
|
|
120
flake.lock
120
flake.lock
|
@ -104,11 +104,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701680307,
|
"lastModified": 1731533236,
|
||||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -122,11 +122,11 @@
|
||||||
"systems": "systems_2"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731533236,
|
"lastModified": 1701680307,
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -155,7 +155,25 @@
|
||||||
},
|
},
|
||||||
"flake-utils_4": {
|
"flake-utils_4": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_5"
|
"systems": "systems_4"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_5": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_6"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705309234,
|
"lastModified": 1705309234,
|
||||||
|
@ -171,9 +189,9 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_5": {
|
"flake-utils_6": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_6"
|
"systems": "systems_7"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1710146030,
|
||||||
|
@ -189,9 +207,9 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_6": {
|
"flake-utils_7": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_7"
|
"systems": "systems_8"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705309234,
|
"lastModified": 1705309234,
|
||||||
|
@ -207,6 +225,21 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flakey-profile": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1712898590,
|
||||||
|
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
|
||||||
|
"owner": "lf-",
|
||||||
|
"repo": "flakey-profile",
|
||||||
|
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "lf-",
|
||||||
|
"repo": "flakey-profile",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -277,6 +310,41 @@
|
||||||
"url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in"
|
"url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"lix": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1746827285,
|
||||||
|
"narHash": "sha256-hsFe4Tsqqg4l+FfQWphDtjC79WzNCZbEFhHI8j2KJzw=",
|
||||||
|
"rev": "47aad376c87e2e65967f17099277428e4b3f8e5a",
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/47aad376c87e2e65967f17099277428e4b3f8e5a.tar.gz?rev=47aad376c87e2e65967f17099277428e4b3f8e5a"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/lix-project/lix/archive/2.93.0.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lix-module": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"flakey-profile": "flakey-profile",
|
||||||
|
"lix": "lix",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1746838955,
|
||||||
|
"narHash": "sha256-11R4K3iAx4tLXjUs+hQ5K90JwDABD/XHhsM9nkeS5N8=",
|
||||||
|
"rev": "cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc",
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz?rev=cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748710831,
|
"lastModified": 1748710831,
|
||||||
|
@ -294,7 +362,7 @@
|
||||||
},
|
},
|
||||||
"moonlight": {
|
"moonlight": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
|
@ -376,7 +444,7 @@
|
||||||
},
|
},
|
||||||
"nix-options-search": {
|
"nix-options-search": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_3",
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
|
@ -475,13 +543,13 @@
|
||||||
"nvf": {
|
"nvf": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"flake-utils": "flake-utils_3",
|
"flake-utils": "flake-utils_4",
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"nil": "nil",
|
"nil": "nil",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"systems": "systems_4"
|
"systems": "systems_5"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751186226,
|
"lastModified": 1751186226,
|
||||||
|
@ -514,6 +582,7 @@
|
||||||
"apple-fonts": "apple-fonts",
|
"apple-fonts": "apple-fonts",
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
|
"lix-module": "lix-module",
|
||||||
"moonlight": "moonlight",
|
"moonlight": "moonlight",
|
||||||
"nh": "nh",
|
"nh": "nh",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
|
@ -735,6 +804,21 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_8": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"zen-browser": {
|
"zen-browser": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -758,7 +842,7 @@
|
||||||
"zig": {
|
"zig": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils_4",
|
"flake-utils": "flake-utils_5",
|
||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -778,7 +862,7 @@
|
||||||
"zig-overlay": {
|
"zig-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_2",
|
||||||
"flake-utils": "flake-utils_6",
|
"flake-utils": "flake-utils_7",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"zls",
|
"zls",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
@ -800,7 +884,7 @@
|
||||||
},
|
},
|
||||||
"zls": {
|
"zls": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_5",
|
"flake-utils": "flake-utils_6",
|
||||||
"gitignore": "gitignore_2",
|
"gitignore": "gitignore_2",
|
||||||
"langref": "langref",
|
"langref": "langref",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4",
|
||||||
|
|
19
flake.nix
19
flake.nix
|
@ -3,6 +3,11 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
lix-module = {
|
||||||
|
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
home-manager.url = "github:nix-community/home-manager/master";
|
home-manager.url = "github:nix-community/home-manager/master";
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
@ -40,11 +45,12 @@
|
||||||
{
|
{
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
lix-module,
|
||||||
darwin,
|
darwin,
|
||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
inherit (nixpkgs) lib;
|
lib = nixpkgs.lib;
|
||||||
# TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
|
# TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
|
||||||
overlays = [
|
overlays = [
|
||||||
inputs.zig.overlays.default
|
inputs.zig.overlays.default
|
||||||
|
@ -88,6 +94,7 @@
|
||||||
inherit
|
inherit
|
||||||
overlays
|
overlays
|
||||||
nixpkgs
|
nixpkgs
|
||||||
|
lix-module
|
||||||
inputs
|
inputs
|
||||||
mkNeovim
|
mkNeovim
|
||||||
;
|
;
|
||||||
|
@ -110,11 +117,10 @@
|
||||||
{
|
{
|
||||||
nvim-chloe = mkNeovim "chloe" system;
|
nvim-chloe = mkNeovim "chloe" system;
|
||||||
nvim-natalie = mkNeovim "natalie" system;
|
nvim-natalie = mkNeovim "natalie" system;
|
||||||
nvim-julia = mkNeovim "julia" system;
|
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (system == "aarch64-darwin") {
|
// lib.optionalAttrs (system == "aarch64-darwin") {
|
||||||
# "nix run .#darwin-rebuild"
|
# "nix run .#darwin-rebuild"
|
||||||
inherit (darwin.packages.aarch64-darwin) darwin-rebuild;
|
darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -146,13 +152,6 @@
|
||||||
system = "aarch64-darwin";
|
system = "aarch64-darwin";
|
||||||
};
|
};
|
||||||
|
|
||||||
# julia's cattop
|
|
||||||
nixosConfigurations.cattop = mkSystem "cattop" {
|
|
||||||
user = "julia";
|
|
||||||
host = "cattop";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
};
|
|
||||||
|
|
||||||
# generate checks for "nix flake check --all-systems --no-build"
|
# generate checks for "nix flake check --all-systems --no-build"
|
||||||
checks.aarch64-darwin = builtins.listToAttrs (
|
checks.aarch64-darwin = builtins.listToAttrs (
|
||||||
builtins.map (
|
builtins.map (
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# particular architecture.
|
# particular architecture.
|
||||||
{
|
{
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
lix-module,
|
||||||
overlays,
|
overlays,
|
||||||
inputs,
|
inputs,
|
||||||
mkNeovim,
|
mkNeovim,
|
||||||
|
@ -86,6 +87,11 @@ systemFunc {
|
||||||
# the overlays are available globally.
|
# the overlays are available globally.
|
||||||
{ nixpkgs.overlays = overlays; }
|
{ nixpkgs.overlays = overlays; }
|
||||||
|
|
||||||
|
# Use lix (alternative nix implementation)
|
||||||
|
# https://lix.systems/add-to-config/#flake-based-configurations
|
||||||
|
lix-module.nixosModules.default
|
||||||
|
# (getInputModule "lix-module" "default")
|
||||||
|
|
||||||
# Modules shared between nix-darwin and NixOS
|
# Modules shared between nix-darwin and NixOS
|
||||||
../modules/shared
|
../modules/shared
|
||||||
# Modules for the specific OS
|
# Modules for the specific OS
|
||||||
|
|
|
@ -16,14 +16,7 @@ in
|
||||||
imports = mainHomeImports ++ [
|
imports = mainHomeImports ++ [
|
||||||
./macos/sketchybar.nix
|
./macos/sketchybar.nix
|
||||||
];
|
];
|
||||||
options = {
|
programs = {
|
||||||
programs.ghostty.shader = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = { };
|
|
||||||
description = "set the ghostty shader, relative to 'files/ghostty'";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config.programs = {
|
|
||||||
home-manager.enable = true;
|
home-manager.enable = true;
|
||||||
nix-index.enable = true;
|
nix-index.enable = true;
|
||||||
|
|
||||||
|
@ -96,9 +89,5 @@ in
|
||||||
test -r '/Users/${user.username}/.opam/opam-init/init.fish' && source '/Users/${user.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
|
test -r '/Users/${user.username}/.opam/opam-init/init.fish' && source '/Users/${user.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
ghostty.settings.custom-shader = lib.mkIf (
|
|
||||||
cfg.ghostty.shader != null
|
|
||||||
) "${../../files/ghostty}/${cfg.ghostty.shader}";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
|
host,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
@ -13,28 +13,10 @@
|
||||||
#
|
#
|
||||||
# override level 999 is used to not conflict with mkDefault as used by nvf.
|
# override level 999 is used to not conflict with mkDefault as used by nvf.
|
||||||
# which allows user configurations to disable/override anything here.
|
# which allows user configurations to disable/override anything here.
|
||||||
config.vim = lib.mkOverride 999 {
|
vim = lib.mkOverride 999 {
|
||||||
theme = {
|
theme = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
options = {
|
|
||||||
tabstop = 2;
|
|
||||||
softtabstop = 2;
|
|
||||||
shiftwidth = 2;
|
|
||||||
undofile = true;
|
|
||||||
swapfile = false;
|
|
||||||
showmode = false;
|
|
||||||
foldlevel = 99;
|
|
||||||
foldcolumn = "1";
|
|
||||||
foldlevelstart = 99;
|
|
||||||
foldenable = true;
|
|
||||||
foldmethod = "expr";
|
|
||||||
#Default to treesitter folding
|
|
||||||
foldexpr = "v:lua.vim.treesitter.foldexpr()";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
visuals = {
|
visuals = {
|
||||||
# notification system
|
# notification system
|
||||||
# https://github.com/j-hui/fidget.nvim
|
# https://github.com/j-hui/fidget.nvim
|
||||||
|
@ -44,7 +26,7 @@
|
||||||
highlight-undo.enable = true;
|
highlight-undo.enable = true;
|
||||||
# indentation guides
|
# indentation guides
|
||||||
# https://github.com/lukas-reineke/indent-blankline.nvim
|
# https://github.com/lukas-reineke/indent-blankline.nvim
|
||||||
indent-blankline.enable = true;
|
indent-blankline.enable = false;
|
||||||
# extra icons
|
# extra icons
|
||||||
nvim-web-devicons.enable = true;
|
nvim-web-devicons.enable = true;
|
||||||
# https://github.com/petertriho/nvim-scrollbar
|
# https://github.com/petertriho/nvim-scrollbar
|
||||||
|
@ -53,43 +35,16 @@
|
||||||
lsp = {
|
lsp = {
|
||||||
# Must be enabled for language modules to hook into the LSP API.
|
# Must be enabled for language modules to hook into the LSP API.
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
formatOnSave = true;
|
formatOnSave = true;
|
||||||
# show errors inline
|
# show errors inline
|
||||||
# https://github.com/folke/trouble.nvim
|
# https://github.com/folke/trouble.nvim
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
# show lightbulb icon in gutter to indicate code actions
|
# show lightbulb icon in gutter to indicate code actions
|
||||||
# https://github.com/kosayoda/nvim-lightbulb
|
# https://github.com/kosayoda/nvim-lightbulb
|
||||||
lightbulb.enable = false;
|
lightbulb.enable = true;
|
||||||
# show icons in auto-completion menu
|
# show icons in auto-completion menu
|
||||||
# https://github.com/onsails/lspkind.nvim
|
# https://github.com/onsails/lspkind.nvim
|
||||||
lspkind.enable = config.vim.autocomplete.blink-cmp.enable;
|
lspkind.enable = config.vim.autocomplete.blink-cmp.enable;
|
||||||
# Enables inlay hints (types info in rust and shit)
|
|
||||||
inlayHints.enable = true;
|
|
||||||
#Nice mappings that i use :3
|
|
||||||
mappings = {
|
|
||||||
codeAction = "<leader>ca";
|
|
||||||
goToDeclaration = "gD";
|
|
||||||
goToDefinition = "gd";
|
|
||||||
listReferences = "gr";
|
|
||||||
goToType = "gy";
|
|
||||||
hover = "K";
|
|
||||||
nextDiagnostic = "<leader>d";
|
|
||||||
openDiagnosticFloat = "<leader>df";
|
|
||||||
renameSymbol = "rn";
|
|
||||||
documentHighlight = null;
|
|
||||||
listDocumentSymbols = null;
|
|
||||||
listImplementations = null;
|
|
||||||
listWorkspaceFolders = null;
|
|
||||||
previousDiagnostic = null;
|
|
||||||
removeWorkspaceFolder = null;
|
|
||||||
signatureHelp = null;
|
|
||||||
toggleFormatOnSave = null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
treesitter = {
|
|
||||||
enable = true;
|
|
||||||
addDefaultGrammars = true;
|
|
||||||
};
|
};
|
||||||
debugger = {
|
debugger = {
|
||||||
nvim-dap = {
|
nvim-dap = {
|
||||||
|
@ -101,39 +56,23 @@
|
||||||
enableFormat = true;
|
enableFormat = true;
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
enableExtraDiagnostics = true;
|
enableExtraDiagnostics = true;
|
||||||
# enable debug adapter protocol by default
|
|
||||||
enableDAP = true;
|
|
||||||
|
|
||||||
# sort-lines: on
|
# sort-lines: on
|
||||||
|
assembly.enable = true;
|
||||||
bash.enable = true;
|
bash.enable = true;
|
||||||
clang.enable = true;
|
clang.enable = true;
|
||||||
css.enable = true;
|
css.enable = true;
|
||||||
html.enable = true;
|
html.enable = true;
|
||||||
markdown.enable = true;
|
|
||||||
nix.enable = true;
|
nix.enable = true;
|
||||||
python.enable = true;
|
|
||||||
rust.crates.enable = true;
|
rust.crates.enable = true;
|
||||||
rust.enable = true;
|
rust.enable = true;
|
||||||
ts.enable = true;
|
ts.enable = true;
|
||||||
zig.enable = true;
|
zig.enable = true;
|
||||||
lua.enable = true;
|
markdown.enable = true;
|
||||||
# sort-lines: off
|
# sort-lines: off
|
||||||
|
|
||||||
ts.format.enable = false; # deno fmt is enabled elsewhere
|
|
||||||
nix.format.type = "nixfmt"; # looks so much nicer
|
nix.format.type = "nixfmt"; # looks so much nicer
|
||||||
};
|
};
|
||||||
formatter.conform-nvim = {
|
|
||||||
enable = true;
|
|
||||||
setupOpts.formatters_by_ft = {
|
|
||||||
typescript = [ "deno_fmt" ];
|
|
||||||
typescriptreact = [ "deno_fmt" ];
|
|
||||||
javascript = [ "deno_fmt" ];
|
|
||||||
javascriptreact = [ "deno_fmt" ];
|
|
||||||
};
|
|
||||||
setupOpts.formatters.deno_fmt = {
|
|
||||||
command = lib.meta.getExe pkgs.deno;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
filetree = {
|
filetree = {
|
||||||
neo-tree = {
|
neo-tree = {
|
||||||
enable = false;
|
enable = false;
|
||||||
|
@ -169,27 +108,22 @@
|
||||||
bigfile.enable = true;
|
bigfile.enable = true;
|
||||||
explorer.replace_netrw = true;
|
explorer.replace_netrw = true;
|
||||||
dashboard = {
|
dashboard = {
|
||||||
preset.keys = [
|
|
||||||
{
|
|
||||||
icon = " ";
|
|
||||||
key = "n";
|
|
||||||
desc = "New File";
|
|
||||||
action = ":ene | startinsert";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
icon = " ";
|
|
||||||
key = "r";
|
|
||||||
desc = "Recent Files";
|
|
||||||
action = ":lua Snacks.dashboard.pick('oldfiles')";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
sections = [
|
sections = [
|
||||||
{ section = "header"; }
|
{ section = "header"; }
|
||||||
{
|
{
|
||||||
|
icon = " ";
|
||||||
|
title = "Keymaps";
|
||||||
section = "keys";
|
section = "keys";
|
||||||
indent = 2;
|
indent = 2;
|
||||||
padding = 1;
|
padding = 1;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
icon = " ";
|
||||||
|
title = "Recent Files";
|
||||||
|
section = "recent_files";
|
||||||
|
indent = 2;
|
||||||
|
padding = 1;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
icon = " ";
|
icon = " ";
|
||||||
title = "Projects";
|
title = "Projects";
|
||||||
|
@ -197,21 +131,6 @@
|
||||||
indent = 2;
|
indent = 2;
|
||||||
padding = 1;
|
padding = 1;
|
||||||
}
|
}
|
||||||
{
|
|
||||||
icon = " ";
|
|
||||||
title = "Git";
|
|
||||||
section = "terminal";
|
|
||||||
enabled = lib.options.literalExpression ''
|
|
||||||
function()
|
|
||||||
return Snacks.git.get_root() ~= nil
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
cmd = "git status --short --branch --renames";
|
|
||||||
height = 10;
|
|
||||||
padding = 1;
|
|
||||||
ttl = 5 * 60;
|
|
||||||
indent = 3;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
image = {
|
image = {
|
||||||
|
@ -228,9 +147,17 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
binds = {
|
binds = {
|
||||||
whichKey.enable = true;
|
whichKey.enable = true;
|
||||||
cheatsheet.enable = true;
|
cheatsheet.enable = true;
|
||||||
|
# discourages bad keyboard habit, e.g. disables arrow keys, explains better binds
|
||||||
|
# https://github.com/m4xshen/hardtime.nvim
|
||||||
|
hardtime-nvim.enable = true;
|
||||||
|
hardtime-nvim.setupOpts = {
|
||||||
|
disable_mouse = false;
|
||||||
|
restriction_mode = "hint"; # default behavior is lenient
|
||||||
|
};
|
||||||
};
|
};
|
||||||
ui = {
|
ui = {
|
||||||
borders.enable = true;
|
borders.enable = true;
|
||||||
|
@ -242,6 +169,19 @@
|
||||||
enable = false;
|
enable = false;
|
||||||
navbuddy.enable = config.vim.ui.breadcrumbs.enable;
|
navbuddy.enable = config.vim.ui.breadcrumbs.enable;
|
||||||
};
|
};
|
||||||
|
smartcolumn = {
|
||||||
|
enable = true;
|
||||||
|
setupOpts.custom_colorcolumn = {
|
||||||
|
# this is a freeform module, it's `buftype = int;` for configuring column position
|
||||||
|
nix = "110";
|
||||||
|
ruby = "120";
|
||||||
|
java = "130";
|
||||||
|
go = [
|
||||||
|
"90"
|
||||||
|
"130"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
notes = {
|
notes = {
|
||||||
todo-comments.enable = true;
|
todo-comments.enable = true;
|
||||||
|
@ -251,11 +191,5 @@
|
||||||
gitsigns.enable = true;
|
gitsigns.enable = true;
|
||||||
gitsigns.codeActions.enable = false; # throws an annoying debug message
|
gitsigns.codeActions.enable = false; # throws an annoying debug message
|
||||||
};
|
};
|
||||||
# Better help docs
|
|
||||||
lazy.plugins."helpview.nvim" = {
|
|
||||||
enabled = true;
|
|
||||||
package = pkgs.vimPlugins.helpview-nvim;
|
|
||||||
lazy = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./ld.nix
|
./ld.nix
|
||||||
|
./nvidia.nix
|
||||||
./services.nix
|
./services.nix
|
||||||
];
|
];
|
||||||
# make 'shared.darwin' not an error to define.
|
# make 'shared.darwin' not an error to define.
|
||||||
|
|
|
@ -22,6 +22,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
desktopManager.cosmic.enable = true;
|
||||||
|
displayManager.cosmic-greeter.enable = true;
|
||||||
|
desktopManager.cosmic.xwayland.enable = true;
|
||||||
|
|
||||||
# Auto mount devices
|
# Auto mount devices
|
||||||
udisks2 = {
|
udisks2 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
9
nvim
9
nvim
|
@ -1,14 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
username="$(id -u -n)"
|
username="$(id -u -n)"
|
||||||
if [ "$username" = "clo" ]; then
|
if [ "$username" = "clo" ]; then
|
||||||
name="chloe"
|
name="chloe";
|
||||||
elif [ "$username" = "nmarks" ]; then
|
elif [ "$username" = "nmarks" ]; then
|
||||||
name="natalie"
|
name="natalie";
|
||||||
elif [ "$username" = "fish" ]; then
|
|
||||||
name="julia"
|
|
||||||
fi
|
fi
|
||||||
if [ -z "$name" ]; then
|
if [ -z "$name" ]; then
|
||||||
echo "Configure this wrapper script with your name." >&2
|
echo "Configure this wrapper script with your name." >2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
exec nix run ".#nvim-$name" -- "$@"
|
exec nix run ".#nvim-$name" -- "$@"
|
||||||
|
|
||||||
|
|
20
readme.md
20
readme.md
|
@ -6,16 +6,16 @@ machines, but also share useful modules between each other.
|
||||||
```
|
```
|
||||||
lib/ # reusable functions
|
lib/ # reusable functions
|
||||||
modules/ # reusable modules
|
modules/ # reusable modules
|
||||||
+-- home/ # home program configurations
|
|
||||||
+-- macos/ # nix-darwin configurations
|
+-- macos/ # nix-darwin configurations
|
||||||
+-- neovim/ # nvf configurations
|
|
||||||
+-- nixos/ # linux configurations
|
+-- nixos/ # linux configurations
|
||||||
|
+-- neovim/ # nvf configurations
|
||||||
+-- shared/ # shared between nixos-rebuild & darwin-rebuild
|
+-- shared/ # shared between nixos-rebuild & darwin-rebuild
|
||||||
|
+-- home-manager.nix # home program presets
|
||||||
users/
|
users/
|
||||||
+-- chloe/
|
+-- chloe/
|
||||||
| +-- user.nix # info about her
|
| +-- user.nix # info about her
|
||||||
| +-- configuration.nix # for all hosts (system)
|
| +-- configuration.nix # for all hosts
|
||||||
| +-- home.nix # for all hosts (userspace)
|
| +-- home.nix # for all hosts
|
||||||
| +-- vim.nix # for neovim
|
| +-- vim.nix # for neovim
|
||||||
| +-- sandwich/
|
| +-- sandwich/
|
||||||
| | +-- configuration.nix # per host
|
| | +-- configuration.nix # per host
|
||||||
|
@ -67,15 +67,3 @@ Setup `nix-darwin` using the `switch` helper:
|
||||||
```
|
```
|
||||||
./switch
|
./switch
|
||||||
```
|
```
|
||||||
|
|
||||||
## Neovim configuration
|
|
||||||
|
|
||||||
By default, neovim is configured to all machines in `$PATH`. Neovim can be run
|
|
||||||
directly via `nix run`, which skips needing to build the whole system
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
```
|
|
||||||
nix run .#nvim-natalie # run by user
|
|
||||||
./nvim # run based on your username
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
9
sample.keys
Normal file
9
sample.keys
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
global {
|
||||||
|
cmd + opt + backtick -> app "Keyboard Maestro"
|
||||||
|
}
|
||||||
|
|
||||||
|
device WorkLouder {
|
||||||
|
a -> {
|
||||||
|
if app "REAPER" -> key cmd + shift
|
||||||
|
}
|
||||||
|
}
|
4
switch
4
switch
|
@ -1,10 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
nh_subcommand="os"
|
nh_subcommand="os"
|
||||||
fallback_command="nixos-rebuild"
|
fallback_command="nixos-rebuild"
|
||||||
if [ "$(uname -o)" = "darwin" ]; then
|
if [ "$(uname -o)" ]; then
|
||||||
nh_subcommand="darwin"
|
nh_subcommand="darwin"
|
||||||
fallback_command="nix run .#darwin-rebuild"
|
fallback_command="nix run .#darwin-rebuild"
|
||||||
fi
|
fi;
|
||||||
if command -v nh > /dev/null; then
|
if command -v nh > /dev/null; then
|
||||||
nh $nh_subcommand switch .
|
nh $nh_subcommand switch .
|
||||||
else
|
else
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
{
|
{
|
||||||
# packages for all machines
|
# packages for all machines
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
|
||||||
];
|
];
|
||||||
|
# services for all machines
|
||||||
services.tailscale.enable = true;
|
services.karabiner-elements.enable = true;
|
||||||
|
|
||||||
# configuration for shared modules.
|
# configuration for shared modules.
|
||||||
# all custom options in 'shared' for clarity.
|
# all custom options in 'shared' for clarity.
|
||||||
|
|
|
@ -10,9 +10,7 @@ in
|
||||||
let
|
let
|
||||||
# packages to always install
|
# packages to always install
|
||||||
all = [
|
all = [
|
||||||
(ffmpeg.override {
|
ffmpeg
|
||||||
withSvtav1 = true;
|
|
||||||
})
|
|
||||||
ripgrep
|
ripgrep
|
||||||
uv
|
uv
|
||||||
nh
|
nh
|
||||||
|
@ -35,26 +33,12 @@ in
|
||||||
};
|
};
|
||||||
programs = {
|
programs = {
|
||||||
# sort-lines:start
|
# sort-lines:start
|
||||||
# bat.enable = true;
|
bat.enable = true;
|
||||||
btop.enable = true;
|
btop.enable = true;
|
||||||
fd.enable = true;
|
fd.enable = true;
|
||||||
hyfetch.enable = true;
|
hyfetch.enable = true;
|
||||||
# sort-lines:end
|
# sort-lines:end
|
||||||
|
|
||||||
ghostty = {
|
|
||||||
enable = true;
|
|
||||||
shader = "cursor-smear-black.glsl";
|
|
||||||
package = null;
|
|
||||||
settings = {
|
|
||||||
theme = "catppuccin-latte";
|
|
||||||
font-family = "AT Name Mono";
|
|
||||||
adjust-cursor-thickness = 1;
|
|
||||||
minimum-contrast = 1.1;
|
|
||||||
background-opacity = 0.9;
|
|
||||||
background-blur = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# zsh is the shell i use
|
# zsh is the shell i use
|
||||||
zsh = {
|
zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
_: {
|
|
||||||
homebrew = {
|
|
||||||
enable = true;
|
|
||||||
casks = [ "eloston-chromium" ];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -13,6 +13,5 @@
|
||||||
pnpm
|
pnpm
|
||||||
yt-dlp
|
yt-dlp
|
||||||
spotdl
|
spotdl
|
||||||
zig
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,20 @@
|
||||||
_: {
|
{ ... }:
|
||||||
vim = {
|
{
|
||||||
options = {
|
vim.theme.extraConfig = ''
|
||||||
linebreak = true;
|
if vim.g.neovide then
|
||||||
};
|
vim.g.neovide_cursor_trail_size = 0.3
|
||||||
git = {
|
vim.g.neovide_scroll_animation_length = 0.1;
|
||||||
gitsigns.setupOpts = {
|
|
||||||
current_line_blame = true;
|
vim.keymap.set('n', '<D-s>', ':w<CR>') -- Save
|
||||||
current_line_blame_opts = {
|
vim.keymap.set('v', '<D-c>', '"+y') -- Copy
|
||||||
virt_text = true;
|
vim.keymap.set('n', '<D-v>', '"+P') -- Paste normal mode
|
||||||
virt_text_pos = "right_align";
|
vim.keymap.set('v', '<D-v>', '"+P') -- Paste visual mode
|
||||||
delay = 25;
|
vim.keymap.set('c', '<D-v>', '<C-R>+') -- Paste command mode
|
||||||
ignore_whitespace = true;
|
vim.keymap.set('i', '<D-v>', '<ESC>l"+Pli') -- Paste insert mode
|
||||||
virt_text_priority = 100;
|
end
|
||||||
use_focus = true;
|
vim.api.nvim_set_keymap("", '<D-v>', '+p<CR>', { noremap = true, silent = true})
|
||||||
};
|
vim.api.nvim_set_keymap('!', '<D-v>', '<C-R>+', { noremap = true, silent = true})
|
||||||
};
|
vim.api.nvim_set_keymap('t', '<D-v>', '<C-R>+', { noremap = true, silent = true})
|
||||||
};
|
vim.api.nvim_set_keymap('v', '<D-v>', '<C-R>+', { noremap = true, silent = true})
|
||||||
keymaps =
|
'';
|
||||||
let
|
|
||||||
mkKeymap = mode: key: action: desc: {
|
|
||||||
inherit mode;
|
|
||||||
inherit key action desc;
|
|
||||||
};
|
|
||||||
n = mkKeymap "n"; # normal mode
|
|
||||||
in
|
|
||||||
[
|
|
||||||
# UI
|
|
||||||
(n "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")
|
|
||||||
# Find Files
|
|
||||||
(n "<leader><space>" ":lua require('snacks').picker.smart()<CR>" "Smart Find Files")
|
|
||||||
(n "<leader>f" ":lua require('snacks').picker.grep()<CR>" "Grep Files")
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,127 +0,0 @@
|
||||||
# Edit this configuration file to define what should be installed on
|
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ # Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
|
|
||||||
# networking.hostName = "nixos"; # Define your hostname.
|
|
||||||
# Pick only one of the below networking options.
|
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
||||||
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
# time.timeZone = "Europe/Amsterdam";
|
|
||||||
|
|
||||||
# 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 the X11 windowing system.
|
|
||||||
services.xserver.enable = true;
|
|
||||||
|
|
||||||
# Enable the GNOME Desktop Environment.
|
|
||||||
services.xserver.displayManager.gdm.enable = true;
|
|
||||||
services.xserver.desktopManager.gnome.enable = true;
|
|
||||||
|
|
||||||
|
|
||||||
# Configure keymap in X11
|
|
||||||
# services.xserver.xkb.layout = "us";
|
|
||||||
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
|
||||||
|
|
||||||
# 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.fish = {
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
|
||||||
packages = with pkgs; [
|
|
||||||
tree
|
|
||||||
git
|
|
||||||
nh
|
|
||||||
vim
|
|
||||||
fish
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
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
|
|
||||||
];
|
|
||||||
|
|
||||||
# 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 = "25.05"; # Did you read the comment?
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [
|
|
||||||
"xhci_pci"
|
|
||||||
"thunderbolt"
|
|
||||||
"vmd"
|
|
||||||
"nvme"
|
|
||||||
];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "/dev/disk/by-uuid/8eb0d6a2-b8cf-4ef2-ba2a-e25a5555b0bc";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot/efi" = {
|
|
||||||
device = "/dev/disk/by-uuid/3B51-4A1C";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [
|
|
||||||
"fmask=0077"
|
|
||||||
"dmask=0077"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{ device = "/dev/disk/by-uuid/58ee9d19-292f-49b5-9979-341b42e8e09d"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
userSettings,
|
|
||||||
systemSettings,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
home = {
|
|
||||||
stateVersion = "23.05"; # Don't change this unless upgrading Home Manager versions
|
|
||||||
|
|
||||||
packages = with pkgs; [
|
|
||||||
# General applications
|
|
||||||
ghostty
|
|
||||||
stremio
|
|
||||||
julia
|
|
||||||
qbittorrent
|
|
||||||
calibre
|
|
||||||
mpv
|
|
||||||
signal-desktop
|
|
||||||
python3
|
|
||||||
gh
|
|
||||||
|
|
||||||
# Gaming
|
|
||||||
bottles
|
|
||||||
lutris
|
|
||||||
mangohud
|
|
||||||
dxvk_2
|
|
||||||
steam-run
|
|
||||||
vulkan-tools
|
|
||||||
path-of-building
|
|
||||||
wineWowPackages.stable
|
|
||||||
winetricks
|
|
||||||
(prismlauncher.override { gamemodeSupport = true; })
|
|
||||||
|
|
||||||
# System & desktop tools
|
|
||||||
wofi
|
|
||||||
xorg.xauth
|
|
||||||
kdePackages.dolphin
|
|
||||||
xdg-desktop-portal-gtk
|
|
||||||
xclip
|
|
||||||
pavucontrol
|
|
||||||
ethtool
|
|
||||||
grub2
|
|
||||||
efibootmgr
|
|
||||||
distrobox
|
|
||||||
|
|
||||||
# Dev tools
|
|
||||||
legcord
|
|
||||||
hyfetch
|
|
||||||
arduino-cli
|
|
||||||
rust-bin.stable.latest.default
|
|
||||||
tytools
|
|
||||||
inputs.zls.packages.x86_64-linux.zls
|
|
||||||
platformio
|
|
||||||
usbutils
|
|
||||||
teensy-loader-cli
|
|
||||||
teensyduino
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
btop.enable = true;
|
|
||||||
hyfetch.enable = true;
|
|
||||||
|
|
||||||
gh = {
|
|
||||||
enable = true;
|
|
||||||
gitCredentialHelper.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Uncomment if you want to use MangoHud system-wide
|
|
||||||
# mangohud.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,72 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
userSettings,
|
|
||||||
systemSettings,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
home = {
|
|
||||||
stateVersion = "23.05"; # Please read the comment before changing.
|
|
||||||
|
|
||||||
packages = with pkgs; [
|
|
||||||
#building macos apps hard :(
|
|
||||||
ghostty
|
|
||||||
stremio
|
|
||||||
julia
|
|
||||||
qbittorrent
|
|
||||||
|
|
||||||
#gaming
|
|
||||||
bottles
|
|
||||||
lutris
|
|
||||||
mangohud
|
|
||||||
dxvk_2
|
|
||||||
steam-run
|
|
||||||
vulkan-tools
|
|
||||||
path-of-building
|
|
||||||
wineWowPackages.stable
|
|
||||||
winetricks
|
|
||||||
(prismlauncher.override { gamemodeSupport = true; })
|
|
||||||
|
|
||||||
#window manager stuff
|
|
||||||
wofi
|
|
||||||
xorg.xauth
|
|
||||||
#linux tools
|
|
||||||
legcord
|
|
||||||
pavucontrol
|
|
||||||
ethtool
|
|
||||||
grub2
|
|
||||||
efibootmgr
|
|
||||||
distrobox
|
|
||||||
xdg-desktop-portal-gtk
|
|
||||||
xclip
|
|
||||||
kdePackages.dolphin
|
|
||||||
hyfetch
|
|
||||||
arduino-cli
|
|
||||||
python3
|
|
||||||
gh
|
|
||||||
#broken on macos
|
|
||||||
calibre
|
|
||||||
mpv
|
|
||||||
wireguard-tools
|
|
||||||
signal-desktop
|
|
||||||
inputs.zls.packages.x86_64-linux.zls
|
|
||||||
rust-bin.stable.latest.default
|
|
||||||
];
|
|
||||||
|
|
||||||
# programs.mangohud.enable = true;
|
|
||||||
programs = {
|
|
||||||
btop.enable = true;
|
|
||||||
hyfetch.enable = true;
|
|
||||||
programs.gh = {
|
|
||||||
enable = true;
|
|
||||||
gitCredentialHelper = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
# Applied to all systems
|
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
host,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
rec {
|
|
||||||
username = "fish"; # username
|
|
||||||
name = "Julia"; # name/identifier
|
|
||||||
email = "fish@fishcat.fish"; # email (used for certain configurations)
|
|
||||||
dotfilesDir = "~/config"; # absolute path of the local repo
|
|
||||||
theme = "catppuccin-mocha"; # name of theme that stylix will use
|
|
||||||
browser = "firefox"; # Default browser; must select one from ./user/app/browser/
|
|
||||||
term = "ghostty"; # Default terminal command;
|
|
||||||
font = "iosevka"; # Selected font
|
|
||||||
editor = "neovim"; # Default editor;
|
|
||||||
timeZone = "America/Los_Angeles";
|
|
||||||
sexuality = "transgender";
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
}
|
|
|
@ -121,11 +121,6 @@
|
||||||
|
|
||||||
# Enable sound with pipewire.
|
# Enable sound with pipewire.
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services = {
|
|
||||||
desktopManager.cosmic.enable = true;
|
|
||||||
displayManager.cosmic-greeter.enable = true;
|
|
||||||
desktopManager.cosmic.xwayland.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
|
@ -35,6 +35,7 @@ with pkgs;
|
||||||
#nix tools
|
#nix tools
|
||||||
direnv
|
direnv
|
||||||
nh
|
nh
|
||||||
|
(lix.override { aws-sdk-cpp = null; })
|
||||||
|
|
||||||
#terminal stuff
|
#terminal stuff
|
||||||
(btop.override { cudaSupport = true; })
|
(btop.override { cudaSupport = true; })
|
||||||
|
@ -85,6 +86,7 @@ with pkgs;
|
||||||
python312Packages.pip
|
python312Packages.pip
|
||||||
|
|
||||||
#programming languages
|
#programming languages
|
||||||
|
R
|
||||||
deno
|
deno
|
||||||
ruby
|
ruby
|
||||||
nodePackages.npm
|
nodePackages.npm
|
||||||
|
@ -97,7 +99,7 @@ with pkgs;
|
||||||
firefox
|
firefox
|
||||||
|
|
||||||
#math
|
#math
|
||||||
# texlive.combined.scheme-full
|
texlive.combined.scheme-full
|
||||||
|
|
||||||
#fun things
|
#fun things
|
||||||
cowsay
|
cowsay
|
||||||
|
|
|
@ -9,6 +9,21 @@
|
||||||
withPython3 = true;
|
withPython3 = true;
|
||||||
python3Packages = [ "pynvim" ];
|
python3Packages = [ "pynvim" ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
tabstop = 2;
|
||||||
|
softtabstop = 2;
|
||||||
|
shiftwidth = 2;
|
||||||
|
undofile = true;
|
||||||
|
swapfile = false;
|
||||||
|
showmode = false;
|
||||||
|
foldlevel = 99;
|
||||||
|
foldcolumn = "1";
|
||||||
|
foldlevelstart = 99;
|
||||||
|
foldenable = true;
|
||||||
|
foldmethod = "expr";
|
||||||
|
#Default to treesitter folding
|
||||||
|
foldexpr = "v:lua.vim.treesitter.foldexpr()";
|
||||||
|
};
|
||||||
|
|
||||||
autocmds = [
|
autocmds = [
|
||||||
#Autocommand to fall back to treesitter folding if LSP doesnt support it
|
#Autocommand to fall back to treesitter folding if LSP doesnt support it
|
||||||
|
@ -29,9 +44,28 @@
|
||||||
tabline = {
|
tabline = {
|
||||||
nvimBufferline.enable = true;
|
nvimBufferline.enable = true;
|
||||||
};
|
};
|
||||||
|
# nvf versions is VERY outdated
|
||||||
|
# pluginOverrides = {
|
||||||
|
# hardtime-nvim = pkgs.fetchFromGitHub {
|
||||||
|
# owner = "m4xshen";
|
||||||
|
# repo = "hardtime.nvim";
|
||||||
|
# rev = "v1.0.1";
|
||||||
|
# hash = "sha256-5tqiSuGvBJcr8l6anEBojXEaaxFS1P5T1ROr46ylVhk=";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
startPlugins = [
|
startPlugins = [
|
||||||
"nui-nvim"
|
"nui-nvim"
|
||||||
];
|
];
|
||||||
|
binds = {
|
||||||
|
hardtime-nvim = {
|
||||||
|
enable = false;
|
||||||
|
setupOpts = {
|
||||||
|
disable_mouse = false;
|
||||||
|
restriction_mode = "warn";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
theme = {
|
theme = {
|
||||||
name = "catppuccin";
|
name = "catppuccin";
|
||||||
style = "mocha";
|
style = "mocha";
|
||||||
|
|
|
@ -1,19 +1,26 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
let
|
let
|
||||||
mkKeymap = mode: key: action: desc: {
|
mkKeymap = mode: key: action: desc: {
|
||||||
inherit mode;
|
inherit
|
||||||
inherit key action desc;
|
mode
|
||||||
|
key
|
||||||
|
action
|
||||||
|
desc
|
||||||
|
;
|
||||||
};
|
};
|
||||||
n = mkKeymap "n"; # normal mode
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
vim = {
|
vim = {
|
||||||
keymaps = [
|
keymaps = [
|
||||||
(n "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")
|
(mkKeymap "n" "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")
|
||||||
|
|
||||||
# Snacks Picker Replaces Telescope!?
|
# Snacks Picker Replaces Telescope!?
|
||||||
(n "<leader><space>" ":lua require('snacks').picker.smart()<CR>" "Smart Find Files")
|
(mkKeymap "n" "<leader><space>" ":lua require('snacks').picker.smart()<CR>" "Smart Find Files")
|
||||||
(n "<leader>ff" ":lua require('snacks').picker.files()<CR>" "Find File")
|
(mkKeymap "n" "<leader>ff" ":lua require('snacks').picker.files()<CR>" "Find File")
|
||||||
(n "<leader>fg" ":lua require('snacks').picker.grep()<CR>" "Grep Files")
|
(mkKeymap "n" "<leader>fg" ":lua require('snacks').picker.grep()<CR>" "Grep Files")
|
||||||
|
# Lsp
|
||||||
|
(mkKeymap "n" "lr" ":lua vim.lsp.buf.rename()<CR>" "Rename")
|
||||||
|
# (mkKeymap "n" "<leader>th" ":lua function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end<CR>" "Toggle Inlay Hints")
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,17 @@
|
||||||
nixd
|
nixd
|
||||||
];
|
];
|
||||||
lsp = {
|
lsp = {
|
||||||
|
formatOnSave = true;
|
||||||
|
lightbulb.enable = false;
|
||||||
|
# lspsaga = {
|
||||||
|
# enable = true;
|
||||||
|
# setupOpts = {
|
||||||
|
# lightbulb = {
|
||||||
|
# virtual_text = false;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
inlayHints.enable = true;
|
||||||
servers = {
|
servers = {
|
||||||
nil = {
|
nil = {
|
||||||
settings.nil.nix.flake = {
|
settings.nil.nix.flake = {
|
||||||
|
@ -47,8 +58,30 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
mappings = {
|
||||||
|
codeAction = "<leader>ca";
|
||||||
|
goToDeclaration = "gD";
|
||||||
|
goToDefinition = "gd";
|
||||||
|
listReferences = "gr";
|
||||||
|
goToType = "gy";
|
||||||
|
hover = "K";
|
||||||
|
nextDiagnostic = "<leader>d";
|
||||||
|
openDiagnosticFloat = "<leader>df";
|
||||||
|
renameSymbol = "rn";
|
||||||
|
documentHighlight = null;
|
||||||
|
listDocumentSymbols = null;
|
||||||
|
listImplementations = null;
|
||||||
|
listWorkspaceFolders = null;
|
||||||
|
previousDiagnostic = null;
|
||||||
|
removeWorkspaceFolder = null;
|
||||||
|
signatureHelp = null;
|
||||||
|
toggleFormatOnSave = null;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
languages = {
|
languages = {
|
||||||
|
enableDAP = true;
|
||||||
|
lua.enable = true;
|
||||||
|
python.enable = true;
|
||||||
python.format.type = "ruff";
|
python.format.type = "ruff";
|
||||||
markdown = {
|
markdown = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
vim = {
|
vim = {
|
||||||
|
visuals = {
|
||||||
|
indent-blankline = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
ui = {
|
ui = {
|
||||||
noice = {
|
noice = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -23,5 +28,11 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Better help docs
|
||||||
|
lazy.plugins."helpview.nvim" = {
|
||||||
|
enabled = true;
|
||||||
|
package = pkgs.vimPlugins.helpview-nvim;
|
||||||
|
lazy = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue