diff --git a/flake.lock b/flake.lock index 0a2b988..06a6248 100644 --- a/flake.lock +++ b/flake.lock @@ -330,11 +330,11 @@ "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1622633535, - "narHash": "sha256-EelxH4BcFDowm5+c8Kl6wUTyvP6LhMpzoOS6r559oHo=", + "lastModified": 1622809115, + "narHash": "sha256-0lfX3ihV+5VsOs40eSzNMUSNlmH6MRqkb+VDWaJNEzw=", "owner": "NixOS", "repo": "nix", - "rev": "bb066409719f3b0e820115a3f89589457bf7f500", + "rev": "8e6ee1b9e924fbbbeb5594eb89e7a570f36ab6e1", "type": "github" }, "original": { diff --git a/machines/AMD-Workstation/default.nix b/machines/AMD-Workstation/default.nix index d2ef0b0..c8b1228 100644 --- a/machines/AMD-Workstation/default.nix +++ b/machines/AMD-Workstation/default.nix @@ -25,13 +25,15 @@ secrets.wireguard-wg0 = { }; + environment.sessionVariables.WINEPREFIX = "/home/balsoft/.local/share/wineprefixes/default"; + persist = { enable = true; cache.clean.enable = false; # Scary... state.directories = [ "/home/balsoft/.local/share/Steam" ]; - derivative.directories = [ "/home/balsoft/.wine" "/home/balsoft/.wine32" ]; + derivative.directories = [ "/home/balsoft/.local/share/wineprefixes/default" ]; }; services.ezwg = { diff --git a/modules/nix.nix b/modules/nix/default.nix similarity index 85% rename from modules/nix.nix rename to modules/nix/default.nix index 3fc68ca..ca80c4f 100644 --- a/modules/nix.nix +++ b/modules/nix/default.nix @@ -16,7 +16,9 @@ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; - package = inputs.nix.packages.x86_64-linux.nix; + package = inputs.nix.packages.x86_64-linux.nix.overrideAttrs (oa: { + patches = [./nix.patch] ++ oa.patches or []; + }); extraOptions = '' experimental-features = nix-command flakes diff --git a/modules/nix/nix.patch b/modules/nix/nix.patch new file mode 100644 index 0000000..0702778 --- /dev/null +++ b/modules/nix/nix.patch @@ -0,0 +1,42 @@ +diff --git a/src/libstore/profiles.cc b/src/libstore/profiles.cc +index 5d1723886..4f2e4f5db 100644 +--- a/src/libstore/profiles.cc ++++ b/src/libstore/profiles.cc +@@ -250,13 +250,6 @@ Path getDefaultProfile() + { + Path profileLink = getHome() + "/.nix-profile"; + try { +- if (!pathExists(profileLink)) { +- replaceSymlink( +- getuid() == 0 +- ? settings.nixStateDir + "/profiles/default" +- : fmt("%s/profiles/per-user/%s/profile", settings.nixStateDir, getUserName()), +- profileLink); +- } + return absPath(readLink(profileLink), dirOf(profileLink)); + } catch (Error &) { + return profileLink; +diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc +index e04954d45..5649bd01a 100644 +--- a/src/nix-env/nix-env.cc ++++ b/src/nix-env/nix-env.cc +@@ -1336,19 +1336,6 @@ static int main_nix_env(int argc, char * * argv) + globals.instSource.nixExprPath = getHome() + "/.nix-defexpr"; + globals.instSource.systemFilter = "*"; + +- if (!pathExists(globals.instSource.nixExprPath)) { +- try { +- createDirs(globals.instSource.nixExprPath); +- replaceSymlink( +- fmt("%s/profiles/per-user/%s/channels", settings.nixStateDir, getUserName()), +- globals.instSource.nixExprPath + "/channels"); +- if (getuid() != 0) +- replaceSymlink( +- fmt("%s/profiles/per-user/root/channels", settings.nixStateDir), +- globals.instSource.nixExprPath + "/channels_root"); +- } catch (Error &) { } +- } +- + globals.dryRun = false; + globals.preserveInstalled = false; + globals.removeAll = false;