Refactor pool.nix to create a symlink for the git directory in the home folder and clean up tmpfiles rules

This commit is contained in:
Chris Toph 2025-04-30 01:18:46 -04:00
parent 955b61c5a9
commit 981634c923
2 changed files with 27 additions and 17 deletions

View file

@ -72,8 +72,4 @@
scale = 1.20;
}
];
# home.file = {
# "run-mac.sh".source = config.lib.file.mkOutOfStoreSymlink "${pkgs.macos-ventura-image.runScript}";
# };
}

View file

@ -5,10 +5,33 @@ let
in
{
# Create the directories if they do not exist
systemd.tmpfiles.rules = [
"d /pool 2775 ${username} ryot -"
"d ${homeDir}/git 2775 ${username} ryot -"
];
systemd = {
tmpfiles.rules = [
"d /pool 2775 ${username} ryot -"
];
services.createGitSymlink = {
description = "Create symlink from home directory to pool/git";
after = [
"network.target"
"pool.mount"
];
requires = [ "pool.mount" ];
wantedBy = [ "multi-user.target" ];
script = ''
mkdir -p /pool/git
chown ${username}:ryot /pool/git
chmod 2775 /pool/git
rm -rf ${homeDir}/git
ln -sf /pool/git ${homeDir}/git
chown -h ${username}:ryot ${homeDir}/git
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
};
};
# File system configuration
fileSystems = {
@ -25,15 +48,6 @@ in
"sec=sys"
];
};
"${homeDir}/git" = {
fsType = "none";
device = "/pool/git";
options = [
"bind"
"nofail"
];
};
};
# Ensure NFS client support is complete