Skip to content

Commit

Permalink
flake: use systems
Browse files Browse the repository at this point in the history
Make the flake externally extensible. Remove flake-utils to keep the
dependency tree lean.
  • Loading branch information
zimbatm committed May 9, 2023
1 parent 643d185 commit 6247172
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 37 deletions.
34 changes: 17 additions & 17 deletions flake.lock

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

35 changes: 15 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,24 @@
# To update all inputs:
# $ nix flake update --recreate-lock-file
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.systems.url = "github:nix-systems/default";

outputs = inputs:
inputs.flake-utils.lib.eachSystem [
"aarch64-darwin"
"aarch64-linux"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
]
(system:
let
pkgs = import inputs.self {
outputs = { self, nixpkgs, systems }:
let
eachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
legacyPackages = eachSystem (system:
import self {
inherit system;
inputs = null;
nixpkgs = inputs.nixpkgs.legacyPackages.${system};
};
in
{
legacyPackages = pkgs;
devShells.default = pkgs.fromTOML ./devshell.toml;
}
) // {
nixpkgs = nixpkgs.legacyPackages.${system};
}
);

devShells = eachSystem (system: {
default = self.legacyPackages.${system}.fromTOML ./devshell.toml;
});

templates = rec {
toml = {
Expand Down

0 comments on commit 6247172

Please sign in to comment.