{flake.nix,package-overrides}: remove unused package overrides

This commit is contained in:
Oystein Kristoffer Tveit 2024-06-29 14:08:38 +02:00
parent 16879904ae
commit dfdc6f9c3d
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
3 changed files with 0 additions and 218 deletions

View File

@ -109,7 +109,6 @@
config.allowUnfree = true;
};
in [
# (self: super: { pcloud = nonrecursive-unstable-pkgs.pcloud; })
(self: super: {
inherit (nonrecursive-unstable-pkgs) atuin wstunnel;
})

View File

@ -1,85 +0,0 @@
{ stdenv
, lib
, formats
, nixosTests
, rustPlatform
, fetchFromGitHub
, installShellFiles
, pkg-config
, udev
, openssl
, sqlite
, pam
}:
let
arch = if stdenv.isx86_64 then "x86_64" else "generic";
in
rustPlatform.buildRustPackage rec {
pname = "kanidm";
version = "1.1.0-alpha.11";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
hash = "sha256-TVGLL1Ir/Nld0kdhWmcYYmChrW42ctJPY/U7wtuEwCo=";
};
cargoSha256 = "sha256-xYnZlPpnNPzk4IWuEcPQHudYR9IVsr4/JMHV7H1HAXw=";
KANIDM_BUILD_PROFILE = "release_nixos_${arch}";
postPatch =
let
format = (formats.toml { }).generate "${KANIDM_BUILD_PROFILE}.toml";
profile = {
web_ui_pkg_path = "@web_ui_pkg_path@";
cpu_flags = if stdenv.isx86_64 then "x86_64_v1" else "none";
};
in
''
cp ${format profile} profiles/${KANIDM_BUILD_PROFILE}.toml
substituteInPlace profiles/${KANIDM_BUILD_PROFILE}.toml \
--replace '@web_ui_pkg_path@' "$out/ui"
'';
nativeBuildInputs = [
pkg-config
installShellFiles
];
buildInputs = [
udev
openssl
sqlite
pam
];
# The UI needs to be in place before the tests are run.
postBuild = ''
# We don't compile the wasm-part form source, as there isn't a rustc for
# wasm32-unknown-unknown in nixpkgs yet.
mkdir $out
cp -r kanidmd_web_ui/pkg $out/ui
'';
preFixup = ''
installShellCompletion \
--bash $releaseDir/build/completions/*.bash \
--zsh $releaseDir/build/completions/_*
# PAM and NSS need fix library names
mv $out/lib/libnss_kanidm.so $out/lib/libnss_kanidm.so.2
mv $out/lib/libpam_kanidm.so $out/lib/pam_kanidm.so
'';
passthru.tests = { inherit (nixosTests) kanidm; };
meta = with lib; {
description = "A simple, secure and fast identity management platform";
homepage = "https://github.com/kanidm/kanidm";
license = licenses.mpl20;
platforms = platforms.linux;
maintainers = with maintainers; [ erictapen Flakebi ];
};
}

View File

@ -1,132 +0,0 @@
# Even though pCloud Drive is redistributed as a plug-n-play AppImage, it
# requires a little bit more love because of the way Nix launches those types
# of applications.
#
# What Nix does, simplifying a bit, is that it extracts an AppImage and starts
# it via buildFHSEnv - this is totally fine for majority of apps, but makes
# it by-design *impossible* to launch SUID wrappers [^1]; in case of pCloud,
# it's fusermount.
# (so pCloud starts, but silently fails to mount the FUSE drive.)
#
# To overcome this issue, we're manually extracting the AppImage and then treat
# it as if it was a regular, good-ol' application requiring some standard path
# fixes.
#
# ^1 https://github.com/NixOS/nixpkgs/issues/69338
{
# Build dependencies
appimageTools
, autoPatchelfHook
, fetchzip
, lib
, stdenv
# Runtime dependencies;
# A few additional ones (e.g. Node) are already shipped together with the
# AppImage, so we don't have to duplicate them here.
, alsa-lib
, dbus-glib
, fuse
, gsettings-desktop-schemas
, gtk3
, libdbusmenu-gtk2
, libXdamage
, libX11
, libappindicator
, libindicator
, libnotify
, nss
, udev
}:
let
pname = "pcloud";
version = "1.12.0";
code = "XZyc9wVZAbFzyV8ElP71D5v170CvEmVtmrB7";
# Archive link's codes: https://www.pcloud.com/release-notes/linux.html
src = fetchzip {
url = "https://api.pcloud.com/getpubzip?code=${code}&filename=${pname}-${version}.zip";
hash = "sha256-QzBlpF+qtNdSZFv3gU0mQhpVyPTWdGH3c+UHKKGfvKc=";
};
appimageContents = appimageTools.extractType2 {
name = "${pname}-${version}";
src = "${src}/pcloud";
};
in
stdenv.mkDerivation {
inherit pname version;
src = appimageContents;
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [
autoPatchelfHook
];
buildInputs = [
alsa-lib
dbus-glib
fuse
gtk3
libX11
libXdamage
libappindicator
libdbusmenu-gtk2
libindicator
libnotify
nss
udev
];
installPhase = ''
mkdir "$out"
cp -ar . "$out/app"
cd "$out"
# Remove the AppImage runner, since users are not supposed to use it; the
# actual entry point is the `pcloud` binary
rm app/AppRun
# Adjust directory structure, so that the `.desktop` etc. files are
# properly detected
mkdir bin
mv app/usr/share .
# mv app/usr/lib .
# Adjust the `.desktop` file
mkdir share/applications
substitute \
app/pcloud.desktop \
share/applications/pcloud.desktop \
--replace 'Name=pcloud' 'Name=pCloud' \
--replace 'Exec=AppRun' 'Exec=${pname}'
# Build the main executable
cat > bin/pcloud <<EOF
#! $SHELL -e
# This is required for the file picker dialog - otherwise pcloud just
# crashes
export XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS"
exec "$out/app/pcloud"
EOF
chmod +x bin/pcloud
'';
meta = with lib; {
description = "Secure and simple to use cloud storage for your files; pCloud Drive, Electron Edition";
homepage = "https://www.pcloud.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ patryk27 ];
platforms = [ "x86_64-linux" ];
};
}