wip
This commit is contained in:
parent
63bf55b978
commit
8b18e05fbc
25 changed files with 1042 additions and 1 deletions
12
working-without-workspace/code/Dockerfile.twig
Normal file
12
working-without-workspace/code/Dockerfile.twig
Normal file
|
@ -0,0 +1,12 @@
|
|||
FROM php:{{ php.version }} AS base
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
RUN which composer && composer -V
|
||||
|
||||
ARG DOCKER_UID=1000
|
||||
ENV DOCKER_UID="${DOCKER_UID}"
|
||||
|
||||
WORKDIR {{ project_root }}
|
||||
|
||||
RUN adduser --disabled-password --uid "${DOCKER_UID}" app \
|
||||
&& chown app:app -R {{ project_root }}
|
13
working-without-workspace/code/aliases.sh
Normal file
13
working-without-workspace/code/aliases.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
alias cp="cp -v"
|
||||
alias mv="mv -v"
|
||||
alias rm="rm -v"
|
||||
|
||||
alias g="git"
|
||||
alias gs="git status"
|
||||
|
||||
alias dk="docker"
|
||||
alias dkp="docker ps"
|
||||
alias dkc="docker compose"
|
||||
alias dkcu="docker compose up"
|
||||
|
||||
alias docker-composer="docker-compose"
|
46
working-without-workspace/code/build.yaml
Normal file
46
working-without-workspace/code/build.yaml
Normal file
|
@ -0,0 +1,46 @@
|
|||
name: docker-example-drupal
|
||||
language: php
|
||||
type: drupal-project
|
||||
|
||||
web:
|
||||
type: nginx
|
||||
|
||||
database:
|
||||
type: mariadb
|
||||
version: 10
|
||||
|
||||
php:
|
||||
version: 8.1-fpm-bullseye
|
||||
phpcs:
|
||||
standard: Drupal,DrupalPractice
|
||||
phpstan:
|
||||
level: max
|
||||
|
||||
drupal:
|
||||
docroot: web
|
||||
|
||||
docker-compose:
|
||||
services:
|
||||
database: ~
|
||||
php:
|
||||
build:
|
||||
target: build
|
||||
|
||||
dockerfile:
|
||||
stages:
|
||||
build:
|
||||
extends: base
|
||||
packages:
|
||||
- git
|
||||
- libpng-dev
|
||||
- libzip-dev
|
||||
- mariadb-client
|
||||
- unzip
|
||||
extensions:
|
||||
install:
|
||||
- gd
|
||||
- pdo_mysql
|
||||
- zip
|
||||
commands:
|
||||
- composer validate --strict
|
||||
- composer install
|
26
working-without-workspace/code/configuration.nix
Normal file
26
working-without-workspace/code/configuration.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
networking.hostName = "nixedo";
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
time.timeZone = "Europe/London";
|
||||
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
users.users.opdavies = {
|
||||
isNormalUser = true;
|
||||
description = "Oliver Davies";
|
||||
extraGroups = [ "docker" "networkmanager" "wheel" ];
|
||||
packages = with pkgs; [ firefox ];
|
||||
};
|
15
working-without-workspace/code/docker-compose.yaml.twig
Normal file
15
working-without-workspace/code/docker-compose.yaml.twig
Normal file
|
@ -0,0 +1,15 @@
|
|||
{% if "php" == language %}
|
||||
php:
|
||||
<<: *default-app
|
||||
build:
|
||||
context: .
|
||||
target: build
|
||||
args:
|
||||
- "DOCKER_UID=${DOCKER_UID:-1000}"
|
||||
volumes:
|
||||
- .:{{ project_root }}
|
||||
{% if "database" in dockerCompose.services|keys -%}
|
||||
depends_on:
|
||||
- database
|
||||
{% endif -%}
|
||||
profiles: [php]
|
19
working-without-workspace/code/flake.nix
Normal file
19
working-without-workspace/code/flake.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
|
||||
outputs = inputs@{ flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [ inputs.devshell.flakeModule ];
|
||||
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
||||
devshells.default = {
|
||||
packages = with pkgs; [ php82 php82Packages.composer ];
|
||||
};
|
||||
};
|
||||
|
||||
flake = { };
|
||||
};
|
||||
}
|
27
working-without-workspace/code/git.nix
Normal file
27
working-without-workspace/code/git.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Oliver Davies";
|
||||
userEmail = "oliver@oliverdavies.uk";
|
||||
|
||||
aliases = {
|
||||
aa = "add --all";
|
||||
assume = "update-index --assume-unchanged";
|
||||
assumed = "!git ls-files -v | grep '^[hsmrck?]' | cut -c 3-";
|
||||
b = "branch";
|
||||
# ...
|
||||
};
|
||||
extraConfig = {
|
||||
branch = {
|
||||
autosetupmerge = true;
|
||||
autosetuprebase = "always";
|
||||
};
|
||||
checkout.defaultRemote = "origin";
|
||||
color.ui = true;
|
||||
commit = {
|
||||
template = "~/.gitmessage";
|
||||
};
|
||||
core = {
|
||||
editor = "nvim";
|
||||
excludesFile = "~/.gitignore-global";
|
||||
pager = "delta";
|
||||
};
|
15
working-without-workspace/code/gitconfig.ini
Normal file
15
working-without-workspace/code/gitconfig.ini
Normal file
|
@ -0,0 +1,15 @@
|
|||
[alias]
|
||||
aa = "add --all"
|
||||
assume = "update-index --assume-unchanged"
|
||||
assumed = "!git ls-files -v | grep '^[hsmrck?]' | cut -c 3-"
|
||||
b = "branch"
|
||||
browse = "!gh repo view --web"
|
||||
ca = "commit --amend --verbose"
|
||||
car = "commit --amend --no-edit"
|
||||
|
||||
[branch]
|
||||
autosetupmerge = true
|
||||
autosetuprebase = "always"
|
||||
|
||||
[checkout]
|
||||
defaultRemote = "origin"
|
25
working-without-workspace/code/hardware-configuration.nix
Normal file
25
working-without-workspace/code/hardware-configuration.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules =
|
||||
[ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.kernelParams = [ "i8042.reset" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/7c6d69ec-ba06-4ddb-b9c4-62b3994fda91";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/B729-9A75";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[{ device = "/dev/disk/by-uuid/5db0a0e6-93fb-4d0b-8fb0-fdb3cb76b89d"; }];
|
11
working-without-workspace/code/home-manager.nix
Normal file
11
working-without-workspace/code/home-manager.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.username = "opdavies";
|
||||
home.homeDirectory = "/home/opdavies";
|
||||
|
||||
home.packages = with pkgs; [
|
||||
php82
|
||||
php82Packages.composer
|
||||
];
|
||||
};
|
12
working-without-workspace/code/justfile.twig
Normal file
12
working-without-workspace/code/justfile.twig
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% if "php" is same as language %}
|
||||
composer *args:
|
||||
{{ "just _exec php composer {{ args }}" | raw }}
|
||||
|
||||
{% if "drupal-project" is same as type %}
|
||||
drush *args:
|
||||
{{ "just _exec php drush {{ args }}" | raw }}
|
||||
|
||||
install *args:
|
||||
{{ "just _exec php drush site:install -y {{ args }}" | raw }}
|
||||
{% endif %}
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue