Skip to content

Commit

Permalink
nitrokey-firmware: migrate
Browse files Browse the repository at this point in the history
Co-authored-by: Auguste Baum <auguste.apple@gmail.com>
Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com>
  • Loading branch information
3 people committed Nov 14, 2023
1 parent 4e9f665 commit 6185b81
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 204 deletions.
24 changes: 24 additions & 0 deletions flake.lock

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

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

outputs = {
self,
nixpkgs,
flake-utils,
treefmt-nix,
sops-nix,
rust-overlay,
...
}:
} @ inputs:
with builtins; let
inherit
(nixpkgs.lib)
Expand Down Expand Up @@ -50,7 +54,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
File renamed without changes.
37 changes: 37 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
{
lib,
callPackage,
inputs,
}: let
linuxSystem = "x86_64-linux";

pkgsNitrokey = import inputs.nixpkgs {
system = linuxSystem;
};
pkgsWithRust = import inputs.nixpkgs {
system = linuxSystem;
overlays = [inputs.rust-overlay.overlays.default];
};
pkgsArm = import inputs.nixpkgs {
system = linuxSystem;
crossSystem.config = "arm-none-eabi";
};
pkgsAvr = import inputs.nixpkgs {
system = linuxSystem;
crossSystem.config = "avr";
};
stdenvArm = pkgsArm.stdenv;
stdenvAvr = pkgsAvr.stdenv;
self = rec {
# LiberaForms is intentionally disabled.
# Refer to <https://github.com/ngi-nix/ngipkgs/issues/40>.
Expand All @@ -28,6 +48,23 @@
pretalx-venueless
pretalx-public-voting
;
nitrokey-3 = callPackage ./nitrokey-firmware/nitrokey-3 (
let
rust = pkgsWithRust.rust-bin.stable.latest.default.override {
extensions = ["llvm-tools-preview"];
targets = ["thumbv8m.main-none-eabi"];
};
in {
rustPlatform = lib.recurseIntoAttrs (pkgsNitrokey.makeRustPlatform {
rustc = rust;
cargo = rust;
});
}
);
nitrokey-pro = callPackage ./nitrokey-firmware/nitrokey-pro.nix {inherit stdenvArm;};
nitrokey-fido2 = pkgsNitrokey.callPackage ./nitrokey-firmware/nitrokey-fido2.nix {inherit stdenvArm;};
nitrokey-start = callPackage ./nitrokey-firmware/nitrokey-start.nix {gcc11StdenvArm = pkgsArm.gcc11Stdenv;};
nitrokey-trng-rs232 = callPackage ./nitrokey-firmware/nitrokey-trng-rs232.nix {inherit stdenvAvr;};
};
in
self
1 change: 0 additions & 1 deletion pkgs/nitrokey-firmware/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions pkgs/nitrokey-firmware/LICENSE

This file was deleted.

43 changes: 0 additions & 43 deletions pkgs/nitrokey-firmware/README.md

This file was deleted.

82 changes: 0 additions & 82 deletions pkgs/nitrokey-firmware/flake.lock

This file was deleted.

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

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6185b81

Please sign in to comment.