-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
538 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.services.infnoise; | ||
in { | ||
options = { | ||
services.infnoise = { | ||
enable = mkEnableOption "the Infinite Noise TRNG driver"; | ||
|
||
fillDevRandom = mkOption { | ||
description = '' | ||
Whether to run the infnoise driver as a daemon to refill /dev/random. | ||
If disabled, you can use the `infnoise` command-line tool to | ||
manually obtain randomness. | ||
''; | ||
type = types.bool; | ||
default = true; | ||
}; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
environment.systemPackages = [ pkgs.infnoise ]; | ||
|
||
services.udev.extraRules = '' | ||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", SYMLINK+="infnoise", TAG+="systemd", GROUP="dialout", MODE="0664", ENV{SYSTEMD_WANTS}="infnoise.service" | ||
''; | ||
|
||
systemd.services.infnoise = mkIf cfg.fillDevRandom { | ||
description = "Infinite Noise TRNG driver"; | ||
|
||
bindsTo = [ "dev-infnoise.device" ]; | ||
after = [ "dev-infnoise.device" ]; | ||
|
||
serviceConfig = { | ||
ExecStart = "${pkgs.infnoise}/bin/infnoise --dev-random --debug"; | ||
Restart = "always"; | ||
User = "infnoise"; | ||
DynamicUser = true; | ||
SupplementaryGroups = [ "dialout" ]; | ||
DeviceAllow = [ "/dev/infnoise" ]; | ||
DevicePolicy = "closed"; | ||
PrivateNetwork = true; | ||
ProtectSystem = "strict"; | ||
ProtectHome = true; | ||
ProtectHostname = true; | ||
ProtectKernelLogs = true; | ||
ProtectKernelModules = true; | ||
ProtectKernelTunables = true; # only reads entropy pool size and watermark | ||
RestrictNamespaces = true; | ||
RestrictRealtime = true; | ||
LockPersonality = true; | ||
MemoryDenyWriteExecute = true; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ lib | ||
, fetchurl | ||
, gdk-pixbuf | ||
, gobject-introspection | ||
, gtk3 | ||
, mcomix | ||
, python3 | ||
, testVersion | ||
, wrapGAppsHook | ||
|
||
# Recommended Dependencies: | ||
, lhasa | ||
, mupdf | ||
, p7zip | ||
, unrar | ||
, unrarSupport ? false # unfree software | ||
}: | ||
|
||
python3.pkgs.buildPythonApplication rec { | ||
pname = "mcomix"; | ||
version = "2.0.2"; | ||
|
||
src = fetchurl { | ||
url = "mirror://sourceforge/mcomix/${pname}-${version}.tar.gz"; | ||
sha256 = "sha256-7zjQcT5WoHxy+YzCDJ6s2ngOOfO4L9exuqBqacecClg="; | ||
}; | ||
|
||
buildInputs = [ gobject-introspection gtk3 gdk-pixbuf ]; | ||
nativeBuildInputs = [ wrapGAppsHook ]; | ||
propagatedBuildInputs = (with python3.pkgs; [ pillow pygobject3 pycairo ]); | ||
|
||
# Tests are broken | ||
doCheck = false; | ||
|
||
# Correct wrapper behavior, see https://github.com/NixOS/nixpkgs/issues/56943 | ||
# until https://github.com/NixOS/nixpkgs/pull/102613 | ||
strictDeps = false; | ||
|
||
# prevent double wrapping | ||
dontWrapGApps = true; | ||
|
||
preFixup = '' | ||
makeWrapperArgs+=( | ||
"''${gappsWrapperArgs[@]}" | ||
"--prefix" "PATH" ":" "${lib.makeBinPath ([ p7zip lhasa mupdf ] ++ lib.optional (unrarSupport) unrar)}" | ||
) | ||
''; | ||
|
||
passthru.tests.version = testVersion { | ||
package = mcomix; | ||
}; | ||
|
||
meta = with lib; { | ||
description = "Comic book reader and image viewer"; | ||
longDescription = '' | ||
User-friendly, customizable image viewer, specifically designed to handle | ||
comic books and manga supporting a variety of container formats | ||
(including CBR, CBZ, CB7, CBT, LHA and PDF) | ||
''; | ||
homepage = "https://sourceforge.net/projects/mcomix/"; | ||
license = licenses.gpl2Plus; | ||
maintainers = with maintainers; [ thiagokokada ]; | ||
}; | ||
} |
Oops, something went wrong.