package adams site and remove tetrio

This commit is contained in:
Kopatz
2024-05-25 21:19:55 +02:00
parent ceff361008
commit ba7aba817e
10 changed files with 98 additions and 144 deletions

38
flake.lock generated
View File

@@ -175,7 +175,7 @@
},
"devshell": {
"inputs": {
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixvim",
"nixpkgs"
@@ -351,6 +351,24 @@
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
@@ -605,7 +623,7 @@
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
@@ -776,6 +794,7 @@
"inputs": {
"agenix": "agenix",
"disko": "disko",
"flake-utils": "flake-utils",
"home-manager": "home-manager_2",
"home-manager-unstable": "home-manager-unstable",
"nix-colors": "nix-colors",
@@ -862,6 +881,21 @@
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [

View File

@@ -31,10 +31,11 @@
stylix.url = "github:danth/stylix";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nur, nixpkgs, nixos-hardware, nixos-wsl, nixpkgs-unstable
, agenix, home-manager, home-manager-unstable, nix-colors, nixos-cosmic
, nixvim, stylix, disko }@inputs:
, nixvim, stylix, disko, flake-utils }@inputs:
let
inherit (self) outputs;
system = "x86_64-linux";
@@ -66,9 +67,10 @@
[ ]);
specialArgs = specialArgs // { inherit inputs outputs; };
};
in {
packages.${system} =
import ./pkgs { pkgs = nixpkgs-unstable.legacyPackages.${system}; };
in flake-utils.lib.eachDefaultSystem (system: {
packages = import ./pkgs { pkgs = nixpkgs-unstable.legacyPackages.${system}; };
}) // {
overlays = import ./overlays.nix { inherit inputs; };
nixosConfigurations = {

View File

@@ -17,13 +17,13 @@ in
};
environment.systemPackages = with pkgs; [
taisei
tetrio
osu-lazer-bin
wineWowPackages.unstableFull
winetricks
lutris
mangohud
prismlauncher
tetrio-desktop
#libs
];
};

View File

@@ -19,12 +19,12 @@ in
fonts.fontDir.enable = true;
fonts.packages = with pkgs; [
#uw-ttyp0
corefonts
nerdfonts
#corefonts
nerdfonts # noto and hack
#noto-fonts
#noto-fonts-emoji
noto-fonts-cjk
font-awesome
#font-awesome
];
networking.firewall = {

View File

@@ -8,6 +8,7 @@
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
discord = prev.discord.override { withVencord = true; };
tetrio-desktop = prev.tetrio-desktop.override { withTetrioPlus = true; };
nerdfonts = prev.nerdfonts.override { fonts = ["Hack" "Noto"]; };
waybar = prev.waybar.overrideAttrs (oldAttrs: { mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; });
# example = prev.example.overrideAttrs (oldAttrs: rec {

View File

@@ -0,0 +1,16 @@
{ lib, buildNpmPackage, fetchFromGitHub }:
buildNpmPackage rec {
pname = "adam-site";
version = "1.0.0";
src = fetchGit {
url = "git@github.com:oberprofis/adams.git";
ref = "main";
rev = "0d1d5003bd5681c5dbe2ad12ed1ef7e56bb4c197";
};
npmDepsHash="sha256-ndpuIqMAitnx0rswYD60l5JhDMdaKH77Qdu7zNgwj/o=";
installPhase = ''
mkdir -p $out
cp -r ./dist/adams-site/* $out
'';
}

View File

@@ -1,8 +1,8 @@
{ pkgs, ... }: rec {
tetrio = pkgs.callPackage ./tetrio-desktop/package.nix { };
kop-hub = pkgs.callPackage ./hub/default.nix { };
ente-frontend = pkgs.callPackage ./ente-frontend/default.nix { };
kop-website =
pkgs.callPackage ./website/default.nix { inherit kop-hub ente-frontend; };
kop-monitor = pkgs.callPackage ./kop-monitor/default.nix { };
adam-site = pkgs.callPackage ./adam-site/default.nix { };
}

View File

@@ -1,97 +0,0 @@
{ stdenv
, lib
, fetchurl
, dpkg
, autoPatchelfHook
, wrapGAppsHook
, alsa-lib
, cups
, libGL
, libX11
, libXScrnSaver
, libXtst
, mesa
, nss
, gtk3
, libpulseaudio
, systemd
, callPackage
, withTetrioPlus ? true
, tetrio-plus ? callPackage ./tetrio-plus.nix { }
, ...
}:
let
libPath = lib.makeLibraryPath [
libGL
libpulseaudio
systemd
];
in
stdenv.mkDerivation (finalAttrs: {
pname = "tetrio-desktop";
version = "9.0.0";
src = fetchurl {
url = "https://tetr.io/about/desktop/builds/${lib.versions.major finalAttrs.version}/TETR.IO%20Setup.deb";
hash = "sha256-UriLwMB8D+/T32H4rPbkJAy/F/FFhNpd++0AR1lwEfs=";
};
nativeBuildInputs = [
dpkg
autoPatchelfHook
wrapGAppsHook
];
dontWrapGApps = true;
buildInputs = [
alsa-lib
cups
libX11
libXScrnSaver
libXtst
mesa
nss
gtk3
];
unpackCmd = "dpkg -x $curSrc src";
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r opt/ usr/share/ $out
ln -s $out/opt/TETR.IO/TETR.IO $out/bin/tetrio
substituteInPlace $out/share/applications/TETR.IO.desktop \
--replace "Exec=/opt/TETR.IO/TETR.IO" "Exec=$out/bin/tetrio"
runHook postInstall
'';
postInstall = lib.strings.optionalString withTetrioPlus ''
cp ${tetrio-plus} $out/opt/TETR.IO/resources/app.asar
'';
postFixup = ''
wrapProgram $out/opt/TETR.IO/TETR.IO \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/TETR.IO \
''${gappsWrapperArgs[@]}
'';
meta = {
description = "TETR.IO desktop client";
downloadPage = "https://tetr.io/about/desktop/";
homepage = "https://tetr.io";
license = lib.licenses.unfree;
longDescription = ''
TETR.IO is a modern yet familiar online stacker.
Play against friends and foes all over the world, or claim a spot on the leaderboards - the stacker future is yours!
'';
mainProgram = "tetrio";
maintainers = with lib.maintainers; [ wackbyte ];
platforms = [ "x86_64-linux" ];
};
})

View File

@@ -1,26 +0,0 @@
{ lib, stdenv, fetchzip }:
stdenv.mkDerivation rec {
pname = "tetrio-plus";
version = "0.25.3";
src = fetchzip {
url = "https://gitlab.com/UniQMG/tetrio-plus/-/jobs/6734605389/artifacts/raw/tetrio-plus_v0.27.2_for_desktop_v9.asar.zip";
hash = "sha256-+5jXhJwltw426eWU1yR4jxXlOm/etuJKzfeoXSetMws=";
};
installPhase = ''
runHook preInstall
install app.asar $out
runHook postInstall
'';
meta = with lib; {
description = "TETR.IO customization toolkit";
homepage = "https://gitlab.com/UniQMG/tetrio-plus";
license = licenses.mit;
maintainers = with maintainers; [ huantian ];
platforms = [ "x86_64-linux" ];
};
}

View File

@@ -5,31 +5,55 @@
./disk-config.nix
];
boot.loader.grub = {
# no need to set devices, disko will add all devices that have a EF02 partition to the list already
# devices = [ ];
efiSupport = true;
efiInstallAsRemovable = true;
};
services.openssh.enable = true;
services.nginx.enable = true;
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
custom = {
services.acme.enable = true;
nftables.enable = true;
nix = {
settings.enable = true;
};
nix = { settings.enable = true; };
};
environment.systemPackages = map lib.lowPrio [
pkgs.curl
pkgs.gitMinimal
];
environment.systemPackages = map lib.lowPrio [ pkgs.curl pkgs.gitMinimal ];
users.users.root.openssh.authorizedKeys.keys = [
# change this to your ssh key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFeP6qtVqE/gu72ZUZE8cdRi3INiUW9NqDR7SjXIzTw2"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDMypKJQvn68s8iNk9J9zghFlW4nrd03FwqfvGQ9sAmWojXe6pKrkat++8grIfB60aiIwNjHeXigVdZrpIb0QiR7+maPLPtxySTmgD7GeyAbwJrAymgKAzJcQvq5tKHtjH60KhLe4QzGXXpjoGIhl/8FhepRT6306JE8OfMwBUwOa3wcEdeJ7eK4JZdELCne3Gj16eWHy8iNIQswNtvJ70M7RACyDJARuazde3zFqkRYCP9Rqinegg/DVd+ykC2qHqM/yCersCOGn+I3hPCS1tz/AhDTQ7T9A7j5CLjv6ZbRS+B7a7u7z5qOAla468sELaiAEo2+fovlh8kib5zzWM2pK3rSEfUzFVGAAfHtrdR8pYynl3DBNC5XGzDT8xqa4B/qJIRoPmr8CMroLBOGGZQm9TJbmhfl8vT96RUwOA6qUmLQl6b0qJRRMkvlgCvKZyZ3d6pPfizQigTn1evBveqO9dgGcCAyAi0Ob6JZisTWUn5nAqe7CR1h2EKC0lqdCc="
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKJTpEPKK38MQHcLHkJ6TCqrhSQ9B2ruVx6ONRVQYJC6"
];
system.stateVersion = "23.11";
systemd.tmpfiles.rules = [
"d /data 0770 github-actions-runner nginx -"
"d /data/website 0770 github-actions-runner nginx -"
];
services.nginx = {
enable = true;
# Use recommended settings
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
# Only allow PFS-enabled ciphers with AES256
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
virtualHosts = {
#discord bot for tracking useractivity public version
"imbissaggsbachdorf.at" = {
forceSSL = true;
enableACME = true;
locations."/".extraConfig = ''
return 200 "Hello, world!";
'';
};
};
};
}