Improve web development setup
Group kinds of projects in files. Hide info for customers via git crypt. Solve todo to auto generate permissions for databases.
This commit is contained in:
parent
1be9c42770
commit
3fbb26a6f6
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -5,4 +5,5 @@ home/files/rclone.conf filter=git-crypt diff=git-crypt
|
|||
home/files/typo3-configuration/client-specific/** filter=git-crypt diff=git-crypt
|
||||
home/packages/custom/dmenu-scripts/customer-issue.sh filter=git-crypt diff=git-crypt
|
||||
systems/hikari/files/hosts filter=git-crypt diff=git-crypt
|
||||
systems/hikari/web-development/projects/customer.nix filter=git-crypt diff=git-crypt
|
||||
shells/** filter=git-crypt diff=git-crypt
|
||||
|
|
|
@ -32,8 +32,6 @@ See: https://github.com/NixOS/nixos-hardware
|
|||
TODOs
|
||||
-----
|
||||
|
||||
* Auto generate permissions for all the databases.
|
||||
|
||||
* Add docker-compose / podman-compose for Elasticsearch, proxy, solr.
|
||||
|
||||
* Add xdebug setup for fpm.
|
||||
|
|
|
@ -1,17 +1,24 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
let
|
||||
|
||||
mysqlEnsurePermissionsForDevUser = builtins.listToAttrs (
|
||||
map (databaseName: {
|
||||
name = "${databaseName}.*";
|
||||
value = "ALL PRIVILEGES";
|
||||
})
|
||||
config.custom.web-development.databases
|
||||
);
|
||||
|
||||
in {
|
||||
imports = [
|
||||
|
||||
./lib/mkcert.nix
|
||||
|
||||
./domains/mailhog.localhost.nix
|
||||
|
||||
./domains/tea-docs.typo3.localhost.nix
|
||||
|
||||
./domains/daniel-siepmann.localhost.nix
|
||||
|
||||
./domains/monorepo.reuter.localhost.nix
|
||||
./projects/private.nix
|
||||
./projects/service-wrapper.nix
|
||||
./projects/typo3.nix
|
||||
./projects/customer.nix
|
||||
|
||||
];
|
||||
|
||||
|
@ -21,6 +28,19 @@
|
|||
rootPath = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "/var/projects";
|
||||
description = ''
|
||||
The root folder where web development happens.
|
||||
All Projects need to be placed within this folder.
|
||||
'';
|
||||
};
|
||||
databases = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.string;
|
||||
default = [];
|
||||
example = lib.literalExpression "[namespace_project namespace2_project1]";
|
||||
description = ''
|
||||
A list of all necessary databases.
|
||||
Used to create the databases and grant permissions.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -67,18 +87,14 @@
|
|||
# INITIALLY once change dev user to be identified by password
|
||||
# alter user dev@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD('dev');
|
||||
name = "dev";
|
||||
ensurePermissions = {
|
||||
# TODO: Auto build from defined databases?!
|
||||
"own_danielsiepmann.*" = "ALL PRIVILEGES";
|
||||
"reuter_reuter.*" = "ALL PRIVILEGES";
|
||||
};
|
||||
ensurePermissions = mysqlEnsurePermissionsForDevUser;
|
||||
}
|
||||
];
|
||||
|
||||
ensureDatabases = [
|
||||
"testing" # Used by TYPO3 functional tests
|
||||
"testing_at" # Used by TYPO3 Acceptance tests
|
||||
];
|
||||
] ++ config.custom.web-development.databases;
|
||||
|
||||
settings = {
|
||||
mysqld = {
|
||||
|
@ -94,7 +110,7 @@
|
|||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
# Would be cool to improve this somehow.
|
||||
# TODO: Improve linking TYPO3 global configuration
|
||||
# Current issues: The link is created once against nix store.
|
||||
# Changes are not reflected until reboot?
|
||||
"C ${config.custom.web-development.rootPath}/own/typo3-configuration - - - - ${config.users.users.daniels.home}/.local/share/typo3-configuration"
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
pkgs
|
||||
,lib
|
||||
,config
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
phps = import <phps>;
|
||||
in import ./../lib/create-typo3.nix {
|
||||
inherit config lib pkgs;
|
||||
|
||||
domain = "monorepo.reuter.localhost";
|
||||
relativeDocumentRoot = "company/customers/reuter/monorepo";
|
||||
databaseName = "reuter_reuter";
|
||||
phpPackage = phps.packages.x86_64-linux.php73;
|
||||
}
|
|
@ -11,6 +11,12 @@
|
|||
let
|
||||
documentRoot = "${config.custom.web-development.rootPath}/${relativeDocumentRoot}";
|
||||
in {
|
||||
custom.web-development = {
|
||||
|
||||
databases = [databaseName];
|
||||
|
||||
};
|
||||
|
||||
services = {
|
||||
|
||||
httpd.virtualHosts.${domain} = {
|
||||
|
@ -98,7 +104,5 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
mysql.ensureDatabases = [databaseName];
|
||||
|
||||
};
|
||||
}
|
||||
|
|
BIN
systems/hikari/web-development/projects/customer.nix
Normal file
BIN
systems/hikari/web-development/projects/customer.nix
Normal file
Binary file not shown.
Loading…
Reference in a new issue