Compare commits

...

2 Commits

Author SHA1 Message Date
e3650d5adb chataingne nonsensenes 2026-03-12 18:00:53 +00:00
cd9716a7f2 some nonsense 2026-03-12 09:45:46 +00:00
6 changed files with 90 additions and 229 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
.session .session
modules/chataigne/squashfs-root

View File

@@ -124,6 +124,27 @@
pulse.enable = true; pulse.enable = true;
}; };
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
curlFull
gnutls
libxrandr
alsa-lib
freetype
avahi
libglvnd
curl
SDL2
hidapi
libpulseaudio
lz4
openssl
libcap
libxcrypt
libgcrypt
libbsd
];
# Local User # Local User
users.users.user01 = { users.users.user01 = {
isNormalUser = true; isNormalUser = true;
@@ -172,10 +193,10 @@
cava cava
cmatrix cmatrix
swaynotificationcenter swaynotificationcenter
(input { # (input {
package = "chataigne"; # package = "chataigne";
output = "chataigne"; # output = "chataigne";
}) # })
wlogout wlogout
wpaperd wpaperd
kando kando
@@ -285,67 +306,11 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
inputs.nvim-wrapped.packages.${stdenv.hostPlatform.system}.default inputs.nvim-wrapped.packages.${stdenv.hostPlatform.system}.default
# (pkgs.symlinkJoin {
# name = "nvim-with-lsp";
# paths = [ pkgs.neovim ];
# buildInputs = [ pkgs.makeWrapper ];
# postBuild = ''
# export TREE_SITTER_LIB_PATH="/run/current-system/sw/lib"
# wrapProgram $out/bin/nvim \
# --prefix PATH : ${
# pkgs.lib.makeBinPath [
# # lsps
# pkgs.lua-language-server
# pkgs.vscode-langservers-extracted
# pkgs.emmet-ls
# pkgs.prettier
# pkgs.black
# pkgs.nixfmt
# pkgs.nil
# pkgs.python313Packages.python-lsp-server
# pkgs.typescript-language-server
# pkgs.tailwindcss-language-server
# pkgs.stylua
# pkgs.nixd
#
# # other shit
# pkgs.lua5_1
# pkgs.tree-sitter
# pkgs.ripgrep
# pkgs.gcc
# pkgs.gnumake
# pkgs.imagemagick
# pkgs.luajitPackages.magick
# pkgs.ghostscript
# pkgs.luarocks
# (pkgs.texlive.combine {
# inherit (pkgs.texlive)
# scheme-basic
# varwidth
# preview
# mathtools
# amsfonts
# amscdx
# xcolor
# dvisvgm
# dvipng # for preview and export as html
# wrapfig
# standalone
# graphicxbox
# amsmath
# ulem
# hyperref
# capt-of
# ;
# })
# ]
# }
# '';
# })
vim vim
unzip unzip
python310 # Its python like come on python310 # Its python like come on
usbutils usbutils
curlWithGnuTls
# Graphics Drivers # Graphics Drivers
mesa mesa
@@ -364,6 +329,7 @@
# Other things (from gnome) # Other things (from gnome)
glib glib
gnutls gnutls
liblzf
appimage-run appimage-run
libnotify libnotify
gsettings-desktop-schemas gsettings-desktop-schemas

View File

@@ -1,131 +0,0 @@
{ pkgs, pinnedPkgs, ... }:
let
# 1. Define the AppImage source.
appImageSrc = ./Chataigne-linux-x64-bleedingedge.AppImage;
# 2a. Libraries pulled from the modern, current Nixpkgs (for small size).
modernLibs = with pkgs; [
alsa-lib
freetype
avahi
libglvnd
curl
SDL2
hidapi
libXrandr
];
# 2b. Libraries pulled from the older, pinned package set (ONLY the ones that failed).
pinnedCurlLibs = with pinnedPkgs; [
curlWithGnuTls # This is the critical component for the CURL_GNUTLS_3 symbol.
gnutls
];
# 3. Combine the modern runtime dependencies with the pinned compatibility libraries.
appImageDeps = [
pkgs.steam-run
pkgs.stdenv.cc.cc.lib # Ensures the modern C++ runtime is available
]
++ modernLibs
++ pinnedCurlLibs;
chataigneDesktopItem = {
desktopName = "Chataigne";
name = "chataigne";
exec = "chataigne"; # The name of the wrapper script in $out/bin
icon = "chataigne"; # The name of the icon file (without extension)
genericName = "Creative Control Software";
comment = "Control and experiment with creative applications, hardware, and media.";
categories = [
"AudioVideo"
"Development"
];
};
in
# 4. Create the final runnable derivation
pkgs.stdenv.mkDerivation {
pname = "chataigne-runner";
version = "1.0";
# --- Attributes needed for AppImage running (not compiling) ---
src = ./.;
dontUnpack = true;
dontBuild = true;
# --------------------------------------------------
# Inject the combined dependencies into the environment
buildInputs = appImageDeps;
# The install phase creates an executable wrapper script, extracts the AppImage,
# and now handles the desktop file and icon.
installPhase = ''
mkdir -p $out/bin
# --- STRATEGY: Extract AppImage contents to bypass FUSE, then fix LD_LIBRARY_PATH ---
echo "Extracting AppImage contents to bypass FUSE requirement..."
# Use the absolute Nix Store path of the AppImage
${appImageSrc} --appimage-extract
echo "appimage extracted"
# 2. Check if extraction worked and move the content to $out
if [ ! -d "squashfs-root" ]; then
echo "Extraction failed. The AppImage may not support --appimage-extract."
exit 1
fi
# 2. CRITICAL FIX: Manually create and install the .desktop file
mkdir -p $out/share/applications
# pkgs.lib.makeDesktopItem takes the metadata and creates a small derivation
# We copy the resulting .desktop file from that derivation's output path ($desktop_file_path)
local desktop_file_path="${pkgs.makeDesktopItem chataigneDesktopItem}"
# The file is typically named $name.desktop inside the share/applications folder of the new derivation
cp $desktop_file_path/share/applications/chataigne.desktop $out/share/applications/
# Copy the extracted contents into the output directory
cp -r squashfs-root $out/
# --- DESKTOP ENTRY & ICON (NEW) ---
echo "Processing icon and desktop file..."
# AppImages usually place the icon in squashfs-root/.DirIcon or similar
# We will assume it's in the root of the extracted content.
local icon_source="$out/squashfs-root/.DirIcon"
local icon_target="$out/share/icons/hicolor/128x128/apps/chataigne.png" # Standard location
# Use the icon if it exists (AppImages often use a .png or .svg)
if [ -f "$icon_source" ]; then
mkdir -p "$(dirname "$icon_target")"
cp "$icon_source" "$icon_target"
else
echo "Warning: Could not find icon at $icon_source. Using default/no icon."
fi
# ----------------------------------
# 3. Create the 'chataigne' executable wrapper
cat > $out/bin/chataigne << EOF
#!${pkgs.stdenv.shell}
# The LD_LIBRARY_PATH is created using all dependencies (excluding the wrapper 'steam-run').
# This ensures the AppImage finds the pinned CURL library.
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath (pkgs.lib.remove pkgs.steam-run appImageDeps)}:$LD_LIBRARY_PATH"
# Use steam-run to launch the main execution script inside the extracted folder.
exec ${pkgs.steam-run}/bin/steam-run "$out/squashfs-root/AppRun" "\$@"
EOF
chmod +x $out/bin/chataigne
'';
meta = {
description = "Declarative runner for the Chataigne AppImage, providing necessary dependencies.";
homepage = "https://chataigne.io/"; # Example: Add the actual homepage
license = pkgs.lib.licenses.unfree; # AppImages are often proprietary/unfree
platforms = [ "x86_64-linux" ];
};
}

27
modules/chataigne/flake.lock generated Normal file
View File

@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1773122722,
"narHash": "sha256-FIqHByVqxCprNjor1NqF80F2QQoiiyqanNNefdlvOg4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "62dc67aa6a52b4364dd75994ec00b51fbf474e50",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -1,51 +1,49 @@
{ {
description = "A flake for running the Chataigne AppImage with necessary patched dependencies."; description = "A flake to run a specific AppImage with custom dependencies";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # Modern Nixpkgs nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Pinned Nixpkgs for compatibility (the commit that fixes the CURL_GNUTLS_3 issue)
pinned-nixpkgs = {
url = "github:NixOS/nixpkgs/5171d7b0a9fbaaf216c873622eb5115b6db97957";
flake = false; # Treat as a tarball input, not a flake
};
}; };
outputs = outputs =
{ { self, nixpkgs }:
self,
nixpkgs,
pinned-nixpkgs,
...
}:
let let
# Supported systems system = "x86_64-linux"; # Adjust if you're on a different architecture
supportedSystems = [ "x86_64-linux" ]; pkgs = import nixpkgs { inherit system; };
# The main package definition logic is imported as a function # Define your AppImage wrapper here
chataigne-appimage-runner = import ./chataigne.nix; myApp = pkgs.appimageTools.wrapType2 {
pname = "my-appimage-app";
version = "1.0.0";
# Function to generate the package set for each system # The source can be a local file or a URL
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); src = ./Chataigne-linux-x64-1.10.3.AppImage;
# Add specific dependencies the AppImage is missing
extraPkgs =
pkgs: with pkgs; [
lz4
libbsd
(curlWithGnuTls.override { gnutlsSupport = true; })
gnutls
libgnurl
openssl
];
};
in in
{ {
packages = forAllSystems ( # This allows you to run it via 'nix run'
system: apps.${system}.default = {
let type = "app";
pkgs = import nixpkgs { program = "${myApp}/bin/my-appimage-app";
inherit system; };
config.allowUnfree = true;
};
pinnedPkgs = import pinned-nixpkgs { inherit system; };
in
{
chataigne = chataigne-appimage-runner {
inherit pkgs pinnedPkgs;
};
# Also expose the default package for convenience # This allows you to add it to your shell via 'nix develop'
default = self.packages.${system}.chataigne; devShells.${system}.default = pkgs.mkShell {
} buildInputs = [ myApp ];
); };
# The package itself
packages.${system}.default = myApp;
}; };
} }