24 stdenv.mkDerivation rec {
25 pname = "intune-portal";
26 version = "1.2405.17-jammy";
29 url = "https://packages.microsoft.com/ubuntu/22.04/prod/pool/main/i/intune-portal/intune-portal_${version}_amd64.deb";
30 hash = "sha256-WpVPWzh8jN092MaY2rMXhLfpVXsflMl9hOY9nNGJlLk=";
33 nativeBuildInputs = [ dpkg ];
38 intune = lib.makeLibraryPath [
57 pam = lib.makeLibraryPath [ pam ];
63 patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath ${libPath.intune} opt/microsoft/intune/bin/intune-portal
64 patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath ${libPath.intune} opt/microsoft/intune/bin/intune-agent
65 patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath ${libPath.intune} opt/microsoft/intune/bin/intune-daemon
66 patchelf --set-rpath ${libPath.pam} ./usr/lib/x86_64-linux-gnu/security/pam_intune.so
75 cp -a opt/microsoft/intune/bin/* $out/bin/
78 mkdir -p $out/lib/security
79 cp -a ./usr/lib/x86_64-linux-gnu/security/pam_intune.so $out/lib/security/
80 cp -a usr/lib/tmpfiles.d $out/lib
82 substituteInPlace $out/share/applications/intune-portal.desktop \
83 --replace /opt/microsoft/intune/bin/intune-portal $out/bin/intune-portal
85 substituteInPlace $out/lib/systemd/user/intune-agent.service \
87 ExecStart=/opt/microsoft/intune/bin/intune-agent \
88 ExecStart=$out/bin/intune-agent
90 substituteInPlace $out/lib/systemd/system/intune-daemon.service \
92 ExecStart=/opt/microsoft/intune/bin/intune-daemon \
93 ExecStart=$out/bin/intune-daemon
98 # Without this network requests fail
102 updateScript = ./update.sh;
103 tests = { inherit (nixosTests) intune; };
107 description = "Microsoft Intune Portal allows you to securely access corporate apps, data, and resources";
108 homepage = "https://www.microsoft.com/";
109 license = licenses.unfree;
110 platforms = [ "x86_64-linux" ];
111 maintainers = with lib.maintainers; [ rhysmdnz ];