mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:19:22 +08:00
整理 hostname
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 =
|
||||
{
|
||||
|
||||
11
modules/system/default.nix
Normal file
11
modules/system/default.nix
Normal 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; }
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user