Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP blueprint #1563

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

WIP blueprint #1563

wants to merge 1 commit into from

Conversation

zowoq
Copy link
Contributor

@zowoq zowoq commented Nov 12, 2024

No description provided.

# version = inputs.hydra.shortRev;
# src = inputs.hydra;
# buildInputs = o.buildInputs ++ [ final.perlPackages.DBIxClassHelpers ];
# });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved to packages/hydra/default.nix, and then pulled in the module with services.hydra.package = perSystem.self.hydra;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With lite-config this overlay is applied to pkgsso we don't need to do any additional wiring, e.g. .#nixosConfigurations.build03 and .#checks.x86_64-linux.nixosTests-hydra both just work. It is also exposed directly in .#packages.${system}.hydra.

flake.nix Outdated
# treefmt = {
# flakeCheck = system == "x86_64-linux";
# imports = [ ./dev/treefmt.nix ];
# };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create a package/formatter/default.nix for this.

See https://github.com/zimbatm/home/blob/main/packages/formatter/default.nix

@zowoq
Copy link
Contributor Author

zowoq commented Nov 13, 2024

Autoloading host config, modules, devshells, packages is good but I think I'd rather just handle the checks manually. Some things doesn't need to be exposed except as a check and others I want exposed on all platforms but CI should only build one platform.


Minor nit, might be nice to hide these if they aren't used but maybe that is something better handled by flake schemas.

❯ nix flake show

homeModules: unknown
lib: unknown
modules: unknown
templates

@zimbatm
Copy link
Member

zimbatm commented Nov 13, 2024

Thanks for the feedback. For the checks, would it help if I added a checks/ folder that works like the packages/ folder? To restrict the checks to specific platforms, you can annotate them with the meta.platforms attibute.

@zowoq
Copy link
Contributor Author

zowoq commented Nov 13, 2024

For the checks, would it help if I added a checks/ folder that works like the packages/ folder? To restrict the checks to specific platforms, you can annotate them with the meta.platforms attibute.

No, I realise that follows the existing pattern but checks folder and meta.platforms makes it more complicated than it needs to be.

This is fine, just need a way to do it.

checks =
  let
    darwinConfigurations = lib.mapAttrs' (
      name: config: lib.nameValuePair "host-${name}" config.config.system.build.toplevel
    ) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.darwinConfigurations);
    devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
    nixosConfigurations = lib.mapAttrs' (
      name: config: lib.nameValuePair "host-${name}" config.config.system.build.toplevel
    ) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
  in
  darwinConfigurations
  // devShells
  // {
    inherit (self') formatter;
  }
  // nixosConfigurations
  // pkgs.lib.optionalAttrs (system == "x86_64-linux") {
    inherit (self'.packages) docs docs-linkcheck;
    nixpkgs-update-supervisor-test = pkgs.callPackage ./hosts/build02/supervisor_test.nix { };
    nixosTests-buildbot = pkgs.nixosTests.buildbot;
    nixosTests-buildbot-nix-master = inputs'.buildbot-nix.checks.master;
    nixosTests-buildbot-nix-worker = inputs'.buildbot-nix.checks.worker;
    nixosTests-hydra = pkgs.nixosTests.hydra.hydra;
  };

@zimbatm
Copy link
Member

zimbatm commented Nov 13, 2024

So the part that's really custom is:

pkgs.lib.optionalAttrs (system == "x86_64-linux") {
    inherit (self'.packages) docs docs-linkcheck;
    nixpkgs-update-supervisor-test = pkgs.callPackage ./hosts/build02/supervisor_test.nix { };
    nixosTests-buildbot = pkgs.nixosTests.buildbot;
    nixosTests-buildbot-nix-master = inputs'.buildbot-nix.checks.master;
    nixosTests-buildbot-nix-worker = inputs'.buildbot-nix.checks.worker;
    nixosTests-hydra = pkgs.nixosTests.hydra.hydra;
  };

What if you could extend the checks more easily, and let the rest be managed by blueprint?

@zowoq
Copy link
Contributor Author

zowoq commented Nov 13, 2024

What if you could extend the checks more easily, and let the rest be managed by blueprint?

Isn't this going to end up being basically same as what I was asking for as some of the default ones will need to be disabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants