Skip to content

Commit

Permalink
nitrokey-firmware: migrate to monorepo
Browse files Browse the repository at this point in the history
Co-authored-by: Auguste Baum <auguste.apple@gmail.com>
  • Loading branch information
alejandrosame and augustebaum committed Oct 27, 2023
1 parent 3deb6e1 commit f92f5bb
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 169 deletions.
57 changes: 56 additions & 1 deletion flake.lock

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

6 changes: 4 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
inputs.flake-utils.inputs.systems.follows = "systems";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
inputs.sops-nix.url = "github:Mic92/sops-nix";
inputs.sops-nix.inputs.nixpkgs.follows = "nixpkgs";

Expand All @@ -20,7 +22,7 @@
treefmt-nix,
sops-nix,
...
}:
} @ inputs:
with builtins; let
inherit
(nixpkgs.lib)
Expand Down Expand Up @@ -50,7 +52,7 @@
inherit (pkgs) lib;
inherit callPackage;
};
result = (import ./pkgs/by-name args) // (import ./pkgs args);
result = (import ./pkgs/by-name args) // (import ./pkgs (args // {inherit inputs;}));
in
result;

Expand Down
13 changes: 13 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
lib,
callPackage,
inputs,
}: let
self = rec {
# LiberaForms is intentionally disabled.
Expand Down Expand Up @@ -28,6 +29,18 @@
pretalx-venueless
pretalx-public-voting
;

# Broken packages:
# - nitrokey-3
# - nitrokey-fido2

inherit
(lib.recurseIntoAttrs (callPackage ./nitrokey-firmware {inherit inputs;}))
nitrokey-storage
nitrokey-pro
nitrokey-start
nitrokey-trng-rs232
;
};
in
self
1 change: 0 additions & 1 deletion pkgs/nitrokey-firmware/.gitignore

This file was deleted.

35 changes: 35 additions & 0 deletions pkgs/nitrokey-firmware/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{inputs}: let
system = "x86_64-linux";
overlays = [inputs.rust-overlay.overlays.default];
pkgs = import inputs.nixpkgs {
inherit system overlays;
};
pkgsArm = import inputs.nixpkgs {
inherit system overlays;
crossSystem.config = "arm-none-eabi";
config.allowUnfree = true; # nitrokey-fido2 → pynitrokey → nrfutil
};
pkgsAvr = import inputs.nixpkgs {
inherit system overlays;
crossSystem.config = "avr";
};
in {
nitrokey-3 = pkgs.callPackage ./devices/nitrokey-3.nix (
let
rust = pkgs.rust-bin.stable.latest.default.override {
extensions = ["llvm-tools-preview"];
targets = ["thumbv8m.main-none-eabi"];
};
in {
rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform {
rustc = rust;
cargo = rust;
});
}
);
nitrokey-storage = pkgs.callPackage ./devices/nitrokey-storage.nix {};
nitrokey-fido2 = pkgsArm.callPackage ./devices/nitrokey-fido2.nix {};
nitrokey-pro = pkgsArm.callPackage ./devices/nitrokey-pro.nix {};
nitrokey-start = pkgsArm.callPackage ./devices/nitrokey-start.nix {};
nitrokey-trng-rs232 = pkgsAvr.callPackage ./devices/nitrokey-trng-rs232.nix {};
}
96 changes: 0 additions & 96 deletions pkgs/nitrokey-firmware/flake.lock

This file was deleted.

49 changes: 0 additions & 49 deletions pkgs/nitrokey-firmware/flake.nix

This file was deleted.

20 changes: 0 additions & 20 deletions pkgs/nitrokey-firmware/overlay.nix

This file was deleted.

0 comments on commit f92f5bb

Please sign in to comment.