mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
pc: enable beesd
This commit is contained in:
@@ -215,7 +215,7 @@
|
||||
nginx = { enable = true; transparentProxy.externalIp = [ "192.168.82.3" ]; };
|
||||
misskey = { enable = true; hostname = "xn--qbtm095lrg0bfka60z.chn.moe"; };
|
||||
misskey-proxy."xn--qbtm095lrg0bfka60z.chn.moe" = {};
|
||||
beesd = { enable = false; instances.root = { device = "/"; hashTableSizeMB = 2048; }; };
|
||||
beesd = { enable = true; instances.root = { device = "/"; hashTableSizeMB = 2048; }; };
|
||||
};
|
||||
bugs =
|
||||
[
|
||||
|
||||
@@ -33,7 +33,7 @@ inputs:
|
||||
{
|
||||
spec = instance.value.device or instance.value;
|
||||
hashTableSizeMB = instance.value.hashTableSizeMB or 1024;
|
||||
extraOptions = [ "--thread-count" "1" "--workaround-btrfs-send" ];
|
||||
extraOptions = [ "--thread-count" "1" "--scan-mode" "3" ];
|
||||
};
|
||||
})
|
||||
(attrsToList beesd.instances));
|
||||
|
||||
@@ -20,14 +20,10 @@ inputs:
|
||||
./vaultwarden.nix
|
||||
./frp.nix
|
||||
./beesd.nix
|
||||
./snapper.nix
|
||||
];
|
||||
options.nixos.services = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
snapper =
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
configs = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
|
||||
};
|
||||
kmscon.enable = mkOption { type = types.bool; default = false; };
|
||||
fontconfig.enable = mkOption { type = types.bool; default = false; };
|
||||
firewall.trustedInterfaces = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
|
||||
@@ -48,38 +44,6 @@ inputs:
|
||||
inherit (builtins) map listToAttrs toString;
|
||||
in mkMerge
|
||||
[
|
||||
(
|
||||
mkIf services.snapper.enable
|
||||
{
|
||||
services.snapper.configs =
|
||||
let
|
||||
f = (config:
|
||||
{
|
||||
inherit (config) name;
|
||||
value =
|
||||
{
|
||||
SUBVOLUME = config.value;
|
||||
TIMELINE_CREATE = true;
|
||||
TIMELINE_CLEANUP = true;
|
||||
TIMELINE_MIN_AGE = 1800;
|
||||
TIMELINE_LIMIT_HOURLY = "10";
|
||||
TIMELINE_LIMIT_DAILY = "7";
|
||||
TIMELINE_LIMIT_WEEKLY = "1";
|
||||
TIMELINE_LIMIT_MONTHLY = "0";
|
||||
TIMELINE_LIMIT_YEARLY = "0";
|
||||
};
|
||||
});
|
||||
in
|
||||
listToAttrs (map f (attrsToList services.snapper.configs));
|
||||
nixpkgs.config.packageOverrides = pkgs:
|
||||
{
|
||||
snapper = pkgs.snapper.overrideAttrs (attrs:
|
||||
{
|
||||
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./snapper.patch ];
|
||||
});
|
||||
};
|
||||
}
|
||||
)
|
||||
(
|
||||
mkIf services.kmscon.enable
|
||||
{
|
||||
|
||||
44
modules/services/snapper.nix
Normal file
44
modules/services/snapper.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.snapper = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
configs = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkMerge mkIf;
|
||||
inherit (inputs.localLib) stripeTabs attrsToList;
|
||||
inherit (inputs.config.nixos) services;
|
||||
inherit (builtins) map listToAttrs toString;
|
||||
in mkIf services.snapper.enable
|
||||
{
|
||||
services.snapper.configs =
|
||||
let
|
||||
f = (config:
|
||||
{
|
||||
inherit (config) name;
|
||||
value =
|
||||
{
|
||||
SUBVOLUME = config.value;
|
||||
TIMELINE_CREATE = true;
|
||||
TIMELINE_CLEANUP = true;
|
||||
TIMELINE_MIN_AGE = 1800;
|
||||
TIMELINE_LIMIT_HOURLY = "10";
|
||||
TIMELINE_LIMIT_DAILY = "7";
|
||||
TIMELINE_LIMIT_WEEKLY = "1";
|
||||
TIMELINE_LIMIT_MONTHLY = "0";
|
||||
TIMELINE_LIMIT_YEARLY = "0";
|
||||
};
|
||||
});
|
||||
in
|
||||
listToAttrs (map f (attrsToList services.snapper.configs));
|
||||
nixpkgs.config.packageOverrides = pkgs:
|
||||
{
|
||||
snapper = pkgs.snapper.overrideAttrs (attrs:
|
||||
{
|
||||
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./snapper.patch ];
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user