2022-11-27 18:02:53 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
# Persist files (due to tmpfs root)
|
|
|
|
## Set root tmpfs to 0755
|
|
|
|
fileSystems."/".options = [ "mode=0755" ];
|
|
|
|
|
|
|
|
## Require data at boot (to have access to host keys for agenix)
|
|
|
|
fileSystems."/data".neededForBoot = true;
|
|
|
|
|
|
|
|
## OpenSSH Host Keys (SSH + agenix secrets)
|
|
|
|
services.openssh = {
|
|
|
|
hostKeys = [
|
|
|
|
{
|
|
|
|
path = "/data/system/etc/ssh/ssh_host_ed25519_key";
|
|
|
|
type = "ed25519";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
path = "/data/system/etc/ssh/ssh_host_rsa_key";
|
|
|
|
type = "rsa";
|
|
|
|
bits = 4096;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
## Persistent directory symlinks
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
### Persistent home subdirectories
|
|
|
|
"L /root/local - - - - /data/users/root"
|
|
|
|
"L /home/jake/local - - - - /data/users/jake"
|
2022-12-05 22:45:12 +00:00
|
|
|
|
|
|
|
## Persistent SSH keys
|
|
|
|
"L /home/jake/.ssh/id_rsa - - - - /data/users/jake/.ssh/id_rsa"
|
|
|
|
"L /home/jake/.ssh/id_ecdsa - - - - /data/users/jake/.ssh/id_ecdsa"
|
2022-11-27 18:02:53 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
## Persistent /etc/nixos
|
|
|
|
fileSystems."/etc/nixos" = {
|
|
|
|
device = "/data/users/root/repos/nixos";
|
|
|
|
options = [ "bind" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
## Persistent zsh history
|
|
|
|
programs.zsh.histFile = lib.mkForce "$HOME/local/.zsh_history";
|
2022-12-05 22:29:56 +00:00
|
|
|
|
|
|
|
## Tailscale
|
|
|
|
fileSystems."/var/lib/tailscale" = {
|
|
|
|
device = "/data/system/var/lib/tailscale";
|
|
|
|
options = [ "bind" ];
|
|
|
|
};
|
2022-11-27 18:02:53 +00:00
|
|
|
}
|