Coder Social home page Coder Social logo

rpearce / robertwpearce.com Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 1.0 28.36 MB

💾 My personal site; built with hakyll

Home Page: https://robertwpearce.com

License: BSD 3-Clause "New" or "Revised" License

CSS 34.82% HTML 29.48% Haskell 30.89% Nix 4.81%
hakyll static-site haskell blog static-site-generation

robertwpearce.com's Introduction

robertwpearce.com's People

Contributors

dependabot[bot] avatar rpearce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

crosseye

robertwpearce.com's Issues

Hakyll – Pure Builds With Nix

Helpful:

Steps:

  1. Make a new project with default.nix, shell.nix, and release.nix and get into its pure nix shell environment
λ mkdir hakyll-nix-example && cd $_
λ echo "(import ./release.nix { }).project" > default.nix
λ echo "(import ./release.nix { }).shell" > shell.nix
λ echo "{ }: let in { }" > release.nix
λ nix-shell --pure -p niv nix cacert
  1. Initialize niv and setup your nixpkgs owner, repository, and branch
[nix-shell:~/projects/hakyll-nix-example]$ niv init
[nix-shell:~/projects/hakyll-nix-example]$ niv update nixpkgs -o NixOS -r nixpkgs-channels -b nixpkgs-unstable
[nix-shell:~/projects/hakyll-nix-example]$ exit
  1. update release.nix
{ compiler ? "ghc883"
, sources ? import ./nix/sources.nix
}:

let
overlay = _: pkgz: {
  niv = import sources.niv { };
};

pkgs = import sources.nixpkgs {
  config = {
    packageOverrides = pkgz: rec {
      haskell = pkgz.haskell // {
        packages = pkgz.haskell.packages // {
          ${compiler} = pkgz.haskell.packages.${compiler}.override {
            overrides = hpNew: hpOld: rec {
              hakyll = hpOld.hakyll.overrideAttrs(oldAttrs: {
                configureFlags = "-f watchServer -f previewServer";
                patches = [ ./hakyll.patch ];
              });

              project = hpNew.callCabal2nix "robertwpearce-com" ./. { };
            };
          };
        };
      };
    };
  };

  overlays = [ overlay ];
};

haskellPackages = pkgs.haskell.packages.${compiler};
in
{
  project = haskellPackages.project;

  shell = haskellPackages.shellFor {
    packages = p: with p; [
      haskellPackages.project
    ];
    buildInputs = with haskellPackages; [
      ghcid
      hlint
      niv
      #ormolu
      pkgs.cacert
      pkgs.nix
    ];
    withHoogle = true;
  };
}
  1. create hakyll.patch diff file
diff --git a/hakyll.cabal b/hakyll.cabal
index fcded8d..9746f20 100644
--- a/hakyll.cabal
+++ b/hakyll.cabal
@@ -199,7 +199,7 @@ Library
   If flag(previewServer)
     Build-depends:
       wai             >= 3.2   && < 3.3,
-      warp            >= 3.2   && < 3.3,
+      warp,
       wai-app-static  >= 3.1   && < 3.2,
       http-types      >= 0.9   && < 0.13,
       fsnotify        >= 0.2   && < 0.4
  1. bootstrap the hakyll project (we won't ever need this again)
λ nix-shell --pure -p haskellPackages.hakyll --run "hakyll-init ."
  1. build the project and --show-trace just in case something goes wrong
λ nix-build --show-trace
  1. run the local dev server
λ ./result/bin/site watch
  1. navigate to http://localhost:8000 and see your local dev site up and running!

People are so much more than cogs

"I point out to you […] a lesson learned from past over-machined societies which you appear not to have learned. The devices themselves condition the users to employ each other the way they employ machines."

— Leto II, God Emperor of Dune

I'm re-reading the Dune series for the nth time, and this time, I'm doing it with a group via the excellent Gom Jabbar podcast. There are some seriously problematic themes in God Emperor of Dune, but the quote above has stuck with me for weeks and has illuminated life for me in a way I haven't experienced in years.

This quote helped me wrap my head around ways we might inadvertantly dehumanize one another by assigning those around us rigid roles in the context of our daily lives and businesses. Like removing extra dough around a cookie cutter baking shape, we may discard from others that wealth of life and creativity that makes us human, leaving behind only the shapes we expect to see, and this limits and devalues ourselves and everyone around us.

Machines are everywhere and, depending on where you live, are involved in nearly everything we do. We give them commands, and they do something. When a part is broken, we replace that part. When they no longer suit our needs or are broken enough, we discard them. If we are exposed to this thinking every day for most of our lives, how does that affect how we treat and interact with people around us? Through force of habit, do we unintentionally treat others similarly to how we treat machines? Have we always done this, but our current technology makes this more ingrained since it is all-engrossing and demands our constant attention?

Much could be written on this subject, but let's keep this short.

The next time you find yourself eliminating someone's "role" at work and laying them off, ignoring someone bagging your groceries, growing impatient with your music teacher's stories, or disregarding someone's ideas because of their station, try to stop and remember that the person before you is a vibrant, autonomous, wonderful being that brings their entire lifetime of valuable experiences before you and exists far outside the box you and/or society might have put them in.

Re-do site (design, phoenix, ???)

License?

Hey, I love your blog setup. May I reuse your code? I'd be happy to attribute.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.