From 4bcedc1a2ebed2c2be3c9ed6fbb54235afdcc31d Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 18 Dec 2024 09:46:54 +0300 Subject: [PATCH] Fmp: Add shfmt. --- .treefmt.toml | 5 +++++ Bootstrap.sh | 4 ++-- flake.nix | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.treefmt.toml b/.treefmt.toml index 909299fd..2b219780 100644 --- a/.treefmt.toml +++ b/.treefmt.toml @@ -14,3 +14,8 @@ excludes = [ command = "nixfmt" options = [ "-s" ] includes = [ "*.nix" ] + +[formatter.shfmt] +command = "shfmt" +options = [ "-s", "-w" ] +includes = [ "*.sh" ] diff --git a/Bootstrap.sh b/Bootstrap.sh index 8766f77e..caf91bf1 100755 --- a/Bootstrap.sh +++ b/Bootstrap.sh @@ -6,7 +6,7 @@ cfg="$(realpath .)" target="${1}" host="${2}" -if [[ "${target}" = "" ]]; then +if [[ ${target} == "" ]]; then printf "Usage: ./.Bootstrap.sh [HOST]\n" exit 2 fi @@ -33,7 +33,7 @@ nixos-generate-config --root /mnt # Install. cd /mnt -if [[ "${host}" = "" ]]; then +if [[ ${host} == "" ]]; then printf "Warning: Installing basic system.\n" nixos-install else diff --git a/flake.nix b/flake.nix index 7276dfc6..a2dea592 100644 --- a/flake.nix +++ b/flake.nix @@ -156,6 +156,7 @@ nativeBuildInputs = with pkgs; [ nixd nixfmt-rfc-style + shfmt treefmt ]; # buildInputs = with pkgs; [ ];