aboutsummaryrefslogblamecommitdiff
path: root/default.nix
blob: e79da46bbbec91d24862e430844291c0fb6d4ce4 (plain) (tree)
1
2
3
4
5
6
7
8
   
                              


                              
                                                     
                         
    





                               
                  
                                                     
                                      
                                  
                     
                  
                            

         
    
                     

                           
                      
    
                            

                           
               
                                                                   

      



                                                  
 
let
  pkgs = import <nixpkgs> { };
in rec {
  utils = import ./utils.nix {
    pkgs = pkgs;
    src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
    baseName = "website";
  };
  jekyllEnv = pkgs.bundlerEnv {
    name = "jekyll-env";
    gemfile = ./Gemfile;
    lockfile = ./Gemfile.lock;
    gemset = ./gemset.nix;
  };
  subtasks = rec {
    docs = utils.baseTask.overrideAttrs (baseAttrs: {
      name = "${baseAttrs.name}-docs";
      buildInputs = [ jekyllEnv ];
      buildPhase = ''
        mkdir $out
        jekyll build -d $out
      '';
    });
  };
  test = utils.test [
    utils.formatNix
    (utils.shellcheck null)
    (utils.fixme null)
  ];
  shell = pkgs.mkShell rec {
    name = "website-shell";
    buildInputs = [
      jekyllEnv
      (pkgs.hunspellWithDicts (with pkgs.hunspellDicts; [ en-us ]))
    ];
  };
  publishScript = utils.overwritingPublishScript {
    docsDerivation = subtasks.docs;
    overwrite = false;
  };
}