This repository has been archived on 2023-07-23. You can view files and clone it, but cannot push or open issues or pull requests.
gpd-configurations/global/stateless-configuration.nix

39 lines
841 B
Nix
Raw Permalink Normal View History

2023-06-25 02:17:21 +00:00
{
2023-07-04 08:53:01 +00:00
# /nix/persistent 是你实际保存文件的地方
environment.persistence."/nix/persistent" = {
# 不让这些映射的 mount 出现在文件管理器的侧边栏中
hideMounts = true;
2023-06-25 02:17:21 +00:00
2023-07-04 08:53:01 +00:00
# 你要映射的文件夹
directories = [
"/etc/NetworkManager/system-connections"
"/root"
"/var"
];
2023-06-26 12:08:55 +00:00
2023-07-04 08:53:01 +00:00
files = [
"/etc/machine-id"
];
};
2023-06-25 02:17:21 +00:00
2023-07-04 08:53:01 +00:00
environment.variables.NIX_REMOTE = "daemon";
2023-06-25 02:17:21 +00:00
2023-07-04 08:53:01 +00:00
systemd.services.nix-daemon = {
environment = {
# 指定临时文件的位置
TMPDIR = "/var/cache/nix";
2023-06-25 02:17:21 +00:00
};
2023-07-04 08:53:01 +00:00
serviceConfig = {
# 在 Nix Daemon 启动时自动创建 /var/cache/nix
CacheDirectory = "nix";
2023-06-25 02:17:21 +00:00
};
2023-07-04 08:53:01 +00:00
};
# Stateless rootfs
fileSystems."/" = {
device = "tmpfs";
fsType = "tmpfs";
options = [ "relatime" "mode=755" "nosuid" "nodev" ];
};
}