From 24993f99f1f82e0166e48381466987de7114930d Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 24 May 2022 10:03:47 -0500 Subject: [PATCH] getting closer to a working nix environment --- flake.lock | 41 +++++++++++++++++++++++++++++++++++++++++ shell.nix | 15 ++++++++++++--- 2 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ed9d9eb --- /dev/null +++ b/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1652776076, + "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1653117584, + "narHash": "sha256-5uUrHeHBIaySBTrRExcCoW8fBBYVSDjDYDU5A6iOl+k=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f4dfed73ee886b115a99e5b85fdfbeb683290d83", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/shell.nix b/shell.nix index 7c7f914..ad75edd 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,6 @@ -with import { }; -pkgs.mkShell { +{ pkgs ? { } }: +with pkgs; +mkShell { name = "presenter-env"; nativeBuildInputs = [ @@ -9,6 +10,7 @@ pkgs.mkShell { cmake extra-cmake-modules pkg-config + libsForQt5.wrapQtAppsHook # gccStdenv # stdenv ]; @@ -27,7 +29,14 @@ pkgs.mkShell { # ffmpeg-full # yt-dlp ]; - + + # This creates the proper qt env so that plugins are found right. shellHook = '' + setQtEnvironment=$(mktemp --suffix .setQtEnvironment.sh) + echo "shellHook: setQtEnvironment = $setQtEnvironment" + makeWrapper "/bin/sh" "$setQtEnvironment" "''${qtWrapperArgs[@]}" + sed "/^exec/d" -i "$setQtEnvironment" + source "$setQtEnvironment" + fish ''; }