[fugitive] Make config part of deployed system

This commit is contained in:
ctsk
2023-08-23 17:33:34 +02:00
parent 8bc595175d
commit 16d6da8c6b
3 changed files with 50 additions and 10 deletions

View File

@@ -0,0 +1,27 @@
{ stdenv, gnutar }:
stdenv.mkDerivation rec {
name = "config-archive";
src = ../../.;
outputs = [ "out" ];
buildInputs = [ gnutar ];
buildPhase = ''
tar czf config.tar.gz -C $src --exclude-ignore=.gitignore .
'';
installPhase = ''
mkdir -p $out/bin
install config.tar.gz $out
echo "
#!/bin/sh
tar xzf ${placeholder "out"}/config.tar.gz --one-top-level
" >> $out/bin/config-extract
chmod +x $out/bin/config-extract
'';
}

View File

@@ -39,6 +39,10 @@
];
};
environment.systemPackages = with pkgs; [
config-archive
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;