This commit is contained in:
Henri Dohmen 2025-07-14 22:57:12 +02:00
parent a018670eae
commit 4183ccb893
Signed by: hd
GPG key ID: AB79213B044674AE
14 changed files with 169 additions and 38 deletions

View file

@ -2,6 +2,10 @@
{
networking.hostName = "c2";
age.identityPaths = [
"/root/.ssh/id_ed25519"
];
imports = with inputs.nixos-hardware.nixosModules; [
./hardware-configuration.nix
common-cpu-intel

41
host/roam/backup.nix Normal file
View file

@ -0,0 +1,41 @@
{
config,
pkgs,
secrets,
var,
...
}:
{
age.secrets.roam-rclone-conf = {
file = secrets.roam."rclone-conf.age";
mode = "440";
owner = "root";
group = "root";
};
systemd = {
timers."backup-rclone" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
Unit = "backup-rclone.service";
};
};
services."backup-rclone" =
let
conf = config.age.secrets.roam-rclone-conf.path;
in
{
script = ''
${pkgs.rclone}/bin/rclone --config ${conf} copy /home/hd/Documents odc:Documents
${pkgs.rclone}/bin/rclone --config ${conf} copy /git odc:git
'';
path = [ pkgs.rclone ];
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
};
}

View file

@ -2,7 +2,12 @@
{
networking.hostName = "roam";
age.identityPaths = [
"/root/.ssh/id_ed25519"
];
imports = [
./backup.nix
./git.nix
./hardware-configuration.nix
./networking.nix

View file

@ -8,6 +8,6 @@
createHome = true;
group = "git";
shell = "${pkgs.git}/bin/git-shell";
openssh.authorizedKeys.keys = var.ssh-keys.unprivileged;
openssh.authorizedKeys.keys = var.ssh-keys.hd;
};
}

View file

@ -1,7 +1,5 @@
{
var,
config,
pkgs,
...
}:
{
@ -36,26 +34,4 @@
443
];
};
systemd = {
timers."backup-rclone" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
Unit = "backup-rclone.service";
};
};
services."backup-rclone" = {
script = ''
${pkgs.rclone}/bin/rclone copy /home/hd/Documents odc:Documents
${pkgs.rclone}/bin/rclone copy /git odc:git
'';
path = [ pkgs.rclone ];
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
};
}

View file

@ -2,6 +2,10 @@
{
networking.hostName = "solo";
age.identityPaths = [
"/root/.ssh/id_ed25519"
];
imports = [
./hardware-configuration.nix
./keyboard.nix