make it eval

This commit is contained in:
Jörg Thalheim 2023-09-10 09:16:51 +00:00
parent 9ce55f46f4
commit 6fbe58a327
2 changed files with 44 additions and 2 deletions

32
examples/default.nix Normal file
View file

@ -0,0 +1,32 @@
{ nixpkgs, system, buildbot-nix, ... }:
let
# some example configuration to make it eval
dummy = { config, ... }: {
networking.hostName = "example-common";
system.stateVersion = config.system.nixos.version;
users.users.root.initialPassword = "fnord23";
boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
fileSystems."/".device = lib.mkDefault "/dev/sda";
};
inherit (nixpkgs) lib;
inherit (lib) nixosSystem;
in
{
# General
example-master = nixosSystem {
inherit system;
modules = [
dummy
buildbot-nix.nixosModules.buildbot-master
];
};
example-worker = nixosSystem {
inherit system;
modules = [
dummy
buildbot-nix.nixosModules.buildbot-worker
];
};
}

View file

@ -7,14 +7,24 @@
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ flake-parts, ... }:
outputs = inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
systems = lib.systems.flakeExposed;
flake = {
nixosModules.buildbot-master = ./nix/master.nix;
nixosModules.buildbot-worker = ./nix/worker.nix;
nixosConfigurations = import ./examples {
inherit (inputs) nixpkgs;
buildbot-nix = self;
system = "x86_64-linux";
};
perSystem = { pkgs, ... }: {
checks.x86_64-linux = {
nixos-master = self.nixosConfigurations.example-master.config.system.build.toplevel;
nixos-worker = self.nixosConfigurations.example-worker.config.system.build.toplevel;
};
};
perSystem = { pkgs, system, ... }: {
packages.default = pkgs.mkShell {
packages = [
pkgs.bashInteractive