Compare commits

..

4 commits

Author SHA1 Message Date
c80ebf9355 Add datepath script
All checks were successful
/ check (push) Successful in 1m53s
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
2025-09-24 23:40:15 +01:00
4f53f5de75 Add ptest to run and watch PHP tests
All checks were successful
/ check (push) Successful in 1m37s
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
2025-09-24 02:08:26 +01:00
a74ee06ec3 Create onchange script
Some checks are pending
/ check (push) Waiting to run
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
2025-09-24 01:35:51 +01:00
4b871d332e Refactor
Some checks are pending
/ check (push) Waiting to run
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
2025-09-23 12:31:56 +01:00
5 changed files with 137 additions and 36 deletions

66
flake.lock generated
View file

@ -26,11 +26,11 @@
"bop-scripts": {
"flake": false,
"locked": {
"lastModified": 1757900376,
"narHash": "sha256-s/a5muTDPFOA2IuDZrKVcyuJQBTyg76TdB3I6vb5cL4=",
"lastModified": 1756931648,
"narHash": "sha256-bfAmJ1IY0B6eNbJvoWkUMQ7Ya4ShrIoVSdQrnE/cn40=",
"owner": "breadonpenguins",
"repo": "scripts",
"rev": "14b951ae1a61f0350e7381304b3962c29a6b23b8",
"rev": "d04bcbe63176e623e1ce8edc4c3840c506a28d96",
"type": "github"
},
"original": {
@ -105,11 +105,11 @@
]
},
"locked": {
"lastModified": 1758287904,
"narHash": "sha256-IGmaEf3Do8o5Cwp1kXBN1wQmZwQN3NLfq5t4nHtVtcU=",
"lastModified": 1756733629,
"narHash": "sha256-dwWGlDhcO5SMIvMSTB4mjQ5Pvo2vtxvpIknhVnSz2I8=",
"owner": "nix-community",
"repo": "disko",
"rev": "67ff9807dd148e704baadbd4fd783b54282ca627",
"rev": "a5c4f2ab72e3d1ab43e3e65aa421c6f2bd2e12a1",
"type": "github"
},
"original": {
@ -205,10 +205,10 @@
]
},
"locked": {
"lastModified": 1757063075,
"narHash": "sha256-DpZgkdZELTZ/F/O+Xgj81E+01S5Zp2JCMa8zruEZe9o=",
"lastModified": 1757018109,
"narHash": "sha256-KfRzBPOOM5cf8mFVeWjV7TGa3p+ul/flxnUdwGW4Sds=",
"ref": "refs/heads/main",
"rev": "19591ad8e1f3c261e84b487307c8534dd67a3707",
"rev": "63235768261976efe0d9c825e69c44fff8c80e5d",
"revCount": 1,
"type": "git",
"url": "https://code.oliverdavies.uk/opdavies/git-repo-updater"
@ -246,11 +246,11 @@
]
},
"locked": {
"lastModified": 1758593331,
"narHash": "sha256-p+904PfmINyekyA/LieX3IYGsiFtExC00v5gSYfJtpM=",
"lastModified": 1756991914,
"narHash": "sha256-4ve/3ah5H/SpL2m3qmZ9GU+VinQYp2MN1G7GamimTds=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "9a2dc0efbc569ce9352a6ffb8e8ec8dbc098e142",
"rev": "b08f8737776f10920c330657bee8b95834b7a70f",
"type": "github"
},
"original": {
@ -310,11 +310,11 @@
]
},
"locked": {
"lastModified": 1758427679,
"narHash": "sha256-xwjWRJTKDCjQ0iwfh7WhDhgcS0Wt3d1Yscg83mKBCn4=",
"lastModified": 1756612744,
"narHash": "sha256-/glV6VAq8Va3ghIbmhET3S1dzkbZqicsk5h+FtvwiPE=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "fd2569ca2ef7d69f244cd9ffcb66a0540772ff85",
"rev": "3fe768e1f058961095b4a0d7a2ba15dc9736bdc6",
"type": "github"
},
"original": {
@ -325,11 +325,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1757943327,
"narHash": "sha256-w6cDExPBqbq7fTLo4dZ1ozDGeq3yV6dSN4n/sAaS6OM=",
"lastModified": 1756925795,
"narHash": "sha256-kUb5hehaikfUvoJDEc7ngiieX88TwWX/bBRX9Ar6Tac=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "67a709cfe5d0643dafd798b0b613ed579de8be05",
"rev": "ba6fab29768007e9f2657014a6e134637100c57d",
"type": "github"
},
"original": {
@ -341,11 +341,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1758277210,
"narHash": "sha256-iCGWf/LTy+aY0zFu8q12lK8KuZp7yvdhStehhyX1v8w=",
"lastModified": 1756787288,
"narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8eaee110344796db060382e15d3af0a9fc396e0e",
"rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1",
"type": "github"
},
"original": {
@ -398,11 +398,11 @@
"systems": "systems_3"
},
"locked": {
"lastModified": 1758551108,
"narHash": "sha256-3KArqJcnrcEr1M3QsBG7NZRQSxVNFI3In+9MHdVmUKY=",
"lastModified": 1756946299,
"narHash": "sha256-N4PjGA0rittpNZGscKPel+mr/dMcKF73j0yr4rbG3T0=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "f828dead7723e7680b09929b9886225389d0370b",
"rev": "63496f00c681b3e200bd17878a43ec68b7139a66",
"type": "github"
},
"original": {
@ -419,11 +419,11 @@
]
},
"locked": {
"lastModified": 1758603982,
"narHash": "sha256-ig0+mpQvUrp56909gMkF0lxQ0nGEXZtljIZWnrrRG1Y=",
"lastModified": 1757050467,
"narHash": "sha256-Rps0Ga0g/TdY49rR2ZRBsdBYybSzPccEsaI9IvwuE98=",
"owner": "nix-community",
"repo": "NUR",
"rev": "de4f5ff4f5dabad8356f67119fbe582a44c9e969",
"rev": "985abf0197c75dd64c24691a7e5e0acf308d7f20",
"type": "github"
},
"original": {
@ -442,11 +442,11 @@
]
},
"locked": {
"lastModified": 1758272005,
"narHash": "sha256-1u3xTH+3kaHhztPmWtLAD8LF5pTYLR2CpsPFWTFnVtQ=",
"lastModified": 1755555503,
"narHash": "sha256-WiOO7GUOsJ4/DoMy2IC5InnqRDSo2U11la48vCCIjjY=",
"owner": "NuschtOS",
"repo": "search",
"rev": "aa975a3757f28ce862812466c5848787b868e116",
"rev": "6f3efef888b92e6520f10eae15b86ff537e1d2ea",
"type": "github"
},
"original": {
@ -483,11 +483,11 @@
"rwxrob-dot": {
"flake": false,
"locked": {
"lastModified": 1758333677,
"narHash": "sha256-gSR2fOzlWA7dtWEsoVjUIdLjZU2gBAxm0JLbk7TEo+g=",
"lastModified": 1751898094,
"narHash": "sha256-kGpHL2l9p/yOtmG+AZvOb0Y5mH1d+Zoh2dd5N3Xjizc=",
"owner": "rwxrob",
"repo": "dot",
"rev": "d0d9eccb3834b1dbde2b133e811d71a05b9ac7f3",
"rev": "90794c77061f270078e847af45c376610768c6e2",
"type": "github"
},
"original": {

View file

@ -0,0 +1,26 @@
{ withSystem, ... }:
let
name = "datepath";
in
{
perSystem =
{ pkgs, ... }:
{
packages.${name} = pkgs.writeShellApplication {
inherit name;
runtimeInputs = with pkgs; [ coreutils ];
text = ''date "+%4Y/%m/%d" "-d ''${*:-now}"'';
};
};
flake.modules.homeManager.base =
{ pkgs, ... }:
{
home.packages = [
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
];
};
}

View file

@ -0,0 +1,35 @@
{ withSystem, ... }:
let
name = "onchange";
in
{
perSystem =
{ pkgs, ... }:
with pkgs;
{
packages.${name} = writeShellApplication {
inherit name;
runtimeInputs = [
coreutils
entr
];
text = ''
PATTERN="$1"
shift 1
find . -path "$PATTERN" -type f | entr -cs "$@"
'';
};
};
flake.modules.homeManager.base =
{ pkgs, ... }:
{
home.packages = [
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
];
};
}

42
modules/scripts/ptest.nix Normal file
View file

@ -0,0 +1,42 @@
{ withSystem, ... }:
let
name = "ptest";
in
{
perSystem =
psArgs@{ pkgs, ... }:
with pkgs;
{
packages.${name} = writeShellApplication {
inherit name;
runtimeInputs = [
psArgs.config.packages.onchange
];
text = ''
command="phpunit"
args=("--colors")
bin="vendor/bin"
if [[ -x "$bin/pest" ]]; then
command="pest"
args=()
fi
onchange "**/*.php" \
"$bin/$command ''${args[*]} $*"
'';
};
};
flake.modules.homeManager.base =
{ pkgs, ... }:
{
home.packages = [
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
];
};
}

View file

@ -7,9 +7,7 @@ pkgs.writeShellApplication {
cat > "$1" << EOF
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
set -euo pipefail
EOF