[fugitive] Make config part of deployed system
This commit is contained in:
27
lib/pkgs/config-archive.nix
Normal file
27
lib/pkgs/config-archive.nix
Normal 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
|
||||
'';
|
||||
}
|
||||
@@ -39,6 +39,10 @@
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
config-archive
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user