Extract dev-shell.nix module
This commit is contained in:
parent
8b48ed5e62
commit
9c33718aff
2 changed files with 63 additions and 51 deletions
52
flake.nix
52
flake.nix
|
@ -11,62 +11,12 @@
|
||||||
systems = [ "x86_64-linux" ];
|
systems = [ "x86_64-linux" ];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
inputs.devshell.flakeModule
|
./nix/modules/dev-shell.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
perSystem =
|
perSystem =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
|
||||||
php = pkgs.php83.buildEnv {
|
|
||||||
extraConfig = ''
|
|
||||||
upload_max_filesize = 50M;
|
|
||||||
post_max_size = 50M;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
phpPackages = pkgs.php83Packages;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
devshells.default = {
|
|
||||||
packages = with pkgs; [
|
|
||||||
just
|
|
||||||
lua-language-server
|
|
||||||
lua54Packages.luacheck
|
|
||||||
nixd
|
|
||||||
php
|
|
||||||
phpactor
|
|
||||||
phpPackages.composer
|
|
||||||
sqlite
|
|
||||||
tailwindcss_4
|
|
||||||
tailwindcss-language-server
|
|
||||||
watchman
|
|
||||||
];
|
|
||||||
|
|
||||||
commands = [
|
|
||||||
{
|
|
||||||
name = "generate";
|
|
||||||
command = "vendor/bin/drush tome:static --uri https://www.oliverdavies.uk";
|
|
||||||
help = "Generate the static HTML";
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
name = "import";
|
|
||||||
command = "vendor/bin/drush tome:import";
|
|
||||||
help = "Re-import configuration, content and files";
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
name = "upload";
|
|
||||||
command = ''
|
|
||||||
generate
|
|
||||||
|
|
||||||
rsync -avzP html/ nixedo.oliverdavies.uk:/var/www/vhosts/website-tome \
|
|
||||||
--delete --delete-after
|
|
||||||
'';
|
|
||||||
help = "Generate the static HTML and upload it to the server";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
formatter = pkgs.nixfmt-rfc-style;
|
formatter = pkgs.nixfmt-rfc-style;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
62
nix/modules/dev-shell.nix
Normal file
62
nix/modules/dev-shell.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.devshell.flakeModule
|
||||||
|
];
|
||||||
|
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
php = pkgs.php83.buildEnv {
|
||||||
|
extraConfig = ''
|
||||||
|
upload_max_filesize = 50M;
|
||||||
|
post_max_size = 50M;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
phpPackages = pkgs.php83Packages;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devshells.default = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
just
|
||||||
|
lua-language-server
|
||||||
|
lua54Packages.luacheck
|
||||||
|
nixd
|
||||||
|
php
|
||||||
|
phpactor
|
||||||
|
phpPackages.composer
|
||||||
|
sqlite
|
||||||
|
tailwindcss_4
|
||||||
|
tailwindcss-language-server
|
||||||
|
watchman
|
||||||
|
];
|
||||||
|
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
name = "generate";
|
||||||
|
command = "vendor/bin/drush tome:static --uri https://www.oliverdavies.uk";
|
||||||
|
help = "Generate the static HTML";
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "import";
|
||||||
|
command = "vendor/bin/drush tome:import";
|
||||||
|
help = "Re-import configuration, content and files";
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "upload";
|
||||||
|
command = ''
|
||||||
|
generate
|
||||||
|
|
||||||
|
rsync -avzP html/ nixedo.oliverdavies.uk:/var/www/vhosts/website-tome \
|
||||||
|
--delete --delete-after
|
||||||
|
'';
|
||||||
|
help = "Generate the static HTML and upload it to the server";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue