-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathflake.nix
73 lines (68 loc) · 1.91 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
{
description = "NixOS module for the Valheim dedicated server";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
steam-fetcher = {
url = "github:nix-community/steam-fetcher";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
steam-fetcher,
}: let
# The Steam Nix fetcher only supports x86_64 Linux.
supportedSystems = ["x86_64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = system:
import nixpkgs {
inherit system;
overlays = [
steam-fetcher.overlays.default
self.overlays.default
];
};
lintersFor = system: let
pkgs = pkgsFor system;
in
with pkgs; [
alejandra
];
in {
devShells = forAllSystems (system: let
pkgs = pkgsFor system;
in {
default = pkgs.mkShell {
packages = with pkgs;
[
nil # Nix LS
]
++ lintersFor system;
};
});
checks = forAllSystems (system: let
pkgs = pkgsFor system;
in {
fmt = pkgs.runCommandLocal "alejandra" {} ''
${pkgs.alejandra}/bin/alejandra --check ${./.} > "$out"
'';
});
formatter = forAllSystems (system: (pkgsFor system).alejandra);
nixosModules = rec {
valheim = import ./nixos-modules/valheim.nix {inherit self steam-fetcher;};
default = valheim;
};
overlays.default = final: prev: {
valheim-server-unwrapped = final.callPackage ./pkgs/valheim-server {};
valheim-server = final.callPackage ./pkgs/valheim-server/fhsenv.nix {};
valheim-bepinex-pack = final.callPackage ./pkgs/bepinex-pack {};
fetchValheimThunderstoreMod = final.callPackage ./pkgs/build-support/fetch-thunderstore-mod {};
};
packages = forAllSystems (system: let
pkgs = pkgsFor system;
in {
valheim-server = pkgs.valheim-server;
});
};
}