Add sops-nix templates
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,8 +1,14 @@
|
|||||||
{ config, inputs, ... }:
|
{ config, inputs, ... }:
|
||||||
{
|
{
|
||||||
sops.secrets."nix/accessTokens/github" = {
|
sops = {
|
||||||
sopsFile = ../../../../../secrets/personal/secrets.yaml;
|
secrets."nix/accessTokens/github.com".sopsFile = ../../../../../secrets/personal/secrets.yaml;
|
||||||
group = "users";
|
|
||||||
|
templates."nix-access-tokens" = {
|
||||||
|
content = ''
|
||||||
|
access-tokens = github.com=${config.sops.placeholder."nix/accessTokens/github.com"}
|
||||||
|
'';
|
||||||
|
group = "users";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
@@ -22,7 +28,7 @@
|
|||||||
registry.self.flake = inputs.self;
|
registry.self.flake = inputs.self;
|
||||||
|
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
!include ${config.sops.secrets."nix/accessTokens/github".path}
|
!include ${config.sops.templates."nix-access-tokens".path}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -3,25 +3,33 @@
|
|||||||
home ? throw "home argument is required",
|
home ? throw "home argument is required",
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
system,
|
system,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
hmConfig = config.home-manager.users.${user};
|
||||||
selfPkgs = inputs.self.packages.${system};
|
selfPkgs = inputs.self.packages.${system};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home-manager.users.${user} = {
|
home-manager.users.${user} = {
|
||||||
sops.secrets = {
|
sops = {
|
||||||
"git/credentials" = {
|
secrets = {
|
||||||
sopsFile = ../../../../../../../secrets/personal/secrets.yaml;
|
"git/credentials/git.karaolidis.com/username".sopsFile =
|
||||||
path = "${home}/.config/git/credentials";
|
../../../../../../../secrets/personal/secrets.yaml;
|
||||||
|
"git/credentials/git.karaolidis.com/password".sopsFile =
|
||||||
|
../../../../../../../secrets/personal/secrets.yaml;
|
||||||
};
|
};
|
||||||
|
|
||||||
"git/cookies" = {
|
templates."git/credentials" = {
|
||||||
sopsFile = ../../../../../../../secrets/personal/secrets.yaml;
|
content = ''
|
||||||
path = "${home}/.config/git/cookies";
|
https://${hmConfig.sops.placeholder."git/credentials/git.karaolidis.com/username"}:${
|
||||||
|
hmConfig.sops.placeholder."git/credentials/git.karaolidis.com/password"
|
||||||
|
}@git.karaolidis.com
|
||||||
|
'';
|
||||||
|
path = "${home}/.config/git/credentials";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
home ? throw "home argument is required",
|
home ? throw "home argument is required",
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
system,
|
system,
|
||||||
@@ -10,19 +11,26 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
hmConfig = config.home-manager.users.${user};
|
||||||
selfPkgs = inputs.self.packages.${system};
|
selfPkgs = inputs.self.packages.${system};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home-manager.users.${user} = {
|
home-manager.users.${user} = {
|
||||||
sops.secrets = {
|
sops = {
|
||||||
"git/credentials" = {
|
secrets = {
|
||||||
sopsFile = ../../../../../../../secrets/personal/secrets.yaml;
|
"git/credentials/git.karaolidis.com/username".sopsFile =
|
||||||
path = "${home}/.config/git/credentials";
|
../../../../../../../secrets/personal/secrets.yaml;
|
||||||
|
"git/credentials/git.karaolidis.com/password".sopsFile =
|
||||||
|
../../../../../../../secrets/personal/secrets.yaml;
|
||||||
};
|
};
|
||||||
|
|
||||||
"git/cookies" = {
|
templates."git/credentials" = {
|
||||||
sopsFile = ../../../../../../../secrets/personal/secrets.yaml;
|
content = ''
|
||||||
path = "${home}/.config/git/cookies";
|
https://${hmConfig.sops.placeholder."git/credentials/git.karaolidis.com/username"}:${
|
||||||
|
hmConfig.sops.placeholder."git/credentials/git.karaolidis.com/password"
|
||||||
|
}@git.karaolidis.com
|
||||||
|
'';
|
||||||
|
path = "${home}/.config/git/credentials";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -2,7 +2,10 @@
|
|||||||
user ? throw "user argument is required",
|
user ? throw "user argument is required",
|
||||||
home ? throw "home argument is required",
|
home ? throw "home argument is required",
|
||||||
}:
|
}:
|
||||||
{ pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
hmConfig = config.home-manager.users.${user};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
environment.persistence."/cache"."${home}/.local/share/gradle" = { };
|
environment.persistence."/cache"."${home}/.local/share/gradle" = { };
|
||||||
|
|
||||||
@@ -12,8 +15,11 @@
|
|||||||
home = ".local/share/gradle";
|
home = ".local/share/gradle";
|
||||||
};
|
};
|
||||||
|
|
||||||
sops.secrets."artifactory" = {
|
sops.templates."gradle.properties" = {
|
||||||
sopsFile = ../../../../../../../secrets/sas/secrets.yaml;
|
content = ''
|
||||||
|
cdpUser=${hmConfig.sops.placeholder."artifactory/cdp/user"}
|
||||||
|
cdpPassword=${hmConfig.sops.placeholder."artifactory/cdp/password"}
|
||||||
|
'';
|
||||||
path = "${home}/.local/share/gradle/gradle.properties";
|
path = "${home}/.local/share/gradle/gradle.properties";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -2,11 +2,29 @@
|
|||||||
user ? throw "user argument is required",
|
user ? throw "user argument is required",
|
||||||
home ? throw "home argument is required",
|
home ? throw "home argument is required",
|
||||||
}:
|
}:
|
||||||
{ lib, ... }:
|
|
||||||
{
|
{
|
||||||
home-manager.users.${user}.sops.secrets = {
|
config,
|
||||||
"registry" = {
|
lib,
|
||||||
sopsFile = ../../../../../../../secrets/sas/secrets.yaml;
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
hmConfig = config.home-manager.users.${user};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home-manager.users.${user}.sops = {
|
||||||
|
secrets."registry/cr.sas.com".sopsFile = ../../../../../../../secrets/sas/secrets.yaml;
|
||||||
|
|
||||||
|
templates."containers-auth.json" = {
|
||||||
|
content = builtins.readFile (
|
||||||
|
(pkgs.formats.json { }).generate "auth.json" {
|
||||||
|
auths = {
|
||||||
|
"cr.sas.com" = {
|
||||||
|
auth = hmConfig.sops.placeholder."registry/cr.sas.com";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
path = "${home}/.config/containers/auth.json";
|
path = "${home}/.config/containers/auth.json";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -163,6 +163,9 @@ in
|
|||||||
sopsFile = ../../../../secrets/sas/secrets.yaml;
|
sopsFile = ../../../../secrets/sas/secrets.yaml;
|
||||||
key = "gpg/pass";
|
key = "gpg/pass";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"artifactory/cdp/user".sopsFile = ../../../../secrets/sas/secrets.yaml;
|
||||||
|
"artifactory/cdp/password".sopsFile = ../../../../secrets/sas/secrets.yaml;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.clipbook.bookmarks = {
|
programs.clipbook.bookmarks = {
|
||||||
|
@@ -3,25 +3,33 @@
|
|||||||
home ? throw "home argument is required",
|
home ? throw "home argument is required",
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
system,
|
system,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
hmConfig = config.home-manager.users.${user};
|
||||||
selfPkgs = inputs.self.packages.${system};
|
selfPkgs = inputs.self.packages.${system};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home-manager.users.${user} = {
|
home-manager.users.${user} = {
|
||||||
sops.secrets = {
|
sops = {
|
||||||
"git/credentials" = {
|
secrets = {
|
||||||
sopsFile = ../../../../../../../secrets/personal/secrets.yaml;
|
"git/credentials/git.karaolidis.com/username".sopsFile =
|
||||||
path = "${home}/.config/git/credentials";
|
../../../../../../../secrets/personal/secrets.yaml;
|
||||||
|
"git/credentials/git.karaolidis.com/password".sopsFile =
|
||||||
|
../../../../../../../secrets/personal/secrets.yaml;
|
||||||
};
|
};
|
||||||
|
|
||||||
"git/cookies" = {
|
templates."git/credentials" = {
|
||||||
sopsFile = ../../../../../../../secrets/personal/secrets.yaml;
|
content = ''
|
||||||
path = "${home}/.config/git/cookies";
|
https://${hmConfig.sops.placeholder."git/credentials/git.karaolidis.com/username"}:${
|
||||||
|
hmConfig.sops.placeholder."git/credentials/git.karaolidis.com/password"
|
||||||
|
}@git.karaolidis.com
|
||||||
|
'';
|
||||||
|
path = "${home}/.config/git/credentials";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user