From 66767ebdfe22321e9d241512f76d8a5fafc96ee6 Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 25 Oct 2025 13:43:27 +0200 Subject: [PATCH] vim notify, and devenv --- configuration.nix | 3 +- packages/nvim/default.nix | 2 + packages/nvim/lua/plugins/notify.lua | 6 + shells/flalingo/arduino/flake.nix | 198 ++++++++++++++++++++++++++ shells/flalingo/devenv.lock | 103 ++++++++++++++ shells/flalingo/devenv.nix | 24 ++++ shells/flalingo/devenv.yaml | 15 ++ shells/flalingo/flake.lock | 100 +++++++++++++ shells/flalingo/flake.nix | 111 +++++++++++++++ shells/flalingo/flutter/flake.nix | 43 ++++++ shells/flalingo/flutter/flake.nix.bk | 109 ++++++++++++++ shells/flalingo/go/flake.nix | 32 +++++ shells/flalingo/linguacafe/flake.nix | 53 +++++++ shells/flalingo/luckyshroom/flake.nix | 33 +++++ shells/flalingo/rust/flake.nix | 73 ++++++++++ 15 files changed, 904 insertions(+), 1 deletion(-) create mode 100644 packages/nvim/lua/plugins/notify.lua create mode 100644 shells/flalingo/arduino/flake.nix create mode 100644 shells/flalingo/devenv.lock create mode 100644 shells/flalingo/devenv.nix create mode 100644 shells/flalingo/devenv.yaml create mode 100644 shells/flalingo/flake.lock create mode 100644 shells/flalingo/flake.nix create mode 100644 shells/flalingo/flutter/flake.nix create mode 100644 shells/flalingo/flutter/flake.nix.bk create mode 100644 shells/flalingo/go/flake.nix create mode 100644 shells/flalingo/linguacafe/flake.nix create mode 100644 shells/flalingo/luckyshroom/flake.nix create mode 100644 shells/flalingo/rust/flake.nix diff --git a/configuration.nix b/configuration.nix index 441f0a9..311d362 100644 --- a/configuration.nix +++ b/configuration.nix @@ -8,7 +8,7 @@ inputs.home-manager.nixosModules.default ]; - + nix.settings.trusted-users = [ "root" "nico" ]; # home manager home-manager = { extraSpecialArgs = { inherit inputs; }; @@ -177,6 +177,7 @@ services.mullvad-vpn.enable = true; sshfs freetube # anydesk + devenv # sway networkmanager diff --git a/packages/nvim/default.nix b/packages/nvim/default.nix index acdf946..cc14ec5 100644 --- a/packages/nvim/default.nix +++ b/packages/nvim/default.nix @@ -58,6 +58,8 @@ programs.neovim.plugins = [ ".config/nvim/lua/plugins/tiny-inline-diagnostic.lua".source = ./lua/plugins/tiny-inline-diagnostic.lua; ".config/nvim/lua/plugins/conform.lua".source = ./lua/plugins/conform.lua; ".config/nvim/lua/plugins/nvim-tree.lua".source = ./lua/plugins/nvim-tree.lua; + ".config/nvim/lua/plugins/notify.lua".source = ./lua/plugins/notify.lua; + # ".config/nvim/lua/plugins/go.lua".source = ./lua/plugins/go.lua; # ".config/nvim/lua/plugins/typst.lua".source = ./lua/plugins/typst.lua; diff --git a/packages/nvim/lua/plugins/notify.lua b/packages/nvim/lua/plugins/notify.lua new file mode 100644 index 0000000..716c948 --- /dev/null +++ b/packages/nvim/lua/plugins/notify.lua @@ -0,0 +1,6 @@ +return { + "rcarriga/nvim-notify", + config = function () + vim.notify = require("notify") + end +} diff --git a/shells/flalingo/arduino/flake.nix b/shells/flalingo/arduino/flake.nix new file mode 100644 index 0000000..24c082d --- /dev/null +++ b/shells/flalingo/arduino/flake.nix @@ -0,0 +1,198 @@ +{ + description = "PlatformIO Development Environment with VSCodium"; + + inputs = { + }; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import { inherit system; }; + + platformioVsix = pkgs.fetchurl { + url = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/platformio/vsextensions/platformio-ide/3.3.4/vspackage?targetPlatform=linux-x64"; + sha256 = "sha256-Ri5TZDxSsW1cW33Rh+l/5Fxl23MNzFEjcFGLDx/xzT8="; + }; + + patchedExtension = pkgs.stdenv.mkDerivation { + name = "platformio-ide-patched"; + src = platformioVsix; + buildInputs = [ pkgs.jq pkgs.unzip pkgs.gzip ]; + unpackCmd = '' + gzip -d < $src > temp.zip + unzip temp.zip + rm temp.zip + ''; + buildPhase = '' + jq '.extensionDependencies = [] | + .["platformio-ide.useBuiltinPIOCore"].default = false | + .["platformio-ide.useBuiltinPython"].default = false | + .["platformio-ide.forceSystemPIOCore"].default = true | + .["platformio-ide.forceSystemPython"].default = true' \ + package.json > package.json.new + mv package.json.new package.json + ''; + installPhase = '' + cd .. + mkdir -p $out + ${pkgs.zip}/bin/zip -r $out/platformio-ide.vsix . + ''; + }; + + platformioWrapper = pkgs.writeScriptBin "platformio" '' + #!/bin/sh + VENV_DIR="''${PLATFORMIO_VENV_DIR:-$HOME/.platformio/penv}" + . "$VENV_DIR/bin/activate" + exec ${pkgs.platformio}/bin/platformio "$@" + ''; + + configureVSCodeSettings = '' + USER_CONFIG_DIR="''${XDG_CONFIG_HOME:-$HOME/.config}/VSCodium/User" + mkdir -p "$USER_CONFIG_DIR" + SETTINGS_FILE="$USER_CONFIG_DIR/settings.json" + if [ ! -f "$SETTINGS_FILE" ]; then + echo '{}' > "$SETTINGS_FILE" + fi + ${pkgs.jq}/bin/jq '. + { + "platformio-ide.useBuiltinPIOCore": true, + "platformio-ide.useBuiltinPython": false, + "platformio-ide.forceSystemPIOCore": false, + "platformio-ide.forceSystemPython": true, + "platformio-ide.customPATH": "$PATH" + }' "$SETTINGS_FILE" > "$SETTINGS_FILE.tmp" + if [ $? -eq 0 ]; then + mv "$SETTINGS_FILE.tmp" "$SETTINGS_FILE" + else + rm -f "$SETTINGS_FILE.tmp" + fi + ''; + + fhsEnv = pkgs.buildFHSEnv { + name = "platformio-env"; + targetPkgs = pkgs: with pkgs; [ + platformio + platformioWrapper + python312 + git + vscodium + gcc + gdb + gnumake + udev + zlib + ncurses + stdenv.cc.cc.lib + glibc + libusb1 + openssl + tio + chromium + ]; + profile = '' + export PYTHONPATH=${pkgs.platformio}/lib/python3.12/site-packages:$PYTHONPATH + export PLATFORMIO_CORE_DIR="''${PLATFORMIO_CORE_DIR:-$HOME/.platformio}" + export PATH=${platformioWrapper}/bin:$PATH + export PATH=${pkgs.python312}/bin:$PATH + ''; + runScript = pkgs.writeScript "platformio-shell" '' + export XDG_DATA_HOME="''${XDG_DATA_HOME:-$HOME/.local/share}" + export PATH=${pkgs.python312}/bin:${platformioWrapper}/bin:$PATH + export PYTHONPATH=${pkgs.platformio}/lib/python3.12/site-packages:$PYTHONPATH + ${configureVSCodeSettings} + VSCODE_PORTABLE="''${VSCODE_PORTABLE:-$HOME/.vscode-portable}" + EXTENSION_DIR="''${VSCODE_PORTABLE}/extensions" + mkdir -p "$EXTENSION_DIR" + ${pkgs.vscodium}/bin/codium --install-extension ${patchedExtension}/platformio-ide.vsix + mkdir -p $HOME/.local/bin + ln -sf ${platformioWrapper}/bin/platformio $HOME/.local/bin/pio + echo "PlatformIO environment ready. PlatformIO Core: $(platformio --version)" + echo "Run 'codium .' to open VSCodium in current directory" + if [ -f $HOME/.platformio/penv/bin/activate ]; then + source $HOME/.platformio/penv/bin/activate + fi + PS1="Codium-PIO> " + exec bash --norc + ''; + }; + + # Create a dedicated VSCodium launcher package that accepts arguments + codiumLauncher = pkgs.writeScriptBin "launch-codium" '' + #!/usr/bin/env bash + export XDG_DATA_HOME="''${XDG_DATA_HOME:-$HOME/.local/share}" + export PATH=${pkgs.python312}/bin:${platformioWrapper}/bin:$PATH + export PYTHONPATH=${pkgs.platformio}/lib/python3.12/site-packages:$PYTHONPATH + ${configureVSCodeSettings} + VSCODE_PORTABLE="''${VSCODE_PORTABLE:-$HOME/.vscode-portable}" + EXTENSION_DIR="''${VSCODE_PORTABLE}/extensions" + mkdir -p "$EXTENSION_DIR" + ${pkgs.vscodium}/bin/codium --install-extension ${patchedExtension}/platformio-ide.vsix + mkdir -p $HOME/.local/bin + ln -sf ${platformioWrapper}/bin/platformio $HOME/.local/bin/pio + + # Initialize PlatformIO environment if needed + if [ ! -f $HOME/.platformio/penv/bin/activate ] && [ -x "$(command -v python3)" ]; then + echo "Initializing PlatformIO environment..." + python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py)" + fi + + if [ -f $HOME/.platformio/penv/bin/activate ]; then + source $HOME/.platformio/penv/bin/activate + fi + + # If no arguments are provided, open the current directory + if [ $# -eq 0 ]; then + exec ${pkgs.vscodium}/bin/codium . + else + # Otherwise, pass all arguments to VSCodium + exec ${pkgs.vscodium}/bin/codium "$@" + fi + ''; + + # Create an FHS environment specifically for launching VSCodium + codiumFhsEnv = pkgs.buildFHSEnv { + name = "codium-launcher"; + targetPkgs = pkgs: with pkgs; [ + platformio + platformioWrapper + python312 + git + vscodium + gcc + gdb + gnumake + udev + zlib + ncurses + stdenv.cc.cc.lib + glibc + libusb1 + openssl + codiumLauncher + tio + ]; + profile = '' + export PYTHONPATH=${pkgs.platformio}/lib/python3.12/site-packages:$PYTHONPATH + export PLATFORMIO_CORE_DIR="''${PLATFORMIO_CORE_DIR:-$HOME/.platformio}" + export PATH=${platformioWrapper}/bin:$PATH + export PATH=${pkgs.python312}/bin:$PATH + ''; + # Pass all arguments received to the launch-codium script + runScript = pkgs.writeScript "codium-launch-wrapper" '' + exec ${codiumLauncher}/bin/launch-codium "$@" + ''; + }; + + in + { + devShells.${system} = { + default = fhsEnv.env; + codium = codiumFhsEnv.env; + }; + + packages.${system} = { + default = fhsEnv; + platformioExtension = patchedExtension; + codium = codiumFhsEnv; + }; + }; +} diff --git a/shells/flalingo/devenv.lock b/shells/flalingo/devenv.lock new file mode 100644 index 0000000..6e2114e --- /dev/null +++ b/shells/flalingo/devenv.lock @@ -0,0 +1,103 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1761343822, + "owner": "cachix", + "repo": "devenv", + "rev": "679d2951cee2d09da3c732d00b320ce752d21ee0", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760663237, + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1758532697, + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "207a4cb0e1253c7658c6736becc6eb9cace1f25f", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": [ + "git-hooks" + ] + } + } + }, + "root": "root", + "version": 7 +} diff --git a/shells/flalingo/devenv.nix b/shells/flalingo/devenv.nix new file mode 100644 index 0000000..f1ef704 --- /dev/null +++ b/shells/flalingo/devenv.nix @@ -0,0 +1,24 @@ +{ + pkgs, + lib, + config, + ... +}: +{ + # https://devenv.sh/languages/ + languages = { + rust.enable = true; + javascript.enable = true; + }; + + # https://devenv.sh/packages/ + packages = [ + pkgs.nodejs + pkgs.yarn + pkgs.wabt # Wasm dependencies for Tauri + # pkgs.webkitgtk # Linux Tauri dependency (Webview2 is the one used on Widnows) + ]; + + # See full reference at https://devenv.sh/reference/options/ +} + diff --git a/shells/flalingo/devenv.yaml b/shells/flalingo/devenv.yaml new file mode 100644 index 0000000..116a2ad --- /dev/null +++ b/shells/flalingo/devenv.yaml @@ -0,0 +1,15 @@ +# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling + +# If you're using non-OSS software, you can set allowUnfree to true. +# allowUnfree: true + +# If you're willing to use a package that's vulnerable +# permittedInsecurePackages: +# - "openssl-1.1.1w" + +# If you have more than one devenv you can merge them +#imports: +# - ./backend diff --git a/shells/flalingo/flake.lock b/shells/flalingo/flake.lock new file mode 100644 index 0000000..2ed4352 --- /dev/null +++ b/shells/flalingo/flake.lock @@ -0,0 +1,100 @@ +{ + "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1756795219, + "narHash": "sha256-tKBQtz1JLKWrCJUxVkHKR+YKmVpm0KZdJdPWmR2slQ8=", + "owner": "nix-community", + "repo": "fenix", + "rev": "80dbdab137f2809e3c823ed027e1665ce2502d74", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "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" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1756819007, + "narHash": "sha256-12V64nKG/O/guxSYnr5/nq1EfqwJCdD2+cIGmhz3nrE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "aaff8c16d7fc04991cac6245bee1baa31f72b1e1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "fenix": "fenix", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1756597274, + "narHash": "sha256-wfaKRKsEVQDB7pQtAt04vRgFphkVscGRpSx3wG1l50E=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "21614ed2d3279a9aa1f15c88d293e65a98991b30", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/shells/flalingo/flake.nix b/shells/flalingo/flake.nix new file mode 100644 index 0000000..8447ea6 --- /dev/null +++ b/shells/flalingo/flake.nix @@ -0,0 +1,111 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + fenix.url = "github:nix-community/fenix"; + fenix.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + fenix, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs { + system = system; + config.allowUnfree = true; + # config.android_sdk.accept_license = true; + }; + + # android_sdk = + # (pkgs.androidenv.composeAndroidPackages { + # platformVersions = ["34"]; + # ndkVersions = ["26.3.11579264"]; + # includeNDK = true; + # useGoogleAPIs = false; + # useGoogleTVAddOns = false; + # includeEmulator = false; + # includeSystemImages = false; + # includeSources = false; + # }) + # .androidsdk; + + packages = with pkgs; [ + curl + wget + pkg-config + + nodejs_20 + # typescript-language-server + # vtsls + # vue-language-server + + zed-editor + # (vscode-with-extensions.override { + # # vscode = vscodium; + # vscodeExtensions = with vscode-extensions; [ + # vscodevim.vim + # vue.volar + # catppuccin.catppuccin-vsc + # github.copilot + # github.copilot-chat + # tauri-apps.tauri-vscode + # rust-lang.rust-analyzer + # ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + # # { + # # name = "vscode-arduino-community"; + # # publisher = "vscode-arduino"; + # # version = "0.7.2"; + # # sha256 = "/HdPJ6LBnyPhz7jeJ0MLRXO2L3bcAzM7J65nKsXsacY="; + # # } + # ]; + # }) + + (with fenix.packages.${system}; + combine [ + complete.rustc + complete.cargo + complete.clippy + # targets.aarch64-linux-android.latest.rust-std + # targets.armv7-linux-androideabi.latest.rust-std + # targets.i686-linux-android.latest.rust-std + targets.x86_64-linux-android.latest.rust-std + ]) + rust-analyzer + sqlx-cli + + # android_sdk + jdk + ]; + + libraries = with pkgs; [ + gtk3 + libsoup_3 + webkitgtk_4_1 + cairo + gdk-pixbuf + glib + dbus + openssl + librsvg + ]; + in { + devShell = pkgs.mkShell { + buildInputs = packages ++ libraries; + + shellHook = '' + zsh + + exit + ''; + + LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libraries}:$LD_LIBRARY_PATH"; + XDG_DATA_DIRS = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS"; + # ANDROID_HOME = "${android_sdk}/libexec/android-sdk"; + # NDK_HOME = "${android_sdk}/libexec/android-sdk/ndk/26.3.11579264"; + # GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${android_sdk}/libexec/android-sdk/build-tools/34.0.0/aapt2"; + }; + }); +} diff --git a/shells/flalingo/flutter/flake.nix b/shells/flalingo/flutter/flake.nix new file mode 100644 index 0000000..b00d8c9 --- /dev/null +++ b/shells/flalingo/flutter/flake.nix @@ -0,0 +1,43 @@ +{ +description = "Flutter 3.13.x"; +inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; +}; +outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + config = { + android_sdk.accept_license = true; + allowUnfree = true; + }; + }; + androidComposition = pkgs.androidenv.composeAndroidPackages { + buildToolsVersions = [ "28.0.3" "34.0.0" ]; + platformVersions = [ "34" "35" "33" ]; + includeNDK = true; + ndkVersions = ["26.3.11579264"]; + abiVersions = [ "armeabi-v7a" "arm64-v8a" ]; + cmakeVersions = [ "3.22.1" ]; + }; + androidSdk = androidComposition.androidsdk; + in + { + devShell = + with pkgs; mkShell rec { + ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk"; + GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/libexec/android-sdk/build-tools/34.0.0/aapt2"; + buildInputs = [ + flutter + androidSdk # The customized SDK that we've made above + jdk17 + ]; + shellHook = '' + zsh + exit + ''; + }; + }); +} diff --git a/shells/flalingo/flutter/flake.nix.bk b/shells/flalingo/flutter/flake.nix.bk new file mode 100644 index 0000000..fe2e04e --- /dev/null +++ b/shells/flalingo/flutter/flake.nix.bk @@ -0,0 +1,109 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + + android-nixpkgs.url = "github:tadfisher/android-nixpkgs"; + + cursor.url = "github:omarcresp/cursor-flake/main"; + }; + + + outputs = { + self, + nixpkgs, + flake-parts, + cursor, + ... + } @ inputs: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + perSystem = { + pkgs, + system, + lib, + ... + }: { + devShells.default = let + pkgs = import nixpkgs { + inherit system; + config = { + allowUnfree = true; + android_sdk.accept_license = true; + }; + overlays = []; + }; + android-nixpkgs = pkgs.callPackage inputs.android-nixpkgs {}; + androidSdk = android-nixpkgs.sdk (sdkPkgs: + with sdkPkgs; [ + cmdline-tools-latest + build-tools-34-0-0 + build-tools-30-0-3 + platform-tools + platforms-android-35 + platforms-android-34 + platforms-android-33 + platforms-android-31 + platforms-android-30 + ndk-26-3-11579264 + cmake-3-22-1 + ]); + PWD = builtins.getEnv "PWD"; + patchedFlutter = pkgs.flutter.override (prev: rec { + flutter = prev.flutter.overrideAttrs (prevAttrs: { + patches = prevAttrs.patches ++ [ + # This patch is needed to avoid the Kotlin Gradle plugin writing to the store. + (pkgs.writeText "kotlin-fix.patch" '' + --- a/packages/flutter_tools/gradle/build.gradle.kts + +++ b/packages/flutter_tools/gradle/build.gradle.kts + @@ -4,6 +4,8 @@ + + import org.jetbrains.kotlin.gradle.dsl.JvmTarget + + +gradle.startParameter.projectCacheDir = layout.buildDirectory.dir("cache").get().asFile + + + plugins { + `java-gradle-plugin` + groovy + '') + ]; + passthru = prevAttrs.passthru // { + sdk = flutter; + }; + # postInstall = (prevAttrs.postInstall or "") + '' + # mkdir -p $out/bin/cache + # touch $out/bin/cache/engine.realm + # ''; + }); + }); + in + pkgs.mkShell { + ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk"; + ANDROID_NDK_ROOT = "${androidSdk}/libexec/android-sdk/ndk-bundle"; + ANDROID_AVD_HOME = "${PWD}/.android/avd"; + ANDROID_HOME = "${androidSdk}/libexec/android-sdk"; + FLUTTER_SDK = "${patchedFlutter}"; + GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/share/android-sdk/build-tools/34.0.0/aapt2"; + buildInputs = with pkgs; [ + patchedFlutter + jdk17 + androidSdk + clang + dart + cmake + android-tools + cursor.packages.${pkgs.system}.default + ]; + shellHook = '' + zsh + exit + ''; + }; + # formatter = pkgs.alejandra; + }; + }; +} diff --git a/shells/flalingo/go/flake.nix b/shells/flalingo/go/flake.nix new file mode 100644 index 0000000..ef98c72 --- /dev/null +++ b/shells/flalingo/go/flake.nix @@ -0,0 +1,32 @@ +{ + description = "GO"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + }; + in + { + devShell = + with pkgs; mkShell rec { + # ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk"; + GOPATH="${go}"; + buildInputs = [ + go + ]; + + shellHook = '' + zsh + + exit + ''; + }; + }); +} + + diff --git a/shells/flalingo/linguacafe/flake.nix b/shells/flalingo/linguacafe/flake.nix new file mode 100644 index 0000000..cdbd9cb --- /dev/null +++ b/shells/flalingo/linguacafe/flake.nix @@ -0,0 +1,53 @@ +{ + description = "Everything for linguacafe <3"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + cursor.url = "github:omarcresp/cursor-flake/main"; + }; + outputs = { self, nixpkgs, flake-utils, cursor }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + config.allowUnfree = true; + inherit system; + }; + in + { + devShell = + with pkgs; mkShell rec { + buildInputs = [ + vue-language-server + cursor.packages.${pkgs.system}.default + php + + (vscode-with-extensions.override { + # vscode = vscodium; + vscodeExtensions = with vscode-extensions; [ + vscodevim.vim + vue.volar + catppuccin.catppuccin-vsc + github.copilot + github.copilot-chat + ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + # { + # name = "vscode-arduino-community"; + # publisher = "vscode-arduino"; + # version = "0.7.2"; + # sha256 = "/HdPJ6LBnyPhz7jeJ0MLRXO2L3bcAzM7J65nKsXsacY="; + # } + ]; + }) + + ]; + + shellHook = '' + zsh + + exit + ''; + }; + }); +} + + diff --git a/shells/flalingo/luckyshroom/flake.nix b/shells/flalingo/luckyshroom/flake.nix new file mode 100644 index 0000000..a089161 --- /dev/null +++ b/shells/flalingo/luckyshroom/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Love you"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + cursor.url = "github:omarcresp/cursor-flake/main"; + }; + outputs = { self, nixpkgs, flake-utils, cursor }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in + { + devShell = + with pkgs; mkShell rec { + buildInputs = [ + love + cursor.packages.${pkgs.system}.default + ]; + + shellHook = '' + zsh + + exit + ''; + }; + }); +} + + diff --git a/shells/flalingo/rust/flake.nix b/shells/flalingo/rust/flake.nix new file mode 100644 index 0000000..5611091 --- /dev/null +++ b/shells/flalingo/rust/flake.nix @@ -0,0 +1,73 @@ +{ + description = "Rust development environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + # Read the file relative to the flake's root + # overrides = (builtins.fromTOML (builtins.readFile (self + "/rust-toolchain.toml"))); + libPath = with pkgs; lib.makeLibraryPath [ + # load external libraries that you need in your rust project here + ]; + in + { + devShells.default = pkgs.mkShell rec { + nativeBuildInputs = [ pkgs.pkg-config ]; + buildInputs = with pkgs; [ + clang + llvmPackages.bintools + rustup + dioxus-cli + webkitgtk_4_1 + wasm-pack + wasm-bindgen-cli + curl + wget + file + openssl + gtk3 + librsvg + xdotool + ]; + + # RUSTC_VERSION = overrides.toolchain.channel; + + # https://github.com/rust-lang/rust-bindgen#environment-variables + LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ]; + + shellHook = '' + export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin + export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/ + ''; + + # Add precompiled library to rustc search path + RUSTFLAGS = (builtins.map (a: ''-L ${a}/lib'') [ + # add libraries here (e.g. pkgs.libvmi) + ]); + + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (buildInputs ++ nativeBuildInputs); + + + # Add glibc, clang, glib, and other headers to bindgen search path + BINDGEN_EXTRA_CLANG_ARGS = + # Includes normal include path + (builtins.map (a: ''-I"${a}/include"'') [ + # add dev libraries here (e.g. pkgs.libvmi.dev) + pkgs.glibc.dev + ]) + # Includes with special directory paths + ++ [ + ''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"'' + ''-I"${pkgs.glib.dev}/include/glib-2.0"'' + ''-I${pkgs.glib.out}/lib/glib-2.0/include/'' + ]; + }; + } + ); +}