chore: remove fonts from sops-nix

Ok, hear me out: managing fonts with sops is a huge pain in the butt.
Especially when you need to have your YubiKey plugged in, to have your
terminal render.
This commit is contained in:
winston 2023-03-16 14:10:49 +01:00
parent 3d6160f69f
commit 1a6686ead9
Signed by: winston
GPG key ID: 3786770EDBC2B481
14 changed files with 17 additions and 237 deletions

1
.gitignore vendored
View file

@ -2,6 +2,7 @@
.gitsecret/keys/random_seed .gitsecret/keys/random_seed
!*.secret !*.secret
home/secrets/default.nix home/secrets/default.nix
home/secrets/fonts.tgz
# Generated by nix-pre-commit-hooks # Generated by nix-pre-commit-hooks
/.pre-commit-config.yaml /.pre-commit-config.yaml

BIN
home/secrets/fonts.tgz.gpg Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,36 +2,12 @@
config, config,
pkgs, pkgs,
... ...
}: let }: {
inherit (pkgs.stdenv.hostPlatform) isLinux isDarwin;
# TODO: make this accept more than just otf
fontMapping = fontname: {
path =
if isLinux
then "${config.xdg.dataHome}/fonts/${fontname}.otf"
else if isDarwin
then "${config.home.homeDirectory}/Library/Fonts/${fontname}.otf"
else throw "Unsupported platform";
format = "binary";
sopsFile = ./fonts/${fontname}.json;
};
in {
sops = { sops = {
gnupg.home = "${config.xdg.configHome}/gnupg"; gnupg.home = config.programs.gpg.homedir;
defaultSopsFile = ./main.yaml; defaultSopsFile = ./main.yaml;
secrets = { secrets = {
"kubeconfig".path = "${config.xdg.configHome}/kube/kubeconfig"; "kubeconfig".path = "${config.xdg.configHome}/kube/kubeconfig";
"berkeley_regular" = fontMapping "berkeley_regular";
"berkeley_italic" = fontMapping "berkeley_italic";
"berkeley_bold" = fontMapping "berkeley_bold";
"berkeley_bold_italic" = fontMapping "berkeley_bold_italic";
"comic_code_regular" = fontMapping "comic_code_regular";
"comic_code_italic" = fontMapping "comic_code_italic";
"comic_code_medium" = fontMapping "comic_code_medium";
"comic_code_medium_italic" = fontMapping "comic_code_medium_italic";
"comic_code_bold" = fontMapping "comic_code_bold";
"comic_code_bold_italic" = fontMapping "comic_code_bold_italic";
}; };
}; };
} }

View file

@ -4,7 +4,6 @@ secret-stage:
secret-unstage: secret-unstage:
git restore --staged home/secrets/default.nix git restore --staged home/secrets/default.nix
[linux] [linux]
boot: secret-stage && secret-unstage boot: secret-stage && secret-unstage
sudo nixos-rebuild boot --flake . sudo nixos-rebuild boot --flake .
@ -24,3 +23,17 @@ switch: secret-stage && secret-unstage
[linux] [linux]
switch: secret-stage && secret-unstage switch: secret-stage && secret-unstage
sudo nixos-rebuild switch --flake . sudo nixos-rebuild switch --flake .
[linux]
install-fonts:
#!/usr/bin/env bash
set -euo pipefail
mkdir -p $XDG_DATA_HOME/fonts
gpg --decrypt home/secrets/fonts.tgz.gpg | tar -xz -C $XDG_DATA_HOME/fonts --strip-components=1
[macos]
install-fonts:
#!/usr/bin/env bash
set -euo pipefail
mkdir -p ~/Library/Fonts
gpg --decrypt home/secrets/fonts.tgz.gpg | tar -xz -C ~/Library/Fonts --strip-components=1