alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
pkgs: filter by meta.platforms
author
lassulus
date
10 months ago
(Nov 27, 2025, 8:42 AM CET)
commit
44b92f32
44b92f3276781d266398b0cbbdb9d8d738aa4aef
parent
321fc735
321fc735e4bbd522d76d2608c1654717f150941d
+19
-14
1 changed file
Expand all
Collapse all
Unified
Split
5pkgs
flake-module.nix
+19
-14
5pkgs/flake-module.nix
View file
Reviewed
···
3
3
perSystem =
4
4
{ lib, pkgs, ... }:
5
5
{
6
6
-
packages = lib.mapAttrs (
7
7
-
name: _:
6
6
+
packages =
8
7
let
9
9
-
pkgDir = ./. + "/${name}";
10
10
-
hasPackageNix = builtins.pathExists (pkgDir + "/package.nix");
11
11
-
hasDefaultNix = builtins.pathExists (pkgDir + "/default.nix");
8
8
+
allPackages = lib.mapAttrs (
9
9
+
name: _:
10
10
+
let
11
11
+
pkgDir = ./. + "/${name}";
12
12
+
hasPackageNix = builtins.pathExists (pkgDir + "/package.nix");
13
13
+
hasDefaultNix = builtins.pathExists (pkgDir + "/default.nix");
14
14
+
in
15
15
+
if hasPackageNix then
16
16
+
pkgs.callPackage (pkgDir + "/package.nix") { }
17
17
+
else if hasDefaultNix then
18
18
+
builtins.trace "Warning: ${name} is using deprecated default.nix, please rename to package.nix" (
19
19
+
pkgs.callPackage pkgDir { }
20
20
+
)
21
21
+
else
22
22
+
throw "Package ${name} has neither package.nix nor default.nix"
23
23
+
) (lib.filterAttrs (_n: v: v == "directory") (builtins.readDir ./.));
12
24
in
13
13
-
if hasPackageNix then
14
14
-
pkgs.callPackage (pkgDir + "/package.nix") { }
15
15
-
else if hasDefaultNix then
16
16
-
builtins.trace "Warning: ${name} is using deprecated default.nix, please rename to package.nix" (
17
17
-
pkgs.callPackage pkgDir { }
18
18
-
)
19
19
-
else
20
20
-
throw "Package ${name} has neither package.nix nor default.nix"
21
21
-
) (lib.filterAttrs (_n: v: v == "directory") (builtins.readDir ./.));
25
25
+
# Filter packages based on meta.platforms
26
26
+
lib.filterAttrs (_name: pkg: lib.meta.availableOn pkgs.stdenv.hostPlatform pkg) allPackages;
22
27
};
23
28
}