From 30fe63591613b4407a58020395e1bc84a9552ddc Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 24 Oct 2024 14:46:23 +0200 Subject: feat(modules/legacy/impermanence): Merge with the system config Using the home-manager module uses a non-root fuse bindfs, which is obviously slower than simply mounting the directories via bind mounts. Besides, mounting them via the bindfs fuse mount, results in a potential DOS, when this mount processes runs out of open file descriptors (leading to the issue described in the `nix -> lix` commit.) --- modules/by-name/im/impermanence/module.nix | 25 +++++++++++++++++++++--- modules/home.legacy/default.nix | 3 --- modules/home.legacy/impermanence/default.nix | 29 ---------------------------- 3 files changed, 22 insertions(+), 35 deletions(-) delete mode 100644 modules/home.legacy/impermanence/default.nix (limited to 'modules') diff --git a/modules/by-name/im/impermanence/module.nix b/modules/by-name/im/impermanence/module.nix index 513a91b7..140e0754 100644 --- a/modules/by-name/im/impermanence/module.nix +++ b/modules/by-name/im/impermanence/module.nix @@ -15,13 +15,32 @@ in { }; config = lib.mkIf cfg.enable { - # needed for the hm impermanence config - programs.fuse.userAllowOther = true; - environment.persistence = { "/srv" = { hideMounts = true; inherit (cfg) directories; + + users.soispha = { + directories = [ + ".local/share" + + ".local/state/nvim" + ".local/state/mpv" + ".local/state/wireplumber" + + ".config/Signal" + ".config/Element" + ".config/iamb/profiles" + + ".cache" + ".mozilla" + + "media" + "repos" + "school" + ]; + }; + files = [ "/etc/machine-id" ]; diff --git a/modules/home.legacy/default.nix b/modules/home.legacy/default.nix index 574ed66a..f4736150 100644 --- a/modules/home.legacy/default.nix +++ b/modules/home.legacy/default.nix @@ -1,5 +1,4 @@ { - impermanence, nixVim, nix-index-database, ... @@ -18,11 +17,9 @@ in { imports = [ ./conf ./files - ./impermanence ./pkgs ./wms - impermanence.nixosModules.home-manager.impermanence nixVim.homeManagerModules.nixvim nix-index-database.hmModules.nix-index ]; diff --git a/modules/home.legacy/impermanence/default.nix b/modules/home.legacy/impermanence/default.nix deleted file mode 100644 index dcb60f3b..00000000 --- a/modules/home.legacy/impermanence/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - lib, - nixosConfig, - ... -}: { - config = lib.mkIf nixosConfig.soispha.impermanence.enable { - home.persistence."/srv/home/soispha" = { - allowOther = true; - directories = [ - ".local/share" - - ".local/state/nvim" - ".local/state/mpv" - ".local/state/wireplumber" - - ".config/Signal" - ".config/Element" - ".config/iamb/profiles" - - ".cache" - ".mozilla" - - "media" - "repos" - "school" - ]; - }; - }; -} -- cgit 1.4.1