summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-07-27 18:48:56 -0400
committerseth <[email protected]>2023-07-27 18:58:15 -0400
commit8912c18891adbd676655965981acb52ba00f2af9 (patch)
treebdd1c28a8dde40af4a45e0e0e7e2720f87387988
parent90365c6a81cde47871eedc15fa6f1589687a11f0 (diff)
flake: simplify checks/packages
-rw-r--r--flake.nix38
-rw-r--r--garnix.yaml4
-rw-r--r--pkgs/default.nix6
3 files changed, 14 insertions, 34 deletions
diff --git a/flake.nix b/flake.nix
index aeb0fc5..b377a37 100644
--- a/flake.nix
+++ b/flake.nix
@@ -30,7 +30,9 @@
"aarch64-darwin"
];
- forAllSystems = nixpkgs.lib.genAttrs systems;
+ inherit (nixpkgs) lib;
+
+ forAllSystems = lib.genAttrs systems;
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
@@ -52,46 +54,24 @@
formatter = forEachSystem (p: p.pkgs.alejandra);
- checks = let
- ciSystems = [
- "x86_64-linux"
- "aarch64-linux"
- ];
- in
- nixpkgs.lib.genAttrs ciSystems (sys: self.packages.${sys});
-
packages = forEachSystem (
{
pkgs,
system,
}: let
- inherit (builtins) attrNames elem filter listToAttrs map readDir substring;
- inherit (nixpkgs.lib) filterAttrs removeSuffix;
-
- # filter disabled pkgs
- avail =
- filter (p: substring 0 1 p != "_" && p != "default.nix")
- (attrNames (readDir ./pkgs));
-
- names = map (removeSuffix ".nix") avail;
-
p = let
- derivs = listToAttrs (map (name: {
- inherit name;
- value = pkgs.${name};
- })
- names);
+ packages = import ./pkgs pkgs;
in
- filterAttrs (_: v:
- elem system (v.meta.platforms or []) && !(v.meta.broken or false))
- derivs;
+ lib.filterAttrs (_: v:
+ builtins.elem system (v.meta.platforms or []) && !(v.meta.broken or false))
+ packages;
in
p // {default = p.treefetch;}
);
- lib = import ./lib nixpkgs.lib;
+ lib = import ./lib lib;
- overlays.default = import ./pkgs;
+ overlays.default = final: _: import ./pkgs final;
templates = let
# string -> string -> {}
diff --git a/garnix.yaml b/garnix.yaml
index 92f2c79..3d882b1 100644
--- a/garnix.yaml
+++ b/garnix.yaml
@@ -1,5 +1,5 @@
builds:
exclude: []
include:
- - "checks.x86_64-linux.*"
- - "checks.aarch64-linux.*"
+ - "packages.x86_64-linux.*"
+ - "packages.aarch64-linux.*"
diff --git a/pkgs/default.nix b/pkgs/default.nix
index db63d63..30241ee 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -1,12 +1,12 @@
-final: _: let
- inherit (final) callPackage;
+pkgs: let
+ inherit (pkgs) callPackage;
in {
# original packages
cfspeedtest = callPackage ./cfspeedtest.nix {};
check-pr = callPackage ./check-pr.nix {};
huion = callPackage ./huion.nix {};
mommy = callPackage ./mommy.nix {};
- theseus = callPackage ./theseus.nix {inherit (final.nodePackages) pnpm;};
+ theseus = callPackage ./theseus.nix {inherit (pkgs.nodePackages) pnpm;};
treefetch = callPackage ./treefetch.nix {};
swhkd = callPackage ./swhkd {};
vim-just = callPackage ./vim-just.nix {};