Browse Source

nixos: add jitter_sponge entropy source

Share an entropy generator amount the systemd services. Would be nice to
have that virtio_rng driver.
remotes/server7/dabus
Emery Hemingway 1 year ago
parent
commit
3215190568
  1. 1
      nixos-modules/genode-core.nix
  2. 7
      nixos-modules/genode-init.nix
  3. 16
      nixos-modules/store-wrapper.dhall
  4. 14
      nixos-modules/systemd-runner.dhall
  5. 1
      nixos-modules/systemd.nix
  6. 4
      packages/genodelabs/depot-targets.nix
  7. 6
      packages/genodelabs/ports.nix

1
nixos-modules/genode-core.nix

@ -116,6 +116,7 @@ in {
++ (with pkgs.genodePackages; [
init
cached_fs_rom
jitter_sponge
report_rom
vfs
])));

7
nixos-modules/genode-init.nix

@ -41,11 +41,12 @@ in {
in Genode.Init::{
, routes =
[ Genode.Init.ServiceRoute.parent "File_system"
, Genode.Init.ServiceRoute.parent "Rtc"
, Genode.Init.ServiceRoute.parent "Timer"
, Genode.Init.ServiceRoute.parent "IRQ"
, Genode.Init.ServiceRoute.parent "IO_MEM"
, Genode.Init.ServiceRoute.parent "IO_PORT"
, Genode.Init.ServiceRoute.parent "IRQ"
, Genode.Init.ServiceRoute.parent "Rtc"
, Genode.Init.ServiceRoute.parent "Terminal"
, Genode.Init.ServiceRoute.parent "Timer"
]
}
'';

16
nixos-modules/store-wrapper.dhall

@ -39,6 +39,22 @@ in λ(subinit : Init.Type) →
, routes = [ Init.ServiceRoute.parent "IO_PORT" ]
}
)
, child
"jitter_sponge"
( Child.flat
Child.Attributes::{
, binary = "jitter_sponge"
, provides = [ "Terminal" ]
, config = Init.Config::{
, policies =
[ Init.Config.Policy::{
, service = "Terminal"
, label = Init.LabelSelector.suffix "entropy"
}
]
}
}
)
, child
"store_fs"
( Child.flat

14
nixos-modules/systemd-runner.dhall

@ -36,7 +36,8 @@ in λ ( params
let init =
Init::{
, routes = parentRoutes [ "Timer", "Rtc", "File_system" ]
, routes =
parentRoutes [ "File_system", "Rtc", "Terminal", "Timer" ]
, children = toMap
{ vfs =
Child.flat
@ -56,6 +57,13 @@ in λ ( params
( [ VFS.dir "pipes" [ VFS.leaf "pipe" ]
, VFS.leaf "log"
, VFS.leaf "null"
, VFS.leafAttrs
"terminal"
( toMap
{ name = "entropy"
, label = "entropy"
}
)
, VFS.leaf "rtc"
, VFS.leaf "zero"
]
@ -101,7 +109,7 @@ in λ ( params
, binary = "cached_fs_rom"
, provides = [ "ROM" ]
, resources = Genode.Init.Resources::{
, ram = Genode.units.MiB 16
, ram = Genode.units.MiB 32
}
, config = Init.Config::{
, policies =
@ -129,7 +137,7 @@ in λ ( params
, stdout = Some "/dev/log"
, stderr = Some "/dev/log"
, pipe = Some "/dev/pipes"
, rng = Some "/dev/random"
, rng = Some "/dev/entropy"
, rtc = Some "/dev/rtc"
, socket = Some "/dev/sockets"
, vfs = [ VFS.leaf "fs" ]

1
nixos-modules/systemd.nix

@ -43,7 +43,6 @@ with lib; {
libc
posix
vfs
vfs_jitterentropy
vfs_pipe
];
configFile = let

4
packages/genodelabs/depot-targets.nix

@ -101,6 +101,10 @@ in {
};
ipxe_nic_drv.portInputs = with ports; [ dde_ipxe ];
jbig2dec = { };
jitter_sponge = {
portInputs = with ports; [ jitterentropy xkcp ];
preConfigure = "cp -r ${self.worldSources} repos/world";
};
jpeg = { };
lan9118_nic_drv = { };
libarchive = { };

6
packages/genodelabs/ports.nix

@ -64,5 +64,11 @@ with pkgs;
nativeBuildInputs = [ iasl libxslt unzip yasm ];
};
x86emu.hash = "sha256-QY6OL+cDVjQ67JItP1rS4ufPRGZf43AZtWxwza/0q0w=";
xkcp = {
extraRepos = [ genodePackages.worldSources ];
hash = "sha256-oB7oFikCFnEtB/ZlV7Gayw3wNa0BU/vi7O5gfzeFGLg=";
nativeBuildInputs = [ libxslt ];
version = "cafc03";
};
zlib.hash = "sha256-j3JXN0f8thrPCvLhYHIPjbGa0t3iynQ/gO7KMlgljq0=";
}

Loading…
Cancel
Save