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

View file

@ -7,7 +7,6 @@
./hardware-configuration.nix ./hardware-configuration.nix
./network.nix ./network.nix
../sops.nix ../sops.nix
../restic.nix
]; ];
# Bootloader. # Bootloader.
@ -247,6 +246,7 @@
sopsFile = ./secrets.yaml; sopsFile = ./secrets.yaml;
}; };
}; };
custom.restic.enable = true;
custom.restic.repositoryFile = config.sops.secrets.restic_repo_calcite.path; custom.restic.repositoryFile = config.sops.secrets.restic_repo_calcite.path;
custom.restic.passwordFile = config.sops.secrets.restic_repo_calcite_password.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,6 +5,7 @@ in
{ {
options = { options = {
custom.restic = { custom.restic = {
enable = lib.mkEnableOption "restic";
repositoryFile = lib.mkOption { repositoryFile = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = ""; default = "";
@ -16,7 +17,7 @@ in
}; };
}; };
config = { config = {
services.restic.backups = { services.restic.backups = lib.mkIf cfg.enable {
remotebackup = { remotebackup = {
repositoryFile = cfg.repositoryFile; repositoryFile = cfg.repositoryFile;
passwordFile = cfg.passwordFile; passwordFile = cfg.passwordFile;