Add module

This commit is contained in:
lelgenio 2023-05-17 23:33:56 -03:00
parent 83998493f7
commit 9a67e3e098
2 changed files with 45 additions and 5 deletions

View file

@ -11,11 +11,26 @@
let
# DayZ only runs on x86_64 systems
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in with pkgs; {
packages.${system} = {
default = self.packages.${system}.dzgui;
dzgui = (pkgs.callPackage ./. { }).overrideAttrs (_: { src = dzgui; });
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in
with pkgs; {
packages.${system} = rec {
default = dzgui;
inherit (pkgs) dzgui;
};
overlays = {
default = (final: _: {
dzgui = (final.callPackage ./. { }).overrideAttrs (_: { src = dzgui; });
});
};
nixosModules = rec {
default = dzgui;
dzgui = import ./module.nix {inherit self;};
};
devShells.${system}.default =

25
module.nix Normal file
View file

@ -0,0 +1,25 @@
{ self, ... }:
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.programs.dzgui;
in
{
options.programs.dzgui = {
enable = mkEnableOption (mdDoc ''
Weather to install dzgui and setup workarounds for DayZ to work on linux
'');
package = mkOption {
type = with types; nullOr package;
default = pkgs.dzgui;
defaultText = literalExpression "pkgs.dzgui";
description = mdDoc "Dzgui package to use.";
};
};
config = mkIf cfg.enable {
# Needed by DayZ
boot.kernel.sysctl."vm.max_map_count" = 1048576;
nixpkgs.overlays = [ self.overlays.default ];
environment.systemPackages = [ cfg.package ];
};
}