mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Format .nix files
This does not include any automation for the release branch, but is based on the configuration of https://github.com/NixOS/nix/pull/12349 pre-commit run -a nixfmt-rfc-style
This commit is contained in:
parent
6cb17fd836
commit
32aed360b8
266 changed files with 7443 additions and 5118 deletions
|
@ -3,57 +3,56 @@ with import ./config.nix;
|
|||
rec {
|
||||
hello = mkDerivation {
|
||||
name = "hello";
|
||||
outputs = [ "out" "dev" ];
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
];
|
||||
meta.outputsToInstall = [ "out" ];
|
||||
buildCommand =
|
||||
''
|
||||
mkdir -p $out/bin $dev/bin
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin $dev/bin
|
||||
|
||||
cat > $out/bin/hello <<EOF
|
||||
#! ${shell}
|
||||
who=\$1
|
||||
echo "Hello \''${who:-World} from $out/bin/hello"
|
||||
EOF
|
||||
chmod +x $out/bin/hello
|
||||
cat > $out/bin/hello <<EOF
|
||||
#! ${shell}
|
||||
who=\$1
|
||||
echo "Hello \''${who:-World} from $out/bin/hello"
|
||||
EOF
|
||||
chmod +x $out/bin/hello
|
||||
|
||||
cat > $dev/bin/hello2 <<EOF
|
||||
#! ${shell}
|
||||
echo "Hello2"
|
||||
EOF
|
||||
chmod +x $dev/bin/hello2
|
||||
'';
|
||||
cat > $dev/bin/hello2 <<EOF
|
||||
#! ${shell}
|
||||
echo "Hello2"
|
||||
EOF
|
||||
chmod +x $dev/bin/hello2
|
||||
'';
|
||||
};
|
||||
|
||||
hello-symlink = mkDerivation {
|
||||
name = "hello-symlink";
|
||||
buildCommand =
|
||||
''
|
||||
ln -s ${hello} $out
|
||||
'';
|
||||
buildCommand = ''
|
||||
ln -s ${hello} $out
|
||||
'';
|
||||
};
|
||||
|
||||
forbidden-symlink = mkDerivation {
|
||||
name = "forbidden-symlink";
|
||||
buildCommand =
|
||||
''
|
||||
ln -s /tmp/foo/bar $out
|
||||
'';
|
||||
buildCommand = ''
|
||||
ln -s /tmp/foo/bar $out
|
||||
'';
|
||||
};
|
||||
|
||||
salve-mundi = mkDerivation {
|
||||
name = "salve-mundi";
|
||||
outputs = [ "out" ];
|
||||
meta.outputsToInstall = [ "out" ];
|
||||
buildCommand =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
cat > $out/bin/hello <<EOF
|
||||
#! ${shell}
|
||||
echo "Salve Mundi from $out/bin/hello"
|
||||
EOF
|
||||
chmod +x $out/bin/hello
|
||||
'';
|
||||
cat > $out/bin/hello <<EOF
|
||||
#! ${shell}
|
||||
echo "Salve Mundi from $out/bin/hello"
|
||||
EOF
|
||||
chmod +x $out/bin/hello
|
||||
'';
|
||||
};
|
||||
|
||||
# execs env from PATH, so that we can probe the environment
|
||||
|
@ -61,20 +60,19 @@ rec {
|
|||
env = mkDerivation {
|
||||
name = "env";
|
||||
outputs = [ "out" ];
|
||||
buildCommand =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
cat > $out/bin/env <<EOF
|
||||
#! ${shell}
|
||||
if [ $# -ne 0 ]; then
|
||||
echo "env: Unexpected arguments ($#): $@" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
exec env
|
||||
EOF
|
||||
chmod +x $out/bin/env
|
||||
'';
|
||||
cat > $out/bin/env <<EOF
|
||||
#! ${shell}
|
||||
if [ $# -ne 0 ]; then
|
||||
echo "env: Unexpected arguments ($#): $@" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
exec env
|
||||
EOF
|
||||
chmod +x $out/bin/env
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue