diff options
author | polwex <polwex@sortug.com> | 2025-01-31 01:55:31 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-01-31 01:55:31 +0700 |
commit | 0e69d956f5fc20546d0a96a3891d6dd29942468b (patch) | |
tree | ea37d521b299e0d606dd6f84a3db76ff3a568ede | |
parent | fb39334bcdac65a1ff1d95e7e4db2e28eabcc2d6 (diff) |
config for wayland on nvidia
-rw-r--r-- | derivations/windsurf/default.nix | 39 | ||||
-rw-r--r-- | derivations/windsurf/flake.lock | 27 | ||||
-rw-r--r-- | derivations/windsurf/flake.nix | 21 | ||||
-rw-r--r-- | derivations/windsurf/update-shell.nix | 18 | ||||
-rw-r--r-- | derivations/windsurf/update.sh | 70 | ||||
-rw-r--r-- | derivations/windsurf/windsurf.nix | 41 | ||||
-rw-r--r-- | flake.lock | 148 | ||||
-rw-r--r-- | flake.nix | 15 | ||||
-rw-r--r-- | hosts/local/i3.nix | 74 | ||||
-rw-r--r-- | hosts/local/master/configuration.nix | 12 | ||||
-rw-r--r-- | hosts/local/master/default.nix | 1 | ||||
-rw-r--r-- | hosts/local/master/keyboard.nix | 58 | ||||
-rw-r--r-- | hosts/local/master/thinkpad.kbd | 105 | ||||
-rw-r--r-- | hosts/local/nvidia.nix | 42 | ||||
-rw-r--r-- | hosts/local/wayland.nix | 20 | ||||
-rw-r--r-- | hosts/nixos.nix | 16 | ||||
-rw-r--r-- | hosts/unfree.nix | 17 |
17 files changed, 542 insertions, 182 deletions
diff --git a/derivations/windsurf/default.nix b/derivations/windsurf/default.nix new file mode 100644 index 0000000..9dc7cec --- /dev/null +++ b/derivations/windsurf/default.nix @@ -0,0 +1,39 @@ +{ + lib, + stdenv, + nixpkgs, + callPackage, + fetchurl, + nixosTests, + commandLineArgs ? "", + useVSCodeRipgrep ? stdenv.hostPlatform.isDarwin, +}: +# https://windsurf-stable.codeium.com/api/update/linux-x64/stable/latest +let + version = "1.2.2"; # "windsurfVersion" + hash = "c418a14b63f051e96dafb37fe06f1fe0b10ba3c8"; # "version" +in + callPackage "${nixpkgs}/pkgs/applications/editors/vscode/generic.nix" rec { + inherit commandLineArgs useVSCodeRipgrep version; + + pname = "windsurf"; + + executableName = "windsurf"; + longName = "Windsurf"; + shortName = "windsurf"; + + src = fetchurl { + url = "https://windsurf-stable.codeiumdata.com/linux-x64/stable/${hash}/Windsurf-linux-x64-${version}.tar.gz"; + hash = "sha256-fsDPzHtAmQIfFX7dji598Q+KXO6A5F9IFEC+bnmQzVU="; + }; + + sourceRoot = "Windsurf"; + + tests = nixosTests.vscodium; + + updateScript = "nil"; + + meta = { + description = "The first agentic IDE, and then some"; + }; + } diff --git a/derivations/windsurf/flake.lock b/derivations/windsurf/flake.lock new file mode 100644 index 0000000..1bb2222 --- /dev/null +++ b/derivations/windsurf/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1737885589, + "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/derivations/windsurf/flake.nix b/derivations/windsurf/flake.nix new file mode 100644 index 0000000..dea1732 --- /dev/null +++ b/derivations/windsurf/flake.nix @@ -0,0 +1,21 @@ +{ + # https://github.com/dtgagnon/nix-config/tree/main/packages/windsurf + description = "Windsurf flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.${system}.default = pkgs.callPackage ./windsurf.nix { + inherit (pkgs) lib stdenv; + inherit nixpkgs; + }; + }; +} diff --git a/derivations/windsurf/update-shell.nix b/derivations/windsurf/update-shell.nix new file mode 100644 index 0000000..366cef6 --- /dev/null +++ b/derivations/windsurf/update-shell.nix @@ -0,0 +1,18 @@ +{ + lib, + pkgs, + ... +}: +lib.mkShell { + packages = with pkgs; [ + bash + curl + gawk + gnugrep + gnused + jq + nix + nix-prefetch + nix-prefetch-scripts + ]; +} diff --git a/derivations/windsurf/update.sh b/derivations/windsurf/update.sh new file mode 100644 index 0000000..8825b65 --- /dev/null +++ b/derivations/windsurf/update.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +#! nix-shell update-shell.nix -i bash + +# Update script for the windsurf package, including vscode versions and hashes. +# Usually doesn't need to be called by hand, +# but is called by a bot: https://github.com/samuela/nixpkgs-upkeep/actions +# Call it by hand if the bot fails to automatically update the versions. + +set -euo pipefail + +# Directory where this script is located +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Supported platforms +declare -A platforms=( + ["x86_64-linux"]="linux-x64" + # Uncomment when supported + # ["x86_64-darwin"]="macos-x64" + # ["aarch64-linux"]="linux-arm64" + # ["aarch64-darwin"]="macos-arm64" + # ["armv7l-linux"]="linux-armhf" +) + +# Get latest version from API json +get_latest_version() { + local plat="$1" + curl -s "https://windsurf-stable.codeium.com/api/update/$plat/stable/latest" | jq -r ".windsurfVersion" +} + +# Get commit hash from API json +get_commit_hash() { + local plat="$1" + local version="$2" + curl -s "https://windsurf-stable.codeium.com/api/update/$plat/stable/latest" | jq -r ".version" +} + +# Get sha256hash from API json +get_sha256_hash() { + local plat="$1" + curl -s "https://windsurf-stable.codeium.com/api/update/$plat/stable/latest" | jq -r ".sha256hash" +} + +# Main update function +update_package() { + echo "Updating Windsurf package..." + + # Get version info for linux-x64 (primary platform) + local version + version=$(get_latest_version "linux-x64") + echo "Latest version: $version" + + local commit_hash + commit_hash=$(get_commit_hash "linux-x64" "$version") + echo "Commit hash: $commit_hash" + + local sha256_hash + sha256_hash=$(get_sha256_hash "linux-x64") + echo "sha256 hash: $sha256_hash" + + # Update default.nix + local default_nix="$SCRIPT_DIR/default.nix" + sed -i "s/version = \".*\"/version = \"$version\"/" "$default_nix" + sed -i "s|/stable/[a-f0-9]\{40\}/|/stable/$commit_hash/|" "$default_nix" + sed -i "s/x86_64-linux = \".*\"/x86_64-linux = \"$sha256_hash\"/" "$default_nix" + + echo "Update complete!" +} + +# Run the update +update_package diff --git a/derivations/windsurf/windsurf.nix b/derivations/windsurf/windsurf.nix new file mode 100644 index 0000000..237be28 --- /dev/null +++ b/derivations/windsurf/windsurf.nix @@ -0,0 +1,41 @@ +{ + lib, + stdenv, + nixpkgs, + callPackage, + fetchurl, + nixosTests, + commandLineArgs ? "", + useVSCodeRipgrep ? stdenv.hostPlatform.isDarwin, +}: +# https://windsurf-stable.codeium.com/api/update/linux-x64/stable/latest +let + version = "1.2.2"; # "windsurfVersion" + hash = "be4251dfb74e60e80fa973d61f3505da1ac9032e"; # "version" +in + callPackage "${nixpkgs}/pkgs/applications/editors/vscode/generic.nix" rec { + inherit commandLineArgs useVSCodeRipgrep version; + + pname = "windsurf"; + + executableName = "windsurf"; + longName = "Windsurf"; + shortName = "windsurf"; + + src = fetchurl { + url = "https://windsurf-stable.codeiumdata.com/linux-x64/stable/${hash}/Windsurf-linux-x64-${version}.tar.gz"; + hash = "sha256-s53azwr+bO7UHVAq0iydP09z7ZK9rvF2P7NKoGPmUMM="; + }; + + sourceRoot = "Windsurf"; + + tests = nixosTests.vscodium; + + updateScript = "nil"; + + meta = { + description = "The first agentic IDE, and then some"; + }; + } +# https://windsurf-stable.codeiumdata.com/linux-x64/stable/be4251dfb74e60e80fa973d61f3505da1ac9032e/Windsurf-linux-x64-1.2.2.tar.gz + @@ -70,21 +70,21 @@ "flake-utils" ], "nixpkgs": [ - "nixpkgs-unfree" + "nixpkgs" ] }, "locked": { - "lastModified": 1736624144, - "narHash": "sha256-wsI1tjN/dQ+yeLurOHwk7RASm/KVqxUXCNd3QSBN3pA=", - "owner": "k3d3", - "repo": "claude-desktop-linux-flake", - "rev": "83fa37319f07bca47278f344b45af1d46ce2feca", - "type": "github" + "lastModified": 1738150082, + "narHash": "sha256-8CTUXRlFbybm5aGgnAkfAX3KO4NnqP4OgXr6RLU6leM=", + "ref": "refs/heads/master", + "rev": "c50cb8dd2b058355514e7a254d28b4cdcfc7c4f8", + "revCount": 15, + "type": "git", + "url": "file://git:file:/home/y/code/nix/claude-desktop-linux-flake" }, "original": { - "owner": "k3d3", - "repo": "claude-desktop-linux-flake", - "type": "github" + "type": "git", + "url": "file://git:file:/home/y/code/nix/claude-desktop-linux-flake" } }, "crane": { @@ -162,11 +162,11 @@ ] }, "locked": { - "lastModified": 1737038063, - "narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=", + "lastModified": 1738148035, + "narHash": "sha256-KYOATYEwaKysL3HdHdS5kbQMXvzS4iPJzJrML+3TKAo=", "owner": "nix-community", "repo": "disko", - "rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2", + "rev": "18d0a984cc2bc82cf61df19523a34ad463aa7f54", "type": "github" }, "original": { @@ -586,11 +586,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1737677675, - "narHash": "sha256-a6VO9JFCif+4ipdszBcQO772QLmBtj9Ai5iAgi/4+/U=", + "lastModified": 1738073973, + "narHash": "sha256-+Bjgq2LuCrFQ8RA/25dWSAguFLH53TxoQZWuX7fb4gc=", "owner": "helix-editor", "repo": "helix", - "rev": "a63a2ad281b5f651effd29efa4e34f504507d0da", + "rev": "6049f2035be3e218da327b51d8e4bfd36242dd43", "type": "github" }, "original": { @@ -641,11 +641,11 @@ }, "impermanence": { "locked": { - "lastModified": 1736688610, - "narHash": "sha256-1Zl9xahw399UiZSJ9Vxs1W4WRFjO1SsNdVZQD4nghz0=", + "lastModified": 1737831083, + "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=", "owner": "nix-community", "repo": "impermanence", - "rev": "c64bed13b562fc3bb454b48773d4155023ac31b7", + "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170", "type": "github" }, "original": { @@ -660,11 +660,11 @@ }, "locked": { "dir": "nix", - "lastModified": 1736192527, - "narHash": "sha256-PhHc2F0ASe6glFGVsUfkYv5uMVUPs2RJ+htt8LA/xHc=", + "lastModified": 1737901920, + "narHash": "sha256-KTWNHAR8FaavuDCWoq0tOR9BP1/zMQO1Ctw1eRKYSNY=", "owner": "kmonad", "repo": "kmonad", - "rev": "25de8837fdd89b5c70bb313188f7430fe29e0c42", + "rev": "b527946b680ee2af25b99fc6bf9386cf175cc02f", "type": "github" }, "original": { @@ -703,11 +703,11 @@ "nixpkgs-lib": "nixpkgs-lib_3" }, "locked": { - "lastModified": 1737288694, - "narHash": "sha256-e9MsdkHidgepQpF0InyRSpeD6YujQcaB0uUzeXVvW+I=", + "lastModified": 1737893510, + "narHash": "sha256-AzUuPAdHSSiYQm+gOtOdyazY432QN8+s8nLPtqbTXjw=", "owner": "nix-community", "repo": "lib-aggregate", - "rev": "e07594822638004d96f100febbe947189c42e8a9", + "rev": "8bfb3946eb1aa6f8b56b2b26c8479b20f5e6c04e", "type": "github" }, "original": { @@ -723,11 +723,11 @@ "spectrum": "spectrum" }, "locked": { - "lastModified": 1736905611, - "narHash": "sha256-eW6SfZRaOnOybBzhvEzu3iRL8IhwE0ETxUpnkErlqkE=", + "lastModified": 1737981104, + "narHash": "sha256-7AGmPPBgLHHWgzzFYDJcyhv/NiuCrpgzg8IyA7Q/H9o=", "owner": "astro", "repo": "microvm.nix", - "rev": "a18d7ba1bb7fd4841191044ca7a7f895ef2adf3b", + "rev": "3768f4937f38334898c67e03f40e244a57a74caa", "type": "github" }, "original": { @@ -743,11 +743,11 @@ ] }, "locked": { - "lastModified": 1737504076, - "narHash": "sha256-/B4XJnzYU/6K1ZZOBIgsa3K4pqDJrnC2579c44c+4rI=", + "lastModified": 1738033138, + "narHash": "sha256-qlIM8A3bdL9c6PexhpS+QyZLO9y/8a3V75HVyJgDE5Q=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "65cc1fa8e36ceff067daf6cfb142331f02f524d3", + "rev": "349a74c66c596ef97ee97b4d80a3ca61227b6120", "type": "github" }, "original": { @@ -764,11 +764,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1736194844, - "narHash": "sha256-CXtD5xUKb92EjL9RrsGQ9jgnl0aIoGEPwnJ805d3Xz0=", + "lastModified": 1737635767, + "narHash": "sha256-/AhicHbKv5eVbHhA1zDkUTU4JEZ8P9sPB6r2+iZhERU=", "owner": "nix-community", "repo": "nix-eval-jobs", - "rev": "cbae9154bc76c5aa7873f0a67b3c9f13124929d3", + "rev": "6521196d5900db73e4e18b84a2162486b19c141b", "type": "github" }, "original": { @@ -784,11 +784,11 @@ "umu": "umu" }, "locked": { - "lastModified": 1737596278, - "narHash": "sha256-OEdGZ6TTHXGB791VvhErq4Nro54NQzzDAO0G0WfK2kw=", + "lastModified": 1737855374, + "narHash": "sha256-RRGX2C+c+GaR3YMiYm6l/Tp5N/KZtYpiTplUrBwH/og=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "10f37dc9be5d79fec72b46b670ece4783a83a13a", + "rev": "4845fe94cda365c7550d9fd1ef899d45df0bc18a", "type": "github" }, "original": { @@ -915,11 +915,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1737590910, - "narHash": "sha256-qM/y6Dtpu9Wmf5HqeZajQdn+cS0aljdYQQQnrvx+LJE=", + "lastModified": 1737751639, + "narHash": "sha256-ZEbOJ9iT72iwqXsiEMbEa8wWjyFvRA9Ugx8utmYbpz4=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "9368027715d8dde4b84c79c374948b5306fdd2db", + "rev": "dfad538f751a5aa5d4436d9781ab27a6128ec9d4", "type": "github" }, "original": { @@ -1066,11 +1066,11 @@ }, "nixpkgs-lib_3": { "locked": { - "lastModified": 1737248590, - "narHash": "sha256-6SWtDeYJS3bS7QyJrGKyd6FpROEN0JCMgakSX8yPbyA=", + "lastModified": 1737853225, + "narHash": "sha256-ZqbbvE9MVNHxSObvAoqRExBsQpfz81u3Ry77agBJIyo=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "977f49fd8cf854416f82987696784717acd6e817", + "rev": "31d08f4e55442d13eb8766b4d6852d9fb8292382", "type": "github" }, "original": { @@ -1116,11 +1116,11 @@ "nixpkgs": "nixpkgs_11" }, "locked": { - "lastModified": 1737555756, - "narHash": "sha256-3LUuooq/dlkRpm+1+i1iu/AKLci9iDsICdLHXroHoy4=", + "lastModified": 1737987762, + "narHash": "sha256-lwlwj99u58bJ7c992XGSLmCMUaNNP6OlayuESHu0zes=", "owner": "numtide", "repo": "nixpkgs-unfree", - "rev": "5da80ccf5e3ea5a5d5fa429bf499f17c40dc3b74", + "rev": "9738e3dcfa7507f53eb542ac31da8ab186ac19d6", "type": "github" }, "original": { @@ -1140,11 +1140,11 @@ ] }, "locked": { - "lastModified": 1737481114, - "narHash": "sha256-SrpaK5R4nMqq6ZDNm/G2Bj53xHEsouz9w7ZiMDqb0Bc=", + "lastModified": 1738147148, + "narHash": "sha256-/RXuwK2UD1wbs7MKrE5nCN60j1KY0U1qEsexSkK9pv4=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "c52a529dd1585cad4ccd5951b10ba27366aa3cee", + "rev": "f1cc3583a7c06857f3e26a850b34766431a15442", "type": "github" }, "original": { @@ -1155,11 +1155,11 @@ }, "nixpkgs_10": { "locked": { - "lastModified": 1737632463, - "narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=", + "lastModified": 1737885589, + "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0aa475546ed21629c4f5bbf90e38c846a99ec9e9", + "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", "type": "github" }, "original": { @@ -1171,11 +1171,11 @@ }, "nixpkgs_11": { "locked": { - "lastModified": 1737469691, - "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", + "lastModified": 1737885589, + "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", + "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", "type": "github" }, "original": { @@ -1201,11 +1201,11 @@ }, "nixpkgs_13": { "locked": { - "lastModified": 1737632463, - "narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=", + "lastModified": 1737885589, + "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0aa475546ed21629c4f5bbf90e38c846a99ec9e9", + "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", "type": "github" }, "original": { @@ -1233,11 +1233,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1737469691, - "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", + "lastModified": 1728018373, + "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", + "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", "type": "github" }, "original": { @@ -1313,11 +1313,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1737003892, - "narHash": "sha256-RCzJE9wKByLCXmRBp+z8LK9EgdW+K+W/DXnJS4S/NVo=", + "lastModified": 1737717945, + "narHash": "sha256-ET91TMkab3PmOZnqiJQYOtSGvSTvGeHoegAv4zcTefM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ae06b9c2d83cb5c8b12d7d0e32692e93d1379713", + "rev": "ecd26a469ac56357fd333946a99086e992452b6a", "type": "github" }, "original": { @@ -1366,11 +1366,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1737719148, - "narHash": "sha256-ycZZghpy+/Hpnzaw252ovAelilVo8/Kz6ah/l9DfdIQ=", + "lastModified": 1738149250, + "narHash": "sha256-ueJsDHnApfukmNu0ctIZL1AKR8KNaPuiAPVADFC+ans=", "owner": "nix-community", "repo": "NUR", - "rev": "44b2880e3f1b5a877b74c3a893dfa03dc1caf238", + "rev": "d221a29d4b156f902fd43c95ae242b406fc01846", "type": "github" }, "original": { @@ -1724,11 +1724,11 @@ }, "locked": { "dir": "packaging/nix", - "lastModified": 1737161836, - "narHash": "sha256-v20q0DeglyrsIAbqwqOSxdzZ4JhEWtU9muWPlPz3Few=", + "lastModified": 1737834175, + "narHash": "sha256-fhyc89qqYM3ql0k4hJVibAhXvEXOch96hnsEGB7Av3I=", "ref": "refs/heads/main", - "rev": "3fd4ef90e8427cfc74d94914654a288912edb2cf", - "revCount": 901, + "rev": "4d1860eefd79d6c04e964774155dbe13be65121a", + "revCount": 911, "submodules": true, "type": "git", "url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix" @@ -1748,11 +1748,11 @@ ] }, "locked": { - "lastModified": 1736677965, - "narHash": "sha256-vj4NpvjjW5cUBYJc9AUbH8D8LIkoSwQyKJ+02tHKAAU=", + "lastModified": 1737793892, + "narHash": "sha256-Dl7JEjpno+4dv66ZhqQyHT3zWw6d51fJ0cphu0Aejqk=", "owner": "alexays", "repo": "waybar", - "rev": "a4241d700823cbee9e717c90a8408e2dfc977b45", + "rev": "481b01d9af1e34b7501665bbfc0b19fce5082eb5", "type": "github" }, "original": { @@ -70,6 +70,15 @@ url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; inputs.nixpkgs.follows = "nixpkgs"; }; + claude-desktop = { + url = "git:file:/home/y/code/nix/claude-desktop-linux-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + windsurf = { + url = "path:derivations/windsurf"; + inputs.nixpkgs.follows = "nixpkgs"; + }; ############# non flakes ############ @@ -78,12 +87,6 @@ flake = false; }; - claude-desktop = { - url = "github:k3d3/claude-desktop-linux-flake"; - inputs.nixpkgs.follows = "nixpkgs-unfree"; - inputs.flake-utils.follows = "flake-utils"; - }; - ########### secrets ################# # mysecrets = { # url = "git+ssh://git@git.sortug.com/polwex/nix-secrets.git"; diff --git a/hosts/local/i3.nix b/hosts/local/i3.nix index 50b9afa..a45c3c1 100644 --- a/hosts/local/i3.nix +++ b/hosts/local/i3.nix @@ -27,9 +27,15 @@ # gnome stuff services.gvfs.enable = true; programs.dconf.enable = true; + # screen tearing + services.picom = { + enable = true; + vSync = true; + }; environment.systemPackages = with pkgs; [ + #notifications + dunst # gnome stuff - gnome.adwaita-icon-theme nautilus polybar rofi @@ -40,6 +46,7 @@ # screenshots flameshot shutter + xclip maim kitty @@ -49,6 +56,8 @@ brave gimp vlc + mpv + celluloid thunderbird kmail firefox @@ -91,36 +100,37 @@ defaultFonts.sansSerif = ["DejaVu Sans"]; defaultFonts.serif = ["DejaVu Serif" "Source Han Serif SC"]; }; - packages = with pkgs; [ - fira-code - fira - cooper-hewitt - ibm-plex - jetbrains-mono - iosevka - spleen - fira-code-symbols - powerline-fonts - nerdfonts - arphic-ukai - arphic-uming - dejavu_fonts - font-awesome - inconsolata # monospaced - noto-fonts - noto-fonts-cjk-sans - noto-fonts-emoji - noto-fonts-extra - powerline-fonts - source-han-sans-japanese - source-han-sans-korean - source-han-sans-simplified-chinese - source-han-sans-traditional-chinese - source-sans-pro - ubuntu_font_family - wqy_microhei - wqy_zenhei - ]; + packages = with pkgs; + [ + fira-code + fira + cooper-hewitt + ibm-plex + jetbrains-mono + iosevka + spleen + fira-code-symbols + powerline-fonts + arphic-ukai + arphic-uming + dejavu_fonts + font-awesome + inconsolata # monospaced + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + noto-fonts-extra + powerline-fonts + source-han-sans-japanese + source-han-sans-korean + source-han-sans-simplified-chinese + source-han-sans-traditional-chinese + source-sans-pro + ubuntu_font_family + wqy_microhei + wqy_zenhei + ] + ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); }; # screen capture @@ -133,7 +143,7 @@ ## Remove sound.enable or set it to false if you had it set previously, as sound.enable is only meant for ALSA-based configurations # rtkit is optional but recommended - hardware.pulseaudio.enable = false; + services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; diff --git a/hosts/local/master/configuration.nix b/hosts/local/master/configuration.nix index 4888f30..aa12e1c 100644 --- a/hosts/local/master/configuration.nix +++ b/hosts/local/master/configuration.nix @@ -6,13 +6,13 @@ # Include the results of the hardware scan. ../../base.nix ../../linux.nix - # ../../unfree.nix + ../../unfree.nix #../../android.nix - # ../i3.nix + ../i3.nix # ../gnome.nix - # ../wayland.nix + #../wayland.nix ../nvidia.nix - ./keyboard.nix + ./keyboard.nix ]; # Use the systemd-boot EFI boot loader. @@ -32,8 +32,8 @@ time.timeZone = "Asia/Bangkok"; # Enable the OpenSSH daemon. - services.openssh.enable = true; - services.openssh.ports = [5555]; + # services.openssh.enable = true; + # services.openssh.ports = [5555]; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/hosts/local/master/default.nix b/hosts/local/master/default.nix index 91e5016..e2ee3e0 100644 --- a/hosts/local/master/default.nix +++ b/hosts/local/master/default.nix @@ -1,4 +1,5 @@ inputs: [ + {nixpkgs.config.allowUnfree = true;} inputs.kmonad.nixosModules.default ./hardware-configuration.nix ./configuration.nix diff --git a/hosts/local/master/keyboard.nix b/hosts/local/master/keyboard.nix index 215d05f..d9f6d84 100644 --- a/hosts/local/master/keyboard.nix +++ b/hosts/local/master/keyboard.nix @@ -1,46 +1,38 @@ -{ config, lib, pkgs, ... }: - -{ - services.logind.extraConfig = '' +{pkgs, ...}: { + services.logind.extraConfig = '' # don’t shutdown when power button is short-pressed HandlePowerKey=ignore ''; -# config file keeps getting rewritten but I don't know by who - # i18n.inputMethod = { - # enabled = "fcitx5"; - # fcitx5.addons = with pkgs; [ - # fcitx5-mozc - # # mozc-ut is better, wat do - # fcitx5-gtk - # libsForQt5.fcitx5-qt - # fcitx5-lua - # fcitx5-configtool - # fcitx5-rime - # ]; - # }; + # config file keeps getting rewritten but I don't know by who + i18n.inputMethod = { + enable = true; + type = "fcitx5"; + fcitx5.addons = with pkgs; [ + fcitx5-mozc + # mozc-ut is better, wat do + fcitx5-gtk + libsForQt5.fcitx5-qt + fcitx5-lua + fcitx5-configtool + fcitx5-rime + ]; + }; environment.variables = { GTK_IM_MODULE = "fcitx"; - QT_IM_MODULE = "fcitx"; + QT_IM_MODULE = "fcitx"; XMODIFIERS = "@im=fcitx"; FCITX_SOCKET = "default"; }; - - #kmonad - services.kmonad ={ - enable = true; - - keyboards.internal = { - device = "/dev/input/by-id/usb-Compx_2.4G_Receiver-event-kbd"; - config = builtins.readFile ./compx.kbd; - # device = "/dev/input/by-id/usb-RAPOO_Rapoo_2.4G_Wireless_Device-if02-event-kbd"; - # config = builtins.readFile ./rapoo.kbd; - - # defcfg = { - # enable = true; - # fallthrough = true; - # }; + #kmonad + services.kmonad = { + enable = true; + keyboards = { + usbThinkpad = { + device = "/dev/input/by-id/usb-Lenovo_TrackPoint_Keyboard_II-event-kbd"; + config = builtins.readFile ./thinkpad.kbd; }; }; + }; } diff --git a/hosts/local/master/thinkpad.kbd b/hosts/local/master/thinkpad.kbd new file mode 100644 index 0000000..6f9c253 --- /dev/null +++ b/hosts/local/master/thinkpad.kbd @@ -0,0 +1,105 @@ +;; one liner comments ';;' +#| Multiline + comments |# + +(defcfg ;; For linux & by-id lists pluggable devices +;; If a key is not bound/left_empty(_) then it will fall back to the previous +;; layer's binding if not then default. +fallthrough true +;; To run system commands. You MIGHT face issues with tiling window managers due to command helpers. +;; allow-cmd true +;; use 'ls /dev/input/by-id/' for detachable keyboards and +;; 'ls /dev/input/by-path/' for builtin keyboards location' +input (device-file "/dev/input/by-id/usb-Lenovo_ThinkPad_Compact_USB_Keyboard_with_TrackPoint-event-kbd") +;; Not sure what this does. Please check the docs. +output (uinput-sink "My KMonad output") +) + +;; This is the real representation of your actual keyboard. We haven't started +;; customizing layouts yet. +(defsrc + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + caps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + lctl lmet lalt spc ralt rctl pgup up pgdn + left down right +) +;; Aliases + +(defalias +;; Layer toggles +sym (layer-toggle syms) +sym2 (layer-toggle syms2) +cords (sticky-key 1000 (layer-toggle mods)) +;; +hrt (layer-switch homerowmods) +back (layer-switch qwerty) + +;; Homerow keys +a (tap-hold-next-release 280 a lctl) +s (tap-hold-next-release 280 s lalt) +d (tap-hold-next-release 280 d lmet) +f (tap-hold-next-release 280 f lsft) +;; +j (tap-hold-next-release 280 j rsft) +k (tap-hold-next-release 280 k lmet) +l (tap-hold-next-release 280 l lalt) +semi (tap-hold-next-release 280 ; rctl) + +;; button to launch brave browser +;; veeb (cmd-button "brave") +;; ssf (sticky-key 500 (layer-toggle rshift)) +;; rsf (layer-toggle rshift) +) + +;; The first custom layer is the one that gets activated when kmonad is started +(deflayer qwerty ;; The default layer that'd be read when you launch kmonad + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + esc a s d f g h j k l ; ' ret + @sym z x c v b n m , . / rsft + lctl lmet @sym spc @cords @hrt left up right + left down right +) +(deflayer homerowmods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + esc @a @s @d @f g h @j @k @l @semi ' ret + @sym z x c v b n m , . / rsft + lctl lmet @sym spc lalt @back left up right + left down right +) +(deflayer mods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] h + esc lctl lalt lmet lsft g h rsft rmet ralt rctl ' ret + @sym z x c v b n m , . / rsft + lctl lmet @sym spc lalt @back left up right + left down right +) + +;; A layer dedicated to symbols +(deflayer syms + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ up _ _ ! @ # $ % _ _ _ + _ _ left down right @sym2 ' ^ & - = _ ret + _ _ _ _ _ _ \( [ { < \ _ _ + _ _ _ _ _ _ _ _ _ _ _ +) + + +;; More symbols +(deflayer syms2 + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ ` ~ * \_ + _ ret + _ _ _ _ _ _ \) ] } > | _ _ + _ _ _ _ _ _ _ _ _ _ _ +) diff --git a/hosts/local/nvidia.nix b/hosts/local/nvidia.nix index 4b2e67a..2d094c9 100644 --- a/hosts/local/nvidia.nix +++ b/hosts/local/nvidia.nix @@ -1,7 +1,23 @@ -{config, pkgs, ...}: { +{ + config, + lib, + pkgs, + ... +}: let + nverStable = config.boot.kernelPackages.nvidiaPackages.stable.version; + nverBeta = config.boot.kernelPackages.nvidiaPackages.beta.version; + nvidiaPackage = + if (lib.versionOlder nverBeta nverStable) + then config.boot.kernelPackages.nvidiaPackages.stable + else config.boot.kernelPackages.nvidiaPackages.beta; +in { boot.kernelModules = ["nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm"]; # boot.kernelPackages = lib.mkForce unfreePkgs.linuxKernel.packages.linux_xanmod_latest; # boot.kernelParams = ["video=HDMI-A-1:1920x1080"]; + # + hardware.graphics = { + enable = true; + }; # hardware.graphics= { # package = (pkgs.mesa.override { galliumDrivers = [ "i915" "swrast" ]; }).drivers; # enable = true; @@ -11,23 +27,26 @@ "https://cuda-maintainers.cachix.org" ]; nix.settings.trusted-public-keys = [ - "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" + "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" ]; - + services.xserver = { videoDrivers = ["nvidia"]; + displayManager.gdm.wayland = true; + displayManager.gdm.nvidiaWayland = true; }; # environment.systemPackages = with pkgs;[ - # libva-utils - # nvidia-vaapi-driver - # pciutils - # vdpauinfo - # (blender.override { - # cudaSupport = true; - # }) + # libva-utils + # nvidia-vaapi-driver + # pciutils + # vdpauinfo + # (blender.override { + # cudaSupport = true; + # }) # ]; hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.stable; + # package = config.boot.kernelPackages.nvidiaPackages.stable; + package = nvidiaPackage; modesetting.enable = true; powerManagement.enable = false; powerManagement.finegrained = false; @@ -44,5 +63,4 @@ # ibtSupport = true; # }; - } diff --git a/hosts/local/wayland.nix b/hosts/local/wayland.nix index 674c54b..8f588c8 100644 --- a/hosts/local/wayland.nix +++ b/hosts/local/wayland.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + inputs, + pkgs, + ... +}: { nixpkgs.config.packageOVerrides = pkgs: { intel-vaapi-driver = pkgs.intel-vaapi-driver.override {enableHybridCodec = true;}; vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;}; @@ -15,7 +19,7 @@ programs.sway = { enable = true; wrapperFeatures.gtk = true; - extraOptions = ["--verbose" "--debug"]; + extraOptions = ["unsupported-gpu" "--verbose" "--debug"]; extraPackages = with pkgs; [ xdg-utils xdg-desktop-portal @@ -29,9 +33,6 @@ brightnessctl swayidle foot - (waybar.override { - wireplumberSupport = false; - }) mako kanshi grim @@ -42,6 +43,10 @@ playerctl blueman wdisplays + inputs.nixpkgs-wayland.packages.x86_64-linux.waybar + glxinfo + vulkan-tools + glmark2 ]; extraSessionCommands = '' ''; @@ -51,8 +56,11 @@ # exec swayc # fi #''; - + environment.variables = { + WLR_NO_HARDWARE_CURSOR = "1"; + }; environment.sessionVariables = { + WLR_NO_HARDWARE_CURSOR = "1"; NIXOS_OZONE_WL = "1"; SDL_VIDEODRIVER = "wayland"; QT_QPA_PLATFORM = "wayland"; diff --git a/hosts/nixos.nix b/hosts/nixos.nix index 1b7b55c..94348d8 100644 --- a/hosts/nixos.nix +++ b/hosts/nixos.nix @@ -10,16 +10,16 @@ in { s15 = mkNixosSystem "aarch64-linux" "local/s15"; fw11 = mkNixosSystem "x86_64-linux" "local/fw11"; - master = mkNixosSystem "x64_64-linux" "local/master"; - # vivo2025 = mkNixosSystem "x64_64-linux" "local/vivo2025"; - ohira = mkNixosSystem "x64_64-linux" "local/ohira"; + master = mkNixosSystem "x86_64-linux" "local/master"; + # vivo2025 = mkNixosSystem "x86_64-linux" "local/vivo2025"; + ohira = mkNixosSystem "x86_64-linux" "local/ohira"; # # headless # r5s = mkNixosSystem "aarch64-linux" "headless/r5s"; # pi4 = mkNixosSystem "aarch64-linux" "headless/pi4"; # # cloud boxes - sortug = mkNixosSystem "x64_64-linux" "cloud/sortug"; - span = mkNixosSystem "x64_64-linux" "cloud/span"; - lightnode = mkNixosSystem "x64_64-linux" "cloud/bkk"; - hostinger = mkNixosSystem "x64_64-linux" "cloud/jeet"; - # contabo = mkNixosSystem "x64_64-linux" "cloud/contabo"; + sortug = mkNixosSystem "x86_64-linux" "cloud/sortug"; + span = mkNixosSystem "x86_64-linux" "cloud/span"; + lightnode = mkNixosSystem "x86_64-linux" "cloud/bkk"; + hostinger = mkNixosSystem "x86_64-linux" "cloud/jeet"; + # contabo = mkNixosSystem "x86_64-linux" "cloud/contabo"; } diff --git a/hosts/unfree.nix b/hosts/unfree.nix index 73c4a8a..169b086 100644 --- a/hosts/unfree.nix +++ b/hosts/unfree.nix @@ -15,21 +15,28 @@ # opera spotify microsoft-edge - vscode + # vscode # fonts corefonts # symbola - steamcmd - steam-run + # steamcmd + # steam-run protonup-qt - # inputs.claude-desktop.packages.x86_64-linux.claude-desktop + # mangohud + # lutris + # bottles + # heroic + inputs.claude-desktop.packages.x86_64-linux.claude-desktop ]; # fucking vscode requires this for github copilot services.gnome.gnome-keyring.enable = true; programs.steam = { enable = true; - extraCompatPackages = [pkgs.proton-ge-bin]; + # package = pkgs.steam.override { + # extraLibraries = pkgs: [pkgs.openssl pkgs.nghttp2 pkgs.libidn2 pkgs.rtmpdump pkgs.libpsl pkgs.curl pkgs.krb5 pkgs.keyutils]; + # }; + # extraCompatPackages = [pkgs.proton-ge-bin]; protontricks.enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server |