Files
nixos-config/configs/user.nix
Alexander Szczepanski 38d6a8f27f some changes
2021-08-03 00:56:59 +02:00

116 lines
2.8 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, lib, ... }:
{
imports = [ <home-manager/nixos> ];
# Define a user account. Don't forget to set a password with passwd.
users = {
defaultUserShell = pkgs.zsh;
users.alex = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" "networkmanager" "libvirtd" "lp" "scanner" ];
};
};
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
home-manager.users.alex = { pkgs, ... }: {
home.enableNixpkgsReleaseCheck = false;
home.packages = [
pkgs.cryfs
];
programs = {
ssh = {
enable = true;
compression = true;
serverAliveInterval = 60;
forwardAgent = true;
matchBlocks."szczepan.ski" = {
hostname = "szczepan.ski";
};
matchBlocks."nixos-vm" = {
hostname = "192.168.122.33";
};
matchBlocks."mini" = {
hostname = "192.168.0.87";
};
matchBlocks."router" = {
hostname = "192.168.1.1";
user = "root";
localForwards = [ {
bind.address = "127.0.0.1";
bind.port = 1337;
host.address = "127.0.0.1";
host.port = 80;
} ];
};
matchBlocks."homeserver" = {
hostname = "192.168.1.100";
};
};
git = {
enable = true;
userName = "Alexander Szczepanski";
userEmail = "alexander@szczepan.ski";
extraConfig = {
push = { default = "current"; };
pull = { rebase = true; };
};
};
zsh = {
enable = true;
enableAutosuggestions = true;
oh-my-zsh = {
enable = true;
plugins = [
"cp"
"common-aliases"
"docker"
"systemd"
"wd"
"kubectl"
"git"
];
};
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./p10k-config;
file = "p10k.zsh";
}
];
localVariables = {
SSH_AUTH_SOCK = "/run/user/1000/keyring/ssh";
};
shellAliases = {
active-services = "systemctl --no-page --no-legend --plain -t service --state=running";
autofanspeed = "echo level auto | sudo tee /proc/acpi/ibm/fan";
maxfanspeed = "echo level full-speed | sudo tee /proc/acpi/ibm/fan";
};
initExtra = ''
eval $(/run/wrappers/bin/gnome-keyring-daemon --start --components=ssh)
'';
};
};
# manuals not needed
manual.html.enable = false;
manual.json.enable = false;
manual.manpages.enable = false;
};
}