Compare commits

...

2 commits

Author SHA1 Message Date
teutat3s e7b03b9770
dumpyourvms: core: use linuxPackages_6_1 and add
All checks were successful
continuous-integration/drone/push Build is passing
check for kernel version for WiFi kernel module pre-sleep + post-sleep
hook
2023-04-26 12:54:38 +02:00
teutat3s 8f0790b6fd
pre-commit hook: only format modified lines
instead of entire files
2023-04-26 12:49:44 +02:00
3 changed files with 20 additions and 6 deletions

View file

@ -135,8 +135,12 @@ in {
# brcmfmac being loaded during hibernation would inhibit a successful resume
# https://bugzilla.kernel.org/show_bug.cgi?id=101681#c116.
# Also brcmfmac could randomly crash on resume from sleep.
powerUpCommands = lib.mkBefore "${pkgs.kmod}/bin/modprobe brcmfmac_wcc brcmfmac";
powerDownCommands = lib.mkBefore "${pkgs.kmod}/bin/rmmod brcmfmac_wcc brcmfmac";
powerUpCommands = lib.mkBefore ("${pkgs.kmod}/bin/modprobe brcmfmac"
+ lib.optionalString
(lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") " brcmfmac_wcc");
powerDownCommands = lib.mkBefore ("${pkgs.kmod}/bin/rmmod brcmfmac"
+ lib.optionalString
(lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") " brcmfmac_wcc");
};
# Change lid switch behaviour

View file

@ -36,7 +36,7 @@ in {
loader.systemd-boot.enable = lib.mkDefault true;
# Use latest linux kernel by default
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_2;
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_1;
# Support ntfs drives
supportedFilesystems = ["ntfs"];

View file

@ -9,15 +9,25 @@ fi
diff="git diff-index --name-only --cached $against --diff-filter d"
all_files=($($diff))
mapfile -t all_files < <($diff)
# Format staged files.
# Stash only unstaged changes, keeping staged changes
old_stash=$(git rev-parse --quiet --verify refs/stash)
git stash push --quiet --keep-index -m 'Unstaged changes before pre-commit hook'
new_stash=$(git rev-parse --quiet --verify refs/stash)
# Format staged files
if ((${#all_files[@]} != 0)); then
treefmt "${all_files[@]}" &&
git add "${all_files[@]}"
fi
# check editorconfig
# If unstaged changes were stashed re-apply to working tree
if [ "$old_stash" != "$new_stash" ]; then
git stash pop --quiet
fi
# Check editorconfig
if ((${#all_files[@]} != 0)); then
if ! editorconfig-checker -- "${all_files[@]}"; then
printf "%b\n" \