about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2022-05-11 10:40:49 +0900
committerNguyễn Gia Phong <mcsinyx@disroot.org>2022-05-11 10:40:49 +0900
commit5de43bb3740eef3f040da93eea1fe08c9bc26263 (patch)
treebd42cc26c5f8d6444d31b2ee9fb8a54acac59a76 /nix
parentc1dfc818278a9a85765d95b29a75ac31fb21e40c (diff)
downloaddotfiles-5de43bb3740eef3f040da93eea1fe08c9bc26263.tar.gz
Update lab config
Diffstat (limited to 'nix')
-rw-r--r--nix/awesome.nix2
-rw-r--r--nix/configuration.nix21
-rw-r--r--nix/devel.nix2
-rw-r--r--nix/games.nix16
-rw-r--r--nix/overgrowth.nix57
5 files changed, 77 insertions, 21 deletions
diff --git a/nix/awesome.nix b/nix/awesome.nix
index d5375be..19b8903 100644
--- a/nix/awesome.nix
+++ b/nix/awesome.nix
@@ -41,7 +41,7 @@
     clipbuzz keynav playerctl pulsemixer xclip xdotool xorg.xkill
     aerc amfora calcurse dante khard ncdu ranger ueberzug vim_configurable
     arandr audacious liferea scrot rxvt-unicode zathura
-    firefox gajim libreoffice mepo nheko obs-studio tor-browser-bundle-bin
+    firefox libreoffice mepo-x11 nheko obs-studio tor-browser-bundle-bin
     nextcloud-client transmission-gtk
   ];
 
diff --git a/nix/configuration.nix b/nix/configuration.nix
index 33b4ace..5b1f698 100644
--- a/nix/configuration.nix
+++ b/nix/configuration.nix
@@ -28,28 +28,23 @@
 
   networking = {
     hostName = "nix";
+    hosts = {
+      "0.0.0.0" = [ "9gag.com" "voz.vn" ];
+    };
     nameservers = [ "9.9.9.11" "149.112.112.11" ];
-    extraHosts = ''
-      0.0.0.0 9gag.com
-    '';
     networkmanager.enable = true;
 
-    # The global useDHCP flag is deprecated, therefore explicitly set
-    # to false here.  Per-interface useDHCP will be mandatory in the future,
-    # so this generated config replicates the default behaviour.
-    useDHCP = false;
-    interfaces.enp1s0.useDHCP = true;
-    interfaces.wlp2s0.useDHCP = true;
+    interfaces = {
+      enp1s0.useDHCP = true;
+      wlp2s0.useDHCP = true;
+    };
 
     # Configure network proxy if necessary
     # proxy.default = "http://user:password@proxy:port/";
     # proxy.noProxy = "127.0.0.1,localhost,internal.domain";
 
     # Open ports in the firewall.
-    # firewall.allowedTCPPorts = [ ... ];
-    # firewall.allowedUDPPorts = [ ... ];
-    # Or disable the firewall altogether.
-    # firewall.enable = false;
+    firewall.allowedUDPPorts = [ 4001 ];
   };
 
   # Set your time zone.
diff --git a/nix/devel.nix b/nix/devel.nix
index cdf09a7..1be5435 100644
--- a/nix/devel.nix
+++ b/nix/devel.nix
@@ -22,11 +22,11 @@
     };
 
     ipfs = {
+      enableGC = true;
       user = "sea";
       dataDir = "/home/sea/.ipfs";
       # autoMount = true;
       localDiscovery = true;
-      enableGC = true;
     };
   };
 }
diff --git a/nix/games.nix b/nix/games.nix
index 0ef6905..2921486 100644
--- a/nix/games.nix
+++ b/nix/games.nix
@@ -1,17 +1,21 @@
 { config, pkgs, ... }:
 
-{
+let
+  overgrowth = pkgs.callPackage ./overgrowth.nix {
+    aux-data = "/home/sea/Games/Overgrowth";
+  };
+in {
   environment.systemPackages = with pkgs; [
-    hedgewars scorched3d teeworlds # _20kly strategy
+    scorched3d zeroad # hedgewars _20kly strategy
     astromenace chromium-bsu # scrolling
-    azimuth cdogs-sdl taisei # shmup
+    taisei # shmup
     bastet moon-buggy n2048 # text
-    blackshades redeclipse xonotic-glx # fps
-    blobwars openclonk superTux # platformer
+    blackshades xonotic-glx # fps
+    blobwars superTux teeworlds # platformer
     bonzomatic # engine
     extremetuxracer gl117 gltron superTuxKart # vehicle
     flare freedroidrpg hyperrogue # slash
     frozen-bubble pinball xbill # coffeebreak
-    orthorobot # neverball puzzle
+    neverball # puzzle
   ];
 }
diff --git a/nix/overgrowth.nix b/nix/overgrowth.nix
new file mode 100644
index 0000000..5b59134
--- /dev/null
+++ b/nix/overgrowth.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, makeDesktopItem
+, libGL, libGLU, SDL2, SDL2_net, gtk2, glib
+, openal, libogg, libvorbis, libtheora
+, libjpeg, freeimage, freetype, bzip2
+, aux-data ? "" }:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "overgrowth";
+    desktopName = "Overgrowth";
+    icon = "overgrowth";
+    exec = "overgrowth";
+    path = aux-data;
+    categories = [ "Game" ];
+  };
+in stdenv.mkDerivation rec {
+  pname = "overgrowth";
+  version = "unstable-2022-04-29";
+
+  src = fetchFromGitHub {
+    owner = "WolfireGames";
+    repo = pname;
+    rev = "dbe069e42e1cea27654a8fb618fdde77f41ac257";
+    sha256 = "sha256-81VKN0mU8XFdOZb6jrii2FeyVXCUiytcF2pgdO0je0s=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    libGL libGLU SDL2 SDL2_net gtk2 glib
+    openal libogg libvorbis libtheora
+    libjpeg freeimage freetype bzip2
+  ];
+
+  cmakeFlags = [
+    "-S../Projects"
+    "-DAUX_DATA=${aux-data}"
+    "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
+    "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
+  ];
+  hardeningDisable = [ "format" ];
+
+  installPhase = ''
+    install -D build/Overgrowth.bin.* $out/bin/overgrowth
+    install -D Projects/OGIcon.png\
+      $out/share/icons/hicolor/1024x1024/apps/overgrowth.png
+    install -D ${desktopItem}/share/applications/overgrowth.desktop \
+      $out/share/applications/overgrowth.desktop
+  '';
+
+  meta = {
+    description = "Third person ninja rabbit fighting game";
+    homepage = "https://overgrowth.wolfire.com";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.McSinyx ];
+    platforms = lib.platforms.linux;
+  };
+}