diff --git a/flake.nix b/flake.nix index ed96a35..eeef114 100644 --- a/flake.nix +++ b/flake.nix @@ -128,12 +128,12 @@ ... }@inputs: let + inherit (nixpkgs) lib; + inherit (self) outputs; systems = [ "x86_64-linux" "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" ]; forEachSystem = lib.genAttrs systems; @@ -167,24 +167,6 @@ [ ]; fileList = dir: map (file: ./. + "/${dir}/${file}") (ls dir); - recursiveMerge = - attrList: - let - f = - attrPath: - builtins.zipAttrsWith ( - n: values: - if builtins.tail values == [ ] then - builtins.head values - else if builtins.all builtins.isList values then - lib.unique (builtins.concatLists values) - else if builtins.all builtins.isAttrs values then - f (attrPath ++ [ n ]) values - else - lib.last values - ); - in - f [ ] attrList; config = { repos = [ @@ -221,6 +203,9 @@ }; in { + inherit (self) outputs; + hydraJobs = import ./hydra.nix { inherit inputs outputs; }; + formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); nixosConfigurations = @@ -354,4 +339,5 @@ } ) sops-nix.packages; }; + } diff --git a/hydra.nix b/hydra.nix new file mode 100644 index 0000000..b3121b9 --- /dev/null +++ b/hydra.nix @@ -0,0 +1,9 @@ +{ inputs, outputs }: +let + inherit (inputs.nixpkgs.lib) mapAttrs; + + getCfg = _: cfg: cfg.config.system.build.toplevel; +in +{ + hosts = mapAttrs getCfg outputs.nixosConfigurations; +}