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.
This commit is contained in:
Luke Granger-Brown 2020-05-06 10:01:46 +01:00
parent 07829d4e34
commit 79c7b70a96
5 changed files with 22 additions and 0 deletions

View file

@ -13,6 +13,7 @@ in fix (self:
third_party = import ./third_party ch; third_party = import ./third_party ch;
ops = import ./ops ch; ops = import ./ops ch;
nix = import ./nix ch;
lib = self.third_party.nixpkgs.lib; lib = self.third_party.nixpkgs.lib;
}) })

3
nix/default.nix Normal file
View file

@ -0,0 +1,3 @@
args: {
pkgs = import ./pkgs args;
}

3
nix/pkgs/default.nix Normal file
View file

@ -0,0 +1,3 @@
args: {
javaws-env = import ./javaws-env.nix args;
}

9
nix/pkgs/javaws-env.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
pkgs.buildFHSUserEnv {
name = "javaws-env";
targetPkgs = pkgs: (with pkgs;
[
adoptopenjdk-icedtea-web
]);
runScript = "javaws";
}

View file

@ -185,6 +185,12 @@ in {
uid = 1000; uid = 1000;
extraGroups = [ "wheel" "networkmanager" ]; extraGroups = [ "wheel" "networkmanager" ];
hashedPassword = secrets.passwordHashes.root; hashedPassword = secrets.passwordHashes.root;
packages = [
(pkgs.writeScriptBin "javaws" ''
#!/bin/sh
exec ${depot.nix.pkgs.javaws-env}/bin/javaws-env "$@"
'')
];
}; };
}; };