Skip to content

Commit

Permalink
Add "nix fmt" formatter, rework flake slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfullmer committed Nov 18, 2024
1 parent 690f531 commit ad69104
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
6 changes: 0 additions & 6 deletions ci/formatting.nix

This file was deleted.

24 changes: 16 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
let
inherit (nixpkgs) lib;

allSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
pkgs = nixpkgs.legacyPackages.${system};
inherit system;
});

installer_minimal_config = {
imports = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
Expand Down Expand Up @@ -77,14 +83,16 @@
};
};

checks = nixpkgs.lib.mapAttrs
(system: _: {
formatting = nixpkgs.legacyPackages.${system}.callPackage ./ci/formatting.nix { };
})
self.legacyPackages;
checks = forAllSystems ({ pkgs, ... }: {
formatting = pkgs.runCommand "repo-formatting" { nativeBuildInputs = with pkgs; [ nixpkgs-fmt ]; } ''
nixpkgs-fmt --check ${self} && touch $out
'';
});

formatter = forAllSystems ({ pkgs, ... }: pkgs.nixpkgs-fmt);

# Not everything here should be cross-compiled to aarch64-linux
legacyPackages.x86_64-linux = (import nixpkgs { system = "x86_64-linux"; overlays = [ self.overlays.default ]; }).nvidia-jetpack;
legacyPackages.aarch64-linux = (import nixpkgs { system = "aarch64-linux"; overlays = [ self.overlays.default ]; }).nvidia-jetpack;
legacyPackages = forAllSystems ({ system, ... }:
(import nixpkgs { inherit system; overlays = [ self.overlays.default ]; }).nvidia-jetpack
);
};
}

0 comments on commit ad69104

Please sign in to comment.