I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
782 B

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. # This file is controlled by /etc/dotfiles/README.org
  2. { config, options, lib, pkgs, ... }:
  3. with lib;
  4. with lib.types;
  5. let
  6. cfg = config.modules.hugo;
  7. mySiteDir = "/etc/dotfiles/docs/public/";
  8. mySiteTgt = "ubuntu@chrishayward.xyz:/var/www/chrishayward";
  9. mySiteBuild = pkgs.writeShellScriptBin "site-build" ''
  10. pushd ${mySiteDir}../ > /dev/null &&
  11. ${pkgs.hugo}/bin/hugo -v ;
  12. popd > /dev/null
  13. '';
  14. mySiteUpdate = pkgs.writeShellScriptBin "site-update" ''
  15. ${pkgs.rsync}/bin/rsync -aP ${mySiteDir} ${mySiteTgt}
  16. '';
  17. in {
  18. options.modules.hugo = {
  19. enable = mkOption {
  20. type = bool;
  21. default = false;
  22. };
  23. };
  24. config = mkIf cfg.enable {
  25. environment.systemPackages = [
  26. pkgs.hugo
  27. mySiteBuild
  28. mySiteUpdate
  29. ];
  30. };
  31. }