diff --git a/hosts/miku.nix b/hosts/miku.nix index 377cb34..690bb3c 100644 --- a/hosts/miku.nix +++ b/hosts/miku.nix @@ -38,6 +38,8 @@ cantata newsflash sublime-music-no-test + psst + staruml-wrapped ]; ptw = { diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index 2d8ea02..f60c0d1 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -43,6 +43,7 @@ in inputs.nixpkgs.lib.nixosSystem { emacs.overlay (import ../packages) (import ../overlays/simple.nix) + (import ../overlays/sandbox.nix) ]; } diff --git a/packages/sandbox.nix b/lib/sandbox.nix similarity index 100% rename from packages/sandbox.nix rename to lib/sandbox.nix diff --git a/overlays/default.nix b/overlays/default.nix index fad7e51..7ea717f 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,4 +3,5 @@ { simple = import ./simple.nix; surface = import ./surface.nix pkgs; + sandbox = import ./sandbox.nix; } diff --git a/overlays/sandbox.nix b/overlays/sandbox.nix new file mode 100644 index 0000000..afda5c5 --- /dev/null +++ b/overlays/sandbox.nix @@ -0,0 +1,59 @@ +final: prev: + +let + wrapInSandbox = prev.callPackage ../lib/sandbox.nix {}; +in { + discord-wrapped = wrapInSandbox { + name = "discord"; + package = prev.discord; + #package = discord-system-electron; + binaryName = "discord"; + mountInHome = [ ".config/discord" ".config/BetterDiscord" ]; + additionalBlacklist = [ "/mnt" ]; + chdirTo = "/home/$USER"; + + version = "1.0.1"; + copyIntoSandbox = [ "share/pixmaps" ]; + desktopFileArgs = { + name = "Discord (wrapped)"; + #exec = "discord"; + icon = "discord"; + desktopName = "Discord (wrapped)"; + genericName = "Instant Messenger"; + categories = "Network;InstantMessaging;"; + }; + }; + + minecraft-wrapped = wrapInSandbox { + name = "minecraft-launcher"; + package = prev.minecraft; + binaryName = "minecraft-launcher"; + mountInHome = [ ".local/share/minecraft" ".minecraft" ]; + additionalBlacklist = [ "/mnt" ]; + chdirTo = "/home/$USER"; + }; + + steam-wrapped = wrapInSandbox { + name = "steam"; + package = prev.steam; + binaryName = "steam"; + mountInHome = [ ".steam" ".local/share/Steam" ]; + additionalBlacklist = [ "/mnt" ]; + additionalMounts = [ "/mnt/Storage/Games/SteamLibrary" ]; + chdirTo = "/home/$USER"; + extraEnv = { + DRI_PRIME = "1"; + }; + + copyIntoSandbox = [ "/share" ]; + }; + + android-studio-wrapped = wrapInSandbox { + name = "android-studio"; + package = prev.android-studio; + binaryName = "android-studio"; + additionalBlacklist = [ "/mnt" ]; + mountInHome = [ "Development/Personal/Android" ".android" ]; + chdirTo = "/home/$USER"; + }; +} diff --git a/overlays/simple.nix b/overlays/simple.nix index 1f5fe9a..241510b 100644 --- a/overlays/simple.nix +++ b/overlays/simple.nix @@ -67,4 +67,26 @@ final: prev: }) ]; }); + + # TODO: Remove once upstream has a new version tagged + kasts-git = prev.libsForQt5.kasts.overrideAttrs (old: { + src = let + commit = "b39be0118ef6ff587b433af185c584f3d5bcec30"; + in builtins.fetchTarball { + url = "https://invent.kde.org/plasma-mobile/kasts/-/archive/${commit}/kasts-${commit}.tar.gz"; + sha256 = "06myymbwj89357cpg7phha1x8q84mlhcy4f44pdkqmg7lkd5a6df"; + }; + + buildInputs = old.buildInputs ++ [ prev.taglib prev.libsForQt5.qtkeychain ]; + }); + + xournalpp-git = prev.xournalpp.overrideAttrs (old: { + version = "1.1.1"; + src = prev.fetchFromGitHub { + owner = "bhennion"; + repo = "xournalpp"; + rev = "5d1545b0c4303e45b4ddf4ef8a1565eba822a9af"; + sha256 = "1d17lvydlny9pvaxa9xy53wxs7i6d563lp5r9g3r1xpgnb7zli8v"; + }; + }); } diff --git a/packages/default.nix b/packages/default.nix index ef4c8e9..118d17f 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -9,7 +9,6 @@ let extraStartupArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; #extraStartupArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer"; }; - wrapInSandbox = prev.callPackage ./sandbox.nix {}; in { key-mapper = prev.callPackage ./tools/games/key-mapper {}; vfio-isolate = prev.callPackage ./tools/virtualisation/vfio-isolate {}; @@ -31,90 +30,12 @@ key-mapper = prev.callPackage ./tools/games/key-mapper {}; pySmartDL = pySmartDL; cfscrape = cfscrape; }; - discord-wrapped = wrapInSandbox { - name = "discord"; - package = prev.discord; - #package = discord-system-electron; - binaryName = "discord"; - mountInHome = [ ".config/discord" ".config/BetterDiscord" ]; - additionalBlacklist = [ "/mnt" ]; - chdirTo = "/home/$USER"; - - version = "1.0.1"; - copyIntoSandbox = [ "share/pixmaps" ]; - desktopFileArgs = { - name = "Discord (wrapped)"; - #exec = "discord"; - icon = "discord"; - desktopName = "Discord (wrapped)"; - genericName = "Instant Messenger"; - categories = "Network;InstantMessaging;"; - }; - }; sddm-sugar-dark = prev.callPackage ./sddm-sugar-dark {}; surface-control = prev.callPackage ./tools/system/surface-control {}; trackma = prev.callPackage ./tools/video/trackma {}; - - multimc-wrapped = wrapInSandbox { - name = "multimc"; - package = prev.multimc.override { - jdk = prev.jdk11; - jdk8 = prev.jdk11; - }; - binaryName = "multimc"; - mountInHome = [ ".local/share/multimc" ]; - additionalBlacklist = [ "/mnt" ]; - chdirTo = "/home/$USER"; - #extraEnv = { - # DRI_PRIME = "1"; - #}; - }; - - minecraft-wrapped = wrapInSandbox { - name = "minecraft-launcher"; - package = prev.minecraft; - binaryName = "minecraft-launcher"; - mountInHome = [ ".local/share/minecraft" ".minecraft" ]; - additionalBlacklist = [ "/mnt" ]; - chdirTo = "/home/$USER"; - }; - - steam-wrapped = wrapInSandbox { - name = "steam"; - package = prev.steam; - binaryName = "steam"; - mountInHome = [ ".steam" ".local/share/Steam" ]; - additionalBlacklist = [ "/mnt" ]; - additionalMounts = [ "/mnt/Storage/Games/SteamLibrary" ]; - chdirTo = "/home/$USER"; - extraEnv = { - DRI_PRIME = "1"; - }; - - copyIntoSandbox = [ "/share" ]; - }; - - android-studio-wrapped = wrapInSandbox { - name = "android-studio"; - package = prev.android-studio; - binaryName = "android-studio"; - additionalBlacklist = [ "/mnt" ]; - mountInHome = [ "Development/Personal/Android" ".android" ]; - chdirTo = "/home/$USER"; - }; - - xournalpp-git = prev.xournalpp.overrideAttrs (old: { - version = "1.1.1"; - src = prev.fetchFromGitHub { - owner = "bhennion"; - repo = "xournalpp"; - rev = "5d1545b0c4303e45b4ddf4ef8a1565eba822a9af"; - sha256 = "1d17lvydlny9pvaxa9xy53wxs7i6d563lp5r9g3r1xpgnb7zli8v"; - }; - }); gajim-mainwindow = prev.callPackage ./applications/networking/instant-messengers/gajim { nbxmpp = prev.python3Packages.nbxmpp.overrideAttrs (old: { @@ -133,20 +54,10 @@ key-mapper = prev.callPackage ./tools/games/key-mapper {}; # TODO: Remove once NixOS has version 0.11.16 in their repos sublime-music-no-test = prev.callPackage ./applications/audio/sublime-music {}; - # TODO: Remove once upstream has a new version tagged - kasts-git = prev.libsForQt5.kasts.overrideAttrs (old: { - src = let - commit = "b39be0118ef6ff587b433af185c584f3d5bcec30"; - in builtins.fetchTarball { - url = "https://invent.kde.org/plasma-mobile/kasts/-/archive/${commit}/kasts-${commit}.tar.gz"; - sha256 = "06myymbwj89357cpg7phha1x8q84mlhcy4f44pdkqmg7lkd5a6df"; - }; - - buildInputs = old.buildInputs ++ [ prev.taglib prev.libsForQt5.qtkeychain ]; - }); - sound-gambit = prev.callPackage tools/audio/sound-gambit {}; ebu-norm = prev.callPackage tools/audio/ebu-norm {}; payload-dumper = prev.callPackage tools/system/payload-dumper {}; + + psst = prev.callPackage tools/audio/psst {}; } diff --git a/packages/tools/audio/psst/default.nix b/packages/tools/audio/psst/default.nix new file mode 100644 index 0000000..5641324 --- /dev/null +++ b/packages/tools/audio/psst/default.nix @@ -0,0 +1,42 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, cairo +, openssl +, alsa-lib +, dbus +, gtk3 +}: + +rustPlatform.buildRustPackage rec { + pname = "psst"; + version = "1.2.1"; + + src = fetchFromGitHub { + owner = "jpochyla"; + repo = "psst"; + rev = "8f142a3232a706537c8477bff43d2e52309f6b78"; + sha256 = "00pdijd70rq98lrrfgh6pzqa6w3pp49lmpzaviw7nrgfl7l6j3v0"; + }; + + cargoSha256 = "sha256-/nbYi7n58D8V3qa9rStg7JfGh4sAhTxC2niFFW5Ta34="; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ cairo openssl gtk3 alsa-lib dbus ]; + + postInstall = '' + # Install the desktop file + mkdir -p $out/share + cp .pkg/psst.desktop $out/share/ + ''; + + meta = with lib; { + description = "A modern Volume Mixer for PulseAudio"; + homepage = "https://github.com/Aurailus/Myxer"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ erin ]; + platforms = platforms.linux; + }; +}