mirror of
https://github.com/lelgenio/dzgui-nix.git
synced 2024-12-24 11:55:36 -03:00
Add module
This commit is contained in:
parent
83998493f7
commit
9a67e3e098
25
flake.nix
25
flake.nix
|
@ -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
25
module.nix
Normal 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 ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue