mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2025-12-16 00:18:19 +01:00
Local akkoma for testing
This commit is contained in:
parent
b317cd7865
commit
85654ce3a9
8 changed files with 361 additions and 17 deletions
30
hosts/laptop/akkoma/akkoma-static.nix
Normal file
30
hosts/laptop/akkoma/akkoma-static.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
imperativeStaticPath = "/data/akkoma/static_i";
|
||||
declarativeStaticPath = "/data/akkoma/static_d";
|
||||
mergedStaticPath = "/data/akkoma/static";
|
||||
declarativeStaticFiles = let cfg = config.services.akkoma; in with lib; pkgs.runCommandLocal "declarative-akkoma-static" { } ''
|
||||
${concatStringsSep "\n" (mapAttrsToList (key: val: ''
|
||||
mkdir -p $out/frontends/${escapeShellArg val.name}/
|
||||
ln -s ${escapeShellArg val.package} $out/frontends/${escapeShellArg val.name}/${escapeShellArg val.ref}
|
||||
'') cfg.frontends)}
|
||||
|
||||
${optionalString (cfg.extraStatic != null)
|
||||
(concatStringsSep "\n" (mapAttrsToList (key: val: ''
|
||||
mkdir -p "$out/$(dirname ${escapeShellArg key})"
|
||||
ln -s ${escapeShellArg val} $out/${escapeShellArg key}
|
||||
'') cfg.extraStatic))}
|
||||
'';
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ mergerfs ];
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${imperativeStaticPath} 700 akkoma akkoma -"
|
||||
"L+ ${declarativeStaticPath} - - - - ${toString declarativeStaticFiles}"
|
||||
];
|
||||
fileSystems."${mergedStaticPath}" = {
|
||||
fsType = "fuse.mergerfs";
|
||||
device = "${imperativeStaticPath}:${declarativeStaticPath}";
|
||||
options = [ "cache.files=off" "dropcacheonclose=true" "category.create=epff" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue