diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..62763a8 --- /dev/null +++ b/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1647350163, + "narHash": "sha256-OcMI+PFEHTONthXuEQNddt16Ml7qGvanL3x8QOl2Aao=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..df30222 --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + description = "Wedding site for Chris & Scotia 2023."; + + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = inputs @ { self, nixpkgs, ... }: + inputs.flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + weddingSiteDir = "$HOME/.local/source/wedding-site/public/"; + weddingSiteTgt = "ubuntu@chrishayward.xyz:/var/www/wedding"; + weddingSiteUpdate = pkgs.writeShellScriptBin "wedding-site-update" '' + ${pkgs.rsync}/bin/rsync -aP ${weddingSiteDir} ${weddingSiteTgt} + ''; + in + rec { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + hugo + weddingSiteUpdate + ]; + }; + } + ); +} diff --git a/shell.nix b/shell.nix deleted file mode 100644 index fa9c8cb..0000000 --- a/shell.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs ? import { } }: - -let - myUpdateWeddingSite = pkgs.writeShellScriptBin "update-wedding-site" '' - ${pkgs.rsync}/bin/rsync -aP $HOME/.local/source/wedding-site/public/ ubuntu@chrishayward.xyz:/var/www/wedding - ''; - -in -with pkgs; -mkShell { - buildInputs = [ - pkgs.hugo - myUpdateWeddingSite - ]; - shellHook = '' - ''; -}