summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorseth <[email protected]>2023-05-03 12:11:28 -0400
committerseth <[email protected]>2023-05-03 12:11:28 -0400
commite29d4bd1b90e42dc73304766f5cb0a71522568b7 (patch)
tree22e69019b97af5a1453df55530a4210e89d8d258 /misc
parent242c23b9d49a8ea5787a4f260c83a9b61975f555 (diff)
feat: add misc expressions
Diffstat (limited to 'misc')
-rw-r--r--misc/README.md3
-rw-r--r--misc/nixgc.nix11
-rw-r--r--misc/tcmalloc-monster.nix16
3 files changed, 30 insertions, 0 deletions
diff --git a/misc/README.md b/misc/README.md
new file mode 100644
index 0000000..df99a17
--- /dev/null
+++ b/misc/README.md
@@ -0,0 +1,3 @@
+# misc expressions
+
+these are standalone nix files for random things i do
diff --git a/misc/nixgc.nix b/misc/nixgc.nix
new file mode 100644
index 0000000..9b2b357
--- /dev/null
+++ b/misc/nixgc.nix
@@ -0,0 +1,11 @@
+# this is a shell script that uses the new nix cli to emulate
+# nix-collect-garbage
+with (import (builtins.getFlake "nixpkgs") {});
+ writeScriptBin "nixgc" ''
+ #!${fish}/bin/fish
+ set -l profiles (find /nix/var/nix/profiles/ -maxdepth 3 -type l -not -name '*-link')
+
+ for profile in $profiles
+ sudo nix profile wipe-history --profile $profile
+ end
+ ''
diff --git a/misc/tcmalloc-monster.nix b/misc/tcmalloc-monster.nix
new file mode 100644
index 0000000..1d5f51c
--- /dev/null
+++ b/misc/tcmalloc-monster.nix
@@ -0,0 +1,16 @@
+# this uses a cherry-picked version of nixpkgs with llvm 16
+# to build a 32-bit, statically linked version of tcmalloc
+#
+# i'm using it to test ways to solve crashes in tf2 on
+# systems with mesa also compiled against llvm 16
+let
+ commit = "2c627d9c702202d75746fd45045d20008bf7ed86";
+ nixpkgs = import (builtins.fetchTarball {
+ url = "https://github.com/RaitoBezarius/nixpkgs/archive/${commit}.tar.gz";
+ sha256 = "sha256:002sz5nqsr7nvwp6bdapwmb691snhrcwdlp4flbhwgqgfzzpyksc";
+ }) {system = "x86_64-linux";};
+
+ inherit (nixpkgs.llvmPackages_16) stdenv;
+ inherit (nixpkgs.pkgsi686Linux.pkgsStatic) gperftools;
+in
+ gperftools.override {inherit stdenv;}