Skip to content

Commit

Permalink
Nix expression for oXygen
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Jul 4, 2019
1 parent 458f075 commit 70aeb6f
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
3 changes: 3 additions & 0 deletions oxygen/.gitignore
@@ -0,0 +1,3 @@
oxygen*sh
*.eml
license
67 changes: 67 additions & 0 deletions oxygen/default.nix
@@ -0,0 +1,67 @@
(p: (import <nixpkgs> {}).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"
''
)
9 changes: 9 additions & 0 deletions 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

0 comments on commit 70aeb6f

Please sign in to comment.