site

files for beauhilton.com
git clone https://git.beauhilton.com/site.git
Log | Files | Refs

flake.nix (2365B)


      1 {
      2   inputs = {
      3     nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
      4     systems.url = "github:nix-systems/default";
      5     #devenv.url = "github:cachix/devenv";
      6     devenv.url = "github:cachix/devenv/python-rewrite";
      7     nixpkgs-python.url = "github:cachix/nixpkgs-python"; # required to set Python version
      8   };
      9 
     10   nixConfig = {
     11     extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
     12     extra-substituters = "https://devenv.cachix.org";
     13   };
     14 
     15   outputs = {
     16     self,
     17     nixpkgs,
     18     devenv,
     19     systems,
     20     ...
     21   } @ inputs: let
     22     forEachSystem = nixpkgs.lib.genAttrs (import systems);
     23   in {
     24     devenv-up = self.devShells.x86_64-linux.default.config.procfileScript;
     25     devShells =
     26       forEachSystem
     27       (system: let
     28         pkgs = nixpkgs.legacyPackages.${system};
     29       in {
     30         default = devenv.lib.mkShell {
     31           inherit inputs pkgs;
     32           modules = [
     33             {
     34               packages = with pkgs; [
     35                 entr
     36                 highlight
     37                 pandoc
     38                 rsync
     39                 soupault
     40                 silver-searcher
     41                 simple-http-server
     42               ];
     43               languages.ocaml = {enable = true;};
     44 
     45               # fresh build every time I enter the project, happens in the background and is super snappy
     46               enterShell = ''
     47                 rm -rf ./build
     48                 soupault
     49               '';
     50 
     51               scripts = {
     52                 newterm.exec = "wezterm start --cwd .";
     53                 build.exec = "soupault --verbose";
     54                 autorebuild.exec = "nohup ag -l | entr -n -s 'soupault' &> /dev/null &"; # autorebuild, uses caching so superer snappier
     55                 serve.exec = "nohup simple-http-server --index --nocache -o -p 8999 ./build 2>&1 &"; # the -o opens $BROWSER
     56                 upload.exec = "soupault && cp build/atom.xml build/feed.xml && rsync -avht --rsync-path=openrsync build/* beau@beauhilton.com:/var/www/htdocs/www.beauhilton.com/";
     57               };
     58               pre-commit.hooks = {
     59                 alejandra.enable = true;
     60                 upload = {
     61                   enable = true;
     62                   name = "upload";
     63                   entry = "upload";
     64                   verbose = true;
     65                 };
     66               };
     67             }
     68           ];
     69         };
     70       });
     71   };
     72 }