mv nix/ci.nix
directly to default.nix
This commit is contained in:
parent
127cb25bd1
commit
f254304796
31
default.nix
31
default.nix
|
@ -1,8 +1,31 @@
|
||||||
let
|
let
|
||||||
inherit (default.inputs.nixos) lib;
|
inherit (default.inputs.nixos) lib;
|
||||||
|
|
||||||
default = (import ./lib/compat).defaultNix;
|
default = (import "${./lib}/compat").defaultNix;
|
||||||
|
|
||||||
|
ciSystems = [
|
||||||
|
"aarch64-linux"
|
||||||
|
"i686-linux"
|
||||||
|
"x86_64-linux"
|
||||||
|
];
|
||||||
|
|
||||||
|
filterSystems = lib.filterAttrs
|
||||||
|
(system: _: lib.elem system ciSystems);
|
||||||
|
|
||||||
|
recurseIntoAttrsRecursive = lib.mapAttrs (_: v:
|
||||||
|
if lib.isAttrs v
|
||||||
|
then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v)
|
||||||
|
else v
|
||||||
|
);
|
||||||
|
|
||||||
|
systemOutputs = lib.filterAttrs
|
||||||
|
(name: set: lib.isAttrs set
|
||||||
|
&& lib.any
|
||||||
|
(system: set ? ${system} && name != "legacyPackages")
|
||||||
|
ciSystems
|
||||||
|
)
|
||||||
|
default.outputs;
|
||||||
|
|
||||||
|
ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs;
|
||||||
in
|
in
|
||||||
builtins.mapAttrs (_: v: lib.recurseIntoAttrs v) default.packages // {
|
(recurseIntoAttrsRecursive ciDrvs) // { shell = import ./shell.nix; }
|
||||||
shell = import ./shell.nix;
|
|
||||||
}
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ binary cache (and of course you do), be sure _not_ to skip the
|
||||||
[binary-caches.json][cache].
|
[binary-caches.json][cache].
|
||||||
|
|
||||||
## Ready to Use
|
## Ready to Use
|
||||||
The repo is already set up with the proper _nix/ci.nix_ file, building all
|
The repo is already set up with the proper _default.nix_ file, building all
|
||||||
declared packages, checks, profiles and shells. So you can see if something
|
declared packages, checks, profiles and shells. So you can see if something
|
||||||
breaks, and never build the same package twice!
|
breaks, and never build the same package twice!
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
let
|
let
|
||||||
inherit (lock.nodes.flake-compat.locked) rev narHash;
|
inherit (lock.nodes.flake-compat.locked) rev narHash;
|
||||||
|
|
||||||
lock = builtins.fromJSON (builtins.readFile ../../flake.lock);
|
lock = builtins.fromJSON (builtins.readFile "${../..}/flake.lock");
|
||||||
flake = (import
|
flake = (import
|
||||||
(
|
(
|
||||||
fetchTarball {
|
fetchTarball {
|
||||||
|
|
31
nix/ci.nix
31
nix/ci.nix
|
@ -1,31 +0,0 @@
|
||||||
let
|
|
||||||
inherit (default.inputs.nixos) lib;
|
|
||||||
|
|
||||||
default = (import "${../lib}/compat").defaultNix;
|
|
||||||
|
|
||||||
ciSystems = [
|
|
||||||
"aarch64-linux"
|
|
||||||
"i686-linux"
|
|
||||||
"x86_64-linux"
|
|
||||||
];
|
|
||||||
|
|
||||||
filterSystems = lib.filterAttrs
|
|
||||||
(system: _: lib.elem system ciSystems);
|
|
||||||
|
|
||||||
recurseIntoAttrsRecursive = lib.mapAttrs (_: v:
|
|
||||||
if lib.isAttrs v
|
|
||||||
then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v)
|
|
||||||
else v
|
|
||||||
);
|
|
||||||
|
|
||||||
systemOutputs = lib.filterAttrs
|
|
||||||
(name: set: lib.isAttrs set
|
|
||||||
&& lib.any
|
|
||||||
(system: set ? ${system} && name != "legacyPackages")
|
|
||||||
ciSystems
|
|
||||||
)
|
|
||||||
default.outputs;
|
|
||||||
|
|
||||||
ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs;
|
|
||||||
in
|
|
||||||
recurseIntoAttrsRecursive ciDrvs
|
|
Loading…
Reference in a new issue