about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-10-21 04:03:28 +0300
committerAzat Bahawi <azat@bahawi.net>2023-10-21 04:03:28 +0300
commite591de4986b1c80f2529b7ba9b0601900a599276 (patch)
tree5cac69f30a8e85791ad6aa058a8abbc2b2b12acb /modules
parent2023-10-13 (diff)
2023-10-21
Diffstat (limited to 'modules')
-rw-r--r--modules/common/common/nix/default.nix39
-rw-r--r--modules/common/common/nix/patches/prismlauncher-allow-offline-accounts.patch24
-rw-r--r--modules/common/git.nix6
-rw-r--r--modules/nixos/default.nix1
-rw-r--r--modules/nixos/discord.nix22
-rw-r--r--modules/nixos/firefox/userContent.css22
-rw-r--r--modules/nixos/games/minecraft.nix4
7 files changed, 73 insertions, 45 deletions
diff --git a/modules/common/common/nix/default.nix b/modules/common/common/nix/default.nix
index bbb06d0..03918d7 100644
--- a/modules/common/common/nix/default.nix
+++ b/modules/common/common/nix/default.nix
@@ -87,22 +87,19 @@ with lib; {
     (
       _: super: {
         grc = super.grc.overrideAttrs (_: final: {
-          version = "devel";
-
+          version = "unstable-2021-08-12";
           src = super.fetchFromGitHub {
             owner = "garabik";
             repo = "grc";
             rev = "4d6a51fd78ad7e19af8dd12b2a828d1807267079";
             hash = "sha256-SmOZrgV0lgLryFoxADU15IKJ7jhxXar0MgbsV/z1GaE=";
           };
-
           patches = [
             (super.fetchpatch {
               url = "https://patch-diff.githubusercontent.com/raw/garabik/grc/pull/214.patch";
               hash = "sha256-VNr9jl5oFbFNJbGsjflwFV3oTbCzJ0lBIZA4eyeoXLY=";
             })
           ];
-
           postPatch =
             final.postPatch
             + ''
@@ -112,14 +109,36 @@ with lib; {
         });
 
         alejandra = super.alejandra.overrideAttrs (_: final: {
-          patches = final.patches ++ [./patches/alejandra-no-ads.patch];
-        });
-
-        telegram-desktop = super.telegram-desktop.overrideAttrs (_: final: {
-          patches = final.patches ++ [./patches/telegram-desktop-no-ads.patch];
+          patches =
+            final.patches
+            ++ [
+              ./patches/alejandra-no-ads.patch
+            ];
         });
 
-        inherit (pkgsPr 245433 "sha256-FF1WW0+/pJ15+mPVjv0bkrh0dpHfQU08HNat2gu1PQk=") openmw;
+        prismlauncher-unwrapped =
+          (super.prismlauncher-unwrapped.override (finalAttrs: {
+            stdenv = pkgs.useMoldLinker finalAttrs.stdenv;
+          }))
+          .overrideAttrs (_: final: {
+            patches =
+              final.patches
+              ++ [
+                ./patches/prismlauncher-allow-offline-accounts.patch
+              ];
+          });
+
+        telegram-desktop =
+          (super.telegram-desktop.override (finalAttrs: {
+            stdenv = pkgs.useMoldLinker finalAttrs.stdenv;
+          }))
+          .overrideAttrs (_: final: {
+            patches =
+              final.patches
+              ++ [
+                ./patches/telegram-desktop-no-ads.patch
+              ];
+          });
       }
     )
   ];
diff --git a/modules/common/common/nix/patches/prismlauncher-allow-offline-accounts.patch b/modules/common/common/nix/patches/prismlauncher-allow-offline-accounts.patch
new file mode 100644
index 0000000..c245066
--- /dev/null
+++ b/modules/common/common/nix/patches/prismlauncher-allow-offline-accounts.patch
@@ -0,0 +1,24 @@
+diff --git i/launcher/ui/pages/global/AccountListPage.cpp w/launcher/ui/pages/global/AccountListPage.cpp
+index 278f45c4..b65cbbfb 100644
+--- i/launcher/ui/pages/global/AccountListPage.cpp
++++ w/launcher/ui/pages/global/AccountListPage.cpp
+@@ -188,19 +188,6 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
+ 
+ void AccountListPage::on_actionAddOffline_triggered()
+ {
+-    if (!m_accounts->anyAccountIsValid()) {
+-        QMessageBox::warning(
+-            this,
+-            tr("Error"),
+-            tr(
+-                "You must add a Microsoft or Mojang account that owns Minecraft before you can add an offline account."
+-                "<br><br>"
+-                "If you have lost your account you can contact Microsoft for support."
+-            )
+-        );
+-        return;
+-    }
+-
+     MinecraftAccountPtr account = OfflineLoginDialog::newAccount(
+         this,
+         tr("Please enter your desired username to add your offline account.")
diff --git a/modules/common/git.nix b/modules/common/git.nix
index 70fb7c7..de401fb 100644
--- a/modules/common/git.nix
+++ b/modules/common/git.nix
@@ -68,6 +68,7 @@ in {
                 submodule = "log";
               };
               init.defaultBranch = "master";
+              push.autoSetupRemote = true;
               status.submoduleSummary = true;
               github.user = my.username;
               gitlab.user = my.username;
@@ -96,6 +97,11 @@ in {
           in {
             fuck = "!${git} reset --hard && ${git} clean -fdx";
             gud = ''commit -m "git gud"'';
+            review = "!${git} lg @{push}..";
+            reword = "commit --amend";
+            tree = "log --graph --date=relative --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ad)%Creset'";
+            uncommit = "reset --soft HEAD~1";
+            untrack = "rm --cache --";
             wtc = "!${curl} -sq whatthecommit.com/index.txt | ${git} commit -F -";
           };
 
diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix
index 5b9a3be..e8c9467 100644
--- a/modules/nixos/default.nix
+++ b/modules/nixos/default.nix
@@ -8,7 +8,6 @@ _: {
     ./chromium.nix
     ./clickhouse.nix
     ./common
-    ./discord.nix
     ./docker.nix
     ./dwm.nix
     ./emacs.nix
diff --git a/modules/nixos/discord.nix b/modules/nixos/discord.nix
deleted file mode 100644
index 69ab525..0000000
--- a/modules/nixos/discord.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  config,
-  lib,
-  pkgs,
-  ...
-}:
-with lib; let
-  cfg = config.nixfiles.modules.discord;
-in {
-  options.nixfiles.modules.discord.enable =
-    mkEnableOption "Steam runtime";
-
-  config = mkIf cfg.enable {
-    nixfiles.modules.common.nix.allowedUnfreePackages = ["discord"];
-
-    hm.home.packages = with pkgs; [
-      (discord.override {
-        withOpenASAR = false; # This doesnt work.
-      })
-    ];
-  };
-}
diff --git a/modules/nixos/firefox/userContent.css b/modules/nixos/firefox/userContent.css
index 5a297ab..e95c733 100644
--- a/modules/nixos/firefox/userContent.css
+++ b/modules/nixos/firefox/userContent.css
@@ -49,27 +49,31 @@
 
 @-moz-document regexp("https?://(.*\.)?github.com.*")
 {
-    #org-repo-pin-select-menu,
-    #sponsor-button,
-    .dropdown-divider,
-    .footer,
-    .octicon.octicon-info,
+    .Overlay-footer,
+    .color-fg-muted.f6.mt-4, /* GitHub profile guide. */
+    .flex-order-1.flex-md-order-none, /* Follow button. */
+    .js-user-status-item,
+    .protip,
     .pt-3.mt-3.d-none.d-md-block, /* Profile achievements. */
-    .starring-container,
-    .user-following-container,
-    .user-profile-link,
+    .text-small.color-fg-muted.mx-md-2.mt-3.mt-md-2.mb-2, /* Community guidelines. */
     .user-status-circle-badge-container,
     .user-status-container,
     a[href^="/account/choose?action=upgrade"],
     a[href^="/codespaces"],
     a[href^="/collections"],
+    a[href^="/contact/report-content"],
     a[href^="/events"],
     a[href^="/explore"],
+    a[href^="/github-copilot"],
     a[href^="/marketplace"],
     a[href^="/organizations/enterprise"],
+    a[href^="/settings/enterprises"],
     a[href^="/sponsors"],
     a[href^="/topics"],
-    a[href^="/trending"] {
+    a[href^="/trending"],
+    details[id^="funding-links-modal"],
+    footer
+    {
         display: none !important;
     }
 
diff --git a/modules/nixos/games/minecraft.nix b/modules/nixos/games/minecraft.nix
index f738c33..2242df4 100644
--- a/modules/nixos/games/minecraft.nix
+++ b/modules/nixos/games/minecraft.nix
@@ -31,9 +31,7 @@ in {
 
   config = mkMerge [
     (mkIf cfg.client.enable {
-      hm.home.packages = with pkgs; [pollymc-unwrapped];
-
-      nixpkgs.overlays = [inputs.pollymc.overlays.default];
+      hm.home.packages = [pkgs.prismlauncher];
     })
     (mkIf cfg.server.enable {
       nixfiles.modules.common.nix.allowedUnfreePackages = ["minecraft-server"];

Consider giving Nix/NixOS a try! <3