Back to a regular flake

This commit is contained in:
Oliver Davies 2025-03-30 21:17:25 +01:00
parent cc8cdbcf96
commit 84cc801e70
8 changed files with 65 additions and 174 deletions

6
.envrc
View file

@ -1,5 +1 @@
export DIRENV_WARN_TIMEOUT=20s
eval "$(devenv direnvrc)"
use devenv
use flake

11
.tmux
View file

@ -1,9 +1,12 @@
#!/usr/bin/env bash
tmux new-window -dn shell
tmux new-window -dn server
tmux new-window -dn daily_emails -c "source/_daily_emails"
PATH="${PATH}:./vendor/bin"
tmux send-keys -t server "devenv up" Enter
tmux new-window -dn scratch
tmux new-window -dn sculpin
tmux new-window -dn tailwind
tmux send-keys -t sculpin "sculpin generate --server --watch" Enter
tmux send-keys -t tailwind "cd assets && tailwindcss --input css/tailwind.css --output ../source/build/tailwind-new.css --watch" Enter
nvim .

View file

@ -1,103 +0,0 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1740256804,
"owner": "cachix",
"repo": "devenv",
"rev": "b799e753d331086a1cc307405df7a93d2cfdab13",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1737465171,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1733477122,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": [
"git-hooks"
]
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,47 +0,0 @@
{ pkgs, ... }:
{
packages = with pkgs; [
git
tailwindcss
];
languages = {
php.enable = true;
};
processes = {
sculpin.exec = "vendor/bin/sculpin generate --server --watch";
tailwind = {
exec = "tailwindcss --config tailwind.config.ts --input css/tailwind.css --output ../source/build/tailwind.css --watch";
process-compose = {
is_tty = true;
working_dir = "assets";
};
};
};
tasks = { };
enterShell = ''
[[ ! -d vendor ]] && composer install
'';
enterTest = '''';
scripts = {
publish.exec = ''
sculpin generate --env prod
rsync -avz static/ output_prod
rsync -avz output_prod/ ssh.oliverdavies.uk:/var/www/vhosts/www.oliverdavies.uk
'';
"tailwind-build".exec = ''
cd assets
tailwindcss --config tailwind.config.ts --input css/tailwind.css --output ../source/build/tailwind.css --minify
'';
};
}

View file

@ -1,15 +0,0 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
# If you're using non-OSS software, you can set allowUnfree to true.
# allowUnfree: true
# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"
# If you have more than one devenv you can merge them
#imports:
# - ./backend

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1742422364,
"narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

21
flake.nix Normal file
View file

@ -0,0 +1,21 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
{ nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
php83
php83Packages.composer
tailwindcss
];
};
formatter.${system} = pkgs.nixfmt-rfc-style;
};
}

9
tools/scripts/publish Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
vendor/bin/sculpin generate --env prod
rsync -uvrP static/ output_prod "$@"
rsync -uvrP output_prod/ ssh.oliverdavies.uk:/var/www/vhosts/www.oliverdavies.uk "$@"