[fugitive] Make config part of deployed system
This commit is contained in:
13
flake.nix
13
flake.nix
@@ -8,17 +8,26 @@
|
||||
};
|
||||
|
||||
|
||||
outputs = {self, nixpkgs, impermanence}: {
|
||||
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
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
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