forked from misterhat/nosefart
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
49 lines (39 loc) · 1.4 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
47
48
49
{
description = "An over-engineered Flake for Nosefart";
# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
lastModifiedDate =
self.lastModifiedDate or self.lastModified or "19700101";
version = builtins.substring 0 8 lastModifiedDate;
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlay ];
});
in {
overlay = final: prev: { inherit (self.packages) nosefart; };
# Provide some binary packages for selected system types.
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
nosefart = pkgs.callPackage ({ stdenv, SDL2 }:
stdenv.mkDerivation {
pname = "nosefart";
inherit version;
src = ./.;
makeFlags = [ "PREFIX=$(out)" ];
nativeBuildInputs = [ SDL2 ];
}) { };
});
defaultPackage = forAllSystems (system: self.packages.${system}.nosefart);
nixosModules.nosefart = { pkgs, ... }: {
nixpkgs.overlays = [ self.overlay ];
environment.systemPackages = [ pkgs.nosefart ];
};
};
}