-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathflake.nix
100 lines (86 loc) · 2.54 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
description = "The EGIL SCIM client";
inputs = {
nixpkgs.url = "nixpkgs/nixos-21.11";
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
nix-utils = {
url = "github:ilkecan/nix-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs:
let
inherit (builtins) elem;
inherit (nixpkgs.lib) filterAttrs;
inherit (inputs.flake-utils.lib)
defaultSystems
eachSystem
flattenTree
;
inherit (inputs.nix-utils.lib)
createDebugSymbolsSearchPath
getCmakeVersion
getUnstableVersion
;
supportedSystems = defaultSystems;
version =
if self.sourceInfo ? rev
then getCmakeVersion ./CMakeLists.txt
else getUnstableVersion self.lastModifiedDate;
meta = {
homepage = "https://www.skolfederation.se/egil-scimclient-esc/";
downloadPage = "https://github.com/Sambruk/EgilSCIM/releases";
changelog = "https://raw.githubusercontent.com/Sambruk/EgilSCIM/master/CHANGELOG.md";
maintainers = with nixpkgs.lib.maintainers; [ ilkecan ];
platforms = supportedSystems;
};
privateOverlay = final: prev:
let
inherit (prev) callPackage;
in
{
nix-filter = inputs.nix-filter.lib;
egil = prev.egil // {
internal = {
inherit version meta;
};
};
};
in
{
overlay = import ./nix/overlay.nix {
inherit privateOverlay;
};
} // eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
inputs.nix-utils.overlay
self.overlay
];
};
inherit (pkgs) egil callPackage;
inherit (pkgs.stdenv) isLinux;
isSupportedOnCurrentSystem = drv:
elem system drv.meta.platforms;
in
rec {
checks = packages;
packages = filterAttrs (_: isSupportedOnCurrentSystem) (flattenTree egil);
defaultPackage = packages.scim-client;
hydraJobs = {
build = checks;
${ if isLinux then "vmTest" else null } =
let
drv = egil.test.suite;
in
{
${ if isSupportedOnCurrentSystem drv then drv.pname else null } = drv.vmTest;
};
};
devShell = callPackage ./nix/shell.nix { inherit isSupportedOnCurrentSystem; };
}
);
}