nixos/hosts/gendry.jakehillion-terminals.ts.hillion.co.uk/persist.nix

64 lines
1.8 KiB
Nix
Raw Normal View History

{ 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;
}
];
};
2023-01-24 20:26:59 +00:00
## Persistent directories and 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
2023-01-22 21:11:23 +00:00
### Persistent SSH keys
2022-12-05 22:45:12 +00:00
"L /home/jake/.ssh/id_rsa - - - - /data/users/jake/.ssh/id_rsa"
"L /home/jake/.ssh/id_ecdsa - - - - /data/users/jake/.ssh/id_ecdsa"
2023-01-22 21:11:23 +00:00
### Persistent spotify-tui
"d /home/jake/.config/ 0700 jake users - -"
"d /home/jake/.config/spotify-tui/ 0700 jake users - -"
2023-01-22 21:11:23 +00:00
"L /home/jake/.config/spotify-tui/.spotify_token_cache.json - - - - /data/users/jake/.config/spotify-tui/.spotify_token_cache.json"
"L /home/jake/.config/spotify-tui/client.yml - - - - /data/users/jake/.config/spotify-tui/client.yml"
];
## 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";
## Tailscale
fileSystems."/var/lib/tailscale" = {
device = "/data/system/var/lib/tailscale";
options = [ "bind" ];
};
2023-01-24 20:26:59 +00:00
## Bluetooth
fileSystems."/var/lib/bluetooth" = {
device = "/data/system/var/lib/bluetooth";
options = [ "bind" ];
};
}