Add Nix flake

This commit is contained in:
Michael Smith
2023-05-05 10:29:26 +02:00
parent 3222d18c32
commit 7b4c3f90ad
2 changed files with 145 additions and 0 deletions

60
flake.nix Normal file
View File

@@ -0,0 +1,60 @@
{
description = "Retrospace website development environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
devshell = {
url = "github:numtide/devshell";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, nixpkgs, flake-utils, devshell }:
flake-utils.lib.eachDefaultSystem (system: {
devShell =
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
};
in
pkgs.devshell.mkShell {
name = "Retrospace website development environment";
packages = with pkgs; [
(pkgs.ruby_3_1.withPackages
(ps: with ps; [
bundler
jekyll
kramdown-parser-gfm
webrick
])
)
nixpkgs-fmt
isort
];
env = [ ];
commands = [
{
name = "retrospace:lint";
category = "Maintenance";
help = "Lint all the files in project";
command = ''
nixpkgs-fmt *.nix
'';
}
{
name = "retrospace:deploy";
help = "Deploy the website";
command = ''
jekyll build && rsync -v -rz --checksum --delete ./_site/ endor:/var/www/retrospace.be
'';
}
];
};
});
}