Compare commits

...

3 Commits

Author SHA1 Message Date
3552314e69
Store git secrets using libsecret 2025-03-01 22:54:49 +01:00
adb963a48d
Added lock and unlock to justfile 2025-03-01 15:11:42 +01:00
7ab89cda7c
Wildcard encrypt files in secrets dir, util function to load
secrets, use apu-key in weather widget
2025-03-01 15:09:03 +01:00
5 changed files with 27 additions and 4 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,10 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ git-crypt ];
home.packages = with pkgs; [
git-crypt
libsecret
];
programs.git = {
enable = true;
@ -22,6 +25,7 @@
extraConfig = {
push.autoSetupRemote = true;
safe.directory = "/etc/nixos";
credential.helper = "${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret";
};
};
}

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));
}

View File

@ -22,3 +22,9 @@ update:
nix flake update
just switch
lock:
git-crypt lock
unlock:
git-crypt unlock ~/.config/git/crypt-key