整理 hostname

This commit is contained in:
2023-07-22 00:01:56 +08:00
parent a18a913546
commit 4337485e5d
3 changed files with 18 additions and 3 deletions

View File

@@ -146,6 +146,7 @@
./modules/hardware
./modules/packages
./modules/boot
./modules/system
(inputs: { config.nixos =
{
fileSystems =
@@ -209,10 +210,14 @@
'';
installDevice = "efi";
};
system =
{
hostname = "chn-PC";
};
};}
)
[ ./modules/basic.nix { hostName = "chn-PC"; } ]
./modules/basic.nix
./modules/fonts.nix
[ ./modules/i18n.nix { fcitx = true; } ]
./modules/kde.nix

View File

@@ -1,4 +1,4 @@
{ hostName }: inputs:
inputs:
{
config =
{
@@ -27,7 +27,6 @@
# "/nix/var/nix/profiles/per-user/root/channels"
# ];
};
networking.hostName = hostName;
time.timeZone = "Asia/Shanghai";
system =
{

View File

@@ -0,0 +1,11 @@
inputs:
{
options.nixos.system = let inherit (inputs.lib) mkOption types; in
{
hostname = mkOption { type = types.nonEmptyStr; };
};
config = let inherit (inputs.lib) mkMerge mkIf; inherit (inputs.localLib) mkConditional; in mkMerge
[
{ networking.hostName = inputs.config.nixos.system.hostname; }
];
}