diff --git a/machines/banana/hardware-configuration.nix b/machines/banana/hardware-configuration.nix index b945a41f..5112921d 100644 --- a/machines/banana/hardware-configuration.nix +++ b/machines/banana/hardware-configuration.nix @@ -32,12 +32,6 @@ fsType = "zfs"; }; - fileSystems."/root" = { - device = "/home/root"; - fsType = "none"; - options = [ "bind" ]; - }; - fileSystems."/boot" = { device = "/dev/disk/by-uuid/9273-1FCA"; fsType = "vfat"; diff --git a/machines/gfdesk/fs.nix b/machines/gfdesk/fs.nix index 429cb4e9..71d74dbb 100644 --- a/machines/gfdesk/fs.nix +++ b/machines/gfdesk/fs.nix @@ -32,11 +32,6 @@ fsType = "zfs"; }; - fileSystems."/root" = { - device = "/home/root"; - options = [ "bind" ]; - }; - fileSystems."/tmp" = { device = "nvmepool/tmp"; fsType = "zfs"; diff --git a/nix/nixos-modules/astral/mount-root-to-home.nix b/nix/nixos-modules/astral/mount-root-to-home.nix new file mode 100644 index 00000000..786e34d1 --- /dev/null +++ b/nix/nixos-modules/astral/mount-root-to-home.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: +with lib; { + options.astral.mount-root-to-home.enable = + mkEnableOption "mounting root to home"; + + config = mkIf config.astral.mount-root-to-home.enable { + fileSystems."/root" = { + device = "/home/root"; + options = [ "bind" ]; + }; + }; +} diff --git a/nix/nixos-modules/roles/pc.nix b/nix/nixos-modules/roles/pc.nix index 9445b9d2..c4bcb3d7 100644 --- a/nix/nixos-modules/roles/pc.nix +++ b/nix/nixos-modules/roles/pc.nix @@ -114,6 +114,7 @@ in { # dates = "*-*-* 3:00:00 US/Pacific"; # }; xmonad.enable = true; + mount-root-to-home.enable = true; }; security.rtkit.enable = true; diff --git a/nix/nixos-modules/roles/server.nix b/nix/nixos-modules/roles/server.nix index 1706566f..92ff61c8 100644 --- a/nix/nixos-modules/roles/server.nix +++ b/nix/nixos-modules/roles/server.nix @@ -27,6 +27,7 @@ inputs: infra-update.enable = false; net.sshd.enable = true; monitoring-node.enable = true; + mount-root-to-home.enable = true; tailscale.enable = true;