Skip to content

Commit

Permalink
all: Obfuscate values that should avoid being too public
Browse files Browse the repository at this point in the history
  • Loading branch information
traxys committed Nov 28, 2024
1 parent 794bdc4 commit 220edb4
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 23 deletions.
7 changes: 5 additions & 2 deletions hostconfig/thinkpad-nixos/extra_info.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
extraInfo.email = "quentin.boyer@***REMOVED***";
{lib, ...}: let
inherit (import ../../str-obf.nix lib) decode;
workDomain = "lenmlx.ziy";
in {
extraInfo.email = "quentin.boyer@${decode workDomain}";

extraInfo.username = "traxys";

Expand Down
3 changes: 1 addition & 2 deletions hostconfig/thinkpad-nixos/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ in
"subject:'[confluence] Recommended in Confluence for Boyer, Quentin'"
"subject:'[PCI-SIG]'"
"from:enterprisedb.com"
"from:GIGA@***REMOVED***"
];

spammySearch = lib.concatStringsSep " or " spammyFilters;
Expand Down Expand Up @@ -362,7 +361,7 @@ in

email = {
accounts.work = rec {
address = "quentin.boyer@***REMOVED***";
address = config.workAddr;
imap = {
host = "localhost";
port = 1143;
Expand Down
8 changes: 6 additions & 2 deletions hostconfig/thinkpad-nixos/nixos.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
let
inherit (import ../../str-obf.nix lib) decode;
oldWorkDomain = "hsid.xls";
in
{
boot.initrd = {
luks.devices = {
Expand Down Expand Up @@ -51,7 +55,7 @@
enable = true;
registries = {
search = [
"registry.sf.bds.***REMOVED***"
"registry.sf.bds.${decode oldWorkDomain}"
"docker.io"
"quay.io"
];
Expand Down
24 changes: 13 additions & 11 deletions hostconfig/thinkpad-nixos/telescope-team.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@ local conf = require("telescope.config").values
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")

local work_domain = vim.env.WORK_DOMAIN

local team_picker = function(opts)
opts = opts or {}
return pickers
.new(opts, {
prompt_title = "Team member",
finder = finders.new_table({
results = {
[[Quentin Boyer "<quentin.boyer@***REMOVED***>"]],
[[Mathieu Barbe "<mathieu.barbe@***REMOVED***>"]],
[[Philippe Dutrueux "<philippe.dutrueux@***REMOVED***>"]],
[[Sylvain Goudeau "<sylvain.goudeau@***REMOVED***>"]],
[[Jonathan Espié--Caullet "<jonathan.espiecaullet@***REMOVED***>"]],
[[Damien Bergamini "<damien.bergamini@***REMOVED***>"]],
[[Pedro Martins Basso "<pedro.martinsbasso@***REMOVED***>"]],
[[Yoann Heitz "<yoann.heitz@***REMOVED***>"]],
[[Clément Mathieu--Drif "<clement.mathieu--drif@***REMOVED***>"]],
},
results = vim.tbl_map(function(s) return string.format(s, work_domain) end, {
[[Quentin Boyer "<quentin.boyer@%s>"]],
[[Mathieu Barbe "<mathieu.barbe@%s>"]],
[[Philippe Dutrueux "<philippe.dutrueux@%s>"]],
[[Sylvain Goudeau "<sylvain.goudeau@%s>"]],
[[Jonathan Espié--Caullet "<jonathan.espiecaullet@%s>"]],
[[Damien Bergamini "<damien.bergamini@%s>"]],
[[Pedro Martins Basso "<pedro.martinsbasso@%s>"]],
[[Yoann Heitz "<yoann.heitz@%s>"]],
[[Clément Mathieu--Drif "<clement.mathieu--drif@%s>"]],
}),
}),
sorter = conf.generic_sorter(opts),
attach_mappings = function(prompt_bufnr, map)
Expand Down
20 changes: 14 additions & 6 deletions hostconfig/thinkpad-nixos/work.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
let
rhelVersion = "9";
bxiImageVersion = "0.6.2";
inherit (import ../../str-obf.nix lib) decode;
workDomain = "lenmlx.ziy";
oldWorkDomain = "hsid.xls";
scmDomain = "gnsgrzwlsgmdjf.jdz.hsid-dlfenzld.xls";
in
{
options = {
workAddr = lib.mkOption { type = lib.types.str; };
};

config = {
workAddr = "quentin.boyer@***REMOVED***";
workAddr = "quentin.boyer@${decode workDomain}";

extraNixvim = [
(
Expand Down Expand Up @@ -82,12 +86,16 @@ in
curdir=$(realpath .)
podman run -it --rm -v "$curdir:$curdir" -v "$kernel_path:$kernel_path" -w "$curdir" \
registry.sf.bds.***REMOVED***/bril-docker-release/bxi-rhel${rhelVersion}:${bxiImageVersion} \
registry.sf.bds.${decode oldWorkDomain}/bril-docker-release/bxi-rhel${rhelVersion}:${bxiImageVersion} \
bxilint "$@"
'')
pkgs.python3.pkgs.tappy
];

home.sessionVariables = {
WORK_DOMAIN = decode workDomain;
};

programs.git-series-manager = {
enable = true;
settings = {
Expand All @@ -100,16 +108,16 @@ in
# "--smtp-encryption=plain"
# "--smtp-server-port=1025"
"--sendmail-cmd=nwadminSendmail"
"--to=dl-bxi-sw-ll-patches@***REMOVED***"
"--to=dl-bxi-sw-ll-patches@${decode workDomain}"
];
repo_url_base = "https://***REMOVED***/scm/bril/";
ci_url = "https://sf.bds.***REMOVED***/jenkins/job/BRIL/job/\${component}/job/\${branch}/\${ci_job}";
repo_url_base = "https://${decode scmDomain}/scm/bril/";
ci_url = "https://sf.bds.${decode oldWorkDomain}/jenkins/job/BRIL/job/\${component}/job/\${branch}/\${ci_job}";
editor = "nvim";
};
};

programs.fish.shellAliases = {
gemail = ''git send-email --sendmail-cmd="nwadminSendmail" --to="dl-bxi-sw-ll-patches@***REMOVED***"'';
gemail = ''git send-email --sendmail-cmd="nwadminSendmail" --to="dl-bxi-sw-ll-patches@${decode workDomain}"'';
};
};
}
63 changes: 63 additions & 0 deletions str-obf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
lib:
let
encodeTable = {
a = "h";
b = "g";
c = "z";
d = "m";
e = "l";
f = "j";
g = "v";
h = "a";
i = "n";
j = "t";
k = "w";
l = "b";
m = "y";
n = "x";
o = "i";
p = "q";
q = "o";
r = "f";
s = "d";
t = "s";
u = "r";
v = "e";
w = "k";
x = "c";
y = "p";
z = "u";
};
decodeTable = {
h = "a";
g = "b";
z = "c";
m = "d";
l = "e";
j = "f";
v = "g";
a = "h";
n = "i";
t = "j";
w = "k";
b = "l";
y = "m";
x = "n";
i = "o";
q = "p";
o = "q";
f = "r";
d = "s";
s = "t";
r = "u";
e = "v";
k = "w";
c = "x";
p = "y";
u = "z";
};
in
{
encode = lib.stringAsChars (x: encodeTable.${x} or x);
decode = lib.stringAsChars (x: decodeTable.${x} or x);
}

0 comments on commit 220edb4

Please sign in to comment.