massicot,fix: fix missing module

This commit is contained in:
xinyangli 2024-09-14 16:41:22 +08:00
parent 5104c5943e
commit 6b375fea91
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
5 changed files with 33 additions and 12 deletions

View file

@ -13,5 +13,6 @@
./forgejo-actions-runner.nix ./forgejo-actions-runner.nix
./oidc-agent.nix ./oidc-agent.nix
./miniflux.nix ./miniflux.nix
./immich.nix
]; ];
} }

View file

@ -31,7 +31,7 @@ in
"/etc/immich" = { "/etc/immich" = {
d = { d = {
inherit user group; inherit user group;
mode = "0600"; mode = "0700";
}; };
}; };
"/etc/immich/config.json" = { "/etc/immich/config.json" = {
@ -53,5 +53,8 @@ in
Environment = "IMMICH_CONFIG_FILE=%d/config"; Environment = "IMMICH_CONFIG_FILE=%d/config";
}; };
}; };
# https://github.com/NixOS/nixpkgs/pull/324127/files#r1723763510
services.immich.redis.host = "/run/redis-immich/redis.sock";
}; };
} }

View file

@ -1,6 +1,6 @@
# TODO: https://github.com/lilyinstarlight/foosteros/blob/dfe1ab3eb68bfebfaa709482d52fa04ebdde81c8/config/restic.nix#L23 <- this is better
{ {
config, config,
pkgs,
lib, lib,
... ...
}: }:
@ -11,6 +11,14 @@ in
options = { options = {
custom.restic = { custom.restic = {
enable = lib.mkEnableOption "restic"; enable = lib.mkEnableOption "restic";
paths = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [
"/home"
"/var/lib"
];
};
prune = lib.mkEnableOption "auto prune remote restic repo";
repositoryFile = lib.mkOption { repositoryFile = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = ""; default = "";
@ -22,14 +30,10 @@ in
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.restic.backups = { services.restic.backups.${config.networking.hostName} = lib.mkMerge [
remotebackup = { {
repositoryFile = cfg.repositoryFile; repositoryFile = cfg.repositoryFile;
passwordFile = cfg.passwordFile; passwordFile = cfg.passwordFile;
paths = [
"/home"
"/var/lib"
];
exclude = [ exclude = [
"/home/*/.cache" "/home/*/.cache"
"/home/*/.cargo" "/home/*/.cargo"
@ -40,13 +44,24 @@ in
OnCalendar = "00:05"; OnCalendar = "00:05";
RandomizedDelaySec = "5h"; RandomizedDelaySec = "5h";
}; };
pruneOpts = [ pruneOpts = lib.mkIf cfg.prune [
"--keep-daily 7" "--keep-daily 7"
"--keep-weekly 5" "--keep-weekly 5"
"--keep-monthly 12" "--keep-monthly 12"
"--keep-yearly 75" "--keep-yearly 75"
]; ];
}; paths = lib.mkDefault cfg.paths;
}; initialize = true;
}
(lib.mkIf (config.fileSystems."/".fsType == "btrfs") {
backupPrepareCommand = ''
btrfs subvolume snapshot -r / backup
'';
backupCleanupCommand = ''
btrfs subvolume delete /backup
'';
paths = map (p: "/backup" + p) cfg.paths;
})
];
}; };
} }

View file

@ -33,7 +33,8 @@ in
stylix.targets = { stylix.targets = {
console.enable = true; console.enable = true;
gnome.enable = if config.services.xserver.desktopManager.gnome.enable then true else false; # gnome.enable = if config.services.xserver.desktopManager.gnome.enable then true else false;
gnome.enable = false;
gtk.enable = true; gtk.enable = true;
}; };
}; };

View file

@ -43,6 +43,7 @@ in
}; };
services.caddy = mkIf cfg.caddy { services.caddy = mkIf cfg.caddy {
enable = true; enable = true;
virtualHosts."https://${cfg.domain}".extraConfig = '' virtualHosts."https://${cfg.domain}".extraConfig = ''
reverse_proxy ${config.services.vaultwarden.config.ROCKET_ADDRESS}:${toString config.services.vaultwarden.config.ROCKET_PORT} reverse_proxy ${config.services.vaultwarden.config.ROCKET_ADDRESS}:${toString config.services.vaultwarden.config.ROCKET_PORT}
''; '';