summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 4e4ece1fabff7897d4ccd7753443cffe79e14710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
  description = "teawie moment";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

  outputs = {
    self,
    nixpkgs,
    ...
  }: let
    systems = [
      "x86_64-linux"
      "aarch64-linux"
      "x86_64-darwin"
      "aarch64-darwin"
    ];

    forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
  in {
    nixosModules.default = import ./nix/module.nix self;

    packages = forAllSystems ({
      pkgs,
      system,
      ...
    }: {
      teawiebot = pkgs.callPackage ./nix/derivation.nix {inherit self;};
      default = self.packages.${system}.teawiebot;
    });

    overlays.default = _: prev: {
      teawiebot = prev.callPackage ./nix/derivation.nix {inherit self;};
    };
  };
}