Browse Source

Use flake instead of shell

master
parent
commit
aca8cbdb0e
Signed by: chris GPG Key ID: 3025DCBD46F81C0F
  1. 41
      flake.lock
  2. 26
      flake.nix
  3. 17
      shell.nix

41
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
}

26
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
];
};
}
);
}

17
shell.nix

@ -1,17 +0,0 @@
{ pkgs ? import <nixpkgs> { } }:
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 = ''
'';
}
Loading…
Cancel
Save