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:
parent
955b61c5a9
commit
981634c923
2 changed files with 27 additions and 17 deletions
|
@ -72,8 +72,4 @@
|
||||||
scale = 1.20;
|
scale = 1.20;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
# home.file = {
|
|
||||||
# "run-mac.sh".source = config.lib.file.mkOutOfStoreSymlink "${pkgs.macos-ventura-image.runScript}";
|
|
||||||
# };
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,33 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Create the directories if they do not exist
|
# Create the directories if they do not exist
|
||||||
systemd.tmpfiles.rules = [
|
systemd = {
|
||||||
"d /pool 2775 ${username} ryot -"
|
tmpfiles.rules = [
|
||||||
"d ${homeDir}/git 2775 ${username} ryot -"
|
"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
|
# File system configuration
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
|
@ -25,15 +48,6 @@ in
|
||||||
"sec=sys"
|
"sec=sys"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"${homeDir}/git" = {
|
|
||||||
fsType = "none";
|
|
||||||
device = "/pool/git";
|
|
||||||
options = [
|
|
||||||
"bind"
|
|
||||||
"nofail"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Ensure NFS client support is complete
|
# Ensure NFS client support is complete
|
||||||
|
|
Loading…
Add table
Reference in a new issue