[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

@@ -8,17 +8,26 @@
};
outputs = {self, nixpkgs, impermanence}: {
nixosConfigurations = {
fugitive = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
impermanence.outputs.nixosModules.impermanence
./lib/systems/fugitive
outputs = {self, nixpkgs, impermanence}:
let
customPackagesModule = {...}: {
nixpkgs.overlays =
[
(super: self: { config-archive = super.callPackage ./lib/pkgs/config-archive.nix { }; })
];
};
in
{
nixosConfigurations = {
fugitive = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
customPackagesModule
impermanence.outputs.nixosModules.impermanence
./lib/systems/fugitive
];
};
};
};
};
}

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;