From ccf57f598491c06930ad1cef29d2ec1c1175fe86 Mon Sep 17 00:00:00 2001 From: Anish L Date: Wed, 22 Jun 2022 23:14:35 +1000 Subject: [PATCH] move sync into submodules --- profiles/sync/{ => kitaab}/default.nix | 2 +- .../{get-music => sync/music}/default.nix | 0 .../{get-music => sync/music}/get-music.sh | 0 profiles/sync/website/default.nix | 27 +++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) rename profiles/sync/{ => kitaab}/default.nix (93%) rename profiles/{get-music => sync/music}/default.nix (100%) rename profiles/{get-music => sync/music}/get-music.sh (100%) create mode 100644 profiles/sync/website/default.nix diff --git a/profiles/sync/default.nix b/profiles/sync/kitaab/default.nix similarity index 93% rename from profiles/sync/default.nix rename to profiles/sync/kitaab/default.nix index 7a3da959..b82c3a1e 100644 --- a/profiles/sync/default.nix +++ b/profiles/sync/kitaab/default.nix @@ -18,7 +18,7 @@ User = "anish"; }; }; - systemd.timers.kitaab-timer = { + systemd.timers.kitaab-sync = { wantedBy = [ "timers.target" ]; partOf = [ "kitaab-sync.service" ]; timerConfig.OnCalendar = [ "daily" ]; diff --git a/profiles/get-music/default.nix b/profiles/sync/music/default.nix similarity index 100% rename from profiles/get-music/default.nix rename to profiles/sync/music/default.nix diff --git a/profiles/get-music/get-music.sh b/profiles/sync/music/get-music.sh similarity index 100% rename from profiles/get-music/get-music.sh rename to profiles/sync/music/get-music.sh diff --git a/profiles/sync/website/default.nix b/profiles/sync/website/default.nix new file mode 100644 index 00000000..93961f83 --- /dev/null +++ b/profiles/sync/website/default.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: + +{ + systemd.services.website-deploy = { + serviceConfig.Type = "oneshot"; + path = [ + pkgs.git + pkgs.coreutils + ]; + script = '' + cd /etc/nixos/ + nix develop + nix flake lock --update-input poonam + deploy .#cube --hostname lakhwara.com + exit 0 + ''; + serviceConfig = { + User = "anish"; + }; + }; + systemd.timers.website-deploy = { + after = [ "kitaab-sync.timer" ]; + wantedBy = [ "timers.target" ]; + partOf = [ "website-deploy.service" ]; + timerConfig.OnCalendar = [ "daily" ]; + }; +}