about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/in
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-04-10 20:43:08 +0200
committerAlyssa Ross <hi@alyssa.is>2024-04-10 20:43:08 +0200
commit69bfdf2484041b9d242840c4e5017b4703383bb0 (patch)
treed8bdaa69e7990d7d6f09b594b3c425f742acd2d0 /nixpkgs/pkgs/by-name/in
parentc8aee4b4363b6bf905a521b05b7476960e8286c8 (diff)
parentd8fe5e6c92d0d190646fb9f1056741a229980089 (diff)
downloadnixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar
nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.gz
nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.bz2
nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.lz
nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.xz
nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.zst
nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.zip
Merge commit 'd8fe5e6c'
Conflicts:
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/by-name/in')
-rw-r--r--nixpkgs/pkgs/by-name/in/incus/client.nix44
-rw-r--r--nixpkgs/pkgs/by-name/in/incus/generic.nix (renamed from nixpkgs/pkgs/by-name/in/incus/unwrapped.nix)63
-rw-r--r--nixpkgs/pkgs/by-name/in/incus/latest.nix12
-rw-r--r--nixpkgs/pkgs/by-name/in/incus/lts.nix2
-rw-r--r--nixpkgs/pkgs/by-name/in/incus/package.nix161
-rwxr-xr-xnixpkgs/pkgs/by-name/in/incus/update.nu29
-rw-r--r--nixpkgs/pkgs/by-name/in/insync/package.nix122
-rw-r--r--nixpkgs/pkgs/by-name/in/integresql/package.nix37
-rw-r--r--nixpkgs/pkgs/by-name/in/invidious-router/package.nix30
9 files changed, 276 insertions, 224 deletions
diff --git a/nixpkgs/pkgs/by-name/in/incus/client.nix b/nixpkgs/pkgs/by-name/in/incus/client.nix
index 76f792377b10..ecad050f042a 100644
--- a/nixpkgs/pkgs/by-name/in/incus/client.nix
+++ b/nixpkgs/pkgs/by-name/in/incus/client.nix
@@ -1,28 +1,28 @@
 {
   lts ? false,
+  meta,
+  patches,
+  src,
+  vendorHash,
+  version,
 
   lib,
   buildGoModule,
-  fetchpatch,
-  fetchFromGitHub,
   installShellFiles,
 }:
 let
-  releaseFile = if lts then ./lts.nix else ./latest.nix;
-  inherit (import releaseFile { inherit fetchpatch; }) version hash vendorHash;
+  pname = "incus${lib.optionalString lts "-lts"}-client";
 in
 
-buildGoModule rec {
-  pname = "incus-client";
-
-  inherit vendorHash version;
-
-  src = fetchFromGitHub {
-    owner = "lxc";
-    repo = "incus";
-    rev = "refs/tags/v${version}";
-    inherit hash;
-  };
+buildGoModule {
+  inherit
+    meta
+    patches
+    pname
+    src
+    vendorHash
+    version
+    ;
 
   CGO_ENABLED = 0;
 
@@ -31,24 +31,12 @@ buildGoModule rec {
   subPackages = [ "cmd/incus" ];
 
   postInstall = ''
-    # use custom bash completion as it has extra logic for e.g. instance names
-    installShellCompletion --bash --name incus ./scripts/bash/incus
-
     installShellCompletion --cmd incus \
+      --bash <($out/bin/incus completion bash) \
       --fish <($out/bin/incus completion fish) \
       --zsh <($out/bin/incus completion zsh)
   '';
 
   # don't run the full incus test suite
   doCheck = false;
-
-  meta = {
-    description = "Powerful system container and virtual machine manager";
-    homepage = "https://linuxcontainers.org/incus";
-    changelog = "https://github.com/lxc/incus/releases/tag/v${version}";
-    license = lib.licenses.asl20;
-    maintainers = lib.teams.lxc.members;
-    platforms = lib.platforms.unix;
-    mainProgram = "incus";
-  };
 }
diff --git a/nixpkgs/pkgs/by-name/in/incus/unwrapped.nix b/nixpkgs/pkgs/by-name/in/incus/generic.nix
index 7a28737ea390..cf73d366e10c 100644
--- a/nixpkgs/pkgs/by-name/in/incus/unwrapped.nix
+++ b/nixpkgs/pkgs/by-name/in/incus/generic.nix
@@ -1,10 +1,18 @@
 {
+  hash,
   lts ? false,
+  patches,
+  updateScriptArgs ? "",
+  vendorHash,
+  version,
+}:
 
+{
+  callPackage,
   lib,
   buildGoModule,
-  fetchpatch,
   fetchFromGitHub,
+  writeScript,
   writeShellScript,
   acl,
   cowsql,
@@ -19,33 +27,24 @@
 }:
 
 let
-  releaseFile = if lts then ./lts.nix else ./latest.nix;
-  inherit (import releaseFile { inherit fetchpatch; })
-    version
-    hash
+  pname = "incus${lib.optionalString lts "-lts"}";
+in
+
+buildGoModule rec {
+  inherit
     patches
+    pname
     vendorHash
+    version
     ;
-  name = "incus${lib.optionalString lts "-lts"}";
-in
-
-buildGoModule {
-  pname = "${name}-unwrapped";
-
-  inherit patches vendorHash version;
 
   src = fetchFromGitHub {
     owner = "lxc";
     repo = "incus";
-    rev = "v${version}";
+    rev = "refs/tags/v${version}";
     inherit hash;
   };
 
-  postPatch = ''
-    substituteInPlace internal/usbid/load.go \
-      --replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
-  '';
-
   excludedPackages = [
     # statically compile these
     "cmd/incus-agent"
@@ -98,21 +97,30 @@ buildGoModule {
     '';
 
   postInstall = ''
-    # use custom bash completion as it has extra logic for e.g. instance names
-    installShellCompletion --bash --name incus ./scripts/bash/incus
-
     installShellCompletion --cmd incus \
+      --bash <($out/bin/incus completion bash) \
       --fish <($out/bin/incus completion fish) \
       --zsh <($out/bin/incus completion zsh)
   '';
 
   passthru = {
-    tests.incus = nixosTests.incus;
-
-    updateScript = writeShellScript "update-incus" ''
-      nix-update ${name}.unwrapped -vr 'v(.*)' --override-filename pkgs/by-name/in/incus/${
-        if lts then "lts" else "latest"
-      }.nix
+    client = callPackage ./client.nix {
+      inherit
+        lts
+        meta
+        patches
+        src
+        vendorHash
+        version
+        ;
+    };
+
+    tests = nixosTests.incus;
+
+    ui = callPackage ./ui.nix { };
+
+    updateScript = writeScript "ovs-update.nu" ''
+      ${./update.nu} ${updateScriptArgs}
     '';
   };
 
@@ -123,5 +131,6 @@ buildGoModule {
     license = lib.licenses.asl20;
     maintainers = lib.teams.lxc.members;
     platforms = lib.platforms.linux;
+    mainProgram = "incus";
   };
 }
diff --git a/nixpkgs/pkgs/by-name/in/incus/latest.nix b/nixpkgs/pkgs/by-name/in/incus/latest.nix
deleted file mode 100644
index 78c09a857488..000000000000
--- a/nixpkgs/pkgs/by-name/in/incus/latest.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ fetchpatch }:
-{
-  hash = "sha256-tGuAS0lZvoYb+TvmCklQ8TADZhbm4w/lhdI0ycS4/0o=";
-  version = "0.6.0";
-  vendorHash = "sha256-+WmgLOEBJ/7GF596iiTgyTPxn8l+hE6RVqjLKfCi5rs=";
-  patches = [
-    (fetchpatch {
-      url = "https://github.com/lxc/incus/pull/529.patch";
-      hash = "sha256-2aaPrzW/LVJidWeom0rqYOGpT2gvuV1yHLJN/TwQ1fk=";
-    })
-  ];
-}
diff --git a/nixpkgs/pkgs/by-name/in/incus/lts.nix b/nixpkgs/pkgs/by-name/in/incus/lts.nix
index a78deb48e23b..1537d4d99bc6 100644
--- a/nixpkgs/pkgs/by-name/in/incus/lts.nix
+++ b/nixpkgs/pkgs/by-name/in/incus/lts.nix
@@ -1,3 +1,3 @@
 # this release doesn't exist yet, but satisfay the by-name checks
 # will be added as incus-lts in all-packages.nix once ready
-_: { }
+import ./generic.nix { }
diff --git a/nixpkgs/pkgs/by-name/in/incus/package.nix b/nixpkgs/pkgs/by-name/in/incus/package.nix
index 2958ab036ac9..de85b0310bc9 100644
--- a/nixpkgs/pkgs/by-name/in/incus/package.nix
+++ b/nixpkgs/pkgs/by-name/in/incus/package.nix
@@ -1,157 +1,6 @@
-{
-  lts ? false,
-
-  lib,
-  callPackage,
-  linkFarm,
-  makeWrapper,
-  stdenv,
-  symlinkJoin,
-  writeShellScriptBin,
-  acl,
-  apparmor-parser,
-  apparmor-profiles,
-  attr,
-  bash,
-  btrfs-progs,
-  cdrkit,
-  criu,
-  dnsmasq,
-  e2fsprogs,
-  getent,
-  gnutar,
-  gptfdisk,
-  gzip,
-  iproute2,
-  iptables,
-  kmod,
-  lvm2,
-  minio,
-  nftables,
-  OVMF,
-  qemu_kvm,
-  qemu-utils,
-  rsync,
-  spice-gtk,
-  squashfsTools,
-  thin-provisioning-tools,
-  util-linux,
-  virtiofsd,
-  xz,
-}:
-let
-  unwrapped = callPackage ./unwrapped.nix { inherit lts; };
-  client = callPackage ./client.nix { inherit lts; };
-  name = "incus${lib.optionalString lts "-lts"}";
-
-  binPath = lib.makeBinPath [
-    acl
-    attr
-    bash
-    btrfs-progs
-    cdrkit
-    criu
-    dnsmasq
-    e2fsprogs
-    getent
-    gnutar
-    gptfdisk
-    gzip
-    iproute2
-    iptables
-    kmod
-    lvm2
-    minio
-    nftables
-    qemu_kvm
-    qemu-utils
-    rsync
-    squashfsTools
-    thin-provisioning-tools
-    util-linux
-    virtiofsd
-    xz
-
-    (writeShellScriptBin "apparmor_parser" ''
-      exec '${apparmor-parser}/bin/apparmor_parser' -I '${apparmor-profiles}/etc/apparmor.d' "$@"
-    '')
-  ];
-
-  clientBinPath = [ spice-gtk ];
-
-  ovmf-2mb = OVMF.override {
-    secureBoot = true;
-    fdSize2MB = true;
-  };
-
-  ovmf-4mb = OVMF.override {
-    secureBoot = true;
-    fdSize4MB = true;
-  };
-
-  ovmf-prefix = if stdenv.hostPlatform.isAarch64 then "AAVMF" else "OVMF";
-
-  # mimic ovmf from https://github.com/canonical/incus-pkg-snap/blob/3abebe1dfeb20f9b7729556960c7e9fe6ad5e17c/snapcraft.yaml#L378
-  # also found in /snap/incus/current/share/qemu/ on a snap install
-  ovmf = linkFarm "incus-ovmf" [
-    {
-      name = "OVMF_CODE.2MB.fd";
-      path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_CODE.fd";
-    }
-    {
-      name = "OVMF_CODE.4MB.fd";
-      path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_CODE.fd";
-    }
-    {
-      name = "OVMF_CODE.fd";
-      path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_CODE.fd";
-    }
-
-    {
-      name = "OVMF_VARS.2MB.fd";
-      path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd";
-    }
-    {
-      name = "OVMF_VARS.2MB.ms.fd";
-      path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd";
-    }
-    {
-      name = "OVMF_VARS.4MB.fd";
-      path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_VARS.fd";
-    }
-    {
-      name = "OVMF_VARS.4MB.ms.fd";
-      path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_VARS.fd";
-    }
-    {
-      name = "OVMF_VARS.fd";
-      path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd";
-    }
-    {
-      name = "OVMF_VARS.ms.fd";
-      path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd";
-    }
-  ];
-in
-symlinkJoin {
-  name = "${name}-${unwrapped.version}";
-
-  paths = [ unwrapped ];
-
-  nativeBuildInputs = [ makeWrapper ];
-
-  postBuild = ''
-    wrapProgram $out/bin/incusd --prefix PATH : ${lib.escapeShellArg binPath}:${qemu_kvm}/libexec:$out/bin --set INCUS_OVMF_PATH ${ovmf}
-
-    wrapProgram $out/bin/incus --prefix PATH : ${lib.makeBinPath clientBinPath}
-  '';
-
-  passthru = {
-    inherit client unwrapped;
-    ui = callPackage ./ui.nix {};
-
-    inherit (unwrapped) tests;
-  };
-
-  inherit (unwrapped) meta pname version;
+import ./generic.nix {
+  hash = "sha256-6TLoua3rooDRyPc5BPYgzU/oeVy6F8h+p3UtKGPZkAE=";
+  version = "0.7.0";
+  vendorHash = "sha256-Slw58pszT6sbpxK6/f+ojA+uStt0zSWxztFTm5ovZr8=";
+  patches = [ ];
 }
diff --git a/nixpkgs/pkgs/by-name/in/incus/update.nu b/nixpkgs/pkgs/by-name/in/incus/update.nu
new file mode 100755
index 000000000000..754da9b59abf
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/in/incus/update.nu
@@ -0,0 +1,29 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i nu -p nushell common-updater-scripts gnused
+
+def main [--lts = false, --regex: string] {
+  let attr = $"incus(if $lts {"-lts"})"
+  let file = $"(pwd)/pkgs/by-name/in/incus/(if $lts { "lts" } else { "package" }).nix"
+
+  let tags = list-git-tags --url=https://github.com/lxc/incus | lines | sort --natural | str replace v ''
+  let latest_tag = if $regex == null { $tags } else { $tags | find --regex $regex } | last
+  let current_version = nix eval --raw -f default.nix $"($attr).version" | str trim
+
+  if $latest_tag != $current_version {
+    print $"Updating: new ($latest_tag) != old ($current_version)"
+    update-source-version $attr $latest_tag $"--file=($file)"
+
+    let oldVendorHash = nix-instantiate . --eval --strict -A $"($attr).goModules.drvAttrs.outputHash" --json | from json
+    let checkBuild = do { nix-build -A $"($attr).goModules" } | complete
+    let vendorHash = $checkBuild.stderr | lines | str trim | find --regex 'got:[[:space:]]*sha256' | split row ' ' | last
+
+    if $vendorHash != null {
+      open $file | str replace $oldVendorHash $vendorHash | save --force $file
+    } else {
+      print $checkBuild.stderr
+      exit 1
+    }
+  }
+
+  {"lts?": $lts, before: $current_version, after: $latest_tag}
+}
diff --git a/nixpkgs/pkgs/by-name/in/insync/package.nix b/nixpkgs/pkgs/by-name/in/insync/package.nix
new file mode 100644
index 000000000000..b8206c38ce90
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/in/insync/package.nix
@@ -0,0 +1,122 @@
+{ lib
+, writeShellScript
+, buildFHSEnv
+, stdenvNoCC
+, fetchurl
+, autoPatchelfHook
+, dpkg
+, nss
+, cacert
+, alsa-lib
+, libvorbis
+, libdrm
+, libGL
+, wayland
+, xkeyboard_config
+, libthai
+, libsForQt5
+}:
+
+let
+  pname = "insync";
+  # Find a binary from https://www.insynchq.com/downloads/linux#ubuntu.
+  version = "3.8.7.50516";
+  ubuntu-dist = "mantic_amd64";
+  meta = with lib; {
+    platforms = ["x86_64-linux"];
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    maintainers = with maintainers; [ hellwolf ];
+    homepage = "https://www.insynchq.com";
+    description = "Google Drive sync and backup with multiple account support";
+    longDescription = ''
+     Insync is a commercial application that syncs your Drive files to your
+     computer.  It has more advanced features than Google's official client
+     such as multiple account support, Google Doc conversion, symlink support,
+     and built in sharing.
+
+     There is a 15-day free trial, and it is a paid application after that.
+
+     Known bug(s):
+
+     1) Currently the system try icon does not render correctly.
+    '';
+    mainProgram = "insync";
+  };
+
+  insync-pkg = stdenvNoCC.mkDerivation {
+    name = "${pname}-pkg-${version}";
+    inherit version meta;
+
+    src = fetchurl {
+      url = "https://cdn.insynchq.com/builds/linux/insync_${version}-${ubuntu-dist}.deb";
+      sha256 = "sha256-U7BcgghbdR7r9WiZpEOka+BzXwnxrzL6p4imGESuB/k=";
+    };
+
+    nativeBuildInputs = [
+      dpkg
+      autoPatchelfHook
+      libsForQt5.qt5.wrapQtAppsHook
+    ];
+
+    buildInputs = [
+      nss
+      alsa-lib
+      libvorbis
+      libdrm
+      libGL
+      wayland
+      libthai
+      libsForQt5.qt5.qtvirtualkeyboard
+    ];
+
+    unpackPhase = ''
+      dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner
+    '';
+
+    installPhase = ''
+      runHook preInstall
+
+      mkdir -p $out
+      cp -R usr/* $out/
+
+      runHook postInstall
+    '';
+
+    # NB! This did the trick, otherwise it segfaults! However I don't understand why!
+    dontStrip = true;
+  };
+
+in buildFHSEnv {
+  name = pname;
+  inherit meta;
+
+  targetPkgs = pkgs: with pkgs; [
+    libudev0-shim
+    insync-pkg
+  ];
+
+  extraInstallCommands = ''
+    cp -rsHf "${insync-pkg}"/share $out
+  '';
+
+  runScript = writeShellScript "insync-wrapper.sh" ''
+    # xkb configuration needed: https://github.com/NixOS/nixpkgs/issues/236365
+    export XKB_CONFIG_ROOT=${xkeyboard_config}/share/X11/xkb/
+
+    # For debugging:
+    # export QT_DEBUG_PLUGINS=1
+
+    exec /usr/lib/insync/insync "$@"
+    '';
+
+  # As intended by this bubble wrap, share as much namespaces as possible with user.
+  unshareUser   = false;
+  unshareIpc    = false;
+  unsharePid    = false;
+  unshareNet    = false;
+  unshareUts    = false;
+  unshareCgroup = false;
+
+  dieWithParent = true;
+}
diff --git a/nixpkgs/pkgs/by-name/in/integresql/package.nix b/nixpkgs/pkgs/by-name/in/integresql/package.nix
new file mode 100644
index 000000000000..3741206239b3
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/in/integresql/package.nix
@@ -0,0 +1,37 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "integresql";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "allaboutapps";
+    repo = "integresql";
+    rev = "v${version}";
+    hash = "sha256-heRa1H4ZSCZzSMCejhakBpJfnEnGQLmNFERKqMxbC04=";
+  };
+
+  vendorHash = "sha256-8qI7mLgQB0GK2QV6tZmWU8hJX+Ax1YhEPisQbjGoJRc=";
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X github.com/allaboutapps/integresql/internal/config.Commit=${src.rev}"
+    "-X github.com/allaboutapps/integresql/internal/config.ModuleName=github.com/allaboutapps/integresql"
+  ];
+
+  postInstall = ''
+    mv $out/bin/server $out/bin/integresql
+  '';
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "IntegreSQL manages isolated PostgreSQL databases for your integration tests";
+    homepage = "https://github.com/allaboutapps/integresql";
+    changelog = "https://github.com/allaboutapps/integresql/blob/${src.rev}/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = [ maintainers.marsam ];
+    mainProgram = "integresql";
+  };
+}
diff --git a/nixpkgs/pkgs/by-name/in/invidious-router/package.nix b/nixpkgs/pkgs/by-name/in/invidious-router/package.nix
new file mode 100644
index 000000000000..112ca05a97c0
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/in/invidious-router/package.nix
@@ -0,0 +1,30 @@
+{
+  lib,
+  buildGo122Module,
+  fetchFromGitLab,
+}: let
+  version = "1.1";
+in
+  buildGo122Module {
+    pname = "invidious-router";
+    inherit version;
+
+    src = fetchFromGitLab {
+      owner = "gaincoder";
+      repo = "invidious-router";
+      rev = version;
+      hash = "sha256-t8KQqMPkBbVis1odDcSu+H0uvyvoFqCmtWoHqVRxmfc=";
+    };
+
+    vendorHash = "sha256-c03vYidm8SkoesRVQZdg/bCp9LIpdTmpXdfwInlHBKk=";
+
+    doCheck = true;
+
+    meta = {
+      homepage = "https://gitlab.com/gaincoder/invidious-router";
+      description = "A Go application that routes requests to different Invidious instances based on their health status and (optional) response time";
+      license = with lib.licenses; [mit];
+      maintainers = with lib.maintainers; [sils];
+      mainProgram = "invidious-router";
+    };
+  }