Rebase to flake parts #11

This commit is contained in:
2026-05-25 13:48:47 -03:00
parent fba5a7a2aa
commit 6978396646
25 changed files with 567 additions and 305 deletions
@@ -1,26 +0,0 @@
{ ... }: {
flake.homeManagerModules.wisdomAppsSpacedrive =
{ config, lib, pkgs, ... }:
let
root = config.chiasson.home;
cfg = config.chiasson.home.apps.spacedrive;
spacedrivePkg = pkgs.callPackage ./package { };
in
{
options.chiasson.home.apps.spacedrive = {
enable = lib.mkEnableOption ''
[Spacedrive](https://spacedrive.com/) v2 alpha upstream `.deb` repackaged for NixOS.
'';
package = lib.mkOption {
type = lib.types.package;
default = spacedrivePkg;
description = "Spacedrive package (defaults to upstream v2.0.0-alpha.2).";
};
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = [ cfg.package ];
};
};
}
@@ -1,112 +0,0 @@
{
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
autoPatchelfHook,
wrapGAppsHook3,
adwaita-icon-theme,
ffmpeg,
gdk-pixbuf,
glib,
glib-networking,
gst_all_1,
gtk3,
hicolor-icon-theme,
libsoup_3,
webkitgtk_4_1,
xdotool,
}:
let
version = "2.0.0-alpha.2";
srcInfo =
if stdenv.hostPlatform.system == "x86_64-linux" then
{
url = "https://github.com/spacedriveapp/spacedrive/releases/download/v${version}/Spacedrive-linux-x86_64.deb";
hash = "sha256-KzRPBtyX5x4ZLlZd6SgAS/cy/7irXt7v+b3Yuq9GETo=";
}
else if stdenv.hostPlatform.system == "aarch64-linux" then
{
url = "https://github.com/spacedriveapp/spacedrive/releases/download/v${version}/Spacedrive-linux-aarch64.deb";
hash = "sha256-Arq4seJxd69XdraIaYJSv1p9g+Bz/7rez/l9EP6dc9k=";
}
else
throw "spacedrive ${version}: unsupported platform: ${stdenv.hostPlatform.system}";
in
stdenv.mkDerivation {
pname = "spacedrive";
inherit version;
src = fetchurl srcInfo;
nativeBuildInputs = [
dpkg
makeWrapper
autoPatchelfHook
wrapGAppsHook3
];
buildInputs = [
adwaita-icon-theme
ffmpeg
gdk-pixbuf
glib
glib-networking
gtk3
hicolor-icon-theme
libsoup_3
webkitgtk_4_1
xdotool
gst_all_1.gst-plugins-ugly
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-base
gst_all_1.gstreamer
];
# WebKitGTK + TLS + icons; ffmpeg/ffprobe on PATH (alpha Linux builds omit bundled ffmpeg).
preFixup = ''
gappsWrapperArgs+=(
"--prefix" "PATH" ":" "${lib.makeBinPath [ ffmpeg ]}"
"--set-default" "WEBKIT_DISABLE_DMABUF_RENDERER" "1"
)
'';
postFixup = ''
# Core daemon is not GTK-linked; wrapGAppsHook3 skips it still needs ffmpeg for media paths.
wrapProgram $out/bin/sd-daemon --prefix PATH : "${lib.makeBinPath [ ffmpeg ]}"
'';
unpackPhase = "dpkg-deb -x $src source";
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib,share}
cp -r source/usr/bin/* $out/bin/
cp -r source/usr/lib/* $out/lib/
cp -r source/usr/share/* $out/share/
ln -sf Spacedrive $out/bin/spacedrive
substituteInPlace $out/share/applications/Spacedrive.desktop \
--replace-fail 'Exec=Spacedrive' 'Exec=spacedrive'
runHook postInstall
'';
meta = with lib; {
description = "Local-first file manager and virtual distributed filesystem (v2 alpha)";
homepage = "https://spacedrive.com";
changelog = "https://github.com/spacedriveapp/spacedrive/releases/tag/v${version}";
license = licenses.agpl3Plus;
platforms = [
"x86_64-linux"
"aarch64-linux"
];
mainProgram = "spacedrive";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
}