From 0ea4fa96f4e6a1de27f50a97db9007e14958547d Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 2 Apr 2019 12:10:28 +0200 Subject: pkgs/profpatsch: add dhall types for s6 servicedir First version of a way to build s6 services using `dhall-to-nix`. Includes a small library that formalizes the tables in `man 7 signal`. --- .../s6/dhall/ServiceDirectory/default-type.dhall | 17 ++++++ .../s6/dhall/ServiceDirectory/default.dhall | 20 +++++++ .../s6/dhall/ServiceDirectory/type.dhall | 1 + pkgs/profpatsch/s6/dhall/defaults.dhall | 1 + pkgs/profpatsch/s6/dhall/imports/Signal.dhall | 1 + pkgs/profpatsch/s6/dhall/imports/Signal/type.dhall | 1 + pkgs/profpatsch/s6/dhall/types.dhall | 1 + pkgs/profpatsch/s6/dhall/unix/Signal/alpha.dhall | 1 + pkgs/profpatsch/s6/dhall/unix/Signal/arm.dhall | 1 + .../s6/dhall/unix/Signal/common/alpha-sparc.dhall | 35 ++++++++++++ .../s6/dhall/unix/Signal/common/constants.dhall | 0 .../s6/dhall/unix/Signal/common/mips.dhall | 35 ++++++++++++ .../s6/dhall/unix/Signal/common/standard.dhall | 25 +++++++++ .../s6/dhall/unix/Signal/common/type.dhall | 63 ++++++++++++++++++++++ .../s6/dhall/unix/Signal/common/x86-arm.dhall | 35 ++++++++++++ pkgs/profpatsch/s6/dhall/unix/Signal/mips.dhall | 1 + .../s6/dhall/unix/Signal/misc/alpha-sparc.dhall | 14 +++++ .../s6/dhall/unix/Signal/misc/common-type.dhall | 1 + .../s6/dhall/unix/Signal/misc/mips.dhall | 14 +++++ .../s6/dhall/unix/Signal/misc/x86-arm.dhall | 14 +++++ pkgs/profpatsch/s6/dhall/unix/Signal/sparc.dhall | 1 + pkgs/profpatsch/s6/dhall/unix/Signal/type.dhall | 2 + pkgs/profpatsch/s6/dhall/unix/Signal/x86.dhall | 1 + 23 files changed, 285 insertions(+) create mode 100644 pkgs/profpatsch/s6/dhall/ServiceDirectory/default-type.dhall create mode 100644 pkgs/profpatsch/s6/dhall/ServiceDirectory/default.dhall create mode 100644 pkgs/profpatsch/s6/dhall/ServiceDirectory/type.dhall create mode 100644 pkgs/profpatsch/s6/dhall/defaults.dhall create mode 100644 pkgs/profpatsch/s6/dhall/imports/Signal.dhall create mode 100644 pkgs/profpatsch/s6/dhall/imports/Signal/type.dhall create mode 100644 pkgs/profpatsch/s6/dhall/types.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/alpha.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/arm.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/common/alpha-sparc.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/common/constants.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/common/mips.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/common/standard.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/common/type.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/common/x86-arm.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/mips.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/misc/alpha-sparc.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/misc/common-type.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/misc/mips.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/misc/x86-arm.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/sparc.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/type.dhall create mode 100644 pkgs/profpatsch/s6/dhall/unix/Signal/x86.dhall (limited to 'pkgs/profpatsch/s6') diff --git a/pkgs/profpatsch/s6/dhall/ServiceDirectory/default-type.dhall b/pkgs/profpatsch/s6/dhall/ServiceDirectory/default-type.dhall new file mode 100644 index 00000000..b560ab0e --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/ServiceDirectory/default-type.dhall @@ -0,0 +1,17 @@ +{ finish : + Optional Text +, up : + Bool +, setid : + Bool +, notification-fd : + Optional Natural +, timeout-kill : + Natural +, timeout-finish : + Natural +, max-death-tally : + Natural +, down-signal : + ./../imports/Signal/type.dhall +} \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/ServiceDirectory/default.dhall b/pkgs/profpatsch/s6/dhall/ServiceDirectory/default.dhall new file mode 100644 index 00000000..c41fff5c --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/ServiceDirectory/default.dhall @@ -0,0 +1,20 @@ +let Signal = ./../imports/Signal.dhall + +in { finish = + None Text + , up = + True + , setid = + True + , notification-fd = + None Natural + , timeout-kill = + 0 + , timeout-finish = + 5000 + , max-death-tally = + 100 + , down-signal = + Signal.SIGTERM + } + : ./default-type.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/ServiceDirectory/type.dhall b/pkgs/profpatsch/s6/dhall/ServiceDirectory/type.dhall new file mode 100644 index 00000000..5ca3b407 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/ServiceDirectory/type.dhall @@ -0,0 +1 @@ +./default-type.dhall ⩓ { run : Text } \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/defaults.dhall b/pkgs/profpatsch/s6/dhall/defaults.dhall new file mode 100644 index 00000000..92ca44a5 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/defaults.dhall @@ -0,0 +1 @@ +{ ServiceDirectory = ./ServiceDirectory/default.dhall } \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/imports/Signal.dhall b/pkgs/profpatsch/s6/dhall/imports/Signal.dhall new file mode 100644 index 00000000..b1ef0ad5 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/imports/Signal.dhall @@ -0,0 +1 @@ +./../unix/Signal/x86.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/imports/Signal/type.dhall b/pkgs/profpatsch/s6/dhall/imports/Signal/type.dhall new file mode 100644 index 00000000..2c45db9d --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/imports/Signal/type.dhall @@ -0,0 +1 @@ +./../../unix/Signal/type.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/types.dhall b/pkgs/profpatsch/s6/dhall/types.dhall new file mode 100644 index 00000000..7223df4b --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/types.dhall @@ -0,0 +1 @@ +{ ServiceDirectory = ./ServiceDirectory/type.dhall } \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/alpha.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/alpha.dhall new file mode 100644 index 00000000..f244a954 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/alpha.dhall @@ -0,0 +1 @@ +./common/alpha-sparc.dhall ⫽ ./misc/alpha-sparc.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/arm.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/arm.dhall new file mode 100644 index 00000000..35678618 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/arm.dhall @@ -0,0 +1 @@ +./x86.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/common/alpha-sparc.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/common/alpha-sparc.dhall new file mode 100644 index 00000000..cebdc49c --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/common/alpha-sparc.dhall @@ -0,0 +1,35 @@ + ./standard.dhall + ⫽ { SIGUSR1 = + 30 + , SIGUSR2 = + 31 + , SIGCHLD = + 20 + , SIGCONT = + 19 + , SIGSTOP = + 17 + , SIGTSTP = + 18 + , SIGTTIN = + 21 + , SIGTTOU = + 22 + , SIGBUS = + 10 + , SIGPOLL = + 23 + , SIGPROF = + 27 + , SIGSYS = + 12 + , SIGURG = + 16 + , SIGVTALRM = + 26 + , SIGXCPU = + 24 + , SIGXFSZ = + 25 + } +: ./type.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/common/constants.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/common/constants.dhall new file mode 100644 index 00000000..e69de29b diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/common/mips.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/common/mips.dhall new file mode 100644 index 00000000..be70924e --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/common/mips.dhall @@ -0,0 +1,35 @@ + ./standard.dhall + ⫽ { SIGUSR1 = + 16 + , SIGUSR2 = + 17 + , SIGCHLD = + 18 + , SIGCONT = + 25 + , SIGSTOP = + 23 + , SIGTSTP = + 24 + , SIGTTIN = + 26 + , SIGTTOU = + 27 + , SIGBUS = + 10 + , SIGPOLL = + 22 + , SIGPROF = + 29 + , SIGSYS = + 12 + , SIGURG = + 21 + , SIGVTALRM = + 28 + , SIGXCPU = + 30 + , SIGXFSZ = + 31 + } +: ./type.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/common/standard.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/common/standard.dhall new file mode 100644 index 00000000..7836bf10 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/common/standard.dhall @@ -0,0 +1,25 @@ +{ SIGHUP = + 1 +, SIGINT = + 2 +, SIGQUIT = + 3 +, SIGILL = + 4 +, SIGTRAP = + 5 +, SIGABRT = + 6 +, SIGFPE = + 8 +, SIGKILL = + 9 +, SIGSEGV = + 11 +, SIGPIPE = + 13 +, SIGALRM = + 14 +, SIGTERM = + 15 +} \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/common/type.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/common/type.dhall new file mode 100644 index 00000000..76ecb01d --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/common/type.dhall @@ -0,0 +1,63 @@ +let POSIX1990 = + { SIGHUP : + Natural + , SIGINT : + Natural + , SIGQUIT : + Natural + , SIGILL : + Natural + , SIGABRT : + Natural + , SIGFPE : + Natural + , SIGKILL : + Natural + , SIGSEGV : + Natural + , SIGPIPE : + Natural + , SIGALRM : + Natural + , SIGTERM : + Natural + , SIGUSR1 : + Natural + , SIGUSR2 : + Natural + , SIGCHLD : + Natural + , SIGCONT : + Natural + , SIGSTOP : + Natural + , SIGTSTP : + Natural + , SIGTTIN : + Natural + , SIGTTOU : + Natural + } + +let POSIX2001 = + { SIGBUS : + Natural + , SIGPOLL : + Natural + , SIGPROF : + Natural + , SIGSYS : + Natural + , SIGTRAP : + Natural + , SIGURG : + Natural + , SIGVTALRM : + Natural + , SIGXCPU : + Natural + , SIGXFSZ : + Natural + } + +in POSIX1990 ⩓ POSIX2001 \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/common/x86-arm.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/common/x86-arm.dhall new file mode 100644 index 00000000..787afad9 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/common/x86-arm.dhall @@ -0,0 +1,35 @@ + ./standard.dhall + ⫽ { SIGUSR1 = + 10 + , SIGUSR2 = + 12 + , SIGCHLD = + 17 + , SIGCONT = + 18 + , SIGSTOP = + 19 + , SIGTSTP = + 20 + , SIGTTIN = + 21 + , SIGTTOU = + 22 + , SIGBUS = + 7 + , SIGPOLL = + 29 + , SIGPROF = + 27 + , SIGSYS = + 31 + , SIGURG = + 23 + , SIGVTALRM = + 26 + , SIGXCPU = + 24 + , SIGXFSZ = + 25 + } +: ./type.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/mips.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/mips.dhall new file mode 100644 index 00000000..63e071ba --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/mips.dhall @@ -0,0 +1 @@ +./common/mips.dhall ⫽ ./misc/mips.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/misc/alpha-sparc.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/misc/alpha-sparc.dhall new file mode 100644 index 00000000..2ce0b50d --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/misc/alpha-sparc.dhall @@ -0,0 +1,14 @@ + { SIGIOT = + 6 + , SIGEMT = + 7 + , SIGIO = + 23 + , SIGPWR = + 29 + , SIGINFO = + 29 + , SIGWINCH = + 28 + } +: ./common-type.dhall ⩓ { SIGEMT : Natural, SIGINFO : Natural } \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/misc/common-type.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/misc/common-type.dhall new file mode 100644 index 00000000..4f4cec9a --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/misc/common-type.dhall @@ -0,0 +1 @@ +{ SIGIOT : Natural, SIGIO : Natural, SIGPWR : Natural, SIGWINCH : Natural } \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/misc/mips.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/misc/mips.dhall new file mode 100644 index 00000000..ac07c128 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/misc/mips.dhall @@ -0,0 +1,14 @@ + { SIGIOT = + 6 + , SIGEMT = + 7 + , SIGIO = + 22 + , SIGCLD = + 18 + , SIGPWR = + 19 + , SIGWINCH = + 20 + } +: ./common-type.dhall ⩓ { SIGEMT : Natural, SIGCLD : Natural } \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/misc/x86-arm.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/misc/x86-arm.dhall new file mode 100644 index 00000000..36fdd842 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/misc/x86-arm.dhall @@ -0,0 +1,14 @@ + { SIGIOT = + 6 + , SIGSTKFLT = + 16 + , SIGIO = + 29 + , SIGPWR = + 30 + , SIGWINCH = + 28 + , SIGUNUSED = + 31 + } +: ./common-type.dhall ⩓ { SIGSTKFLT : Natural, SIGUNUSED : Natural } \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/sparc.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/sparc.dhall new file mode 100644 index 00000000..bdbad021 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/sparc.dhall @@ -0,0 +1 @@ +./alpha.dhall \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/type.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/type.dhall new file mode 100644 index 00000000..55f6540c --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/type.dhall @@ -0,0 +1,2 @@ +-- A signal is a positive number +Natural \ No newline at end of file diff --git a/pkgs/profpatsch/s6/dhall/unix/Signal/x86.dhall b/pkgs/profpatsch/s6/dhall/unix/Signal/x86.dhall new file mode 100644 index 00000000..7030dd27 --- /dev/null +++ b/pkgs/profpatsch/s6/dhall/unix/Signal/x86.dhall @@ -0,0 +1 @@ +./common/x86-arm.dhall ⫽ ./misc/x86-arm.dhall \ No newline at end of file -- cgit 1.4.1