Wildcard encrypt files in secrets dir, util function to load

secrets, use apu-key in weather widget
This commit is contained in:
Martin Berg Alstad 2025-03-01 15:04:56 +01:00
parent fd03c87c18
commit 7ab89cda7c
Signed by: martials
GPG Key ID: 706F53DD087A91DE
3 changed files with 16 additions and 3 deletions

2
.gitattributes vendored
View File

@ -1 +1 @@
home-manager/secrets/weather-api-key filter=git-crypt diff=git-crypt
home-manager/secrets/* filter=git-crypt diff=git-crypt

View File

@ -1,7 +1,13 @@
{ pkgs, inputs, ... }:
{
pkgs,
inputs,
lib,
...
}:
let
common = import ../../../common.nix;
theme = import ../../../theme.nix;
loader = import ../../secretsLoader.nix lib;
in
{
imports = [ inputs.hyprpanel.homeManagerModules.hyprpanel ];
@ -74,7 +80,8 @@ in
};
weather = {
unit = "metric";
location = "Bergen, Norway"; # TODO not working
location = "Bergen, Norway";
key = loader.loadSecret ../../secrets/weather-api-key;
};
};

View File

@ -0,0 +1,6 @@
lib:
{
loadSecret =
filePath: lib.strings.trim (lib.strings.removeSuffix "\n" (builtins.readFile filePath));
}