From 54840dc4f00b1fbf0c1f422c584246e2f814cbf0 Mon Sep 17 00:00:00 2001 From: buffet Date: Sun, 13 Aug 2023 19:23:02 +0200 Subject: [PATCH] feat: add update command --- flake.nix | 2 -- programs/bash.nix | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index fce16f8..5961b70 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,4 @@ { - nixConfig.commit-lockfile-summary = "chore: update"; - inputs = { impermanence.url = "github:nix-community/impermanence"; nixos-hardware.url = "github:NixOS/nixos-hardware"; diff --git a/programs/bash.nix b/programs/bash.nix index 3307a32..674adc9 100644 --- a/programs/bash.nix +++ b/programs/bash.nix @@ -18,6 +18,12 @@ in { htop = "htop -t"; mkdir = "mkdir -p"; rg = "rg -S"; + update = let + change-message = pkgs.writeScript "change-commit-message" '' + #!/bin/sh + sed -i '1s/.*/chore: update/' "$1" + ''; + in "nix flake update --commit-lock-file && EDITOR=${change-message} git commit --amend"; }; shellOptions = [