mirror of
https://github.com/lelgenio/dzgui-nix.git
synced 2025-01-18 14:46:26 -03:00
Compare commits
5 commits
2f036031a3
...
e072283096
Author | SHA1 | Date | |
---|---|---|---|
e072283096 | |||
lelgenio | 54e6c10bac | ||
lelgenio | f7a0747d62 | ||
lelgenio | af1a43a8de | ||
lelgenio | 6cd3a545f2 |
29
flake.nix
29
flake.nix
|
@ -3,33 +3,36 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
|
||||||
};
|
};
|
||||||
outputs = { self, nixpkgs, ... }:
|
outputs =
|
||||||
|
{ self, nixpkgs, ... }:
|
||||||
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 = {
|
||||||
default = (final: _: {
|
default = import ./overlay.nix;
|
||||||
dzgui = (final.callPackage ./package { });
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules = rec {
|
nixosModules = rec {
|
||||||
default = dzgui;
|
default = dzgui;
|
||||||
dzgui = import ./module.nix { inherit self; };
|
dzgui = import ./module.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.${system}.default =
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
mkShell { buildInputs = self.packages.${system}.default.runtimeDeps; };
|
buildInputs = self.packages.${system}.default.runtimeDeps;
|
||||||
|
};
|
||||||
|
|
||||||
|
checks.${system}.nixosCheck =
|
||||||
|
(nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [ ./nixos-test/configuration.nix ];
|
||||||
|
}).config.system.build.toplevel;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
30
module.nix
30
module.nix
|
@ -1,25 +1,29 @@
|
||||||
{ self, ... }:
|
{
|
||||||
{ pkgs, config, lib, ... }:
|
pkgs,
|
||||||
with lib;
|
config,
|
||||||
|
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 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
7
nixos-test/configuration.nix
Normal file
7
nixos-test/configuration.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
imports = [ ../module.nix ];
|
||||||
|
programs.dzgui.enable = true;
|
||||||
|
|
||||||
|
boot.isContainer = true;
|
||||||
|
system.stateVersion = "24.05";
|
||||||
|
}
|
1
overlay.nix
Normal file
1
overlay.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(final: _: { dzgui = (final.callPackage ./package { }); })
|
|
@ -1,15 +1,16 @@
|
||||||
{ lib
|
{
|
||||||
, stdenv
|
lib,
|
||||||
, fetchFromGitHub
|
stdenv,
|
||||||
, makeWrapper
|
fetchFromGitHub,
|
||||||
, curl
|
makeWrapper,
|
||||||
, jq
|
curl,
|
||||||
, python3
|
jq,
|
||||||
, wmctrl
|
python3,
|
||||||
, xdotool
|
wmctrl,
|
||||||
, gnome
|
xdotool,
|
||||||
, gobject-introspection
|
gnome,
|
||||||
, wrapGAppsHook
|
gobject-introspection,
|
||||||
|
wrapGAppsHook,
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "dzgui";
|
pname = "dzgui";
|
||||||
|
@ -38,9 +39,7 @@ stdenv.mkDerivation rec {
|
||||||
runtimeDeps = [
|
runtimeDeps = [
|
||||||
curl
|
curl
|
||||||
jq
|
jq
|
||||||
(python3.withPackages (p: with p; [
|
(python3.withPackages (p: with p; [ pygobject3 ]))
|
||||||
pygobject3
|
|
||||||
]))
|
|
||||||
|
|
||||||
wmctrl
|
wmctrl
|
||||||
xdotool
|
xdotool
|
||||||
|
|
Loading…
Reference in a new issue