diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2023-09-08 13:25:32 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2023-09-08 13:25:32 +0200 |
commit | b417b44757c688ed9df71241d0721ce86fdc9a13 (patch) | |
tree | 741280ea73f7939eb84039defd7761b4b65d063c /home-modules/lmu-hausschrift/default.nix | |
parent | b626d646d98e5d6cf6102bfc0c26cd7cb3f57676 (diff) | |
download | nixos-b417b44757c688ed9df71241d0721ce86fdc9a13.tar nixos-b417b44757c688ed9df71241d0721ce86fdc9a13.tar.gz nixos-b417b44757c688ed9df71241d0721ce86fdc9a13.tar.bz2 nixos-b417b44757c688ed9df71241d0721ce86fdc9a13.tar.xz nixos-b417b44757c688ed9df71241d0721ce86fdc9a13.zip |
...
Diffstat (limited to 'home-modules/lmu-hausschrift/default.nix')
-rw-r--r-- | home-modules/lmu-hausschrift/default.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/home-modules/lmu-hausschrift/default.nix b/home-modules/lmu-hausschrift/default.nix new file mode 100644 index 00000000..c3344947 --- /dev/null +++ b/home-modules/lmu-hausschrift/default.nix | |||
@@ -0,0 +1,49 @@ | |||
1 | { config, pkgs, lib, ... }: | ||
2 | |||
3 | with lib; | ||
4 | |||
5 | { | ||
6 | options = { | ||
7 | fonts.lmu-hausschrift.enable = mkEnableOption "LMU Hausschrift"; | ||
8 | }; | ||
9 | |||
10 | config = mkIf config.fonts.lmu-hausschrift.enable { | ||
11 | sops.secrets."lmu-hausschrift.tar.zstd" = { | ||
12 | format = "binary"; | ||
13 | sopsFile = ./lmu-hausschrift.tar.zstd; | ||
14 | }; | ||
15 | |||
16 | xdg.configFile = { | ||
17 | "fontconfig/conf.d/20-lmu-hausschrift.conf".text = '' | ||
18 | <?xml version='1.0'?> | ||
19 | |||
20 | <!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'> | ||
21 | <fontconfig> | ||
22 | <dir>${config.home.homeDirectory}/.local/share/lmu-hausschrift</dir> | ||
23 | </fontconfig> | ||
24 | ''; | ||
25 | }; | ||
26 | |||
27 | systemd.user.services.sops-nix = { | ||
28 | Service = { | ||
29 | ExecStartPost = pkgs.writeShellScript "unpack-lmu-hausschrift.sh" '' | ||
30 | set -xe | ||
31 | |||
32 | out=''${XDG_RUNTIME_DIR:-/tmp}/lmu-hausschrift | ||
33 | src="${config.sops.secrets."lmu-hausschrift.tar.zstd".path}" | ||
34 | src=''${src#"%r/"} | ||
35 | src=''${XDG_RUNTIME_DIR:-/tmp}/"''${src}" | ||
36 | |||
37 | umask 07077 | ||
38 | |||
39 | if [[ ! -d "''${out}" ]]; then | ||
40 | ${pkgs.coreutils}/bin/mkdir -p "''${out}" | ||
41 | ${pkgs.gnutar}/bin/tar -xaf "''${src}" -C "''${out}" | ||
42 | |||
43 | ${pkgs.coreutils}/bin/ln -sfT "''${out}" "${config.home.homeDirectory}/.local/share/lmu-hausschrift" | ||
44 | fi | ||
45 | ''; | ||
46 | }; | ||
47 | }; | ||
48 | }; | ||
49 | } | ||