Skip to content

Commit

Permalink
Merge branches 'rosenpass', 'flarum' and 'update_flake_lock_action' i…
Browse files Browse the repository at this point in the history
…nto fix
  • Loading branch information
lorenzleutgeb committed Nov 4, 2023
4 parents b1d2a6a + 3f7bb28 + 6439206 + 887d3c8 commit bc0f45e
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 271 deletions.
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
in
mapAttrs (name: _:
pkgs.nixosTest (import (dir + "/${name}") {
inherit pkgs;
inherit (pkgs) lib;
modules = extendedModules;
configurations = importNixosConfigurations;
})) (readDir dir)
Expand Down
1 change: 0 additions & 1 deletion modules/all-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
#liberaforms = import ./liberaforms.nix;
flarum = import ./flarum.nix;
pretalx = import ./pretalx.nix;
rosenpass = import ./rosenpass.nix;
unbootable = import ./unbootable.nix;
}
178 changes: 0 additions & 178 deletions modules/rosenpass.nix

This file was deleted.

1 change: 1 addition & 0 deletions pkgs/by-name/flarum/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ php.buildComposerProject (finalAttrs: {
};

composerLock = ./composer.lock;
composerStrictValidation = false;
vendorHash = "sha256-G/EPHcvcppuyAC0MAzE11ZjlOSTlphQrHnO3yS4+j5g=";

meta = {
Expand Down
30 changes: 16 additions & 14 deletions pkgs/by-name/rosenpass-tools/package.nix
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
{
lib,
makeWrapper,
stdenv,
makeWrapper,
installShellFiles,
coreutils,
findutils,
gawk,
rosenpass,
wireguard-tools,
}:
stdenv.mkDerivation {
pname = "rosenpass-tools";
inherit (rosenpass) version src;
pname = "rosenpass-tools";

nativeBuildInputs = [makeWrapper];
nativeBuildInputs = [makeWrapper installShellFiles];

postInstall = let
rpDependencies = [
postInstall = ''
install -D $src/rp $out/bin/rp
installManPage $src/doc/rp.1
wrapProgram $out/bin/rp \
--prefix PATH : ${lib.makeBinPath [
coreutils
findutils
gawk
rosenpass
wireguard-tools
];
in ''
install -D $src/rp $out/bin/rp
install -D $src/doc/rp.1 $out/share/man/man1/rp.1
wrapProgram $out/bin/rp --prefix PATH : ${lib.makeBinPath rpDependencies}
]}
'';

meta = {
inherit (rosenpass.meta) homepage license maintainers;
description = rosenpass.meta.description + " This package contains `rp`, which is a script that wraps the `rosenpass` binary.";
};
meta =
rosenpass.meta
// {
description = "This package contains the Rosenpass tool `rp`, which is a script that wraps the `rosenpass` binary.";
mainProgram = "rp";
};
}
45 changes: 19 additions & 26 deletions pkgs/by-name/rosenpass/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,44 @@
nixosTests,
rustPlatform,
targetPlatform,
installShellFiles,
cmake,
libsodium,
pkg-config,
}:
rustPlatform.buildRustPackage rec {
pname = "rosenpass";
version = "0.2.0";
version = "unstable-2023-09-28";

src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
hash = "sha256-r7/3C5DzXP+9w4rp9XwbP+/NK1axIP6s3Iiio1xRMbk=";
rev = "b15f17133f8b5c3c5175b4cfd4fc10039a4e203f";
hash = "sha256-UXAkmt4VY0irLK2k4t6SW+SEodFE3CbX5cFbsPG0ZCo=";
};

cargoHash = "sha256-g2w3lZXQ3Kg3ydKdFs8P2lOPfIkfTbAF0MhxsJoX/E4=";
cargoHash = "sha256-N1DQHkgKgkDQ6DbgQJlpZkZ7AMTqX3P8R/cWr14jK2I=";

nativeBuildInputs = [
cmake # for oqs build in the oqs-sys crate
pkg-config # let libsodium-sys-stable find libsodium
pkg-config
rustPlatform.bindgenHook # for C-bindings in the crypto libs
installShellFiles
];

buildInputs = [libsodium];

# liboqs requires quite a lot of stack memory, thus we adjust
# Increase the default stack size picked for new threads (which is used
# by `cargo test`) to be _big enough_.
# Only set this value for the check phase (not as an environment variable for the derivation),
# because it is only required in this phase.
preCheck = "export RUST_MIN_STACK=${builtins.toString (8 * 1024 * 1024)}"; # 8 MiB

# nix defaults to building for aarch64 _without_ the armv8-a
# crypto extensions, but liboqs depends on these
preBuild =
lib.optionalString targetPlatform.isAarch
''NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -march=armv8-a+crypto"'';
preBuild = lib.optionalString targetPlatform.isAarch64 ''
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -march=armv8-a+crypto"
'';

postInstall = ''
installManPage doc/rosenpass.1
'';

preInstall = "install -D doc/rosenpass.1 $out/share/man/man1/rosenpass.1";
passthru.tests.rosenpass = nixosTests.rosenpass;

meta = with lib; {
description = "Build post-quantum-secure VPNs with WireGuard!";
Expand All @@ -53,15 +53,8 @@ rustPlatform.buildRustPackage rec {
*/
asl20
];
platforms = platforms.all;
maintainers = with maintainers;
[
andresnav
imincik
lorenzleutgeb
]
++ (with (import ../../maintainers/maintainers-list.nix); [augustebaum kubaneko]);
maintainers = with maintainers; [wucke13];
platforms = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"];
mainProgram = "rosenpass";
};

passthru.tests.rosenpass = nixosTests.rosenpass;
}
Loading

0 comments on commit bc0f45e

Please sign in to comment.