Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate nitrokey-firmware into monorepo #90

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

11 changes: 8 additions & 3 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 @@ -54,15 +58,16 @@
};
explicitPkgs = import ./pkgs {
inherit (pkgs) lib;
inherit callPackage;
inherit callPackage inputs;
};
allPackages = pkgsByName // explicitPkgs;
in
allPackages;

importNixpkgs = system: overlays:
import nixpkgs {
inherit system overlays;
inherit system;
overlays = overlays ++ [rust-overlay.overlays.default];
};

importNixosConfigurations = import ./configs/all-configurations.nix;
Expand Down
16 changes: 16 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
{
lib,
callPackage,
inputs,
}: let
linuxSystem = "x86_64-linux";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lorenzleutgeb I'm not sure what to do with this. I'm quite sure I don't understand the overall structure of the flake and that's why I'm confused. I know it's documented with some comments, but I still don't get it. Perhaps I'll take another look. There's just too much passing of values around and I lose track.

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 +40,10 @@
pretalx-venueless
pretalx-public-voting
;
nitrokey-3 = callPackage ./nitrokey-firmware/nitrokey-3 {};
nitrokey-pro = callPackage ./nitrokey-firmware/nitrokey-pro.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.

42 changes: 0 additions & 42 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.

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

This file was deleted.

Loading