-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
59 lines (47 loc) · 1.98 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
{
description = "tailscale-manager";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
nix-github-actions.url = "github:nix-community/nix-github-actions";
nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, nix-github-actions }:
{
githubActions = nix-github-actions.lib.mkGithubMatrix {
checks = nixpkgs.lib.getAttrs [ "x86_64-linux" ] self.checks;
};
nixosModules.default = self.nixosModules.tailscale-manager;
nixosModules.tailscale-manager = import ./nix/nixos-module.nix;
overlays.default = final: prev: {
tailscale-manager = self.packages.${prev.system}.tailscale-manager;
};
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system}.extend self.overlays.default;
haskellPackages = pkgs.haskellPackages;
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
in {
packages.tailscale-manager = (
haskellPackages.callCabal2nix "tailscale-manager" self rec {
# Dependency overrides go here
}).overrideAttrs (x: {
outputs = x.outputs ++ ["testreport"];
preCheck = ''
checkFlagsArray+=("--test-options=--xml=$testreport/junit.xml")
'';
});
packages.default = self.packages.${system}.tailscale-manager;
checks.tailscale-manager = self.packages.${system}.tailscale-manager;
checks.vm-test = pkgs.callPackage ./nix/vm-test.nix { inherit self; };
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
haskellPackages.haskell-language-server # you must build it with your ghc to work
ghcid
cabal-install
];
inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system});
};
});
}