mirror of
https://github.com/lelgenio/dzgui-nix.git
synced 2025-01-11 19:45: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
|
let
|
||||||
# DayZ only runs on x86_64 systems
|
# DayZ only runs on x86_64 systems
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs { inherit system; };
|
||||||
inherit system;
|
|
||||||
overlays = [ self.overlays.default ];
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
with pkgs;
|
|
||||||
{
|
{
|
||||||
packages.${system} = rec {
|
packages.${system} = rec {
|
||||||
default = dzgui;
|
default = dzgui;
|
||||||
inherit (pkgs) dzgui;
|
dzgui = pkgs.callPackage ./package { };
|
||||||
};
|
};
|
||||||
|
|
||||||
overlays = {
|
overlays = {
|
||||||
|
@ -26,10 +22,10 @@
|
||||||
|
|
||||||
nixosModules = rec {
|
nixosModules = rec {
|
||||||
default = dzgui;
|
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;
|
buildInputs = self.packages.${system}.default.runtimeDeps;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
23
module.nix
23
module.nix
|
@ -1,30 +1,29 @@
|
||||||
{ self, ... }:
|
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.dzgui;
|
cfg = config.programs.dzgui;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.programs.dzgui = {
|
options.programs.dzgui = {
|
||||||
enable = mkEnableOption (mdDoc ''
|
enable = lib.mkEnableOption (
|
||||||
Weather to install dzgui and setup workarounds for DayZ to work on linux
|
lib.mdDoc ''
|
||||||
'');
|
Weather to install dzgui and setup workarounds for DayZ to work on linux
|
||||||
package = mkOption {
|
''
|
||||||
type = with types; nullOr package;
|
);
|
||||||
default = pkgs.dzgui;
|
package = lib.mkOption {
|
||||||
defaultText = literalExpression "pkgs.dzgui";
|
type = with lib.types; nullOr package;
|
||||||
description = mdDoc "Dzgui package to use.";
|
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
|
# Needed by DayZ
|
||||||
boot.kernel.sysctl."vm.max_map_count" = 1048576;
|
boot.kernel.sysctl."vm.max_map_count" = 1048576;
|
||||||
nixpkgs.overlays = [ self.overlays.default ];
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue