boron: move postgresqlBackup to disk to reduce ram pressure
All checks were successful
flake / flake (push) Successful in 1m14s
All checks were successful
flake / flake (push) Successful in 1m14s
This commit is contained in:
parent
41d5f0cc53
commit
3d642e2320
@ -41,7 +41,14 @@
|
|||||||
fileSystems."/nix".options = [ "compress=zstd" ];
|
fileSystems."/nix".options = [ "compress=zstd" ];
|
||||||
|
|
||||||
## Impermanence
|
## Impermanence
|
||||||
custom.impermanence.enable = true;
|
custom.impermanence = {
|
||||||
|
enable = true;
|
||||||
|
cache.enable = true;
|
||||||
|
};
|
||||||
|
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||||
|
btrfs subvolume delete /cache/system
|
||||||
|
btrfs subvolume snapshot /cache/empty_snapshot /cache/system
|
||||||
|
'';
|
||||||
|
|
||||||
## Custom Services
|
## Custom Services
|
||||||
custom = {
|
custom = {
|
||||||
|
@ -35,6 +35,13 @@
|
|||||||
options = [ "subvol=data" ];
|
options = [ "subvol=data" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fileSystems."/cache" =
|
||||||
|
{
|
||||||
|
device = "/dev/disk/by-uuid/9aebe351-156a-4aa0-9a97-f09b01ac23ad";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=cache" ];
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/nix" =
|
fileSystems."/nix" =
|
||||||
{
|
{
|
||||||
device = "/dev/disk/by-uuid/9aebe351-156a-4aa0-9a97-f09b01ac23ad";
|
device = "/dev/disk/by-uuid/9aebe351-156a-4aa0-9a97-f09b01ac23ad";
|
||||||
|
@ -22,12 +22,14 @@
|
|||||||
fileSystems."/nix".options = [ "compress=zstd" ];
|
fileSystems."/nix".options = [ "compress=zstd" ];
|
||||||
|
|
||||||
## Impermanence
|
## Impermanence
|
||||||
custom.impermanence.enable = true;
|
custom.impermanence = {
|
||||||
|
enable = true;
|
||||||
|
cache.enable = true;
|
||||||
|
};
|
||||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||||
btrfs subvolume delete /cache/tmp
|
btrfs subvolume delete /cache/tmp
|
||||||
btrfs subvolume snapshot /cache/empty_snapshot /cache/tmp
|
btrfs subvolume snapshot /cache/empty_snapshot /cache/tmp
|
||||||
chmod 0777 /cache/tmp
|
chmod 1777 /cache/tmp
|
||||||
chmod +t /cache/tmp
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
## CA server
|
## CA server
|
||||||
|
@ -11,6 +11,13 @@ in
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "/data";
|
default = "/data";
|
||||||
};
|
};
|
||||||
|
cache = {
|
||||||
|
enable = lib.mkEnableOption "impermanence.cache";
|
||||||
|
path = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "/cache";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
users = lib.mkOption {
|
users = lib.mkOption {
|
||||||
type = with lib.types; listOf str;
|
type = with lib.types; listOf str;
|
||||||
@ -39,7 +46,9 @@ in
|
|||||||
gitea.stateDir = "${cfg.base}/system/var/lib/gitea";
|
gitea.stateDir = "${cfg.base}/system/var/lib/gitea";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.persistence."${cfg.base}/system" = {
|
environment.persistence = lib.mkMerge [
|
||||||
|
{
|
||||||
|
"${cfg.base}/system" = {
|
||||||
hideMounts = true;
|
hideMounts = true;
|
||||||
|
|
||||||
directories = [
|
directories = [
|
||||||
@ -53,6 +62,15 @@ in
|
|||||||
(lib.lists.optional config.services.tang.enable "/var/lib/private/tang") ++
|
(lib.lists.optional config.services.tang.enable "/var/lib/private/tang") ++
|
||||||
(lib.lists.optional config.services.step-ca.enable "/var/lib/step-ca/db");
|
(lib.lists.optional config.services.step-ca.enable "/var/lib/step-ca/db");
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
(lib.mkIf cfg.cache.enable {
|
||||||
|
"${cfg.cache.path}/system" = {
|
||||||
|
hideMounts = true;
|
||||||
|
|
||||||
|
directories = (lib.lists.optional config.services.postgresqlBackup.enable config.services.postgresqlBackup.location);
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
home-manager.users =
|
home-manager.users =
|
||||||
let
|
let
|
||||||
|
Loading…
Reference in New Issue
Block a user