forked from
oeiuwq.com/den
Modular, context-aware and aspect-oriented dendritic Nix configurations.
Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/
1{ den, withSystem, ... }:
2let
3 testModule =
4 {
5 inputs',
6 lib,
7 self',
8 ...
9 }:
10 {
11 options.specialArgsTest = {
12 test-package = lib.mkOption { type = lib.types.package; };
13 neovim-package = lib.mkOption { type = lib.types.package; };
14 };
15
16 config.specialArgsTest = {
17 test-package = self'.packages.hello;
18 neovim-package = inputs'.neovim-nightly-overlay.packages.neovim;
19 };
20 };
21in
22{
23 flake-file.inputs.neovim-nightly-overlay = {
24 url = "github:nix-community/neovim-nightly-overlay";
25 inputs.nixpkgs.follows = "nixpkgs";
26 inputs.flake-parts.follows = "flake-parts";
27 };
28
29 den.default.includes = [
30 den._.self'
31 den._.inputs'
32 ];
33
34 den.aspects.rockhopper.nixos.imports = [ testModule ];
35 den.aspects.cam.homeManager.imports = [ testModule ];
36
37 flake.checks.x86_64-linux = withSystem "x86_64-linux" (
38 {
39 checkCond,
40 rockhopper,
41 cam,
42 self',
43 inputs',
44 ...
45 }:
46 {
47 special-args-self-nixos = checkCond "self' provides same package to nixos" (
48 rockhopper.config.specialArgsTest.test-package == self'.packages.hello
49 );
50
51 special-args-inputs-nixos = checkCond "inputs' provides same package to nixos" (
52 rockhopper.config.specialArgsTest.neovim-package == inputs'.neovim-nightly-overlay.packages.neovim
53 );
54
55 special-args-self-hm = checkCond "self' provides same package to home-manager" (
56 cam.config.specialArgsTest.test-package == self'.packages.hello
57 );
58
59 special-args-inputs-hm = checkCond "inputs' provides same package to home-manager" (
60 cam.config.specialArgsTest.neovim-package == inputs'.neovim-nightly-overlay.packages.neovim
61 );
62 }
63 );
64
65 perSystem =
66 { pkgs, ... }:
67 {
68 packages.hello = pkgs.hello;
69 };
70}