feat: add secure github access token

This commit is contained in:
EinEtwas 2024-10-21 22:02:49 +02:00
parent 06d69dfa10
commit bc4b411db8
5 changed files with 27 additions and 3 deletions

View file

@ -31,6 +31,7 @@
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
inherit spicetify-nix; inherit spicetify-nix;
inherit agenix;
}; };
system = "x86_64-linux"; system = "x86_64-linux";

View file

@ -1,4 +1,4 @@
{ config, pkgs, inputs, spicetify-nix, ... }: { config, pkgs, inputs, spicetify-nix, agenix, ... }:
{ {
imports = [ imports = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
@ -12,6 +12,7 @@
extraSpecialArgs = { extraSpecialArgs = {
inherit spicetify-nix; inherit spicetify-nix;
inherit agenix;
}; };
users.rhea = { users.rhea = {
@ -63,5 +64,14 @@
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
# TODO: Get a token2 and set up https://github.com/oddlama/agenix-rekey
age.identityPaths = [ "/var/lib/persistent/host_id_ed25519" ];
age.secrets.access-tokens-github.file = ../secrets/gh.age;
nix.extraOptions = ''
!include ${config.age.secrets.access-tokens-github.path}
'';
nix.settings.allowed-users = [ "rhea" ]; nix.settings.allowed-users = [ "rhea" ];
} }

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, agenix, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
# Desktop Applications # Desktop Applications
@ -26,6 +26,7 @@
nix-output-monitor nix-output-monitor
nil nil
nh nh
agenix.packages.${system}.default
# Dev Things # Dev Things
vscode vscode

5
secrets/gh.age Normal file
View file

@ -0,0 +1,5 @@
age-encryption.org/v1
-> ssh-ed25519 7JS6dg I9bdNrtj0UzjlrVWOjgVomgWprX+KAaL4uITS9j163I
8vEaIAqFwmUKXbBskafWr15tqYIfmWjKn9g61F4y6F8
--- ToUNScc7K59kI8y+SR5e3RxTu16uGSsvd65tqomiOVc
VoÓX˜¬ZÖζ»·<C2BB>ÁííÍG}úZüm…ˆ°Ó ®,ºåï*«àÛ³¬}ušþå8… \^I /¢T"u s\¨¡CGÄ §¿“h˜¥m>æÍÆ$†]òÍÄ$H"<¼.tbÐOËÝü¿†žÖ± !j¹Ñƒ"°Ÿ³„@á­Õo=騫Ç_ÌoÜÌô]ð÷zÍ9Ä~qO

7
secrets/secrets.nix Normal file
View file

@ -0,0 +1,7 @@
let
rhea-laptop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJynM8SLRXRrfGRJd43T4wabsOHFcWeeuTym9h7vl7Io";
systems = [ rhea-laptop ];
in
{
"gh.age".publicKeys = [ rhea-laptop ];
}