Skip to content

Commit

Permalink
Add sae_pk_gen
Browse files Browse the repository at this point in the history
  • Loading branch information
42LoCo42 committed Apr 19, 2024
1 parent 76f90d0 commit 79a6e63
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 10 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ jobs:
substituters = https://42loco42.cachix.org https://cache.nixos.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= 42loco42.cachix.org-1:6HvWFER3RdTSqEZDznqahkqaoI6QCOiX2gRpMMsThiQ=
# - name: Enable Cachix
# uses: cachix/cachix-action@v14
# with:
# name: 42loco42
# authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Run CI
run: nix run .#ci
env:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ A personal collection of unusual things
|`prettier-plugin-go-template`|Fixes prettier formatting for go templates|https://github.com/NiklasPor/prettier-plugin-go-template|
|`pug`|Pug 3 CLI interface|https://github.com/tokilabs/pug3-cli|
|`redis-json`|RedisJSON - a JSON data type for Redis|https://github.com/RedisJSON/RedisJSON|
|`sae_pk_gen`|SAE-PK key generator|https://github.com/vanhoefm/hostap-wpa3|
|`samloader`|Download Samsung firmware from official servers|https://github.com/samloader/samloader|
|`wayland-shell`|Small-scale replacement of the GNOME Shell|https://github.com/nilsherzig/wayland-shell|
13 changes: 9 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

outputs = { self, nixpkgs, nce, nsc }:
let
inherit (nixpkgs.lib) mapAttrsToList pipe recursiveUpdate;

mkLanza030 = pkgs: import (pkgs.fetchFromGitHub {
owner = "nix-community";
repo = "lanzaboote";
Expand Down Expand Up @@ -50,6 +52,7 @@
prettier-plugin-go-template = pkgs.callPackage ./packages/prettier-plugin-go-template.nix { };
pug = pkgs.callPackage ./packages/pug { };
redis-json = pkgs.callPackage ./packages/redis-json { };
sae_pk_gen = pkgs.callPackage ./packages/sae_pk_gen.nix { };
samloader = pkgs.callPackage ./packages/samloader.nix { };
wayland-shell = pkgs.callPackage ./packages/wayland-shell.nix { inherit gtk4-layer-shell; };

Expand Down Expand Up @@ -93,7 +96,7 @@
mkPackageSet = system: { packages.${system} = mkPackages system; };

pkgs = import nixpkgs { system = "x86_64-linux"; };
merge = builtins.foldl' nixpkgs.lib.recursiveUpdate { };
merge = builtins.foldl' recursiveUpdate { };
in
merge [
(mkPackageSet "x86_64-linux")
Expand Down Expand Up @@ -122,7 +125,7 @@
inherit ((mkLanza030 pkgs).nixosModules) lanzaboote;
};

templates = let dir = ./templates; in nixpkgs.lib.pipe dir [
templates = let dir = ./templates; in pipe dir [
builtins.readDir
builtins.attrNames
(map (name: {
Expand All @@ -135,8 +138,8 @@
builtins.listToAttrs
];

readme = nixpkgs.lib.pipe self.packages.${pkgs.system} [
(nixpkgs.lib.mapAttrsToList (name: p:
readme = pipe self.packages.${pkgs.system} [
(mapAttrsToList (name: p:
"|`${name}`|${p.meta.description or ""}|${p.meta.homepage or ""}|"))
(builtins.concatStringsSep "\n")
(s: pkgs.writeText "readme"
Expand Down Expand Up @@ -164,6 +167,8 @@
| cachix push 42loco42
'';
};

foo = nixpkgs.lib.getExe self.packages.${pkgs.system}.sae_pk_gen;
}
];
}
31 changes: 31 additions & 0 deletions packages/sae_pk_gen.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ fetchFromGitHub, stdenv, pkg-config, openssl }:
stdenv.mkDerivation rec {
pname = "sae_pk_gen";
version = "72e2975";

src = fetchFromGitHub {
owner = "vanhoefm";
repo = "hostap-wpa3";
rev = version;
hash = "sha256-zveLNcZN7+L1iw3i9tq8fOgCh7VdMTg8B2PEoJ2fGwQ=";
};

nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];

buildPhase = ''
cd hostapd
cp defconfig .config
make -j $(nproc) ${pname}
'';

installPhase = ''
install -Dm755 ${pname} $out/bin/${pname}
'';

meta = {
mainProgram = pname;
description = "SAE-PK key generator";
homepage = "https://github.com/vanhoefm/hostap-wpa3";
};
}

0 comments on commit 79a6e63

Please sign in to comment.