vim notify, and devenv

This commit is contained in:
Nico
2025-10-25 13:43:27 +02:00
parent 2224c25e2b
commit 66767ebdfe
15 changed files with 904 additions and 1 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -0,0 +1,6 @@
return {
"rcarriga/nvim-notify",
config = function ()
vim.notify = require("notify")
end
}

View File

@@ -0,0 +1,198 @@
{
description = "PlatformIO Development Environment with VSCodium";
inputs = {
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import <nixpkgs> { 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;
};
};
}

103
shells/flalingo/devenv.lock Normal file
View File

@@ -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
}

View File

@@ -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/
}

View File

@@ -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

100
shells/flalingo/flake.lock generated Normal file
View File

@@ -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
}

111
shells/flalingo/flake.nix Normal file
View File

@@ -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";
};
});
}

View File

@@ -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
'';
};
});
}

View File

@@ -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;
};
};
}

View File

@@ -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
'';
};
});
}

View File

@@ -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
'';
};
});
}

View File

@@ -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
'';
};
});
}

View File

@@ -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/''
];
};
}
);
}