24 current 2024-04-17 17:19:51 23.11.20240405.72da83d 6.1.84 *

This commit is contained in:
Jonas Röger 2024-04-17 17:21:16 +02:00
parent ebedd90923
commit df2b89632c
Signed by: jonas
GPG Key ID: 4000EB35E1AE0F07
3 changed files with 27 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.log

View File

@ -11,6 +11,7 @@
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
../../modules/bin/nix-scripts.nix
../../modules/hardware/bluetooth.nix ../../modules/hardware/bluetooth.nix
../../modules/hardware/printing.nix ../../modules/hardware/printing.nix
../../modules/hardware/sound.nix ../../modules/hardware/sound.nix

View File

@ -0,0 +1,25 @@
{
config,
pkgs,
...
}: let
rebuild =
pkgs.writeShellScriptBin ".nixos-rebuild"
''
set -e
pushd ~/.nixos/
${pkgs.alejandra}/bin/alejandra . &>/dev/null
${pkgs.git}/bin/git diff -U0 *.nix
echo "NixOS Rebuilding..."
sudo nixos-rebuild switch --flake . &>nixos-switch.log || (
${pkgs.coreutils-full}/bin/cat nixos-switch.log | ${pkgs.gnugrep}/bin/grep --color error && false)
gen=$(nixos-rebuild list-generations | ${pkgs.gnugrep}/bin/grep current)
${pkgs.git}/bin/git commit -am "$gen"
popd
'';
in {
environment.systemPackages = [
pkgs.bash
rebuild
];
}