Update overlay directory paths

This commit is contained in:
Chris Toph 2025-03-12 13:32:51 -04:00
parent 6a86cf0153
commit 6391e39862
4 changed files with 89 additions and 56 deletions

View file

@ -105,7 +105,7 @@
in
lib.packagesFromDirectoryRecursive {
callPackage = lib.callPackageWith pkgs;
directory = ./pkgs/common;
directory = pkgs/common;
}
);
};

View file

@ -0,0 +1,31 @@
{ pkgs, lib, ... }:
# TODO: not really working, might just remove
let
pname = "fleet";
version = "1.46.97";
src = pkgs.fetchurl {
url = "https://download-cdn.jetbrains.com/fleet/installers/linux_x64/Fleet-${version}.tar.gz";
sha256 = "a7b66f9faff74f2b8b0143bc588a990304dd8efd3ea20fd8d2754cb064a993f3";
};
appimageContents = pkgs.appimageTools.extractType2 { inherit pname version src; };
in
pkgs.appimageTools.wrapType2 rec {
inherit pname version src;
extraInstallCommands = ''
mv $out/bin/${pname} $out/bin/${pname}
install -m 444 -D ${appimageContents}/lib/${pname}.png $out/share/icons/hicolor/512x512/apps/${pname}.png
'';
# install -m 444 -D ${appimageContents}/ubports-installer.desktop $out/share/applications/${pname}.desktop
# substituteInPlace $out/share/applications/${pname}.desktop \
# --replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname} %U'
meta = with lib; {
description = "Jetbrains Fleet";
platforms = [ "x86_64-linux" ];
};
}

View file

@ -1,55 +0,0 @@
{
stdenv,
lib,
pkgs,
...
}:
let
snapraid-runner-py = pkgs.writeTextFile {
name = "snapraid-runner.py";
executable = true;
destination = "/bin/snapraid-runner.py";
text = builtins.readFile ./snapraid-runner.py;
};
snapraid-runner = pkgs.writeTextFile {
name = "snapraid-runner.sh";
executable = true;
destination = "/bin/snapraid-runner";
text = ''#!${pkgs.stdenv.shell}
# Check if the "-c" option is present
config_option_present=false
for arg in "$@"; do
if [ "$arg" = "-c" ]; then
config_option_present=true
break
fi
done
# Add the default config option if not present
if [ "$config_option_present" = false ]; then
set -- "-c" "/etc/snapraid-runner.conf" "$@"
fi
${pkgs.python311}/bin/python3 ${snapraid-runner-py}/bin/snapraid-runner.py "$@"
'';
};
in
stdenv.mkDerivation rec {
pname = "snapraid-runner";
version = "8f78f9f1af8ca5a9b6469a6c142cab2577157331";
buildInputs = [
snapraid-runner
];
builder = pkgs.writeTextFile {
name = "builder.sh";
text = ''. $stdenv/setup
mkdir -p $out/bin
ln -sf ${snapraid-runner}/bin/snapraid-runner $out/bin/snapraid-runner'';
};
}

View file

@ -0,0 +1,57 @@
{
stdenv,
lib,
pkgs,
...
}:
let
snapraid-runner-py = pkgs.writeTextFile {
name = "snapraid-runner.py";
executable = true;
destination = "/bin/snapraid-runner.py";
text = builtins.readFile ./snapraid-runner.py;
};
snapraid-runner = pkgs.writeTextFile {
name = "snapraid-runner.sh";
executable = true;
destination = "/bin/snapraid-runner";
text = ''
#!${pkgs.stdenv.shell}
# Check if the "-c" option is present
config_option_present=false
for arg in "$@"; do
if [ "$arg" = "-c" ]; then
config_option_present=true
break
fi
done
# Add the default config option if not present
if [ "$config_option_present" = false ]; then
set -- "-c" "/etc/snapraid-runner.conf" "$@"
fi
${pkgs.python311}/bin/python3 ${snapraid-runner-py}/bin/snapraid-runner.py "$@"
'';
};
in
stdenv.mkDerivation rec {
pname = "snapraid-runner";
version = "8f78f9f1af8ca5a9b6469a6c142cab2577157331";
buildInputs = [
snapraid-runner
];
builder = pkgs.writeTextFile {
name = "builder.sh";
text = ''
. $stdenv/setup
mkdir -p $out/bin
ln -sf ${snapraid-runner}/bin/snapraid-runner $out/bin/snapraid-runner'';
};
}