diff options
author | azahi <azat@bahawi.net> | 2025-01-14 13:27:50 +0300 |
---|---|---|
committer | azahi <azat@bahawi.net> | 2025-01-14 13:27:50 +0300 |
commit | b8ea365ca8eb801f8c8442f2f9ab439343ed8b8f (patch) | |
tree | fe46f6e8f0da8d8525e486290cca3079679b363d | |
parent | 2025-01-06 (diff) |
2025-01-14
-rw-r--r-- | configurations/eonwe/default.nix | 23 | ||||
-rw-r--r-- | flake.lock | 91 | ||||
-rw-r--r-- | flake.nix | 15 | ||||
-rw-r--r-- | modules/beets.nix | 1 | ||||
-rw-r--r-- | modules/common/nix.nix | 6 | ||||
-rw-r--r-- | modules/common/systemd.nix | 9 | ||||
-rw-r--r-- | modules/piracy/default.nix | 26 | ||||
-rw-r--r-- | modules/wireguard-ng.nix | 24 | ||||
-rw-r--r-- | modules/wireguard.nix | 130 | ||||
-rw-r--r-- | overlays.nix | 90 | ||||
-rw-r--r-- | packages/prismlauncher-no-login.patch | 65 | ||||
-rw-r--r-- | packages/telegram-no-ads.patch | 61 | ||||
-rw-r--r-- | packages/vesktop-no-anime.patch (renamed from packages/vesktop.patch) | 0 |
13 files changed, 345 insertions, 196 deletions
diff --git a/configurations/eonwe/default.nix b/configurations/eonwe/default.nix index 68cfac4..37653de 100644 --- a/configurations/eonwe/default.nix +++ b/configurations/eonwe/default.nix @@ -288,6 +288,17 @@ with lib; "x-systemd.idle-timeout=${5 * 60 |> toString}" ]; }; + + "/mnt/ydata/rtorrent" = { + device = "yavanna.shire.net:/export/rtorrent"; + fsType = "nfs"; + options = [ + "ro" + "noauto" + "x-systemd.automount" + "x-systemd.idle-timeout=${5 * 60 |> toString}" + ]; + }; }; zramSwap = { @@ -318,4 +329,16 @@ with lib; }; nix.settings.trusted-users = [ "builder" ]; + + # https://cl.tvl.fyi/c/depot/+/12961 + systemd.services = + let + override.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false"; + in + { + systemd-suspend = override; + systemd-hibernate = override; + systemd-hybrid-sleep = override; + systemd-suspend-then-hibernate = override; + }; } diff --git a/flake.lock b/flake.lock index 850db7c..2370b4a 100644 --- a/flake.lock +++ b/flake.lock @@ -229,11 +229,11 @@ ] }, "locked": { - "lastModified": 1735468753, - "narHash": "sha256-2dt1nOe9zf9pDkf5Kn7FUFyPRo581s0n90jxYXJ94l0=", + "lastModified": 1736591904, + "narHash": "sha256-LFO8pSrPKrH8OPq2HaAuBG5skk8/MNJ/9YmK3KsnSks=", "owner": "nix-community", "repo": "disko", - "rev": "84a5b93637cc16cbfcc61b6e1684d626df61eb21", + "rev": "33827d2bd16bfe2e21b62956526c72d313595dfd", "type": "github" }, "original": { @@ -265,6 +265,22 @@ "type": "github" } }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1734969791, + "narHash": "sha256-A9PxLienMYJ/WUvqFie9qXrNC2MeRRYw7TG/q7DRjZg=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "92f4890bd150fc9d97b61b3583680c0524a8cafe", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, "flake-compat": { "locked": { "lastModified": 1733328505, @@ -475,11 +491,11 @@ ] }, "locked": { - "lastModified": 1736089250, - "narHash": "sha256-/LPWMiiJGPHGd7ZYEgmbE2da4zvBW0acmshUjYC3WG4=", + "lastModified": 1736508663, + "narHash": "sha256-ZOaGwa+WnB7Zn3YXimqjmIugAnHePdXCmNu+AHkq808=", "owner": "nix-community", "repo": "home-manager", - "rev": "172b91bfb2b7f5c4a8c6ceac29fd53a01ef07196", + "rev": "2532b500c3ed2b8940e831039dcec5a5ea093afc", "type": "github" }, "original": { @@ -573,11 +589,11 @@ ] }, "locked": { - "lastModified": 1736128264, - "narHash": "sha256-B2RuVaQBbVChPf9ZqRBEqUA09MCD5P/iBpOokoXd5gM=", + "lastModified": 1736646923, + "narHash": "sha256-kU6J2zS90yskkmcbUcHKrDBxsUZWwLNMiCHnzJs2Rjg=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "eefeae9b72d15f69e7264a6a87fba6ecc9782496", + "rev": "cbd313bed852a2f277e7199ce060ac224bdce7da", "type": "github" }, "original": { @@ -593,11 +609,11 @@ ] }, "locked": { - "lastModified": 1736047960, - "narHash": "sha256-hutd85FA1jUJhhqBRRJ+u7UHO9oFGD/RVm2x5w8WjVQ=", + "lastModified": 1736652904, + "narHash": "sha256-8uolHABgroXqzs03QdulHp8H9e5kWQZnnhcda1MKbBM=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "816a6ae88774ba7e74314830546c29e134e0dffb", + "rev": "271e5bd7c57e1f001693799518b10a02d1123b12", "type": "github" }, "original": { @@ -635,11 +651,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1735388221, - "narHash": "sha256-e5IOgjQf0SZcFCEV/gMGrsI0gCJyqOKShBQU0iiM3Kg=", + "lastModified": 1736441705, + "narHash": "sha256-OL7leZ6KBhcDF3nEKe4aZVfIm6xQpb1Kb+mxySIP93o=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "7c674c6734f61157e321db595dbfcd8523e04e19", + "rev": "8870dcaff63dfc6647fb10648b827e9d40b0a337", "type": "github" }, "original": { @@ -650,16 +666,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734978747, - "narHash": "sha256-pf6fuTEgaWhRULssfJuogTV+huMGcj/zCAtvqEWkJcY=", + "lastModified": 1736675421, + "narHash": "sha256-TZTSrzYjwP1AM4IvJcN643U6uJbSQW3CNmpwIRafd1g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1588cc08aff2ccae08ec49a0b8612ff71c5736ac", + "rev": "7093d6908eeca322434542ac527902242382233f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "1588cc08aff2ccae08ec49a0b8612ff71c5736ac", "repo": "nixpkgs", "type": "github" } @@ -709,11 +724,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1736163950, - "narHash": "sha256-w+Kk+zA8R2Oae4i2jC8IflJsfjogOKy8pm3H28k5zY4=", + "lastModified": 1736675421, + "narHash": "sha256-TZTSrzYjwP1AM4IvJcN643U6uJbSQW3CNmpwIRafd1g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "19ab97dfada0904de0ff1329d93f6bbadf8269f3", + "rev": "7093d6908eeca322434542ac527902242382233f", "type": "github" }, "original": { @@ -829,6 +844,7 @@ "base16-fish": "base16-fish", "base16-helix": "base16-helix", "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", "flake-compat": [ "flake-compat" ], @@ -844,14 +860,15 @@ "systems": "systems_3", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", - "tinted-tmux": "tinted-tmux" + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1736011580, - "narHash": "sha256-8gmk/i9ZA5C6LGRnqHb5sZ8UKaqT5GnS6XxeSPMSz+s=", + "lastModified": 1736530113, + "narHash": "sha256-a+IUtGdzESNSQEZkW99TXf5js8o4Oy9M4H2am+2ECp4=", "owner": "danth", "repo": "stylix", - "rev": "7dfcdb410118dcd02ba1d85a2179a6f1c877403f", + "rev": "f1e003194cb528bbd4eda50b781d1f703611782d", "type": "github" }, "original": { @@ -955,6 +972,22 @@ "type": "github" } }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1725758778, + "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, "vscode-extensions": { "inputs": { "flake-compat": [ @@ -968,11 +1001,11 @@ ] }, "locked": { - "lastModified": 1736128196, - "narHash": "sha256-wSVfnO8Hixn767LsdAE/FIHO5IemkfbTEZZ03+HUowM=", + "lastModified": 1736646936, + "narHash": "sha256-NJaM0SiWs6nSZCQ9w3H9cV6ysg447/PYoBpMWYV12h4=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "ba2fa846fba43fb9c8cd71b1435d227a7925fae0", + "rev": "5669bbca35e6dd98ba43477e2fa4d87d0a0da3db", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3bf2570..527ea3f 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ # # [1]: https://github.com/NixOS/nix/issues/5373 inputs = { - nixpkgs.url = "github:NixOS/nixpkgs?ref=1588cc08aff2ccae08ec49a0b8612ff71c5736ac"; + nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs-master.url = "github:NixOS/nixpkgs/master"; nixpkgs-stable.url = "github:NixOS/nixpkgs/release-24.05"; @@ -154,7 +154,6 @@ inputs = { flake-compat.follows = "flake-compat"; nixpkgs.follows = "nixpkgs"; - nixpkgs-stable.follows = "nixpkgs-stable"; }; }; @@ -165,7 +164,7 @@ outputs = inputs@{ self, nixpkgs, ... }: let - lib = nixpkgs.lib.extend (lib: _: (import ./lib { inherit inputs lib system; })); + lib = nixpkgs.lib.extend (lib: _: import ./lib { inherit inputs lib system; }); system = "x86_64-linux"; @@ -202,12 +201,10 @@ overlays = import ./overlays.nix { inherit lib inputs; }; - devShells.${system}.default = - with pkgs; - mkShell { - inherit (self.checks.${system}.git-hooks) shellHook; - packages = [ go-task ]; - }; + devShells.${system}.default = pkgs.mkShell { + inherit (self.checks.${system}.git-hooks) shellHook; + packages = [ pkgs.go-task ]; + }; formatter.${system} = pkgs.nixfmt; diff --git a/modules/beets.nix b/modules/beets.nix index c25ad53..3141e4d 100644 --- a/modules/beets.nix +++ b/modules/beets.nix @@ -78,6 +78,7 @@ in "AU" "NZ" "US" + "XW" ]; original_year = true; }; diff --git a/modules/common/nix.nix b/modules/common/nix.nix index 2054185..0ce2ae4 100644 --- a/modules/common/nix.nix +++ b/modules/common/nix.nix @@ -80,10 +80,10 @@ in trusted-users = [ my.username ]; substituters = [ - "https://cache.garnix.io" - "https://cache.tvl.su" "https://nix-community.cachix.org" - "https://numtide.cachix.org" + # "https://cache.garnix.io" + # "https://cache.tvl.su" + # "https://numtide.cachix.org" ]; trusted-public-keys = [ "cache.tvl.su:kjc6KOMupXc1vHVufJUoDUYeLzbwSr9abcAKdn/U1Jk=" diff --git a/modules/common/systemd.nix b/modules/common/systemd.nix index 996096e..f832518 100644 --- a/modules/common/systemd.nix +++ b/modules/common/systemd.nix @@ -1,6 +1,5 @@ { config, - lib, ... }: { @@ -36,16 +35,8 @@ user = { inherit extraConfig; }; - - suppressedSystemUnits = lib.optionals config.nixfiles.modules.ark.enable [ - "systemd-machine-id-commit.service" - ]; }; - boot.initrd.systemd.suppressedUnits = lib.optionals config.nixfiles.modules.ark.enable [ - "systemd-machine-id-commit.service" - ]; - environment.variables = { SYSTEMD_PAGERSECURE = "1"; SYSTEMD_PAGER = "less"; diff --git a/modules/piracy/default.nix b/modules/piracy/default.nix index be957f0..7682356 100644 --- a/modules/piracy/default.nix +++ b/modules/piracy/default.nix @@ -58,6 +58,9 @@ in rpcSocket = socket; configText = with config.services.rtorrent; + let + pow = x: y: lib.pow x y |> toString; + in lib.mkForce '' directory.default.set = ${files} session.path.set = ${dataDir}/session @@ -72,23 +75,33 @@ in protocol.encryption.set = allow_incoming,try_outgoing,enable_retry - pieces.memory.max.set = ${toString (lib.pow 2 11)}M + pieces.memory.max.set = ${pow 2 11}M pieces.preload.type.set = 2 - network.max_open_files.set = ${toString (lib.pow 2 13)} - network.max_open_sockets.set = ${toString (lib.pow 2 13)} + network.max_open_files.set = ${pow 2 16} + network.max_open_sockets.set = ${pow 2 15} - network.http.max_open.set = ${toString (lib.pow 2 10)} + network.http.max_open.set = ${pow 2 10} + # https://github.com/rakshasa/rtorrent/wiki/Performance-Tuning#peers-and-slots + throttle.max_downloads.global.set = 10 + throttle.max_uploads.global.set = 1000 + throttle.min_peers.seed.set = 99 + throttle.max_peers.seed.set = 100 throttle.global_down.max_rate.set_kb = 0 - throttle.global_up.max_rate.set_kb = 0 + throttle.global_up.max_rate.set_kb = 0 + + pieces.preload.type.set = 2 network.scgi.open_local = ${socket} - network.xmlrpc.size_limit.set = ${toString (lib.pow 2 17)} + network.xmlrpc.size_limit.set = ${pow 2 17} encoding.add = utf8 system.umask.set = 0007 + # https://github.com/rakshasa/rtorrent/wiki/Performance-Tuning#session-save + schedule2 = session_save, 1200, 43200, ((session.save)) + log.open_file = "log", "/var/log/rtorrent/log" log.add_output = "info", "log" ''; @@ -106,6 +119,7 @@ in RuntimeDirectory = "rtorrent"; LogsDirectory = "rtorrent"; ReadWritePaths = [ files ]; + LimitNOFILE = lib.pow 2 17; }; after = [ "rtorrent.socket" ]; requires = [ "rtorrent.socket" ]; diff --git a/modules/wireguard-ng.nix b/modules/wireguard-ng.nix index 5374a71..1d291c9 100644 --- a/modules/wireguard-ng.nix +++ b/modules/wireguard-ng.nix @@ -128,13 +128,6 @@ in "${inputs.self}/secrets/wireguard-private-key-${this.hostname}"; networking.firewall.trustedInterfaces = [ cfg.interface ]; - - topology = with cfg; { - nodes.${this.hostname}.interfaces.${interface} = { - network = interface; - icon = "interfaces.wireguard"; - }; - }; }) (mkIf cfg.client.enable { networking.wg-quick.interfaces.${cfg.interface} = mkMerge [ @@ -233,23 +226,6 @@ in withRemoteIp = true; port = 9586; }; - - topology = with cfg; { - networks = { - ${interface} = { - name = interface; - cidrv4 = ipv4.subnet; - cidrv6 = ipv6.subnet; - icon = "interfaces.wireguard"; - }; - }; - - nodes.${this.hostname}.interfaces.${interface}.physicalConnections = - mapAttrsToList (name: _: config.lib.topology.mkConnection name interface) - ( - filterAttrs (n: v: !v.isOther && n != this.hostname && hasAttr "wireguard-ng" v) my.configurations - ); - }; }) ]; } diff --git a/modules/wireguard.nix b/modules/wireguard.nix index 633ec5b..92497e1 100644 --- a/modules/wireguard.nix +++ b/modules/wireguard.nix @@ -6,17 +6,16 @@ this, ... }: -with lib; let cfg = config.nixfiles.modules.wireguard; - DNSSetup = optionalString config.services.resolved.enable ( + DNSSetup = lib.optionalString config.services.resolved.enable ( let resolvectl = "${config.systemd.package}/bin/resolvectl"; in '' ${resolvectl} dns ${cfg.interface} ${cfg.server.ipv6.address} ${cfg.server.ipv4.address} - ${resolvectl} domain ${cfg.interface} local ${my.domain.shire} + ${resolvectl} domain ${cfg.interface} local ${lib.my.domain.shire} ${resolvectl} dnssec ${cfg.interface} no ${resolvectl} dnsovertls ${cfg.interface} no '' @@ -46,83 +45,81 @@ in options.nixfiles.modules.wireguard = { client = { - enable = mkEnableOption "WireGuard client"; + enable = lib.mkEnableOption "WireGuard client"; - enableTrafficRouting = mkOption { + enableTrafficRouting = lib.mkOption { description = "Whether to enable traffic routing through the sever."; - type = with types; bool; + type = lib.types.bool; default = !this.isHeadless; }; }; server = { - enable = mkEnableOption "WireGuard server"; + enable = lib.mkEnableOption "WireGuard server"; - ipv4.address = mkOption { + ipv4.address = lib.mkOption { description = "IPv4 address to bind to."; - type = with types; str; - default = my.configurations.manwe.wireguard.ipv4.address; + type = lib.types.str; + default = lib.my.configurations.manwe.wireguard.ipv4.address; }; - ipv6.address = mkOption { + ipv6.address = lib.mkOption { description = "IPv4 address to bind to."; - type = with types; str; - default = my.configurations.manwe.wireguard.ipv6.address; + type = lib.types.str; + default = lib.my.configurations.manwe.wireguard.ipv6.address; }; - address = mkOption { + address = lib.mkOption { description = "Endpoint address to use"; - type = with types; str; - default = my.configurations.manwe.ipv4.address; + type = lib.types.str; + default = lib.my.configurations.manwe.ipv4.address; }; - port = mkOption { + port = lib.mkOption { description = "Endpoint port to use."; - type = with types; int; + type = lib.types.int; default = 6969; }; - publicKey = mkOption { + publicKey = lib.mkOption { description = "Server's public key."; - type = with types; str; - default = my.configurations.manwe.wireguard.publicKey; + type = lib.types.str; + default = lib.my.configurations.manwe.wireguard.publicKey; }; - peers = mkOption { + peers = lib.mkOption { description = "List of peers."; - type = with types; listOf attrs; + type = with lib.types; listOf attrs; default = - mapAttrsToList - ( - _: attr: with attr; { - inherit (wireguard) publicKey; - allowedIPs = with wireguard; [ - "${ipv6.address}/128" - "${ipv4.address}/32" - ]; - } - ) - ( - filterAttrs (_: attr: attr.hostname != this.hostname && hasAttr "wireguard" attr) my.configurations - ); + lib.my.configurations + |> lib.filterAttrs (_: v: v.hostname != this.hostname && lib.hasAttr "wireguard" v) + |> lib.mapAttrsToList ( + _: v: { + inherit (v.wireguard) publicKey; + allowedIPs = with v.wireguard; [ + "${ipv6.address}/128" + "${ipv4.address}/32" + ]; + } + ); }; }; - interface = mkOption { + interface = lib.mkOption { description = "Name of the interface to use WireGuard with."; - type = with types; str; + type = lib.types.str; default = "wg69"; }; - ipv4.subnet = mkOption { + ipv4.subnet = lib.mkOption { description = "CIDR notation for the IPv4 subnet to use over WireGuard."; - type = with types; str; + type = lib.types.str; default = "10.69.0.0/16"; }; - ipv6.subnet = mkOption { + ipv6.subnet = lib.mkOption { description = "CIDR notation for the IPv6 subnet to use over WireGuard."; - type = with types; str; + type = lib.types.str; default = "fd69::/16"; }; }; @@ -135,27 +132,27 @@ in message = "Sudo is not enabled."; } { - assertion = any (x: x == "wheel") config.my.extraGroups; + assertion = lib.any (x: x == "wheel") config.my.extraGroups; message = ''User is not in the "wheel" group.''; } ]; } - // mkMerge [ - (mkIf (cfg.client.enable || cfg.server.enable) { + // lib.mkMerge [ + (lib.mkIf (cfg.client.enable || cfg.server.enable) { secrets."wireguard-private-key-${this.hostname}".file = "${inputs.self}/secrets/wireguard-private-key-${this.hostname}"; networking.firewall.trustedInterfaces = [ cfg.interface ]; - topology = with cfg; { - nodes.${this.hostname}.interfaces.${interface} = { - network = interface; + topology = { + nodes.${this.hostname}.interfaces.${cfg.interface} = { + network = cfg.interface; icon = "interfaces.wireguard"; }; }; }) - (mkIf cfg.client.enable { - networking.wg-quick.interfaces.${cfg.interface} = mkMerge [ + (lib.mkIf cfg.client.enable { + networking.wg-quick.interfaces.${cfg.interface} = lib.mkMerge [ (with this.wireguard; { type = "amneziawg"; privateKeyFile = config.secrets."wireguard-private-key-${this.hostname}".path; @@ -169,7 +166,7 @@ in peers = [ { inherit publicKey; - endpoint = "${address}:${toString port}"; + endpoint = "${address}:${port |> toString}"; allowedIPs = if cfg.client.enableTrafficRouting then [ @@ -217,7 +214,7 @@ in }) ]; }) - (mkIf cfg.server.enable { + (lib.mkIf cfg.server.enable { networking = { wireguard = { enable = true; @@ -239,7 +236,7 @@ in enable = true; enableIPv6 = true; - externalInterface = mkDefault "eth0"; + externalInterface = lib.mkDefault "eth0"; internalInterfaces = [ cfg.interface ]; internalIPs = [ cfg.ipv4.subnet ]; @@ -251,24 +248,27 @@ in services.prometheus.exporters.wireguard = { enable = false; # TODO Doesn't work with amneziawg-tools. - listenAddress = mkDefault this.wireguard.ipv4.address; + listenAddress = lib.mkDefault this.wireguard.ipv4.address; withRemoteIp = true; port = 9586; }; - topology = with cfg; { - networks = { - ${interface} = { - name = interface; - cidrv4 = ipv4.subnet; - cidrv6 = ipv6.subnet; - icon = "interfaces.wireguard"; - }; + topology = { + networks.${cfg.interface} = { + name = cfg.interface; + cidrv4 = cfg.ipv4.subnet; + cidrv6 = cfg.ipv6.subnet; + icon = "interfaces.wireguard"; + style.pattern = "dotted"; }; - nodes.${this.hostname}.interfaces.${interface}.physicalConnections = mapAttrsToList ( - name: _: config.lib.topology.mkConnection name interface - ) (filterAttrs (n: v: !v.isOther && n != this.hostname && hasAttr "wireguard" v) my.configurations); + nodes.${this.hostname}.interfaces.${cfg.interface} = { + network = cfg.interface; + physicalConnections = + lib.my.configurations + |> lib.filterAttrs (n: v: !v.isOther && n != this.hostname && lib.hasAttr "wireguard" v) + |> lib.mapAttrsToList (n: _: config.lib.topology.mkConnection n cfg.interface); + }; }; }) ]; diff --git a/overlays.nix b/overlays.nix index 020c6b2..893fea4 100644 --- a/overlays.nix +++ b/overlays.nix @@ -8,7 +8,7 @@ lib.infuse prev { bruh = _: prev.callPackage ./packages/bruh.nix { }; - emacsql-sqlite = _: prev.callPackage ./packages/emacsql-sqlite.nix { }; + emacsql-sqlite.__assign = prev.callPackage ./packages/emacsql-sqlite.nix { }; git-extras.__output.postPatch.__append = '' substituteInPlace bin/git-setup \ @@ -16,7 +16,6 @@ ''; grc.__output = { - version.__assign = "unstable-2021-08-12"; src.__assign = final.fetchFromGitHub { owner = "garabik"; repo = "grc"; @@ -31,68 +30,57 @@ ]; }; - hiccup = _: prev.callPackage ./packages/hiccup.nix { }; + hiccup.__assign = prev.callPackage ./packages/hiccup.nix { }; - lampray = _: prev.callPackage ./packages/lampray.nix { }; + lampray.__assign = prev.callPackage ./packages/lampray.nix { }; # TODO Can this be infused? - logcli = - _: - prev.grafana-loki.overrideAttrs ( - _: super: { - pname = "logcli"; - subPackages = [ "cmd/logcli" ]; - nativeBuildInputs = (super.nativeBuildInputs or [ ]) ++ [ final.installShellFiles ]; - postInstall = - (super.postInstall or "") - + '' - installShellCompletion --cmd logcli \ - --bash <($out/bin/logcli --completion-script-bash) \ - --zsh <($out/bin/logcli --completion-script-zsh) - ''; - preFixup = null; - } - ); + logcli.__assign = prev.grafana-loki.overrideAttrs ( + _: super: { + pname = "logcli"; + subPackages = [ "cmd/logcli" ]; + nativeBuildInputs = (super.nativeBuildInputs or [ ]) ++ [ final.installShellFiles ]; + postInstall = + (super.postInstall or "") + + '' + installShellCompletion --cmd logcli \ + --bash <($out/bin/logcli --completion-script-bash) \ + --zsh <($out/bin/logcli --completion-script-zsh) + ''; + preFixup = null; + } + ); - myip = _: prev.callPackage ./packages/myip.nix { }; + myip.__assign = prev.callPackage ./packages/myip.nix { }; - nixfiles = _: prev.callPackage ./packages/nixfiles.nix { }; + nixfiles.__assign = prev.callPackage ./packages/nixfiles.nix { }; - nixfmt = _: prev.nixfmt-rfc-style; + nixfmt.__assign = prev.nixfmt-rfc-style; - openssl_1_0_0 = _: prev.callPackage ./packages/openssl_1_0_0.nix { }; + prismlauncher-unwrapped.__output.patches.__append = [ + ./packages/prismlauncher-no-login.patch + ]; - # telegram-desktop = { - # __input.stdenv = stdenv: final.useMoldLinker stdenv; - # __output.patches.__append = - # let - # patches = "https://raw.githubusercontent.com/msva/mva-overlay/4c89938831bcce03fae22081809e53a47bdee31b/net-im/telegram-desktop/files/patches/0/conditional"; - # in - # [ - # (prev.fetchpatch { - # url = "${patches}/tdesktop_patches_hide-sponsored-messages/0000-data_data_sponsored_messages.cpp.patch"; - # hash = "sha256-vVucKG0YNY41MVdqibhKfxL/2/nNPPtYw+otwat971U="; - # }) - # (prev.fetchpatch { - # url = "${patches}/tdesktop_patches_allow-disable-stories/option-to-disable-stories.patch"; - # hash = "sha256-ctL9wIn3cLtqgCcQFNnx7WQuBw+9IjDlMJUicmVt8no="; - # }) - # (prev.fetchpatch { - # url = "${patches}/tdesktop_patches_hide-banned/0000_hide-messages-from-blocked-users.patch"; - # hash = "sha256-61U3wQsUdLvB4ymHPjVecw9WvhW8W/V0Jf1cnvYUkHk="; - # }) - # ]; - # }; + openssl_1_0_0.__assign = prev.callPackage ./packages/openssl_1_0_0.nix { }; + + telegram-desktop = { + __input.stdenv = final.useMoldLinker; + # __output.patches.__append = [ + # ./packages/telegram-no-ads.patch + # ]; + }; vesktop = { __input = { - withSystemVencord = _: false; - withTTS = _: false; + withMiddleClickScroll.__assign = true; + withSystemVencord.__assign = true; + withTTS.__assign = false; }; __output = { nativeBuildInputs.__append = [ final.imagemagick ]; - patches.__append = [ ./packages/vesktop.patch ]; + patches.__append = [ ./packages/vesktop-no-anime.patch ]; postInstall.__append = '' + # Remove LGBT iconography. rm -rf $out/share/icons/hicolor/* for size in 1024 128 256 32 512 64; do convert -scale $size $src/build/icon.png $size.png @@ -102,7 +90,7 @@ }; }; - rtorrent = - _: (lib.packages.fromPR 368724 "sha256-99C1bOu6L5UMia0zqR3258HO+MS7Jq89KQE6oycFsvc=").rtorrent; + dendrite = + _: (lib.packages.fromPR 366129 "sha256-oI9Afm3azJyEz4SJJIwuzeyuH7IaiGNTSA442vFlfv4=").dendrite; }; } diff --git a/packages/prismlauncher-no-login.patch b/packages/prismlauncher-no-login.patch new file mode 100644 index 0000000..033cb1a --- /dev/null +++ b/packages/prismlauncher-no-login.patch @@ -0,0 +1,65 @@ +diff --git c/launcher/Application.cpp w/launcher/Application.cpp +index b8dcc1099..29a84ba85 100644 +--- c/launcher/Application.cpp ++++ w/launcher/Application.cpp +@@ -1094,7 +1094,7 @@ bool Application::createSetupWizard() + bool pasteInterventionRequired = settings()->get("PastebinURL") != ""; + bool validWidgets = m_themeManager->isValidApplicationTheme(settings()->get("ApplicationTheme").toString()); + bool validIcons = m_themeManager->isValidIconTheme(settings()->get("IconTheme").toString()); +- bool login = !m_accounts->anyAccountIsValid() && capabilities() & Application::SupportsMSA; ++ bool login = false; + bool themeInterventionRequired = !validWidgets || !validIcons; + bool wizardRequired = javaRequired || languageRequired || pasteInterventionRequired || themeInterventionRequired || askjava || login; + if (wizardRequired) { +diff --git c/launcher/LaunchController.cpp w/launcher/LaunchController.cpp +index 687da1322..2bab547e8 100644 +--- c/launcher/LaunchController.cpp ++++ w/launcher/LaunchController.cpp +@@ -84,27 +84,8 @@ void LaunchController::decideAccount() + return; + } + +- // Find an account to use. +- auto accounts = APPLICATION->accounts(); +- if (accounts->count() <= 0 || !accounts->anyAccountIsValid()) { +- // Tell the user they need to log in at least one account in order to play. +- auto reply = CustomMessageBox::selectable(m_parentWidget, tr("No Accounts"), +- tr("In order to play Minecraft, you must have at least one Microsoft " +- "account which owns Minecraft logged in. " +- "Would you like to open the account manager to add an account now?"), +- QMessageBox::Information, QMessageBox::Yes | QMessageBox::No) +- ->exec(); +- +- if (reply == QMessageBox::Yes) { +- // Open the account manager. +- APPLICATION->ShowGlobalSettings(m_parentWidget, "accounts"); +- } else if (reply == QMessageBox::No) { +- // Do not open "profile select" dialog. +- return; +- } +- } +- + // Select the account to use. If the instance has a specific account set, that will be used. Otherwise, the default account will be used ++ auto accounts = APPLICATION->accounts(); + auto instanceAccountId = m_instance->settings()->get("InstanceAccountId").toString(); + auto instanceAccountIndex = accounts->findAccountByProfileId(instanceAccountId); + if (instanceAccountIndex == -1 || instanceAccountId.isEmpty()) { +diff --git c/launcher/ui/pages/global/AccountListPage.cpp w/launcher/ui/pages/global/AccountListPage.cpp +index 041b8faff..90eb6becf 100644 +--- c/launcher/ui/pages/global/AccountListPage.cpp ++++ w/launcher/ui/pages/global/AccountListPage.cpp +@@ -141,14 +141,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 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/packages/telegram-no-ads.patch b/packages/telegram-no-ads.patch new file mode 100644 index 0000000..1b34920 --- /dev/null +++ b/packages/telegram-no-ads.patch @@ -0,0 +1,61 @@ +diff --git i/Telegram/SourceFiles/data/components/sponsored_messages.cpp w/Telegram/SourceFiles/data/components/sponsored_messages.cpp +index 5ae9d8b2c..f116246b5 100644 +--- i/Telegram/SourceFiles/data/components/sponsored_messages.cpp ++++ w/Telegram/SourceFiles/data/components/sponsored_messages.cpp +@@ -27,7 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + namespace Data { + namespace { + +-constexpr auto kRequestTimeLimit = 5 * 60 * crl::time(1000); ++constexpr auto kRequestTimeLimit = 9999999 * 60 * crl::time(1000); + + [[nodiscard]] bool TooEarlyForRequest(crl::time received) { + return (received > 0) && (received + kRequestTimeLimit > crl::now()); +@@ -74,6 +74,9 @@ void SponsoredMessages::clearOldRequests() { + + SponsoredMessages::AppendResult SponsoredMessages::append( + not_null<History*> history) { ++ if (1) { ++ return; ++ } + if (isTopBarFor(history)) { + return SponsoredMessages::AppendResult::None; + } +@@ -110,6 +113,9 @@ void SponsoredMessages::inject( + MsgId injectAfterMsgId, + int betweenHeight, + int fallbackWidth) { ++ if (1) { ++ return; ++ } + if (!canHaveFor(history)) { + return; + } +@@ -210,24 +216,17 @@ void SponsoredMessages::inject( + } + + bool SponsoredMessages::canHaveFor(not_null<History*> history) const { +- if (history->peer->isChannel()) { +- return true; +- } else if (const auto user = history->peer->asUser()) { +- return user->isBot(); +- } + return false; + } + + bool SponsoredMessages::isTopBarFor(not_null<History*> history) const { +- if (peerIsUser(history->peer->id)) { +- if (const auto user = history->peer->asUser()) { +- return user->isBot(); +- } +- } + return false; + } + + void SponsoredMessages::request(not_null<History*> history, Fn<void()> done) { ++ if (1) { ++ return; ++ } + if (!canHaveFor(history)) { + return; + } diff --git a/packages/vesktop.patch b/packages/vesktop-no-anime.patch index 5fd97ef..5fd97ef 100644 --- a/packages/vesktop.patch +++ b/packages/vesktop-no-anime.patch |