From 79c7b70a966fcd5a213285b1653abc446eef823b Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Wed, 6 May 2020 10:01:46 +0100 Subject: [PATCH] porcorosso: add javaws bin that drops into a FHS env. This allows me to use Supermicro's BMC, which appears to drop a stunnel binary into /tmp and then execute it, which doesn't work properly in Nix because nothing is where it is expected to be. --- default.nix | 1 + nix/default.nix | 3 +++ nix/pkgs/default.nix | 3 +++ nix/pkgs/javaws-env.nix | 9 +++++++++ ops/nixos/porcorosso/default.nix | 6 ++++++ 5 files changed, 22 insertions(+) create mode 100644 nix/default.nix create mode 100644 nix/pkgs/default.nix create mode 100644 nix/pkgs/javaws-env.nix diff --git a/default.nix b/default.nix index fed95addc8..ebd53b56f5 100644 --- a/default.nix +++ b/default.nix @@ -13,6 +13,7 @@ in fix (self: third_party = import ./third_party ch; ops = import ./ops ch; + nix = import ./nix ch; lib = self.third_party.nixpkgs.lib; }) diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000000..6aca2df9b4 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,3 @@ +args: { + pkgs = import ./pkgs args; +} diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix new file mode 100644 index 0000000000..8f1c07d039 --- /dev/null +++ b/nix/pkgs/default.nix @@ -0,0 +1,3 @@ +args: { + javaws-env = import ./javaws-env.nix args; +} diff --git a/nix/pkgs/javaws-env.nix b/nix/pkgs/javaws-env.nix new file mode 100644 index 0000000000..b309406c1c --- /dev/null +++ b/nix/pkgs/javaws-env.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +pkgs.buildFHSUserEnv { + name = "javaws-env"; + targetPkgs = pkgs: (with pkgs; + [ + adoptopenjdk-icedtea-web + ]); + runScript = "javaws"; +} diff --git a/ops/nixos/porcorosso/default.nix b/ops/nixos/porcorosso/default.nix index 426d1182da..e76e2ed900 100644 --- a/ops/nixos/porcorosso/default.nix +++ b/ops/nixos/porcorosso/default.nix @@ -185,6 +185,12 @@ in { uid = 1000; extraGroups = [ "wheel" "networkmanager" ]; hashedPassword = secrets.passwordHashes.root; + packages = [ + (pkgs.writeScriptBin "javaws" '' + #!/bin/sh + exec ${depot.nix.pkgs.javaws-env}/bin/javaws-env "$@" + '') + ]; }; };