Skip to content

Commit 3554d4f

Browse files
committed
refactor: move custom packages into flake
1 parent 85e23da commit 3554d4f

4 files changed

Lines changed: 99 additions & 13 deletions

File tree

.github/workflows/review.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ jobs:
139139
with:
140140
sparse-checkout: |
141141
.github/actions
142-
packages.nix
142+
flake.lock
143+
flake.nix
143144
144145
- name: setup nix
145146
uses: ./.github/actions/setup-nix
@@ -160,7 +161,7 @@ jobs:
160161
elif [[ ${{ inputs.push-to-cache && vars.CACHIX_CACHE != '' }} = true ]]; then
161162
pkgs+=(cachix)
162163
fi
163-
nix profile add -f packages.nix ${pkgs[@]}
164+
nix profile add "${pkgs[@]/#/.#}"
164165
165166
- name: clone nixpkgs
166167
uses: actions/checkout@v4

flake.lock

Lines changed: 80 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
11
{
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4+
nixpkgs-review.url = "github:Mic92/nixpkgs-review";
45
};
56

67
outputs =
7-
{ self, nixpkgs }:
8+
{
9+
self,
10+
nixpkgs,
11+
nixpkgs-review,
12+
}:
813

914
let
1015
inherit (nixpkgs) lib;
1116

12-
eachSystem = f: lib.genAttrs systems (s: f nixpkgs.legacyPackages.${s});
17+
eachSystem = f: lib.genAttrs systems (system: f (import nixpkgs { inherit system overlays; }));
1318
systems = [
1419
"x86_64-linux"
1520
"aarch64-linux"
1621
"x86_64-darwin"
1722
"aarch64-darwin"
1823
];
24+
25+
overlays = [ self.overlays.nixpkgs-review ];
1926
in
2027

2128
{
29+
overlays.nixpkgs-review = final: prev: {
30+
inherit (nixpkgs-review.packages.${final.system}) nixpkgs-review;
31+
};
32+
33+
legacyPackages = eachSystem lib.id;
34+
2235
formatter = eachSystem (
2336
pkgs:
2437
pkgs.treefmt.withConfig {
@@ -30,6 +43,7 @@
3043
);
3144

3245
checks = eachSystem (pkgs: {
46+
inherit (pkgs) nixpkgs-review;
3347
fmt = pkgs.runCommandNoCCLocal "fmt-check" { } ''
3448
cp -r --no-preserve=mode ${self} repo
3549
${lib.getExe self.formatter.${pkgs.system}} -C repo --ci

packages.nix

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)