Initial commit

This commit is contained in:
lelgenio 2023-01-22 14:59:45 -03:00
parent 5e15528f41
commit 041210735c
4 changed files with 193 additions and 0 deletions

72
README.md Normal file
View file

@ -0,0 +1,72 @@
Install dzgui on nix-based systems
# Installation
## Using flake profiles (manual updates)
```
# install
nix profile install github:lelgenio/dzgui-nix
# update
nix profile upgrade '.*dzgui.*'
```
## As a flake input (auto updates)
Flake users are expected to have a `flake.nix` file and a `configuration.nix`.
Note that this is just a suggestion on how to to it, you may have different configuration structure.
1 - Add `dzgui` as a flake input:
```nix
# flake.nix
{
inputs.dzgui = {
# url of this repository, may change in the future
url = "github:lelgenio/dzgui-nix";
# save storage by not having duplicates of packages
inputs.nixpkgs.follows = "nixpkgs";
};
# outputs...
}
```
2 - Pass `inputs` to your to you system config
```nix
# flake.nix
{
outputs = inputs@{pkgs, ...}: {
nixosConfigurations.your-hostname-here = lib.nixosSystem {
specialArgs = { inherit inputs; };
# modules...
};
};
}
```
3 - Add dzgui as a package in your system:
```nix
# configuration.nix
# this is the file generate by `nixos-generate-config`
{ inputs, pkgs, ... }: {
environment.systemPackages = [
inputs.dzgui.packages.${pkgs.system}.dzgui
];
}
```
4 - Rebuild your system
```sh
nixos-rebuild --switch --flake .#your-hostname-here
```
Now dzgui will auto update together with your system.
## On non flake systems
Good luck.

54
default.nix Normal file
View file

@ -0,0 +1,54 @@
{ pkgs, lib, stdenv, fetchFromGitHub, makeWrapper }:
stdenv.mkDerivation rec {
pname = "dzgui";
version = "0.1";
src = fetchFromGitHub {
owner = "aclist";
repo = "dztui";
rev = "10c29c0542a07fb81b5922f96b416e3a2e8079cc";
sha256 = "sha256-VmW0ohXK+9CAr4yGaA/NSW7+E1vUvZthom8MculmOEs=";
};
nativeBuildInputs = [ makeWrapper ];
runtimeDeps = with pkgs; [
curl
jq
python3
wmctrl
xdotool
gnome.zenity
## Here we don't declare steam as a dependency because
## we could either use the native or flatpack version
## and also so this does not become a non-free package
# steam
];
patchPhase = ''
sed -i \
-e 's|/usr/bin/zenity|${pkgs.gnome.zenity}/bin/zenity|' \
-e 's|2>/dev/null||' \
dzgui.sh
'';
installPhase = ''
install -Dm777 -T dzgui.sh $out/bin/.dzgui-unwrapped_
makeWrapper $out/bin/.dzgui-unwrapped_ $out/bin/dzgui \
--prefix PATH ':' ${lib.makeBinPath runtimeDeps}
'';
meta = with lib; {
homepage = "https://github.com/pronovic/banner";
description = "DayZ TUI/GUI server browser";
license = licenses.gpl3;
longDescription = ''
DZGUI allows you to connect to both official and modded/community DayZ
servers on Linux and provides a graphical interface for doing so.
'';
platforms = platforms.all;
};
}

43
flake.lock Normal file
View file

@ -0,0 +1,43 @@
{
"nodes": {
"dzgui": {
"flake": false,
"locked": {
"lastModified": 1674148870,
"narHash": "sha256-VmW0ohXK+9CAr4yGaA/NSW7+E1vUvZthom8MculmOEs=",
"owner": "aclist",
"repo": "dztui",
"rev": "10c29c0542a07fb81b5922f96b416e3a2e8079cc",
"type": "github"
},
"original": {
"owner": "aclist",
"repo": "dztui",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1674211260,
"narHash": "sha256-xU6Rv9sgnwaWK7tgCPadV6HhI2Y/fl4lKxJoG2+m9qs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5ed481943351e9fd354aeb557679624224de38d5",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"dzgui": "dzgui",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

24
flake.nix Normal file
View file

@ -0,0 +1,24 @@
{
description = "DayZ TUI/GUI server browser";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
dzgui = {
url = "github:aclist/dztui";
flake = false;
};
};
outputs = { self, nixpkgs, dzgui, ... }:
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; });
};
devShells.${system}.default =
mkShell { buildInputs = self.packages.${system}.default.runtimeDeps; };
};
}