Compare commits

...

4 commits

4 changed files with 59 additions and 34 deletions

View file

@ -1,32 +1,38 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
services.restic.backups.home = { services.restic.backups.system = {
paths = [ "/home/.zfs/snapshot/restic" ]; paths = [
"/home/.zfs/snapshot/restic"
"/var/.zfs/snapshot/restic"
];
repository = "s3:s3.us-west-001.backblazeb2.com/nolans-nixos-backups/${config.networking.hostName}"; repository = "s3:s3.us-west-001.backblazeb2.com/nolans-nixos-backups/${config.networking.hostName}";
environmentFile = config.age.secrets."restic_b2_${config.networking.hostName}".path; environmentFile = config.age.secrets."restic_b2_${config.networking.hostName}".path;
passwordFile = config.age.secrets."restic_password_${config.networking.hostName}".path; passwordFile = config.age.secrets."restic_password_${config.networking.hostName}".path;
initialize = true; initialize = true;
backupPrepareCommand = "${pkgs.zfs}/bin/zfs snapshot zpool/home@restic"; backupPrepareCommand = ''
backupCleanupCommand = "${pkgs.zfs}/bin/zfs destroy zpool/home@restic"; #!${pkgs.bash}/bin/sh
timerConfig = { ${pkgs.zfs}/bin/zfs snapshot zpool/home@restic
OnCalendar = "hourly"; ${pkgs.zfs}/bin/zfs snapshot zpool/var@restic
Persistent = true; '';
}; backupCleanupCommand = ''
}; #!${pkgs.bash}/bin/sh
services.restic.backups.var = { ${pkgs.zfs}/bin/zfs destroy zpool/home@restic
paths = [ "/var/.zfs/snapshot/restic" ]; ${pkgs.zfs}/bin/zfs destroy zpool/var@restic
repository = "s3:s3.us-west-001.backblazeb2.com/nolans-nixos-backups/${config.networking.hostName}"; '';
environmentFile = config.age.secrets."restic_b2_${config.networking.hostName}".path; timerConfig.OnCalendar = "hourly";
passwordFile = config.age.secrets."restic_password_${config.networking.hostName}".path; pruneOpts = [
initialize = true; "--keep-daily 7"
backupPrepareCommand = "${pkgs.zfs}/bin/zfs snapshot zpool/var@restic"; "--keep-weekly 5"
backupCleanupCommand = "${pkgs.zfs}/bin/zfs destroy zpool/var@restic"; "--keep-monthly 12"
timerConfig = { "--keep-yearly 2"
OnCalendar = "hourly"; ];
Persistent = true;
};
}; };
systemd.tmpfiles.rules = [
"d /mnt/restic 0700 root root"
];
age.secrets."restic_b2_${config.networking.hostName}".file = age.secrets."restic_b2_${config.networking.hostName}".file =
../secrets/restic_b2_${config.networking.hostName}.age; ../secrets/restic_b2_${config.networking.hostName}.age;
age.secrets."restic_password_${config.networking.hostName}".file = age.secrets."restic_password_${config.networking.hostName}".file =

View file

@ -10,6 +10,8 @@
packages = with pkgs; [ unstable.firefoxpwa ]; packages = with pkgs; [ unstable.firefoxpwa ];
}; };
programs.localsend.enable = true;
home-manager.users.nolan = { home-manager.users.nolan = {
programs = { programs = {
firefox = { firefox = {

View file

@ -44,15 +44,15 @@
credential.helper = "${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret"; credential.helper = "${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret";
}; };
}; };
jujutsu = { # jujutsu = {
enable = true; # enable = true;
settings = { # settings = {
user = { # user = {
name = "Nolan Darilek"; # name = "Nolan Darilek";
email = "nolan@thewordnerd.info"; # email = "nolan@thewordnerd.info";
}; # };
}; # };
}; # };
obs-studio = { obs-studio = {
enable = true; enable = true;
plugins = with pkgs.obs-studio-plugins; [ plugins = with pkgs.obs-studio-plugins; [
@ -65,4 +65,8 @@
}; };
}; };
}; };
environment.sessionVariables = {
PATH = [ "$HOME/.local/bin" ];
};
} }

View file

@ -1,7 +1,20 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
users.users.root.openssh.authorizedKeys.keys = [ users.users.root = {
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPk6C4eOYzTZ8XOuUA2tErGnSTLS/l9kRDl9+5Ql+m7VtaH/KRFbu6x+C0QAIKOrRcQOjpGYUjL1aIn0HCcoEW2PSihDmOHC+W8cy8ucScy4fPI5KpFFqTZU336Fje+NS4n587gcoaa5LjKcr2KZy/ljgzl4eNSRIqy85khfH4puxsj7LwTIqsZoqDhtD/jSqaKP1C2wuYSsijLF85UnRcT9jErnL757yUv/4xb4Is+gB0zan9GiBXRca4lzb0mY8rmMXmKhc2lm/mu8ogZRdYX5R2JP1AukzYGSdOFs4iUauihgvakuou9AugD2CC+ygYIEbWkUjwKfT9nRN93Qi9 id_rsa" openssh.authorizedKeys.keys = [
]; "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPk6C4eOYzTZ8XOuUA2tErGnSTLS/l9kRDl9+5Ql+m7VtaH/KRFbu6x+C0QAIKOrRcQOjpGYUjL1aIn0HCcoEW2PSihDmOHC+W8cy8ucScy4fPI5KpFFqTZU336Fje+NS4n587gcoaa5LjKcr2KZy/ljgzl4eNSRIqy85khfH4puxsj7LwTIqsZoqDhtD/jSqaKP1C2wuYSsijLF85UnRcT9jErnL757yUv/4xb4Is+gB0zan9GiBXRca4lzb0mY8rmMXmKhc2lm/mu8ogZRdYX5R2JP1AukzYGSdOFs4iUauihgvakuou9AugD2CC+ygYIEbWkUjwKfT9nRN93Qi9 id_rsa"
];
shell = pkgs.fish;
};
programs.fish.enable = true;
home-manager.users.root.home = {
shellAliases = {
"systemctl" = "systemctl --no-ager -l";
"journalctl" = "journalctl --no-pager -l";
};
stateVersion = "24.11";
};
} }