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 = {
|
||||
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
outputs = { self, nixpkgs, ... }:
|
||||
outputs =
|
||||
{ self, nixpkgs, ... }:
|
||||
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 = {
|
||||
default = (final: _: {
|
||||
dzgui = (final.callPackage ./package { });
|
||||
});
|
||||
default = import ./overlay.nix;
|
||||
};
|
||||
|
||||
nixosModules = rec {
|
||||
default = dzgui;
|
||||
dzgui = import ./module.nix { inherit self; };
|
||||
dzgui = import ./module.nix;
|
||||
};
|
||||
|
||||
devShells.${system}.default =
|
||||
mkShell { buildInputs = self.packages.${system}.default.runtimeDeps; };
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
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, ... }:
|
||||
with lib;
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
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 ];
|
||||
};
|
||||
}
|
||||
|
|
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
|
||||
, fetchFromGitHub
|
||||
, makeWrapper
|
||||
, curl
|
||||
, jq
|
||||
, python3
|
||||
, wmctrl
|
||||
, xdotool
|
||||
, gnome
|
||||
, gobject-introspection
|
||||
, wrapGAppsHook
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
makeWrapper,
|
||||
curl,
|
||||
jq,
|
||||
python3,
|
||||
wmctrl,
|
||||
xdotool,
|
||||
gnome,
|
||||
gobject-introspection,
|
||||
wrapGAppsHook,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dzgui";
|
||||
|
@ -38,9 +39,7 @@ stdenv.mkDerivation rec {
|
|||
runtimeDeps = [
|
||||
curl
|
||||
jq
|
||||
(python3.withPackages (p: with p; [
|
||||
pygobject3
|
||||
]))
|
||||
(python3.withPackages (p: with p; [ pygobject3 ]))
|
||||
|
||||
wmctrl
|
||||
xdotool
|
||||
|
|
Loading…
Reference in a new issue