diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1d953f4 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.gitignore b/.gitignore index 153dfbb..d7d21f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ # nixos-rebuild buildvm --flake .# result *.qcow2 + +# direnv +.direnv diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 0000000..aaf3e03 --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,22 @@ +keys: + - &muon age1m97a3eptxwpdd7h5kkqe9gkmhg6rquc64qjmlsfqfhfqv8q72crqrylhgc + - &muho age1v4s4hg7u3vjjkarvrk7v6ev7w3wja2r5xm7f4t06culw3fuq7qns8sfju7 + - &mups age1n7qz2w3hkf7fcdv92kxw9k6uef487na2tlc87486rcjwj8lyfuws5q46gn + - &murk age1mgjhkqy9x27gv2t2xvq46dxcajkr9c8zes7rr3dj0ac7md2j6vas43dftp + +creation_rules: + - path_regex: modules/nixos/sops/secrets.ya?ml$ + key_groups: + - age: + - *muon + - *muho + - *mups + - *murk + + - path_regex: modules/home/sops/secrets.ya?ml$ + key_groups: + - age: + - *muon + - *muho + - *mups + - *murk diff --git a/README.md b/README.md new file mode 100644 index 0000000..10eb0b5 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# Installation + +```sh +sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount hosts/$(hostname)/disk-config.nix +sudo mkdir /tmp/mnt +sudo mount /dev/mapper/crypted /tmp/mnt +sudo btrfs subvolume snapshot -r /tmp/mnt/root /tmp/mnt/root-blank +sudo umount /tmp/mnt +sudo nixos-generate-config --no-filesystems --root /mnt +cp /mnt/etc/nixos/hardware-configuration.nix hosts/$(hostname)/hardware-configuration.nix +rbw config set email admin@muon.host +rbw config set base_url https://vault.muon.host +rbw login +sudo mkdir -p /mnt{,/persist}/var/lib/sops-nix +sudo chown muon:users /mnt/persist/var/lib/sops-nix -R +rbw get sops > /mnt/var/lib/sops-nix/key.txt +sudo cp {/mnt,/mnt/persist}/var/lib/sops-nix/key.txt +sudo nixos-install --root /mnt --no-root-passwd --flake .#$(hostname) +sudo cp -r /mnt/var/lib/nixos/* /mnt/persist/var/lib/nixos/ +sudo cp {/mnt,/mnt/persist}/etc/machine-id +``` + +# Impermanence + +## Erasure + +```nix + boot.initrd.postResumeCommands = lib.mkAfter '' + mkdir /btrfs_tmp + mount /dev/mapper/crypted /btrfs_tmp + if [[ -e /btrfs_tmp/root ]]; then + mkdir -p /btrfs_tmp/old_roots + timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") + mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" + fi + + delete_subvolume_recursively() { + IFS=$'\n' + for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do + delete_subvolume_recursively "/btrfs_tmp/$i" + done + btrfs subvolume delete "$1" + } + + for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do + delete_subvolume_recursively "$i" + done + + btrfs subvolume create /btrfs_tmp/root + umount /btrfs_tmp + ''; +``` diff --git a/_sources/generated.json b/_sources/generated.json new file mode 100644 index 0000000..e44d564 --- /dev/null +++ b/_sources/generated.json @@ -0,0 +1,437 @@ +{ + "valheim.aaacrafting": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.aaacrafting", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-cObo71X0wOzW3pZwAy7/dh7IRghu7EMPw7vWuoPWPlk=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Azumatt/AAA_Crafting/1.6.6/" + }, + "version": "1.6.6" + }, + "valheim.architect": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.architect", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-6H9zmahsKsjZITOAVzGQ6Fv4KN9HgwdjGUCLBp2pC3U=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/OdinPlus/OdinArchitect/1.5.0/" + }, + "version": "1.5.0" + }, + "valheim.arearepair": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.arearepair", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-5eRobZrlGB5ECpyXldYMOt+0xKzU9rBeCSVPIs3PZd8=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Azumatt/AzuAreaRepair/1.1.6/" + }, + "version": "1.1.6" + }, + "valheim.autostore": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.autostore", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-ooghhDinwLTwEpTTQFj/brdb9Yj5aLGr+zYsjrsq9A0=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Azumatt/AzuAutoStore/3.0.8/" + }, + "version": "3.0.8" + }, + "valheim.backpacks": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.backpacks", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-xSfcLisLLPALx6l1Rtbt10YFUo112HV2I6BO/zCjr5w=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Smoothbrain/Backpacks/1.3.6/" + }, + "version": "1.3.6" + }, + "valheim.betternetworking": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.betternetworking", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-krgZ4B+MbIG/3CQUMkVIB/xrvvW1TbxB0cp1KwCTBN4=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/CW_Jesse/BetterNetworking_Valheim/2.3.2/" + }, + "version": "2.3.2" + }, + "valheim.boneappetit": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.boneappetit", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-rqJWdsXKoxk49d4qyQ9s2cpcwOkEXJ80bL7UTxDa6fc=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/RockerKitten/BoneAppetit/3.3.1/" + }, + "version": "3.3.1" + }, + "valheim.campsite": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.campsite", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-r3HTjfNy7ehr6bsjddr6mTA7T8VVXRhDfulIodjc0jc=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/OdinPlus/OdinCampsite/1.5.8/" + }, + "version": "1.5.8" + }, + "valheim.cartography": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.cartography", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-u20BTiyF4e6QJ6OUK5migjdEpyzIGRDxLPJ3NdZNhvA=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Advize/CartographySkill/3.0.1/" + }, + "version": "3.0.1" + }, + "valheim.craftyboxes": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.craftyboxes", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-8bvHmONHuc9K0cgT42+W4oxQ6MusAv8v0IIVMerdYSA=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Azumatt/AzuCraftyBoxes/1.8.4/" + }, + "version": "1.8.4" + }, + "valheim.customships": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.customships", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-pUSd1DHQVTyN83ur1AmL8duEYk07otAZ8deDX4YaViU=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/MSchmoecker/CustomShips/0.4.1/" + }, + "version": "0.4.1" + }, + "valheim.extendedinv": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.extendedinv", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-Xd7KdUm3c14iQBST31DAqs+bQF9hwYhUxE66o3lusrA=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Azumatt/AzuExtendedPlayerInventory/1.4.9/" + }, + "version": "1.4.9" + }, + "valheim.foodmove": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.foodmove", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-O4hboEOetIA/xQkTmDMTMoSAxdtB4XfdlqBr8Ai/CvM=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/sbtoonz/Food_Degrade_Only_On_Move/1.0.1/" + }, + "version": "1.0.1" + }, + "valheim.jotunn": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.jotunn", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-Tso4/Sf4Evt5kpBrVqZrjE9Qs2MSZV04WB1w+uX+TX8=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/ValheimModding/Jotunn/2.25.0/" + }, + "version": "2.25.0" + }, + "valheim.jsondotnet": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.jsondotnet", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-OZgL/KKR5JP5PL6lq4hqqKtmhNzgyWIM0y6lXw5sQls=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/ValheimModding/JsonDotNET/13.0.4/" + }, + "version": "13.0.4" + }, + "valheim.lazyvikings": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.lazyvikings", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-6pkQ0q267r2y1+WSfnnBdf7XAhG+i8Mux+Noo+w2A3s=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/blacks7ar/LazyVikings/1.2.1/" + }, + "version": "1.2.1" + }, + "valheim.mining": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.mining", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-SxQ+Z4T5Hg5w4X4+L++eArWZXhoXuarecKl6gdpcpNQ=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Smoothbrain/Mining/1.1.5/" + }, + "version": "1.1.5" + }, + "valheim.missingpieces": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.missingpieces", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-Q6CPQp7C9+LyXIotiUhz3zRR0oze6FaugswVE4V6g7o=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/BentoG/MissingPieces/2.2.2/" + }, + "version": "2.2.2" + }, + "valheim.multiuserchest": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.multiuserchest", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-PhXW6vBtEMnhE93RAALEucPU9q3VpdMrooFawWYXl2A=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/MSchmoecker/MultiUserChest/0.6.1/" + }, + "version": "0.6.1" + }, + "valheim.planteasily": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.planteasily", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-HvjwiVBWs723LhHR7Xk6knugOU8eQewGiV+mZaAN5YU=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Advize/PlantEasily/2.0.3/" + }, + "version": "2.0.3" + }, + "valheim.quickteleport": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.quickteleport", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-YSAVthV994do/atQA+wGfillXeSYFlLJK6VyMcQNVKE=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/OdinPlus/QuickTeleport/1.1.0/" + }, + "version": "1.1.0" + }, + "valheim.reclaim": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.reclaim", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-2cWdmspwid2h1ekfDFAngN25402pQnxZQhm4rX6BNhw=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Azumatt/Recycle_N_Reclaim/1.3.6/" + }, + "version": "1.3.6" + }, + "valheim.savecrossbow": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.savecrossbow", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-AIgmeE9HZYOIFl4jZ2eL3tdFtrpHpGFAmYTt8IG7shU=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Azumatt/SaveCrossbowState/1.0.1/" + }, + "version": "1.0.1" + }, + "valheim.seedbed": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.seedbed", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-wm2gGSyMQ6r3lLpbpXtZYG7s+fFYvw5nZGmSW54Ayt4=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/blacks7ar/SeedBed/1.2.7/" + }, + "version": "1.2.7" + }, + "valheim.servercharacters": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.servercharacters", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-aSB+G4nK3gf0yvMYWbICMFe3A0aCSr7nBH45G9ZdE9g=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Smoothbrain/ServerCharacters/1.4.16/" + }, + "version": "1.4.16" + }, + "valheim.smoothsave": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.smoothsave", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-v5Zn+0O0au8VDzO+302oCE7Z9s87I3nq+eK2WbVVyFo=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Smoothbrain/SmoothSave/1.0.5/" + }, + "version": "1.0.5" + }, + "valheim.spearfishing": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.spearfishing", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-8hnK1sosF1cZGcHtq7w1y2WmWpqDuHDGrYDD2titSc8=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Korppis/Spearfishing/1.0.4/" + }, + "version": "1.0.4" + }, + "valheim.swim": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.swim", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-QCEYnx0I6onWEAJy851wS0WdC35L18DyJL1wAAwHFaU=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/blacks7ar/VikingsDoSwim/1.3.8/" + }, + "version": "1.3.8" + }, + "valheim.swimequip": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.swimequip", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-UotiInuJAZsR1sL9aquTBQf7sw5kzG+2fG8QlFl+2Fc=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/blacks7ar/WieldEquipmentWhileSwimming/1.1.2/" + }, + "version": "1.1.2" + }, + "valheim.targetportal": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "valheim.targetportal", + "passthru": null, + "pinned": false, + "src": { + "sha256": "sha256-6rfc+/4a55pIP2hIjwlggS2kqnqGhyCmRW8r+2OHhB4=", + "type": "tarball", + "url": "https://thunderstore.io/package/download/Smoothbrain/TargetPortal/1.2.0/" + }, + "version": "1.2.0" + }, + "vesktop.micfix": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "vesktop.micfix", + "passthru": null, + "pinned": false, + "src": { + "name": null, + "sha256": "sha256-eNOKW43LQdJp2GFHqe3RxAhMwkNulrotIOMByosen84=", + "type": "url", + "url": "https://codeberg.org/muon/gists/raw/branch/main/micfix.patch" + }, + "version": "1.0.1" + } +} \ No newline at end of file diff --git a/_sources/generated.nix b/_sources/generated.nix new file mode 100644 index 0000000..c6511a1 --- /dev/null +++ b/_sources/generated.nix @@ -0,0 +1,252 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: +{ + "valheim.aaacrafting" = { + pname = "valheim.aaacrafting"; + version = "1.6.6"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Azumatt/AAA_Crafting/1.6.6/"; + sha256 = "sha256-cObo71X0wOzW3pZwAy7/dh7IRghu7EMPw7vWuoPWPlk="; + }; + }; + "valheim.architect" = { + pname = "valheim.architect"; + version = "1.5.0"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/OdinPlus/OdinArchitect/1.5.0/"; + sha256 = "sha256-6H9zmahsKsjZITOAVzGQ6Fv4KN9HgwdjGUCLBp2pC3U="; + }; + }; + "valheim.arearepair" = { + pname = "valheim.arearepair"; + version = "1.1.6"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Azumatt/AzuAreaRepair/1.1.6/"; + sha256 = "sha256-5eRobZrlGB5ECpyXldYMOt+0xKzU9rBeCSVPIs3PZd8="; + }; + }; + "valheim.autostore" = { + pname = "valheim.autostore"; + version = "3.0.8"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Azumatt/AzuAutoStore/3.0.8/"; + sha256 = "sha256-ooghhDinwLTwEpTTQFj/brdb9Yj5aLGr+zYsjrsq9A0="; + }; + }; + "valheim.backpacks" = { + pname = "valheim.backpacks"; + version = "1.3.6"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Smoothbrain/Backpacks/1.3.6/"; + sha256 = "sha256-xSfcLisLLPALx6l1Rtbt10YFUo112HV2I6BO/zCjr5w="; + }; + }; + "valheim.betternetworking" = { + pname = "valheim.betternetworking"; + version = "2.3.2"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/CW_Jesse/BetterNetworking_Valheim/2.3.2/"; + sha256 = "sha256-krgZ4B+MbIG/3CQUMkVIB/xrvvW1TbxB0cp1KwCTBN4="; + }; + }; + "valheim.boneappetit" = { + pname = "valheim.boneappetit"; + version = "3.3.1"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/RockerKitten/BoneAppetit/3.3.1/"; + sha256 = "sha256-rqJWdsXKoxk49d4qyQ9s2cpcwOkEXJ80bL7UTxDa6fc="; + }; + }; + "valheim.campsite" = { + pname = "valheim.campsite"; + version = "1.5.8"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/OdinPlus/OdinCampsite/1.5.8/"; + sha256 = "sha256-r3HTjfNy7ehr6bsjddr6mTA7T8VVXRhDfulIodjc0jc="; + }; + }; + "valheim.cartography" = { + pname = "valheim.cartography"; + version = "3.0.1"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Advize/CartographySkill/3.0.1/"; + sha256 = "sha256-u20BTiyF4e6QJ6OUK5migjdEpyzIGRDxLPJ3NdZNhvA="; + }; + }; + "valheim.craftyboxes" = { + pname = "valheim.craftyboxes"; + version = "1.8.4"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Azumatt/AzuCraftyBoxes/1.8.4/"; + sha256 = "sha256-8bvHmONHuc9K0cgT42+W4oxQ6MusAv8v0IIVMerdYSA="; + }; + }; + "valheim.customships" = { + pname = "valheim.customships"; + version = "0.4.1"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/MSchmoecker/CustomShips/0.4.1/"; + sha256 = "sha256-pUSd1DHQVTyN83ur1AmL8duEYk07otAZ8deDX4YaViU="; + }; + }; + "valheim.extendedinv" = { + pname = "valheim.extendedinv"; + version = "1.4.9"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Azumatt/AzuExtendedPlayerInventory/1.4.9/"; + sha256 = "sha256-Xd7KdUm3c14iQBST31DAqs+bQF9hwYhUxE66o3lusrA="; + }; + }; + "valheim.foodmove" = { + pname = "valheim.foodmove"; + version = "1.0.1"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/sbtoonz/Food_Degrade_Only_On_Move/1.0.1/"; + sha256 = "sha256-O4hboEOetIA/xQkTmDMTMoSAxdtB4XfdlqBr8Ai/CvM="; + }; + }; + "valheim.jotunn" = { + pname = "valheim.jotunn"; + version = "2.25.0"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/ValheimModding/Jotunn/2.25.0/"; + sha256 = "sha256-Tso4/Sf4Evt5kpBrVqZrjE9Qs2MSZV04WB1w+uX+TX8="; + }; + }; + "valheim.jsondotnet" = { + pname = "valheim.jsondotnet"; + version = "13.0.4"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/ValheimModding/JsonDotNET/13.0.4/"; + sha256 = "sha256-OZgL/KKR5JP5PL6lq4hqqKtmhNzgyWIM0y6lXw5sQls="; + }; + }; + "valheim.lazyvikings" = { + pname = "valheim.lazyvikings"; + version = "1.2.1"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/blacks7ar/LazyVikings/1.2.1/"; + sha256 = "sha256-6pkQ0q267r2y1+WSfnnBdf7XAhG+i8Mux+Noo+w2A3s="; + }; + }; + "valheim.mining" = { + pname = "valheim.mining"; + version = "1.1.5"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Smoothbrain/Mining/1.1.5/"; + sha256 = "sha256-SxQ+Z4T5Hg5w4X4+L++eArWZXhoXuarecKl6gdpcpNQ="; + }; + }; + "valheim.missingpieces" = { + pname = "valheim.missingpieces"; + version = "2.2.2"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/BentoG/MissingPieces/2.2.2/"; + sha256 = "sha256-Q6CPQp7C9+LyXIotiUhz3zRR0oze6FaugswVE4V6g7o="; + }; + }; + "valheim.multiuserchest" = { + pname = "valheim.multiuserchest"; + version = "0.6.1"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/MSchmoecker/MultiUserChest/0.6.1/"; + sha256 = "sha256-PhXW6vBtEMnhE93RAALEucPU9q3VpdMrooFawWYXl2A="; + }; + }; + "valheim.planteasily" = { + pname = "valheim.planteasily"; + version = "2.0.3"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Advize/PlantEasily/2.0.3/"; + sha256 = "sha256-HvjwiVBWs723LhHR7Xk6knugOU8eQewGiV+mZaAN5YU="; + }; + }; + "valheim.quickteleport" = { + pname = "valheim.quickteleport"; + version = "1.1.0"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/OdinPlus/QuickTeleport/1.1.0/"; + sha256 = "sha256-YSAVthV994do/atQA+wGfillXeSYFlLJK6VyMcQNVKE="; + }; + }; + "valheim.reclaim" = { + pname = "valheim.reclaim"; + version = "1.3.6"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Azumatt/Recycle_N_Reclaim/1.3.6/"; + sha256 = "sha256-2cWdmspwid2h1ekfDFAngN25402pQnxZQhm4rX6BNhw="; + }; + }; + "valheim.savecrossbow" = { + pname = "valheim.savecrossbow"; + version = "1.0.1"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Azumatt/SaveCrossbowState/1.0.1/"; + sha256 = "sha256-AIgmeE9HZYOIFl4jZ2eL3tdFtrpHpGFAmYTt8IG7shU="; + }; + }; + "valheim.seedbed" = { + pname = "valheim.seedbed"; + version = "1.2.7"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/blacks7ar/SeedBed/1.2.7/"; + sha256 = "sha256-wm2gGSyMQ6r3lLpbpXtZYG7s+fFYvw5nZGmSW54Ayt4="; + }; + }; + "valheim.servercharacters" = { + pname = "valheim.servercharacters"; + version = "1.4.16"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Smoothbrain/ServerCharacters/1.4.16/"; + sha256 = "sha256-aSB+G4nK3gf0yvMYWbICMFe3A0aCSr7nBH45G9ZdE9g="; + }; + }; + "valheim.smoothsave" = { + pname = "valheim.smoothsave"; + version = "1.0.5"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Smoothbrain/SmoothSave/1.0.5/"; + sha256 = "sha256-v5Zn+0O0au8VDzO+302oCE7Z9s87I3nq+eK2WbVVyFo="; + }; + }; + "valheim.spearfishing" = { + pname = "valheim.spearfishing"; + version = "1.0.4"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Korppis/Spearfishing/1.0.4/"; + sha256 = "sha256-8hnK1sosF1cZGcHtq7w1y2WmWpqDuHDGrYDD2titSc8="; + }; + }; + "valheim.swim" = { + pname = "valheim.swim"; + version = "1.3.8"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/blacks7ar/VikingsDoSwim/1.3.8/"; + sha256 = "sha256-QCEYnx0I6onWEAJy851wS0WdC35L18DyJL1wAAwHFaU="; + }; + }; + "valheim.swimequip" = { + pname = "valheim.swimequip"; + version = "1.1.2"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/blacks7ar/WieldEquipmentWhileSwimming/1.1.2/"; + sha256 = "sha256-UotiInuJAZsR1sL9aquTBQf7sw5kzG+2fG8QlFl+2Fc="; + }; + }; + "valheim.targetportal" = { + pname = "valheim.targetportal"; + version = "1.2.0"; + src = fetchTarball { + url = "https://thunderstore.io/package/download/Smoothbrain/TargetPortal/1.2.0/"; + sha256 = "sha256-6rfc+/4a55pIP2hIjwlggS2kqnqGhyCmRW8r+2OHhB4="; + }; + }; + "vesktop.micfix" = { + pname = "vesktop.micfix"; + version = "1.0.1"; + src = fetchurl { + url = "https://codeberg.org/muon/gists/raw/branch/main/micfix.patch"; + sha256 = "sha256-eNOKW43LQdJp2GFHqe3RxAhMwkNulrotIOMByosen84="; + }; + }; +} diff --git a/flake.lock b/flake.lock index f847322..167bba0 100644 --- a/flake.lock +++ b/flake.lock @@ -1,33 +1,15 @@ { "nodes": { - "actual": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1733551027, - "narHash": "sha256-nlZWAq4E+cNywCuxpnYcyky4fd+8bVzJHrS2e8QTtVs=", - "ref": "refs/heads/main", - "rev": "7f041ffa7f204deb0fc2e36908b382804f2e108d", - "revCount": 18, - "type": "git", - "url": "https://git.xeno.science/xenofem/actual-nix.git" - }, - "original": { - "type": "git", - "url": "https://git.xeno.science/xenofem/actual-nix.git" - } - }, "base16": { "inputs": { "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1732200724, - "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "153d52373b0fb2d343592871009a286ec8837aec", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", "type": "github" }, "original": { @@ -55,11 +37,11 @@ "base16-helix": { "flake": false, "locked": { - "lastModified": 1725860795, - "narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=", + "lastModified": 1752979451, + "narHash": "sha256-0CQM+FkYy0fOO/sMGhOoNL80ftsAzYCg9VhIrodqusM=", "owner": "tinted-theming", "repo": "base16-helix", - "rev": "7f795bf75d38e0eea9fed287264067ca187b88a9", + "rev": "27cf1e66e50abc622fb76a3019012dc07c678fac", "type": "github" }, "original": { @@ -71,26 +53,43 @@ "base16-vim": { "flake": false, "locked": { - "lastModified": 1731949548, - "narHash": "sha256-XIDexXM66sSh5j/x70e054BnUsviibUShW7XhbDGhYo=", + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", "owner": "tinted-theming", "repo": "base16-vim", - "rev": "61165b1632409bd55e530f3dbdd4477f011cadc6", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", "type": "github" }, "original": { "owner": "tinted-theming", "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1756083905, + "narHash": "sha256-UqYGTBgI5ypGh0Kf6zZjom/vABg7HQocB4gmxzl12uo=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "b655eaf16d4cbec9c3472f62eee285d4b419a808", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", "type": "github" } }, "flake-compat": { "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "owner": "edolstra", "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "type": "github" }, "original": { @@ -102,11 +101,11 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "type": "github" }, "original": { @@ -118,16 +117,58 @@ "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "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" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nvf", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", "type": "github" }, "original": { - "owner": "edolstra", - "repo": "flake-compat", + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", "type": "github" } }, @@ -149,63 +190,6 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "inputs": { - "systems": [ - "stylix", - "systems" - ] - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "fromYaml": { "flake": false, "locked": { @@ -225,16 +209,16 @@ "gnome-shell": { "flake": false, "locked": { - "lastModified": 1732369855, - "narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=", + "lastModified": 1748186689, + "narHash": "sha256-UaD7Y9f8iuLBMGHXeJlRu6U1Ggw5B9JnkFs3enZlap0=", "owner": "GNOME", "repo": "gnome-shell", - "rev": "dadd58f630eeea41d645ee225a63f719390829dc", + "rev": "8c88f917db0f1f0d80fa55206c863d3746fa18d0", "type": "github" }, "original": { "owner": "GNOME", - "ref": "47.2", + "ref": "48.2", "repo": "gnome-shell", "type": "github" } @@ -246,11 +230,11 @@ ] }, "locked": { - "lastModified": 1735774425, - "narHash": "sha256-C73gLFnEh8ZI0uDijUgCDWCd21T6I6tsaWgIBHcfAXg=", + "lastModified": 1758810399, + "narHash": "sha256-bpWoE1tiFX5T1tr5EudkpW9Kk02XR+6olkoSkf3nHZU=", "owner": "nix-community", "repo": "home-manager", - "rev": "5f6aa268e419d053c3d5025da740e390b12ac936", + "rev": "39d26c16866260eee6d0487fe9c102ba1c1bf7b2", "type": "github" }, "original": { @@ -262,16 +246,16 @@ "home-manager_2": { "inputs": { "nixpkgs": [ - "stylix", + "zen-browser", "nixpkgs" ] }, "locked": { - "lastModified": 1733085484, - "narHash": "sha256-dVmNuUajnU18oHzBQWZm1BQtANCHaqNuxTHZQ+GN0r8=", + "lastModified": 1752603129, + "narHash": "sha256-S+wmHhwNQ5Ru689L2Gu8n1OD6s9eU9n9mD827JNR+kw=", "owner": "nix-community", "repo": "home-manager", - "rev": "c1fee8d4a60b89cae12b288ba9dbc608ff298163", + "rev": "e8c19a3cec2814c754f031ab3ae7316b64da085b", "type": "github" }, "original": { @@ -280,20 +264,48 @@ "type": "github" } }, + "impermanence": { + "locked": { + "lastModified": 1737831083, + "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, + "mnw": { + "locked": { + "lastModified": 1756659871, + "narHash": "sha256-v6Rh4aQ6RKjM2N02kK9Usn0Ix7+OY66vNpeklc1MnGE=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "ed6cc3e48557ba18266e598a5ebb6602499ada16", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, "nix-alien": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nix-filter": "nix-filter", "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1734239219, - "narHash": "sha256-iKY/OGNANXpd9hXBGfx8vObpHW4IcOH0MrerLCCc7hA=", + "lastModified": 1757920634, + "narHash": "sha256-MNxTc+dncIHFGKQRyAqI/Clttp3JICaSUKlMUQ6l9jc=", "owner": "thiagokokada", "repo": "nix-alien", - "rev": "a266d0f74dd4a82ec6a72b02fbf3fbc5f7105f15", + "rev": "f8a51ef800bc8b7420998415035f9c086eb64d5c", "type": "github" }, "original": { @@ -302,21 +314,6 @@ "type": "github" } }, - "nix-filter": { - "locked": { - "lastModified": 1731533336, - "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -325,11 +322,11 @@ ] }, "locked": { - "lastModified": 1734234111, - "narHash": "sha256-icEMqBt4HtGH52PU5FHidgBrNJvOfXH6VQKNtnD1aw8=", + "lastModified": 1757822619, + "narHash": "sha256-3HIpe3P2h1AUPYcAH9cjuX0tZOqJpX01c0iDwoUYNZ8=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "311d6cf3ad3f56cb051ffab1f480b2909b3f754d", + "rev": "050a5feb5d1bb5b6e5fc04a7d3d816923a87c9ea", "type": "github" }, "original": { @@ -341,15 +338,15 @@ "nix-minecraft": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3" + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1720748198, - "narHash": "sha256-2AxCoCoBnFJcZjp9Se7W7JgQ88rwMLUwi5EAcsj5B9I=", + "lastModified": 1750164803, + "narHash": "sha256-aLDTGNh84IcJTT9m380uW3wHogKbHcTcK9uUunALdNU=", "ref": "refs/heads/main", - "rev": "a1ab2a1353a38a6642fbc69f118adc08faf7dbcb", - "revCount": 628, + "rev": "efaa1a2497ce1988d9b3bc7bb395abdf8177e0a3", + "revCount": 925, "type": "git", "url": "https://codeberg.org/nix-astral/nix-minecraft.git" }, @@ -360,11 +357,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728492678, - "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", + "lastModified": 1757745802, + "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", + "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1", "type": "github" }, "original": { @@ -376,15 +373,15 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1733940404, - "narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=", - "owner": "NixOS", + "lastModified": 1748929857, + "narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713", + "rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -392,11 +389,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1715266358, - "narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=", - "owner": "nixos", + "lastModified": 1760773850, + "narHash": "sha256-skbm70mjURx9k0iGIN1aUm09b0n3QbFw2gCpG0A5mEI=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "f1010e0469db743d14519a1efd37e23f8513d714", + "rev": "df05dcceaf4d6a5f2caeda75da00de370d8c14e6", "type": "github" }, "original": { @@ -408,79 +405,121 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1735471104, - "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=", - "owner": "nixos", + "lastModified": 1756819007, + "narHash": "sha256-12V64nKG/O/guxSYnr5/nq1EfqwJCdD2+cIGmhz3nrE=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4", + "rev": "aaff8c16d7fc04991cac6245bee1baa31f72b1e1", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_5": { + "nur": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1622516815, - "narHash": "sha256-ZjBd81a6J3TwtlBr3rHsZspYUwT9OdhDk+a/SgSEf7I=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "7e9b0dff974c89e070da1ad85713ff3c20b0ca97", + "lastModified": 1756961635, + "narHash": "sha256-hETvQcILTg5kChjYNns1fD5ELdsYB/VVgVmBtqKQj9A=", + "owner": "nix-community", + "repo": "NUR", + "rev": "6ca27b2654ac55e3f6e0ca434c1b4589ae22b370", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "21.05", - "repo": "nixpkgs", + "owner": "nix-community", + "repo": "NUR", "type": "github" } }, - "nixpkgs_6": { + "nvf": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-parts": "flake-parts", + "mnw": "mnw", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2" + }, "locked": { - "lastModified": 1732238832, - "narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", + "lastModified": 1758271661, + "narHash": "sha256-ENqd2/33uP5vB44ClDjjAV+J78oF8q1er4QUZuT8Z7g=", + "owner": "NotAShelf", + "repo": "nvf", + "rev": "b7571df4d6e9ac08506a738ddceeec0b141751b0", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "NotAShelf", + "repo": "nvf", "type": "github" } }, "root": { "inputs": { - "actual": "actual", "home-manager": "home-manager", + "impermanence": "impermanence", "nix-alien": "nix-alien", "nix-minecraft": "nix-minecraft", - "nixpkgs": "nixpkgs_4", - "shabitica": "shabitica", - "stylix": "stylix" + "nixpkgs": "nixpkgs_3", + "nvf": "nvf", + "sops-nix": "sops-nix", + "stylix": "stylix", + "valheim-server": "valheim-server", + "zen-browser": "zen-browser" } }, - "shabitica": { + "sops-nix": { "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_5" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1724518687, - "narHash": "sha256-rPKeUG3aKLHF/9t5zAQPvy/QKm/eBXFKP6X+Cr9E7Go=", - "owner": "lomenzel", - "repo": "shabitica", - "rev": "6013624a276b326530ebf8c616fc89e2f23fd3af", + "lastModified": 1758425756, + "narHash": "sha256-L3N8zV6wsViXiD8i3WFyrvjDdz76g3tXKEdZ4FkgQ+Y=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "e0fdaea3c31646e252a60b42d0ed8eafdb289762", "type": "github" }, "original": { - "owner": "lomenzel", - "repo": "shabitica", + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "steam-fetcher": { + "inputs": { + "nixpkgs": [ + "valheim-server", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714795926, + "narHash": "sha256-PkgC9jqoN6cJ8XYzTA2PlrWs7aPJkM3BGiTxNqax0cA=", + "owner": "nix-community", + "repo": "steam-fetcher", + "rev": "12f66eafb7862d91b3e30c14035f96a21941bd9c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "steam-fetcher", "type": "github" } }, @@ -490,22 +529,24 @@ "base16-fish": "base16-fish", "base16-helix": "base16-helix", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-parts": "flake-parts_2", "gnome-shell": "gnome-shell", - "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_6", - "systems": "systems_4", + "nixpkgs": "nixpkgs_4", + "nur": "nur", + "systems": "systems_3", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", - "tinted-tmux": "tinted-tmux" + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1735764504, - "narHash": "sha256-shMdOkQzR9jIK3TW6XaesOea1rHwxWIFFOhIRhuCF4Y=", + "lastModified": 1758757969, + "narHash": "sha256-2zC4aHoDsR12Jyd6WvSxmQbAKT4V93frnHHDjA8o3r8=", "owner": "danth", "repo": "stylix", - "rev": "911c07f40f816fd2d12a7dd750ca8bc421db9dd2", + "rev": "484819a16fdc1c76cdd62d8e94018db44e5e1a8b", "type": "github" }, "original": { @@ -559,21 +600,6 @@ "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tinted-foot": { "flake": false, "locked": { @@ -594,28 +620,43 @@ "tinted-kitty": { "flake": false, "locked": { - "lastModified": 1716423189, - "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", "owner": "tinted-theming", "repo": "tinted-kitty", - "rev": "eb39e141db14baef052893285df9f266df041ff8", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", "type": "github" }, "original": { "owner": "tinted-theming", "repo": "tinted-kitty", - "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1754779259, + "narHash": "sha256-8KG2lXGaXLUE0F/JVwLQe7kOVm21IDfNEo0gfga5P4M=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "097d751b9e3c8b97ce158e7d141e5a292545b502", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", "type": "github" } }, "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1729501581, - "narHash": "sha256-1ohEFMC23elnl39kxWnjzH1l2DFWWx4DhFNNYDTYt54=", + "lastModified": 1754788770, + "narHash": "sha256-LAu5nBr7pM/jD9jwFc6/kyFY4h7Us4bZz7dvVvehuwo=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "f0e7f7974a6441033eb0a172a0342e96722b4f14", + "rev": "fb2175accef8935f6955503ec9dd3c973eec385c", "type": "github" }, "original": { @@ -623,6 +664,64 @@ "repo": "tinted-tmux", "type": "github" } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1755613540, + "narHash": "sha256-zBFrrTxHLDMDX/OYxkCwGGbAhPXLi8FrnLhYLsSOKeY=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "937bada16cd3200bdbd3a2f5776fc3b686d5cba0", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, + "valheim-server": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "steam-fetcher": "steam-fetcher" + }, + "locked": { + "lastModified": 1744964760, + "narHash": "sha256-VSy6SZqDDMqrFlf6gw3xA/u3WEu3thjGOh3akIJEWW4=", + "owner": "kmjayadeep", + "repo": "valheim-server-flake", + "rev": "5b95198dca8af8287108b610432d88aef5fa29fc", + "type": "github" + }, + "original": { + "owner": "kmjayadeep", + "repo": "valheim-server-flake", + "type": "github" + } + }, + "zen-browser": { + "inputs": { + "home-manager": "home-manager_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760843785, + "narHash": "sha256-lp6xctqGBNKZ3pmRlALX1puVG7EKQa4xAq+2leThDKw=", + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "rev": "a36f9da8a234b59dd5fc4484e37dadae2aa75b80", + "type": "github" + }, + "original": { + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 7aa9a8f..24547ee 100644 --- a/flake.nix +++ b/flake.nix @@ -5,98 +5,108 @@ home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + sops-nix.url = "github:Mic92/sops-nix"; + sops-nix.inputs.nixpkgs.follows = "nixpkgs"; + + impermanence.url = "github:nix-community/impermanence"; + stylix.url = "github:danth/stylix"; - # nix-minecraft.url = "git+ssh://git@codeberg.org/nix-astral/nix-minecraft.git"; - nix-minecraft.url = "git+https://codeberg.org/nix-astral/nix-minecraft.git"; - shabitica.url = "github:lomenzel/shabitica"; - actual.url = "git+https://git.xeno.science/xenofem/actual-nix.git"; nix-alien.url = "github:thiagokokada/nix-alien"; + + nvf = { + url = "github:NotAShelf/nvf"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-minecraft.url = "git+https://codeberg.org/nix-astral/nix-minecraft.git"; + # nix-minecraft.url = "github:Infinidoge/nix-minecraft"; + valheim-server.url = "github:kmjayadeep/valheim-server-flake"; + valheim-server.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = inputs@{ nixpkgs, home-manager, stylix, ... }: - let - system = "x86_64-linux"; + outputs = inputs @ { + nixpkgs, + home-manager, + stylix, + ... + }: let + system = "x86_64-linux"; - pkgs' = (import inputs.nixpkgs { inherit system; }).applyPatches { - name = "nixpkgs-unstable-patched"; - src = inputs.nixpkgs; - patches = [ - (builtins.fetchurl { - url = - "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/369042.patch"; - sha256 = - "sha256:08asxmd34rzaxb8dr4nccy26k3vxnx7psy2imnp40fdplqna0a85"; - }) - (builtins.fetchurl { - url = - "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/368790.patch"; - sha256 = - "sha256:1blsawm4l30wkrdkvvq0fw2aki7v921isdwrk9dw8yh09cglbfd9"; - }) - (builtins.fetchurl { - url = - "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/368091.patch"; - sha256 = - "sha256:11qnwrq8sgbmxiy9qvv7q2lbl824x90p2iklf3kjf9yb3c2dx9nj"; - }) + pkgs = import inputs.nixpkgs {inherit system;}; + + sources = import ./_sources/generated.nix { + inherit (pkgs) fetchurl fetchgit fetchFromGitHub dockerTools; + }; + + utils = import ./utils.nix {inherit inputs system sources;}; + in { + nixosConfigurations = { + # desktop + muon = utils.mkHost ./hosts/muon/configuration.nix; + + # laptop + muop = utils.mkHost ./hosts/muop/configuration.nix; + + # vps + muho = utils.mkHost ./hosts/muho/configuration.nix; + + # vps + mups = utils.mkHost ./hosts/mups/configuration.nix; + + # vm + muvm = utils.mkHost ./hosts/muvm/configuration.nix; + + # work + murk = utils.mkHost ./hosts/murk/configuration.nix; + + # installer + muin = utils.mkHost ./hosts/muin/configuration.nix; + }; + + homeManagerModules.default = ./modules/home; + + colmena = { + meta = { + nixpkgs = import inputs.nixpkgs {inherit system;}; + + specialArgs = {inherit nixpkgs inputs system sources;}; + }; + + # Remote host name + "mups" = { + name, + nodes, + ... + }: { + deployment.targetHost = "muon.host"; # SSH IP + deployment.targetUser = "root"; # SSH username + + # modules + imports = [ + ./hosts/mups/configuration.nix + ./modules/nixos + inputs.home-manager.nixosModules.default + inputs.stylix.nixosModules.stylix ]; }; - pkgs = import pkgs' { inherit system; }; - utils = import ./utils.nix { inherit builtins inputs system pkgs; }; - in { - nixosConfigurations = { - # desktop - muon = utils.mkHost ./hosts/muon/configuration.nix; + # "muho" = { name, nodes, ... }: { + # deployment.targetHost = "muho"; # SSH IP + # deployment.targetUser = "muon"; # SSH username - # laptop - muop = utils.mkHost ./hosts/muop/configuration.nix; - - # vps - muho = utils.mkHost ./hosts/muho/configuration.nix; - - # vps - mups = utils.mkHost ./hosts/mups/configuration.nix; - - # vm - muvm = utils.mkHost ./hosts/muvm/configuration.nix; - }; - - homeManagerModules.default = ./modules/home; - - colmena = { - meta = { - nixpkgs = import inputs.nixpkgs { inherit system; }; - - specialArgs = { inherit nixpkgs inputs system; }; - }; - - # Remote host name - "mups" = { name, nodes, ... }: { - deployment.targetHost = "muon.host"; # SSH IP - deployment.targetUser = "root"; # SSH username - - # modules - imports = [ - ./hosts/mups/configuration.nix - ./modules/nixos - inputs.home-manager.nixosModules.default - inputs.stylix.nixosModules.stylix - ]; - }; - - # "muho" = { name, nodes, ... }: { - # deployment.targetHost = "muho"; # SSH IP - # deployment.targetUser = "muon"; # SSH username - - # # modules - # imports = [ - # ./hosts/muho/configuration.nix - # ./modules/nixos - # inputs.home-manager.nixosModules.default - # inputs.stylix.nixosModules.stylix - # ]; - # }; - }; + # # modules + # imports = [ + # ./hosts/muho/configuration.nix + # ./modules/nixos + # inputs.home-manager.nixosModules.default + # inputs.stylix.nixosModules.stylix + # ]; + # }; }; + }; } diff --git a/hosts/muho/configuration.nix b/hosts/muho/configuration.nix index 735e33b..e4717a5 100644 --- a/hosts/muho/configuration.nix +++ b/hosts/muho/configuration.nix @@ -1,5 +1,11 @@ { config, lib, pkgs, inputs, system, ... }: -let cfg = config.mods; +let + cfg = config.mods; + keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKEio+Y5wBVD1wILaH2R3wV10FvVjiqy/4gGBWHOITTB muon@muon" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKevYmkH7xvYoquBjnYZ7PJiVqf+GOh9fxAJBN6wZGBB gin4@hi.is" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILmAOd9VbhyJeibt6Vrb101MNTk5W8+rh94Djv/C+pyu muon@muho" + ]; in { # Hardware imports = [ ./hardware-configuration.nix ../ports.nix ]; @@ -29,16 +35,37 @@ in { mods.server.reddit.enable = true; mods.server.grav.enable = true; + mods.server.homebox.enable = true; + mods.server.share.enable = false; + mods.server.vault.enable = true; + mods.server.git.enable = true; + mods.server.cal.enable = true; + mods.server.chat.enable = false; + mods.server.ntfy.enable = true; + mods.server.lemmy.enable = true; + mods.server.audio.enable = true; + mods.server.atuin.enable = true; + + mods.server.dash.enable = false; + mods.server.nginx.ports.dash = 3009; mods.tailscale.enable = true; mods.wireguard.id = 3; services.xserver.windowManager.i3.enable = false; + users.users.muon.openssh.authorizedKeys.keys = keys; + users.users.root.openssh.authorizedKeys.keys = keys; + # Proprietary /tmp/ss.png;if [ ! -s /tmp/ss.png ]; then + exit 1 + fi + AUTH=$(cat ${config.sops.secrets.zipline-auth.path}) + curl -H "authorization: $AUTH" https://share.muon.host/api/upload -F file=@/tmp/ss.png -H "Content-Type: multipart/form-data" -H "Format: date" -H "Image-Compression-Percent: 90" -H "No-JSON: true" | tr -d '\n' | xsel -ib; + ''; + }; + zmenu = with pkgs; + writeShellApplication { + name = "zmenu"; + runtimeInputs = [zellij zoxide wmctrl i3 rofi alacritty zsh]; + text = '' + ZPATH=$(zoxide query -l | sed -e "s|$HOME/||g" | rofi -dmenu) + [[ -z "$ZPATH" ]] && exit + ZSESH=$(echo "$ZPATH" | tr / -) + ZWIND=$(wmctrl -l | grep "$ZSESH" || echo "") + cd "$ZPATH" + if [[ -z "$ZWIND" ]]; then + alacritty -T "$ZSESH" -e zsh -c "zellij -s $ZSESH -n dev || zellij a $ZSESH" + else + wmctrl -a "$ZSESH" + fi + ''; + }; +in + with lib; { + options.mods.i3.enable = mkEnableOption "enables i3"; + options.mods.battery.enable = mkEnableOption "enables battery"; - config = lib.mkIf config.mods.i3.enable { - services.unclutter.enable = true; - programs.rofi.enable = true; + config = mkIf config.mods.i3.enable { + services.unclutter.enable = true; + programs.rofi.enable = true; - programs.i3status-rust = { - enable = true; - bars.default = { - settings.theme.overrides = with config.lib.stylix.colors.withHashtag; { - idle_bg = base00; - idle_fg = base05; - separator = ""; - }; - icons = "awesome5"; - blocks = [ + programs.i3status-rust = { + enable = true; + bars.default = lib.mkMerge [ { - block = "sound"; - format = " $icon $volume "; - click = [{ - button = "left"; - cmd = "pavucontrol"; - }]; + blocks = lib.mkBefore [ + { + block = "privacy"; + driver = [{name = "v4l";} {name = "pipewire";}]; + } + # { + # block = "net"; + # format = " $icon "; + # inactive_format = " $icon "; + # } + ]; } + (lib.mkIf config.mods.battery.enable { + blocks = [ + { + block = "battery"; + format = " $icon $percentage "; + # format_alt = + # " $icon $percentage {$time_remaining.dur(hms:true, min_unit:m) |}"; + } + ]; + }) { - block = "time"; - format = "$icon $timestamp.datetime(f:'%Y-%m-%d %a %H:%M:%S') "; - interval = 1; + settings.theme.overrides = lib.mkMerge [ + {separator = "";} + config.lib.stylix.i3status-rust.bar + ]; + icons = "awesome5"; + blocks = lib.mkAfter [ + { + block = "sound"; + format = " $icon {$volume |} "; + click = [ + { + button = "left"; + cmd = "${lib.getExe pkgs.pavucontrol}"; + } + ]; + } + { + block = "time"; + format = "$icon $timestamp.datetime(f:'%Y-%m-%d %a %H:%M:%S') "; + # format_alt = "$icon $timestamp.datetime(f:'%Y-%m-%d %H:%M') "; + interval = 1; + } + ]; } ]; }; - }; - xsession.windowManager.i3 = let - modifier = "Mod4"; - wsAmount = 10; - genSpaces = f: map builtins.toString (builtins.genList f wsAmount); - workspaces = genSpaces (x: x + 1); + xsession.windowManager.i3 = let + modifier = "Mod4"; + wsAmount = 10; + genSpaces = f: map builtins.toString (builtins.genList f wsAmount); + workspaces = genSpaces (x: x + 1); + in { + enable = true; + config = { + modifier = modifier; + terminal = "alacritty"; + menu = "rofi -show drun"; - in { - enable = true; - config = { - modifier = modifier; - terminal = "alacritty"; - menu = "rofi -show drun"; + window = { + titlebar = false; + hideEdgeBorders = "smart"; + }; - window = { - titlebar = false; - hideEdgeBorders = "smart"; + floating.criteria = [ + {title = "^Cheat$";} + ]; + + defaultWorkspace = "workspace number 1"; + workspaceAutoBackAndForth = true; + focus.wrapping = "yes"; + + # startup = [ ] ++ lib.optionals config.mods.social.enable [{ + # command = "exec vesktop"; + # }]; + + assigns = { + "2" = [{class = "Vesktop";}]; + "3" = [{class = "^Steam$";}]; + }; + + keybindings = let + # modKeyComb: string -> valueAction: string + # -> keys: [string] -> values: [string] + # -> keybindings: attrSet { string -> string } + zipBinds = comb: action: keys: values: (builtins.listToAttrs (zipListsWith (k: v: { + name = "${modifier}${comb}${k}"; + value = "${action} ${v}"; + }) + keys + values)); + + moveKeys = ["h" "j" "k" "l"]; + moveDirs = ["left" "down" "up" "right"]; + + workspKeys = genSpaces (x: mod (x + 1) wsAmount); + in + mkOptionDefault ((zipBinds "+" "focus" moveKeys moveDirs) + // (zipBinds "+Shift+" "move" moveKeys moveDirs) + // (zipBinds "+" "workspace number" workspKeys workspaces) + // (zipBinds "+Shift+" "move container to workspace number" workspKeys + workspaces) + // { + "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +2%"; + "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -2%"; + "Print" = "exec ${getExe fsss}"; + "${modifier}+z" = "exec ${getExe zmenu}"; + "${modifier}+y" = "sticky toggle"; + "${modifier}+g" = "floating toggle"; + }); + + bars = let + status_conf = "${config.xdg.configHome}/i3status-rust/config-default.toml"; + stylix_bar = + { + mode = "dock"; + hiddenState = "hide"; + position = "bottom"; + statusCommand = "${getExe pkgs.i3status-rust} ${status_conf}"; + command = "${pkgs.i3}/bin/i3bar"; + workspaceButtons = true; + workspaceNumbers = true; + trayOutput = "primary"; + } + // config.lib.stylix.i3.bar; + in [stylix_bar]; }; - - defaultWorkspace = "workspace number 1"; - workspaceAutoBackAndForth = true; - focus.wrapping = "yes"; - - # startup = [ ] ++ lib.optionals config.mods.social.enable [{ - # command = "exec vesktop"; - # }]; - - assigns = { - "2" = [{ class = "Vesktop"; }]; - "3" = [{ class = "^Steam$"; }]; - }; - - keybindings = let - # modKeyComb: string -> valueAction: string - # -> keys: [string] -> values: [string] - # -> keybindings: attrSet { string -> string } - zipBinds = comb: action: keys: values: - (builtins.listToAttrs (lib.zipListsWith (k: v: { - name = "${modifier}${comb}${k}"; - value = "${action} ${v}"; - }) keys values)); - - moveKeys = [ "h" "j" "k" "l" ]; - moveDirs = [ "left" "down" "up" "right" ]; - - workspKeys = genSpaces (x: lib.mod (x + 1) wsAmount); - - in lib.mkOptionDefault ((zipBinds "+" "focus" moveKeys moveDirs) - // (zipBinds "+Shift+" "move" moveKeys moveDirs) - // (zipBinds "+" "workspace number" workspKeys workspaces) - // (zipBinds "+Shift+" "move container to workspace number" workspKeys - workspaces) // { - "XF86AudioRaiseVolume" = - "exec --no-startup-id pactl set-sink-volume 0 +2%"; - "XF86AudioLowerVolume" = - "exec --no-startup-id pactl set-sink-volume 0 -2%"; - }); - - bars = let - status_conf = - "${config.xdg.configHome}/i3status-rust/config-default.toml"; - stylix_bar = { - mode = "dock"; - hiddenState = "hide"; - position = "bottom"; - statusCommand = "${lib.getExe pkgs.i3status-rust} ${status_conf}"; - command = "${pkgs.i3}/bin/i3bar"; - workspaceButtons = true; - workspaceNumbers = true; - trayOutput = "primary"; - } // config.lib.stylix.i3.bar; - in [ stylix_bar ]; }; }; - }; -} + } diff --git a/modules/home/desktop/media.nix b/modules/home/desktop/media.nix index 2070299..2f4fe79 100644 --- a/modules/home/desktop/media.nix +++ b/modules/home/desktop/media.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, config, ... }: { +{ + pkgs, + lib, + config, + ... +}: { options.mods.desktop.media.enable = lib.mkEnableOption "enables entertainment programs"; @@ -9,10 +14,13 @@ pavucontrol # Video - stremio + (callPackage ./packages/stremio-linux-shell.nix {}) # Podcasts gpodder + + # Interactive + bottles ]; programs.mpv.enable = true; }; diff --git a/modules/home/desktop/packages/stremio-linux-shell.nix b/modules/home/desktop/packages/stremio-linux-shell.nix new file mode 100644 index 0000000..79ca2fc --- /dev/null +++ b/modules/home/desktop/packages/stremio-linux-shell.nix @@ -0,0 +1,122 @@ +{ + lib, + stdenv, + rustPlatform, + fetchFromGitHub, + openssl, + pkg-config, + gtk3, + mpv, + libappindicator, + libxkbcommon, + libcef, + makeWrapper, + nodejs, + # fetchurl, + ... +}: let + # cef-rs expects a specific directory layout + # Copied from https://github.com/NixOS/nixpkgs/pull/428206 because im lazy + cef-path = stdenv.mkDerivation { + pname = "cef-path"; + version = libcef.version; + dontUnpack = true; + installPhase = '' + mkdir -p "$out" + find ${libcef}/lib -type f -name "*" -exec cp {} $out/ \; + find ${libcef}/libexec -type f -name "*" -exec cp {} $out/ \; + cp -r ${libcef}/share/cef/* $out/ + mkdir -p "$out/include" + cp -r ${libcef}/include/* "$out/include/" + ''; + postFixup = '' + strip $out/*.so* + ''; + }; + # NOTE stremio downloads server.js into XDG_DATA_DIR. Packaging it is not required. + # I'm patching this because I don't enjoy stremio downloading code at runtime. + # This and the postPatch are not needed if you're okay with stremio downloading server.js at runtime + # Latest server.js version found at https://www.strem.io/updater/server/check + # server = fetchurl rec { + # pname = "stremio-server"; + # version = "4.20.11"; + # url = "https://dl.strem.io/server/v${version}/desktop/server.js"; + # hash = "sha256-2QCwUlusNTGqbOmOGjyKOx0bHaoGmn9vy93qViXx95E="; + # meta.license = lib.licenses.unfree; + # }; +in + rustPlatform.buildRustPackage (finalAttrs: { + name = "stremio-linux-shell"; + version = "1.0.0-beta.11"; + + src = fetchFromGitHub { + owner = "Stremio"; + repo = "stremio-linux-shell"; + tag = "v${finalAttrs.version}"; + hash = "sha256-FNAeur5esDqBoYlmjUO6jdi1eC83ynbLxbjH07QZ++E="; + }; + + cargoHash = "sha256-9/28BCG51jPnKXbbzzNp7KQLMkLEugFQfwszRR9kmUw="; + + # The build scripts tries to download CEF binaries by default. + # Probably overkill since setting CEF_PATH should skip downloading binaries. + buildFeatures = [ + "offline-build" + ]; + + buildInputs = [ + openssl + gtk3 + mpv + libcef + ]; + + nativeBuildInputs = [ + makeWrapper + pkg-config + ]; + + #postPatch = '' + # substituteInPlace ./src/config.rs \ + # --replace-fail \ + # 'let file = data_dir.join(SERVER_FILE);' \ + # 'let file = PathBuf::from(r"${server}");' + + # substituteInPlace ./src/server.rs \ + # --replace-fail \ + # 'let should_download = self.config.version() != Some(latest_version.clone());' \ + # 'let should_download = false;' + #''; + + postInstall = '' + mkdir -p $out/share/applications + mkdir -p $out/share/icons/hicolor/scalable/apps + + mv $out/bin/stremio-linux-shell $out/bin/stremio + cp $src/data/com.stremio.Stremio.desktop $out/share/applications/com.stremio.Stremio.desktop + cp $src/data/icons/com.stremio.Stremio.svg $out/share/icons/hicolor/scalable/apps/com.stremio.Stremio.svg + + + wrapProgram $out/bin/stremio \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libappindicator libxkbcommon]} \ + --prefix PATH : ${lib.makeBinPath [nodejs]}''; + + env.CEF_PATH = cef-path; + + meta = { + mainProgram = "stremio"; + description = "Modern media center that gives you the freedom to watch everything you want"; + homepage = "https://www.stremio.com/"; + # (Server-side) 4.x versions of the web UI are closed-source + license = with lib.licenses; [ + gpl3Only + # server.js is unfree + # unfree + ]; + maintainers = with lib.maintainers; [ + griffi-gh + {name = "nuko";} + ]; + platforms = lib.platforms.linux; + }; + }) diff --git a/modules/home/desktop/productivity.nix b/modules/home/desktop/productivity.nix index ade6f7f..e23e21a 100644 --- a/modules/home/desktop/productivity.nix +++ b/modules/home/desktop/productivity.nix @@ -1,61 +1,322 @@ -{ pkgs, lib, config, osConfig, ... }: { - options.mods.desktop.productivity.enable = - lib.mkEnableOption "enables gui productivity tools"; +{ + pkgs, + lib, + config, + osConfig, + system, + inputs, + ... +}: let + color = config.lib.stylix.colors.withHashtag; +in + with lib; { + options.mods.desktop.productivity.enable = + lib.mkEnableOption "enables gui productivity tools"; - config = lib.mkIf config.mods.desktop.productivity.enable { - home.packages = with pkgs; [ - # ISO downloader - qbittorrent - xd - biglybt - # transmission_4-gtk - - # email - thunderbird - - # webgl - chromium - mullvad-browser - - # password manager - bitwarden-desktop - - # file management - breeze-icons - libsForQt5.qt5ct - dolphin - - # documents - # texliveFull - # texstudio + imports = [ + inputs.zen-browser.homeModules.beta + # or inputs.zen-browser.homeModules.twilight + # or inputs.zen-browser.homeModules.twilight-official ]; - qt.platformTheme = "qt5ct"; + config = lib.mkIf config.mods.desktop.productivity.enable { + home.packages = with pkgs; [ + # ISO downloader + qbittorrent + xd + biglybt + # transmission_4-gtk - home.sessionVariables.BROWSER = "librewolf"; - programs.zsh.sessionVariables.BROWSER = "librewolf"; + # email + thunderbird - programs.librewolf = { - enable = false; - settings = { - "webgl.disabled" = true; - "privacy.resistFingerprinting" = true; - "privacy.clearOnShutdown.history" = false; - "privacy.clearOnShutdown.cookies" = false; - "network.cookie.lifetimePolicy" = 0; + # webgl + # mullvad-browser + + # password manager + bitwarden-desktop + + # file management + libsForQt5.breeze-icons + libsForQt5.qt5ct + + # documents + # texliveFull + # texstudio + + # 3D + blender + ]; + + # qt.platformTheme = "qtct"; + + home.sessionVariables.BROWSER = "librewolf"; + programs.zsh.sessionVariables.BROWSER = "librewolf"; + + services.flameshot = { + enable = false; + settings = { + General = { + disabledTrayIcon = true; + showStartupLaunchMessage = false; + startupLaunch = false; + + uiColor = color.base01; + contrastUiColor = color.base00; + }; + }; + }; + + programs.librewolf = { + enable = false; + settings = { + "webgl.disabled" = true; + "privacy.resistFingerprinting" = true; + "privacy.clearOnShutdown.history" = false; + "privacy.clearOnShutdown.cookies" = false; + "network.cookie.lifetimePolicy" = 0; + }; + }; + + xdg.desktopEntries = lib.mkIf osConfig.mods.i2p.enable { + i2p-browser = { + name = "i2p Browser"; + genericName = "Web Browser"; + exec = "${pkgs.mullvad-browser}/bin/mullvad-browser -p i2p"; + }; + }; + + stylix.targets.zen-browser.profileNames = []; + programs.zen-browser = { + enable = true; + + policies = let + mkLockedAttrs = builtins.mapAttrs (_: value: { + Value = value; + Status = "locked"; + }); + + mkPluginUrl = id: "https://addons.mozilla.org/firefox/downloads/latest/${id}/latest.xpi"; + + mkExtensionEntry = { + id, + pinned ? false, + }: let + base = { + install_url = mkPluginUrl id; + installation_mode = "force_installed"; + }; + in + if pinned + then base // {default_area = "navbar";} + else base; + + mkExtensionSettings = builtins.mapAttrs (_: entry: + if builtins.isAttrs entry + then entry + else mkExtensionEntry {id = entry;}); + in { + AutofillAddressEnabled = false; + AutofillCreditCardEnabled = false; + DisableAppUpdate = true; + DisableFeedbackCommands = true; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + DontCheckDefaultBrowser = true; + OfferToSaveLogins = false; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + ExtensionSettings = mkExtensionSettings { + "uBlock0@raymondhill.net" = mkExtensionEntry { + id = "ublock-origin"; + pinned = true; + }; + "{85860b32-02a8-431a-b2b1-40fbd64c9c69}" = "github-file-icons"; + "{74145f27-f039-47ce-a470-a662b129930a}" = "clearurls"; + "github-no-more@ihatereality.space" = "github-no-more"; + "github-repository-size@pranavmangal" = "gh-repo-size"; + "@searchengineadremover" = "searchengineadremover"; + "jid1-BoFifL9Vbdl2zQ@jetpack" = "decentraleyes"; + "{d7742d87-e61d-4b78-b8a1-b469842139fa}" = "vimium-ff"; + }; + Preferences = mkLockedAttrs { + "browser.aboutConfig.showWarning" = false; + "browser.tabs.warnOnClose" = false; + "media.videocontrols.picture-in-picture.video-toggle.enabled" = true; + # Disable swipe gestures (Browser:BackOrBackDuplicate, Browser:ForwardOrForwardDuplicate) + "browser.gesture.swipe.left" = ""; + "browser.gesture.swipe.right" = ""; + "browser.tabs.hoverPreview.enabled" = true; + "browser.newtabpage.activity-stream.feeds.topsites" = false; + "browser.topsites.contile.enabled" = false; + + "privacy.resistFingerprinting" = true; + "privacy.firstparty.isolate" = true; + "network.cookie.cookieBehavior" = 5; + "dom.battery.enabled" = false; + + "gfx.webrender.all" = true; + "network.http.http3.enabled" = true; + }; + }; + + profiles.default = rec { + settings = { + "zen.workspaces.continue-where-left-off" = true; + "zen.workspaces.natural-scroll" = true; + "zen.view.compact.hide-tabbar" = true; + "zen.view.compact.hide-toolbar" = true; + "zen.view.compact.animate-sidebar" = false; + "zen.welcome-screen.seen" = true; + }; + + bookmarks = { + force = true; + settings = [ + { + name = "Nix sites"; + toolbar = true; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + tags = ["wiki" "nix"]; + url = "https://wiki.nixos.org/"; + } + ]; + } + ]; + }; + + pinsForce = true; + pins = { + "GitHub" = { + id = "48e8a119-5a14-4826-9545-91c8e8dd3bf6"; + workspace = spaces."Work".id; + url = "https://github.com"; + position = 101; + isEssential = false; + }; + }; + + containersForce = true; + containers = { + Work = { + color = "blue"; + icon = "briefcase"; + id = 2; + }; + }; + + spacesForce = true; + spaces = { + "Personal" = { + id = "572910e1-4468-4832-a869-0b3a93e2f165"; + # icon = ""; + position = 1000; + }; + "Work" = { + id = "ec287d7f-d910-4860-b400-513f269dee77"; + # icon = "briefcase"; + position = 1001; + container = containers."Work".id; + }; + }; + + search = { + force = true; + default = "searx"; + engines = let + nixSnowflakeIcon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + in { + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "channel"; + value = "unstable"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = nixSnowflakeIcon; + definedAliases = ["np"]; + }; + "Nix Options" = { + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { + name = "channel"; + value = "unstable"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = nixSnowflakeIcon; + definedAliases = ["nop"]; + }; + "Home Manager Options" = { + urls = [ + { + template = "https://home-manager-options.extranix.com/"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + { + name = "release"; + value = "master"; # unstable + } + ]; + } + ]; + icon = nixSnowflakeIcon; + definedAliases = ["hm"]; + }; + "searx" = { + urls = [ + { + template = "https://search.muon.host/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "magnifying-glass"; + definedAliases = ["srx"]; + }; + bing.metaData.hidden = "true"; + }; + }; + }; }; }; - - xdg.desktopEntries = lib.mkIf osConfig.mods.i2p.enable { - i2p-browser = { - name = "i2p Browser"; - genericName = "Web Browser"; - exec = "${pkgs.mullvad-browser}/bin/mullvad-browser -p i2p"; - }; - }; - - # programs.qutebrowser = { - # enable = true; - # }; - }; -} + } diff --git a/modules/home/desktop/social.nix b/modules/home/desktop/social.nix index 02b8ef2..170857b 100644 --- a/modules/home/desktop/social.nix +++ b/modules/home/desktop/social.nix @@ -1,12 +1,7 @@ -{ pkgs, lib, config, ... }: +{ pkgs, lib, config, sources, ... }: let vesktop-nogain = (pkgs.vesktop.overrideAttrs (previousAttrs: { - patches = previousAttrs.patches ++ [ - (builtins.fetchurl { - url = "https://codeberg.org/muon/gists/raw/branch/main/micfix.patch"; - sha256 = "18zmq68m5mx3s924iqfbmm8a7r8qbjnw86hvvax2vg8w94g7mrqp"; - }) - ]; + patches = previousAttrs.patches ++ [ sources."vesktop.micfix".src ]; })); in { options.mods.social.enable = diff --git a/modules/home/impermanence.nix b/modules/home/impermanence.nix new file mode 100644 index 0000000..8dd5e97 --- /dev/null +++ b/modules/home/impermanence.nix @@ -0,0 +1,50 @@ +{ pkgs, lib, config, osConfig, ... }: +let + fs-diff = with pkgs; + writeShellApplication { + name = "fs-diff"; + text = '' + #!/usr/bin/env bash + # fs-diff.sh + set -euo pipefail + + sudo mkdir -p /btrfs_tmp + sudo mount -o subvol=/ /dev/mapper/crypted /btrfs_tmp + + OLD_TRANSID=$(sudo btrfs subvolume find-new /btrfs_tmp/root-blank 9999999) + OLD_TRANSID=''${OLD_TRANSID#transid marker was } + + sudo btrfs subvolume find-new "/btrfs_tmp/root" "$OLD_TRANSID" | + sed '$d' | + cut -f17- -d' ' | + sort | + uniq | + while read -r path; do + path="/$path" + if [ -L "$path" ]; then + : # The path is a symbolic link, so is probably handled by NixOS already + elif [ -d "$path" ]; then + : # The path is a directory, ignore + else + echo "$path" + fi + done + sudo umount /btrfs_tmp + ''; + }; +in with lib; { + config = mkIf osConfig.mods.impermanence.enable { + home.packages = [ fs-diff ]; + # home.persistence."/persist/home/muon" = { + # directories = [ + # "documents" + # "downloads" + # "src" + # ".gnupg" + # ".ssh" + # ".config/sops" + # ".local/share/direnv" + # ]; + # }; + }; +} diff --git a/modules/home/sops/default.nix b/modules/home/sops/default.nix new file mode 100644 index 0000000..01b2b21 --- /dev/null +++ b/modules/home/sops/default.nix @@ -0,0 +1,21 @@ +{ + pkgs, + lib, + config, + inputs, + system, + ... +}: let + cfg = config.mods; +in + with lib; { + imports = [inputs.sops-nix.homeManagerModules.sops]; + sops = { + age.keyFile = "/persist/var/lib/sops-nix/key.txt"; + defaultSopsFile = ./secrets.yaml; + secrets.zipline-auth = {}; + secrets.atuin-auth = {}; + secrets.hr-password = {}; + secrets.sops-key = {}; + }; + } diff --git a/modules/home/sops/secrets.yaml b/modules/home/sops/secrets.yaml new file mode 100644 index 0000000..81d63e7 --- /dev/null +++ b/modules/home/sops/secrets.yaml @@ -0,0 +1,46 @@ +zipline-auth: ENC[AES256_GCM,data:RkJI6GuH7RzdcSlKn32gMGojjB6rkdDcnNUvsi/BTfJk2slzoktAaJPzQA==,iv:LIiB3tyqXf/D64aIDSo0AyG3imvI6ZE893KBPlYFr28=,tag:wl8spMBwzfvuKA+Y6JnVyQ==,type:str] +atuin-auth: ENC[AES256_GCM,data:LDkiXWIwxor8Ro383gonJCyqu+nyxS7DrI2J8uo4Cqu2X61rBUlnpNR6YirUZS/lYAnWYJhZM7sR0G7ZNh9EgQ==,iv:UEs2KW8ImMnaQrSLrIGbVXEq86QiVPAPNIXBZpa3jFI=,tag:N0rhnPbasFzkoI3CJ9CV+Q==,type:str] +hr-password: ENC[AES256_GCM,data:QZuzAnTJ2KgPnffHvdCWrJEM5d/FXxhX3dA1,iv:FgDw6aXDY0jCpJiYc9WOobR96TXNtnvN7neJu8drxMM=,tag:YT82wryVy3V+41w0YbMOrA==,type:str] +sops-key: ENC[AES256_GCM,data:msX0EJqJauteOBICUsLcVgqNxqGcqvD+Xi/B2EhUX2OAoyBH5oDae8XWlQCi2RdOm4NtnrSTnG8FRQXfkXO+tne0VEfYTCjeVtU=,iv:qxpvofr56Ey17xcPpju/mQgiz+0cOYED5caAHs3myXw=,tag:oDFXh0rlc0tmV2IUJ1ezBQ==,type:str] +sops: + age: + - recipient: age1m97a3eptxwpdd7h5kkqe9gkmhg6rquc64qjmlsfqfhfqv8q72crqrylhgc + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqWlVGK0V3UTVuejFMRVA0 + QUhrRXhwcTc4N3B5b1V6ckZqRUJVcXdCbWtzCnl2a0JTeVJKSkpreGdyc0xnODk1 + WlFFdVBBbTkxRnVoRmQ5VjFsRGxvN1EKLS0tIGQ2dlFFRlM5NzQxQkZ5MENuYU8x + SkhrZUR0MkVyazc2MUx0aklWUFZFNHMKm8wOh9R1LWyLgJ7nJ0mCGmSeK8biNfHG + Y9w991ccXbVd8QVq7k0I2sJ/T/4DLlFineV8jRsj4rN9cks4Uo5mTQ== + -----END AGE ENCRYPTED FILE----- + - recipient: age1v4s4hg7u3vjjkarvrk7v6ev7w3wja2r5xm7f4t06culw3fuq7qns8sfju7 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBxQlJQN3c2WVU4T2hhVDV1 + SjlqZkVJSFk5VEw4dkNxejF6MFBkWVQ0MUE0Cjc2WTQvTXlsbDZqNlg1RkZ4eVNF + NTczRGJ6M2c1cXBqcmxYbzMxVGdSVjAKLS0tIG9JNmdLUW9iN29CVVZ0dC9BVFRP + Y2g3MU1TZnhjQ0t5MkxKWVhQVDJ3WDAKMuI1G3t4BmG3JbwXfQKNTdkHCjnU/jHK + Z2eKhvwKqT08z+Pvtxd2pcRtK+t23/edCUJv684VrNXoBlgMH10PuA== + -----END AGE ENCRYPTED FILE----- + - recipient: age1n7qz2w3hkf7fcdv92kxw9k6uef487na2tlc87486rcjwj8lyfuws5q46gn + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA5Lyt4Zk5GeW1XNTBLbnBZ + MHE4WG5Cci9Sa1V4aDZQRkVzdDJ0a3JRYWwwCmhSSFFNdTlCM05wUy9uQnhUcFY3 + c05xUFRiamV1WmxuU2tFeWVqeTlYdGsKLS0tIGJtWWNMc2lwK0taOHluN3BmcnRO + YVYySTJaNE1aalAxUXZqR1BWMzJvalUKnD3hpu5b1Tb+tg+gmVWuAYVlg2SPRI8p + kILLFBP2mHz3V6lRX77tXXvCkjLZ8EFKMIl8owGZ8LUsokz1k5EbSA== + -----END AGE ENCRYPTED FILE----- + - recipient: age1mgjhkqy9x27gv2t2xvq46dxcajkr9c8zes7rr3dj0ac7md2j6vas43dftp + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6d0JHVWd6eGt4b05RNUVr + VzFsSnN1Qk5wSnk4aWdvOVlzY0k5LzZMQXc4CmxRMmMrM3pVMjV6S0pVNnNsQlFo + S3lDTGZGTHV3cXdyWndzd0JQSVRUYTQKLS0tIDJHbnZvTFN0YmVsdkFhR2NhckYy + a0V1N2VjUDE4Z3R5MGxMQVNmOVp0bVUK9cppJW33tKFOSvbIn/2Dga8k7/McaTpK + m7M+83guMzNoOlpJ/WYU1BaePcM974AgjVR0WD/v+xGBvGKubKHqtw== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2025-08-04T07:58:56Z" + mac: ENC[AES256_GCM,data:aJw3KK4GMj5/Q06v1C5rdSerdO21cNxpTIJYoxmfhBKudzD7lSL6l+d47kWoB0U4J5jtbs9obWz2MH3CvyPBapjJaSFnYEXk1JuGihf8GK3QrqLAt+dmF2ZD1FBLpQELripueneyHkzT32180hpXGnppNlgOuATlIMSPosvlpVI=,iv:SpGAyTqqbpuxcLkMq7VnLQUoR6oW0ERgnyPaqVHpaN8=,tag:OSNGT8/5E+PRhoR8dIyaSA==,type:str] + unencrypted_suffix: _unencrypted + version: 3.10.2 diff --git a/modules/home/terminal/default.nix b/modules/home/terminal/default.nix index d87e57d..82727d0 100644 --- a/modules/home/terminal/default.nix +++ b/modules/home/terminal/default.nix @@ -1,10 +1,6 @@ { pkgs, lib, osConfig, ... }: { - imports = [ - ./shell.nix - ./emulator.nix - ./development.nix - ./tools.nix - ]; + imports = + [ ./shell.nix ./emulator.nix ./development.nix ./tools.nix ./yazi.nix ]; config = lib.mkIf osConfig.mods.desktop.enable { mods.terminal.emulator.enable = lib.mkDefault true; diff --git a/modules/home/terminal/development.nix b/modules/home/terminal/development.nix index e0fa682..348bfa0 100644 --- a/modules/home/terminal/development.nix +++ b/modules/home/terminal/development.nix @@ -1,32 +1,19 @@ -{ pkgs, lib, config, ... }: -let - wgsl_analyzer = with pkgs; - stdenv.mkDerivation rec { - pname = "wgsl_analyzer"; - version = "0.8.1"; - - src = fetchurl { - url = - "https://github.com/wgsl-analyzer/wgsl-analyzer/releases/download/v${version}/${pname}-linux-x64"; - hash = "sha256-WRc9fHUw9/KHD5BzUX3nd+0sRkc7i8axsXhHUZFOUeY="; - }; - - nativeBuildInputs = [ autoPatchelfHook ]; - - buildInputs = [ openssl zlib ]; - - sourceRoot = "."; - phases = [ "installPhase" "patchPhase" ]; - installPhase = '' - mkdir -p $out/bin - cp $src $out/bin/${pname} - chmod +x $out/bin/${pname} - ''; - }; +{ + pkgs, + lib, + config, + inputs, + ... +}: let + zellij-muon = pkgs.zellij.overrideAttrs (previousAttrs: { + patches = previousAttrs.patches ++ [./zellij/floating_fix.patch]; + }); in { options.mods.terminal.development.enable = lib.mkEnableOption "enables cli editor"; + imports = [inputs.nvf.homeManagerModules.default]; + config = lib.mkIf config.mods.terminal.development.enable { home.packages = with pkgs; [ # Nix @@ -38,8 +25,10 @@ in { # Shaders glsl_analyzer - # wgsl_analyzer + wgsl-analyzer + # Python + black ]; programs.direnv = { @@ -48,21 +37,115 @@ in { enableZshIntegration = lib.mkIf config.mods.terminal.zsh.enable true; }; + programs.zellij = { + settings = { + default_mode._args = ["locked"]; + show_startup_tips._args = [false]; + show_release_notes._args = [false]; + }; + + extraConfig = builtins.readFile ./zellij/config.kdl; + + layouts = { + dev = { + layout = { + _children = [ + { + default_tab_template = { + _children = [ + { + pane = { + size = 1; + borderless = true; + plugin = { + location = "zellij:tab-bar"; + }; + }; + } + {"children" = {};} + { + pane = { + size = 1; + borderless = true; + plugin = { + location = "zellij:status-bar"; + }; + }; + } + ]; + }; + } + { + tab = { + _props = { + name = "project"; + focus = true; + }; + _children = [ + { + pane = { + command = "zsh"; + args = ["-c" "nvim"]; + }; + } + ]; + }; + } + { + tab = { + _props = { + name = "test"; + }; + _children = [ + { + pane = { + command = "zsh"; + }; + } + ]; + }; + } + { + tab = { + _props = { + name = "git"; + }; + _children = [ + { + pane = { + command = "lazygit"; + }; + } + ]; + }; + } + ]; + }; + }; + }; + }; + home.sessionVariables.EDITOR = "hx"; programs.zsh.sessionVariables.EDITOR = "hx"; programs.helix = { enable = true; + package = pkgs.evil-helix; settings = { keys.normal = { - "esc" = [ "collapse_selection" "keep_primary_selection" ]; + "esc" = ["collapse_selection" "keep_primary_selection"]; + "Z" = { + "Q" = ":quit!"; + "Z" = ":write-quit!"; + }; + "V" = ["select_mode" "extend_to_line_bounds"]; }; editor = { line-number = "relative"; completion-replace = true; bufferline = "always"; - rulers = [ 80 ]; + rulers = [80]; soft-wrap.enable = true; indent-guides.render = true; cursor-shape = { @@ -75,7 +158,7 @@ in { languages.language-server = { glsl.command = "${pkgs.glsl_analyzer}/bin/glsl_analyzer"; - wgsl.command = "${wgsl_analyzer}/bin/wgsl_analyzer"; + wgsl.command = "${pkgs.wgsl-analyzer}/bin/wgsl-analyzer"; }; languages.language = [ @@ -91,13 +174,147 @@ in { } { name = "glsl"; - language-servers = [ "glsl" ]; + language-servers = ["glsl"]; } { name = "wgsl"; - language-servers = [ "wgsl" ]; + language-servers = ["wgsl"]; + } + { + name = "python"; + auto-format = true; + formatter = { + command = "${pkgs.black}/bin/black"; + args = ["-" "--quiet" "--line-length=79"]; + }; } ]; }; + + programs.nvf = { + enable = true; + settings = { + vim = { + viAlias = false; + vimAlias = true; + lsp = { + enable = true; + formatOnSave = true; + }; + + keymaps = [ + { + key = "w"; + mode = ["n"]; + action = ":w"; + silent = true; + desc = "Save file"; + } + { + key = "gd"; + mode = "n"; + silent = true; + action = "lua vim.lsp.buf.definition()"; + desc = "Go to Definition"; + } + ]; + + languages = { + enableFormat = true; + enableTreesitter = true; + enableExtraDiagnostics = true; + + nix.enable = true; + nix.lsp.server = "nixd"; + + markdown.enable = true; + bash.enable = true; + rust.enable = true; + rust.crates.enable = true; + + python.enable = true; + python.lsp.server = "pyright"; + # python.lsp.package = [(lib.getExe pkgs.ruff) "server"]; + python.format.type = "ruff"; + + clang = { + enable = true; + cHeader = true; + }; + }; + + statusline.lualine.enable = true; + telescope.enable = true; + autocomplete.nvim-cmp.enable = true; + autopairs.nvim-autopairs.enable = true; + tabline.nvimBufferline.enable = true; + treesitter.context.enable = true; + dashboard.alpha.enable = true; + comments.comment-nvim.enable = true; + + options = { + tabstop = 2; + shiftwidth = 0; + }; + + notes = { + # orgmode.enable = true; + todo-comments.enable = true; + }; + + spellcheck = {enable = true;}; + + binds = { + whichKey.enable = true; + cheatsheet.enable = true; + }; + + git = { + enable = true; + gitsigns.enable = true; + gitsigns.codeActions.enable = + false; # throws an annoying debug message + }; + + terminal = { + toggleterm = { + enable = true; + lazygit.enable = true; + }; + }; + + utility = { + diffview-nvim.enable = true; + surround.enable = true; + # multicursors.enable = true; + undotree.enable = true; + + motion = { + hop.enable = true; + leap.enable = true; + }; + }; + + visuals = { + nvim-web-devicons.enable = true; + nvim-cursorline.enable = true; + cinnamon-nvim.enable = true; + fidget-nvim.enable = true; + + highlight-undo.enable = true; + indent-blankline.enable = true; + }; + + ui = { + borders.enable = true; + noice.enable = true; + colorizer.enable = true; + illuminate.enable = true; + smartcolumn.enable = true; + fastaction.enable = true; + }; + }; + }; + }; }; } diff --git a/modules/home/terminal/shell.nix b/modules/home/terminal/shell.nix index fab820b..b8ad4a0 100644 --- a/modules/home/terminal/shell.nix +++ b/modules/home/terminal/shell.nix @@ -1,15 +1,22 @@ -{ pkgs, lib, config, ... }: -let +{ + pkgs, + lib, + config, + ... +}: let cfg = config.mods.terminal; - aliases = { + aliases = with lib; { la = "ls -lah"; + xc = "${getExe pkgs.xclip} -selection clipboard"; + ".." = "cd .."; + "..." = "cd ../.."; + "...." = "cd ../.."; + "....." = "cd ../../.."; + "......" = "cd ../../../.."; }; - in { - options.mods.terminal = { - zsh.enable = lib.mkEnableOption "enables zsh"; - }; + options.mods.terminal = {zsh.enable = lib.mkEnableOption "enables zsh";}; config = { programs.starship.enable = true; @@ -29,7 +36,7 @@ in { path = "${config.xdg.dataHome}/zsh/history"; }; - initExtra = '' + initContent = '' autoload -U compinit setopt no_auto_remove_slash ''; diff --git a/modules/home/terminal/tools.nix b/modules/home/terminal/tools.nix index 2f21239..b3c00dd 100644 --- a/modules/home/terminal/tools.nix +++ b/modules/home/terminal/tools.nix @@ -1,51 +1,90 @@ -{ pkgs, lib, config, ... }: -let cfg = config.mods.terminal; -in with lib; { - options.mods.terminal.tools.enable = mkEnableOption "enables cli tools"; +{ + pkgs, + lib, + config, + ... +}: let + cfg = config.mods.terminal; +in + with lib; { + options.mods.terminal.tools.enable = mkEnableOption "enables cli tools"; - config = mkIf cfg.tools.enable { + config = mkIf cfg.tools.enable { + programs = + builtins.listToAttrs (map (name: { + name = name; + value = + { + enable = true; + } + // optionalAttrs + (builtins.hasAttr "enableZshIntegration" config.programs.${name}) { + enableZshIntegration = mkIf cfg.zsh.enable true; + }; + }) [ + "zellij" + "fzf" + "eza" + "bat" + "zoxide" + "dircolors" + "nix-index" - programs = builtins.listToAttrs (map (name: { - name = name; - value = { - enable = true; - } // optionalAttrs - (builtins.hasAttr "enableZshIntegration" config.programs.${name}) { - enableZshIntegration = mkIf cfg.zsh.enable true; + "lazygit" + "fd" + "ripgrep" + "bottom" + "htop" + "vifm" + "rbw" + ]) + // { + atuin = { + enable = true; + enableZshIntegration = true; + flags = ["--disable-up-arrow"]; + settings = { + sync_frequency = "5m"; + sync_address = "https://atuin.muon.host"; + key_path = config.sops.secrets.atuin-auth.path; + keymap_mode = "vim-insert"; + keymap_cursor = { + vim_insert = "blink-bar"; + vim_normal = "steady-block"; + }; + }; + }; }; - }) [ - "zellij" - "fzf" - "eza" - "bat" - "zoxide" - "dircolors" - "yazi" - "nix-index" - "thefuck" - "lazygit" - "fd" - "ripgrep" - "bottom" - "htop" - "vifm" - ]); + services.clipmenu = { + enable = true; + launcher = "rofi"; + }; - home.packages = with pkgs; [ - # libraries - glow - ueberzugpp + home.packages = with pkgs; [ + # libraries + glow + ueberzugpp - # file managing - trash-cli - dua - fdupes - vifm + # file managing + trash-cli + dua + fdupes + vifm + unzip - # programs - fend - unzip - ]; - }; -} + # email + aerc + + # security + pinentry-tty + + # utilities + fend + xclip + just + devenv + tealdeer + ]; + }; + } diff --git a/modules/home/terminal/yazi.nix b/modules/home/terminal/yazi.nix new file mode 100644 index 0000000..160b944 --- /dev/null +++ b/modules/home/terminal/yazi.nix @@ -0,0 +1,39 @@ +{ pkgs, lib, config, ... }: +let cfg = config.mods.terminal; +in with lib; { + + config = mkIf cfg.tools.enable { + programs.yazi = { + enable = true; + settings = { + manager = { + ratio = [ 1 4 3 ]; + sort_by = "natural"; + sort_sensitive = true; + sort_reverse = false; + sort_dir_first = true; + linemode = "none"; + show_hidden = true; + show_symlink = true; + }; + + preview = { + image_filter = "lanczos3"; + image_quality = 90; + tab_size = 1; + max_width = 600; + max_height = 900; + cache_dir = ""; + ueberzug_scale = 1; + ueberzug_offset = [ 0 0 0 0 ]; + }; + + tasks = { + micro_workers = 5; + macro_workers = 10; + bizarre_retry = 5; + }; + }; + }; + }; +} diff --git a/modules/home/terminal/zellij/config.kdl b/modules/home/terminal/zellij/config.kdl new file mode 100644 index 0000000..0115cec --- /dev/null +++ b/modules/home/terminal/zellij/config.kdl @@ -0,0 +1,244 @@ +keybinds clear-defaults=true { + unbind "Ctrl g" + locked { + bind "Alt Space" { SwitchToMode "normal"; } + } + pane { + bind "left" { MoveFocus "left"; } + bind "down" { MoveFocus "down"; } + bind "up" { MoveFocus "up"; } + bind "right" { MoveFocus "right"; } + bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; } + bind "d" { NewPane "down"; SwitchToMode "locked"; } + bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "locked"; } + bind "f" { ToggleFocusFullscreen; SwitchToMode "locked"; } + bind "h" { MoveFocus "left"; } + bind "i" { TogglePanePinned; SwitchToMode "locked"; } + bind "j" { MoveFocus "down"; } + bind "k" { MoveFocus "up"; } + bind "l" { MoveFocus "right"; } + bind "n" { NewPane; SwitchToMode "locked"; } + bind "p" { SwitchToMode "normal"; } + bind "r" { NewPane "right"; SwitchToMode "locked"; } + bind "s" { NewPane "stacked"; SwitchToMode "locked"; } + bind "w" { ToggleFloatingPanes; SwitchToMode "locked"; } + bind "x" { CloseFocus; SwitchToMode "locked"; } + bind "z" { TogglePaneFrames; SwitchToMode "locked"; } + bind "tab" { SwitchFocus; } + } + tab { + bind "left" { GoToPreviousTab; } + bind "down" { GoToNextTab; } + bind "up" { GoToPreviousTab; } + bind "right" { GoToNextTab; } + 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"; } + bind "[" { BreakPaneLeft; SwitchToMode "locked"; } + bind "]" { BreakPaneRight; SwitchToMode "locked"; } + bind "b" { BreakPane; SwitchToMode "locked"; } + bind "h" { GoToPreviousTab; } + bind "j" { GoToNextTab; } + bind "k" { GoToPreviousTab; } + bind "l" { GoToNextTab; } + bind "n" { NewTab; SwitchToMode "locked"; } + bind "r" { SwitchToMode "renametab"; TabNameInput 0; } + bind "s" { ToggleActiveSyncTab; SwitchToMode "locked"; } + bind "t" { SwitchToMode "normal"; } + bind "x" { CloseTab; SwitchToMode "locked"; } + bind "tab" { ToggleTab; } + } + resize { + bind "left" { Resize "Increase left"; } + bind "down" { Resize "Increase down"; } + bind "up" { Resize "Increase up"; } + bind "right" { Resize "Increase right"; } + bind "+" { Resize "Increase"; } + bind "-" { Resize "Decrease"; } + bind "=" { Resize "Increase"; } + bind "H" { Resize "Decrease left"; } + bind "J" { Resize "Decrease down"; } + bind "K" { Resize "Decrease up"; } + bind "L" { Resize "Decrease right"; } + bind "h" { Resize "Increase left"; } + bind "j" { Resize "Increase down"; } + bind "k" { Resize "Increase up"; } + bind "l" { Resize "Increase right"; } + bind "r" { SwitchToMode "normal"; } + } + move { + bind "left" { MovePane "left"; } + bind "down" { MovePane "down"; } + bind "up" { MovePane "up"; } + bind "right" { MovePane "right"; } + bind "h" { MovePane "left"; } + bind "j" { MovePane "down"; } + bind "k" { MovePane "up"; } + bind "l" { MovePane "right"; } + bind "m" { SwitchToMode "normal"; } + bind "n" { MovePane; } + bind "p" { MovePaneBackwards; } + bind "tab" { MovePane; } + } + scroll { + bind "Alt left" { MoveFocusOrTab "left"; SwitchToMode "locked"; } + bind "Alt down" { MoveFocus "down"; SwitchToMode "locked"; } + bind "Alt up" { MoveFocus "up"; SwitchToMode "locked"; } + bind "Alt right" { MoveFocusOrTab "right"; SwitchToMode "locked"; } + bind "e" { EditScrollback; SwitchToMode "locked"; } + bind "f" { SwitchToMode "entersearch"; SearchInput 0; } + bind "Alt h" { MoveFocusOrTab "left"; SwitchToMode "locked"; } + bind "Alt j" { MoveFocus "down"; SwitchToMode "locked"; } + bind "Alt k" { MoveFocus "up"; SwitchToMode "locked"; } + bind "Alt l" { MoveFocusOrTab "right"; SwitchToMode "locked"; } + bind "s" { SwitchToMode "normal"; } + } + search { + bind "c" { SearchToggleOption "CaseSensitivity"; } + bind "n" { Search "down"; } + bind "o" { SearchToggleOption "WholeWord"; } + bind "p" { Search "up"; } + bind "w" { SearchToggleOption "Wrap"; } + } + session { + bind "a" { + LaunchOrFocusPlugin "zellij:about" { + floating true + move_to_focused_tab true + } + SwitchToMode "locked" + } + bind "c" { + LaunchOrFocusPlugin "configuration" { + floating true + move_to_focused_tab true + } + SwitchToMode "locked" + } + bind "d" { Detach; } + bind "o" { SwitchToMode "normal"; } + bind "p" { + LaunchOrFocusPlugin "plugin-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "locked" + } + bind "s" { + LaunchOrFocusPlugin "zellij:share" { + floating true + move_to_focused_tab true + } + SwitchToMode "locked" + } + bind "w" { + LaunchOrFocusPlugin "session-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "locked" + } + } + shared_among "normal" "locked" { + bind "Alt left" { MoveFocusOrTab "left"; } + bind "Alt down" { MoveFocus "down"; } + bind "Alt up" { MoveFocus "up"; } + bind "Alt right" { MoveFocusOrTab "right"; } + bind "Alt +" { Resize "Increase"; } + bind "Alt -" { Resize "Decrease"; } + bind "Alt =" { Resize "Increase"; } + bind "Alt [" { PreviousSwapLayout; } + bind "Alt ]" { NextSwapLayout; } + bind "Alt f" { ToggleFloatingPanes; } + bind "Alt h" { MoveFocusOrTab "left"; } + bind "Alt i" { MoveTab "left"; } + bind "Alt j" { MoveFocus "down"; } + bind "Alt k" { MoveFocus "up"; } + bind "Alt l" { MoveFocusOrTab "right"; } + bind "Alt n" { NewPane; } + bind "Alt o" { MoveTab "right"; } + bind "Alt p" { TogglePaneInGroup; } + bind "Alt Shift p" { ToggleGroupMarking; } + } + shared_except "locked" "renametab" "renamepane" { + bind "Alt Space" { SwitchToMode "locked"; } + bind "Alt q" { Quit; } + } + shared_except "locked" "entersearch" { + bind "enter" { SwitchToMode "locked"; } + } + shared_except "locked" "entersearch" "renametab" "renamepane" { + bind "esc" { SwitchToMode "locked"; } + } + shared_except "locked" "entersearch" "renametab" "renamepane" "move" { + bind "m" { SwitchToMode "move"; } + } + shared_except "locked" "entersearch" "search" "renametab" "renamepane" "session" { + bind "o" { SwitchToMode "session"; } + } + shared_except "locked" "tab" "entersearch" "renametab" "renamepane" { + bind "t" { SwitchToMode "tab"; } + } + shared_among "normal" "resize" "tab" "scroll" "prompt" "tmux" { + bind "p" { SwitchToMode "pane"; } + } + shared_among "normal" "resize" "search" "move" "prompt" "tmux" { + bind "s" { SwitchToMode "scroll"; } + } + shared_except "locked" "resize" "pane" "tab" "entersearch" "renametab" "renamepane" { + bind "r" { SwitchToMode "resize"; } + } + shared_among "scroll" "search" { + bind "PageDown" { PageScrollDown; } + bind "PageUp" { PageScrollUp; } + bind "left" { PageScrollUp; } + bind "down" { ScrollDown; } + bind "up" { ScrollUp; } + bind "right" { PageScrollDown; } + bind "Ctrl b" { PageScrollUp; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "locked"; } + bind "d" { HalfPageScrollDown; } + bind "Ctrl f" { PageScrollDown; } + bind "h" { PageScrollUp; } + bind "j" { ScrollDown; } + bind "k" { ScrollUp; } + bind "l" { PageScrollDown; } + bind "u" { HalfPageScrollUp; } + } + entersearch { + bind "Ctrl c" { SwitchToMode "scroll"; } + bind "esc" { SwitchToMode "scroll"; } + bind "enter" { SwitchToMode "search"; } + } + renametab { + bind "esc" { UndoRenameTab; SwitchToMode "tab"; } + } + shared_among "renametab" "renamepane" { + bind "Ctrl c" { SwitchToMode "locked"; } + } + renamepane { + bind "esc" { UndoRenamePane; SwitchToMode "pane"; } + } +} +plugins { + about location="zellij:about" + compact-bar location="zellij:compact-bar" + configuration location="zellij:configuration" + filepicker location="zellij:strider" { + cwd "/" + } + plugin-manager location="zellij:plugin-manager" + session-manager location="zellij:session-manager" + status-bar location="zellij:status-bar" + strider location="zellij:strider" + tab-bar location="zellij:tab-bar" + welcome-screen location="zellij:session-manager" { + welcome_screen true + } +} diff --git a/modules/home/terminal/zellij/floating_fix.patch b/modules/home/terminal/zellij/floating_fix.patch new file mode 100644 index 0000000..c929612 --- /dev/null +++ b/modules/home/terminal/zellij/floating_fix.patch @@ -0,0 +1,32 @@ +diff --git a/zellij-utils/src/kdl/kdl_layout_parser.rs b/zellij-utils/src/kdl/kdl_layout_parser.rs +index c38c0146..d44440a7 100644 +--- a/zellij-utils/src/kdl/kdl_layout_parser.rs ++++ b/zellij-utils/src/kdl/kdl_layout_parser.rs +@@ -1607,6 +1607,10 @@ impl<'a> KdlLayoutParser<'a> { + floating_pane.add_cwd_to_layout(&cwd_prefix); + } + } ++ // hide_floating_panes on the tab_layout takes precedence over the hide_floating_panes on the tab_template ++ tab_layout.hide_floating_panes = ++ kdl_get_bool_property_or_child_value!(kdl_node, "hide_floating_panes") ++ .unwrap_or(tab_layout.hide_floating_panes); + tab_layout.external_children_index = None; + Ok(( + is_focused, +@@ -1671,6 +1675,8 @@ impl<'a> KdlLayoutParser<'a> { + let mut tab_floating_children = vec![]; + let mut external_children_index = None; + let mut children_index_offset = 0; ++ let hide_floating_panes = ++ kdl_get_bool_property_or_child_value!(kdl_node, "hide_floating_panes").unwrap_or(false); + let is_part_of_stack = false; + if let Some(children) = kdl_children_nodes!(kdl_node) { + for (i, child) in children.iter().enumerate() { +@@ -1721,6 +1727,7 @@ impl<'a> KdlLayoutParser<'a> { + children_split_direction, + children: tab_children, + external_children_index, ++ hide_floating_panes, + ..Default::default() + }, + tab_floating_children, diff --git a/modules/home/xdg.nix b/modules/home/xdg.nix index f0395cb..3215032 100644 --- a/modules/home/xdg.nix +++ b/modules/home/xdg.nix @@ -1,9 +1,14 @@ -{ pkgs, lib, config, ... }: { +{ + pkgs, + lib, + config, + ... +}: { options.mods.xdg.enable = lib.mkEnableOption "enables xdg settings"; config = lib.mkIf config.mods.xdg.enable { xdg = let - browser = [ "librewolf.desktop" ]; + browser = ["qutebrowser.desktop"]; associations = { "text/html" = browser; "x-scheme-handler/http" = browser; @@ -18,13 +23,13 @@ "application/x-extension-xhtml" = browser; "application/x-extension-xht" = browser; - "audio/*" = [ "mpv.desktop" ]; - "video/*" = [ "mpv.dekstop" ]; - "image/*" = [ "imv.desktop" ]; + "audio/*" = ["mpv.desktop"]; + "video/*" = ["mpv.dekstop"]; + "image/*" = ["imv.desktop"]; "application/json" = browser; # "application/pdf" = ["org.pwmt.zathura.desktop.desktop"]; - "x-scheme-handler/tg" = [ "kotatogram-desktop.desktop" ]; - "x-scheme-handler/discord" = [ "vesktop.desktop" ]; + "x-scheme-handler/tg" = ["kotatogram-desktop.desktop"]; + "x-scheme-handler/discord" = ["vesktop.desktop"]; }; in { enable = true; diff --git a/modules/nixos/core/boot.nix b/modules/nixos/core/boot.nix index 051e0d0..2c2e49d 100644 --- a/modules/nixos/core/boot.nix +++ b/modules/nixos/core/boot.nix @@ -11,10 +11,11 @@ timeout = 2; efi.canTouchEfiVariables = true; grub = { - enable = true; + enable = lib.mkDefault true; zfsSupport = true; efiSupport = true; device = "nodev"; + } // lib.optionalAttrs (config.mods.monitors != { }) { gfxmodeEfi = config.mods.monitors.primary.config.mode; }; }; diff --git a/modules/nixos/core/home.nix b/modules/nixos/core/home.nix index e2e1be9..8829fd5 100644 --- a/modules/nixos/core/home.nix +++ b/modules/nixos/core/home.nix @@ -1,19 +1,16 @@ -{ pkgs, lib, config, inputs, system, ... }: let - cfg = config.mods; +{ pkgs, lib, config, inputs, system, sources, ... }: +let cfg = config.mods; in { - options.mods.home.file = lib.mkOption { - description = "home-manager configuration file"; - }; + options.mods.home.file = + lib.mkOption { description = "home-manager configuration file"; }; config = { home-manager = { - extraSpecialArgs = { inherit system pkgs inputs; }; + extraSpecialArgs = { inherit system pkgs inputs sources; }; users."${cfg.user.name}" = { - imports = [ - cfg.home.file - inputs.self.outputs.homeManagerModules.default - ]; + imports = + [ cfg.home.file inputs.self.outputs.homeManagerModules.default ]; }; backupFileExtension = "bak"; }; diff --git a/modules/nixos/core/network.nix b/modules/nixos/core/network.nix index e6b2171..8eea024 100644 --- a/modules/nixos/core/network.nix +++ b/modules/nixos/core/network.nix @@ -27,7 +27,15 @@ in with lib; { config = { networking.networkmanager.enable = true; - services.resolved.enable = true; + # networking.nameservers = [ "45.90.28.97" "45.90.30.97" ]; + networking.nameservers = [ "194.242.2.4#base.dns.mullvad.net" ]; + # services.resolved = { + # enable = true; + # dnssec = "false"; + # dnsovertls = "true"; + # domains = [ "~." ]; + # fallbackDns = [ "194.242.2.4#base.dns.mullvad.net" ]; + # }; # udev 250 doesn't reliably reinitialize devices after restart systemd.services.systemd-udevd.restartIfChanged = false; @@ -73,6 +81,7 @@ in with lib; { presharedKeyFile = "/home/muon/wireguard-keys/psk-${config.networking.hostName}"; allowedIPs = [ "10.0.0.${toString wg.id}/24" ]; + # allowedIPs = [ "0.0.0.0/0" ]; # ip route add 93.95.230.11 via 192.168.0.1 endpoint = "93.95.230.11:51820"; persistentKeepalive = 25; diff --git a/modules/nixos/core/nix.nix b/modules/nixos/core/nix.nix index cabe731..16167ee 100644 --- a/modules/nixos/core/nix.nix +++ b/modules/nixos/core/nix.nix @@ -1,15 +1,23 @@ -{ pkgs, lib, config, inputs, system, ... }: { +{ + pkgs, + lib, + config, + inputs, + system, + ... +}: { options = { mods.nix.upgrade.enable = lib.mkEnableOption "enables nix auto upgrade"; mods.nix.clean.enable = lib.mkEnableOption "enables nix auto cleaning"; }; - config = let flake = "/home/${config.mods.user.name}/.config/home"; + config = let + flake = "/home/${config.mods.user.name}/.config/home"; in { system.autoUpgrade = { enable = config.mods.nix.upgrade.enable; flake = flake; - flags = [ "--commit-lock-file" "-L" ]; + flags = ["--commit-lock-file" "-L"]; dates = "02:00"; randomizedDelaySec = "45min"; }; @@ -21,19 +29,23 @@ flake = flake; }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings = { substituters = [ "https://cache.nixos.org" "https://nix-community.cachix.org" "https://nixpkgs-unfree.cachix.org" "https://hyprland.cachix.org" + "https://devenv.cachix.org" + "https://muon.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" + "muon.cachix.org-1:tHFazVc8JsSeeLa2WLi50DHpJZKYy4V+oKlbhnbecXE=" ]; }; diff --git a/modules/nixos/core/user.nix b/modules/nixos/core/user.nix index 800f01c..67f2989 100644 --- a/modules/nixos/core/user.nix +++ b/modules/nixos/core/user.nix @@ -8,10 +8,8 @@ users.users.${config.mods.user.name} = { isNormalUser = true; extraGroups = [ "wheel" ]; - initialPassword = "changeme"; - shell = if config.programs.zsh.enable - then pkgs.zsh - else pkgs.bash; + hashedPasswordFile = config.sops.secrets.muon-password.path; + shell = if config.programs.zsh.enable then pkgs.zsh else pkgs.bash; }; }; } diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index e86db4e..cbccb97 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,10 +1,18 @@ -{ pkgs, lib, ... }: { +{ + pkgs, + lib, + ... +}: { imports = [ ./core ./system ./desktop ./theme ./server + ./sops + ./security + + ./impermanence.nix # { }, ... }: { + default = pkgs.mkShell { + NIX_CONFIG = + "extra-experimental-features = nix-command flakes ca-derivations"; + nativeBuildInputs = with pkgs; [ + nix + git + + sops + age + nvfetcher + ]; + }; +} diff --git a/utils.nix b/utils.nix index e532287..fdb6c8b 100644 --- a/utils.nix +++ b/utils.nix @@ -1,21 +1,14 @@ -{ builtins, inputs, system, pkgs, ... }: { +{ inputs, system, sources, ... }: { mkHost = host: inputs.nixpkgs.lib.nixosSystem { - specialArgs = with builtins; - let - hasInfix = infix: content: match ".*${infix}.*" "${content}" != null; - muho = hasInfix "/muho/" (toString host); - in if muho then { - inherit inputs system pkgs; - } else { - inherit inputs system; - }; + specialArgs = { inherit inputs system sources; }; modules = [ host ./modules/nixos inputs.home-manager.nixosModules.default inputs.stylix.nixosModules.stylix + inputs.impermanence.nixosModules.impermanence ]; }; }