sodium: add cache directory on the sd card
All checks were successful
flake / flake (push) Successful in 1m13s

This commit is contained in:
Jake Hillion 2024-06-02 22:01:17 +01:00
parent 67644162e1
commit 30679f9f4b
2 changed files with 25 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, nixos-hardware, ... }:
{ config, pkgs, nixpkgs-unstable, lib, nixos-hardware, ... }:
{
imports = [
@ -23,6 +23,23 @@
## Impermanence
custom.impermanence.enable = true;
boot.initrd.postDeviceCommands = lib.mkAfter ''
btrfs subvolume delete /cache/tmp
btrfs subvolume snapshot /cache/empty_snapshot /cache/tmp
chmod 0777 /cache/tmp
chmod +t /cache/tmp
'';
### nix only supports build-dir from 2.22. bind mount /tmp to something persistent instead.
fileSystems."/tmp" = {
device = "/cache/tmp";
options = [ "bind" ];
};
# nix = {
# settings = {
# build-dir = "/cache/tmp/";
# };
# };
## Custom Services
custom.locations.autoServe = true;

View File

@ -42,6 +42,13 @@
options = [ "subvol=data" ];
};
fileSystems."/cache" =
{
device = "/dev/disk/by-uuid/48ae82bd-4d7f-4be6-a9c9-4fcc29d4aac0";
fsType = "btrfs";
options = [ "subvol=cache" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking