Migrate to flake-parts
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
3a060cb6e9
commit
7671099aea
5 changed files with 249 additions and 40 deletions
92
drupal-cms/flake.lock
generated
92
drupal-cms/flake.lock
generated
|
@ -1,24 +1,106 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1759362264,
|
||||
"narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "758cf7296bee11f1706a574c77d072b8a7baa881",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1758198701,
|
||||
"narHash": "sha256-7To75JlpekfUmdkUZewnT6MoBANS0XVypW6kjUOXQwc=",
|
||||
"lastModified": 1759632233,
|
||||
"narHash": "sha256-krgZxGAIIIKFJS+UB0l8do3sYUDWJc75M72tepmVMzE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0147c2f1d54b30b5dd6d4a8c8542e8d7edf93b5d",
|
||||
"rev": "d7f52a7a640bc54c7bb414cca603835bf8dd4b10",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1754788789,
|
||||
"narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "a73b9c743612e4244d865a2fdee11865283c04e6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"process-compose": {
|
||||
"locked": {
|
||||
"lastModified": 1758658658,
|
||||
"narHash": "sha256-y5GSCqlGe/uZzlocCPZcjc7Gj+mTq7m0P6xPGx88+No=",
|
||||
"owner": "Platonic-Systems",
|
||||
"repo": "process-compose-flake",
|
||||
"rev": "e968a94633788f5d9595d727f41c2baf0714be7b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Platonic-Systems",
|
||||
"repo": "process-compose-flake",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"process-compose": "process-compose",
|
||||
"services": "services",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"locked": {
|
||||
"lastModified": 1759624902,
|
||||
"narHash": "sha256-WLbsTVyf7o2hwvSPo6S4pIE+t8BM0trYl9RogukveWc=",
|
||||
"owner": "juspay",
|
||||
"repo": "services-flake",
|
||||
"rev": "e234166b0bfe94f8d7be7ce94a763aa0b736ae1f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "juspay",
|
||||
"repo": "services-flake",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,26 +1,79 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
process-compose.url = "github:Platonic-Systems/process-compose-flake";
|
||||
services.url = "github:juspay/services-flake";
|
||||
systems.url = "github:nix-systems/default";
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import inputs.nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
(php.buildEnv {
|
||||
extraConfig = ''
|
||||
memory_limit = 512M
|
||||
'';
|
||||
})
|
||||
phpPackages.composer
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = import inputs.systems;
|
||||
|
||||
sqlite
|
||||
];
|
||||
};
|
||||
imports = [
|
||||
inputs.process-compose.flakeModule
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
php = pkgs.php;
|
||||
phpPackages = pkgs.phpPackages;
|
||||
|
||||
databasePort = 3306;
|
||||
webPort = 8000;
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
|
||||
process-compose."default" = {
|
||||
imports = [
|
||||
inputs.services.processComposeModules.default
|
||||
];
|
||||
|
||||
services = {
|
||||
mysql."mysql1" = {
|
||||
enable = true;
|
||||
|
||||
initialDatabases = [
|
||||
{ name = "drupal_cms"; }
|
||||
];
|
||||
|
||||
settings.mysqld.port = toString databasePort;
|
||||
};
|
||||
};
|
||||
|
||||
settings.processes = {
|
||||
php = {
|
||||
command = pkgs.writeShellApplication {
|
||||
name = "php-local-server";
|
||||
|
||||
text = "${getExe php} -S 127.0.0.1:${toString webPort} -t web";
|
||||
};
|
||||
|
||||
depends_on."mysql1".condition = "process_healthy";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
inputsFrom = [
|
||||
config.process-compose."default".services.outputs.devShell
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
php
|
||||
phpPackages.composer
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue