/nix/store/dlwqlnbaj5vfm9aw20r1yxk8y56lmgif-repo/header.tmpl

Compare commits

..

1 commit

Author SHA1 Message Date
e4ef026a0c website: init 2025-04-26 00:04:55 +02:00
230 changed files with 3737 additions and 9216 deletions

4
.envrc Normal file
View file

@ -0,0 +1,4 @@
watch_file flake.nix
use flake

207
.github/logo.svg vendored Normal file
View file

@ -0,0 +1,207 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="200"
height="200"
viewBox="0 0 501.56251 501.56249"
id="svg2"
version="1.1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
sodipodi:docname="nix-webring.svg"
inkscape:export-filename="nix-webring.png"
inkscape:export-xdpi="107.66355"
inkscape:export-ydpi="107.66355"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs4">
<linearGradient
inkscape:collect="always"
id="linearGradient5562">
<stop
style="stop-color:#699ad7;stop-opacity:1"
offset="0"
id="stop5564" />
<stop
id="stop5566"
offset="0.24345198"
style="stop-color:#7eb1dd;stop-opacity:1" />
<stop
style="stop-color:#7ebae4;stop-opacity:1"
offset="1"
id="stop5568" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient5053">
<stop
style="stop-color:#415e9a;stop-opacity:1"
offset="0"
id="stop5055" />
<stop
id="stop5057"
offset="0.23168644"
style="stop-color:#4a6baf;stop-opacity:1" />
<stop
style="stop-color:#5277c3;stop-opacity:1"
offset="1"
id="stop5059" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5053"
id="linearGradient4330"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(864.69589,-1491.3405)"
x1="-584.19934"
y1="782.33563"
x2="-496.29703"
y2="937.71399" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5562"
id="linearGradient1"
gradientUnits="userSpaceOnUse"
gradientTransform="rotate(60,1285.574,-127.0267)"
x1="200.59668"
y1="351.41116"
x2="290.08701"
y2="506.18814" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5562"
id="linearGradient2"
gradientUnits="userSpaceOnUse"
gradientTransform="rotate(-60,-541.80106,-249.3096)"
x1="200.59668"
y1="351.41116"
x2="290.08701"
y2="506.18814" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5562"
id="linearGradient3"
gradientUnits="userSpaceOnUse"
gradientTransform="rotate(180,372.09351,-188.18095)"
x1="200.59668"
y1="351.41116"
x2="290.08701"
y2="506.18814" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5053"
id="linearGradient4"
gradientUnits="userSpaceOnUse"
gradientTransform="rotate(120,405.50413,279.20289)"
x1="-584.19934"
y1="782.33563"
x2="-496.29703"
y2="937.71399" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5053"
id="linearGradient5"
gradientUnits="userSpaceOnUse"
gradientTransform="rotate(-120,-455.57263,-219.8159)"
x1="-584.19934"
y1="782.33563"
x2="-496.29703"
y2="937.71399" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.70710678"
inkscape:cx="428.50671"
inkscape:cy="330.92597"
inkscape:document-units="px"
inkscape:current-layer="g2"
showgrid="false"
inkscape:window-width="2560"
inkscape:window-height="1404"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="gradient-logo"
style="display:inline;opacity:1"
transform="translate(-156.41121,933.30685)">
<g
id="g2"
transform="matrix(0.99994059,0,0,0.99994059,-0.06321798,33.188377)"
style="stroke-width:1.00006">
<g
id="g5"
transform="matrix(1.5923554,0,0,1.5923554,-241.25483,424.14882)">
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="use3439-6"
d="m 353.65459,-797.57947 -75.33983,131.03333 -28.53475,-48.37004 14.05181,-24.82625 33.4638,-57.69041 z"
style="fill:url(#linearGradient1);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00018;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="use3445-0"
d="m 363.03058,-628.3791 150.65887,0.012 -27.6223,48.89684 -28.03684,-0.0386 -66.69326,-0.1353 z"
style="fill:url(#linearGradient2);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00018;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="use3449-5"
d="m 505.28844,-721.12473 -75.88193,-131.23275 56.15706,-0.5268 14.54791,25.05223 33.22946,57.8257 z"
style="fill:url(#linearGradient3);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00018;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4330);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00018;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 309.54892,-710.38827 75.60056,130.67022 -56.15706,0.5268 -14.26654,-24.4897 -33.22946,-57.8256 z"
id="path4260-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00018;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 451.30201,-803.62004 -150.65887,-0.012 27.62231,-48.89684 28.03683,0.0386 66.69317,0.13525 z"
id="use4354-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient5);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00018;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 460.90516,-633.96606 75.33983,-131.03333 28.53475,48.37004 -14.05181,24.82625 -33.46371,57.69035 z"
id="use4362-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

1
.gitignore vendored
View file

@ -1,2 +1 @@
/.direnv
.qmlls.ini

View file

@ -12,13 +12,11 @@ GNU GPL3
This configuration was only made possible through the help of some amazing
people! Below are all the repositories I took inspiration from, check them out!
- [jacekpoz](https://git.jacekpoz.pl/jacekpoz/niksos.git)
- [dragyx](https://github.com/dragyx/nichts)
- [sioodmy](https://github.com/sioodmy/dotfiles)
- [Henrik Lissner](https://github.com/hlissner/dotfiles)
- [diniamo](https://github.com/diniamo/niqs)
- [fufexan](https://github.com/fufexan)
- [lokasku](https://github.com/lokasku/nix-config)
- [NotAShelf](https://github.com/notashelf/nyx)
- [viperML](https://github.com/viperml/dotfiles)
- [atagen](https://git.atagen.co/atagen/nix)
[jacekpoz](https://git.jacekpoz.pl/jacekpoz/niksos.git)
[dragyx](https://github.com/dragyx/nichts)
[sioodmy](https://github.com/sioodmy/dotfiles)
[Henrik Lissner](https://github.com/hlissner/dotfiles)
[diniamo](https://github.com/diniamo/niqs) [fufexan](https://github.com/fufexan)
[lokasku](https://github.com/lokasku/nix-config)
[NotAShelf](https://github.com/notashelf/nyx)
[viperML](https://github.com/viperml/dotfiles)

21
TODO.md Normal file
View file

@ -0,0 +1,21 @@
## Todo
This is a list of all the things I still have to fix/achive in this
configuration:
- [ ] Fix apparmor
- [ ] Lanzaboote
- [ ] Remove all `with`
- [ ] better documentation
- [ ] Fix greetd
- [ ] ClamAV
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]

View file

@ -1,67 +0,0 @@
let
inherit (builtins)
filter
fromJSON
readFile
;
/*
The *sole* use for the flake in this repository is easy locking
of dependencies and inputs for nil, my lsp.
I parse the flake.lock here, extract the Lix project's
flake-compat, which features lazy store copies, aka lazy trees.
Using that, I can use Lix as my CppNix implementation
AND have lazy trees for basically free.
*/
lockFile = fromJSON (readFile ./flake.lock);
node = lockFile.nodes.root.inputs.__flake-compat;
inherit (lockFile.nodes.${node}.locked) narHash rev url;
flake-compat = builtins.fetchTarball {
url = "${url}/archive/${rev}.tar.gz";
sha256 = narHash;
};
flake = import flake-compat {
src = ./.;
# Prevent eager store copies
copySourceTreeToStore = false;
useBuiltinsFetchTree = true;
};
inherit (flake) inputs;
pkgs = import inputs.nixpkgs { };
inherit (pkgs) lib;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
inherit (lib.attrsets) genAttrs;
nixosSystem = import (inputs.nixpkgs.outPath + "/nixos/lib/eval-config.nix");
mkSystem =
hostname:
nixosSystem {
specialArgs = {
inherit inputs;
self = ./.;
};
modules = [
{ networking.hostName = hostname; }
./hosts/${hostname}
inputs.agenix.nixosModules.age
]
++ ((listFilesRecursive ./modules) |> filter (hasSuffix ".mod.nix"));
lib = inputs.nixpkgs.lib.extend (
final: prev: {
getFlakePkg = p: p.packages.${builtins.currentSystem}.default;
getFlakePkg' = p: n: p.packages.${builtins.currentSystem}.${n};
}
);
};
hosts = [
"temperance"
"hermit"
"tower"
];
in
genAttrs hosts mkSystem

55
docs/dualboot.md Normal file
View file

@ -0,0 +1,55 @@
# Dualbooting NixOS and FreeBSD
Out of curiosity, I decided to dual-boot NixOS and FreeBSD on my laptop, sharing
one disk. I document the process here for future reference:
## Linux install
First, flash a stick with NixOS, then boot into it, wipe your disk, create two
partitions, one being boot, the other your main NixOS partition. Then, follow
these commands:
```bash
sudo su
cryptsetup luksFormat /dev/diskname/partition
cryptsetup open /dev/diskname/partition crypt
mkfs.btrfs -L nixos /dev/mapper/crypt
mount /dev/mapper/crypt /mnt
btrfs create subvolume /mnt/nix
btrfs create subvolume /mnt/home
btrfs create subvolume /mnt/persist
mkdir /mnt/boot
mount /dev/partition # boot partition
```
Then, copy [my nixos flake](https://github.com/bloxx12/nichts) to `/mnt`, you
can remove it from there later on.
```bash
git clone https://github.com/bloxx12/nichts /mnt
```
In there, change the file system uuids to the correct ones, you can see them
using
```bash
sudo blkid
```
Then, install NixOS itself:
```bash
nixos-install --impure --flake /mnt/nichts#<hostname> -j 1 --cores 2
```
Wait for that to finish, then reboot.
If your system works, great! if not, redo from the beginning.
After that, set up FreeBSD the following way:

8
docs/resizing.md Normal file
View file

@ -0,0 +1,8 @@
## Resizing images using imagemagick
I wanted to resize an image using imagemagick.
To do this I had to run:
`magick lain.png -crop 1072x1448^ -gravity center -quality 90 sca.png`
What does this do?

795
flake.lock generated
View file

@ -1,51 +1,45 @@
{
"nodes": {
"__flake-compat": {
"flake": false,
"locked": {
"lastModified": 1751685974,
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
"ref": "refs/heads/main",
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
"revCount": 92,
"type": "git",
"url": "https://git.lix.systems/lix-project/flake-compat.git"
},
"original": {
"type": "git",
"url": "https://git.lix.systems/lix-project/flake-compat.git"
}
},
"agenix": {
"aquamarine": {
"inputs": {
"darwin": [],
"home-manager": "home-manager",
"hyprutils": [
"hyprland",
"hyprutils"
],
"hyprwayland-scanner": [
"hyprland",
"hyprwayland-scanner"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": "systems"
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1754433428,
"narHash": "sha256-NA/FT2hVhKDftbHSwVnoRTFhes62+7dxZbxj5Gxvghs=",
"owner": "ryantm",
"repo": "agenix",
"rev": "9edb1787864c4f59ae5074ad498b6272b3ec308d",
"lastModified": 1743265529,
"narHash": "sha256-QbjP15/2N+VJl0b5jxrrTc+VOt39aU4XrDvtP0Lz5ik=",
"owner": "hyprwm",
"repo": "aquamarine",
"rev": "1d2dbd72c2bbaceab031c592d4810f744741d203",
"type": "github"
},
"original": {
"owner": "ryantm",
"repo": "agenix",
"owner": "hyprwm",
"repo": "aquamarine",
"type": "github"
}
},
"crane": {
"locked": {
"lastModified": 1754269165,
"narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=",
"lastModified": 1741148495,
"narHash": "sha256-EV8KUaIZ2/CdBXlutXrHoZYbWPeB65p5kKZk71gvDRI=",
"owner": "ipetkov",
"repo": "crane",
"rev": "444e81206df3f7d92780680e45858e31d2f07a08",
"rev": "75390a36cd0c2cdd5f1aafd8a9f827d7107f2e53",
"type": "github"
},
"original": {
@ -57,11 +51,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
@ -73,26 +67,11 @@
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
@ -109,11 +88,11 @@
]
},
"locked": {
"lastModified": 1754091436,
"narHash": "sha256-XKqDMN1/Qj1DKivQvscI4vmHfDfvYR2pfuFOJiCeewM=",
"lastModified": 1740872218,
"narHash": "sha256-ZaMw0pdoUKigLpv9HiNDH2Pjnosg7NBYMJlHTIsHEUo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "67df8c627c2c39c41dbec76a1f201929929ab0bd",
"rev": "3876f6b87db82f33775b1ef5ea343986105db764",
"type": "github"
},
"original": {
@ -122,49 +101,29 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ghostty": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"zig": "zig",
"zon2nix": "zon2nix"
},
"locked": {
"lastModified": 1757111114,
"narHash": "sha256-pf/XTuWIJWcEXb/hcZ30MV6Alpnz8iP9dF4v1YBFqMI=",
"owner": "ghostty-org",
"repo": "ghostty",
"rev": "e4c3a56242c3e70366bdd8013537a8fed8f7a147",
"type": "github"
},
"original": {
"owner": "ghostty-org",
"repo": "ghostty",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"hyprland",
"pre-commit-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"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"lanzaboote",
@ -186,45 +145,266 @@
"type": "github"
}
},
"hjem": {
"hyprcursor": {
"inputs": {
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"smfh": "smfh"
},
"locked": {
"lastModified": 1756255328,
"narHash": "sha256-WJ70Dv+tJjIl7mMOqUgcdcz+RrujDRoeKptiU6oh1lI=",
"owner": "feel-co",
"repo": "hjem",
"rev": "2426d6ad20e767895e936ed0c9563cc4e2b6c96f",
"type": "github"
},
"original": {
"owner": "feel-co",
"repo": "hjem",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1745494811,
"narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be",
"lastModified": 1742215578,
"narHash": "sha256-zfs71PXVVPEe56WEyNi2TJQPs0wabU4WAlq0XV7GcdE=",
"owner": "hyprwm",
"repo": "hyprcursor",
"rev": "2fd36421c21aa87e2fe3bee11067540ae612f719",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"owner": "hyprwm",
"repo": "hyprcursor",
"type": "github"
}
},
"hyprgraphics": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1739049071,
"narHash": "sha256-3+7TpXMrbsUXSwgr5VAKAnmkzMb6JO+Rvc9XRb5NMg4=",
"owner": "hyprwm",
"repo": "hyprgraphics",
"rev": "175c6b29b6ff82100539e7c4363a35a02c74dd73",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprgraphics",
"type": "github"
}
},
"hyprland": {
"inputs": {
"aquamarine": "aquamarine",
"hyprcursor": "hyprcursor",
"hyprgraphics": "hyprgraphics",
"hyprland-protocols": "hyprland-protocols",
"hyprland-qtutils": "hyprland-qtutils",
"hyprlang": "hyprlang",
"hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks",
"systems": [
"systems"
],
"xdph": "xdph"
},
"locked": {
"lastModified": 1744214922,
"narHash": "sha256-136gjyhECXU5t9uFCpWsC4t50lUJnI4PJ9KZsNIaydg=",
"owner": "hyprwm",
"repo": "hyprland",
"rev": "0dc531c4a7d6849f2db61084497b3007e92f470b",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1743714874,
"narHash": "sha256-yt8F7NhMFCFHUHy/lNjH/pjZyIDFNk52Q4tivQ31WFo=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "3a5c2bda1c1a4e55cc1330c782547695a93f05b2",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprland-qt-support": {
"inputs": {
"hyprlang": [
"hyprland",
"hyprland-qtutils",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"hyprland-qtutils",
"nixpkgs"
],
"systems": [
"hyprland",
"hyprland-qtutils",
"systems"
]
},
"locked": {
"lastModified": 1737634706,
"narHash": "sha256-nGCibkfsXz7ARx5R+SnisRtMq21IQIhazp6viBU8I/A=",
"owner": "hyprwm",
"repo": "hyprland-qt-support",
"rev": "8810df502cdee755993cb803eba7b23f189db795",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-qt-support",
"type": "github"
}
},
"hyprland-qtutils": {
"inputs": {
"hyprland-qt-support": "hyprland-qt-support",
"hyprlang": [
"hyprland",
"hyprlang"
],
"hyprutils": [
"hyprland",
"hyprland-qtutils",
"hyprlang",
"hyprutils"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1739048983,
"narHash": "sha256-REhTcXq4qs3B3cCDtLlYDz0GZvmsBSh947Ub6pQWGTQ=",
"owner": "hyprwm",
"repo": "hyprland-qtutils",
"rev": "3504a293c8f8db4127cb0f7cfc1a318ffb4316f8",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-qtutils",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1741191527,
"narHash": "sha256-kM+11Nch47Xwfgtw2EpRitJuORy4miwoMuRi5tyMBDY=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "72df3861f1197e41b078faa3e38eedd60e00018d",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprutils": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1743950287,
"narHash": "sha256-/6IAEWyb8gC/NKZElxiHChkouiUOrVYNq9YqG0Pzm4Y=",
"owner": "hyprwm",
"repo": "hyprutils",
"rev": "f2dc70e448b994cef627a157ee340135bd68fbc6",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprutils",
"type": "github"
}
},
"hyprwayland-scanner": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1739870480,
"narHash": "sha256-SiDN5BGxa/1hAsqhgJsS03C3t2QrLgBT8u+ENJ0Qzwc=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "206367a08dc5ac4ba7ad31bdca391d098082e64b",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"type": "github"
}
},
@ -252,14 +432,14 @@
"nixpkgs"
],
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
"rust-overlay": "rust-overlay_2"
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1756744479,
"narHash": "sha256-EyZXusK/wRD3V9vDh00W2Re3Eg8UQ+LjVBQrrH9dq1U=",
"lastModified": 1741442524,
"narHash": "sha256-tVcxLDLLho8dWcO81Xj/3/ANLdVs0bGyCPyKjp70JWk=",
"owner": "nix-community",
"repo": "lanzaboote",
"rev": "747b7912f49e2885090c83364d88cf853a020ac1",
"rev": "d8099586d9a84308ffedac07880e7f07a0180ff4",
"type": "github"
},
"original": {
@ -268,79 +448,13 @@
"type": "github"
}
},
"nh": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1757153783,
"narHash": "sha256-HtnGRQX7BCze1eNlcc5ejAMExPk4DSqBPh6j2Byov7E=",
"owner": "nix-community",
"repo": "nh",
"rev": "036c141e2f14fb481f12c4d1498bc5d03d9e1865",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nh",
"type": "github"
}
},
"nil": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1754679101,
"narHash": "sha256-nFK2XhrDS5igmkDQWmyTcgiJsEr3KOcR31DaSy+Fy9s=",
"owner": "oxalica",
"repo": "nil",
"rev": "f80fe365cb441624d1608235e6e793e5dce47fb0",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "nil",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1755972213,
"narHash": "sha256-VYK7aDAv8H1enXn1ECRHmGbeY6RqLnNwUJkOwloIsko=",
"rev": "73e96df7cff5783f45e21342a75a1540c4eddce4",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable-small/nixos-25.11pre850642.73e96df7cff5/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable-small/nixexprs.tar.xz"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1756875158,
"narHash": "sha256-nDWEPoSmjN0P/NG9XntBijws0vwxnbeq+pKBLJGC0sA=",
"rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-25.11pre855242.d0fc30899600/nixexprs.tar.xz?rev=d0fc30899600b9b3466ddb260fd83deb486c32f1"
},
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1754214453,
"narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=",
"lastModified": 1744098102,
"narHash": "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376",
"rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7",
"type": "github"
},
"original": {
@ -350,24 +464,47 @@
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1742649964,
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": [
"lanzaboote",
"flake-compat"
],
"gitignore": "gitignore",
"gitignore": "gitignore_2",
"nixpkgs": [
"lanzaboote",
"nixpkgs"
]
},
"locked": {
"lastModified": 1750779888,
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
"lastModified": 1740915799,
"narHash": "sha256-JvQvtaphZNmeeV+IpHgNdiNePsIpHD5U/7QN5AeY44A=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
"rev": "42b1ba089d2034d910566bf6b40830af6b8ec732",
"type": "github"
},
"original": {
@ -376,66 +513,16 @@
"type": "github"
}
},
"quickshell": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1756981260,
"narHash": "sha256-GhuD9QVimjynHI0OOyZsqJsnlXr2orowh9H+HYz4YMs=",
"ref": "refs/heads/master",
"rev": "6eb12551baf924f8fdecdd04113863a754259c34",
"revCount": 672,
"type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
},
"original": {
"type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
}
},
"root": {
"inputs": {
"__flake-compat": "__flake-compat",
"agenix": "agenix",
"ghostty": "ghostty",
"hjem": "hjem",
"hyprland": "hyprland",
"impermanence": "impermanence",
"lanzaboote": "lanzaboote",
"nh": "nh",
"nil": "nil",
"nixpkgs": "nixpkgs_2",
"quickshell": "quickshell",
"watt": "watt",
"zedless": "zedless",
"zen-browser-flake": "zen-browser-flake"
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"hjem",
"smfh",
"nixpkgs"
]
},
"locked": {
"lastModified": 1747622321,
"narHash": "sha256-W0dYIWgsUu6rvOJRtKLhKskkv0VhQhJYGNIq+gGUc8g=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "bd030fd9983f7fddf87be1c64aa3064c8afa24c4",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"nixpkgs": [
"lanzaboote",
@ -443,11 +530,11 @@
]
},
"locked": {
"lastModified": 1754189623,
"narHash": "sha256-fstu5eb30UYwsxow0aQqkzxNxGn80UZjyehQVNVHuBk=",
"lastModified": 1741228283,
"narHash": "sha256-VzqI+k/eoijLQ5am6rDFDAtFAbw8nltXfLBC6SIEJAE=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "c582ff7f0d8a7ea689ae836dfb1773f1814f472a",
"rev": "38e9826bc4296c9daf18bc1e6aa299f3e932a403",
"type": "github"
},
"original": {
@ -456,183 +543,59 @@
"type": "github"
}
},
"smfh": {
"inputs": {
"nixpkgs": [
"hjem",
"nixpkgs"
],
"rust-overlay": "rust-overlay",
"systems": "systems_3"
},
"locked": {
"lastModified": 1749906619,
"narHash": "sha256-/9Ww10kYopxfCNNnNDwENTubs7Wzqlw+O6PJAHNOYQw=",
"owner": "feel-co",
"repo": "smfh",
"rev": "39f5c06153f63100376bc607b1465850b6df77fd",
"type": "github"
},
"original": {
"owner": "feel-co",
"repo": "smfh",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"repo": "default-linux",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"watt": {
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"hyprlang": [
"hyprland",
"hyprlang"
],
"hyprutils": [
"hyprland",
"hyprutils"
],
"hyprwayland-scanner": [
"hyprland",
"hyprwayland-scanner"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1754314403,
"narHash": "sha256-pETi/Fs+8FF2ZuE+JyK9+NcFaDPMHx71UdWgmzjxvkQ=",
"owner": "notashelf",
"repo": "watt",
"rev": "f68a9795616699870d213dc9e641dab655aa434a",
"lastModified": 1741934139,
"narHash": "sha256-ZhTcTH9FoeAtbPfWGrhkH7RjLJZ7GeF18nygLAMR+WE=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "150b0b6f52bb422a1b232a53698606fe0320dde0",
"type": "github"
},
"original": {
"owner": "notashelf",
"repo": "watt",
"type": "github"
}
},
"zedless": {
"inputs": {
"flake-compat": "flake-compat_3",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1754831523,
"narHash": "sha256-tkdq7WR0AvIy/eof2L2ELXKh6b73P7dcWcgJC7ww3aM=",
"owner": "zedless-editor",
"repo": "zed",
"rev": "adb21022b5063757c035d851a0e458f8e4ae954b",
"type": "github"
},
"original": {
"owner": "zedless-editor",
"repo": "zed",
"type": "github"
}
},
"zen-browser-flake": {
"inputs": {
"home-manager": [],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1757142986,
"narHash": "sha256-HB01usaR5wg5LK3lV6S7Za2x4AfKrNceOnun/mlpChk=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "ed4bfefc49ef23e55b4f6e39d2e297a79f5ab2df",
"type": "github"
},
"original": {
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"type": "github"
}
},
"zig": {
"inputs": {
"flake-compat": [
"ghostty",
"flake-compat"
],
"flake-utils": [
"ghostty",
"flake-utils"
],
"nixpkgs": [
"ghostty",
"nixpkgs"
]
},
"locked": {
"lastModified": 1748261582,
"narHash": "sha256-3i0IL3s18hdDlbsf0/E+5kyPRkZwGPbSFngq5eToiAA=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "aafb1b093fb838f7a02613b719e85ec912914221",
"type": "github"
},
"original": {
"owner": "mitchellh",
"repo": "zig-overlay",
"type": "github"
}
},
"zon2nix": {
"inputs": {
"flake-utils": [
"ghostty",
"flake-utils"
],
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1756000480,
"narHash": "sha256-fR5pdcjO0II5MNdCzqvyokyuFkmff7/FyBAjUS6sMfA=",
"owner": "jcollie",
"repo": "zon2nix",
"rev": "d9dc9ef1ab9ae45b5c9d80c6a747cc9968ee0c60",
"type": "github"
},
"original": {
"owner": "jcollie",
"repo": "zon2nix",
"rev": "d9dc9ef1ab9ae45b5c9d80c6a747cc9968ee0c60",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}

View file

@ -1,68 +1,53 @@
{
description = "My NixOS config flake";
outputs = inputs: let
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
eachSystem = inputs.nixpkgs.lib.genAttrs (import inputs.systems);
pkgsFor = inputs.nixpkgs.legacyPackages;
in {
nixosConfigurations = import ./hosts inputs;
devShells.x86_64-linux.default = pkgs.callPackage ./shell.nix {};
formatter.x86_64-linux = pkgs.alejandra;
packages = eachSystem (
system: {
inherit (import ./packages pkgsFor.${system}) fish helix kakoune;
}
);
apps = eachSystem (system: let
inherit (inputs.self.packages.${system}) fish helix;
in {
default = {
type = "app";
program = "${fish}/bin/fish";
};
helix = {
type = "app";
program = "${helix}/bin/hx";
};
});
};
inputs = {
# Unstable nixpkgs, using the new Lockable HTTP Tarball protocol
# https://github.com/NixOS/infra/pull/562.
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
# Unstable nixpkgs baby!
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
impermanence.url = "github:nix-community/impermanence";
watt = {
url = "github:notashelf/watt";
inputs.nixpkgs.follows = "nixpkgs";
};
quickshell = {
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
# THIS IS IMPORTANT
# Mismatched system dependencies will lead to crashes and other issues.
inputs.nixpkgs.follows = "nixpkgs";
};
# secure booting
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser-flake = {
url = "github:0xc000022070/zen-browser-flake";
hyprland = {
url = "github:hyprwm/hyprland";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "";
inputs.systems.follows = "systems";
};
hjem = {
url = "github:feel-co/hjem";
inputs.nixpkgs.follows = "nixpkgs";
};
zedless.url = "github:zedless-editor/zed";
nh = {
url = "github:nix-community/nh";
inputs.nixpkgs.follows = "nixpkgs";
};
nil = {
url = "github:oxalica/nil";
inputs.nixpkgs.follows = "nixpkgs";
};
ghostty = {
url = "github:ghostty-org/ghostty";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.darwin.follows = "";
};
__flake-compat = {
url = "git+https://git.lix.systems/lix-project/flake-compat.git";
flake = false;
};
};
outputs = _: { };
}

46
hosts/common.nix Normal file
View file

@ -0,0 +1,46 @@
# This is for packages I want in all systems.
# Keeping this list as small as possible is important,
# since these also get installed to server,
# which should have a small attack surface.
{
self,
pkgs,
...
}: let
inherit (self.packages.${pkgs.stdenv.system}) helix fish;
in {
environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
cachix
calc
difftastic
eza
gcc
git
httpie
inetutils
jujutsu
just
lazygit
links2
linuxHeaders
neofetch
microfetch
mprocs
nmap
polkit
ripgrep
smartmontools
television
trash-cli
util-linux
wireguard-tools
zip
zoxide
;
inherit helix fish;
};
# helix as the only editor, a reasonable choice.
environment.sessionVariables.EDITOR = pkgs.lib.getExe' helix "hx";
}

64
hosts/default.nix Normal file
View file

@ -0,0 +1,64 @@
inputs: let
inherit (inputs) self;
inherit (builtins) filter map toString;
inherit (inputs.nixpkgs) lib;
inherit (lib.attrsets) recursiveUpdate;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.lists) concatLists flatten singleton;
inherit (lib.strings) hasSuffix;
inherit (lib) nixosSystem;
# NOTE: This was inspired by raf, and I find this
# to be quite a sane way of managing all modules in my flake.
mkSystem = {
system,
hostname,
...
} @ args:
nixosSystem {
specialArgs =
recursiveUpdate
{
inherit lib;
inherit inputs;
inherit self;
}
(args.specialArgs or {});
modules = concatLists [
# This is used to pre-emptively set the hostPlatform for nixpkgs.
# Also, we set the system hostname here.
[
# self.nixosModules.user
]
(singleton {
networking.hostName = hostname;
nixpkgs.hostPlatform = system;
})
(flatten (
concatLists [
(singleton ./${hostname}/default.nix)
(singleton ./common.nix)
(
filter (hasSuffix "module.nix") (
map toString (listFilesRecursive ../modules)
)
)
]
))
];
};
in {
temperance = mkSystem {
system = "x86_64-linux";
hostname = "temperance";
};
hermit = mkSystem {
system = "x86_64-linux";
hostname = "hermit";
};
tower = mkSystem {
system = "aarch64-linux";
hostname = "tower";
};
}

View file

@ -2,47 +2,33 @@
lib,
pkgs,
...
}:
{
}: {
# Time Zone
time.timeZone = "Europe/Zurich";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console.keyMap = "uk";
security.polkit.enable = true;
programs.kdeconnect.enable = false;
programs.nix-ld.enable = false;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
services.fstrim.enable = lib.mkDefault true;
programs = {
nix-ld.enable = false;
gnupg.agent = {
services = {
fstrim.enable = lib.mkDefault true;
thermald.enable = true;
auto-cpufreq.enable = true;
printing.enable = true;
avahi = {
enable = true;
pinentryPackage = pkgs.pinentry-qt;
nssmdns4 = true;
openFirewall = true;
};
};
meta.system = {
isWorkstation = true;
isGraphical = true;
isLaptop = true;
};
modules = {
wms.wayland.enable = true;
# desktops.niri.enable = true;
theming = {
gtk.enable = true;
quickshell.enable = true;
};
desktops.hyprland.enable = true;
system = {
systemType = "laptop";
isGraphical = true;
boot = {
systemd-boot.enable = true;
lanzaboote.enable = true;
};
boot.systemd-boot.enable = true;
impermanence.enable = false;
services = {
owncloud.enable = true;
};
@ -55,27 +41,34 @@
};
};
programs = {
editors.helix.enable = true;
steam.enable = true;
editors = {
helix.enable = true;
};
# nushell.enable = true;
# starship.enable = true;
terminals = {
foot.enable = true;
};
};
sound.enable = true;
};
services = {
locate.enable = true;
kanata.enable = true;
uwsm.enable = false;
greetd.enable = false;
cups.enable = true;
media.mpd.enable = true;
uwsm.enable = true;
greetd.enable = true;
media.mpd = {
enable = true;
};
};
other = {
system.username = "cr";
};
other.system.username = "cr";
programs = {
ssh.enable = true;
btop.enable = true;
nh.enable = true;
thunar.enable = true;
};
};
system.stateVersion = "23.11";

View file

@ -1,7 +1,6 @@
{
config = {
boot.initrd.luks.devices."cryptroot".device =
"/dev/disk/by-uuid/10318654-ed20-43f6-885d-35366a427581";
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/10318654-ed20-43f6-885d-35366a427581";
fileSystems = {
"/boot" = {
device = "/dev/disk/by-uuid/5D7D-FC52";
@ -11,28 +10,17 @@
"/" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs";
options = [
"compress=zstd"
"noatime"
];
options = ["compress=zstd" "noatime"];
};
"/nix" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs";
options = [
"subvol=nix"
"compress=zstd"
"noatime"
];
options = ["subvol=nix" "compress=zstd" "noatime"];
};
"/home" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs";
options = [
"subvol=home"
"compress=zstd"
"noatime"
];
options = ["subvol=home" "compress=zstd" "noatime"];
};
};
# swapDevices = [

View file

@ -6,54 +6,16 @@
lib,
modulesPath,
...
}:
{
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd = {
availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
blacklistedKernelModules = [
"nouveau"
"nvidia"
"nvidia_drm"
"nvidia_modeset"
];
kernelParams = [ "mem_sleep_default=deep" ];
extraModulePackages = [ ];
extraModprobeConfig = ''
blacklist nouveau
options nouveau modeset=0
'';
};
# Not setting these udev rules seems to improve Zed's performance by a bit.
# services.udev.extraRules = ''
# # Remove NVIDIA USB xHCI Host Controller devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA USB Type-C UCSI devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA Audio devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA VGA/3D controller devices
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
# '';
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.kernelParams = ["mem_sleep_default=deep"];
boot.extraModulePackages = [];
# swapDevices =
# [ { device = "/dev/disk/by-uuid/3518272e-1051-41e2-a7f0-f5c744e46789"; }
@ -64,6 +26,8 @@
# (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.wlp59s0.useDHCP = lib.mkDefault true;
# Enable firmware updates via `fwupdmgr`.
services.fwupd.enable = lib.mkDefault true;

View file

@ -1 +1 @@
_: { imports = [ ./monitors.nix ]; }
_: {imports = [./monitors.nix];}

View file

@ -3,10 +3,8 @@
lib,
pkgs,
...
}:
let
}: let
xanmod_custom = callPackage ./xanmod.nix;
in
{
in {
boot.kernelPackages = xanmod_custom;
}

View file

@ -1,24 +1,29 @@
{pkgs, ...}: {
{
self,
pkgs,
...
}: {
environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
abook
aerc
aichat
alsa-utils
anki
asciinema
bacon
cachix
calc
cargo-info
# calibre
cbonsai
cinny-desktop
cmus
comma
difftastic
dua
element
element-desktop
emacs30-pgtk
evince
eza
fselect
firefox
fftw
gcc
gh
grc
@ -29,44 +34,67 @@
httpie
hyperfine
imagemagick
img2pdf
impala
imv
inetutils
jujutsu
just
jrnl
keepassxc
lazygit
libtool
librewolf
links2
linuxHeaders
mprocs
moc
mpv
ncmpcpp
neofetch
networkmanagerapplet
nicotine-plus
nil
nitch
obsidian
swww
microfetch
nmap
pamixer
pwvucontrol
pavucontrol
pdfarranger
pdfpc
pfetch
pidgin
playerctl
presenterm
polkit
pulsemixer
python3
ripgrep
rmpc
rusty-man
signal-desktop
smartmontools
telegram-desktop
texliveFull
tldr
thunderbird
tor-browser
trash-cli
typst
util-linux
v4l-utils
vesktop
vlc
wiki-tui
vscodium
weechat
wireguard-tools
xournalpp
zathura
zapzap
zip
zoxide
kakoune
kakoune-lsp
television
;
inherit (self.packages.${pkgs.stdenv.system}) helix;
};
}

View file

@ -3,35 +3,46 @@
lib,
pkgs,
...
}:
{
}: let
inherit
(
pkgs.callPackage ./kernel/xanmod.nix {
inherit lib;
inherit
(pkgs)
stdenv
fetchFromGitHub
kernelPatches
buildLinux
variant
;
}
)
xanmod_blox
;
in {
# Time Zone
time.timeZone = "Europe/Zurich";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console.keyMap = "us";
security.polkit.enable = true;
# boot.kernelPackages = pkgs.linuxPackagesFor xanmod_blox;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
programs.nix-ld.enable = true;
services = {
fstrim.enable = lib.mkDefault true;
udisks2.enable = true;
system76-scheduler = {
enable = true;
};
};
virtualisation.docker.enable = true;
meta = {
mainUser.gitSigningKey = "";
system = {
isWorkstation = true;
isGraphical = true;
};
};
modules = {
system = {
isGraphical = true;
impermanence.enable = true;
boot = {
systemd-boot.enable = true;
@ -53,11 +64,10 @@
nvidia.enable = true;
};
};
desktops.niri.enable = true;
desktops.hyprland.enable = true;
theming = {
gtk.enable = true;
quickshell.enable = true;
};
services = {
@ -69,8 +79,8 @@
enable = true;
musicDirectory = "/home/${config.modules.other.system.username}/cloud/media/Music";
};
# uwsm.enable = true;
# greetd.enable = true;
uwsm.enable = true;
greetd.enable = true;
};
other = {
system = {
@ -79,8 +89,8 @@
};
programs = {
ssh.enable = true;
btop.enable = true;
nh.enable = true;
thunar.enable = true;
};
};
}

View file

@ -1,7 +1,6 @@
{
config = {
boot.initrd.luks.devices."cryptroot".device =
"/dev/disk/by-uuid/96e8f3d6-8d2d-4e2d-abd9-3eb7f48fed02";
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/96e8f3d6-8d2d-4e2d-abd9-3eb7f48fed02";
fileSystems = {
"/boot" = {
device = "/dev/disk/by-uuid/B3AC-9050";
@ -11,49 +10,29 @@
"/" = {
device = "none";
fsType = "tmpfs";
options = [
"defaults"
"size=40%"
"mode=755"
];
options = ["defaults" "size=40%" "mode=755"];
};
"/nix" = {
device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548";
fsType = "btrfs";
options = [
"subvol=nix"
"compress=zstd"
"noatime"
];
options = ["subvol=nix" "compress=zstd" "noatime"];
};
"/persist" = {
device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548";
neededForBoot = true;
fsType = "btrfs";
options = [
"subvol=persist"
"compress=zstd"
"noatime"
];
options = ["subvol=persist" "compress=zstd" "noatime"];
};
"/home" = {
device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548";
fsType = "btrfs";
options = [
"subvol=home"
"compress=zstd"
"noatime"
];
options = ["subvol=home" "compress=zstd" "noatime"];
};
"/swap" = {
device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548";
fsType = "btrfs";
options = [
"subvol=swap"
"compress=lzo"
"noatime"
];
options = ["subvol=swap" "compress=lzo" "noatime"];
};
};
swapDevices = [

View file

@ -3,22 +3,13 @@
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot = {
initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"sd_mod"
];
initrd.kernelModules = [ ];
kernelModules = [ ];
extraModulePackages = [ ];
};
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
# 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
@ -27,5 +18,7 @@
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1 +1 @@
_: { imports = [ ./monitors.nix ]; }
_: {imports = [./monitors.nix];}

View file

@ -3,10 +3,8 @@
lib,
pkgs,
...
}:
let
}: let
xanmod_custom = callPackage ./xanmod.nix;
in
{
in {
boot.kernelPackages = xanmod_custom;
}

View file

@ -1,10 +1,8 @@
{ lib, ... }:
let
{lib, ...}: let
inherit (lib.kernel) no unset;
inherit (lib.attrsets) mapAttrs;
inherit (lib.modules) mkForce;
in
{
in {
boot.kernelPatches = [
{
name = "disable-unused-features";

View file

@ -4,8 +4,7 @@
buildLinux,
kernelPatches,
...
}:
let
}: let
pname = "linux-xanmod";
version = "6.11.5";
vendorSuffix = "xanmod1";
@ -59,17 +58,17 @@ let
};
})
# 1:1 taken from raf's custom kernel, check out his config for this.
.overrideAttrs
(oa: {
prePatch = oa.prePatch or "" + ''
.overrideAttrs (oa: {
prePatch =
(oa.prePatch or "")
+ ''
# bragging rights
echo "Replacing localversion with custom suffix"
substituteInPlace localversion \
--replace-fail "xanmod1" "blox"
'';
});
in
{
in {
inherit
xanmod_blox
;

View file

@ -1,20 +1,24 @@
{ pkgs, ... }:
{
{pkgs, ...}: let
in {
environment.systemPackages = builtins.attrValues {
inherit (pkgs)
inherit
(pkgs)
alsa-utils
anki
asciinema
beets
blender
brave
bubblewrap
cachix
calc
calibre
carapace
cinny-desktop
comma
digikam
difftastic
dnsutils
devenv
element-desktop
evince
gcc
gh
@ -29,38 +33,48 @@
impala
imv
inetutils
inshellisense
joplin-desktop
jujutsu
julia
just
keepassxc
lazygit
librewolf
libtool
logiops
mergiraf
mpv
nautilus
nextcloud-client
nheko
nicotine-plus
oculante
obsidian
swww
pandoc
pavucontrol
pdfarranger
picard
polkit
pulsemixer
python3
pwvucontrol
qbittorrent
r2modman
radare2
ripgrep
rmpc
ruby_3_2
signal-desktop
starship
strawberry
telegram-desktop
texliveFull
thunderbird
topiary
tor-browser
trash-cli
tutanota-desktop
typst
vesktop
vivid
vscodium
walker
wayneko
wireguard-tools
xdg-utils
xournalpp
@ -68,12 +82,10 @@
zathura
zotero
zoxide
curl
git
wget
unzip
zip
util-linux
;
inherit
(pkgs.wineWowPackages)
waylandFull
;
};
}

View file

@ -2,15 +2,16 @@
lib,
pkgs,
...
}:
{
}: {
# Time Zone
time.timeZone = "Europe/Vienna";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console.keyMap = "uk";
security.polkit.enable = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
# boot.kernelPackages = pkgs.linuxPackagesFor xanmod_blox;
# boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
programs.nix-ld.enable = true;
users.users."cr".openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPiRe9OH/VtWFWyy5QbAVcN7CLxr4zUtRCwmxD6aeN6"
@ -28,17 +29,8 @@
locate.enable = true;
};
system = {
boot = {
grub.enable = true;
timeout = 30;
};
services = {
forgejo.enable = true;
radicle.enable = true;
grafana.enable = true;
prometheus.enable = true;
matrix.enable = true;
};
boot.grub.enable = true;
services.forgejo.enable = true;
programs = {
editors = {
helix.enable = true;

View file

@ -8,7 +8,7 @@
"/" = {
device = "/dev/disk/by-uuid/3a781f2e-290a-4609-9035-a93374459def";
fsType = "ext4";
options = [ "noatime" ];
options = ["noatime"];
};
};
}

View file

@ -2,24 +2,17 @@
lib,
modulesPath,
...
}:
{
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot = {
initrd.availableKernelModules = [
"xhci_pci"
"virtio_scsi"
"sr_mod"
];
initrd.kernelModules = [ ];
kernelModules = [ ];
extraModulePackages = [ ];
};
boot.initrd.availableKernelModules = ["xhci_pci" "virtio_scsi" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
swapDevices = [ ];
swapDevices = [];
# 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

View file

@ -1,7 +1,7 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
environment.systemPackages = builtins.attrValues {
inherit (pkgs)
inherit
(pkgs)
;
};
}

View file

@ -1,51 +0,0 @@
{
lib,
pkgs,
...
}:
{
# Time Zone
time.timeZone = "Europe/Zurich";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console.keyMap = "uk";
programs.nix-ld.enable = false;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
services = {
fstrim.enable = lib.mkDefault true;
thermald.enable = true;
};
modules = {
desktops.hyprland.enable = true;
system = {
boot.systemd-boot.enable = true;
impermanence.enable = false;
hardware = {
intel.enable = true;
};
programs = {
editors = {
helix.enable = true;
};
terminals = {
foot.enable = true;
};
};
};
services = {
kanata.enable = true;
};
other = {
system.username = "cr";
};
programs = {
ssh.enable = true;
btop.enable = true;
nh.enable = true;
thunar.enable = true;
};
};
system.stateVersion = "23.11";
}

View file

@ -1,8 +0,0 @@
_: {
imports = [
./configuration.nix
./programs.nix
./hardware-configuration.nix
./hardware
];
}

View file

@ -1,45 +0,0 @@
{
config = {
boot.initrd.luks.devices."cryptroot".device =
"/dev/disk/by-uuid/10318654-ed20-43f6-885d-35366a427581";
fileSystems = {
"/boot" = {
device = "/dev/disk/by-uuid/5D7D-FC52";
fsType = "vfat";
};
"/" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs";
options = [
"compress=zstd"
"noatime"
];
};
"/nix" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs";
options = [
"subvol=nix"
"compress=zstd"
"noatime"
];
};
"/home" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs";
options = [
"subvol=home"
"compress=zstd"
"noatime"
];
};
};
# swapDevices = [
# {
# device = "/swap/swapfile";
# size = (1024 * 16) + (1024 * 2);
# }
# ];
};
}

View file

@ -1,48 +0,0 @@
{
config,
lib,
modulesPath,
...
}:
{
imports = [
# (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd = {
availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
blacklistedKernelModules = [
"nouveau"
"nvidia"
"nvidia_drm"
"nvidia_modeset"
];
kernelParams = [ "mem_sleep_default=deep" ];
extraModulePackages = [ ];
extraModprobeConfig = ''
blacklist nouveau
options nouveau modeset=0
'';
};
# Earlier font setup
console.earlySetup = true;
# Enable firmware updates via `fwupdmgr`.
services.fwupd.enable = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1 +0,0 @@
_: { imports = [ ./monitors.nix ]; }

View file

@ -1,16 +0,0 @@
_: {
modules.system.hardware.monitors = {
eDP-1 = {
resolution = {
x = 1920;
y = 1080;
};
scale = 1;
refreshRate = 60;
position = {
x = 1920;
y = 0;
};
};
};
}

View file

@ -1,40 +0,0 @@
{
self,
pkgs,
...
}:
{
environment.systemPackages = builtins.attrValues {
inherit (pkgs)
calc
comma
difftastic
evince
eza
gcc
gh
grc
gparted
git
httpie
imagemagick
img2pdf
imv
inetutils
just
lazygit
libtool
librewolf
linuxHeaders
mpv
networkmanagerapplet
microfetch
nmap
pfetch
ripgrep
smartmontools
util-linux
wireguard-tools
;
};
}

View file

@ -1,465 +0,0 @@
{
inputs,
lib,
pkgs,
...
}:
let
inherit (lib.attrsets) mapAttrs' nameValuePair;
inherit (lib) getFlakePkg;
helix = pkgs.helix.overrideAttrs (
finalAttrs: _: {
version = "25.09.2";
src = pkgs.fetchzip {
url = "https://github.com/faukah/helix/releases/download/${finalAttrs.version}/helix-${finalAttrs.version}-source.tar.xz";
hash = "sha256-VT0SKsrsGFWaRFwMRMP0kxh+Br0LU15mdP9LfKxANBQ=";
stripRoot = false;
};
doInstallCheck = false;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (helix) src;
hash = "sha256-1xikOKTtlhhmgPNhycTLRJBueahREhylucVc91tp0CU=";
};
}
);
toml = pkgs.formats.toml { };
languages =
let
inherit (lib.meta) getExe getExe';
nil = getFlakePkg inputs.nil;
new-deadnix = pkgs.deadnix.overrideAttrs (
_: _: {
version = "unstable-15-07-2025";
src = pkgs.fetchFromGitHub {
owner = "astro";
repo = "deadnix";
rev = "d75457b95d7cfa82fcd60970939f76fccfce19e5";
hash = "sha256-O/z2neAXL8JNkGosvxC+DyZnnJ8zYP9XHApxHVmlzfY=";
};
doInstallCheck = false;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (new-deadnix) src;
hash = "sha256-O8yhqyPflOvQXAA19k1XpbrHysgV5VNWLBX0l5Q5GkM=";
};
meta.mainProgram = "nil";
}
);
in
{
language =
let
mark = lang: {
command = getExe pkgs.deno;
args = [
"fmt"
"-"
"--ext"
lang
];
};
in
[
{
name = "bash";
auto-format = true;
formatter = {
command = getExe pkgs.shfmt;
args = [
"-i"
"2"
];
};
}
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = [
"clj"
"cljs"
"cljc"
"clje"
"cljr"
"cljx"
"edn"
"boot"
"yuck"
];
}
{
name = "cmake";
auto-format = true;
language-servers = [ "cmake-language-server" ];
formatter = {
command = getExe pkgs.cmake-format;
args = [ "-" ];
};
}
{
name = "javascript";
auto-format = true;
# language-servers = [
# "dprint"
# "typescript-language-server"
# ];
}
{
name = "json";
formatter = mark "json";
}
{
name = "markdown";
auto-format = true;
formatter = mark "md";
language-servers = [ "taplo" ];
}
{
name = "nix";
language-servers = [
"nil"
"deadnix"
];
}
{
name = "qml";
language-servers = [ "qmlls" ];
}
{
name = "python";
auto-format = true;
language-servers = [
"basedpyright"
"ruff"
];
}
{
name = "typescript";
auto-format = true;
# language-servers = [
# "dprint"
# "typescript-language-server"
# ];
}
{
name = "rust";
}
{
name = "c";
auto-format = true;
language-servers = [ "clangd" ];
}
{
name = "zig";
auto-format = true;
}
{
name = "c";
}
];
language-server = {
bash-language-server = {
command = getExe pkgs.bash-language-server;
args = [ "start" ];
};
rust-analyzer = {
command = getExe pkgs.rust-analyzer;
config.rust-analyzer = {
procMacro.enable = true;
cargo = {
loadOutDirsFromCheck = true;
features = "all";
};
assist = {
preferSelf = true;
};
check = {
command = "clippy";
extraArgs = [
"--"
"-W"
"clippy::pedantic"
"-W"
"clippy::nursery"
"-W"
"clippy::perf"
];
};
lens = {
references = true;
methodReferences = true;
};
completion.autoimport.enable = true;
experimental.procAttrMacros = true;
interpret.tests = true;
};
};
clangd = {
command = "${pkgs.clang-tools}/bin/clangd";
clangd.fallbackFlags = [ "-std=c++2b" ];
};
cmake-language-server = {
command = getExe pkgs.cmake-language-server;
};
deno-lsp = {
command = getExe pkgs.deno;
args = [ "lsp" ];
environment.NO_COLOR = "1";
config.deno = {
enable = true;
lint = true;
unstable = true;
suggest = {
completeFunctionCalls = false;
imports = {
hosts."https://deno.land" = true;
};
};
inlayHints = {
enumMemberValues.enabled = true;
functionLikeReturnTypes.enabled = true;
parameterNames.enabled = "all";
parameterTypes.enabled = true;
propertyDeclarationTypes.enabled = true;
variableTypes.enabled = true;
};
};
};
# dprint = {
# command = getExe pkgs.dprint;
# args = [ "lsp" ];
# };
nil = {
command = getExe nil;
config.nil = {
formatting.command = [ "${getExe pkgs.nixfmt}" ];
diagnostics = {
bindingEndHintMinLines = 10;
};
nix.flake = {
autoArchive = true;
autoEvalInputs = true;
nixpkgsInputName = "nixpkgs";
};
};
};
deadnix = {
command = getExe new-deadnix;
};
typescript-language-server = {
command = getExe pkgs.typescript-language-server;
args = [ "--stdio" ];
config = {
typescript-language-server.source = {
addMissingImports.ts = true;
fixAll.ts = true;
organizeImports.ts = true;
removeUnusedImports.ts = true;
sortImports.ts = true;
};
};
};
ruff = {
command = getExe pkgs.ruff;
args = [ "server" ];
};
qmlls.command = getExe' pkgs.kdePackages.qtdeclarative "qmlls";
basedpyright.command = "${pkgs.basedpyright}/bin/basedpyright-langserver";
vscode-css-language-server = {
command = "${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server";
args = [ "--stdio" ];
config = {
provideFormatter = true;
css.validate.enable = true;
scss.validate.enable = true;
};
};
zls = {
command = getExe pkgs.zls;
config = {
enable_build_on_save = true;
build_on_save_args = [
"check"
"-fincremental"
"--watch"
];
enable_autofix = false;
warn_style = true;
highlight_global_var_declarations = true;
};
};
};
};
themes = {
rose_pine_transparent = {
inherits = "rose_pine";
"ui.background" = { };
};
rose_pine_dawn_transparent = {
inherits = "rose_pine_dawn";
"ui.background" = { };
};
nightfox_transparent = {
inherits = "nightfox";
"ui.background" = { };
};
nord_transparent = {
inherits = "nord";
"ui.background" = { };
};
};
settings = {
theme = "gruvbox_dark_hard";
editor = {
cursorline = true;
color-modes = true;
true-color = true;
indent-guides.render = true;
lsp = {
enable = true;
auto-signature-help = true;
display-inlay-hints = true;
display-messages = true;
display-progress-messages = true;
snippets = true;
};
file-picker = {
hidden = true;
};
line-number = "relative";
completion-timeout = 5;
clipboard-provider = "wayland";
completion-trigger-len = 1;
mouse = true;
bufferline = "multiple";
popup-border = "none";
soft-wrap.enable = true;
word-completion = {
enable = true;
trigger-length = 2;
};
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
statusline = {
left = [
"spinner"
"diagnostics"
"file-name"
];
right = [
"file-base-name"
"position"
];
diagnostics = [
"warning"
"error"
];
workspace-diagnostics = [
"warning"
"error"
];
};
gutters.layout = [
"diff"
"diagnostics"
"line-numbers"
];
};
keys = {
normal = {
space = {
g = [
":new"
":buffer-close!"
":redraw"
];
i = ":toggle lsp.display-inlay-hints";
u = ":toggle file-picker.hidden";
};
esc = [
"collapse_selection"
"keep_primary_selection"
"normal_mode"
];
A-H = "goto_previous_buffer";
A-L = "goto_next_buffer";
A-w = ":buffer-close";
A-f = ":format";
A-r = ":reload";
A-x = "extend_to_line_bounds";
X = [
"extend_line_up"
"extend_to_line_bounds"
];
";" = "flip_selections";
"A-;" = "collapse_selection";
# Kakoune-like config
H = "extend_char_left";
J = "extend_line_down";
K = "extend_line_up";
L = "extend_char_right";
};
select = {
A-x = "extend_to_line_bounds";
X = [
"extend_line_up"
"extend_to_line_bounds"
];
g = {
e = "goto_file_end";
};
};
};
};
in
{
packages = builtins.attrValues {
inherit helix;
inherit (pkgs)
tinymist
taplo
kdlfmt
gopls
asm-lsp
;
};
files = {
".config/helix/config.toml".source = toml.generate "helix-config.toml" settings;
".config/helix/languages.toml".source = toml.generate "helix-languages.toml" languages;
}
// mapAttrs' (
name: value:
nameValuePair ".config/helix/themes/${name}.toml" {
source = toml.generate "helix-theme-${name}.toml" value;
}
) themes;
# osConfig.environment.variables.EDITOR = "hx";
}

View file

@ -1,38 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
inherit (builtins) filter;
inherit (config.meta.mainUser) username;
inherit (lib.modules) mkForce;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
in
{
imports = [
inputs.hjem.nixosModules.default
];
config = {
hjem = {
clobberByDefault = true;
linker = pkgs.smfh;
users.${username} = {
enable = true;
user = username;
directory = config.users.users.${username}.home;
clobberFiles = mkForce true;
};
extraModules = (listFilesRecursive ./.) |> filter (hasSuffix ".hjem.nix");
specialArgs = {
inherit inputs;
};
};
};
}

View file

@ -1 +0,0 @@

View file

@ -1,337 +0,0 @@
#! /usr/bin/env nu
$env.config = {
bracketed_paste: true
buffer_editor: "hx"
datetime_format: {}
edit_mode: vi
error_style: fancy
float_precision: 2
footer_mode: 25
render_right_prompt_on_last_line: false
show_banner: false
use_ansi_coloring: true
use_kitty_protocol: true
shell_integration: {
osc2: false
osc7: true
osc8: true
osc9_9: false
osc133: true
osc633: true
reset_application_mode: true
}
}
$env.config.color_config = {
binary: '#b48ead'
block: '#81a1c1'
cell-path: '#e5e9f0'
closure: '#88c0d0'
custom: '#8fbcbb'
duration: '#ebcb8b'
float: '#bf616a'
glob: '#8fbcbb'
int: '#b48ead'
list: '#88c0d0'
nothing: '#bf616a'
range: '#ebcb8b'
record: '#88c0d0'
string: '#a3be8c'
bool: {|| if $in { '#88c0d0' } else { '#ebcb8b' } }
datetime: {|| (date now) - $in |
if $in < 1hr {
{ fg: '#bf616a' attr: 'b' }
} else if $in < 6hr {
'#bf616a'
} else if $in < 1day {
'#ebcb8b'
} else if $in < 3day {
'#a3be8c'
} else if $in < 1wk {
{ fg: '#a3be8c' attr: 'b' }
} else if $in < 6wk {
'#88c0d0'
} else if $in < 52wk {
'#81a1c1'
} else { 'dark_gray' }
}
filesize: {|e|
if $e == 0b {
'#e5e9f0'
} else if $e < 1mb {
'#88c0d0'
} else {{ fg: '#81a1c1' }}
}
shape_and: { fg: '#b48ead' attr: 'b' }
shape_binary: { fg: '#b48ead' attr: 'b' }
shape_block: { fg: '#81a1c1' attr: 'b' }
shape_bool: '#88c0d0'
shape_closure: { fg: '#88c0d0' attr: 'b' }
shape_custom: '#a3be8c'
shape_datetime: { fg: '#88c0d0' attr: 'b' }
shape_directory: '#88c0d0'
shape_external: '#88c0d0'
shape_external_resolved: '#88c0d0'
shape_externalarg: { fg: '#a3be8c' attr: 'b' }
shape_filepath: '#88c0d0'
shape_flag: { fg: '#81a1c1' attr: 'b' }
shape_float: { fg: '#bf616a' attr: 'b' }
shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' }
shape_glob_interpolation: { fg: '#88c0d0' attr: 'b' }
shape_globpattern: { fg: '#88c0d0' attr: 'b' }
shape_int: { fg: '#b48ead' attr: 'b' }
shape_internalcall: { fg: '#88c0d0' attr: 'b' }
shape_keyword: { fg: '#b48ead' attr: 'b' }
shape_list: { fg: '#88c0d0' attr: 'b' }
shape_literal: '#81a1c1'
shape_match_pattern: '#a3be8c'
shape_matching_brackets: { attr: 'u' }
shape_nothing: '#bf616a'
shape_operator: '#ebcb8b'
shape_or: { fg: '#b48ead' attr: 'b' }
shape_pipe: { fg: '#b48ead' attr: 'b' }
shape_range: { fg: '#ebcb8b' attr: 'b' }
shape_raw_string: { fg: '#8fbcbb' attr: 'b' }
shape_record: { fg: '#88c0d0' attr: 'b' }
shape_redirection: { fg: '#b48ead' attr: 'b' }
shape_signature: { fg: '#a3be8c' attr: 'b' }
shape_string: '#a3be8c'
shape_string_interpolation: { fg: '#88c0d0' attr: 'b' }
shape_table: { fg: '#81a1c1' attr: 'b' }
shape_vardecl: { fg: '#81a1c1' attr: 'u' }
shape_variable: '#b48ead'
foreground: '#e5e9f0'
background: '#2e3440'
cursor: '#e5e9f0'
empty: '#81a1c1'
header: { fg: '#a3be8c' attr: 'b' }
hints: '#4c566a'
leading_trailing_space_bg: { attr: 'n' }
row_index: { fg: '#a3be8c' attr: 'b' }
search_result: { fg: '#bf616a' bg: '#e5e9f0' }
separator: '#e5e9f0'
}
$env.config.ls = {
clickable_links: true
use_ls_colors: true
}
$env.config.rm.always_trash = true
$env.config.table = {
header_on_separator: true
footer_inheritance: true
index_mode: always
mode: compact
missing_value_symbol: kek
padding: {left: 1 right: 1}
show_empty: false
trim: {
methodology: wrapping
truncating_suffix: "..."
wrapping_try_keep_words: true
}
}
$env.config.explore = {
command_bar_text: {fg: "#C4C9C6"}
highlight: {fg: black bg: yellow}
status: {
error: {fg: white bg: red}
warn: {}
info: {}
}
status_bar_background: {fg: "#1D1F21" bg: "#C4C9C6"}
table: {
split_line: {fg: "#404040"}
selected_cell: {bg: light_blue}
selected_row: {}
selected_column: {}
}
}
$env.config.history = {
file_format: sqlite
isolation: false
max_size: 100_000
sync_on_enter: true
}
$env.config.cursor_shape = {
vi_insert: line
vi_normal: block
}
$env.config.hooks = {
command_not_found: {|| }
pre_execution: [
{
let prompt = commandline | str trim
if ($prompt | is-empty) {
return
}
print $"(ansi title)($prompt) — nu(char bel)"
}
]
pre_prompt: [
{||
if not ($env.PWD | path join .envrc | path exists) {
return
}
if (which direnv | is-empty) {
return
}
direnv export json | from json | default {} | load-env
$env.PATH = $env.PATH | split row (char env_sep)
}
]
}
let menus = [
{
name: completion_menu
only_buffer_difference: false
marker: $"(ansi yellow)╋ "
type: {
layout: columnar
columns: 3
min_completion_width: 0
max_completion_width: 150
max_completion_height: 25
padding: 0
border: false
cursor_offset: 0
description_mode: "prefer_right"
min_description_width: 0
max_description_width: 50
max_description_height: 10
description_offset: 1
correct_cursor_pos: true
}
style: {
text: white
selected_text: white_reverse
description_text: yellow
match_text: { attr: u }
selected_match_text: { attr: ur }
}
}
{
name: history_menu
only_buffer_difference: true
marker: $env.PROMPT_INDICATOR
type: {
layout: list
page_size: 10
}
style: {
text: white
selected_text: white_reverse
}
}
]
$env.config.menus = $env.config.menus
| where name not-in ($menus | get name)
| append $menus
$env.config.keybindings ++= [
{
name: copy_commandline
modifier: alt
keycode: char_c
mode: [vi_normal vi_insert]
event: {
send: executehostcommand
cmd: 'commandline | nu-highlight | $"```ansi\n($in)\n```" | wl-copy $in'
}
}
]
let env_vars_file = '/tmp/nushell-env-vars'
if not ($env_vars_file | path exists) {
open /etc/profile
| lines
| select 11
| str trim
| split column ' ' del path
| get path.0
| open $in
| str trim
| lines
| str replace --all '$HOME' $env.HOME
| str replace --all '$USER' $env.USER
| parse 'export {name}="{value}"'
| transpose --header-row --as-record
| tee { load-env $in }
| to nuon
| save --force $env_vars_file} else {
open $env_vars_file
| from nuon
| load-env $in
}
let converter = {
from_string: {|s| $s | split row (char esep) | path expand --no-symlink }
to_string: {|v| $v | path expand --no-symlink | str join (char esep) }
}
let addition = [
XDG_DATA_DIRS
XDG_CONFIG_DIRS
XCURSOR_PATH
TERMINFO_DIRS
QT_PLUGIN_PATH
QTWEBKIT_PLUGIN_PATH
QML2_IMPORT_PATH
INFOPATH
LIBEXEC_PATH
GTK_PATH
GIO_EXTRA_MODULES
CUPS_DATADIR
]
| each { {($in): $converter} }
| into record
$env.ENV_CONVERSIONS = $env.ENV_CONVERSIONS | merge $addition
$env.EDITOR = "hx"
def switch [] {
nh os switch --file ($env.NH_FLAKE | path join default.nix) (open /etc/hostname | str trim)
}
def --env y [...args] {
let tmp = (mktemp -t "yazi-cwd.XXXXXX")
yazi ...$args --cwd-file $tmp
let cwd = (open $tmp)
if $cwd != "" and $cwd != $env.PWD {
cd $cwd
}
rm -fp $tmp
}
# fix sudo by prepending /run/wrappers/bin to the PATH.
$env.PATH = ($env.PATH | split row (char esep) | prepend '/run/wrappers/bin')
$env.PATH = ($env.PATH | split row (char esep) | prepend '/etc/profiles/per-user/cr/bin')
carapace _carapace nushell
| save -f ($nu.user-autoload-dirs | path join carapace.nu)
source ./prompt.nu
source ./zoxide.nu

View file

@ -1,25 +0,0 @@
{
pkgs,
...
}:
{
packages = with pkgs; [
nushell
inshellisense
carapace
fish
];
environment.sessionVariables = {
CARAPACE_BRIDGES = "fish,inshellisense,carapace,clap,bash";
CARAPACE_MATCH = 1;
};
files = {
".config/nushell/config.nu".source = ./config.nu;
".config/nushell/prompt.nu".source = ./prompt.nu;
".config/nushell/zoxide.nu".source = ./zoxide.nu;
};
}

View file

@ -1,73 +0,0 @@
use std null_device
export-env {
load-env {
PROMPT_COMMAND: {||
let exit_code = $env.LAST_EXIT_CODE
mut path_segment = $env.PWD | path basename
let exit_code_segment = if ($exit_code == 0) {
""
} else {
$"(ansi yellow)━┫(ansi red)($exit_code)(ansi yellow)┣━"
}
[$"(ansi yellow)┏" $exit_code_segment "━ " $path_segment "\n"] | str join
}
TRANSIENT_PROMPT_COMMAND: {||
let path_segment = $env.PWD | path basename
let exit_code_segment = if ($env.LAST_EXIT_CODE == 0) {
""
} else {
$"(ansi yellow)━┫(ansi red)($env.LAST_EXIT_CODE)(ansi yellow)┣━"
}
[$"(ansi yellow)━" $exit_code_segment "━ " $path_segment] | str join
}
PROMPT_INDICATOR_VI_INSERT: $"(ansi yellow)┃ "
PROMPT_INDICATOR_VI_NORMAL: $"(ansi yellow)┋ "
PROMPT_MULTILINE_INDICATOR: $"(ansi yellow)┃ "
TRANSIENT_PROMPT_INDICATOR_VI_INSERT: " "
TRANSIENT_PROMPT_INDICATOR_VI_NORMAL: " "
TRANSIENT_PROMPT_MULTILINE_INDICATOR: $"(ansi yellow)┃ "
config: (
$env.config? | default {} | merge {
render_right_prompt_on_last_line: true
}
)
PROMPT_COMMAND_RIGHT: {||
let jj_status = try {
jj --quiet --color always --ignore-working-copy log --no-graph --revisions @ --template '
separate(
" ",
if(empty, label("empty", "(empty)")),
coalesce(
surround(
"\"",
"\"",
if(
description.first_line().substr(0, 24).starts_with(description.first_line()),
description.first_line().substr(0, 24),
description.first_line().substr(0, 23) ++ "…"
)
),
label(if(empty, "empty"), description_placeholder)
),
bookmarks.join(", "),
change_id.shortest(),
commit_id.shortest(),
if(conflict, label("conflict", "(conflict)")),
if(divergent, label("divergent prefix", "(divergent)")),
if(hidden, label("hidden prefix", "(hidden)")),
)
' err> $null_device
} catch {
""
}
$jj_status
}
}
}

View file

@ -1,54 +0,0 @@
# Initialize hook to add new entries to the database.
export-env {
$env.config = (
$env.config?
| default {}
| upsert hooks { default {} }
| upsert hooks.env_change { default {} }
| upsert hooks.env_change.PWD { default [] }
)
let __zoxide_hooked = (
$env.config.hooks.env_change.PWD | any { try { get __zoxide_hook } catch { false } }
)
if not $__zoxide_hooked {
$env.config.hooks.env_change.PWD = ($env.config.hooks.env_change.PWD | append {
__zoxide_hook: true,
code: {|_, dir| zoxide add -- $dir}
})
}
}
def zoxide_completions [context: string] {
let parts = $context | split row " " | skip 1
{
options: {
sort: false,
completion_algorithm: substring,
case_sensitive: false,
},
completions: (^zoxide query --list --exclude $env.PWD -- ...$parts | lines | first 10)
}
}
# Jump to a directory using only keywords.
def --env --wrapped __zoxide_z [...rest: string@zoxide_completions] {
let path = match $rest {
[] => {'~'},
[ '-' ] => {'-'},
[ $arg ] if ($arg | path expand | path type) == 'dir' => {$arg}
_ => {
zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n"
}
}
cd $path
}
# Jump to a directory using interactive search.
def --env --wrapped __zoxide_zi [...rest:string] {
cd $'(zoxide query --interactive -- ...$rest | str trim -r -c "\n")'
}
# =============================================================================
alias z = __zoxide_z
alias zi = __zoxide_zi

View file

@ -1,40 +0,0 @@
{
lib,
pkgs,
...
}:
let
inherit (builtins) attrValues;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.strings) concatStringsSep;
btop-settings = {
truecolor = "True";
vim_keys = "True";
rounded_corners = "True";
update_ms = "100";
graph_symbol = "braille";
cpu_single_graph = "True";
clock_format = "%X";
use_fstab = "True";
io_mode = "True";
net_sync = "True";
net_iface = "enp4s0";
log_level = "ERROR";
color_theme = "gruvbox_dark";
};
btop-no-desktop-entry = pkgs.btop.overrideAttrs (prev: {
postInstall = ''
${prev.postInstall or ""}
rm -rf $out/share/applications/*.desktop
'';
});
in
{
packages = attrValues { inherit btop-no-desktop-entry; };
files.".config/btop/btop.conf".text =
concatStringsSep "\n" <| mapAttrsToList (name: value: "${name} = ${toString value}") btop-settings;
}

View file

@ -1,80 +0,0 @@
{
inputs,
lib,
osConfig,
...
}:
let
inherit (lib.lists) elem singleton;
inherit (lib.meta) getExe;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.strings) concatStringsSep;
inherit (lib.modules) mkIf;
inherit (lib) getFlakePkg;
inherit (osConfig.meta.system) isGraphical;
inherit (osConfig.meta.mainUser.defaultShell) name package;
ghostty = (getFlakePkg inputs.ghostty).override {
optimize = "ReleaseFast";
enableX11 = false;
enableWayland = true;
};
# Shell integration for ghostty only supports
# bash, fish and zsh for now.
shell-integration =
if
elem name [
"bash"
"fish"
"zsh"
]
then
name
else
"none";
ghostty-settings = {
font-size = 14;
# font-family = "JetBrainsMonoNerdFont";
font-family = "Berkeley Mono";
app-notifications = "no-clipboard-copy";
background-opacity = 1.0;
bold-is-bright = true;
confirm-close-surface = "false";
cursor-style-blink = "false";
gtk-single-instance = "true";
gtk-tabs-location = "top";
gtk-wide-tabs = false;
mouse-hide-while-typing = "true";
resize-overlay-duration = "0s";
shell-integration-features = "cursor,sudo,no-title";
term = "xterm-256color";
theme = "GruvboxDarkHard";
window-decoration = "none";
window-padding-balance = true;
window-padding-x = 2;
window-padding-y = 2;
window-theme = "system";
cursor-style = "block";
gtk-titlebar = false;
# Whether to automatically copy selected text to the clipboard. true will prefer to copy to the selection clipboard, otherwise it will copy to the system clipboard.
# The value clipboard will always copy text to the selection clipboard as well as the system clipboard.
copy-on-select = "clipboard";
inherit shell-integration;
command = getExe package;
};
in
{
config = mkIf isGraphical {
packages = singleton ghostty;
files.".config/ghostty/config".text =
concatStringsSep "\n"
<| mapAttrsToList (name: value: "${name} = ${toString value}") ghostty-settings;
};
}

View file

@ -2,26 +2,49 @@
config,
lib,
...
}:
let
}: let
inherit (builtins) elemAt;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types)
enum
listOf
str
nullOr
bool
;
inherit (lib.lists) elem;
inherit (lib.types) enum listOf str nullOr bool package;
in {
imports = [
# configuration options for nixos activation scripts
# ./activation.nix
# boot/impermanence mounts
# ./boot.nix
# ./impermanence.nix
# network and overall hardening
./networking
# ./security.nix
# ./encryption.nix
# filesystems
# ./fs.nix
# package and program related options
# ./services
./programs
# monitor configuration
./monitors.nix
];
inherit (config.modules.system) systemType;
in
{
options.modules.system = {
mainUser = mkOption {
type = enum config.modules.system.users;
default = elemAt config.modules.system.users 0;
description = ''
The username of the main user for your system.
In case of a multiple systems, this will be the user with priority in ordered lists and enabled options.
'';
};
users = mkOption {
type = listOf str;
default = [ "cr" ];
default = ["charlie"];
description = "A list of users on the system.";
};
@ -34,37 +57,10 @@ in
'';
};
systemType = mkOption {
type = nullOr (enum [
"desktop"
"laptop"
"server"
]);
default = null;
description = ''
The type of the current system. This is used to determine whether things like graphical
environments and power-saving programs should be installed or not.
'';
};
isGraphical = mkOption {
type = bool;
default = elem systemType [
"desktop"
"laptop"
];
description = ''
Whether the current system is a graphical system.
'';
};
yubikeySupport = {
enable = mkEnableOption "yubikey support";
deviceType = mkOption {
type = nullOr (enum [
"NFC5"
"nano"
]);
type = nullOr (enum ["NFC5" "nano"]);
default = null;
description = "A list of device models to enable Yubikey support for";
};
@ -76,7 +72,6 @@ in
impermanence = {
enable = mkEnableOption "Enable Impermanence";
};
video = {
enable = mkEnableOption "video drivers and programs that require a graphical user interface";
nvidia = mkEnableOption "Nvidia graphics drivers";
@ -94,9 +89,18 @@ in
enable = mkEnableOption "printing";
extraDrivers = mkOption {
type = listOf str;
default = [ ];
default = [];
description = "A list of extra drivers to enable for printing";
};
"3d" = {
enable = mkEnableOption "3D printing suite";
extraPrograms = mkOption {
type = listOf package;
default = [];
description = "A list of extra programs to enable for 3D printing";
};
};
};
};
}

View file

@ -1,18 +1,10 @@
{ lib, ... }:
let
{lib, ...}: let
inherit (lib.options) mkOption;
inherit (lib.types)
submodule
int
ints
number
attrsOf
;
in
{
inherit (lib.types) submodule int ints number attrsOf;
in {
options.modules.system.hardware.monitors = mkOption {
description = "\n List of monitors to use\n ";
default = { };
default = {};
type = attrsOf (submodule {
options = {
resolution = mkOption {

View file

@ -0,0 +1,7 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
in {
options.modules.system.networking = {
nftbles.enable = mkEnableOption "Nftables firewall";
};
}

View file

@ -1,9 +1,7 @@
{ lib, ... }:
let
{lib, ...}: let
inherit (lib.types) str enum;
inherit (lib.options) mkEnableOption mkOption;
in
{
in {
options.modules.system.programs = {
editors = {
helix.enable = mkEnableOption "Helix text editor";
@ -29,42 +27,23 @@ in
};
default = {
terminal = mkOption {
type = enum [
"foot"
"kitty"
];
type = enum ["foot" "kitty"];
default = "foot";
};
fileManager = mkOption {
type = enum [
"thunar"
"dolphin"
"nemo"
];
type = enum ["thunar" "dolphin" "nemo"];
default = "thunar";
};
browser = mkOption {
type = enum [
"firefox"
"librewolf"
"chromium"
];
type = enum ["firefox" "librewolf" "chromium"];
default = "firefox";
};
editor = mkOption {
type = enum [
"neovim"
"helix"
"emacs"
];
type = enum ["neovim" "helix" "emacs"];
default = "emacs";
};
launcher = mkOption {
type = enum [
"anyrun"
"rofi"
"wofi"
];
type = enum ["anyrun" "rofi" "wofi"];
default = "anyrun";
};
};

View file

@ -1,8 +1,7 @@
{ pkgs, ... }:
let
key = pkgs.writeText "signingkey" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPiRe9OH/VtWFWyy5QbAVcN7CLxr4zUtRCwmxD6aeN6";
in
{
{pkgs, ...}: let
key =
pkgs.writeText "signingkey" "ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw==";
in {
programs.git = {
enable = true;
lfs.enable = true;

8
modules/other/module.nix Normal file
View file

@ -0,0 +1,8 @@
_: {
imports = [
./system.nix
./xdg.nix
./git.nix
./users.nix
];
}

View file

@ -1,9 +1,7 @@
{ lib, ... }:
let
{lib, ...}: let
inherit (lib.options) mkOption;
inherit (lib.types) str;
in
{
in {
options.modules.other.system = {
username = mkOption {
description = "username for this system";

View file

@ -2,19 +2,19 @@
config,
lib,
pkgs,
self,
...
}:
let
}: let
inherit (builtins) elemAt;
inherit (lib.options) mkOption;
inherit (lib.types) listOf str package;
inherit (lib.types) listOf str;
inherit (config.meta.mainUser) username;
in
{
in {
options.meta = {
users = mkOption {
type = listOf str;
default = [ "cr" ];
default = ["cr"];
description = ''
A list of users on a system.
'';
@ -27,36 +27,17 @@ in
The main user for each system. This is the first element of the list of users by default.
'';
};
gitSigningKey = mkOption {
type = str;
description = ''
The main user's git signing key, used to automatically sing git commits with this key
'';
default = ''
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw==
'';
};
# TODO: clean this up and move it somewhere else.
defaultShell = {
name = mkOption {
type = str;
default = "nushell";
description = ''
The default shell of a user. This is not the main system shell, but the shell used in terminals.
'';
};
package = mkOption {
type = package;
default = pkgs.nushell;
};
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw== '';
};
};
};
config = {
environment.shells = [ pkgs.nushell ];
programs.zsh.enable = false;
users = {
mutableUsers = true;
users = {
@ -71,8 +52,10 @@ in
"nix"
"docker"
];
shell = pkgs.nushell;
shell = self.packages.${pkgs.stdenv.system}.fish;
# hashedPasswordFile = "/etc/passwords/cr";
};
# root.hashedPasswordFile = "/persist/passwords/root";
};
};
};

View file

@ -1,82 +0,0 @@
{
config,
pkgs,
...
}:
let
inherit (config.meta.mainUser) username;
primary_browser = "zen-beta.desktop";
mail_client = "thunderbird.desktop";
file_manager = "nautilus.desktop";
media_player = "mpv.desktop";
image_viewer = "imv.desktop";
text_editor = "helix.desktop";
terminal = "com.mitchellh.ghostty";
pdf_viewer = "zathura.desktop";
in
{
environment = {
systemPackages = [ pkgs.xdg-utils ];
variables = {
TERMINAL = "${terminal}";
XDG_CACHE_HOME = "/home/${username}/.config";
};
};
xdg = {
autostart.enable = true;
menus.enable = true;
icons.enable = true;
terminal-exec = {
enable = true;
settings = {
default = [
"com.mitchellh.ghostty.desktop"
];
};
};
mime = {
enable = true;
defaultApplications = {
"text/html" = [ primary_browser ];
"x-scheme-handler/http" = [ primary_browser ];
"x-scheme-handler/https" = [ primary_browser ];
"x-scheme-handler/about" = [ primary_browser ];
"x-scheme-handler/unknown" = [ primary_browser ];
"x-scheme-handler/mailto" = [ mail_client ];
"message/rfc822" = [ mail_client ];
"x-scheme-handler/mid" = [ mail_client ];
"inode/directory" = [ file_manager ];
"audio/mp3" = [ media_player ];
"audio/ogg" = [ media_player ];
"audio/mpeg" = [ media_player ];
"audio/aac" = [ media_player ];
"audio/opus" = [ media_player ];
"audio/wav" = [ media_player ];
"audio/webm" = [ media_player ];
"audio/3gpp" = [ media_player ];
"audio/3gpp2" = [ media_player ];
"video/mp4" = [ media_player ];
"video/x-msvideo" = [ media_player ];
"video/mpeg" = [ media_player ];
"video/ogg" = [ media_player ];
"video/mp2t" = [ media_player ];
"video/webm" = [ media_player ];
"video/3gpp" = [ media_player ];
"video/3gpp2" = [ media_player ];
"image/png" = [ image_viewer ];
"image/jpeg" = [ image_viewer ];
"image/gif" = [ image_viewer ];
"image/avif" = [ image_viewer ];
"image/bmp" = [ image_viewer ];
"image/vnd.microsoft.icon" = [ image_viewer ];
"image/svg+xml" = [ image_viewer ];
"image/tiff" = [ image_viewer ];
"image/webp" = [ image_viewer ];
"text/plain" = [ text_editor ];
"application/pdf" = [ pdf_viewer ];
};
};
};
}

72
modules/other/xdg.nix Normal file
View file

@ -0,0 +1,72 @@
{
config,
pkgs,
...
}: let
inherit (config.meta.mainUser) username;
primary_browser = "Librewolf.desktop";
mail_client = "thunderbird.desktop";
file_manager = "nautilus.desktop";
media_player = "mpv.desktop";
image_viewer = "imv.desktop";
text_editor = "helix.desktop";
terminal = "foot.desktop";
pdf_viewer = "sioyek.desktop";
in {
environment = {
systemPackages = [pkgs.xdg-utils];
sessionVariables = {
TERMINAL = "${terminal}";
XDG_CACHE_HOME = "/home/${username}/.config";
};
};
xdg = {
autostart.enable = true;
menus.enable = true;
icons.enable = true;
mime = {
enable = true;
defaultApplications = {
"text/html" = [primary_browser];
"x-scheme-handler/http" = [primary_browser];
"x-scheme-handler/https" = [primary_browser];
"x-scheme-handler/about" = [primary_browser];
"x-scheme-handler/unknown" = [primary_browser];
"x-scheme-handler/mailto" = [mail_client];
"message/rfc822" = [mail_client];
"x-scheme-handler/mid" = [mail_client];
"inode/directory" = [file_manager];
"audio/mp3" = [media_player];
"audio/ogg" = [media_player];
"audio/mpeg" = [media_player];
"audio/aac" = [media_player];
"audio/opus" = [media_player];
"audio/wav" = [media_player];
"audio/webm" = [media_player];
"audio/3gpp" = [media_player];
"audio/3gpp2" = [media_player];
"video/mp4" = [media_player];
"video/x-msvideo" = [media_player];
"video/mpeg" = [media_player];
"video/ogg" = [media_player];
"video/mp2t" = [media_player];
"video/webm" = [media_player];
"video/3gpp" = [media_player];
"video/3gpp2" = [media_player];
"image/png" = [image_viewer];
"image/jpeg" = [image_viewer];
"image/gif" = [image_viewer];
"image/avif" = [image_viewer];
"image/bmp" = [image_viewer];
"image/vnd.microsoft.icon" = [image_viewer];
"image/svg+xml" = [image_viewer];
"image/tiff" = [image_viewer];
"image/webp" = [image_viewer];
"text/plain" = [text_editor];
"application/pdf" = [pdf_viewer];
};
};
};
}

View file

@ -0,0 +1,8 @@
{
config,
lib,
pkgs,
...
}: let
in {
}

View file

@ -0,0 +1,22 @@
{pkgs, ...}: {
imports = [
./hardware.nix
./wayland.nix
# ./media.nix
];
# These are some standard packages I want to have installed on every system, regardless of type or use case.
environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
calc # Calculator device
coreutils-full # All of the GNU coreutils
curl # I sometimes need to curl stuff
git # take a guess
inetutils # internet stuff I need/want on every system.
wget
unzip # zipping and unzipping stuff
zip
util-linux
;
};
}

View file

@ -1,98 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
inherit (lib) getFlakePkg;
nil = getFlakePkg inputs.nil;
in
{
environment = {
defaultPackages = [ ];
systemPackages =
(with pkgs; [
(lib.hiPrio pkgs.uutils-coreutils-noprefix)
asciinema
atuin
bat
bvi
cachix
calc
comma
cpufetch
curlie
delta
diff-so-fancy
difftastic
dig
direnv
dust
element
entr
eza
fd
ffmpeg-full
figlet
fzf
gcc
git
glow
gnumake
hexyl
httpie
hyperfine
iamb
imagemagick
inetutils
jq
just
kondo
lazygit
linuxHeaders
microfetch
mprocs
neofetch
nixfmt
nmap
ouch
procs
pv
python3
radare2
radicle-node
radicle-tui
ripgrep
rsync
sd
serpl
sesh
smartmontools
starship
tealdeer
television
tig
timg
tokei
trash-cli
ty
universal-android-debloater
unzip
util-linux
uv
w3m
watchman
wget
wireguard-tools
yazi
zip
zoxide
])
++ [
nil
inputs.agenix.packages.${pkgs.stdenv.system}.agenix
];
};
}

View file

@ -0,0 +1,15 @@
{
config,
lib,
pkgs,
...
}: {
# These are packages I only need in wayland environments, nowhere else.
environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
wl-clipboard
grimblast
;
};
}

View file

@ -1,132 +0,0 @@
{
config,
lib,
pkgs,
self,
...
}:
let
inherit (lib.meta) getExe;
inherit (lib.lists) singleton;
inherit (lib.modules) mkIf;
inherit (config.meta.mainUser) username;
inherit (config.meta.system) isWorkstation;
toml = pkgs.formats.toml { };
jj-config = toml.generate "config.toml" {
user = {
email = "fau@faukah.com";
name = "faukah";
};
aliases = {
c = [ "commit" ];
ci = [
"commit"
"--interactive"
];
e = [ "edit" ];
i = [
"git"
"init"
"--colocate"
];
nb = [
"bookmark"
"create"
"-r @-"
];
pull = [
"git"
"fetch"
];
push = [
"git"
"push"
"--allow-new"
];
r = [ "rebase" ];
s = [ "squash" ];
si = [
"squash"
"--interactive"
];
tug = [
"bookmark"
"move"
"--from"
"closest_bookmark(@-)"
"--to"
"@-"
];
};
git = {
# colocate = true;
push-new-bookmarks = true;
};
revset-aliases."closest_bookmark(to)" = "heads(::to & bookmarks())";
signing = {
backend = "ssh";
behavior = "drop";
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPiRe9OH/VtWFWyy5QbAVcN7CLxr4zUtRCwmxD6aeN6";
};
template-aliases = {
"format_short_id(id)" = "id.shortest()";
"format_timestamp(timestamp)" = "timestamp.ago()";
};
templates = {
draft_commit_description = ''
concat(
coalesce(description, "\n"),
surround(
"\nJJ: This commit contains the following changes:\n", "",
indent("JJ: ", diff.stat(72)),
),
"\nJJ: ignore-rest\n",
diff.git(),
)
'';
};
ui = {
default-command = "log";
diff-editor = ":builtin";
diff-formatter = [
"${getExe pkgs.difftastic}"
"--color"
"always"
"$left"
"$right"
];
movement = {
edit = true;
};
pager = [
"${getExe pkgs.bat}"
"--plain"
];
};
};
inherit (config.age.secrets) organizationScope uniScope;
jj-wrapped = pkgs.symlinkJoin {
name = "jj-wrapped";
paths = singleton [ pkgs.jujutsu ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/jj --add-flags " --config-file ${organizationScope.path} --config-file ${uniScope.path}"
'';
};
in
{
hjem.users.${username}.xdg.config.files."jj/config.toml".source = jj-config;
age.secrets.organizationScope = mkIf isWorkstation {
file = "${self}/secrets/organization_scope.age";
owner = username;
};
age.secrets.uniScope = mkIf isWorkstation {
file = "${self}/secrets/uni_scope.age";
owner = username;
};
environment.systemPackages = singleton (if isWorkstation then jj-wrapped else pkgs.jujutsu);
}

View file

@ -0,0 +1,6 @@
_: {
imports = [
./nh.nix
# ./beets.nix
];
}

View file

@ -1,25 +1,18 @@
{
config,
inputs,
lib,
...
}:
let
}: let
cfg = config.modules.programs.nh;
inherit (config.modules.other.system) username;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (lib) getFlakePkg;
nh = getFlakePkg inputs.nh;
in
{
in {
options.modules.programs.nh.enable = mkEnableOption "nh";
config = mkIf cfg.enable {
programs.nh = {
enable = true;
package = nh;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/${username}/repos/projects/nichts";

View file

@ -1,7 +0,0 @@
_: {
programs.zoxide = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
};
}

View file

@ -1,85 +0,0 @@
{
config,
lib,
pkgs,
self,
...
}:
let
inherit (config.modules.system) isGraphical;
inherit (lib.modules) mkIf;
inherit (config.meta.mainUser) username;
fix_ssh_keys = pkgs.writeText "patch" ''
diff --git a/src/api.rs b/src/api.rs
index 8cad5b6..ea352fa 100644
--- a/src/api.rs
+++ b/src/api.rs
@@ -1115,13 +1115,14 @@ impl Client {
.get(self.api_url("/sync"))
.header("Authorization", format!("Bearer {access_token}"))
// This is necessary for vaultwarden to include the ssh keys in the response
- .header("Bitwarden-Client-Version", "2024.12.0")
+ .header("Bitwarden-Client-Version", "2025.08.0")
.send()
.await
.map_err(|source| Error::Reqwest { source })?;
match res.status() {
reqwest::StatusCode::OK => {
let sync_res: SyncRes = res.json_with_path().await?;
+ eprintln!("sync res: {sync_res:?}");
let folders = sync_res.folders.clone();
let ciphers = sync_res
.ciphers '';
bitwarden-desktop-wrapped = pkgs.symlinkJoin {
name = "bitwarden-desktop-wrapped";
paths = [ pkgs.bitwarden-desktop ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/bitwarden --set \
BITWARDEN_SSH_AUTH_SOCK /run/user/1000/ssh-agent.sock
'';
};
rbw = pkgs.rbw.overrideAttrs (finalAttrs: {
version = "1.14.1";
src = pkgs.fetchzip {
url = "https://git.tozt.net/rbw/snapshot/rbw-${finalAttrs.version}.tar.gz";
hash = "sha256-4wNDDMaz9zjNYahOZXARDbNdGKl0kS0pF3qQuM7fK4s=";
};
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (rbw) src;
hash = "sha256-H1DSP3Kyklv8ncn7zDP0njDlwB8Qh+h7mqWRAJcpWrE=";
};
patches = [
fix_ssh_keys
];
});
in
{
config = mkIf isGraphical {
age.secrets.rbwConfig = {
file = (self + "/secrets/rbw_config.age");
owner = username;
};
hjem.users.${username}.xdg.config.files."rbw/config.json".source =
config.age.secrets.rbwConfig.path;
environment = {
systemPackages = lib.attrValues {
inherit (pkgs)
bitwarden-cli
pinentry-qt
;
inherit bitwarden-desktop-wrapped rbw;
};
# Set the ssh socket globally. This alows all applications and shells to use
# the ssh-agent.
sessionVariables."SSH_AUTH_SOCK" = "/run/user/1000/ssh-agent.sock";
};
};
}

View file

@ -1,19 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib.modules) mkIf;
inherit (config.modules.system) isGraphical;
in
{
config = mkIf isGraphical {
environment.systemPackages = with pkgs; [
kdePackages.dolphin
kdePackages.kio-fuse # to mount remote filesystems via FUSE
kdePackages.kio-extras # extra protocols support (sftp, fish and more)
];
};
}

View file

@ -1,143 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib.modules) mkIf;
inherit (config.meta.mainUser) username;
cfg = config.modules.system.programs.terminals.foot;
theme-colors = config.modules.style.colorScheme.colors;
foot-config = pkgs.writeText "foot.ini" (
lib.generators.toINI { } {
main = {
term = "xterm-256color";
app-id = "foot";
title = "foot";
locked-title = "no";
font = "JetBrainsMono Nerd Font Mono:size=14";
font-bold = "JetBrainsMono Nerd Font Mono:size=14:style=Bold";
line-height = 20;
letter-spacing = 0;
horizontal-letter-offset = 0;
vertical-letter-offset = 0;
box-drawings-uses-font-glyphs = "no";
dpi-aware = "no";
bold-text-in-bright = "no";
word-delimiters = ",`|:\"'()[]{}<>";
selection-target = "primary";
initial-window-size-chars = "104x36";
initial-window-mode = "windowed";
pad = "8x8 center";
resize-delay-ms = 100;
};
desktop-notifications.command = "${pkgs.libnotify}/bin/notify-send -a \${app-id} -i \${app-id} \${title} \${body}";
bell = {
urgent = "yes";
notify = "yes";
command = "${pkgs.libnotify}/bin/notify-send bell";
command-focused = "no";
};
scrollback = {
lines = 10000;
multiplier = 10.0;
indicator-position = "relative";
indicator-format = "line";
};
url = {
launch = "${pkgs.xdg-utils}/bin/xdg-open \${url}";
label-letters = "sadfjklewcmpgh";
osc8-underline = "always";
};
tweak = {
font-monospace-warn = "no";
sixel = "yes";
};
cursor = {
style = "beam";
blink = "no";
};
mouse = {
hide-when-typing = "yes"; # not really needed since we already enable this in Hyprland.
alternate-scroll-mode = "yes";
};
csd.preferred = "server";
key-bindings = {
scrollback-up-half-page = "Control+k";
scrollback-up-page = "Control+Shift+k";
scrollback-down-half-page = "Control+j";
scrollback-down-page = "Control+Shift+j";
};
mouse-bindings = {
selection-override-modifiers = "Shift";
primary-paste = "BTN_MIDDLE";
select-begin = "BTN_LEFT";
select-begin-block = "Control+BTN_LEFT";
select-extend = "BTN_RIGHT";
select-extend-character-wise = "Control+BTN_RIGHT";
select-word = "BTN_LEFT-2";
select-word-whitespace = "Control+BTN_LEFT-2";
};
colors = {
foreground = theme-colors.base05; # Text
background = theme-colors.base00; # Base
regular0 = theme-colors.base03; # Surface 1
regular1 = theme-colors.base08; # red
regular2 = theme-colors.base0B; # green
regular3 = theme-colors.base0A; # yellow
regular4 = theme-colors.base0D; # blue
regular5 = "f5c2e7"; # pink
regular6 = "94e2d5"; # teal
regular7 = "bac2de"; # Subtext 1
bright0 = theme-colors.base04; # Surface 2
bright1 = theme-colors.base08; # red
bright2 = theme-colors.base0B; # green
bright3 = theme-colors.base0A; # yellow
bright4 = "89b4fa"; # blue
bright5 = "f5c2e7"; # pink
bright6 = "94e2d5"; # teal
bright7 = "a6adc8"; # Subtext 0
selection-foreground = "cdd6f4";
selection-background = "414356";
search-box-no-match = "11111b f38ba8";
search-box-match = "cdd6f4 313244";
jump-labels = "11111b fab387";
urls = "89b4fa";
alpha = 0.9;
};
}
);
foot-wrapped = pkgs.symlinkJoin {
name = "foot-wrapped";
paths = [ pkgs.foot ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/foot --add-flags "--config=${foot-config} --working-directory=/home/${username}"
'';
};
in
{
config = mkIf cfg.enable {
environment.systemPackages = [ foot-wrapped ];
};
}

View file

@ -0,0 +1,132 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.modules) mkIf;
inherit (config.meta.mainUser) username;
cfg = config.modules.system.programs.terminals.foot;
colours = config.modules.style.colorScheme.colors;
foot-config = pkgs.writeText "foot.ini" (lib.generators.toINI {} {
main = {
term = "xterm-256color";
app-id = "foot";
title = "foot";
locked-title = "no";
font = "valiosevka:size=14";
font-bold = "valiosevka:size=14";
# font = "Iosevka Nerd Font:size=14";
# font-bold = "Iosevka Nerd Font:size=14";
line-height = 20;
letter-spacing = 0;
horizontal-letter-offset = 0;
vertical-letter-offset = 0;
box-drawings-uses-font-glyphs = "no";
dpi-aware = "no";
bold-text-in-bright = "no";
word-delimiters = ",`|:\"'()[]{}<>";
selection-target = "primary";
initial-window-size-chars = "104x36";
initial-window-mode = "windowed";
pad = "8x8 center";
resize-delay-ms = 100;
};
desktop-notifications.command = "${pkgs.libnotify}/bin/notify-send -a \${app-id} -i \${app-id} \${title} \${body}";
bell = {
urgent = "yes";
notify = "yes";
command = "${pkgs.libnotify}/bin/notify-send bell";
command-focused = "no";
};
scrollback = {
lines = 10000;
multiplier = 10.0;
indicator-position = "relative";
indicator-format = "line";
};
url = {
launch = "${pkgs.xdg-utils}/bin/xdg-open \${url}";
label-letters = "sadfjklewcmpgh";
osc8-underline = "always";
};
tweak = {
font-monospace-warn = "no";
sixel = "yes";
};
cursor = {
style = "beam";
blink = "no";
};
mouse = {
hide-when-typing = "yes"; # not really needed since we already enable this in Hyprland.
alternate-scroll-mode = "yes";
};
csd.preferred = "server";
key-bindings = {
scrollback-up-half-page = "Control+k";
scrollback-up-page = "Control+Shift+k";
scrollback-down-half-page = "Control+j";
scrollback-down-page = "Control+Shift+j";
};
mouse-bindings = {
selection-override-modifiers = "Shift";
primary-paste = "BTN_MIDDLE";
select-begin = "BTN_LEFT";
select-begin-block = "Control+BTN_LEFT";
select-extend = "BTN_RIGHT";
select-extend-character-wise = "Control+BTN_RIGHT";
select-word = "BTN_LEFT-2";
select-word-whitespace = "Control+BTN_LEFT-2";
};
colors = {
background = colours.base00; # base color
foreground = colours.base05; # text color
regular0 = colours.base03; # black
regular1 = colours.base08; # red
regular2 = colours.base0B; # green
regular3 = colours.base0A; # yellow
regular4 = colours.base0D; # blue
regular5 = colours.base0F; #magenta
regular6 = colours.base0C; #cyan
regular7 = colours.base06; #white
bright0 = colours.base04; # Surface 2
bright1 = colours.base08; # red
bright2 = colours.base0B; # green
bright3 = colours.base0A; # yellow
bright4 = colours.base0D; # blue
bright5 = colours.base0F; # pink
bright6 = colours.base0C; # teal
bright7 = colours.base07; # Subtext 0
alpha = 1.0;
};
});
foot-wrapped = pkgs.symlinkJoin {
name = "foot-wrapped";
paths = [pkgs.foot];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/foot --add-flags "--config=${foot-config} --working-directory=/home/${username}"
'';
};
in {
config = mkIf cfg.enable {
environment.systemPackages = [foot-wrapped];
};
}

View file

@ -0,0 +1,11 @@
{
config,
lib,
pkgs,
...
}: let
in {
environment.systemPackages = builtins.attrValues {
inherit (pkgs) fuzzel;
};
}

View file

@ -3,20 +3,18 @@
lib,
pkgs,
...
}:
let
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf;
cfg = config.modules.programs.minecraft;
in
{
in {
options.modules.programs.minecraft = {
enable = mkEnableOption "minecraft";
wayland = mkEnableOption "wayland";
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.prismlauncher ];
environment.systemPackages = [pkgs.prismlauncher];
};
}

View file

@ -0,0 +1,9 @@
_: {
imports = [
./foot.nix
./steam.nix
# ./schizofox.nix
./minecraft.nix
./miniflux.nix
];
}

View file

@ -1,9 +0,0 @@
{ pkgs, ... }:
{
environment.systemPackages = [
pkgs.spotify
]
++ (with pkgs; [
sptlrx
]);
}

View file

@ -3,14 +3,12 @@
lib,
pkgs,
...
}:
let
}: let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.programs.steam;
in
{
in {
options.modules.system.programs.steam.enable = mkEnableOption "Steam games platform";
config = mkIf cfg.enable {
programs.steam = {
@ -21,20 +19,16 @@ in
SDL_VIDEODRIVER = "x11";
};
extraLibraries =
p:
extraLibraries = p:
builtins.attrValues {
inherit (p) atk;
};
};
gamescopeSession.enable = true;
extraCompatPackages = [ pkgs.proton-ge-bin.steamcompattool ];
extraCompatPackages = [pkgs.proton-ge-bin.steamcompattool];
};
services.udev.extraRules = ''
SUBSYSTEM=="input", ATTRS{idVendor}=="2dc8", ATTRS{idProduct}=="3106", MODE="0660", GROUP="input"
''; # See
# See
# https://wiki.nixos.org/wiki/GameMode
programs.gamemode.enable = true;
};

View file

@ -1,40 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.programs.thunar;
in
{
options.modules.programs.thunar.enable = mkEnableOption "Thunar file manager";
config = mkIf cfg.enable {
programs.thunar = {
enable = true;
plugins = builtins.attrValues {
inherit (pkgs.xfce)
thunar-volman
thunar-vcs-plugin
thunar-archive-plugin
thunar-media-tags-plugin
;
};
};
services.gvfs = {
enable = true;
package = pkgs.gvfs;
};
# Archive management
programs.file-roller = {
enable = true;
package = pkgs.file-roller;
};
# image thumbnails
services.tumbler.enable = true;
};
}

View file

@ -0,0 +1,23 @@
{
config,
lib,
pkgs,
...
}: {
programs.thunar = {
enable = true;
plugins = builtins.attrValues {
inherit
(pkgs.xfce)
thunar-volman
thunar-vcs-plugin
thunar-archive-plugin
thunar-media-tags-plugin
;
};
};
services.gvfs = {
enable = true;
package = pkgs.gvfs;
};
}

View file

@ -1,19 +0,0 @@
{
config,
inputs,
lib,
...
}:
let
inherit (lib) getFlakePkg;
inherit (lib.lists) singleton;
inherit (lib.modules) mkIf;
inherit (config.meta.system) isWorkstation;
zedless = (getFlakePkg inputs.zedless).overrideAttrs {
doCheck = false;
};
in
{
# environment.systemPackages = mkIf isWorkstation <| singleton zedless;
}

View file

@ -1,138 +0,0 @@
{
lib,
inputs,
...
}:
let
inherit (lib) getFlakePkg';
zen-browser = getFlakePkg' inputs.zen-browser-flake "beta";
inherit (lib.modules) mkForce;
in
{
programs.firefox = {
enable = true;
package = zen-browser;
languagePacks = [
"de"
"en-US"
"ru"
];
policies = {
# Updates & Background Services
AppAutoUpdate = false;
BackgroundAppUpdate = false;
# Feature Disabling
DisableBuiltinPDFViewer = false;
DisableFirefoxStudies = true;
DisableFirefoxAccounts = true;
DisableFirefoxScreenshots = true;
DisableForgetButton = true;
DisableMasterPasswordCreation = true;
DisableProfileImport = true;
DisableProfileRefresh = true;
DisableSetDesktopBackground = true;
DisablePocket = true;
DisableTelemetry = true;
DisableFormHistory = true;
DisablePasswordReveal = true;
# Access Restrictions
BlockAboutConfig = false;
BlockAboutProfiles = true;
BlockAboutSupport = true;
# UI and Behavior
DisplayMenuBar = "never";
DontCheckDefaultBrowser = true;
HardwareAcceleration = true;
OfferToSaveLogins = false;
# Extensions
ExtensionSettings =
let
moz = short: "https://addons.mozilla.org/firefox/downloads/latest/${short}/latest.xpi";
in
{
# Block all extensions by default.
"*".installation_mode = "blocked";
"uBlock0@raymondhill.net" = {
install_url = moz "ublock-origin";
installation_mode = "force_installed";
updates_disabled = true;
};
"{73a6fe31-595d-460b-a920-fcc0f8843232}" = {
install_url = moz "noscript";
installation_mode = "force_installed";
updates_disabled = true;
};
"3rdparty".Extensions = {
"uBlock0@raymondhill.net".adminSettings = {
userSettings = rec {
uiTheme = "dark";
uiAccentCustom = true;
uiAccentCustom0 = "#8300ff";
cloudStorageEnabled = mkForce false;
importedLists = [
"https:#filters.adtidy.org/extension/ublock/filters/3.txt"
"https:#github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
"https://raw.githubusercontent.com/yokoffing/filterlists/refs/heads/main/privacy_essentials.txt"
"https://raw.githubusercontent.com/hagezi/dns-blocklists/refs/heads/main/adblock/pro.plus.mini.txt"
"https://raw.githubusercontent.com/DandelionSprout/adfilt/refs/heads/master/LegitimateURLShortener.txt"
"https://raw.githubusercontent.com/yokoffing/filterlists/refs/heads/main/annoyance_list.txt"
"https://raw.githubusercontent.com/DandelionSprout/adfilt/refs/heads/master/BrowseWebsitesWithoutLoggingIn.txt"
];
externalLists = lib.concatStringsSep "\n" importedLists;
};
selectedFilterLists = [
"CZE-0"
"adguard-generic"
"adguard-annoyance"
"adguard-social"
"adguard-spyware-url"
"easylist"
"easyprivacy"
"https:#github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
"plowe-0"
"ublock-abuse"
"ublock-badware"
"ublock-filters"
"ublock-privacy"
"ublock-quick-fixes"
"ublock-unbreak"
"urlhaus-1"
"https://raw.githubusercontent.com/yokoffing/filterlists/refs/heads/main/privacy_essentials.txt"
"https://raw.githubusercontent.com/hagezi/dns-blocklists/refs/heads/main/adblock/pro.plus.mini.txt"
"https://raw.githubusercontent.com/DandelionSprout/adfilt/refs/heads/master/LegitimateURLShortener.txt"
"https://raw.githubusercontent.com/yokoffing/filterlists/refs/heads/main/annoyance_list.txt"
"https://raw.githubusercontent.com/DandelionSprout/adfilt/refs/heads/master/BrowseWebsitesWithoutLoggingIn.txt"
];
};
};
};
SearchEngines = {
Add = [
{
"Name" = "Kagi";
"URLTemplate" = "https://kagi.com/search?q={searchTerms}";
"Method" = "'GET' | 'POST'";
"IconURL" = "https://www.example.org/favicon.ico";
"Alias" = "Kagi";
"Description" = "Kagi search engine";
"PostData" = "name=value&q={searchTerms}";
"SuggestURLTemplate" = "https://kagi.com/api/autosuggest?q={searchTerms}";
}
];
};
};
};
}

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
config = {
programs.direnv = {
enable = true;
@ -11,9 +10,8 @@
# We want direnv to load in our nix dev shells
loadInNixShell = true;
enableBashIntegration = false;
enableBashIntegration = true;
enableFishIntegration = true;
};
environment.systemPackages = [pkgs.fish];
};
}

View file

@ -0,0 +1,3 @@
_: {
imports = [./direnv.nix ./nix-index.nix];
}

View file

@ -1,10 +0,0 @@
{
programs = {
# We disable this and use nix-index instead. (Rust >>> Pearl)
command-not-found.enable = false;
nix-index = {
enable = true;
};
};
}

View file

@ -0,0 +1,11 @@
{pkgs, ...}: {
programs = {
# We have to disable this and use nix-index instead. (Rust >>> Pearl)
command-not-found = {
enable = false;
};
nix-index = {
enable = true;
};
};
}

View file

@ -0,0 +1,40 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf;
cfg = config.modules.programs.btop;
btop-settings = pkgs.writeTextDir "btop/btop.conf" ''
truecolor = True
vim_keys = True
rounded_corners = True
update_ms = 100
graph_symbol = "braille"
cpu_single_graph = True
clock_format = "%X"
use_fstab = True
io_mode = True
net_sync = True
net_iface = "enp4s0"
log_level = "ERROR"
'';
btop-wrapped = pkgs.symlinkJoin {
name = "btop-wrapped";
paths = [pkgs.btop];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/btop --set XDG_CONFIG_HOME "${btop-settings}"
'';
};
in {
options.modules.programs.btop.enable = mkEnableOption "btop";
config = mkIf cfg.enable {
environment.systemPackages = [btop-wrapped];
};
}

View file

@ -0,0 +1,3 @@
_: {
imports = [./btop.nix];
}

View file

@ -1,327 +0,0 @@
// taken from https://lobste.rs/s/ft797a/why_zellij#c_4g7k3x
// Make the default layout compact and non-disturbing
default_layout "compact"
// do not pane frames
pane_frames false
// do not show startup tips
show_startup_tips false
// Choose the mode that zellij uses when starting up.
// Default: normal
//
default_mode "locked"
default_shell "fish"
theme "catppuccin-frappe"
// Toggle enabling the mouse mode. On certain configurations, or terminals this
// could potentially interfere with copying text.
// Default: true
//
mouse_mode true
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds clear-defaults=true {
scroll {
bind "Esc" "Ctrl s" {
SwitchToMode "Locked"
}
bind "e" {
EditScrollback
SwitchToMode "Locked"
}
bind "/" {
SwitchToMode "EnterSearch"
SearchInput 0
}
bind "Ctrl c" {
ScrollToBottom
SwitchToMode "Locked"
}
bind "j" "Down" {
ScrollDown
}
bind "k" "Up" {
ScrollUp
}
bind "Ctrl f" "PageDown" "Right" "l" {
PageScrollDown
}
bind "Ctrl b" "PageUp" "Left" "h" {
PageScrollUp
}
bind "d" {
HalfPageScrollDown
}
bind "u" {
HalfPageScrollUp
}
bind "g" {
ScrollToTop
}
bind "G" {
ScrollToBottom
}
}
search {
bind "Ctrl s" {
SwitchToMode "Locked"
}
bind "Esc" "Ctrl c" {
ScrollToBottom
SwitchToMode "Locked"
}
bind "j" "Down" {
ScrollDown
}
bind "k" "Up" {
ScrollUp
}
bind "Ctrl f" "PageDown" "Right" "l" {
PageScrollDown
}
bind "Ctrl b" "PageUp" "Left" "h" {
PageScrollUp
}
bind "d" {
HalfPageScrollDown
}
bind "u" {
HalfPageScrollUp
}
bind "n" {
Search "down"
}
bind "p" {
Search "up"
}
bind "c" {
SearchToggleOption "CaseSensitivity"
}
bind "w" {
SearchToggleOption "Wrap"
}
bind "o" {
SearchToggleOption "WholeWord"
}
}
entersearch {
bind "Ctrl c" "Esc" {
SwitchToMode "Scroll"
}
bind "Enter" {
SwitchToMode "Search"
}
}
renametab {
bind "Ctrl c" {
SwitchToMode "Locked"
}
bind "Esc" {
UndoRenameTab
SwitchToMode "Tmux"
}
}
renamepane {
bind "Ctrl c" {
SwitchToMode "Locked"
}
bind "Esc" {
UndoRenamePane
SwitchToMode "Tmux"
}
}
tmux {
bind "[" {
SwitchToMode "Scroll"
}
bind "Ctrl Space" {
Write 1
SwitchToMode "Locked"
}
bind "z" {
ToggleFocusFullscreen
SwitchToMode "Locked"
}
// manipulate tabs
bind "c" {
NewTab
SwitchToMode "Locked"
}
bind "K" {
CloseTab
SwitchToMode "Locked"
}
bind "R" {
SwitchToMode "RenameTab"
}
// switch modes
bind "/" {
SwitchToMode "EnterSearch"
SearchInput 0
}
// miscellaneous
bind "s" {
ToggleActiveSyncTab
SwitchToMode "Locked"
}
bind "m" {
ToggleMouseMode
SwitchToMode "Locked"
}
bind "y" {
Run "yazi"
SwitchToMode "Locked"
}
// create new pane
bind "Space" {
NewPane
SwitchToMode "Locked"
}
bind "-" "_" {
NewPane "Down"
SwitchToMode "Locked"
}
bind "|" "\\" {
NewPane "Right"
SwitchToMode "Locked"
}
bind "r" {
SwitchToMode "RenamePane"
}
// switch between tabs
bind "h" {
GoToPreviousTab
SwitchToMode "Locked"
}
bind "l" {
GoToNextTab
SwitchToMode "Locked"
}
bind "1" {
GoToTab 1
SwitchToMode "Locked"
}
bind "2" {
GoToTab 2
SwitchToMode "Locked"
}
bind "3" {
GoToTab 3
SwitchToMode "Locked"
}
bind "4" {
GoToTab 4
SwitchToMode "Locked"
}
bind "5" {
GoToTab 5
SwitchToMode "Locked"
}
bind "6" {
GoToTab 6
SwitchToMode "Locked"
}
bind "7" {
GoToTab 7
SwitchToMode "Locked"
}
bind "8" {
GoToTab 8
SwitchToMode "Locked"
}
bind "9" {
GoToTab 9
SwitchToMode "Locked"
}
// switch between panes
bind "Left" {
MoveFocus "Left"
}
bind "Right" {
MoveFocus "Right"
}
bind "Down" {
MoveFocus "Down"
}
bind "Up" {
MoveFocus "Up"
}
bind "Tab" {
FocusNextPane
}
// move panes
bind "H" {
MovePane "Left"
}
bind "J" {
MovePane "Down"
}
bind "K" {
MovePane "Up"
}
bind "L" {
MovePane "Right"
}
// manipulate panes
bind "W" {
CloseFocus
SwitchToMode "Locked"
}
// exit etc
bind "Enter" "Esc" {
SwitchToMode "Locked"
}
bind "d" {
Detach
SwitchToMode "Locked"
}
bind "Q" {
Quit
}
// resizing
bind "Ctrl h" {
Resize "Increase Left"
}
bind "Ctrl j" {
Resize "Increase Down"
}
bind "Ctrl k" {
Resize "Increase Up"
}
bind "Ctrl l" {
Resize "Increase Right"
}
}
shared {
bind "Alt n" {
NewPane
}
bind "Alt Ctrl h" {
MoveFocus "Left"
}
bind "Alt Ctrl j" {
MoveFocus "Down"
}
bind "Alt Ctrl l" {
MoveFocus "Right"
}
bind "Alt Ctrl k" {
MoveFocus "Up"
}
bind "Alt [" {
PreviousSwapLayout
}
bind "Alt ]" {
NextSwapLayout
}
bind "Alt =" "Alt +" {
Resize "Increase"
}
bind "Alt -" "Alt _" {
Resize "Decrease"
}
}
shared_except "tmux" {
bind "Ctrl Space" {
SwitchToMode "Tmux"
}
}
}

View file

@ -0,0 +1,12 @@
{pkgs, ...}: let
# I am patching zellij because of this issue:
# https://github.com/zellij-org/zellij/pull/2548
patched-zellij = pkgs.zellij.overrideAttrs (old: {
patches = [./zellij-good-scrolling.patch];
doCheck = false;
});
in {
environment.systemPackages = builtins.attrValues {
# inherit patched-zellij;
};
}

View file

@ -0,0 +1,22 @@
--- a/zellij-server/src/panes/grid.rs
+++ b/zellij-server/src/panes/grid.rs
@@ -271,7 +271,7 @@ fn subtract_isize_from_usize(u: usize, i: isize) -> usize {
macro_rules! dump_screen {
($lines:expr) => {{
let mut is_first = true;
- let mut buf = "".to_owned();
+ let mut buf = String::with_capacity($lines.iter().map(|l| l.len()).sum());
for line in &$lines {
if line.is_canonical && !is_first {
@@ -280,8 +280,7 @@ macro_rules! dump_screen {
let s: String = (&line.columns).into_iter().map(|x| x.character).collect();
// Replace the spaces at the end of the line. Sometimes, the lines are
// collected with spaces until the end of the panel.
- let re = Regex::new("([^ ])[ ]*$").unwrap();
- buf.push_str(&(re.replace(&s, "${1}")));
+ buf.push_str(&s.trim_end_matches(' '));
is_first = false;
}
buf

View file

@ -1,17 +0,0 @@
{ pkgs, ... }:
let
zellij-wrapped = pkgs.symlinkJoin {
name = "zellij-wrapped";
paths = [ pkgs.zellij ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/zellij --add-flags "\
--config ${./config.kdl}"
'';
};
in
{
environment.systemPackages = builtins.attrValues {
inherit zellij-wrapped;
};
}

View file

@ -1,35 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
mkAcmeCert = domain: {
# An acme system user is created. This user belongs to the acme group
# and the home directory is /var/lib/acme. This user will try to make the directory
# .well-known/acme-challenge/ under the webroot directory.
webroot = "/var/lib/acme";
# email to send updates to, we prefix "acme" and the
# name of the domain the certificate is for to it.
email = "charlie@charlieroot.dev";
group = "nginx";
};
in
{
security.acme = {
acceptTerms = true;
defaults = {
email = "charlie@charlieroot.dev";
# testing server, do not use in production, but DO use it for setting things up.
# it has much higher rate limits.
# server = "https://acme-staging-v02.api.letsencrypt.org/directory";
};
certs = {
# "copeberg.org" = mkAcmeCert "copeberg.org";
# "info.copeberg.org" = mkAcmeCert "info.copeberg.org";
# "mail.charlieroot.dev" = mkAcmeCert "mail.charlieroot.dev";
};
};
}

View file

@ -0,0 +1,3 @@
_: {
networking.nftables.enable = true;
}

View file

@ -1,169 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (pkgs) fetchurl;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (config.services.forgejo) customDir user group;
cfg = config.modules.system.services.forgejo;
port = 3000;
domain = "copeberg.org";
img = ./img;
dataDir = "/srv/data/forgejo";
dumpDir = "/srv/data/forgejo-dump";
in
{
options.modules.system.services.forgejo.enable = mkEnableOption "forgejo";
config = mkIf cfg.enable {
modules.system.services = {
database.postgresql.enable = true;
nginx.enable = true;
};
networking.firewall.allowedTCPPorts = [
443
80
3000
];
services.nginx = {
enable = true;
virtualHosts.${domain} = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString port}";
};
};
};
# create the git user for forgejo
# NOTE: this is important and it will _not_ work otherwise.
users.users.git = {
home = dataDir;
useDefaultShell = true;
group = "git";
isSystemUser = true;
};
users.groups.git = { };
services.forgejo = {
enable = true;
package = pkgs.forgejo;
stateDir = dataDir;
user = "git";
group = "git";
database = {
createDatabase = true;
name = "git";
user = "git";
type = "postgres";
};
# Disable support for Git Large File Storage
lfs.enable = false;
settings = {
server = {
DOMAIN = domain;
# You need to specify this to remove the port from URLs in the web UI.
ROOT_URL = "https://${domain}/";
HTTP_PORT = port;
LANDING_PAGE = "home";
};
DEFAULT = {
APP_NAME = "Copeberg.org";
APP_SLOGAN = "Code and seethe.";
};
# disable registration by default.
service.DISABLE_REGISTRATION = true;
# Add support for actions, based on act: https://github.com/nektos/act
actions = {
ENABLED = false;
DEFAULT_ACTIONS_URL = "github";
};
ui = {
SHOW_USER_EMAIL = false;
THEMES = "codeberg-dark";
DEFAULT_THEME = "codeberg-dark";
};
# The glory of the old default branch name
repository = {
DEFAULT_BRANCH = "master";
};
"repository.signing" = {
SIGNING_KEY = "none";
};
};
dump = {
enable = false;
backupDir = dumpDir;
interval = "06:00";
type = "tar.xz";
};
};
systemd.tmpfiles.rules =
let
# no crawlers, thank you.
robots = pkgs.writeText "robots-txt" ''
User-agent: *
Disallow: /
'';
base-brand = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/src/branch/codeberg-11/web_src/css/themes/codeberg/base-brand.css";
hash = "sha256-8gUmye/Z8H1Xe6U1CNAq907n3jt2TnPtzgpz6KhdiDU=";
};
dark-variables = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-11/web_src/css/themes/codeberg/dark-variables.css";
hash = "sha256-nCSJUOU9/R1fldoKXTTZmP7vmRjYUk/OKkbgrJ/NrXQ=";
};
theme-codeberg-dark = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-11/web_src/css/themes/theme-codeberg-dark.css";
hash = "sha256-KyXznH49koRGlzIDDqagN4PvFGD/zCX//wrctmtfgBs=";
};
in
[
"d '${customDir}/public' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets/img' 0750 ${user} ${group} - -"
# Copeberg logo, thanks Raf <3
"f '${customDir}/public/assets/img/logo.svg' - - - - ${img}/logo.svg"
"f '${customDir}/public/assets/img/logo.png' - - - - ${img}/logo.png"
"f '${customDir}/public/assets/img/apple-touch-icon' - - - - ${img}/logo.png"
"f '${customDir}/public/assets/img/favicon.svg' - - - - ${img}/logo.svg"
"f '${customDir}/public/assets/img/favicon.png' - - - - ${img}/logo.png"
# Theming shenanigans
"d '${customDir}/public/assets' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets/css' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets/css/codeberg' 0750 ${user} ${group} - -"
"f '${customDir}/public/assets/css/theme-codeberg-dark.css' - - - - ${theme-codeberg-dark}"
"f '${customDir}/public/assets/css/codeberg/base-brand.css' - - - - ${base-brand}"
"f '${customDir}/public/assets/css/codeberg/dark-variables.css' - - - - ${dark-variables}"
# Templates
"d '${customDir}/templates' 0750 ${user} ${group} - -"
"d '${customDir}/templates/repo' 0750 ${user} ${group} - -"
# Home page
"f '${customDir}/templates/home.tmpl' - - - - ${./templates}/home.tmpl"
"f '${customDir}/templates/repo/header.tmpl' - - - - ${./templates/repo}/header.tmpl"
# Fuck off scrapers
"f ${customDir}/public/robots.txt - - - - ${robots.outPath}"
];
};
}

View file

@ -0,0 +1,172 @@
{
config,
lib,
pkgs,
...
}: let
inherit (pkgs) fetchurl;
inherit (lib.modules) mkIf;
inherit (config.services.forgejo) customDir user group;
cfg = config.modules.system.services.forgejo;
port = 3000;
domain = "copeberg.org";
img = ./img;
acmeRoot = "/var/lib/acme/challenges-forgejo";
dataDir = "/srv/data/forgejo";
in {
options.modules.system.services.forgejo.enable = lib.mkEnableOption "forgejo";
config = mkIf cfg.enable {
modules.system.services = {
database.postgresql.enable = true;
nginx.enable = true;
};
networking.firewall.allowedTCPPorts = [
443
80
3000
];
services.nginx = {
enable = true;
virtualHosts.${domain} = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString port}";
};
};
};
security.acme = let
email = "charlie@charlieroot.dev";
in {
# testing server, do not use in production, but DO use it for setting things up.
# it has much higher rate limits.
# defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
certs = {
${domain} = {
webroot = acmeRoot;
inherit email;
group = "nginx";
};
};
};
# create the git user for forgejo
# NOTE: this is important and it will _not_ work otherwise.
users.users.git = {
home = dataDir;
useDefaultShell = true;
group = "git";
isSystemUser = true;
};
users.groups.git = {};
services.forgejo = {
enable = true;
package = pkgs.forgejo;
stateDir = dataDir;
user = "git";
group = "git";
database = {
createDatabase = true;
name = "git";
user = "git";
type = "postgres";
};
# Disable support for Git Large File Storage
lfs.enable = false;
settings = {
server = {
DOMAIN = domain;
# You need to specify this to remove the port from URLs in the web UI.
ROOT_URL = "https://${domain}/";
HTTP_PORT = port;
LANDING_PAGE = "home";
};
DEFAULT = {
APP_NAME = "Copeberg.org";
APP_SLOGAN = "Code and seethe.";
};
# disable registration by default.
service.DISABLE_REGISTRATION = true;
# Add support for actions, based on act: https://github.com/nektos/act
actions = {
ENABLED = false;
DEFAULT_ACTIONS_URL = "github";
};
ui = {
SHOW_USER_EMAIL = false;
THEMES = "codeberg-dark";
DEFAULT_THEME = "codeberg-dark";
};
# The glory of the old default branch name
repository = {
DEFAULT_BRANCH = "master";
};
"repository.signing" = {
SIGNING_KEY = "none";
};
};
};
systemd.tmpfiles.rules = let
# no crawlers, thank you.
robots = pkgs.writeText "robots-txt" ''
User-agent: *
Disallow: /
'';
base-brand = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/codeberg/base-brand.css";
hash = "sha256-QJ775HpINf8klO3d/8h+tEw0vk34p19dWUCWWuVwcho=";
};
dark-variables = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/codeberg/dark-variables.css";
hash = "sha256-nCSJUOU9/R1fldoKXTTZmP7vmRjYUk/OKkbgrJ/NrXQ=";
};
theme-codeberg-dark = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/theme-codeberg-dark.css";
hash = "sha256-KyXznH49koRGlzIDDqagN4PvFGD/zCX//wrctmtfgBs=";
};
in [
"d '${customDir}/public' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets/img' 0750 ${user} ${group} - -"
# Copeberg logo, thanks Raf <3
"L+ '${customDir}/public/assets/img/logo.svg' - - - - ${img}/logo.svg"
"L+ '${customDir}/public/assets/img/logo.png' - - - - ${img}/logo.png"
"L+ '${customDir}/public/assets/img/apple-touch-icon' - - - - ${img}/logo.png"
"L+ '${customDir}/public/assets/img/favicon.svg' - - - - ${img}/logo.svg"
"L+ '${customDir}/public/assets/img/favicon.png' - - - - ${img}/logo.png"
# Theming shenanigans
"d '${customDir}/public/assets' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets/css' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets/css/codeberg' 0750 ${user} ${group} - -"
"L+ '${customDir}/public/assets/css/theme-codeberg-dark.css' - - - - ${theme-codeberg-dark}"
"L+ '${customDir}/public/assets/css/codeberg/base-brand.css' - - - - ${base-brand}"
"L+ '${customDir}/public/assets/css/codeberg/dark-variables.css' - - - - ${dark-variables}"
# Templates
"d '${customDir}/templates' 0750 ${user} ${group} - -"
"d '${customDir}/templates/repo' 0750 ${user} ${group} - -"
# Home page
"L+ '${customDir}/templates/home.tmpl' - - - - ${./templates}/home.tmpl"
"L+ '${customDir}/templates/repo/header.tmpl' - - - - ${./templates/repo}/header.tmpl"
# Fuck off scrapers
"L+ ${customDir}/public/robots.txt - - - - ${robots.outPath}"
];
};
}

View file

@ -7,10 +7,49 @@
<h1 class="ui icon header title">
{{AppDisplayName}}
</h1>
<h2>{{ctx.Locale.Tr "startpage.app_desc"}}</h2>
<h2>A very painful Git service</h2>
</div>
</div>
</div>
{{template "home_forgejo" .}}
<div class="ui stackable middle very relaxed page grid">
<div class="eight wide center column">
<h1 class="hero ui icon header stackable">
<img class="logo" width="100" height="100" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
<p>Made with copious amounts of caffeeine</p>
</h1>
<p class="large">
<b>TODO</b>: Write some funny text here
</p>
</div>
<div class="eight wide center column stackable">
<h1 class="hero ui icon header">
<img class="logo" width="100" height="100" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
<p><it>I hate it here</it></p>
</h1>
<p class="large">
Bottom text
</p>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="eight wide center column">
<h1 class="hero ui icon header stackable">
<img class="logo" width="100" height="100" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
<p>Is this the real life?</p>
</h1>
<p class="large">
Something something fuck poettering
</p>
</div>
<div class="eight wide center column stackable">
<h1 class="hero ui icon header">
<img class="logo" width="100" height="100" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
<p>Open source or something</p>
</h1>
<p class="large">
I forgor
</p>
</div>
</div>
</div>
{{template "base/footer" .}}

View file

@ -1,36 +0,0 @@
<div class="ui stackable middle very relaxed page grid">
<div class="eight wide center column">
<h1 class="hero ui icon header">
{{svg "octicon-flame"}} {{ctx.Locale.Tr "startpage.install"}}
</h1>
<p class="large">
{{ctx.Locale.Tr "startpage.install_desc" "https://forgejo.org/download/#installation-from-binary" "https://forgejo.org/download/#container-image" "https://forgejo.org/download"}}
</p>
</div>
<div class="eight wide center column">
<h1 class="hero ui icon header">
{{svg "octicon-device-desktop"}} {{ctx.Locale.Tr "startpage.platform"}}
</h1>
<p class="large">
{{ctx.Locale.Tr "startpage.platform_desc"}}
</p>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="eight wide center column">
<h1 class="hero ui icon header">
{{svg "octicon-rocket"}} {{ctx.Locale.Tr "startpage.lightweight"}}
</h1>
<p class="large">
{{ctx.Locale.Tr "startpage.lightweight_desc"}}
</p>
</div>
<div class="eight wide center column">
<h1 class="hero ui icon header">
{{svg "octicon-code"}} {{ctx.Locale.Tr "startpage.license"}}
</h1>
<p class="large">
{{ctx.Locale.Tr "startpage.license_desc" "https://forgejo.org/download" "https://codeberg.org/forgejo/forgejo"}}
</p>
</div>
</div>

View file

@ -1,103 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (builtins) fetchurl;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.services.grafana;
domain = "info.copeberg.org";
port = 4021;
in
{
options.modules.system.services.grafana.enable = mkEnableOption "Grafana, a graphing service";
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [ config.services.grafana.settings.server.http_port ];
modules.system.services.database.postgresql.enable = true;
services.grafana = {
enable = true;
package = pkgs.grafana;
settings = {
server = {
http_addr = "127.0.0.1";
http_port = port;
root_url = "https://${domain}";
inherit domain;
enforce_domain = true;
};
database = {
type = "postgres";
host = "/run/postgresql";
name = "grafana";
user = "grafana";
ssl_mode = "disable";
};
analytics = {
reporting_enabled = false;
check_for_updates = false;
};
users.allow_signup = false;
};
provision = {
enable = true;
datasources.settings = {
datasources = [
(mkIf config.modules.system.services.prometheus.enable {
name = "Prometheus";
type = "prometheus";
access = "proxy";
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
isDefault = true;
})
(mkIf config.modules.system.services.database.postgresql.enable {
name = "PostgreSQL";
type = "postgres";
access = "proxy";
url = "127.0.0.1:${toString config.services.prometheus.exporters.postgres.port}";
})
];
};
dashboards.settings.providers = [
{
# taken from https://grafana.com/grafana/dashboards/1860-node-exporter-full/
name = "system-status";
options.path = fetchurl {
url = "https://grafana.com/api/dashboards/1860/revisions/40/download";
sha256 = "sha256-zTsS/UEX6W8+qK3l2GtvdDfmwS8eVnnyZxZ++LtRLBA=";
};
}
{
# taken from https://grafana.com/grafana/dashboards/9628-postgresql-database/
name = "PostgreSQL-status";
options.path = fetchurl {
url = "https://grafana.com/api/dashboards/9628/revisions/8/download";
sha256 = "sha256-UhusNAZbyt7fJV/DhFUK4FKOmnTpG0R15YO2r+nDnMc=";
};
}
];
};
};
services.nginx = {
enable = true;
virtualHosts.${domain} = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString port}";
};
};
};
};
}

View file

@ -3,17 +3,13 @@
lib,
pkgs,
...
}:
let
inherit (lib.meta) getExe getExe';
inherit (lib.modules) mkIf;
}: let
cfg = config.modules.services.greetd;
uwsmEnabled = config.modules.services.uwsm.enable;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str listOf;
inherit (config.meta.mainUser) username;
cfg = config.modules.services.greetd;
in
{
inherit (lib.modules) mkIf;
in {
options.modules.services.greetd = {
enable = mkEnableOption "greetd";
greeter = mkOption {
@ -27,30 +23,26 @@ in
session = mkOption {
description = "Which login session to start";
type = str;
default = "niri";
default =
if uwsmEnabled
then "uwsm start Hyprland"
else "Hyprland";
};
};
config = mkIf cfg.enable {
services.greetd =
let
session = {
services.greetd = {
enable = true;
package = pkgs.greetd;
settings.default_session = {
command = ''
${getExe pkgs.greetd.tuigreet} \
${pkgs.greetd.tuigreet}/bin/tuigreet \
-c \"${cfg.session}\" \
-r
-t --time-format "DD.MM.YYYY"
--asteriks'';
user = "greeter";
};
in
{
enable = true;
vt = 7;
settings = {
default_session = session;
initial_session = session;
};
};
};
}

View file

@ -2,24 +2,24 @@
config,
lib,
...
}:
let
}: let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.services.kanata;
in
{
in {
options.modules.services.kanata.enable = mkEnableOption "kanata";
config = mkIf cfg.enable {
services.kanata = {
enable = true;
keyboards.main = {
devices = [
"/dev/input/by-id/usb-Metadot_-_Das_Keyboard_Das_Keyboard-event-kbd"
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
"/dev/input/by-id/usb-Dell_Dell_USB_Keyboard-event-kbd"
];
keyboards.daskeyboard = {
devices = ["/dev/input/by-id/usb-Metadot_-_Das_Keyboard_Das_Keyboard-event-kbd"];
config = builtins.readFile (./. + "/main.kbd");
};
keyboards.laptop = {
devices = ["/dev/input/by-path/platform-i8042-serio-0-event-kbd"];
config = builtins.readFile (./. + "/main.kbd");
};
};

View file

@ -3,16 +3,14 @@
lib,
pkgs,
...
}:
let
}: let
cfg = config.modules.services.locate;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
in
{
in {
options.modules.services.locate.enable = mkEnableOption "Locate service";
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.plocate ];
environment.systemPackages = [pkgs.plocate];
services.locate = {
enable = true;
interval = "hourly";

17
modules/services/mako.nix Normal file
View file

@ -0,0 +1,17 @@
{pkgs, ...}: let
mako-wrapped = pkgs.symlinkJoin {
name = "mako-wrapped";
paths = [pkgs.mako];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/mako --add-flags "\
--font 'Lexend 11' \
--border-radius 8 \
--padding 8 \
--border-size 5 \
--default-timeout 4000"
'';
};
in {
environment.systemPackages = [mako-wrapped];
}

View file

@ -1,72 +0,0 @@
{
config,
lib,
pkgs,
self,
...
}:
let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (lib.lists) singleton;
inherit (builtins) toJSON;
cfg = config.modules.system.services.matrix;
port = 4926;
domain = "faukah.com";
# Taken from Max Privatevoid.
serverFederation = pkgs.writeText "server_federation.json" (toJSON {
"m.server" = "matrix.${domain}:443";
});
clientFederation = pkgs.writeText "client_federation.json" (toJSON {
"m.homeserver".base_url = "https://matrix.${domain}";
});
in
{
options.modules.system.services.matrix.enable = mkEnableOption "matrix";
config = mkIf cfg.enable {
age.secrets.registrationToken.file = "${self}/secrets/tuwunel_token_file.age";
services = {
nginx = {
enable = true;
virtualHosts.${domain} = {
addSSL = true;
enableACME = true;
locations = {
"= /.well-known/matrix/server".alias = serverFederation;
"= /.well-known/matrix/client".alias = clientFederation;
};
};
virtualHosts."matrix.${domain}" = {
addSSL = true;
enableACME = true;
locations."/_matrix".proxyPass = "http://localhost:${toString port}";
};
};
matrix-tuwunel = {
enable = true;
package = pkgs.matrix-tuwunel;
settings = {
global = {
port = singleton port;
address = [
"127.0.0.1"
"::1"
];
server_name = domain;
allow_registration = true;
allow_federation = true;
allow_encryption = true;
new_user_displayname_suffix = "";
registration_token_file = config.age.secrets.registrationToken.path;
};
};
};
};
};
}

View file

@ -0,0 +1,11 @@
_: {
imports = [
./pipewire.nix
./locate.nix
./ssh.nix
./greetd.nix
./mako.nix
./mpd.nix
./firewall.nix
];
}

Some files were not shown because too many files have changed in this diff Show more