summaryrefslogtreecommitdiff
path: root/home/baseline
diff options
context:
space:
mode:
Diffstat (limited to 'home/baseline')
-rw-r--r--home/baseline/default.nix63
-rw-r--r--home/baseline/git.nix13
-rw-r--r--home/baseline/graphics.nix52
-rw-r--r--home/baseline/nvim.nix26
-rw-r--r--home/baseline/zsh.nix14
-rw-r--r--home/baseline/zshrc.nix64
6 files changed, 232 insertions, 0 deletions
diff --git a/home/baseline/default.nix b/home/baseline/default.nix
new file mode 100644
index 0000000..a859fb7
--- /dev/null
+++ b/home/baseline/default.nix
@@ -0,0 +1,63 @@
+{ config, lib, pkgs, ... }:
+with lib; let
+ cfg = config.local.baseline;
+in
+{
+ imports = [
+ ./git.nix
+ ./graphics.nix
+ ./nvim.nix
+ ./zsh.nix
+ ];
+
+ options.local = {
+ hostname = mkOption {
+ type = types.str;
+ };
+
+ uid = mkOption {
+ type = types.int;
+ };
+
+ gecos = mkOption {
+ type = types.str;
+ };
+
+ email = mkOption {
+ type = types.str;
+ };
+ };
+
+ config = {
+ home = {
+ # This value determines the Home Manager release that your
+ # configuration is compatible with. This helps avoid breakage
+ # when a new Home Manager release introduces backwards
+ # incompatible changes.
+ #
+ # You can update Home Manager without changing this value. See
+ # the Home Manager release notes for a list of state version
+ # changes in each release.
+ stateVersion = "21.11";
+
+ homeDirectory = "/home/${config.home.username}";
+
+ packages = [
+ pkgs.file
+ pkgs.killall
+ pkgs.man-pages
+ pkgs.man-pages-posix
+ pkgs.tree
+ pkgs.unzip
+ pkgs.wget
+ pkgs.zip
+ ];
+
+ sessionVariables = {
+ LESSHISTFILE = "/dev/null";
+ };
+ };
+
+ xdg.enable = true;
+ };
+}
diff --git a/home/baseline/git.nix b/home/baseline/git.nix
new file mode 100644
index 0000000..faad082
--- /dev/null
+++ b/home/baseline/git.nix
@@ -0,0 +1,13 @@
+{ config, lib, ... }:
+with lib; let
+ cfg = config.local;
+in
+{
+ config = {
+ programs.git = {
+ enable = true;
+ userName = cfg.gecos;
+ userEmail = cfg.email;
+ };
+ };
+}
diff --git a/home/baseline/graphics.nix b/home/baseline/graphics.nix
new file mode 100644
index 0000000..072acb7
--- /dev/null
+++ b/home/baseline/graphics.nix
@@ -0,0 +1,52 @@
+{ config, lib, pkgs, ... }:
+with lib; {
+ config = {
+ fonts.fontconfig.enable = true;
+
+ gtk = {
+ enable = true;
+
+ gtk2.extraConfig = ''
+ gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
+ gtk-menu-images=1
+ gtk-button-images=1
+ '';
+
+ font = {
+ package = pkgs.noto-fonts;
+ name = "Noto Sans Regular";
+ #size = 14; <- caga layout de páginas
+ };
+
+ theme = {
+ package = pkgs.materia-theme;
+ name = "Materia-dark";
+ };
+ };
+
+ home = {
+ pointerCursor = {
+ name = "Adwaita";
+ package = pkgs.adwaita-icon-theme;
+
+ gtk.enable = true;
+ x11.enable = true;
+ };
+
+ sessionVariables = {
+ # Usar gtk en aplicaciones de jvm
+ _JAVA_OPTIONS = concatStringsSep " " [
+ "-Dawt.useSystemAAFontSettings=on"
+ "-Dswing.aatext=true"
+ "-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
+ "-Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
+ ];
+ };
+ };
+
+ qt = {
+ enable = true;
+ platformTheme.name = "gtk";
+ };
+ };
+}
diff --git a/home/baseline/nvim.nix b/home/baseline/nvim.nix
new file mode 100644
index 0000000..882788d
--- /dev/null
+++ b/home/baseline/nvim.nix
@@ -0,0 +1,26 @@
+{ config, lib, ... }:
+with lib; let
+ cfg = config.local.baseline;
+in
+{
+ config = {
+ home.sessionVariables.EDITOR = "nvim";
+
+ programs.neovim = {
+ enable = true;
+
+ viAlias = true;
+ vimAlias = true;
+ withRuby = false;
+ withPython3 = false;
+
+ extraConfig = ''
+ set number " Enable line numbering
+ set relativenumber " Enable relative line numbering
+ set tabstop=4 " Set tap stop to 4
+ set shiftwidth=4 " Set shift width to 4 (same as tabstop)
+ set viminfo= " No tracking
+ '';
+ };
+ };
+}
diff --git a/home/baseline/zsh.nix b/home/baseline/zsh.nix
new file mode 100644
index 0000000..8dd169c
--- /dev/null
+++ b/home/baseline/zsh.nix
@@ -0,0 +1,14 @@
+{ config, lib, pkgs, ... }:
+with lib; let
+ cfg = config.local.baseline;
+in
+{
+ config = {
+ programs.zsh = {
+ enable = true;
+ autosuggestion.enable = true;
+ syntaxHighlighting.enable = true;
+ initExtra = import ./zshrc.nix pkgs;
+ };
+ };
+}
diff --git a/home/baseline/zshrc.nix b/home/baseline/zshrc.nix
new file mode 100644
index 0000000..a82ab7a
--- /dev/null
+++ b/home/baseline/zshrc.nix
@@ -0,0 +1,64 @@
+{ grml-zsh-config, local, ... }: ''
+ source ${grml-zsh-config}/etc/zsh/zshrc
+
+ export PATH="$PATH:$HOME/.cargo/bin"
+
+ alias reset='tput reset'
+ alias reload='exec zsh'
+ alias this-date='date +%b%d | sed "s/^\w/\U&/g"'
+
+ function spawn() {
+ if [ ! -x "$(command -v $1)" ]; then
+ echo "spawn: no such command: $1" >&2
+ return 1
+ fi
+
+ $@ >/dev/null 0>&1 2>&1 &
+ disown
+ }
+
+ function xseli() {
+ T=$(mktemp)
+ $EDITOR -n $T
+ xsel -b <$T
+ rm $T
+ }
+
+ autoload -Uz up-line-or-beginning-search
+ zle -N up-line-or-beginning-search
+ autoload -Uz down-line-or-beginning-search
+ zle -N down-line-or-beginning-search
+ bindkey '\eOA' up-line-or-beginning-search
+ bindkey '\e[A' up-line-or-beginning-search
+ bindkey '\eOB' down-line-or-beginning-search
+ bindkey '\e[B' down-line-or-beginning-search
+
+ INSTALLABLES=()
+ while read -d: PATH_ITEM; do
+ if [[ "$PATH_ITEM" =~ "^(/nix/store/[a-z0-9]+-([a-zA-Z][a-zA-Z0-9_]*(-[a-zA-Z][a-zA-Z0-9_]*)*)(-[^/]+)?)/" ]]; then
+ INSTALLABLES+=("''${match[2]}")
+ fi
+ done <<<"$PATH"
+
+ if [ "''${#INSTALLABLES[@]}" -gt 0 ]; then
+ _GRML_NIX_SHELL="{''${INSTALLABLES[@]}} "
+ fi
+
+ unset INSTALLABLES PATH_ITEM
+
+ function grml_nix_shell() {
+ REPLY="$_GRML_NIX_SHELL"
+ }
+
+ grml_theme_add_token nix-shell -f grml_nix_shell '%F{red}' '%f'
+
+ zstyle ':prompt:grml:left:setup' items $([ ''${NO_USERATHOST:-0} -gt 0 ] || echo user at host) path nix-shell percent
+ zstyle ':prompt:grml:right:setup' items sad-smiley vcs $([ ''${NO_BATTERY:-0} -gt 0 ] || echo battery) time
+ zstyle ':prompt:grml:right:items:time' pre ' %F{yellow}'
+
+ unsetopt sharehistory
+ setopt appendhistory
+ setopt extendedhistory
+
+ source ${local.git-aliases}
+''