chore: Use nixfmt reformat all nix source code

This commit is contained in:
ulic-youthlic 2026-07-04 23:11:21 +08:00
parent 1cdf00cefe
commit 11337b8f9e
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
184 changed files with 2349 additions and 1943 deletions

View file

@ -4,42 +4,44 @@
self,
rootPath,
...
}: let
}:
let
inherit (self) outputs;
homeModules =
(
with lib;
pipe (rootPath + "/home") [
builtins.readDir
(filterAttrs (_key: value: value == "directory"))
(filterAttrs (
key: _value:
!builtins.elem key [
"modules"
"extra"
]
))
builtins.attrNames
(flip genAttrs (name: import (rootPath + "/home/${name}/modules")))
]
pipe (rootPath + "/home") [
builtins.readDir
(filterAttrs (_key: value: value == "directory"))
(filterAttrs (
key: _value:
!builtins.elem key [
"modules"
"extra"
]
))
builtins.attrNames
(flip genAttrs (name: import (rootPath + "/home/${name}/modules")))
]
)
// {
default = import "${toString rootPath}/home/modules";
extra = import "${toString rootPath}/home/extra";
};
makeHomeConfiguration = {
hostName,
unixName ? "david",
system ? "x86_64-linux",
nixpkgs ? inputs.nixpkgs,
home-manager ? inputs.home-manager,
}: {
"${unixName}@${hostName}" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
localSystem = {inherit system;};
};
modules =
[
makeHomeConfiguration =
{
hostName,
unixName ? "david",
system ? "x86_64-linux",
nixpkgs ? inputs.nixpkgs,
home-manager ? inputs.home-manager,
}:
{
"${unixName}@${hostName}" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
localSystem = { inherit system; };
};
modules = [
(rootPath + "/home/${unixName}/configurations/${hostName}")
]
++ (with homeModules; [
@ -51,30 +53,32 @@
]
++ [
{
lib = {inherit (lib) youthlic;};
lib = { inherit (lib) youthlic; };
}
];
extraSpecialArgs = {
inherit
inputs
outputs
unixName
hostName
system
rootPath
;
extraSpecialArgs = {
inherit
inputs
outputs
unixName
hostName
system
rootPath
;
};
};
};
};
in {
in
{
flake = {
homeConfigurations = with lib;
foldr (a: b: a // b) {} (
homeConfigurations =
with lib;
foldr (a: b: a // b) { } (
pipe
[
# Hostname
]
[(map (hostName: makeHomeConfiguration {inherit hostName;}))]
[
# Hostname
]
[ (map (hostName: makeHomeConfiguration { inherit hostName; })) ]
);
inherit homeModules;
};