move restic to nixosModules

This commit is contained in:
xinyangli 2023-12-02 01:33:20 +08:00
parent 9bec6270ef
commit 9986100945
4 changed files with 10 additions and 5 deletions

View file

@ -46,6 +46,7 @@
inherit system;
specialArgs = specialArgs // { inherit inputs system; };
modules = [
self.nixosModules.default
home-manager.nixosModules.home-manager
nur.nixosModules.nur
] ++ modules;
@ -53,7 +54,7 @@
evalSecrets = import ./eval_secrets.nix;
in
{
nixosModules = import ./modules/nixos;
nixosModules.default = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
colmena = {

View file

@ -7,7 +7,6 @@
./hardware-configuration.nix
./network.nix
../sops.nix
../restic.nix
];
# Bootloader.
@ -247,6 +246,7 @@
sopsFile = ./secrets.yaml;
};
};
custom.restic.enable = true;
custom.restic.repositoryFile = config.sops.secrets.restic_repo_calcite.path;
custom.restic.passwordFile = config.sops.secrets.restic_repo_calcite_password.path;

View file

@ -1,3 +1,6 @@
{ config, pkgs, ... }:
{
imports = [
./restic.nix
];
}

View file

@ -5,18 +5,19 @@ in
{
options = {
custom.restic = {
enable = lib.mkEnableOption "restic";
repositoryFile = lib.mkOption {
type = lib.types.str;
default = "";
};
passwordFile = lib.mkOption {
passwordFile = lib.mkOption {
type = lib.types.str;
default = "";
};
};
};
config = {
services.restic.backups = {
services.restic.backups = lib.mkIf cfg.enable {
remotebackup = {
repositoryFile = cfg.repositoryFile;
passwordFile = cfg.passwordFile;