diff --git a/flake.lock b/flake.lock index 87b7ade..24e363f 100644 --- a/flake.lock +++ b/flake.lock @@ -179,11 +179,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1684305980, - "narHash": "sha256-vd4SKXX1KZfSX6n3eoguJw/vQ+sBL8XGdgfxjEgLpKc=", + "lastModified": 1684385584, + "narHash": "sha256-O7y0gK8OLIDqz+LaHJJyeu09IGiXlZIS3+JgEzGmmJA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e6e389917a8c778be636e67a67ec958f511cc55d", + "rev": "48a0fb7aab511df92a17cf239c37f2bd2ec9ae3a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 291c234..7b53d0e 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,7 @@ }@attrs: { packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage; packages.x86_64-linux.jmri = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/jmri { }; + # packages.x86_64-linux.circuitjs = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/circuitjs { }; hydraJobs = self.packages; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; nixosConfigurations = { diff --git a/pkgs/circuitjs/default.nix b/pkgs/circuitjs/default.nix new file mode 100644 index 0000000..cc2f0cf --- /dev/null +++ b/pkgs/circuitjs/default.nix @@ -0,0 +1,72 @@ +{ stdenv, fetchurl, makeWrapper, wrapGAppsHook, lib, libX11, libXext, gtk3-x11, dbus, nspr, alsa-lib, glib, expat, gdk-pixbuf, mesa, xorg, nss, cups, ffmpeg, cairo, pango, at-spi2-atk, atk, at-spi2-core, libdrm, ... }: +stdenv.mkDerivation rec { + pname = "circuitjs"; + version = "2.8.0"; + + src = fetchurl { + url = "https://www.falstad.com/circuit/offline/circuitjs1-linux64.tgz"; + hash = "sha256-dyIEuDA7FRwHCok41wcJAr8eqksJSOdChafPPh0Q3zM="; + }; + + nativeBuildInputs = [ makeWrapper wrapGAppsHook ]; + + sourceRoot = "."; + dontBuild = true; + dontStrip = true; + dontPatchELF = true; + libPath = lib.makeLibraryPath [ + libX11 + libXext + alsa-lib + xorg.libXi + xorg.libXrender + xorg.libXfixes + xorg.libXtst + xorg.libXcomposite + xorg.libXcursor + xorg.libXrandr + xorg.libXdamage + xorg.libxcb + xorg.libXScrnSaver + nss + ffmpeg.lib + cups + pango + cairo + nspr + atk + libdrm + glib + dbus + gtk3-x11 + mesa + expat + gdk-pixbuf + ]; + + # wrapProgramShell $out/opt/circuitjs1 \ + # "''${gappsWrapperArgs[@]}" \ + # --prefix LD_LIBRARY_PATH : ${libPath}:$out/lib \ + installPhase = '' + mkdir -p $out/ + cp -r circuitjs1 $out/opt + mkdir -p $out/lib + cp circuitjs1/lib* $out/lib + mkdir -p $out/bin + ln -sf $out/opt/circuitjs1 $out/bin/circuitjs1 + + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${libPath}":$out/lib \ + $out/bin/circuitjs1 + ''; + + meta = with lib; { + # inherit homepage; + description = "Falstad circuit simulator"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + # license = licenses.unfree; + platforms = platforms.linux; + maintainers = [ maintainers.therealr5 ]; + }; +} diff --git a/users/rouven/modules/packages.nix b/users/rouven/modules/packages.nix index 5b42783..1e4178c 100644 --- a/users/rouven/modules/packages.nix +++ b/users/rouven/modules/packages.nix @@ -38,7 +38,7 @@ # yubikey and password stuff yubikey-manager yubikey-manager-qt - # yubioath-flutter # broken, TODO fix + yubioath-flutter bitwarden # misc