Compare commits
4 commits
flake-lock
...
main
Author | SHA1 | Date | |
---|---|---|---|
c80ebf9355 | |||
4f53f5de75 | |||
a74ee06ec3 | |||
4b871d332e |
4 changed files with 104 additions and 3 deletions
26
modules/scripts/datepath.nix
Normal file
26
modules/scripts/datepath.nix
Normal 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}))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
35
modules/scripts/onchange.nix
Normal file
35
modules/scripts/onchange.nix
Normal 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
42
modules/scripts/ptest.nix
Normal 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}))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,9 +7,7 @@ pkgs.writeShellApplication {
|
||||||
cat > "$1" << EOF
|
cat > "$1" << EOF
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -o errexit
|
set -euo pipefail
|
||||||
set -o nounset
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue