Hi there !
I want to add a function to be available in my shell:
iain_nr() {
output="${1%%.*}_iain_nr.${1##*.}"
echo $output
gmic -input $1 iain_nr_2019 1,0,0,0,0.5,1,0,30,3,0,5,2,0.5,4,0 -output "${output}"
}
So I add this to environment.shellInit
as such:
environment.shellInit = ''
iain_nr() {
output="${1%%.*}_iain_nr.${1##*.}"
echo $output
gmic -input $1 iain_nr_2019 1,0,0,0,0.5,1,0,30,3,0,5,2,0.5,4,0 -output "${output}"
}
'';
But I get this error:
error: syntax error, unexpected invalid token, expecting '}'
at /etc/nixos/aliases.nix:29:18:
28| iain_nr() {
29| output="${1%%.*}_iain_nr.${1##*.}"
| ^
30| echo $output
(use '--show-trace' to show detailed location information)
What is the correct way to use shell parameter expansion in a nix string?