From bc7c3f803a2b8928ff63f2f1d80b89a5f6353492 Mon Sep 17 00:00:00 2001
From: Lillian-Violet <git@lillianviolet.dev>
Date: Wed, 26 Jun 2024 15:26:00 +0200
Subject: [PATCH 1/2] Queen has been fixed! (also flake lock update, and some
 small tweaks to reduce errors)

---
 flake.lock               | 48 ++++++++++++++++++++--------------------
 flake.nix                | 15 +------------
 nixos/shared/default.nix | 14 ++++++++++--
 3 files changed, 37 insertions(+), 40 deletions(-)

diff --git a/flake.lock b/flake.lock
index fa609b8..b280618 100644
--- a/flake.lock
+++ b/flake.lock
@@ -403,11 +403,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1719236180,
-        "narHash": "sha256-VZAfBk2Lo8hQy/NQ4XVSpTICT0ownXBUi1QvGfdlxaM=",
+        "lastModified": 1719401812,
+        "narHash": "sha256-QONBQ/arBsKZNJuSd3sMIkSYFlBoRJpvf1jGlMfcOuI=",
         "owner": "nix-community",
         "repo": "disko",
-        "rev": "dd4d1663ccf7fbdb32361b9afe9e71206584cd4c",
+        "rev": "b6a1262796b2990ec3cc60bb2ec23583f35b2f43",
         "type": "github"
       },
       "original": {
@@ -897,11 +897,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1719180626,
-        "narHash": "sha256-vZAzm5KQpR6RGple1dzmSJw5kPivES2heCFM+ZWkt0I=",
+        "lastModified": 1719385710,
+        "narHash": "sha256-0yb5D0wCEtXoTi4ssNZxwvLTrahTwlHYPtx252FZ1MU=",
         "owner": "nix-community",
         "repo": "home-manager",
-        "rev": "6b1f90a8ff92e81638ae6eb48cd62349c3e387bb",
+        "rev": "92a26bf6df1f00cbbed16a99d2547531ff4b3a83",
         "type": "github"
       },
       "original": {
@@ -917,11 +917,11 @@
         "nixpkgs": "nixpkgs_6"
       },
       "locked": {
-        "lastModified": 1719292813,
-        "narHash": "sha256-6w/buoRKo4ijH9O4D/0KjNtiWjtrJebuV7djTEEa0+k=",
+        "lastModified": 1719380852,
+        "narHash": "sha256-Li7zNOomyu0FVtm3TyyeUUCZex6L8QpGAJtiFQKGZGw=",
         "owner": "Jovian-Experiments",
         "repo": "Jovian-NixOS",
-        "rev": "d6222e7818aa5528f8369afe84bc53556a57c329",
+        "rev": "fd232b7d5d328619b21b867199b31ce799ae29f3",
         "type": "github"
       },
       "original": {
@@ -1133,11 +1133,11 @@
     },
     "nixos-hardware": {
       "locked": {
-        "lastModified": 1719145664,
-        "narHash": "sha256-+0bBlerLxsHUJcKPDWZM1wL3V9bzCFjz+VyRTG8fnUA=",
+        "lastModified": 1719391814,
+        "narHash": "sha256-zlRvpIUQrxMSOi+1lVFuJNvIJt9LB93c05tYQ1KSdRg=",
         "owner": "NixOS",
         "repo": "nixos-hardware",
-        "rev": "c3e48cbd88414f583ff08804eb57b0da4c194f9e",
+        "rev": "aab67495e34365045f9dfbe58725cc6fa03607b7",
         "type": "github"
       },
       "original": {
@@ -1180,11 +1180,11 @@
     },
     "nixpkgs-edge": {
       "locked": {
-        "lastModified": 1719313272,
-        "narHash": "sha256-0YOLZ8BslZZVfpWw/fOE/zn/QKeKOdS87UjuGzI4ciQ=",
+        "lastModified": 1719407708,
+        "narHash": "sha256-EipdX6SC6uVY/5kdNnDbYQiKoJoeFZHKEet8c34IWsc=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "736555406c2a59499046a31827a1470b6c29402d",
+        "rev": "aaa950d4f20622b00dbab53bf7b26c3d9a34939a",
         "type": "github"
       },
       "original": {
@@ -1291,11 +1291,11 @@
     },
     "nixpkgs-unstable": {
       "locked": {
-        "lastModified": 1719075281,
-        "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=",
+        "lastModified": 1719254875,
+        "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af",
+        "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
         "type": "github"
       },
       "original": {
@@ -1435,11 +1435,11 @@
     },
     "nixpkgs_8": {
       "locked": {
-        "lastModified": 1719075281,
-        "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=",
+        "lastModified": 1719254875,
+        "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af",
+        "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
         "type": "github"
       },
       "original": {
@@ -1474,11 +1474,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1719302143,
-        "narHash": "sha256-PMtSsKvbgfoI5+rb7UBIBfIwQ4Zvjt1iChWwQL+BkGo=",
+        "lastModified": 1719340029,
+        "narHash": "sha256-j++6RRMNvw+aYwI9qC2svfRwNj/2EEnaty552VIAFX0=",
         "owner": "pjones",
         "repo": "plasma-manager",
-        "rev": "a3b881f62eb3aabb97e4fc68041ef34e8029e186",
+        "rev": "004923027388062be53d5b489be51c59c114d857",
         "type": "github"
       },
       "original": {
diff --git a/flake.nix b/flake.nix
index 065ea9a..40ddf08 100644
--- a/flake.nix
+++ b/flake.nix
@@ -79,24 +79,11 @@
     # Add any other flake you might need
     # hardware.url = "github:nixos/nixos-hardware";
   };
-  nixConfig = {
-    extra-substituters = [
-      "https://nix-community.cachix.org"
-      "https://nixpkgs-unfree.cachix.org"
-      "https://0uptime.cachix.org"
-      "https://cache.lix.systems"
-    ];
-    extra-trusted-public-keys = [
-      "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
-      "nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs="
-      "0uptime.cachix.org-1:ctw8yknBLg9cZBdqss+5krAem0sHYdISkw/IFdRbYdE="
-      "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
-    ];
-  };
 
   outputs = {
     self,
     nixpkgs,
+    flake-utils,
     nixpkgs-edge,
     nixos-generators,
     catppuccin,
diff --git a/nixos/shared/default.nix b/nixos/shared/default.nix
index 702add4..1ad4cf2 100644
--- a/nixos/shared/default.nix
+++ b/nixos/shared/default.nix
@@ -34,8 +34,18 @@
       experimental-features = "nix-command flakes";
       # Deduplicate and optimize nix store
       auto-optimise-store = true;
-      extra-substituters = ["https://cache.lix.systems"];
-      trusted-public-keys = ["cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="];
+      extra-substituters = [
+        "https://cache.lix.systems"
+        "https://nix-community.cachix.org"
+        "https://nixpkgs-unfree.cachix.org"
+        "https://0uptime.cachix.org"
+      ];
+      trusted-public-keys = [
+        "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
+        "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+        "nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs="
+        "0uptime.cachix.org-1:ctw8yknBLg9cZBdqss+5krAem0sHYdISkw/IFdRbYdE="
+      ];
     };
   };
 

From 67cdc3600ea98cb81e392e625d5b83f812a50e63 Mon Sep 17 00:00:00 2001
From: Lillian-Violet <git@lillianviolet.dev>
Date: Fri, 28 Jun 2024 23:18:11 +0200
Subject: [PATCH 2/2] Let's see if this makes auto-mount work now

---
 nixos/hosts/shodan/auto-mount.nix    | 2 +-
 nixos/hosts/shodan/configuration.nix | 2 +-
 pkgs/auto-mount/default.nix          | 9 ++-------
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/nixos/hosts/shodan/auto-mount.nix b/nixos/hosts/shodan/auto-mount.nix
index 664322d..f1e7387 100644
--- a/nixos/hosts/shodan/auto-mount.nix
+++ b/nixos/hosts/shodan/auto-mount.nix
@@ -16,7 +16,7 @@
   '';
 
   systemd.services."external-drive-mount@" = {
-    path = with pkgs; [jq coreutils udisks bash util-linux toybox auto-mount steam];
+    path = with pkgs; [udisks bash auto-mount steam];
     enable = true;
     serviceConfig = {
       ExecStart = "${pkgs.auto-mount}/bin/auto-mount add %i";
diff --git a/nixos/hosts/shodan/configuration.nix b/nixos/hosts/shodan/configuration.nix
index 2ebcef8..b35973b 100644
--- a/nixos/hosts/shodan/configuration.nix
+++ b/nixos/hosts/shodan/configuration.nix
@@ -25,7 +25,7 @@
 
     ../../../disko/shodan
 
-    # ./auto-mount.nix
+    ./auto-mount.nix
   ];
 
   boot.tmp.cleanOnBoot = true;
diff --git a/pkgs/auto-mount/default.nix b/pkgs/auto-mount/default.nix
index 37a8ef2..7872cb4 100644
--- a/pkgs/auto-mount/default.nix
+++ b/pkgs/auto-mount/default.nix
@@ -3,11 +3,6 @@
   stdenv,
   system,
   pkgs,
-  jq,
-  coreutils,
-  udisks,
-  toybox,
-  util-linux,
   writeShellApplication,
 }:
 writeShellApplication
@@ -16,7 +11,7 @@ writeShellApplication
 
   name = "auto-mount";
 
-  runtimeInputs = [jq coreutils udisks util-linux toybox pkgs.steam pkgs.extest];
+  runtimeInputs = [pkgs.steam];
 
   text = ''
     set -euo pipefail
@@ -76,7 +71,7 @@ writeShellApplication
             # TODO use -ifrunning and check return value - if there was a steam process and it returns -1, the message wasn't sent
             # need to retry until either steam process is gone or -ifrunning returns 0, or timeout i guess
             echo "Sent URL to steam: steam://''${command}/''${arg} (steam://''${command}/''${encoded})" >> /home/lillian/steam.txt
-            systemd-run -M 1000@ --user --collect --wait sh -c "export LD_PRELOAD=${pkgs.extest}/lib/libextest.so:$LD_PRELOAD ${pkgs.steam}/bin/steam steam://''${command}/''${encoded@Q}"
+            systemd-run -M 1000@ --user --collect --wait sh -c "${pkgs.steam}/bin/steam steam://''${command}/''${encoded@Q}"
         else
             echo "Could not send steam URL steam://''${command}/''${arg} (steam://''${command}/''${encoded}) -- steam not running"
         fi