Skip to content

Commit

Permalink
feat: add fixed fido2luks as flake input
Browse files Browse the repository at this point in the history
Allow for Nitrokey 3A NFC support via a forked fido2luks
See shimunn/fido2luks#51 for details.
  • Loading branch information
savau committed Apr 10, 2024
1 parent 1277998 commit f5adace
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 5 deletions.
91 changes: 90 additions & 1 deletion flake.lock

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

13 changes: 11 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
#inputs.nixpkgs.url = "nixpkgs";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

outputs = { self, nixpkgs, ... }:
# use fido2luks fork for Nitrokey 3A NFC support
# see also: https://github.com/shimunn/fido2luks/issues/51
inputs.fido2luks.url = "github:savau/fido2luks";

outputs = { self, nixpkgs, fido2luks, ... }:
let
supportedSystems = [
"x86_64-linux"
Expand All @@ -24,7 +28,12 @@
};
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { inherit system overlays; };
overlays = [
(final: prev: {
fido2luks = fido2luks.packages.${system}.fido2luks;
})
];
in
{
disko = pkgs.callPackage ./package.nix { };
Expand Down
4 changes: 2 additions & 2 deletions package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenvNoCC, makeWrapper, lib, path, nix, coreutils }:
{ stdenvNoCC, makeWrapper, lib, path, nix, coreutils, fido2luks }:

stdenvNoCC.mkDerivation (finalAttrs: {
name = "disko";
Expand All @@ -14,7 +14,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
sed -e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" "$i" > "$out/bin/$i"
chmod 755 "$out/bin/$i"
wrapProgram "$out/bin/$i" \
--prefix PATH : ${lib.makeBinPath [ nix coreutils ]} \
--prefix PATH : ${lib.makeBinPath [ nix coreutils fido2luks ]} \
--prefix NIX_PATH : "nixpkgs=${path}"
done
'';
Expand Down

0 comments on commit f5adace

Please sign in to comment.