From 0076dc6aaa284f70dc5a61044f2c24e078c5992b Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Mon, 12 Aug 2024 01:39:56 -0400 Subject: [PATCH 1/8] add ftb-app package Signed-off-by: ahuston-0 --- packages/default.nix | 8 +++ packages/ftb-app/default.nix | 109 +++++++++++++++++++++++++++++++++++ packages/maintainers.nix | 77 +++++++++++++++++++++++++ 3 files changed, 194 insertions(+) create mode 100644 packages/default.nix create mode 100644 packages/ftb-app/default.nix create mode 100644 packages/maintainers.nix diff --git a/packages/default.nix b/packages/default.nix new file mode 100644 index 0000000..6716bbf --- /dev/null +++ b/packages/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +let + rad-maintainers = import ./maintainers.nix; +in +{ + + ftb-app = pkgs.callPackage ./ftb-app { inherit rad-maintainers; }; +} diff --git a/packages/ftb-app/default.nix b/packages/ftb-app/default.nix new file mode 100644 index 0000000..2724b02 --- /dev/null +++ b/packages/ftb-app/default.nix @@ -0,0 +1,109 @@ +{ + alsa-lib, + at-spi2-atk, + cairo, + cups, + dbus, + dpkg, + expat, + fetchurl, + gtk3, + jre, + lib, + libdrm, + libxkbcommon, + makeWrapper, + mesa, + nspr, + nss, + pango, + rad-maintainers, + stdenv, + xorg, + ... +}: +# source_aarch64=("https://piston.feed-the-beast.com/app/ftb-app-${pkgver}-arm64.deb") +# sha256sums_aarch64=(ad1197556a187693cbc488142562a0c17144e33056f1c914950c2f1496a4c532) +stdenv.mkDerivation rec { + pname = "ftb-app"; + version = "1.25.14"; + + src = fetchurl { + url = "https://piston.feed-the-beast.com/app/ftb-app-${version}-amd64.deb"; + sha256 = "c9e4ce43be5337d2c7f10c55412d0acc629178d4967aef88897ebad2aa241ef0"; + }; + + nativeBuildInputs = [ + dpkg + makeWrapper + ]; + + unpackPhase = '' + runHook preUnpack + + dpkg -x $src ./ftb-app + + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + + mkdir -p "$out" + cp -r ftb-app/* "$out" + + # Flatten /usr and manually merge lib/ and usr/lib/, since mv refuses to. + mv "$out"'/opt/FTB Electron App' "$out/bin" + mv "$out/usr/"* "$out/" + rmdir "$out/usr" + rmdir "$out/opt" + + for f in "$out/share/applications/"*.desktop; do + substituteInPlace "$f" \ + --replace-fail '/opt/FTB Electron App/ftb-app' "$out/bin/ftb-app" + done + + # prevent self-upgrade with dpkg + rm "$out/bin/resources/package-type" + + chmod +x "$out/bin/ftb-app" + + libs="${nss}/lib/libnss3.so ${nss}/lib/libnssutil3.so ${nss}/lib/libsmime3.so " + libs+="${nspr}/lib/libnspr4.so ${dbus.lib}/lib/libdbus-1.so.3 " + libs+="${at-spi2-atk}/lib/libatk-1.0.so.0 ${cups.lib}/lib/libcups.so.2 " + libs+="${at-spi2-atk}/lib/libatk-bridge-2.0.so.0 " + libs+="${libdrm}/lib/libdrm.so.2 ${gtk3}/lib/libgtk-3.so.0 " + libs+="${pango.out}/lib/libpango-1.0.so.0 ${cairo}/lib/libcairo.so.2 " + libs+="${xorg.libX11}/lib/libX11.so.6 ${xorg.libXext}/lib/libXext.so.6 " + libs+="${xorg.libXcomposite}/lib/libXcomposite.so.1 " + libs+="${xorg.libXdamage}/lib/libXdamage.so.1 " + libs+="${xorg.libXfixes}/lib/libXfixes.so.3 ${expat}/lib/libexpat.so.1 " + libs+="${xorg.libXrandr}/lib/libXrandr.so.2 ${mesa}/lib/libgbm.so.1 " + libs+="${xorg.libxcb}/lib/libxcb.so.1 ${alsa-lib}/lib/libasound.so.2 " + libs+="${libxkbcommon}/lib/libxkbcommon.so.0 " + libs+="${at-spi2-atk}/lib/libatspi.so.0 ${xorg.libXtst}/lib/libXtst.so.6 " + + echo "$libs" + + + for p in "$out/bin/ftb-app"; do + wrapProgram "$p" \ + --set LD_PRELOAD "$libs" \ + --set NIX_REDIRECTS "/usr/share=$out/share:"'/opt/FTB Electron Application'"=$out/bin" \ + --set JAVA_HOME "${jre.home}" + # --prefix PATH : "{lib.makeBinPath [ gzip gnutar ]}" + done + + runHook postInstall + ''; + + meta = with lib; { + description = "A new Modpack launcher for FTB and Curse modpacks."; + homepage = "https://feed-the-beast.com/app"; + license = with licenses; [ lgpl21Only ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + maintainers = with rad-maintainers; [ ahuston-0 ]; + platforms = [ "x86_64-linux" ]; + mainProgram = "ftb-app"; + }; +} diff --git a/packages/maintainers.nix b/packages/maintainers.nix new file mode 100644 index 0000000..1f48dc7 --- /dev/null +++ b/packages/maintainers.nix @@ -0,0 +1,77 @@ +/* + Borrowed this from nixpkgs :) + List of NixOS maintainers. + ```nix + handle = { + # Required + name = "Your name"; + + # Optional, but at least one of email, matrix or githubId must be given + email = "address@example.org"; + matrix = "@user:example.org"; + github = "GithubUsername"; + githubId = your-github-id; + + keys = [{ + fingerprint = "AAAA BBBB CCCC DDDD EEEE FFFF 0000 1111 2222 3333"; + }]; + }; + ``` + + where + + - `handle` is the handle you are going to use in nixpkgs expressions, + - `name` is a name that people would know and recognize you by, + - `email` is your maintainer email address, + - `matrix` is your Matrix user ID, + - `github` is your GitHub handle (as it appears in the URL of your profile page, `https://github.com/`), + - `githubId` is your GitHub user ID, which can be found at `https://api.github.com/users/`, + - `keys` is a list of your PGP/GPG key fingerprints. + + Specifying a GitHub account ensures that you automatically: + - get invited to the @NixOS/nixpkgs-maintainers team ; + - once you are part of the @NixOS org, OfBorg will request you review + pull requests that modify a package for which you are a maintainer. + + `handle == github` is strongly preferred whenever `github` is an acceptable attribute name and is short and convenient. + + If `github` begins with a numeral, `handle` should be prefixed with an underscore. + ```nix + _1example = { + github = "1example"; + }; + ``` + + Add PGP/GPG keys only if you actually use them to sign commits and/or mail. + + To get the required PGP/GPG values for a key run + ```shell + gpg --fingerprint | head -n 2 + ``` + + !!! Note that PGP/GPG values stored here are for informational purposes only, don't use this file as a source of truth. + + More fields may be added in the future, however, in order to comply with GDPR this file should stay as minimal as possible. + + When editing this file: + * keep the list alphabetically sorted, check with: + nix-instantiate --eval maintainers/scripts/check-maintainers-sorted.nix + * test the validity of the format with: + nix-build lib/tests/maintainers.nix + + See `./scripts/check-maintainer-github-handles.sh` for an example on how to work with this data. + + When adding a new maintainer, be aware of the current commit conventions + documented at [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions) + file located in the root of the Nixpkgs repo. +*/ + +{ + ahuston-0 = { + name = "ahuston-0"; + email = "aliceghuston@gmail.com"; + github = "ahuston-0"; + githubId = 43225907; + keys = [ { fingerprint = "F638 32C3 080D 6E1A C77E ECF8 0B42 45FF E305 BC82"; } ]; + }; +} -- 2.48.1 From 343aee5d60cfef45a31ff6bb1fdfd9ed7ce0c2eb Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Mon, 3 Mar 2025 00:47:51 -0500 Subject: [PATCH 2/8] expose packages output, add it to global nixpkgs Signed-off-by: ahuston-0 --- flake.nix | 6 ++---- lib/systems.nix | 4 ++-- modules/nix.nix | 14 +++++++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index b1915e8..df0d41d 100644 --- a/flake.nix +++ b/flake.nix @@ -154,6 +154,7 @@ ); inherit (lib.adev.systems) genSystems getImages; inherit (self) outputs; # for hydra + in rec { inherit lib; # for allowing use of custom functions in nix repl @@ -168,10 +169,7 @@ qcow = getImages nixosConfigurations "qcow"; }; - packages.x86_64-linux.lego-latest = - nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/lego-latest/default.nix - { }; - + packages = import ./packages { pkgs = nixpkgs.legacyPackages.x86_64-linux; }; checks = import ./checks.nix { inherit inputs forEachSystem formatter; }; devShells = import ./shell.nix { inherit inputs forEachSystem checks; }; diff --git a/lib/systems.nix b/lib/systems.nix index 4cb2607..102e9d0 100644 --- a/lib/systems.nix +++ b/lib/systems.nix @@ -149,7 +149,7 @@ rec { configPath, hostname, inputs, - outputs, + outputs ? { }, src, users, home ? true, @@ -219,7 +219,7 @@ rec { ; hostname = name; } - // import configPath { inherit inputs; } + // import configPath { inherit inputs outputs; } ); } ) (lib.adev.lsdir path) diff --git a/modules/nix.nix b/modules/nix.nix index aaee247..457fef8 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, ... }: +{ + lib, + pkgs, + outputs, + ... +}: { nix = { package = pkgs.nixVersions.latest; @@ -46,4 +51,11 @@ dates = [ "01:00" ]; }; }; + + nixpkgs.overlays = [ + (_: _: { + # bring all packages into a namespace called rad-pkgs + rad-pkgs = lib.genAttrs (lib.attrNames outputs.packages) (pkg: outputs.packages.${pkg}); + }) + ]; } -- 2.48.1 From d9fd71193d3b2ad25a7575e1f1e9cfc43d6358c5 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Mon, 12 Aug 2024 01:41:43 -0400 Subject: [PATCH 3/8] add ftb-app to artemision Signed-off-by: ahuston-0 --- systems/artemision/desktop.nix | 4 ++++ systems/artemision/programs.nix | 1 + 2 files changed, 5 insertions(+) diff --git a/systems/artemision/desktop.nix b/systems/artemision/desktop.nix index 207b75f..8c19dad 100644 --- a/systems/artemision/desktop.nix +++ b/systems/artemision/desktop.nix @@ -30,6 +30,10 @@ }; # Optional, hint electron apps to use wayland: environment.sessionVariables.NIXOS_OZONE_WL = "1"; + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; services = { xserver = { diff --git a/systems/artemision/programs.nix b/systems/artemision/programs.nix index 217e5cc..ecf13b2 100644 --- a/systems/artemision/programs.nix +++ b/systems/artemision/programs.nix @@ -72,6 +72,7 @@ protontricks proxychains qrencode + rad-pkgs.ftb-app redshift restic ripgrep -- 2.48.1 From 926b1618ffeb51f3dfdff8e216ce6ecdfc776dd4 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Wed, 2 Apr 2025 00:11:08 -0400 Subject: [PATCH 4/8] update documentation Signed-off-by: ahuston-0 --- flake.nix | 3 +-- lib/systems.nix | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index df0d41d..0e2e8a4 100644 --- a/flake.nix +++ b/flake.nix @@ -153,8 +153,7 @@ } ); inherit (lib.adev.systems) genSystems getImages; - inherit (self) outputs; # for hydra - + inherit (self) outputs; # for hydra and packages in rec { inherit lib; # for allowing use of custom functions in nix repl diff --git a/lib/systems.nix b/lib/systems.nix index 102e9d0..a34fc27 100644 --- a/lib/systems.nix +++ b/lib/systems.nix @@ -128,6 +128,7 @@ rec { # configPath: path to the folder containing hardware.nix & configuration.nix # hostname: hostname of the server # inputs: flake inputs to be used + # outputs: flake outputs to be used, primarily for accessing custom packages # src: base path of the repo # users: list of users to be added # home: enables home-manager on this machine (requires all users to have home-manager) @@ -191,6 +192,7 @@ rec { # # args: # inputs: flake-inputs to be distributed to each system config + # outputs: flake-outputs to be distributed to each system config # src: the base path to the repo # path: the path to read the systems from, should be a directory containing one directory per machine, each having at least the following # - default.nix (with the extra params for constructSystem in it, see systems/palatine-hill/default.nix for an example) -- 2.48.1 From 3d8b4d56392a771c2dead71243b4730fd0750b38 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Mon, 3 Mar 2025 00:50:41 -0500 Subject: [PATCH 5/8] move all packages under one folder --- flake.nix | 2 +- {packages => pkgs}/default.nix | 0 {packages => pkgs}/ftb-app/default.nix | 0 {packages => pkgs}/maintainers.nix | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename {packages => pkgs}/default.nix (100%) rename {packages => pkgs}/ftb-app/default.nix (100%) rename {packages => pkgs}/maintainers.nix (100%) diff --git a/flake.nix b/flake.nix index 0e2e8a4..e0ca595 100644 --- a/flake.nix +++ b/flake.nix @@ -168,7 +168,7 @@ qcow = getImages nixosConfigurations "qcow"; }; - packages = import ./packages { pkgs = nixpkgs.legacyPackages.x86_64-linux; }; + packages = import ./pkgs { pkgs = nixpkgs.legacyPackages.x86_64-linux; }; checks = import ./checks.nix { inherit inputs forEachSystem formatter; }; devShells = import ./shell.nix { inherit inputs forEachSystem checks; }; diff --git a/packages/default.nix b/pkgs/default.nix similarity index 100% rename from packages/default.nix rename to pkgs/default.nix diff --git a/packages/ftb-app/default.nix b/pkgs/ftb-app/default.nix similarity index 100% rename from packages/ftb-app/default.nix rename to pkgs/ftb-app/default.nix diff --git a/packages/maintainers.nix b/pkgs/maintainers.nix similarity index 100% rename from packages/maintainers.nix rename to pkgs/maintainers.nix -- 2.48.1 From 80b31b3a7dcfb2fdc08e1bbce09be5fac8eaa95a Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Mon, 3 Mar 2025 08:22:50 -0500 Subject: [PATCH 6/8] merge lego with existing pkgs --- pkgs/default.nix | 1 + pkgs/lego-latest/default.nix | 3 ++- systems/palatine-hill/acme.nix | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/default.nix b/pkgs/default.nix index 6716bbf..37b0b45 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -5,4 +5,5 @@ in { ftb-app = pkgs.callPackage ./ftb-app { inherit rad-maintainers; }; + lego-latest = pkgs.callPackage ./lego-latest { inherit rad-maintainers; }; } diff --git a/pkgs/lego-latest/default.nix b/pkgs/lego-latest/default.nix index bca86e4..fedc0fe 100644 --- a/pkgs/lego-latest/default.nix +++ b/pkgs/lego-latest/default.nix @@ -2,6 +2,7 @@ lib, fetchFromGitHub, buildGoModule, + rad-maintainers, }: buildGoModule rec { @@ -31,7 +32,7 @@ buildGoModule rec { description = "Let's Encrypt client and ACME library written in Go"; license = licenses.mit; homepage = "https://go-acme.github.io/lego/"; - maintainers = teams.acme.members; + maintainers = teams.acme.members ++ [ rad-maintainers.ahuston-0 ]; mainProgram = "lego"; }; diff --git a/systems/palatine-hill/acme.nix b/systems/palatine-hill/acme.nix index 150946b..5b2380b 100644 --- a/systems/palatine-hill/acme.nix +++ b/systems/palatine-hill/acme.nix @@ -31,7 +31,7 @@ openssl ] ++ [ - outputs.packages.x86_64-linux.lego-latest + outputs.packages.lego-latest ] ); -- 2.48.1 From c78a8db1442383e10a0f8def981a652c49f037e3 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Mon, 3 Mar 2025 10:31:53 -0500 Subject: [PATCH 7/8] bump ftb-app to 1.27.3 --- pkgs/ftb-app/default.nix | 8 +++++--- users/alice/home.nix | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/ftb-app/default.nix b/pkgs/ftb-app/default.nix index 2724b02..a8b8f74 100644 --- a/pkgs/ftb-app/default.nix +++ b/pkgs/ftb-app/default.nix @@ -8,6 +8,7 @@ expat, fetchurl, gtk3, + gdk-pixbuf, jre, lib, libdrm, @@ -26,11 +27,11 @@ # sha256sums_aarch64=(ad1197556a187693cbc488142562a0c17144e33056f1c914950c2f1496a4c532) stdenv.mkDerivation rec { pname = "ftb-app"; - version = "1.25.14"; + version = "1.27.3"; src = fetchurl { - url = "https://piston.feed-the-beast.com/app/ftb-app-${version}-amd64.deb"; - sha256 = "c9e4ce43be5337d2c7f10c55412d0acc629178d4967aef88897ebad2aa241ef0"; + url = "https://piston.feed-the-beast.com/app/ftb-app-linux-${version}-amd64.deb"; + sha256 = "031a73g58vj35h33pmp3swjrjlg09ismdx46810sp7ihrpvs0ad6"; }; nativeBuildInputs = [ @@ -82,6 +83,7 @@ stdenv.mkDerivation rec { libs+="${xorg.libxcb}/lib/libxcb.so.1 ${alsa-lib}/lib/libasound.so.2 " libs+="${libxkbcommon}/lib/libxkbcommon.so.0 " libs+="${at-spi2-atk}/lib/libatspi.so.0 ${xorg.libXtst}/lib/libXtst.so.6 " + libs+="${gdk-pixbuf}/lib/libgdk_pixbuf-2.0.so.0 " echo "$libs" diff --git a/users/alice/home.nix b/users/alice/home.nix index 330cae1..c301de1 100644 --- a/users/alice/home.nix +++ b/users/alice/home.nix @@ -76,6 +76,7 @@ nix-prefetch nix-tree nh + nix-prefetch-scripts # doom emacs dependencies fd @@ -90,6 +91,7 @@ nodejs_20 nodePackages.prettier treefmt + ]; }; -- 2.48.1 From f97789228c6c763ea74cb7516705b28e0f92dee3 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Wed, 19 Mar 2025 23:43:46 -0400 Subject: [PATCH 8/8] fix libgbm import --- pkgs/ftb-app/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/ftb-app/default.nix b/pkgs/ftb-app/default.nix index a8b8f74..0ee184f 100644 --- a/pkgs/ftb-app/default.nix +++ b/pkgs/ftb-app/default.nix @@ -12,6 +12,7 @@ jre, lib, libdrm, + libgbm, libxkbcommon, makeWrapper, mesa, @@ -79,11 +80,11 @@ stdenv.mkDerivation rec { libs+="${xorg.libXcomposite}/lib/libXcomposite.so.1 " libs+="${xorg.libXdamage}/lib/libXdamage.so.1 " libs+="${xorg.libXfixes}/lib/libXfixes.so.3 ${expat}/lib/libexpat.so.1 " - libs+="${xorg.libXrandr}/lib/libXrandr.so.2 ${mesa}/lib/libgbm.so.1 " + libs+="${xorg.libXrandr}/lib/libXrandr.so.2 " libs+="${xorg.libxcb}/lib/libxcb.so.1 ${alsa-lib}/lib/libasound.so.2 " libs+="${libxkbcommon}/lib/libxkbcommon.so.0 " libs+="${at-spi2-atk}/lib/libatspi.so.0 ${xorg.libXtst}/lib/libXtst.so.6 " - libs+="${gdk-pixbuf}/lib/libgdk_pixbuf-2.0.so.0 " + libs+="${gdk-pixbuf}/lib/libgdk_pixbuf-2.0.so.0 ${libgbm}/lib/libgbm.so.1" echo "$libs" -- 2.48.1