summaryrefslogtreecommitdiff
path: root/modules/common
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-11-13 10:40:41 +0300
committerAzat Bahawi <azat@bahawi.net>2023-11-13 10:40:41 +0300
commita3f9fde2a2d43dd477f402bd4b8df2a1cd29ca43 (patch)
treecbd0c2457daa6865eb33b5389ec40309e60868a9 /modules/common
parent011c1632f3762e1bc1ecfdee9d9f3b3f44be74e5 (diff)
2023-11-13
Diffstat (limited to 'modules/common')
-rw-r--r--modules/common/common/default.nix2
-rw-r--r--modules/common/common/nix.nix (renamed from modules/common/common/nix/default.nix)82
-rw-r--r--modules/common/common/nix/patches/alejandra-no-ads.patch33
-rw-r--r--modules/common/common/nix/patches/prismlauncher-allow-offline-accounts.patch24
-rw-r--r--modules/common/common/nix/patches/telegram-desktop-no-ads.patch45
-rw-r--r--modules/common/common/nix/patches/vesktop-no-anime.patch17
-rw-r--r--modules/common/profiles/dev/editorconfig.ini85
7 files changed, 51 insertions, 237 deletions
diff --git a/modules/common/common/default.nix b/modules/common/common/default.nix
index a516ef3..0087754 100644
--- a/modules/common/common/default.nix
+++ b/modules/common/common/default.nix
@@ -4,7 +4,7 @@ _: {
./home-manager.nix
./locale.nix
./networking.nix
- ./nix
+ ./nix.nix
./secrets.nix
./shell
./users.nix
diff --git a/modules/common/common/nix/default.nix b/modules/common/common/nix.nix
index 370667c..ec3a4a3 100644
--- a/modules/common/common/nix/default.nix
+++ b/modules/common/common/nix.nix
@@ -4,7 +4,6 @@
lib,
localUsername ? lib.my.username,
pkgs,
- pkgsMaster,
this,
...
}:
@@ -84,84 +83,8 @@ with lib; {
nixpkgs.overlays = with inputs; [
self.overlays.default
nur.overlay
- (
- _: super: {
- grc = super.grc.overrideAttrs (_: final: {
- 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
- + ''
- substituteInPlace grc.conf \
- --replace "^([/\w\.]+\/)" "^([/\w\.\-]+\/)"
- '';
- });
-
- alejandra = super.alejandra.overrideAttrs (_: final: {
- patches =
- final.patches
- ++ [
- ./patches/alejandra-no-ads.patch
- ];
- });
-
- 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 =
- (pkgsMaster.telegram-desktop.override (finalAttrs: {
- stdenv = pkgs.useMoldLinker finalAttrs.stdenv;
- }))
- .overrideAttrs (_: final: {
- patches =
- final.patches
- ++ [
- ./patches/telegram-desktop-no-ads.patch
- ];
- });
-
- vesktop = pkgsMaster.vesktop.overrideAttrs (_: final: {
- nativeBuildInputs = final.nativeBuildInputs ++ [super.imagemagick];
- patches =
- final.patches
- ++ [
- ./patches/vesktop-no-anime.patch
- ];
- postInstall = ''
- # Replace gay icons with the default one. Apparently, these were
- # designed specifically for MacOS[1]. You can't make this shit up
- # LMAO.
- #
- # [1]: https://github.com/Vencord/Vesktop/pull/48
- rm -rf $out/share/icons/hicolor/*
- for size in 16 24 32 48 64 96; do
- convert -scale $size icon.png $size.png
- install -Dm644 $size.png $out/share/icons/hicolor/''${size}x''${size}/apps/vencorddesktop.png
- done
- '';
- });
- }
- )
+ (_: _: {
+ })
];
environment = {
@@ -175,6 +98,7 @@ with lib; {
};
hm = {
+ # Used primarily in conjunction with the "nixfiles" script.
home.file.".nix-defexpr/default.nix".text = let
hostname = strings.escapeNixIdentifier this.hostname;
in
diff --git a/modules/common/common/nix/patches/alejandra-no-ads.patch b/modules/common/common/nix/patches/alejandra-no-ads.patch
deleted file mode 100644
index 6eaac66..0000000
--- a/modules/common/common/nix/patches/alejandra-no-ads.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git i/src/alejandra_cli/src/cli.rs w/src/alejandra_cli/src/cli.rs
-index bab102c..b90bf1d 100644
---- i/src/alejandra_cli/src/cli.rs
-+++ w/src/alejandra_cli/src/cli.rs
-@@ -7,7 +7,6 @@ use futures::future::RemoteHandle;
- use futures::stream::FuturesUnordered;
- use futures::task::SpawnExt;
-
--use crate::ads::random_ad;
- use crate::verbosity::Verbosity;
-
- /// The Uncompromising Nix Code Formatter.
-@@ -203,11 +202,6 @@ pub fn main() -> std::io::Result<()> {
- (true, false) => "requires formatting",
- }
- );
--
-- if in_place {
-- eprintln!();
-- eprint!("{}", random_ad());
-- }
- }
-
- std::process::exit(if in_place { 0 } else { 2 });
-@@ -218,8 +212,6 @@ pub fn main() -> std::io::Result<()> {
- eprintln!(
- "Congratulations! Your code complies with the Alejandra style."
- );
-- eprintln!();
-- eprint!("{}", random_ad());
- }
-
- std::process::exit(0);
diff --git a/modules/common/common/nix/patches/prismlauncher-allow-offline-accounts.patch b/modules/common/common/nix/patches/prismlauncher-allow-offline-accounts.patch
deleted file mode 100644
index c245066..0000000
--- a/modules/common/common/nix/patches/prismlauncher-allow-offline-accounts.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-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/common/nix/patches/telegram-desktop-no-ads.patch b/modules/common/common/nix/patches/telegram-desktop-no-ads.patch
deleted file mode 100644
index d066066..0000000
--- a/modules/common/common/nix/patches/telegram-desktop-no-ads.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git i/Telegram/SourceFiles/data/data_sponsored_messages.cpp w/Telegram/SourceFiles/data/data_sponsored_messages.cpp
-index fa21af469..263ea3e61 100644
---- i/Telegram/SourceFiles/data/data_sponsored_messages.cpp
-+++ w/Telegram/SourceFiles/data/data_sponsored_messages.cpp
-@@ -179,39 +179,7 @@ bool SponsoredMessages::canHaveFor(not_null<History*> history) const {
- }
-
- void SponsoredMessages::request(not_null<History*> history, Fn<void()> done) {
-- if (!canHaveFor(history)) {
-- return;
-- }
-- auto &request = _requests[history];
-- if (request.requestId || TooEarlyForRequest(request.lastReceived)) {
-- return;
-- }
-- {
-- const auto it = _data.find(history);
-- if (it != end(_data)) {
-- auto &list = it->second;
-- // Don't rebuild currently displayed messages.
-- const auto proj = [](const Entry &e) {
-- return e.item != nullptr;
-- };
-- if (ranges::any_of(list.entries, proj)) {
-- return;
-- }
-- }
-- }
-- const auto channel = history->peer->asChannel();
-- Assert(channel != nullptr);
-- request.requestId = _session->api().request(
-- MTPchannels_GetSponsoredMessages(
-- channel->inputChannel)
-- ).done([=](const MTPmessages_sponsoredMessages &result) {
-- parse(history, result);
-- if (done) {
-- done();
-- }
-- }).fail([=] {
-- _requests.remove(history);
-- }).send();
-+ return;
- }
-
- void SponsoredMessages::parse(
diff --git a/modules/common/common/nix/patches/vesktop-no-anime.patch b/modules/common/common/nix/patches/vesktop-no-anime.patch
deleted file mode 100644
index 5fd97ef..0000000
--- a/modules/common/common/nix/patches/vesktop-no-anime.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git i/static/views/splash.html w/static/views/splash.html
-index 7cb571b..519c0f6 100644
---- i/static/views/splash.html
-+++ w/static/views/splash.html
-@@ -30,12 +30,6 @@
-
- <body>
- <div class="wrapper">
-- <img
-- draggable="false"
-- src="../shiggy.gif"
-- alt="shiggy"
-- role="presentation"
-- />
- <p>Loading Vesktop...</p>
- </div>
- </body>
diff --git a/modules/common/profiles/dev/editorconfig.ini b/modules/common/profiles/dev/editorconfig.ini
index 098229f..87f47eb 100644
--- a/modules/common/profiles/dev/editorconfig.ini
+++ b/modules/common/profiles/dev/editorconfig.ini
@@ -9,79 +9,88 @@ insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true
-[*.nix]
-indent_size = 2
-indent_style = space
-
-[*.{S,s,asm}]
-indent_size = 4
-indent_style = tab
-
-[*.{C,H,c,c++,cc,cpp,cxx,h,h++,hh,hpp,hxx}]
+# C/C++
+[*.{c,cc,cpp,cxx,h,hh,hpp,hxx,ixx}]
indent_size = 4
indent_style = tab
-[*.{cl,clj,el,l,lisp,lsp,rkt,scm,ss}]
-indent_size = 2
-indent_style = space
-
+# Go
[*.go]
indent_size = 4
indent_style = tab
-[*.{py,pyx}]
+# Python
+[*.py]
indent_size = 4
indent_style = space
+max_line_length = 72
-[*.{hs,lhs}]
-indent_size = 2
-indent_style = space
-
-[*.{html,xhtml,xml}]
-indent_size = 4
-indent_style = tab
-
-[*.json]
+# Haskell
+[*.hs]
indent_size = 2
indent_style = space
-[*.{yaml,yml}]
+# Lisp(s)
+[*.{lisp,cl,rkt,scm,el}]
indent_size = 2
indent_style = space
-[*.{toml,tml}]
-indent_size = 4
-indent_style = space
-
-[*.{py,pyx}]
-indent_size = 4
-indent_style = space
-max_line_length = 72
-
+# Zig
[*.zig]
indent_size = 4
indent_style = tab
-[*.{tf,hcl}]
-indent_size = 2
-indent_style = space
+# Assembly
+[*.{asm,s}]
+indent_size = 4
+indent_style = tab
+# GNU Cringetools
[configure.ac]
indent_size = 4
indent_style = tab
+# Make
[{Makefile*,*.mk}]
indent_size = 4
indent_style = tab
+# CMake
[{CMakeLists.txt,*.cmake}]
indent_size = 8
indent_style = tab
-[*.tex]
+# Nix
+[*.nix]
+indent_size = 2
+indent_style = space
+
+# HCL
+[*.{tf,hcl}]
+indent_size = 2
+indent_style = space
+
+# JSON
+[*.json]
+indent_size = 2
+indent_style = space
+
+# YAML
+[*.{yaml,yml}]
+indent_size = 2
+indent_style = space
+
+# TOML
+[*.{toml,tml}]
+indent_size = 4
+indent_style = space
+
+# Markup
+[*.{html,xml}]
indent_size = 4
indent_style = tab
-[*.{md,adoc,rtf,txt}]
+# (La)TeX
+[*.{tex,cls}]
indent_size = 4
indent_style = tab