Skip to content

Commit

Permalink
add aarch64-linux
Browse files Browse the repository at this point in the history
  • Loading branch information
zowoq committed Sep 24, 2024
1 parent 496d576 commit f09e049
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
outputs = { self, nixpkgs }: {
nixosModules.default = { config, lib, ... }: {
outputs = { self, nixpkgs }:
let
systems = [ "aarch64-linux" "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
});
in
{
nixosModules.default = { config, lib, pkgs, ... }: {
imports = [
./nix/module.nix
];

services.prometheus.exporters.cgroup.package = lib.mkDefault self.packages.x86_64-linux.default;
services.prometheus.exporters.cgroup.package = lib.mkDefault self.packages.${pkgs.system}.default;
};

overlays.default = final: prev: {
cgroup-exporter = final.callPackage ./nix/package.nix { };
};

packages.x86_64-linux.default = import ./nix/package.nix {
inherit (nixpkgs.legacyPackages.x86_64-linux) buildGoModule;
};
packages = forAllSystems (system: {
default = import ./nix/package.nix {
inherit (nixpkgsFor."${system}") buildGoModule;
};
});

devShells.x86_64-linux.default = with nixpkgs.legacyPackages.x86_64-linux; mkShell {
name = "cgroups-exporter";
Expand Down

0 comments on commit f09e049

Please sign in to comment.