From b768ad0ca4208e8b3588b881067c43d85246e967 Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Fri, 2 Oct 2026 11:23:45 -0500 Subject: experiment with modular services; more unix domain sockets, clean up old code --- hosts/mercury/hjem.nix | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) (limited to 'hosts/mercury/hjem.nix') diff --git a/hosts/mercury/hjem.nix b/hosts/mercury/hjem.nix index 307317a..e27e87c 100644 --- a/hosts/mercury/hjem.nix +++ b/hosts/mercury/hjem.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: let +{ + pkgs, + lib, + ... +}: let rust-shell = let rustProfile = pkgs.buildEnv { name = "rust-profile"; @@ -26,16 +30,55 @@ export PYTHONSTARTUP="" exec $SHELL ''; + + smallObsidian = let + pname = "obsidian"; + version = "1.13.7"; + in + pkgs.stdenv.mkDerivation { + inherit pname version; + + src = pkgs.fetchurl { + url = "https://github.com/obsidianmd/obsidian-releases/releases/download/v${version}/obsidian-${version}.tar.gz"; + hash = "sha256-08vjdcv6QCTbGRC5gZFkn0E0xcSK7l5gtudxOYfc2yg="; + }; + nativeBuildInputs = with pkgs; [ + autoPatchelfHook + makeWrapper + imagemagick + asar + ]; + installPhase = '' + runHook preInstall + mkdir -p $out/bin + + # Mark Obsidian's app:// scheme `corsEnabled` to fix the internal PDF + # viewer; see https://github.com/NixOS/nixpkgs/pull/525772 for details. + # Remove once upstream registers the scheme with `corsEnabled`. + asar extract resources/app.asar app-src + substituteInPlace app-src/main.js \ + --replace-fail "supportFetchAPI: true," "supportFetchAPI: true, corsEnabled: true," + asar pack app-src resources/app.asar + + makeWrapper ${pkgs.electron}/bin/electron $out/bin/obsidian \ + --add-flags $out/share/obsidian/app.asar \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-wayland-ime=true --wayland-text-input-version=3}}" + install -m 755 -D obsidian-cli $out/bin/obsidian-cli + install -m 444 -D resources/app.asar $out/share/obsidian/app.asar + install -m 444 -D resources/obsidian.asar $out/share/obsidian/obsidian.asar + runHook postInstall + ''; + }; in { packages = with pkgs; [ anki libreoffice-qt musescore vscodium + smallObsidian noctalia-shell - prismlauncher mpv irssi -- cgit v1.3.1