2021-03-05 20:05:50 +01:00
|
|
|
{
|
|
|
|
description = "Zentralwerk network";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs }:
|
|
|
|
let
|
|
|
|
system = "x86_64-linux";
|
|
|
|
systems = [ system ];
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
|
|
|
in
|
|
|
|
rec {
|
2021-03-19 01:41:12 +01:00
|
|
|
lib =
|
2021-03-19 01:52:49 +01:00
|
|
|
import ./nix/lib { inherit nixpkgs; };
|
2021-03-05 20:05:50 +01:00
|
|
|
|
|
|
|
packages = forAllSystems (system: {
|
|
|
|
test_vm = nixpkgs.legacyPackages.${system}.runCommandLocal "test_vm" {
|
|
|
|
src = 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
|
|
|
|
'';
|
2021-03-19 01:41:12 +01:00
|
|
|
} // (import ./nix/pkgs/device-templates.nix { inherit self nixpkgs system; }));
|
2021-03-05 20:05:50 +01:00
|
|
|
|
|
|
|
nixosModule = { ... }: {
|
|
|
|
imports = nixpkgs.lib.filesystem.listFilesRecursive ./nix/nixos-modules;
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.test_vm =
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
inherit system;
|
|
|
|
modules = [ nixosModule ];
|
|
|
|
extraModules = [ ({ ... }: {
|
|
|
|
networking.hostName = "test_vm";
|
|
|
|
}) ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.server1 =
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
inherit system;
|
|
|
|
modules = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|