mirror of
https://github.com/lelgenio/dzgui-nix.git
synced 2025-01-11 11:35:35 -03:00
refactor: be less flake and overlay dependant
This commit is contained in:
parent
af1a43a8de
commit
f7a0747d62
12
flake.nix
12
flake.nix
|
@ -8,16 +8,12 @@
|
|||
let
|
||||
# DayZ only runs on x86_64 systems
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
with pkgs;
|
||||
{
|
||||
packages.${system} = rec {
|
||||
default = dzgui;
|
||||
inherit (pkgs) dzgui;
|
||||
dzgui = pkgs.callPackage ./package { };
|
||||
};
|
||||
|
||||
overlays = {
|
||||
|
@ -26,10 +22,10 @@
|
|||
|
||||
nixosModules = rec {
|
||||
default = dzgui;
|
||||
dzgui = import ./module.nix { inherit self; };
|
||||
dzgui = import ./module.nix;
|
||||
};
|
||||
|
||||
devShells.${system}.default = mkShell {
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = self.packages.${system}.default.runtimeDeps;
|
||||
};
|
||||
|
||||
|
|
23
module.nix
23
module.nix
|
@ -1,30 +1,29 @@
|
|||
{ 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.";
|
||||
enable = lib.mkEnableOption (
|
||||
lib.mdDoc ''
|
||||
Weather to install dzgui and setup workarounds for DayZ to work on linux
|
||||
''
|
||||
);
|
||||
package = lib.mkOption {
|
||||
type = with lib.types; nullOr package;
|
||||
default = pkgs.callPackage ./package { };
|
||||
defaultText = lib.literalExpression "pkgs.dzgui";
|
||||
description = lib.mdDoc "Dzgui package to use.";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.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