generalize common -> oizys and add backups option

This commit is contained in:
Daylin Morgan 2024-03-19 09:49:43 -05:00
parent 9f8a1692b5
commit cec9ce730f
Signed by: daylin
GPG key ID: 950D13E9719334AD
5 changed files with 59 additions and 48 deletions

View file

@ -16,12 +16,11 @@ in {
"python"
];
docker = enabled;
backups = enabled;
};
environment.systemPackages = with pkgs; [
rclone
(pkgs.writeShellScriptBin "gitea" ''
(writeShellScriptBin "gitea" ''
ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"
'')
];

View file

@ -4,14 +4,20 @@
lib,
...
}: let
inherit (lib) enableAttrs;
inherit (lib) enabled;
in {
imports = with self.nixosModules; [
restic
];
oizys =
{
oizys = {
desktop = enabled;
chrome = enabled;
docker = enabled;
nix-ld = enabled;
vbox = enabled;
vpn = enabled;
backups = enabled;
languages = [
"misc"
"python"
@ -19,19 +25,10 @@ in {
"tex"
"node"
];
}
// enableAttrs [
"chrome"
"desktop"
"docker"
"nix-ld"
"vbox"
"vpn"
];
};
environment.systemPackages = with pkgs; [
zk
rclone
quarto
];

View file

@ -30,7 +30,7 @@ in rec {
system = "x86_64-linux";
modules =
[
../modules/common.nix
../modules/oizys.nix
../overlays
]
++ filter

View file

@ -2,7 +2,9 @@
lib,
self,
...
}: {
}: let
inherit (lib) mkEnableOption;
in {
imports = with self.nixosModules; [
users
nix
@ -33,5 +35,5 @@
nix-ld
];
options.oizys.desktop.enable = lib.mkEnableOption "is desktop";
options.oizys.desktop.enable = mkEnableOption "is desktop";
}

View file

@ -1,4 +1,16 @@
{...}: {
{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.oizys.backups;
in {
options.oizys.backups.enable = mkEnableOption "enable restic/rclone backups";
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [rclone];
services.restic.backups.gdrive = {
# BUG: if .conda/environments.txt doesn't exist then this won't work
# workaround for now `mkdir ~/.conda && touch ~/.conda/environments.txt`
@ -24,4 +36,5 @@
RandomizedDelaySec = "5h";
};
};
};
}