-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
46 lines (41 loc) · 1.48 KB
/
flake.nix
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
36
37
38
39
40
41
42
43
44
45
46
{
description = "Ascii Coffee Status Server";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.napalm.url = "github:nix-community/napalm";
inputs.napalm.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, napalm }:
let
# Generate a user-friendly version number.
version = builtins.substring 0 8 self.lastModifiedDate;
supportedSystems = [ "x86_64-linux" "aarch64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f:
nixpkgs.lib.genAttrs supportedSystems (system: f system);
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [
self.overlay
];
});
in
{
overlay = final: prev: {
ascii-coffee-status = (napalm.overlays.default final prev).napalm.buildPackage ./. {
customPatchPackages = {
"husky" = pkgs: prev: {};
"typescript" = pkgs: prev: {};
};
};
};
# Provide your packages for selected system types.
packages = forAllSystems (system: {
inherit (nixpkgsFor.${system}) ascii-coffee-status;
});
# The default package for 'nix build'. This makes sense if the
# flake provides only one package or there is a clear "main"
# package.
defaultPackage =
forAllSystems (system: self.packages.${system}.ascii-coffee-status);
};
}