-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
946 lines (857 loc) · 34.9 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
{
description = "NAHO's dofiles";
inputs = {
agenix = {
inputs = {
darwin.follows = "";
home-manager.follows = "home-manager";
nixpkgs.follows = "nixpkgs";
systems.follows = "systems";
};
url = "github:ryantm/agenix";
};
dragon-xplr = {
flake = false;
url = "github:sayanarijit/dragon.xplr";
};
flake-utils = {
inputs.systems.follows = "systems";
url = "github:numtide/flake-utils";
};
git-hooks = {
inputs = {
flake-compat.follows = "";
nixpkgs-stable.follows = "git-hooks/nixpkgs";
nixpkgs.follows = "nixpkgs";
};
url = "github:cachix/git-hooks.nix";
};
home-manager = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/home-manager";
};
logo = {
inputs = {
flakeUtils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
preCommitHooks.follows = "git-hooks";
};
url = "github:trueNAHO/logo-nixos";
};
nix-alien = {
# The nix-index-database and nixpkgs inputs are not overridden to prevent
# version mismatches:
#
# > Overriding nix-alien inputs may cause mismatches between the
# > nix-index-database and nixpkgs, causing possibly incorrect results, so
# > it is unsupported.
# >
# > -- https://github.com/thiagokokada/nix-alien/blob/75c0c2d5eb1fdd2c5187c49888cab40b060605fa/README.md#nixos-installation-with-flakes
inputs = {
flake-compat.follows = "";
flake-utils.follows = "flake-utils";
};
url = "github:thiagokokada/nix-alien";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# TODO: Replace this fork with Nixpkgs once [1] is merged.
#
# [1]: https://github.com/NixOS/nixpkgs/pull/332341
nixpkgs-antora-lunr-extension.url = "github:trueNAHO/nixpkgs/antora-lunr-extension-init-at-1-0-0-alpha-8";
# pkgs.buildEnv fails with the following error due to the git-hooks
# derivation containing an empty file:
#
# The store path <PATH> is a file and can't be merged into an
# environment using pkgs.buildEnv!
#
# This fork resolves this issue.
#
# TODO: Replace this fork with Nixpkgs once [1] is merged.
#
# [1]: https://github.com/NixOS/nixpkgs/pull/325140
nixpkgs-build-env.url = "github:trueNAHO/nixpkgs/feat-pkgs-build-support-buildenv-builder-ignore-empty-paths-derivations-containing-an-empty-file";
# Lock the Hyprland package version to avoid Hyprland from being unable to
# launch.
#
# Resolving this input probably requires an upstream fix or updating the
# system-wide installed Hyprland package.
#
# TODO: Update the Hyprland package and remove this locked input.
nixpkgsHyprland.url = "github:nixos/nixpkgs/a58bc8ad779655e790115244571758e8de055e3d";
nixvim = {
inputs = {
devshell.follows = "";
flake-compat.follows = "";
git-hooks.follows = "";
home-manager.follows = "home-manager";
nix-darwin.follows = "";
nixpkgs.follows = "nixpkgs";
nuschtosSearch.follows = "";
treefmt-nix.follows = "";
};
url = "github:nix-community/nixvim";
};
stylix = {
inputs = {
flake-compat.follows = "";
flake-utils.follows = "flake-utils";
home-manager.follows = "home-manager";
nixpkgs.follows = "nixpkgs";
systems.follows = "systems";
};
url = "github:danth/stylix";
};
# Interface flake systems.
systems.url = "github:nix-systems/default";
tri-pane-xplr = {
flake = false;
url = "github:sayanarijit/tri-pane.xplr";
};
};
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system: let
lib = pkgs.lib.extend (
final: _:
import ./lib {
inherit inputs pkgs system;
lib = final;
pkgsHyprland = inputs.nixpkgsHyprland.legacyPackages.${system};
}
);
nixosOptionsDoc = {
nixosOptionsDoc = extraConfig:
pkgs.nixosOptionsDoc (extraConfig {
# This attribute set is expected contain all internal module
# options.
options =
(
let
name = "nixos-options-doc";
in
# TODO: Avoid Import From Derivation (IFD) by extracting the
# options without intermediate derivations.
(
lib.dotfiles.homeManagerConfiguration.homeManagerConfiguration
name
{}
# The lacking config attribute prevents evaluating
# full-blown Home Manager derivations, which increases
# performance and compatibility by not evaluating
# derivations for non-native architectures.
{
imports = [
home_configurations/private/full/imports.nix
];
}
)
.${name}
)
.options
.dotfiles;
});
transformOptions = {
declarations.documentation = let
declarationPrefix = toString ./.;
in
option: {
declarations =
map
(
declaration: let
declarationString = toString declaration;
declarationWithoutprefix =
lib.removePrefix
"${declarationPrefix}/"
declarationString;
in
lib.throwIfNot
(lib.hasPrefix declarationPrefix declarationString)
"declaration not in ${declarationPrefix}: ${declarationString}"
{
name = "<dotfiles/${declarationWithoutprefix}/default.nix>";
url = "https://github.com/trueNAHO/dotfiles/blob/master/${declarationWithoutprefix}/default.nix";
}
)
option.declarations;
};
visible.bool = option: {
visible = option.visible && option.type == "boolean";
};
};
};
pkgs = inputs.nixpkgs.legacyPackages.${system};
in {
checks = lib.dotfiles.mergeAttrsUnionOfDisjoint [
# This attribute set contains manually declared checks.
{
git-hooks = inputs.git-hooks.lib.${system}.run {
hooks = {
alejandra = {
enable = true;
settings.verbosity = "quiet";
};
deadnix.enable = true;
statix.enable = true;
typos = {
enable = true;
settings.exclude = "*.age";
};
yamllint.enable = true;
};
src = ./.;
};
}
# This attribute set contains all Home Manager configurations.
(
lib.mapAttrs'
(
name: value:
lib.nameValuePair
(
lib.removePrefix
(system + lib.dotfiles.homeManagerConfiguration.separator)
name
)
value.activationPackage
)
(
lib.filterAttrs
(name: _: lib.hasPrefix system name)
inputs.self.homeConfigurations
)
)
# This attribute set contains all packages.
#
# To maintain performance, this attribute set should not contain
# composed or aliased packages.
(
builtins.removeAttrs
inputs.self.packages.${system}
["checkWithoutStandalone"]
)
# This attribute set contains all
# inputs.self.checks.<SYSTEM>.standalone-<OPTION>-<VALUE> Home Manager
# activation packages generated from internal module options.
(
builtins.mapAttrs
(_: value: value.activationPackage)
(
let
homeManagerConfiguration = optionName: optionValue: let
optionNameSeparator = ".";
optionPath = lib.splitString optionNameSeparator optionName;
in
lib.dotfiles.homeManagerConfiguration.homeManagerConfiguration
(
builtins.concatStringsSep
lib.dotfiles.homeManagerConfiguration.separator
(
["standalone"]
++ lib.drop 1 optionPath
++ [(lib.boolToString optionValue)]
)
)
# Due to the upstream outputs.checks process making underlying
# derivation attributes inaccessible, the description and
# documentationDescription attributes are not declared here.
{}
(
# Due to the following error, the attribute sets are merged
# using lib.dotfiles.mergeAttrsMkMerge instead of
# lib.mkMerge:
#
# error: Module `:anon-1:anon-1' has an unsupported
# attribute `_type'. This is caused by introducing a
# top-level `config' or `options' attribute. Add
# configuration attributes immediately on the top level
# instead, or move all of them (namely: _type contents)
# into the explicit `config' attribute.
lib.dotfiles.mergeAttrsMkMerge
# Backtrack the optionName attribute set to declare itself
# and potentially necessary parent options to the same
# value.
#
# For example, the a.b.c.d.full option would declare itself
# and the following options, if available, to the same
# value, while importing their necessary dependencies:
#
# - a.b.c.d.enable
# - a.b.c.enable
# - a.b.enable
# - a.enable
#
# The backtracking only considers options named 'enable' to
# provide minimal working examples, while enabling
# potentially necessary parent modules.
(
map
(
option: let
name =
builtins.concatStringsSep
optionNameSeparator
option;
in
lib.optionalAttrs
(options ? ${name})
(
lib.setAttrByPath (["config"] ++ option) optionValue
// {
imports =
lib.flatten
options.${name}.declarations;
}
)
)
(
[optionPath]
++ lib.fix
(
self: count: list:
[(lib.take count list ++ ["enable"])]
++ (
if count > 1
then self (count - 1) list
else []
)
)
(builtins.length optionPath - 1)
optionPath
)
)
);
options =
(nixosOptionsDoc.nixosOptionsDoc (
parent:
parent
// {
# Extract boolean options as their entire space (false
# and true) can be trivially covered.
#
# Covering non-boolean options is non-trivial as they
# may impose arbitrary constraints on themselves.
transformOptions = option:
option
// nixosOptionsDoc.transformOptions.visible.bool
option;
}
))
.optionsNix;
in
lib.concatMapAttrs
(
name: _:
homeManagerConfiguration name false
// homeManagerConfiguration name true
)
options
)
)
];
devShells.default = pkgs.mkShell {
inherit (inputs.self.checks.${system}.git-hooks) shellHook;
packages = [
inputs.agenix.packages.${system}.default
inputs.home-manager.packages.${system}.default
inputs.self.checks.${system}.git-hooks.enabledPackages
inputs.self.packages.${system}.docs.nativeBuildInputs
pkgs.asciidoctor-with-extensions
pkgs.http-server
];
};
formatter = pkgs.alejandra;
packages = {
docs = let
out = "${placeholder "out"}/usr/share/doc";
in
pkgs.stdenv.mkDerivation {
buildPhase = let
antora = {
playbook = builtins.toFile "antora-playbook.json" (
builtins.toJSON {
content.sources = [{url = "~+";}];
runtime.log.failure_level = "warn";
site = {
robots = "allow";
start_page = "dotfiles::index.adoc";
title = "NAHO's dotfiles";
url = "https://truenaho.github.io/dotfiles";
};
ui.supplemental_files = "supplemental_ui";
urls.html_extension_style = "indexify";
}
);
uiBundle = pkgs.fetchurl {
hash = "sha256-7zcPsAsK/k43sJo5VZrekvKVNOpd8aMUwb9qMdG1cnE=";
name = "ui-bundle.zip";
url = "https://gitlab.com/antora/antora-ui-default/-/jobs/7377097942/artifacts/raw/build/ui-bundle.zip";
};
};
in ''
# The --to-dir and --ui-bundle-url options are not included in
# the playbook due to Antora and Nix limitations.
antora \
--cache-dir "$(mktemp --directory)" \
--extension "${inputs.nixpkgs-antora-lunr-extension.legacyPackages.${system}.antora-lunr-extension}" \
--to-dir "${out}" \
--ui-bundle-url "${antora.uiBundle}" \
"${antora.playbook}"
# Ensure sitemap.xml reproducibility by replacing build
# timestamps [1] with the last commit date.
#
# [1]: https://gitlab.com/antora/antora/-/issues/661
xq \
--in-place \
--xml-output \
".urlset.url[].lastmod = \"$(
date \
--date @${toString inputs.self.lastModified} \
--utc \
+"%Y-%m-%dT%H:%M:%S.%3NZ"
)\"" \
"${out}/sitemap.xml"
# These commands are not parallelized as execution order affects
# the sorting within ${out}/search-index.js.
{
svgo --folder "${out}" --multipass --recursive
fd \
--extension css \
--type f \
--unrestricted \
. "${out}" \
--exec cleancss --batch --batch-suffix ""
fd \
--extension js \
--type f \
--unrestricted \
. "${out}" \
--exec uglifyjs --in-situ
html-minifier \
--case-sensitive \
--collapse-boolean-attributes \
--collapse-inline-tag-whitespace \
--collapse-whitespace \
--conservative-collapse \
--decode-entities \
--file-ext css \
--file-ext html \
--input-dir "${out}" \
--minify-css true \
--minify-js true \
--minify-urls true \
--output-dir "${out}" \
--preserve-line-breaks \
--remove-attribute-quotes \
--remove-comments \
--remove-empty-attributes \
--remove-optional-tags \
--remove-redundant-attributes \
--remove-script-type-attributes \
--remove-style-link-type-attributes \
--remove-tag-whitespace \
--sort-attributes \
--sort-class-name \
--trim-custom-fragments
}
'';
meta = {
description = "Builds the documentation";
documentationDescription = ''
Builds the documentation.
[TIP]
====
To view the indexified documentation locally by launching a
local server with
xref:dev/contributing/development_environment/index.adoc[
`http-server`], run:
[,bash]
----
http-server result -c-1
----
****
> Although the site is viewable without a web server, you may
> still need to view your site through a web server to test
> certain features, such as indexified URLs, caching, or
> scripts that don’t work over the file: protocol.
>
> -- Antora, https://docs.antora.org/antora/3.1/preview-site
****
====
'';
};
name = "docs";
nativeBuildInputs = with pkgs; [
antora
clean-css-cli
fd
html-minifier
nodePackages.svgo
nodePackages.uglify-js
yq
];
# > The presence of the .nojekyll file at the root of the gh-pages
# > branch tells GitHub Pages not to run the published files
# > through Jekyll. The result is that your Antora-made site will
# > work as expected.
# >
# > -- https://docs.antora.org/antora/3.1/publish-to-github-pages
postInstall = ''touch "${out}/.nojekyll"'';
postPatch = let
git = lib.getExe pkgs.gitMinimal;
in ''
substitute_in_place() {
initial_content="$(<"$2")"
sed --in-place "$1" "$2"
if [[ "$initial_content" == "$(<"$2")" ]]; then
printf \
'%s\n' \
"No changes made by: 'sed --in-place \"$1\" \"$2\"'" \
>&2
exit 3
fi
}
substitute_to_file() {
initial_content="$(<"$2")"
sed "$1" "$2" >"$3"
if [[ "$initial_content" == "$(<"$3")" ]]; then
printf '%s\n' "No changes made by: 'sed \"$1\" \"$2\"'" >&2
exit 3
fi
}
# > In order to use a local content repository with Antora, even
# > when using the worktree (HEAD), the repository must have at
# > least one commit.
# >
# > -- https://docs.antora.org/antora/3.1/playbook/content-source-url
${git} init &&
${git} \
-c user.email="" \
-c user.name="name" \
commit \
--allow-empty \
--allow-empty-message \
--message ""
cp \
${inputs.logo.outputs.packages.${system}.default}/main.svg \
supplemental_ui/img/logo.svg
${
lib.concatMapStrings
(
let
sedCommand = title: file: let
header = let
header = type: title: ''^\/\/ -----${type} ${title}-----$'';
in {
begin = header "BEGIN" title;
end = header "END" title;
};
in ''
/${header.begin}/,/${header.end}/{
/${header.end}/r ${file}
d
}
'';
in
{
inputFile,
inputFileSedCommand ? null,
targetFile,
targetFileBlockTitle,
}:
if inputFileSedCommand == null
then ''
substitute_in_place "${
sedCommand
targetFileBlockTitle
inputFile
}" "${targetFile}"
''
else ''
file="$(mktemp)"
substitute_to_file \
${lib.escapeShellArg inputFileSedCommand} \
"${inputFile}" \
"$file"
substitute_in_place "${
sedCommand
targetFileBlockTitle
"$file"
}" "${targetFile}"
''
)
[
{
inputFile =
(
nixosOptionsDoc.nixosOptionsDoc (
parent:
parent
// {
transformOptions = option:
option
// nixosOptionsDoc.transformOptions.declarations.documentation
option;
}
)
)
.optionsAsciiDoc;
targetFile = "modules/ROOT/pages/user/options/index.adoc";
targetFileBlockTitle = "OPTIONS";
}
{
inputFile = builtins.toFile "overview" (
lib.concatLines (
builtins.attrValues (
builtins.mapAttrs
(
name: value: ''
${
lib.concatMapStrings
(
system: "{repository-blob}/home_configurations/${
let
splitName = lib.flatten (
builtins.split "(^[^-]*)-" name
);
in "${
builtins.elemAt splitName 1
}/${
builtins.elemAt splitName 2
}/default.nix"
}[`${
system
+ lib.dotfiles.homeManagerConfiguration.separator
+ name
}]`::\n"
)
inputs.flake-utils.lib.defaultSystems
}
+
--
${value.meta.documentationDescription}
====
${
lib.concatMapStrings
(
system: ''
[,bash, subs=attributes+]
----
{command-home-manager-switch-flake}${
system
+ lib.dotfiles.homeManagerConfiguration.separator
+ name
}
----
''
)
inputs.flake-utils.lib.defaultSystems
}
====
--
''
)
(
let
systemPrefix =
builtins.elemAt
inputs.flake-utils.lib.defaultSystems
0
+ lib.dotfiles.homeManagerConfiguration.separator;
in
lib.mapAttrs'
(
name:
lib.nameValuePair
(lib.removePrefix systemPrefix name)
)
(
lib.filterAttrs
(name: _: lib.hasPrefix systemPrefix name)
inputs.self.homeConfigurations
)
)
)
)
);
targetFile = "modules/ROOT/pages/user/home_manager_configurations/overview/index.adoc";
targetFileBlockTitle = "OVERVIEW";
}
{
inputFile = builtins.toFile "packages" "[horizontal]\n${
lib.concatLines (
builtins.attrValues (
builtins.mapAttrs
(
name: value: ''
[[${name}]]`${name}`::
+
--
${value.meta.documentationDescription}
====
[,bash, subs=attributes+]
----
nix build {repository-flake}#${name}
----
====
--
''
)
(
builtins.elemAt
(builtins.attrValues inputs.self.outputs.packages)
0
)
)
)
}";
targetFile = "modules/ROOT/pages/user/packages/index.adoc";
targetFileBlockTitle = "PACKAGES";
}
{
inputFile =
(
nixosOptionsDoc.nixosOptionsDoc (
parent:
parent
// {
# Due to context loss and expansion
# restrictions, these option transformations
# cannot be done in the transformOptions
# function.
options =
lib.mapAttrsRecursiveCond
# Leaves are determined under the assumption
# that option attribute sets contain at least
# one attribute that is not an attribute set.
(
value:
builtins.all
lib.isAttrs
(lib.attrValues value)
)
(
let
extraConfig = path: value: bool: let
boolString = lib.boolToString bool;
in {
description = ''
Standalone Home Manager configuration
setting the `${
builtins.concatStringsSep "." path
}` option and its parent `enable`
options to `${boolString}`.
'';
loc =
["standalone"]
++ lib.drop 1 value.loc
++ [boolString];
};
in
path: value: {
false =
value // extraConfig path value false;
true =
value // extraConfig path value true;
}
)
parent.options;
transformOptions = option:
option
// nixosOptionsDoc.transformOptions.declarations.documentation
option
//
# This attribute set should match the one used
# to generate the
# inputs.self.checks.<SYSTEM>.standalone-<OPTION>-<VALUE>
# Home Manager activation packages.
nixosOptionsDoc.transformOptions.visible.bool
option
// {
default = {};
example = {};
type = {};
};
}
)
)
.optionsAsciiDoc;
inputFileSedCommand = ''
/^==/ {
s/\./${lib.dotfiles.homeManagerConfiguration.separator}/g
}
'';
targetFile = "modules/ROOT/pages/user/checks/standalone/index.adoc";
targetFileBlockTitle = "STANDALONE";
}
]
}
'';
src = ./docs;
};
checkWithoutStandalone =
inputs.nixpkgs-build-env.legacyPackages.${system}.buildEnv
{
ignoreCollisions = true;
meta = {
description = "Lightweight 'nix flake check' alternative without standalone checks";
documentationDescription = ''
Lightweight xref:user/checks/index.adoc[`nix flake check`]
alternative without xref:user/checks/standalone/index.adoc[]
checks.
'';
};
name = "checkWithoutStandalone";
passthru.enableParallelBuilding = true;
paths = pkgs.lib.attrsets.attrValues (
lib.filterAttrs
(
name: _:
!lib.hasPrefix "standalone${
lib.dotfiles.homeManagerConfiguration.separator
}"
name
)
inputs.self.checks.${system}
);
};
};
}
)
//
# The outputs.homeConfigurations attribute set is not contained in
# inputs.flake-utils.lib.eachDefaultSystem to prevent the following invalid
# system key injection:
#
# outputs.homeConfigurations.${system}.<HOME_CONFIGURATION_NAME>
#
# Due to the lib.mkMerge function being unavailable in this scope, the
# outputs.homeConfigurations attribute set is expanded and merged with the
# inputs.flake-utils.lib.defaultSystems values using the less reliable '//'
# operator.
#
# Unlike inputs.flake-utils.lib.eachDefaultSystem, this implementation
# merely provides the system argument.
{
homeConfigurations =
builtins.foldl'
(
acc: system: let
lib = pkgs.lib.extend (
final: _:
import ./lib {
inherit inputs pkgs system;
lib = final;
pkgsHyprland = inputs.nixpkgsHyprland.legacyPackages.${system};
}
);
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
lib.attrsets.unionOfDisjoint acc (
import ./home_configurations {inherit lib system;}
)
)
{}
inputs.flake-utils.lib.defaultSystems;
};
}