Compare commits
No commits in common. "4586c00f4e7bad8991c75cd9252b22b5fd56a4bc" and "fc1f1b328b00c063200c13fd895d8c6b0654657b" have entirely different histories.
4586c00f4e
...
fc1f1b328b
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v20
|
||||
- uses: cachix/install-nix-action@v19
|
||||
- name: Check ${{ matrix.check }}
|
||||
# Depends on nixos/nix#7759 to simply `nix flake check`
|
||||
run: nix run .#checks.$(nix eval --raw --impure --expr "builtins.currentSystem").${{ matrix.check }}
|
||||
@ -45,7 +45,7 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install nix
|
||||
uses: cachix/install-nix-action@v20
|
||||
uses: cachix/install-nix-action@v19
|
||||
- name: Show nixpkgs version
|
||||
run: nix eval --impure --expr '(import ./flake-compat.nix { src = ./.; }).lib.version'
|
||||
- name: Setup cachix
|
||||
|
2
.github/workflows/update.yml
vendored
2
.github/workflows/update.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v20
|
||||
- uses: cachix/install-nix-action@v19
|
||||
with:
|
||||
extra_nix_config: |
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
|
@ -1,10 +0,0 @@
|
||||
{ pkgs, lib ? pkgs.lib, unitDir ? "unit", packageFun ? "package.nix", root ? "${./pkgs}/${unitDir}" }:
|
||||
let
|
||||
shards = lib.attrNames (builtins.readDir root);
|
||||
namesForShard = shard: lib.mapAttrs'
|
||||
(name: _: { inherit name; value = "${root}/${shard}/${name}"; })
|
||||
(builtins.readDir "${root}/${shard}");
|
||||
namesToPath = lib.foldl' lib.recursiveUpdate { } (map namesForShard shards);
|
||||
units = lib.mapAttrs (_: path: pkgs.callPackage "${path}/${packageFun}" { }) namesToPath;
|
||||
in
|
||||
units
|
@ -9,9 +9,9 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
import ./pkgs/top-level/all-packages.nix { inherit pkgs; }
|
||||
// {
|
||||
// {
|
||||
# The `lib`, `modules`, and `overlay` names are special
|
||||
lib = import ./lib { inherit pkgs; }; # functions
|
||||
modules = import ./modules; # NixOS modules
|
||||
overlays = import ./overlays; # nixpkgs overlays
|
||||
} // import ./callUnitRoot.nix { inherit pkgs; }
|
||||
}
|
||||
|
14
flake.nix
14
flake.nix
@ -20,11 +20,23 @@
|
||||
# Unstable names are variables.
|
||||
packages =
|
||||
let
|
||||
unitDir = "unit";
|
||||
packageFun = "package.nix";
|
||||
|
||||
callUnitRoot = root:
|
||||
let
|
||||
shards = lib.attrNames (builtins.readDir root);
|
||||
namesForShard = shard: lib.mapAttrs'
|
||||
(name: _: { inherit name; value = "${root}/${shard}/${name}"; })
|
||||
(builtins.readDir "${root}/${shard}");
|
||||
namesToPath = lib.foldl' lib.recursiveUpdate { } (map namesForShard shards);
|
||||
units = lib.mapAttrs (_: path: pkgs.callPackage "${path}/${packageFun}" { }) namesToPath;
|
||||
in
|
||||
units;
|
||||
legacyPackages = import ./pkgs/top-level/all-packages.nix { inherit pkgs; };
|
||||
onlyAvailable = lib.filterAttrs (_: drv: builtins.elem system (drv.meta.platforms or [ ]));
|
||||
in
|
||||
onlyAvailable (legacyPackages // import ./callUnitRoot.nix { inherit pkgs; });
|
||||
onlyAvailable (legacyPackages // callUnitRoot "${./pkgs}/${unitDir}");
|
||||
|
||||
checks = {
|
||||
nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
|
||||
|
Loading…
Reference in New Issue
Block a user