From ecb0121fd2147af1c0b94f90266dee23e709e0fd Mon Sep 17 00:00:00 2001 From: Bill Ewanick Date: Wed, 28 Jun 2023 19:46:20 -0400 Subject: [PATCH] Add the seal post script into nix file itself. Some comments on how to use Gitea. Switching mentions of users to alice --- nixos-apps/cutesealfanpage.love.nix | 8 +++++++ .../cutesealfanpage.love/newSealPost.sh | 24 +++++++++++++++++++ nixos-apps/git.ewanick.com.nix | 14 +++++++++++ server-config/configuration.nix | 2 +- 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 nixos-apps/cutesealfanpage.love/newSealPost.sh diff --git a/nixos-apps/cutesealfanpage.love.nix b/nixos-apps/cutesealfanpage.love.nix index ce8ce77..6ff1906 100644 --- a/nixos-apps/cutesealfanpage.love.nix +++ b/nixos-apps/cutesealfanpage.love.nix @@ -2,6 +2,14 @@ let PROJECT_ROOT = builtins.toString ./.; in { + nixpkgs.overlays = [ + (self: super: { + newSealPost = pkgs.writeShellScriptBin "newSealPost.sh" (builtins.readFile ./cutesealfanpage.love/newSealPost.sh); + }) + ]; + + environment.systemPackages = [ pkgs.newSealPost ]; + services.caddy = { enable = true; virtualHosts = { diff --git a/nixos-apps/cutesealfanpage.love/newSealPost.sh b/nixos-apps/cutesealfanpage.love/newSealPost.sh new file mode 100755 index 0000000..87a82cf --- /dev/null +++ b/nixos-apps/cutesealfanpage.love/newSealPost.sh @@ -0,0 +1,24 @@ +#!/bin/sh +HOME="/home/alice/seal-blog" + +# Call generateSealPosts from root of blog +# This will generate posts up to today +cd $HOME +./generate/generateSealPosts + +# cd to website so site can find posts folder and build +cd $HOME/website + +# Before our posts will show up on the site +# we need to build them so they're generated +# from our site.hs logic +./site build + +# Push to git +cd $HOME +ssh-add +git add . +git config user.name "Alice" +git config user.email "admin@cutesealfanpage.love" +git commit -m "Daily blog update" +git push origin main \ No newline at end of file diff --git a/nixos-apps/git.ewanick.com.nix b/nixos-apps/git.ewanick.com.nix index a010757..277a4ec 100644 --- a/nixos-apps/git.ewanick.com.nix +++ b/nixos-apps/git.ewanick.com.nix @@ -25,3 +25,17 @@ }; }; } + + +/* + # README + + ## View users and use the command line + + Do something like this, preferably as the gitea user + + ```bash + $ sudo su gitea + $ /nix/store/5xwh7m7252m9ljvr3lyilcza1q699r2c-gitea-1.17.4/bin/gitea -c /var/lib/gitea/custom/conf/app.ini admin user list + ``` +*/ diff --git a/server-config/configuration.nix b/server-config/configuration.nix index b52acc3..dcec498 100644 --- a/server-config/configuration.nix +++ b/server-config/configuration.nix @@ -52,7 +52,7 @@ auto-optimise-store = true; # Required by Cachix to be used as non-root user - trusted-users = [ "root" "bill" ]; + trusted-users = [ "root" "alice" ]; }; };