diff --git a/config.nix b/config.nix deleted file mode 100644 index af40ac2..0000000 --- a/config.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - allowUnfree = true; - allowBroken = false; -} diff --git a/modules/colors.nix b/lib/colors.nix similarity index 100% rename from modules/colors.nix rename to lib/colors.nix diff --git a/modules/common.nix b/modules/common.nix deleted file mode 100644 index 13e66db..0000000 --- a/modules/common.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, pkgs, ... }: -let - colors = import ./colors.nix; -in { - imports = [ - ./vim - ./tmux.nix - ./zsh.nix - (import ./termite.nix { - config = config; - pkgs = pkgs; - colors = colors; - }) - ./gpg.nix - ./ssh.nix - ./git.nix - ./gtk.nix - ./xdg.nix - (import ./mako.nix { - config = config; - pkgs = pkgs; - colors = colors; - }) - ./keyring.nix - ./sway - ]; -} diff --git a/modules/dadada/direnv.nix b/modules/dadada/direnv.nix new file mode 100644 index 0000000..e111d29 --- /dev/null +++ b/modules/dadada/direnv.nix @@ -0,0 +1,17 @@ +{ config, pkgs, lib, ... }: +with lib; +let + cfg = config.dadada.direnv; +in +{ + options.dadada.direnv = { + enable = mkEnableOption "Enable direnv config"; + }; + config = mkIf cfg.enable { + programs.direnv = { + enable = true; + enableZshIntegration = true; + enableNixDirenvIntegration = true; + }; + }; +} diff --git a/modules/dadada/fish.nix b/modules/dadada/fish.nix new file mode 100644 index 0000000..22d608b --- /dev/null +++ b/modules/dadada/fish.nix @@ -0,0 +1,79 @@ +{ config, pkgs, lib, ... }: +with lib; +let + cfg = config.dadada.fish; +in { + options.dadada.fish = { + enable = mkEnableOption "Enable fish config"; + }; + + config = mkIf cfg.enable { + programs.fish = { + enable = true; + plugins = with pkgs; [{ + name = "fzf"; + src = pkgs.fetchFromGitHub { + owner = "jethrokuan"; + repo = "fzf"; + rev = "c3defd4a922e97120503b45e26efa775bc672b50"; + sha256 = "1k5b0nva0mbqc9830qhbcwxsi8d9b2p4ws1fq0bw9nkf2ripyp4p"; + }; + }]; + interactiveShellInit = '' + # fish git prompt + set __fish_git_prompt_show_informative_status 'yes' + set __fish_git_prompt_showdirtystate 'yes' + set __fish_git_prompt_showstashstate 'yes' + set __fish_git_prompt_showuntrackedfiles 'yes' + set __fish_git_prompt_showupstream 'yes' + set __fish_git_prompt_showcolorhints 'yes' + + set fish_greeting + + # disable path shortening + set fish_prompt_pwd_dir_length 0 + + set -U FZF_LEGACY_KEYBINDINGS 0 + set -x TERM xterm-256color + set -U fish_user_paths ~/bin $fish_user_paths + + #if status is-interactive + #and not status is-login + #and not set -q TMUX + #and string match -qr "^xterm-.*" "$TERM" + # exec tmux + #end + ''; + promptInit = '' + function fish_prompt + set last_status $status + printf '%s %s:%s ' \ + (set_color red + echo $last_status) \ + (set_color green + hostname) \ + (set_color blue + prompt_pwd) + set_color normal + end + + function fish_right_prompt + printf '%s' (__fish_git_prompt) + end + ''; + shellAliases = { + gst = "git status"; + gco = "git commit"; + glo = "git log"; + gad = "git add"; + ls = "exa"; + ll = "exa -l"; + la = "exa -la"; + mv = "mv -i"; + cp = "cp -i"; + }; + }; + + home.packages = [ pkgs.exa ]; + }; +} diff --git a/modules/dadada/git.nix b/modules/dadada/git.nix new file mode 100644 index 0000000..9c141ac --- /dev/null +++ b/modules/dadada/git.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: +with lib; +let + cfg = config.dadada.git; +in +{ + options.dadada.git = { + enable = mkEnableOption "Enable git config"; + }; + config = mkIf cfg.enable { + programs.git.enable = true; + }; +} diff --git a/modules/dadada/gpg.nix b/modules/dadada/gpg.nix new file mode 100644 index 0000000..4e526be --- /dev/null +++ b/modules/dadada/gpg.nix @@ -0,0 +1,34 @@ +{ config, lib, ... }: +with lib; +let + cfg = config.dadada.gpg; +in { + options.dadada.gpg = { + enable = mkEnableOption "Enable GnuPG config"; + }; + config = mkIf cfg.enable { + programs.gpg = { + enable = true; + settings = { + fixed-list-mode = true; + keyid-format = "0xlong"; + verify-options = "show-uid-validity"; + list-options = "show-uid-validity"; + cert-digest-algo = "SHA256"; + use-agent = true; + keyserver = "hkps://keys.openpgp.org"; + }; + }; + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = false; + pinentryFlavor = "gnome3"; + }; + + programs.git.extraConfig = { + commit = { gpgSign = true; }; + }; + }; +} diff --git a/modules/dadada/gtk.nix b/modules/dadada/gtk.nix new file mode 100644 index 0000000..4ab58f4 --- /dev/null +++ b/modules/dadada/gtk.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: +with lib; +let + cfg = config.dadada.gtk; +in +{ + options.dadada.gtk = { + enable = mkEnableOption "Enable GTK config"; + }; + config = mkIf cfg.enable { + gtk = { + enable = true; + theme.package = pkgs.gnome3.gnome-themes-extra; + theme.name = "Adwaita-dark"; + iconTheme.package = pkgs.gnome3.adwaita-icon-theme; + iconTheme.name = "Adwaita"; + font.package = pkgs.cantarell-fonts; + font.name = "Cantarell"; + }; + qt = { + enable = true; + platformTheme = "gtk"; + }; + }; +} diff --git a/modules/dadada/keyring.nix b/modules/dadada/keyring.nix new file mode 100644 index 0000000..1793b9d --- /dev/null +++ b/modules/dadada/keyring.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: +with lib; +let + cfg = config.dadada.keyring; +in { + options.dadada.keyring = { + enable = mkEnableOption "Enable keyring config"; + }; + config = mkIf cfg.enable { + services.gnome-keyring = { + enable = false; + components = [ "pkcs11" "secrets" ]; + }; + }; +} diff --git a/modules/dadada/kitty/config b/modules/dadada/kitty/config new file mode 100644 index 0000000..54f0cfc --- /dev/null +++ b/modules/dadada/kitty/config @@ -0,0 +1,42 @@ +enable_audio_bell = false; +background #1f2022 +foreground #a3a3a3 +selection_background #a3a3a3 +selection_foreground #1f2022 +url_color #b8b8b8 +cursor #a3a3a3 +active_border_color #585858 +inactive_border_color #282828 +active_tab_background #1f2022 +active_tab_foreground #a3a3a3 +inactive_tab_background #282828 +inactive_tab_foreground #b8b8b8 +tab_bar_background #282828 + +# normal +color0 #1f2022 +color1 #f2241f +color2 #67b11d +color3 #b1951d +color4 #4f97d7 +color5 #a31db1 +color6 #2d9574 +color7 #a3a3a3 + +# bright +color8 #585858 +color9 #f2241f +color10 #67b11d +color11 #b1951d +color12 #4f97d7 +color13 #a31db1 +color14 #2d9574 +color15 #f8f8f8 + +# extended base16 colors +color16 #ffa500 +color17 #b03060 +color18 #282828 +color19 #444155 +color20 #b8b8b8 +color21 #e8e8e8 diff --git a/modules/dadada/kitty/default.nix b/modules/dadada/kitty/default.nix new file mode 100644 index 0000000..55dc653 --- /dev/null +++ b/modules/dadada/kitty/default.nix @@ -0,0 +1,19 @@ +{ pkgs, lib, config, ... }: +with lib; +let + cfg = config.dadada.kitty; +in { + options.dadada.kitty = { + enable = mkEnableOption "Enable kitty config"; + }; + config = mkIf cfg.enable { + programs.kitty = { + enable = true; + font = { + package = pkgs.source-code-pro; + name = "Source Code Pro 8"; + }; + extraConfig = builtins.readFile ./config; + }; + }; +} diff --git a/modules/dadada/mako.nix b/modules/dadada/mako.nix new file mode 100644 index 0000000..88acc2f --- /dev/null +++ b/modules/dadada/mako.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, colors, ...}: +with lib; +let + cfg = config.dadada.mako; +in { + options.dadada.mako = { + enable = mkEnableOption "Enable mako config"; + }; + config = mkIf cfg.enable { + programs.mako = { + enable = true; + anchor = "bottom-right"; + backgroundColor = colors.color8; + borderColor = colors.color0; + #defaultTimeout = -1; + font = "Source Code Pro 10"; + format = ''%a %s\n%b''; + height = 100; + #groupBy = "app-name"; + icons = false; + ignoreTimeout = false; + layer = "overlay"; + margin = "0,0,0"; + maxVisible = 200; + padding = "0"; + progressColor = colors.color4; + sort = "+time"; + textColor = colors.foreground; + width = 400; + }; + }; +} diff --git a/modules/dadada/session.nix b/modules/dadada/session.nix new file mode 100644 index 0000000..1ac9d53 --- /dev/null +++ b/modules/dadada/session.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: +with lib; +let + cfg = config.dadada.session; +in { + options.dadada.session = { + enable = mkEnableOption "Enable session variable management"; + sessionVars = mkOption { + description = "Session variables"; + type = types.attrs; + default = {}; + example = '' + EDITOR = "vim"; + PAGER = "less"; + ''; + }; + }; + config = mkIf cfg.enable { + home.sessionVariables = cfg.sessionVars; + systemd.user.sessionVariables = cfg.sessionVars; + }; +} diff --git a/modules/dadada/ssh.nix b/modules/dadada/ssh.nix new file mode 100644 index 0000000..d89cfa1 --- /dev/null +++ b/modules/dadada/ssh.nix @@ -0,0 +1,14 @@ +{ config, lib, ... }: +with lib; +let + cfg = config.dadada.ssh; +in { + options.dadada.ssh = { + enable = mkEnableOption "Enable SSH config"; + }; + config = mkIf cfg.enable { + programs.ssh = { + enable = true; + }; + }; +} diff --git a/modules/sway/config b/modules/dadada/sway/config similarity index 100% rename from modules/sway/config rename to modules/dadada/sway/config diff --git a/modules/dadada/sway/default.nix b/modules/dadada/sway/default.nix new file mode 100644 index 0000000..2cbb12a --- /dev/null +++ b/modules/dadada/sway/default.nix @@ -0,0 +1,39 @@ +{ config, pkgs, lib, colors, ...}: +with lib; +let + cfg = config.dadada.sway; +in { + options.dadada.sway = { + enable = mkEnableOption "Enable Sway config"; + }; + config = mkIf cfg.enable { + home.packages = with pkgs; [ + qt5.qtwayland + swayidle + xwayland + mako + kanshi + i3blocks + termite + bemenu + xss-lock + ] ++ (with unstable; [ + swaylock + ]); + + wayland.windowManager.sway = { + enable = true; + config = null; + extraConfig = (builtins.readFile ./config); + extraSessionCommands = '' + export SDL_VIDEODRIVER=wayland + # needs qt5.qtwayland in systemPackages + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + # Fix for some Java AWT applications (e.g. Android Studio), + # use this if they aren't displayed properly: + export _JAVA_AWT_WM_NONREPARENTING=1 + ''; + }; + }; +} diff --git a/modules/dadada/syncthing.nix b/modules/dadada/syncthing.nix new file mode 100644 index 0000000..9d038a9 --- /dev/null +++ b/modules/dadada/syncthing.nix @@ -0,0 +1,15 @@ +{ config, pkgs, lib, ... }: +with lib; +let + cfg = config.dadada.syncthing; +in { + options.dadada.syncthing = { + enable = mkEnableOption "Enable Syncthing config"; + }; + config = mkIf cfg.enable { + services.syncthing = { + enable = true; + tray = false; + }; + }; +} diff --git a/modules/dadada/termite.nix b/modules/dadada/termite.nix new file mode 100644 index 0000000..c0ad51b --- /dev/null +++ b/modules/dadada/termite.nix @@ -0,0 +1,63 @@ +{ config, lib, pkgs, colors, ... }: +with lib; +let + cfg = config.dadada.termite; +in { + options.dadada.termite = { + enable = mkEnableOption "Enable termite config"; + }; + config = mkIf cfg.enable { + programs.termite = { + enable = true; + allowBold = true; + audibleBell = false; + clickableUrl = true; + dynamicTitle = true; + font = "Source Code Pro 10"; + mouseAutohide = false; + scrollOnOutput = false; + scrollOnKeystroke = true; + scrollbackLines = -1; + searchWrap = true; + urgentOnBell = true; + cursorBlink = "off"; + cursorShape = "block"; + sizeHints = false; + scrollbar = "off"; + colorsExtra = '' + foreground = ${colors.foreground} + foreground_bold = ${colors.foregroundBold} + cursor = ${colors.cursor} + cursor_foreground = ${colors.cursorForeground} + background = ${colors.background} + color0 = ${colors.background} + color8 = ${colors.color8} + color7 = ${colors.color7} + color15 = ${colors.color15} + color1 = ${colors.color1} + color9 = ${colors.color9} + color2 = ${colors.color2} + color10 = ${colors.color10} + color3 = ${colors.color3} + color11 = ${colors.color11} + color4 = ${colors.color4} + color12 = ${colors.color12} + color5 = ${colors.color5} + color13 = ${colors.color13} + color6 = ${colors.color6} + color14 = ${colors.color14} + color16 = ${colors.color16} + color17 = ${colors.color17} + color18 = ${colors.color18} + color19 = ${colors.color19} + color20 = ${colors.color20} + color21 = ${colors.color21} + ''; + }; + + # Add font that is used in config + home.packages = [ + pkgs.source-code-pro + ]; + }; +} diff --git a/modules/dadada/tmux.nix b/modules/dadada/tmux.nix new file mode 100644 index 0000000..2da6792 --- /dev/null +++ b/modules/dadada/tmux.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: +with lib; +let + cfg = config.dadada.tmux; +in { + options.dadada.tmux = { + enable = mkEnableOption "Enable tmux config"; + }; + config = mkIf cfg.enable { + programs.tmux = { + enable = true; + terminal = "xterm-256color"; + extraConfig = '' + set -g status on + set-option -g set-titles on + set-option -g automatic-rename on + set-window-option -g mode-keys vi + ''; + }; + }; +} diff --git a/modules/dadada/vim/default.nix b/modules/dadada/vim/default.nix new file mode 100644 index 0000000..e5a5a81 --- /dev/null +++ b/modules/dadada/vim/default.nix @@ -0,0 +1,52 @@ +{ config, pkgs, lib, fetchFromGitHub, ... }: +with lib; +let + cfg = config.dadada.vim; + + myFtplugins = pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "myFtplugins"; + version = "2010-11-06"; + src = vim/plugins/myFtplugins; + }; + + spacemacsTheme = pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "spacemacs-theme"; + version = "2.0.1"; + src = pkgs.fetchFromGitHub { + owner = "colepeters"; + repo = "spacemacs-theme.vim"; + rev = "056bba9bd05a2c97c63c28216a1c232cfb91529e"; + sha256 = "0iy3i6waigk759p2z59mrxkjc0p412y7d8zf3cjak4a9sh1sh6qz"; + }; + }; +in +{ + options.dadada.vim = { + enable = mkEnableOption "Enable VIM config"; + }; + + config = mkIf cfg.enable { + programs.vim = { + enable = true; + extraConfig = builtins.readFile ./vimrc; + plugins = [ + pkgs.vimPlugins.vim-nix + #pkgs.vimPlugins.kotlin-vim + pkgs.vimPlugins.ale + pkgs.vimPlugins.fzf-vim + pkgs.vimPlugins.rust-vim + pkgs.vimPlugins.base16-vim + pkgs.vimPlugins.typescript-vim + pkgs.vimPlugins.vim-airline + pkgs.vimPlugins.vim-airline-themes + pkgs.vimPlugins.vim-fish + spacemacsTheme + #pkgs.vimPlugins.vim-gnupg + #pkgs.vimPlugins.vim-l9 + pkgs.vimPlugins.vim-ledger + #pkgs.vimPlugins.clang_complete + ]; + }; + home.packages = [ pkgs.languagetool ]; + }; +} diff --git a/modules/vim/plugins/myFtplugins/ftplugin/cpp.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/cpp.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/cpp.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/cpp.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/css.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/css.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/css.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/css.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/fish.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/fish.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/fish.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/fish.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/foo.kt b/modules/dadada/vim/plugins/myFtplugins/ftplugin/foo.kt similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/foo.kt rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/foo.kt diff --git a/modules/vim/plugins/myFtplugins/ftplugin/html.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/html.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/html.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/html.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/javascript.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/javascript.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/javascript.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/javascript.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/kotlin.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/kotlin.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/kotlin.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/kotlin.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/ledger.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/ledger.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/ledger.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/ledger.vim diff --git a/modules/dadada/vim/plugins/myFtplugins/ftplugin/markdown.md b/modules/dadada/vim/plugins/myFtplugins/ftplugin/markdown.md new file mode 100644 index 0000000..0c79590 --- /dev/null +++ b/modules/dadada/vim/plugins/myFtplugins/ftplugin/markdown.md @@ -0,0 +1,2 @@ +let b:ale_linters = {'markdown': ['languagetool']} +let b:ale_fixers = {'markdown': ['languagetool']} diff --git a/modules/vim/plugins/myFtplugins/ftplugin/nix.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/nix.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/nix.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/nix.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/python.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/python.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/python.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/python.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/rust.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/rust.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/rust.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/rust.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/scss.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/scss.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/scss.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/scss.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/typescript.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/typescript.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/typescript.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/typescript.vim diff --git a/modules/vim/plugins/myFtplugins/ftplugin/yaml.vim b/modules/dadada/vim/plugins/myFtplugins/ftplugin/yaml.vim similarity index 100% rename from modules/vim/plugins/myFtplugins/ftplugin/yaml.vim rename to modules/dadada/vim/plugins/myFtplugins/ftplugin/yaml.vim diff --git a/modules/vim/vimrc b/modules/dadada/vim/vimrc similarity index 97% rename from modules/vim/vimrc rename to modules/dadada/vim/vimrc index 9d55fdc..3538ae9 100644 --- a/modules/vim/vimrc +++ b/modules/dadada/vim/vimrc @@ -124,6 +124,7 @@ let g:ale_fix_on_save = 1 let g:ale_warn_about_trailing_whitespace = 1 let g:ale_warn_about_trailing_lines = 1 let g:ale_completion_tsserver_autoimport = 1 +let g:ale_languagetool_executable = 'languagetool-commandline' "let g:ale_lint_on_text_changed = 'never' " You can disable this option too diff --git a/modules/xdg.nix b/modules/dadada/xdg.nix similarity index 57% rename from modules/xdg.nix rename to modules/dadada/xdg.nix index 34d1f9a..bf8199a 100644 --- a/modules/xdg.nix +++ b/modules/dadada/xdg.nix @@ -1,4 +1,5 @@ { config, pkgs, lib, ... }: +with lib; let apps = { "x-scheme-handler/mailto" = "userapp-Thunderbird-PB7NI0.desktop"; @@ -17,26 +18,32 @@ let "text/plain" = "vim.desktop"; "application/pdf" = "org.pwmt.zathura.desktop"; }; + cfg = config.dadada.xdg; in { - xdg = { - enable = true; - mimeApps = { - enable = false; - associations.added = apps; - defaultApplications = apps; - }; - userDirs = { - download ="\$HOME/tmp"; - music = "\$HOME/lib/music"; - videos ="\$HOME/lib/videos"; - pictures = "\$HOME/lib/pictures"; - documents = "\$HOME/lib"; - desktop = "$HOME/tmp"; - }; + options.dadada.xdg = { + enable = mkEnableOption "Enable XDG config"; + }; + config = mkIf cfg.enable { + xdg = { + enable = true; + mimeApps = { + enable = false; + associations.added = apps; + defaultApplications = apps; + }; + userDirs = { + download ="\$HOME/tmp"; + music = "\$HOME/lib/music"; + videos ="\$HOME/lib/videos"; + pictures = "\$HOME/lib/pictures"; + documents = "\$HOME/lib"; + desktop = "$HOME/tmp"; + }; + }; + home.packages = with pkgs; [ + firefox-bin + xdg_utils + zathura + ]; }; - home.packages = with pkgs; [ - firefox-bin - xdg_utils - zathura - ]; } diff --git a/modules/dadada/zsh.nix b/modules/dadada/zsh.nix new file mode 100644 index 0000000..77472bc --- /dev/null +++ b/modules/dadada/zsh.nix @@ -0,0 +1,60 @@ +{ config, pkgs, lib, ... }: +with lib; +let + cfg = config.dadada.zsh; +in { + options.dadada.zsh = { + enable = mkEnableOption "Enable ZSH config"; + }; + config = mkIf cfg.enable { + programs.fzf.enableZshIntegration = true; + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + autocd = true; + sessionVariables = { + EDITOR = "vim"; + }; + history = { + extended = true; + ignoreDups = true; + ignoreSpace = true; + save = 100000; + share = true; + }; + plugins = [ + ]; + initExtra = '' + source ~/.nix-profile/share/zsh-git-prompt/zshrc.sh + source ~/.nix-profile/share/fzf/key-bindings.zsh + source ~/.nix-profile/share/fzf/completion.zsh + + preexec() { echo -n -e "\033]0;$1\007" } + + PROMPT="%F{red}%?%f %F{green}%m%f:%F{blue}%~%f " + RPROMPT='$(git_super_status)' + #NIX_BUILD_SHELL="${pkgs.zsh}/bin/zsh" + ''; + profileExtra = '' + ''; + shellAliases = { + gst = "git status"; + gco = "git commit"; + glo = "git log"; + gad = "git add"; + ls = "exa"; + ll = "exa -l"; + la = "exa -la"; + mv = "mv -i"; + cp = "cp -i"; + }; + }; + + home.packages = [ + pkgs.fzf + pkgs.exa + pkgs.zsh-git-prompt + ]; + }; +} diff --git a/modules/direnv.nix b/modules/direnv.nix deleted file mode 100644 index e552096..0000000 --- a/modules/direnv.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - programs.direnv = { - enable = true; - enableZshIntegration = true; - enableNixDirenvIntegration = true; - }; -} diff --git a/modules/fish.nix b/modules/fish.nix deleted file mode 100644 index fb28567..0000000 --- a/modules/fish.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - programs.fish = { - enable = true; - plugins = with pkgs; [ - { - name = "fzf"; - src = pkgs.fetchFromGitHub { - owner = "jethrokuan"; - repo = "fzf"; - rev = "c3defd4a922e97120503b45e26efa775bc672b50"; - sha256 = "1k5b0nva0mbqc9830qhbcwxsi8d9b2p4ws1fq0bw9nkf2ripyp4p"; - }; - } - ]; - interactiveShellInit = '' - # fish git prompt - set __fish_git_prompt_show_informative_status 'yes' - set __fish_git_prompt_showdirtystate 'yes' - set __fish_git_prompt_showstashstate 'yes' - set __fish_git_prompt_showuntrackedfiles 'yes' - set __fish_git_prompt_showupstream 'yes' - set __fish_git_prompt_showcolorhints 'yes' - - set fish_greeting - - # disable path shortening - set fish_prompt_pwd_dir_length 0 - - set -U FZF_LEGACY_KEYBINDINGS 0 - set -x TERM xterm-256color - set -U fish_user_paths ~/bin $fish_user_paths - - #if status is-interactive - #and not status is-login - #and not set -q TMUX - #and string match -qr "^xterm-.*" "$TERM" - # exec tmux - #end - ''; - promptInit = '' - function fish_prompt - set last_status $status - printf '%s %s:%s ' \ - (set_color red - echo $last_status) \ - (set_color green - hostname) \ - (set_color blue - prompt_pwd) - set_color normal - end - - function fish_right_prompt - printf '%s' (__fish_git_prompt) - end - ''; - shellAliases = { - gst = "git status"; - gco = "git commit"; - glo = "git log"; - gad = "git add"; - ls = "exa"; - ll = "exa -l"; - la = "exa -la"; - mv = "mv -i"; - cp = "cp -i"; - }; - }; - - home.packages = [ pkgs.exa ]; - -} diff --git a/modules/git.nix b/modules/git.nix deleted file mode 100644 index 450441b..0000000 --- a/modules/git.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, ... }: -{ - programs.git.enable = true; -} - diff --git a/modules/gpg.nix b/modules/gpg.nix deleted file mode 100644 index ff69120..0000000 --- a/modules/gpg.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, ... }: -{ - programs.gpg = { - enable = true; - settings = { - fixed-list-mode = true; - keyid-format = "0xlong"; - verify-options = "show-uid-validity"; - list-options = "show-uid-validity"; - cert-digest-algo = "SHA256"; - use-agent = true; - keyserver = "hkps://keys.openpgp.org"; - }; - }; - - services.gpg-agent = { - enable = true; - defaultCacheTtl = 1800; - enableSshSupport = false; - }; - - programs.git.extraConfig = { - commit = { gpgSign = true; }; - }; -} diff --git a/modules/gtk.nix b/modules/gtk.nix deleted file mode 100644 index 6bd417a..0000000 --- a/modules/gtk.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, pkgs, ... }: -{ - gtk = { - enable = true; - theme.package = pkgs.gnome3.gnome-themes-extra; - theme.name = "Adwaita-dark"; - iconTheme.package = pkgs.gnome3.adwaita-icon-theme; - iconTheme.name = "Adwaita"; - font.package = pkgs.cantarell-fonts; - font.name = "Cantarell"; - }; - qt = { - enable = true; - platformTheme = "gtk"; - }; -} diff --git a/modules/keyring.nix b/modules/keyring.nix deleted file mode 100644 index 82aba74..0000000 --- a/modules/keyring.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, ... }: -{ - services.gnome-keyring = { - enable = false; - components = [ "pkcs11" "secrets" ]; - }; -} diff --git a/modules/kitty.nix b/modules/kitty.nix deleted file mode 100644 index d8d1988..0000000 --- a/modules/kitty.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ pkgs, lib, config, ... }: -{ - programs.kitty = { - enable = true; - font = { - package = pkgs.source-code-pro; - name = "Source Code Pro 10"; - }; - extraConfig = '' - enable_audio_bell = false; - background #1f2022 - foreground #a3a3a3 - selection_background #a3a3a3 - selection_foreground #1f2022 - url_color #b8b8b8 - cursor #a3a3a3 - active_border_color #585858 - inactive_border_color #282828 - active_tab_background #1f2022 - active_tab_foreground #a3a3a3 - inactive_tab_background #282828 - inactive_tab_foreground #b8b8b8 - tab_bar_background #282828 - - # normal - color0 #1f2022 - color1 #f2241f - color2 #67b11d - color3 #b1951d - color4 #4f97d7 - color5 #a31db1 - color6 #2d9574 - color7 #a3a3a3 - - # bright - color8 #585858 - color9 #f2241f - color10 #67b11d - color11 #b1951d - color12 #4f97d7 - color13 #a31db1 - color14 #2d9574 - color15 #f8f8f8 - - # extended base16 colors - color16 #ffa500 - color17 #b03060 - color18 #282828 - color19 #444155 - color20 #b8b8b8 - color21 #e8e8e8 - ''; - }; -} diff --git a/modules/mako.nix b/modules/mako.nix deleted file mode 100644 index eacc975..0000000 --- a/modules/mako.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, pkgs, colors, ...}: -{ - programs.mako = { - enable = true; - anchor = "bottom-right"; - backgroundColor = colors.color8; - borderColor = colors.color0; - #defaultTimeout = -1; - font = "Source Code Pro 10"; - format = ''%a %s\n%b''; - height = 100; - #groupBy = "app-name"; - icons = false; - ignoreTimeout = false; - layer = "overlay"; - margin = "0,0,0"; - maxVisible = 200; - padding = "0"; - progressColor = colors.color4; - sort = "+time"; - textColor = colors.foreground; - width = 400; - }; -} diff --git a/modules/module-list.nix b/modules/module-list.nix new file mode 100644 index 0000000..b35d249 --- /dev/null +++ b/modules/module-list.nix @@ -0,0 +1,19 @@ +[ + ./dadada/direnv.nix + ./dadada/fish.nix + ./dadada/git.nix + ./dadada/gpg.nix + ./dadada/gtk.nix + ./dadada/keyring.nix + ./dadada/kitty + ./dadada/mako.nix + ./dadada/session.nix + ./dadada/ssh.nix + ./dadada/sway + ./dadada/syncthing.nix + ./dadada/termite.nix + ./dadada/tmux.nix + ./dadada/vim + ./dadada/xdg.nix + ./dadada/zsh.nix +] diff --git a/modules/profiles/home.nix b/modules/profiles/home.nix deleted file mode 100644 index bfe19ca..0000000 --- a/modules/profiles/home.nix +++ /dev/null @@ -1,120 +0,0 @@ -{ config, pkgs, lib, ... }: -let - unstable = import {}; -in { - imports = [ - (import ../session.nix { - inherit config; - sessionVars = { - EDITOR = "vim"; - PAGER = "less"; - MAILDIR = "\$HOME/.var/mail"; - MBLAZE = "\$HOME/.config/mblaze"; - NOTMUCH_CONFIG = "\$HOME/.config/notmuch/config"; - MOZ_ENABLE_WAYLAND= "1"; - }; - }) - ../direnv.nix - ../vim - ../tmux.nix - ../zsh.nix - ../gpg.nix - ../ssh.nix - ../git.nix - ../gtk.nix - ../xdg.nix - ../keyring.nix - ../kitty.nix - ../syncthing.nix - ]; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - - home.packages = with pkgs; [ - anki - aspell - aspellDicts.de - aspellDicts.en - aspellDicts.en-computers - aspellDicts.en-science - bluez-tools - chromium - clang - clang-tools - direnv - evince - ffmpeg - fido2luks - file - fzf - gimp - git-lfs - gnome3.eog - gnome3.gnome-tweak-tool - gnome3.nautilus - gnumake - gnupg - graphviz - grim - imagemagick - inkscape - inotify-tools - jq - kcachegrind - kitty - ldns - libreoffice - libvirt - lsof - mblaze - mkpasswd - mpv - mumble - ncurses - nfs-utils - nmap - openssl - p7zip - pass - pavucontrol - playerctl - pwgen - python27Packages.dbus-python - python3 - python38Packages.dateutil - python38Packages.solo-python - slurp - sqlite - sshfs-fuse - steam - tcpdump - tdesktop - unzip - usbutils - virtmanager - whois - xdg_utils - firefox-bin - ] ++ (with unstable; [ - android-studio - keepassxc - minecraft - python38Packages.managesieve - signal-desktop - thunderbird-bin - texlive-tubslatex - wireshark - youtube-dl - ]); - - # 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. - home.stateVersion = "19.09"; -} diff --git a/modules/profiles/home/default.nix b/modules/profiles/home/default.nix new file mode 100644 index 0000000..3fdb5e6 --- /dev/null +++ b/modules/profiles/home/default.nix @@ -0,0 +1,54 @@ +{ config, pkgs, lib, ... }: +let + sources = import ../../../nix/sources.nix; + stable = import {}; +in { + nixpkgs = { + overlays = [ + (import ../../../overlays/texlive-tubslatex.nix) + ]; + }; + + imports = import ../../module-list.nix; + + dadada = { + vim.enable = true; + direnv.enable = true; + git.enable = true; + gpg.enable = true; + gtk.enable = true; + keyring.enable = true; + kitty.enable = true; + session.enable = true; + ssh.enable = true; + syncthing.enable = true; + xdg.enable = true; + zsh.enable = true; + }; + + dadada.session = { + sessionVars = { + EDITOR = "vim"; + PAGER = "less"; + MAILDIR = "\$HOME/.var/mail"; + MBLAZE = "\$HOME/.config/mblaze"; + NOTMUCH_CONFIG = "\$HOME/.config/notmuch/config"; + MOZ_ENABLE_WAYLAND= "1"; + }; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + home.packages = import ./pkgs.nix { pkgs = pkgs; }; + + # 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. + home.stateVersion = "19.09"; +} diff --git a/modules/profiles/home/pkgs.nix b/modules/profiles/home/pkgs.nix new file mode 100644 index 0000000..c2aa282 --- /dev/null +++ b/modules/profiles/home/pkgs.nix @@ -0,0 +1,83 @@ +{ pkgs }: +with pkgs; [ + android-studio + anki + aspell + aspellDicts.de + aspellDicts.en + aspellDicts.en-computers + aspellDicts.en-science + aqbanking + bluez-tools + chromium + clang + clang-tools + darcs + direnv + element-desktop + evince + ffmpeg + file + firefox-bin + fractal + fzf + gimp + git-lfs + gitAndTools.hub + gnome3.gnome-tweak-tool + gnome3.nautilus + gnome3.vinagre + gnucash + gnumake + gnupg + graphviz + grim + imagemagick + inkscape + inotify-tools + jameica + jq + kcachegrind + keepassxc + kitty + ldns + libreoffice + libvirt + lsof + mblaze + mkpasswd + mpv + mumble + ncurses + nfs-utils + niv + nmap + openssl + p7zip + pass + pavucontrol + pinentry-gnome + playerctl + pwgen + python27Packages.dbus-python + python3 + python38Packages.dateutil + python38Packages.managesieve + python38Packages.solo-python + signal-desktop + slurp + sqlite + sshfs-fuse + steam + tcpdump + tdesktop + texlive-tubslatex + thunderbird-bin + unzip + usbutils + virtmanager + whois + wireshark + xdg_utils + youtube-dl +] diff --git a/modules/session.nix b/modules/session.nix deleted file mode 100644 index 3718ab0..0000000 --- a/modules/session.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, sessionVars }: -{ - home.sessionVariables = sessionVars; - systemd.user.sessionVariables = sessionVars; -} diff --git a/modules/ssh.nix b/modules/ssh.nix deleted file mode 100644 index 10e5e15..0000000 --- a/modules/ssh.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, ... }: -{ - programs.ssh = { - enable = true; - }; -} diff --git a/modules/sway/default.nix b/modules/sway/default.nix deleted file mode 100644 index 6d853e0..0000000 --- a/modules/sway/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, pkgs, lib, colors, ...}: -let - unstable = import {}; -in { - home.packages = with pkgs; [ - qt5.qtwayland - swayidle - xwayland - mako - kanshi - i3blocks - termite - bemenu - xss-lock - ] ++ (with unstable; [ - swaylock - ]); - - wayland.windowManager.sway = { - enable = true; - config = null; - extraConfig = (builtins.readFile ./config); - extraSessionCommands = '' - export SDL_VIDEODRIVER=wayland - # needs qt5.qtwayland in systemPackages - export QT_QPA_PLATFORM=wayland - export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" - # Fix for some Java AWT applications (e.g. Android Studio), - # use this if they aren't displayed properly: - export _JAVA_AWT_WM_NONREPARENTING=1 - ''; - }; -} - diff --git a/modules/sway/wallpaper b/modules/sway/wallpaper deleted file mode 100644 index 0b540d8..0000000 Binary files a/modules/sway/wallpaper and /dev/null differ diff --git a/modules/syncthing.nix b/modules/syncthing.nix deleted file mode 100644 index c1a8b1e..0000000 --- a/modules/syncthing.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - services.syncthing = { - enable = true; - tray = false; - }; -} diff --git a/modules/termite.nix b/modules/termite.nix deleted file mode 100644 index 9ba13c4..0000000 --- a/modules/termite.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ config, pkgs, colors, ... }: -{ - programs.termite = { - enable = true; - allowBold = true; - audibleBell = false; - clickableUrl = true; - dynamicTitle = true; - font = "Source Code Pro 10"; - mouseAutohide = false; - scrollOnOutput = false; - scrollOnKeystroke = true; - scrollbackLines = -1; - searchWrap = true; - urgentOnBell = true; - cursorBlink = "off"; - cursorShape = "block"; - sizeHints = false; - scrollbar = "off"; - colorsExtra = '' - foreground = ${colors.foreground} - foreground_bold = ${colors.foregroundBold} - cursor = ${colors.cursor} - cursor_foreground = ${colors.cursorForeground} - background = ${colors.background} - color0 = ${colors.background} - color8 = ${colors.color8} - color7 = ${colors.color7} - color15 = ${colors.color15} - color1 = ${colors.color1} - color9 = ${colors.color9} - color2 = ${colors.color2} - color10 = ${colors.color10} - color3 = ${colors.color3} - color11 = ${colors.color11} - color4 = ${colors.color4} - color12 = ${colors.color12} - color5 = ${colors.color5} - color13 = ${colors.color13} - color6 = ${colors.color6} - color14 = ${colors.color14} - color16 = ${colors.color16} - color17 = ${colors.color17} - color18 = ${colors.color18} - color19 = ${colors.color19} - color20 = ${colors.color20} - color21 = ${colors.color21} - ''; - }; - - # Add font that is used in config - home.packages = [ - pkgs.source-code-pro - ]; -} diff --git a/modules/tmux.nix b/modules/tmux.nix deleted file mode 100644 index 72cbf8b..0000000 --- a/modules/tmux.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, ... }: -{ - programs.tmux = { - enable = true; - terminal = "xterm-256color"; - extraConfig = '' - set -g status on - set-option -g set-titles on - set-option -g automatic-rename on - set-window-option -g mode-keys vi - ''; - }; -} - diff --git a/modules/vim/default.nix b/modules/vim/default.nix deleted file mode 100644 index 911f889..0000000 --- a/modules/vim/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, pkgs, lib, fetchFromGitHub, ... }: -let - myFtplugins = pkgs.vimUtils.buildVimPluginFrom2Nix { - pname = "myFtplugins"; - version = "2010-11-06"; - src = vim/plugins/myFtplugins; - }; - spacemacsTheme = pkgs.vimUtils.buildVimPluginFrom2Nix { - pname = "spacemacs-theme"; - version = "2.0.1"; - src = pkgs.fetchFromGitHub { - owner = "colepeters"; - repo = "spacemacs-theme.vim"; - rev = "056bba9bd05a2c97c63c28216a1c232cfb91529e"; - sha256 = "0iy3i6waigk759p2z59mrxkjc0p412y7d8zf3cjak4a9sh1sh6qz"; - }; - }; -in -{ - programs.vim = { - enable = true; - extraConfig = builtins.readFile ./vimrc; - plugins = [ - pkgs.vimPlugins.vim-nix - #pkgs.vimPlugins.kotlin-vim - pkgs.vimPlugins.ale - pkgs.vimPlugins.fzf-vim - pkgs.vimPlugins.rust-vim - pkgs.vimPlugins.base16-vim - pkgs.vimPlugins.typescript-vim - pkgs.vimPlugins.vim-airline - pkgs.vimPlugins.vim-airline-themes - pkgs.vimPlugins.vim-fish - spacemacsTheme - #pkgs.vimPlugins.vim-gnupg - #pkgs.vimPlugins.vim-l9 - pkgs.vimPlugins.vim-ledger - #pkgs.vimPlugins.clang_complete - ]; - }; -} - diff --git a/modules/zsh.nix b/modules/zsh.nix deleted file mode 100644 index 92f24c2..0000000 --- a/modules/zsh.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - programs.fzf.enableZshIntegration = true; - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - autocd = true; - sessionVariables = { - EDITOR = "vim"; - }; - history = { - extended = true; - ignoreDups = true; - ignoreSpace = true; - save = 100000; - share = true; - }; - plugins = [ - ]; - initExtra = '' - source ~/.nix-profile/share/zsh-git-prompt/zshrc.sh - source ~/.nix-profile/share/fzf/key-bindings.zsh - source ~/.nix-profile/share/fzf/completion.zsh - - preexec() { echo -n -e "\033]0;$1\007" } - - PROMPT="%F{red}%?%f %F{green}%m%f:%F{blue}%~%f " - RPROMPT='$(git_super_status)' - #NIX_BUILD_SHELL="${pkgs.zsh}/bin/zsh" - ''; - profileExtra = '' - ''; - shellAliases = { - gst = "git status"; - gco = "git commit"; - glo = "git log"; - gad = "git add"; - ls = "exa"; - ll = "exa -l"; - la = "exa -la"; - mv = "mv -i"; - cp = "cp -i"; - }; - }; - - home.packages = [ - pkgs.fzf - pkgs.exa - pkgs.zsh-git-prompt - ]; - -}