diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-08-08 16:04:42 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-08-13 06:35:37 +0000 |
commit | 12aaa58dac35800b5b7d77f81cf2a87c21ee55da (patch) | |
tree | be0add9e5c22a85d20b5d78206aa74f956eb2a1b /nixpkgs/pkgs/os-specific/linux/esdm/default.nix | |
parent | 45892a5591202f75a1c2f1ca7c62a92c7566e3c5 (diff) | |
parent | 5a8e9243812ba528000995b294292d3b5e120947 (diff) | |
download | nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.gz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.bz2 nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.lz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.xz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.zst nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.zip |
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/pkgs/applications/window-managers/sway/default.nix nixpkgs/pkgs/build-support/go/module.nix nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix nixpkgs/pkgs/development/libraries/mesa/default.nix nixpkgs/pkgs/servers/dict/dictd-db.nix Link: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/issues/391
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/esdm/default.nix')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/esdm/default.nix | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/esdm/default.nix b/nixpkgs/pkgs/os-specific/linux/esdm/default.nix new file mode 100644 index 000000000000..42e20981872f --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/esdm/default.nix @@ -0,0 +1,87 @@ +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, protobufc +, pkg-config +, fuse3 +, meson +, ninja +, libselinux +, jitterentropy + # A more detailed explaination of the following meson build options can be found + # in the source code of esdm. + # A brief explanation is given: +, selinux ? false # enable selinux support +, drngHashDrbg ? true # set the default drng callback +, drngChaCha20 ? false # set the default drng callback +, ais2031 ? false # set the seeding strategy to be compliant with AIS 20/31 +, linuxDevFiles ? true # enable linux /dev/random and /dev/urandom support +, linuxGetRandom ? true # enable linux getrandom support +, esJitterRng ? true # enable support for the entropy source: jitter rng +, esCPU ? true # enable support for the entropy source: cpu-based entropy +, esKernel ? true # enable support for the entropy source: kernel-based entropy +, esIRQ ? false # enable support for the entropy source: interrupt-based entropy +, esSched ? false # enable support for the entropy source: scheduler-based entropy +, esHwrand ? true # enable support for the entropy source: /dev/hwrng +, hashSha512 ? false # set the conditioning hash: SHA2-512 +, hashSha3_512 ? true # set the conditioning hash: SHA3-512 +}: + +assert drngHashDrbg != drngChaCha20; +assert hashSha512 != hashSha3_512; + +stdenv.mkDerivation rec { + pname = "esdm"; + version = "0.6.0"; + + src = fetchFromGitHub { + owner = "smuellerDD"; + repo = "esdm"; + rev = "v${version}"; + sha256 = "sha256-swBKVb5gnND76w2ULT+5hR/jVOqxEe4TAB1gyaLKE9Q="; + }; + + patches = [ + (fetchpatch { + name = "arm64.patch"; + url = "https://github.com/smuellerDD/esdm/commit/86b93a0ddf684448aba152c8f1b3baf40a6d41c0.patch"; + sha256 = "sha256-gjp13AEsDNj23fcGanAAn2KCbYKA0cphhf4mCxek9Yg="; + }) + ]; + + nativeBuildInputs = [ meson pkg-config ninja ]; + buildInputs = [ protobufc fuse3 jitterentropy ] + ++ lib.optional selinux libselinux; + + mesonFlags = [ + (lib.mesonBool "b_lto" false) + (lib.mesonBool "ais2031" ais2031) + (lib.mesonEnable "linux-devfiles" linuxDevFiles) + (lib.mesonEnable "linux-getrandom" linuxGetRandom) + (lib.mesonEnable "es_jent" esJitterRng) + (lib.mesonEnable "es_cpu" esCPU) + (lib.mesonEnable "es_kernel" esKernel) + (lib.mesonEnable "es_irq" esIRQ) + (lib.mesonEnable "es_sched" esSched) + (lib.mesonEnable "es_hwrand" esHwrand) + (lib.mesonEnable "hash_sha512" hashSha512) + (lib.mesonEnable "hash_sha3_512" hashSha3_512) + (lib.mesonEnable "selinux" selinux) + (lib.mesonEnable "drng_hash_drbg" drngHashDrbg) + (lib.mesonEnable "drng_chacha20" drngChaCha20) + ]; + + doCheck = true; + + strictDeps = true; + mesonBuildType = "release"; + + meta = { + homepage = "https://www.chronox.de/esdm.html"; + description = "Entropy Source and DRNG Manager in user space"; + license = with lib.licenses; [ gpl2Only bsd3 ]; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ orichter thillux ]; + }; +} |