mirror of
https://github.com/rosenpass/rosenpass.git
synced 2025-12-05 20:40:02 -08:00
This implicates a change from nixpkgs-fmt to nixfmt. Nixfmt will become the new standard on nix formatting, sanctioned by the nixpkgs. To verify that these changes are purely in whitespace, but not semantic: git diff --ignore-all-space -w HEAD^! That will only show newline changes, make the diffing somewhat easier. Signed-off-by: wucke13 <wucke13+github@gmail.com>
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
system,
|
|
runCommand,
|
|
rosenpass,
|
|
rpm,
|
|
}:
|
|
|
|
let
|
|
splitVersion = lib.strings.splitString "-" rosenpass.version;
|
|
version = builtins.head splitVersion;
|
|
release = if builtins.length splitVersion != 2 then "release" else builtins.elemAt splitVersion 1;
|
|
arch = builtins.head (builtins.split "-" system);
|
|
in
|
|
|
|
runCommand "rosenpass-${version}.rpm" { } ''
|
|
mkdir -p rpmbuild/SPECS
|
|
|
|
cat << EOF > rpmbuild/SPECS/rosenpass.spec
|
|
Name: rosenpass
|
|
Release: ${release}
|
|
Version: ${version}
|
|
Summary: Post-quantum-secure VPN key exchange
|
|
License: Apache-2.0
|
|
|
|
%description
|
|
Post-quantum-secure VPN tool Rosenpass
|
|
Rosenpass is a post-quantum-secure VPN
|
|
that uses WireGuard to transport the actual data.
|
|
|
|
%files
|
|
/usr/bin/rosenpass
|
|
/usr/bin/rp
|
|
/etc/systemd/system/rosenpass.target
|
|
/etc/systemd/system/rosenpass@.service
|
|
/etc/systemd/system/rp@.service
|
|
/etc/rosenpass/example.toml
|
|
EOF
|
|
|
|
buildroot=rpmbuild/BUILDROOT/rosenpass-${version}-${release}.${arch}
|
|
mkdir -p $buildroot/usr/bin
|
|
install -m755 -t $buildroot/usr/bin ${rosenpass}/bin/*
|
|
|
|
mkdir -p $buildroot/etc/rosenpass
|
|
cp -r ${rosenpass}/lib/systemd $buildroot/etc/
|
|
chmod -R 744 $buildroot/etc/systemd
|
|
cp ${./example.toml} $buildroot/etc/rosenpass/example.toml
|
|
|
|
export HOME=/build
|
|
mkdir -p /build/tmp
|
|
ls -R rpmbuild
|
|
|
|
${rpm}/bin/rpmbuild \
|
|
-bb \
|
|
--dbpath=$HOME \
|
|
--define "_tmppath /build/tmp" \
|
|
rpmbuild/SPECS/rosenpass.spec
|
|
|
|
cp rpmbuild/RPMS/${arch}/rosenpass*.rpm $out
|
|
''
|