mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:19:22 +08:00
modules.services: 整理
This commit is contained in:
@@ -48,7 +48,6 @@ inputs:
|
||||
{
|
||||
sshd = {};
|
||||
xray.client = { enable = true; dnsmasq.hosts."git.nas.chn.moe" = "127.0.0.1"; };
|
||||
smartd.enable = true;
|
||||
beesd.instances =
|
||||
{
|
||||
root = { device = "/"; hashTableSizeMB = 4096; threads = 4; };
|
||||
|
||||
@@ -26,7 +26,6 @@ inputs:
|
||||
services =
|
||||
{
|
||||
xray.client.enable = true;
|
||||
smartd.enable = true;
|
||||
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
|
||||
wireguard =
|
||||
{
|
||||
|
||||
@@ -108,7 +108,6 @@ inputs:
|
||||
};
|
||||
};
|
||||
nix-serve = { enable = true; hostname = "nix-store.chn.moe"; };
|
||||
smartd.enable = true;
|
||||
misskey.instances.misskey.hostname = "xn--qbtm095lrg0bfka60z.chn.moe";
|
||||
beesd.instances.root = { device = "/"; hashTableSizeMB = 4096; threads = 4; };
|
||||
wireguard =
|
||||
|
||||
@@ -23,7 +23,6 @@ inputs:
|
||||
services =
|
||||
{
|
||||
sshd.passwordAuthentication = true;
|
||||
smartd.enable = true;
|
||||
slurm =
|
||||
{
|
||||
enable = true;
|
||||
|
||||
@@ -39,7 +39,6 @@ inputs:
|
||||
services =
|
||||
{
|
||||
sshd = { passwordAuthentication = true; groupBanner = true; };
|
||||
smartd.enable = true;
|
||||
slurm =
|
||||
{
|
||||
enable = true;
|
||||
|
||||
@@ -3,18 +3,16 @@ inputs:
|
||||
imports = inputs.localLib.findModules ./.;
|
||||
options.nixos.services = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
smartd.enable = mkOption { type = types.bool; default = false; };
|
||||
noisetorch.enable = mkOption { type = types.bool; default = inputs.config.nixos.model.type == "desktop"; };
|
||||
smartd = mkOption { type = types.nullOr (types.submodule {}); default = {}; };
|
||||
noisetorch = mkOption
|
||||
{
|
||||
type = types.nullOr (types.submodule {});
|
||||
default = if inputs.config.nixos.model.type == "desktop" then {} else null;
|
||||
};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkMerge mkIf;
|
||||
inherit (inputs.localLib) stripeTabs attrsToList;
|
||||
inherit (inputs.config.nixos) services;
|
||||
inherit (builtins) map listToAttrs toString;
|
||||
in mkMerge
|
||||
[
|
||||
(mkIf services.smartd.enable { services.smartd.enable = true; })
|
||||
(mkIf services.noisetorch.enable { programs.noisetorch.enable = true; })
|
||||
];
|
||||
config = let inherit (inputs.config.nixos.services) smartd noisetorch; in inputs.lib.mkMerge
|
||||
[
|
||||
(inputs.lib.mkIf (smartd != null) { services.smartd.enable = true; })
|
||||
(inputs.lib.mkIf (noisetorch != null) { programs.noisetorch.enable = true; })
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user