31 lines
786 B
Nix
31 lines
786 B
Nix
{ self, nixpkgs, system }:
|
|
|
|
let
|
|
inherit (self.lib) config;
|
|
|
|
export-config-file = builtins.toFile "config.nix" (
|
|
nixpkgs.lib.generators.toPretty {} config
|
|
);
|
|
# Debug dump aid
|
|
export-config = nixpkgs.legacyPackages.${system}.runCommandLocal "config.nix" {} ''
|
|
cp ${export-config-file} $out
|
|
'';
|
|
|
|
test_vm = nixpkgs.legacyPackages.${system}.runCommandLocal "test_vm" {
|
|
src = self.nixosConfigurations.test_vm.config.system.build.toplevel;
|
|
} ''
|
|
set -x
|
|
mkdir -p $out/{bin,dev,etc,home,mnt,nix/store,nix/var,proc,root,run,sys,tmp,var,usr}
|
|
ln -s $src/init $out/
|
|
ln -s $src/etc $out/etc/static
|
|
'';
|
|
|
|
device-templates = import ./device-templates.nix {
|
|
inherit self nixpkgs system;
|
|
};
|
|
|
|
in
|
|
device-templates // {
|
|
inherit export-config test_vm;
|
|
}
|