Something went wrong. Try again.
simple QT restic repository browser
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495{ description = "Simple QT restic repository browser";
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs, }: let systems = [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems; in { devShells = forAllSystems (system: let pkgs = import nixpkgs {inherit system;}; in { default = pkgs.mkShell { packages = with pkgs; [ go gotools # goimports go-tools # staticcheck
pkg-config just libicns imagemagick oxipng nsis qt6.qtbase restic ];
shellHook = '' export CGO_ENABLED=1 export QT_PLUGIN_PATH="${pkgs.qt6.qtbase}/${pkgs.qt6.qtbase.qtPluginPrefix}" ''; }; });
packages = forAllSystems (system: let pkgs = import nixpkgs {inherit system;}; isDarwin = pkgs.stdenv.hostPlatform.isDarwin; in { default = pkgs.buildGoModule { pname = "restree"; version = "0.2.0"; src = self; vendorHash = "sha256-UAzWSjjiCJnyUMvdvz3J+ULyyPh7+i4vEAqf9ScEWPU="; overrideModAttrs = _: { nativeBuildInputs = [pkgs.go]; };
env = pkgs.lib.optionalAttrs isDarwin { CGO_CFLAGS = "-mmacosx-version-min=13.0"; CGO_CXXFLAGS = "-std=c++17 -mmacosx-version-min=13.0"; CGO_LDFLAGS = "-mmacosx-version-min=13.0"; MACOSX_DEPLOYMENT_TARGET = "13.0"; };
nativeBuildInputs = [ pkgs.pkg-config pkgs.qt6.wrapQtAppsHook ];
buildInputs = [ pkgs.qt6.qtbase ];
postInstall = if isDarwin then '' mkdir -p $out/Applications/Restree.app/Contents/{MacOS,Resources} mv $out/bin/restree $out/Applications/Restree.app/Contents/MacOS/Restree cp packaging/darwin/Info.plist $out/Applications/Restree.app/Contents/Info.plist cp packaging/darwin/restree.icns $out/Applications/Restree.app/Contents/Resources/restree.icns ln -s $out/Applications/Restree.app/Contents/MacOS/Restree $out/bin/restree '' else '' install -Dm644 packaging/linux/restree.desktop $out/share/applications/restree.desktop install -Dm644 packaging/linux/restree.png $out/share/icons/hicolor/1024x1024/apps/restree.png substituteInPlace $out/share/applications/restree.desktop \ --replace-fail "Exec=restree" "Exec=$out/bin/restree" ''; }; }); };}