summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/5pkgs')
-rw-r--r--krebs/5pkgs/builders.nix43
-rw-r--r--krebs/5pkgs/default.nix4
-rw-r--r--krebs/5pkgs/noVNC/default.nix21
-rw-r--r--krebs/5pkgs/vncdotool/default.nix20
4 files changed, 70 insertions, 18 deletions
diff --git a/krebs/5pkgs/builders.nix b/krebs/5pkgs/builders.nix
index b3cb1c943..fa51857ba 100644
--- a/krebs/5pkgs/builders.nix
+++ b/krebs/5pkgs/builders.nix
@@ -1,19 +1,30 @@
-{ lib, pkgs, ... }:
-with lib;
-{
- execve = name: { filename, argv, envp ? {}, destination ? "" }:
- writeC name { inherit destination; } ''
- #include <unistd.h>
- int main () {
- const char *filename = ${toC filename};
- char *const argv[] = ${toC (argv ++ [null])};
- char *const envp[] = ${toC (
- mapAttrsToList (k: v: "${k}=${v}") envp ++ [null]
- )};
- execve(filename, argv, envp);
- return -1;
- }
- '';
+{ config, lib, pkgs, ... }:
+with config.krebs.lib;
+rec {
+ execve = name: { filename, argv ? null, envp ? {}, destination ? "" }: let
+ in writeC name { inherit destination; } ''
+ #include <unistd.h>
+
+ static char *const filename = ${toC filename};
+
+ ${if argv == null
+ then /* Propagate arguments */ ''
+ #define MAIN_ARGS int argc, char **argv
+ ''
+ else /* Provide fixed arguments */ ''
+ #define MAIN_ARGS void
+ static char *const argv[] = ${toC (argv ++ [null])};
+ ''}
+
+ static char *const envp[] = ${toC (
+ mapAttrsToList (k: v: "${k}=${v}") envp ++ [null]
+ )};
+
+ int main (MAIN_ARGS) {
+ execve(filename, argv, envp);
+ return -1;
+ }
+ '';
execveBin = name: cfg: execve name (cfg // { destination = "/bin/${name}"; });
diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix
index 1cf3de56e..d395fe00a 100644
--- a/krebs/5pkgs/default.nix
+++ b/krebs/5pkgs/default.nix
@@ -1,5 +1,5 @@
-{ lib, pkgs, ... }@args:
-with lib;
+{ config, lib, pkgs, ... }@args:
+with config.krebs.lib;
{
nixpkgs.config.packageOverrides = pkgs: {
haskellPackages = pkgs.haskellPackages.override {
diff --git a/krebs/5pkgs/noVNC/default.nix b/krebs/5pkgs/noVNC/default.nix
new file mode 100644
index 000000000..629d288ae
--- /dev/null
+++ b/krebs/5pkgs/noVNC/default.nix
@@ -0,0 +1,21 @@
+{ fetchgit, lib, stdenv, ... }:
+with builtins;
+with lib;
+stdenv.mkDerivation rec {
+ name = "${baseNameOf src.name}-${removePrefix "refs/tags/v" src.rev}";
+
+ src = fetchgit {
+ url = https://github.com/kanaka/noVNC;
+ rev = "refs/tags/v0.5.1";
+ sha256 = "1azsnppwnrsv3axj0r5bw8lfarkibgz5vhgcyj8dzn4afn98f55w";
+ };
+
+ phases = [
+ "unpackPhase"
+ "installPhase"
+ ];
+
+ installPhase = ''
+ cp -R . $out
+ '';
+}
diff --git a/krebs/5pkgs/vncdotool/default.nix b/krebs/5pkgs/vncdotool/default.nix
new file mode 100644
index 000000000..95e2ca706
--- /dev/null
+++ b/krebs/5pkgs/vncdotool/default.nix
@@ -0,0 +1,20 @@
+{ lib, pythonPackages, fetchurl, ... }:
+with pythonPackages; buildPythonPackage rec {
+ name = lib.removeSuffix ".tar.gz" (builtins.baseNameOf src.name);
+
+ src = fetchurl {
+ url = https://pypi.python.org/packages/source/v/vncdotool/vncdotool-0.9.0.tar.gz;
+ sha256 = "1hl44w4x9c8air0g6kp9h1af2vj4lmc50vnsxmca9g080740iyvi";
+ };
+
+ propagatedBuildInputs = [
+ twisted
+ pillow
+ ];
+
+ meta = {
+ homepage = https://github.com/sibson/vncdotool;
+ description = "A command line VNC client and python library";
+ license = lib.licenses.mit;
+ };
+}