From 70aeb6f7d3f0278cfa5c448530ba9e8c4b9d20c6 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 4 Jul 2019 12:20:48 -0400 Subject: [PATCH] Nix expression for oXygen --- oxygen/.gitignore | 3 +++ oxygen/default.nix | 67 ++++++++++++++++++++++++++++++++++++++++++++++ oxygen/fetch.sh | 9 +++++++ 3 files changed, 79 insertions(+) create mode 100644 oxygen/.gitignore create mode 100644 oxygen/default.nix create mode 100755 oxygen/fetch.sh diff --git a/oxygen/.gitignore b/oxygen/.gitignore new file mode 100644 index 0000000..29bf0e7 --- /dev/null +++ b/oxygen/.gitignore @@ -0,0 +1,3 @@ +oxygen*sh +*.eml +license diff --git a/oxygen/default.nix b/oxygen/default.nix new file mode 100644 index 0000000..7a1b496 --- /dev/null +++ b/oxygen/default.nix @@ -0,0 +1,67 @@ +(p: (import {}).callPackage p {}) +( +{ runCommand, requireFile, jdk + , buildFHSUserEnv, makeWrapper +}: +let + env = buildFHSUserEnv { + name = "oxygen-env"; + targetPkgs = pkgs: [ pkgs.jdk ]; + runScript = '' + bash -c "set -x + cp ${./oxygen.sh} ./install.sh + chmod +x ./install.sh + sh ./install.sh" + ''; + + }; +in runCommand "oxygen-cmd" { + installer = ./oxygen.sh; + buildInputs = [ jdk makeWrapper ]; +} '' + ( + echo 2 # language: Engish + echo o # confirm we want to install + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo "" # go to the next page of the license + echo 1 # accept the license + echo /build/staged # install to this directory + + echo "" # accept the default list of components + # (only one, and it was selected, at this time) + + echo "n" # make desktop symlinks + echo "n" # Run Oxygen XML Editor now? + + echo "n" # Privacy Options, saying Yes failed b/c no X11 + ) | ${env}/bin/oxygen-env + + mv staged $out + + cd $out + + # Leaving the jre directory makes oxygen prefer its own JRE over + # our provided java + rm -rf jre + wrapProgram $out/oxygen.sh \ + --set JAVA_HOME "$JAVA_HOME" + + + +'' +) diff --git a/oxygen/fetch.sh b/oxygen/fetch.sh new file mode 100755 index 0000000..8b43108 --- /dev/null +++ b/oxygen/fetch.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +name=oxygen-$(date).sh +curl -L --output "$name" \ + https://mirror.oxygenxml.com/InstData/Editor/Linux64/VM/oxygen-64bit.sh + +cp "$name" oxygen.sh +nix-hash --type sha256 --base32 "oxygen.sh" > oxygen.sh.hash +nix-store --add-fixed sha256 oxygen.sh