ark/users/nrd.nix

180 lines
4.0 KiB
Nix
Raw Normal View History

2019-12-16 07:22:09 +03:00
{ config, lib, pkgs, ... }:
2019-12-15 10:06:28 +03:00
let
2019-12-15 12:37:45 +03:00
inherit (builtins)
toFile
2019-12-16 07:22:09 +03:00
readFile
2019-12-15 12:37:45 +03:00
;
2019-12-15 10:06:28 +03:00
inherit (lib)
fileContents
2019-12-15 13:07:35 +03:00
mkForce
2019-12-15 10:06:28 +03:00
;
2019-12-15 11:59:33 +03:00
2019-12-15 12:37:45 +03:00
2019-12-15 11:59:33 +03:00
name = "Timothy DeHerrera";
2019-12-15 10:06:28 +03:00
in
{
imports = [
../profiles/develop
];
2019-12-16 11:53:23 +03:00
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
2019-12-16 07:22:09 +03:00
};
2019-12-16 11:53:23 +03:00
environment.systemPackages = with pkgs; [
pinentry_gnome
];
2019-12-15 11:59:33 +03:00
home-manager.users.nrd = {
2019-12-15 13:07:35 +03:00
home = {
packages = mkForce [];
file = {
".ec2-keys".source = ../secrets/ec2;
2019-12-15 13:10:13 +03:00
".cargo/credentials".source = ../secrets/cargo;
".zshrc".text = "#";
2019-12-15 13:07:35 +03:00
};
};
2019-12-15 11:59:33 +03:00
2019-12-18 02:26:01 +03:00
programs.alacritty = {
enable = true;
settings = {
env.TERM = "xterm-256color";
window.decorations = "full";
tabspaces = 2;
font.size = 9.0;
cursor.style = "Beam";
# snazzy theme
colors = {
# Default colors
primary = {
background = "0x282a36";
foreground = "0xeff0eb";
};
# Normal colors
normal = {
black = "0x282a36";
red = "0xff5c57";
green = "0x5af78e";
yellow = "0xf3f99d";
blue = "0x57c7ff";
magenta = "0xff6ac1";
cyan = "0x9aedfe";
white = "0xf1f1f0";
};
# Bright colors
bright = {
black = "0x686868";
red = "0xff5c57";
green = "0x5af78e";
yellow = "0xf3f99d";
blue = "0x57c7ff";
magenta = "0xff6ac1";
cyan = "0x9aedfe";
white = "0xf1f1f0";
};
};
};
};
2019-12-16 10:54:46 +03:00
programs.mpv = {
enable = true;
config = {
ytdl-format = "bestvideo[height<=?1080]+bestaudio/best";
};
};
2019-12-15 11:59:33 +03:00
programs.git = {
enable = true;
aliases = {
a = "add -p";
co = "checkout";
cob = "checkout -b";
f = "fetch -p";
c = "commit";
p = "push";
ba = "branch -a";
bd = "branch -d";
bD = "branch -D";
2019-12-15 13:07:35 +03:00
d = "diff";
2019-12-15 11:59:33 +03:00
dc = "diff --cached";
2019-12-15 12:46:08 +03:00
ds = "diff --staged";
2019-12-18 02:00:59 +03:00
r = "restore";
rs = "restore --staged";
2019-12-15 11:59:33 +03:00
st = "status -sb";
# logging
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'";
tlog = "log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative";
rank = "shortlog -sn --no-merges";
# delete merged branches
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
};
userName = name;
userEmail = "tim.deh@pm.me";
signing = {
key = "8985725DB5B0C122";
signByDefault = true;
};
};
2019-12-15 12:15:12 +03:00
2019-12-15 12:37:45 +03:00
programs.ssh = {
enable = true;
hashKnownHosts = true;
matchBlocks = let
githubKey = toFile "github"
2019-12-16 07:22:09 +03:00
(readFile ../secrets/github);
2019-12-15 12:37:45 +03:00
gitlabKey = toFile "gitlab"
2019-12-16 07:22:09 +03:00
(readFile ../secrets/gitlab);
2019-12-15 12:37:45 +03:00
in
{
github = {
host = "github.com";
identityFile = githubKey;
extraOptions = {
AddKeysToAgent = "yes";
};
};
gitlab = {
host = "gitlab.com";
identityFile = gitlabKey;
extraOptions = {
AddKeysToAgent = "yes";
};
};
"gitlab.company" = {
host = "gitlab.company.com";
identityFile = gitlabKey;
extraOptions = {
AddKeysToAgent = "yes";
};
};
};
};
2019-12-15 11:59:33 +03:00
};
2019-12-15 10:06:28 +03:00
users.users.nrd = {
uid = 1000;
2019-12-15 11:59:33 +03:00
description = name;
2019-12-15 10:06:28 +03:00
isNormalUser = true;
hashedPassword = fileContents ../secrets/nrd;
extraGroups = [
"wheel"
"input"
"networkmanager"
"adbusers"
];
};
}