diff --git a/.gitmodules b/.gitmodules index b8fee3f7..d9753d11 100644 --- a/.gitmodules +++ b/.gitmodules @@ -11,8 +11,8 @@ path = home-common/graphical/rofi/zzzfoo url = https://github.com/andersju/zzzfoo.git [submodule "modules/cdarknet/hosts"] - path = system/cdarknet/hosts + path = system/modules/cdarknet/hosts url = git@git.darmstadt.ccc.de:cdark.net/hosts [submodule "modules/cdarknet/nixdark"] - path = system/cdarknet/nixdark + path = system/modules/cdarknet/nixdark url = git@git.darmstadt.ccc.de:cdark.net/nixdark diff --git a/home-manager/default.nix b/home-manager/default.nix index a6257630..b47746db 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,12 +1,32 @@ { pkgs, config, ... }: { - nixpkgs.config.packageOverrides = pkgs: { - rust-scripts = pkgs.callPackage ./packages/rust-scripts {}; - jali = pkgs.callPackage ./packages/jali {}; + imports = [ + ./zsh + ./modules/taskwarrior.nix + ./modules/force-copies.nix + ./modules/battery.nix + ./modules/laptop.nix + ./modules/accounting.nix + ./modules/rustdev.nix + ./modules/latex.nix + ./modules/sleep-nag.nix + ./modules/graphical + ./modules/home-options.nix +# ./sort-mail.nix +# ./morgenreport.nix +# ./my-systems.nix + ]; + + nixpkgs.config.packageOverrides = pkgs: with pkgs; { + tasktree = callPackage ./packages/tasktree {}; + rust-scripts = callPackage ./packages/rust-scripts {}; + jali = with pkgs; callPackage ./packages/jali {}; eventd = (import {}).callPackage ./packages/eventd {}; - st = (import graphical/st) pkgs config.common.colors; + st = (import packages/st) pkgs config.common.colors; + neovim = (import ./nvim) pkgs config.m-0.rustdev.enable; }; + home.file.".tmux.conf".text = '' set -g default-terminal "st-256color" set -ga terminal-overrides ",st-256color:Tc" @@ -80,20 +100,6 @@ { host = "door.w17.io"; identityFile = "~/.ssh/door_rsa";} ]; }; - zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - history = { - save = 100000; - size = 100000; - }; - initExtra = builtins.readFile ./configs/zshrc; - oh-my-zsh = { - enable = true; - plugins = [ "colored-man-pages" "git-prompt" ]; - }; - }; }; home.sessionVariables = { @@ -103,66 +109,8 @@ }; systemd.user.startServices = true; - imports = [ - ./taskwarrior.nix - ./force-copies.nix - ]; - home.packages = with pkgs; [ - htop - tree - st.terminfo - most - - socat - nmap - tcpdump - - git-crypt - rcm - tmux - tig - exa - fzf - ag - - pythonPackages.qrcode - ranger - - (pkgs.neovim.override { - vimAlias = true; - withPython3 = true; - configure = { - customRC = '' - let $RUST_SRC_PATH="${pkgs.rustPlatform.rustcSrc}" - let g:rustfmt_command = "${pkgs.rustfmt}/bin/rustfmt" - let g:racer_cmd = "${pkgs.rustracer}/bin/racer" - let g:deoplete#sources#rust#racer_binary='${pkgs.rustracer}/bin/racer' - let g:syntastic_rust_rustc_exe = '${pkgs.cargo}/bin/cargo check' - ${builtins.readFile ./configs/vimrc} - ''; - packages.myVimPackage = with pkgs.vimPlugins; { - start = [ - vim-nix - ctrlp - vimtex - Syntastic - UltiSnips - airline - rust-vim - fugitive - airline - vim-trailing-whitespace - vim-polyglot - nvim-cm-racer - nvim-completion-manager - vim-pandoc - nerdcommenter - vim-signify - ]; - }; - }; - }) + neovim ]; xdg.enable = true; } diff --git a/home-manager/graphical/rofi/default.nix b/home-manager/graphical/rofi/default.nix deleted file mode 100644 index 7e1d63fb..00000000 --- a/home-manager/graphical/rofi/default.nix +++ /dev/null @@ -1,115 +0,0 @@ -{ pkgs, lib, config, ... }: -let - workspaces = config.common.workspaces; - terminal = config.common.terminal; - colors = config.common.colors; - #rofiScriptWeb = pkgs.writeShellScriptBin "rofi-script-web" '' - #if [[ -z $@ ]]; then - #sed 's/^[0-9]*\(-r\)\? \?//;s/^\([^[:space:]]*\).*$/\1/' $HOME/.local/share/qutebrowser/history | tac - #else - #${pkgs.qutebrowser}/bin/qutebrowser "$1" > /dev/null & - #fi - #''; - #rofiScriptI3 = pkgs.writeShellScriptBin "rofi-script-i3" '' - #if [ -z $@ ]; then - #(i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g'; - #echo "${builtins.concatStringsSep "\n" (builtins.foldl' (labels: name: let - #number = toString (builtins.length labels); - #in - #labels ++ [ "${number}:${name}" ] - #) [] workspaces)}") | sort -u - #else - #i3-msg workspace "$@" >/dev/null - #fi - #''; - rofiTask = pkgs.writeScriptBin "tasklauncher" (builtins.readFile ./tasklauncher.py); -# recollPython = pkgs.python2.withPackages (ps: [ -# pkgs.recoll -# ]); -# rofiFind = pkgs.writeScriptBin "zzzfoo" (builtins.replaceStrings [ "/usr/bin/env python" ] [ "${recollPython}/bin/python" ] (builtins.readFile ./zzzfoo/zzzfoo)); -in { - home = { - packages = with pkgs; [ - rofi - #rofiScriptWeb - #rofiScriptI3 - rofiTask -# rofiFind - rofi-pass -# recoll - ]; - }; - programs = { - rofi = { - enable = true; - extraConfig = '' - rofi.modi: combi,window,drun,run,ssh,keys - rofi.combi-modi: window,drun,run - ''; - borderWidth = 0; - separator = "none"; - fullscreen = false; - terminal = terminal; - yoffset = 19; - location = "top"; - scrollbar = false; - padding = 10; - cycle = false; - lines = 30; - colors = { - window = { - background = "argb:c0${builtins.substring 1 6 colors.background}"; - border = colors.blue; - separator = colors.blue; - }; - - rows = { - normal = { - background = colors.background; - foreground = colors.foreground; - backgroundAlt = colors.black; - highlight = { - background = colors.blue; - foreground = colors.white; - }; - }; - active = { - background = colors.background; - foreground = colors.foreground; - backgroundAlt = colors.black; - highlight = { - background = colors.blue; - foreground = colors.white; - }; - }; - urgent = { - background = colors.background; - foreground = colors.foreground; - backgroundAlt = colors.black; - highlight = { - background = colors.blue; - foreground = colors.white; - }; - }; - }; - #colors = { - #window = { - #background = "argb:${builtins.substring 1 6 colors.background}22"; - #border = colors.blue; - #separator = colors.blue; - #}; - #rows = { - #normal = { - #background = colors.background; - #foreground = colors.foreground; - #backgroundAlt = colors.black; - #highlight = { - #background = colors.blue; - #foreground = colors.white; - #}; - #}; - #}; - }; - }; - }; -} diff --git a/home-manager/habitask.nix b/home-manager/habitask.nix deleted file mode 100644 index 7c63b876..00000000 --- a/home-manager/habitask.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, ... }: -let - habitask = with pkgs; with rustPlatform; buildRustPackage rec { - name = "habitask"; - version = "0.1.0"; - src = ~/data/aktuell/it/code/habitask; - depsSha256 = "0clac943ajxns64jkdcg312a4x4jgd239jb4yd5qm32nnkj62ym7"; - cargoSha256 = "0clac943ajxns64jkdcg312a4x4jgd239jb4yd5qm32nnkj62ym7"; - buildInputs = [ openssl pkgconfig ]; - }; -in { - systemd.user = { - services.habitask = { - Unit = { - Description = "Update habitica Tasks"; - }; - Service = { - Type = "oneshot"; - ExecStart="{habitask}/bin/habitask"; - }; - }; - timers.habitask = { - Timer.OnCalendar = "6:00"; - }; - }; -} diff --git a/home-manager/modules/accounting.nix b/home-manager/modules/accounting.nix new file mode 100644 index 00000000..073195c8 --- /dev/null +++ b/home-manager/modules/accounting.nix @@ -0,0 +1,16 @@ +{ lib, pkgs, config, ...}: +with lib; +{ + +options.m-0.accounting.enable = mkEnableOption "Accounting"; + +config = mkIf config.m-0.accounting.enable { + home.packages = with pkgs; [ + hledger + haskellPackages.hledger-ui + ledger + jali + ]; +}; + +} diff --git a/home-manager/battery.nix b/home-manager/modules/battery.nix similarity index 88% rename from home-manager/battery.nix rename to home-manager/modules/battery.nix index 443bf78f..96351a6f 100644 --- a/home-manager/battery.nix +++ b/home-manager/modules/battery.nix @@ -1,4 +1,5 @@ -{pkgs, ... }: +{ lib, pkgs, ... }: +with lib; let battery-watch = pkgs.writeShellScriptBin "battery-watch" '' critical_level=20 #percent @@ -18,6 +19,10 @@ do done ''; in { + +options.m-0.battery.enable = mkEnableOption "Battery"; + +config = mkIf config.m-0.battery.enable { systemd.user = { services.battery = { Unit = { @@ -31,4 +36,6 @@ in { }; }; }; +}; + } diff --git a/home-manager/graphical/default.nix b/home-manager/modules/graphical/default.nix similarity index 63% rename from home-manager/graphical/default.nix rename to home-manager/modules/graphical/default.nix index 55f33fcb..3b059144 100644 --- a/home-manager/graphical/default.nix +++ b/home-manager/modules/graphical/default.nix @@ -1,12 +1,13 @@ -{ pkgs, lib, ... }: -let - tasktree = with pkgs; callPackage ../../packages/tasktree {}; -in { - imports = [ - ./i3.nix - ../../modules/home-options.nix - ]; - common = { +{ pkgs, lib, config, ... }: +with lib; +{ + +options.m-0.graphical.enable = mkEnableOption "Window Manager"; + +#imports = if config.m-0.graphical.enable then [ ./i3.nix ] else []; + +config = mkIf config.m-0.graphical.enable { + m-0 = { workspaces = [ "tasks" "chat" @@ -20,26 +21,26 @@ in { "config" ]; terminal = "${pkgs.st}/bin/st"; - colors = { - "foreground" = "#dddbff"; - "background" = "#05004a"; - "black" = "#030031"; - "brightBlack" = "#55508f"; - "red" = "#e34b4f"; - "brightRed" = "#e34b4f"; - "green" = "#67b779"; - "brightGreen" = "#45b75e"; - "yellow" = "#ff9c00"; - "brightYellow" = "#ff9c00"; - "blue" = "#5c67ff"; - "brightBlue" = "#5c67ff"; - "magenta" = "#cb85ff"; - "brightMagenta" = "#cb85ff"; - "cyan" = "#17d0f4"; - "brightCyan" = "#17d0f4"; - "white" = "#dddbff"; - "brightWhite" = "#ffffff"; - }; + colors = { + "foreground" = "#dddbff"; + "background" = "#05004a"; + "black" = "#030031"; + "brightBlack" = "#55508f"; + "red" = "#e34b4f"; + "brightRed" = "#e34b4f"; + "green" = "#67b779"; + "brightGreen" = "#45b75e"; + "yellow" = "#ff9c00"; + "brightYellow" = "#ff9c00"; + "blue" = "#5c67ff"; + "brightBlue" = "#5c67ff"; + "magenta" = "#cb85ff"; + "brightMagenta" = "#cb85ff"; + "cyan" = "#17d0f4"; + "brightCyan" = "#17d0f4"; + "white" = "#dddbff"; + "brightWhite" = "#ffffff"; + }; }; home = { packages = with pkgs; [ @@ -99,4 +100,6 @@ in { }; }; xsession.enable = true; +}; + } diff --git a/home-manager/graphical/eventd.nix b/home-manager/modules/graphical/eventd.nix similarity index 100% rename from home-manager/graphical/eventd.nix rename to home-manager/modules/graphical/eventd.nix diff --git a/home-manager/graphical/i3.nix b/home-manager/modules/graphical/i3.nix similarity index 95% rename from home-manager/graphical/i3.nix rename to home-manager/modules/graphical/i3.nix index a50a8301..88b4b0cf 100644 --- a/home-manager/graphical/i3.nix +++ b/home-manager/modules/graphical/i3.nix @@ -1,8 +1,8 @@ { pkgs, lib, config, ... }: let - colors = config.common.colors; - workspaces = config.common.workspaces; - terminal = config.common.terminal; + colors = config.m-0.colors; + workspaces = config.m-0.workspaces; + terminal = config.m-0.terminal; exec = "exec --no-startup-id"; taskstatus = pkgs.writeShellScriptBin "taskstatus" '' while true; @@ -29,7 +29,6 @@ in { ./rofi ./urxvt.nix ]; - home.packages = [ pkgs.skippy-xd ]; xsession = { windowManager.i3 = { enable = true; @@ -123,7 +122,7 @@ in { "XF86AudioMicMute" = "exec pactl set-source-mute '@DEFAULT_SOURCE@' toggle"; "XF86MonBrightnessUp" = "exec xbacklight +5"; "XF86MonBrightnessDown" = "exec xbacklight -5"; - "XF86Display" = "exec arandr"; + "XF86Display" = "${exec} ${pkgs.arandr}/bin/arandr"; "Ctrl+Escape" = "${exec} loginctl lock-session;"; } // addMods ({ @@ -131,7 +130,7 @@ in { "Down" = "focus down"; "Up" = "focus up"; "Right" = "focus right"; - "Tab" = "${exec} skippy-xd"; + "Tab" = "${exec} ${pkgs.skippy-xd}/bin/skippy-xd"; "Prior" = "focus parent"; "Next" = "focus child"; "Return" = "${exec} ${terminal}"; diff --git a/home-manager/modules/graphical/rofi/default.nix b/home-manager/modules/graphical/rofi/default.nix new file mode 100644 index 00000000..6461d175 --- /dev/null +++ b/home-manager/modules/graphical/rofi/default.nix @@ -0,0 +1,70 @@ +{ pkgs, lib, config, ... }: +let + workspaces = config.m-0.workspaces; + terminal = config.m-0.terminal; + colors = config.m-0.colors; + rofiTask = pkgs.writeScriptBin "tasklauncher" (builtins.readFile ./tasklauncher.py); +in { + home = { + packages = with pkgs; [ + rofi + rofiTask + rofi-pass + ]; + }; + programs = { + rofi = { + enable = true; + extraConfig = '' + rofi.modi: combi,window,drun,run,ssh,keys + rofi.combi-modi: window,drun,run + ''; + borderWidth = 0; + separator = "none"; + fullscreen = false; + terminal = terminal; + yoffset = 19; + location = "top"; + scrollbar = false; + padding = 10; + cycle = false; + lines = 30; + colors = { + window = { + background = "argb:c0${builtins.substring 1 6 colors.background}"; + border = colors.blue; + separator = colors.blue; + }; + rows = { + normal = { + background = colors.background; + foreground = colors.foreground; + backgroundAlt = colors.black; + highlight = { + background = colors.blue; + foreground = colors.white; + }; + }; + active = { + background = colors.background; + foreground = colors.foreground; + backgroundAlt = colors.black; + highlight = { + background = colors.blue; + foreground = colors.white; + }; + }; + urgent = { + background = colors.background; + foreground = colors.foreground; + backgroundAlt = colors.black; + highlight = { + background = colors.blue; + foreground = colors.white; + }; + }; + }; + }; + }; + }; +} diff --git a/home-manager/graphical/rofi/tasklauncher.py b/home-manager/modules/graphical/rofi/tasklauncher.py similarity index 100% rename from home-manager/graphical/rofi/tasklauncher.py rename to home-manager/modules/graphical/rofi/tasklauncher.py diff --git a/home-manager/graphical/urxvt.nix b/home-manager/modules/graphical/urxvt.nix similarity index 100% rename from home-manager/graphical/urxvt.nix rename to home-manager/modules/graphical/urxvt.nix diff --git a/home-manager/modules/home-options.nix b/home-manager/modules/home-options.nix index 27b84e3d..b33e7e2a 100644 --- a/home-manager/modules/home-options.nix +++ b/home-manager/modules/home-options.nix @@ -1,21 +1,22 @@ { lib, config, pkgs, ... }: - with lib; { - options = { - common = { - terminal = mkOption { - default = "urxvt"; - type = types.str; - }; - colors = mkOption { - default = {}; - type = types.attrs; - }; - workspaces = mkOption { - default = [ "configure some workspaces" ]; - type = types.listOf types.str; - }; + +options = { + m-0 = { + terminal = mkOption { + default = "urxvt"; + type = types.str; + }; + colors = mkOption { + default = {}; + type = types.attrs; + }; + workspaces = mkOption { + default = [ "configure some workspaces" ]; + type = types.listOf types.str; }; }; +}; + } diff --git a/home-manager/modules/laptop.nix b/home-manager/modules/laptop.nix new file mode 100644 index 00000000..c1cfc417 --- /dev/null +++ b/home-manager/modules/laptop.nix @@ -0,0 +1,73 @@ +{ lib, pkgs, config, ...}: +with lib; +{ + +options.m-0.laptop.enable = mkEnableOption "Laptop"; + +config = mkIf config.m-0.laptop.enable { + programs = { + firefox = { + enable = true; + }; + git = { + signing = { + signByDefault = true; + key = "6C3D12CD88CDF46C5EAF4D12226A2D41EF5378C9"; + }; + }; + }; + home.sessionVariables = { + MOZ_USE_XINPUT2 = "1"; + }; + + services = { + udiskie = { + enable = true; + notify = true; + }; + }; + + home.packages = with pkgs; [ + chromium + signal-desktop + tdesktop + acpi + dino + + arandr + + mumble + + xorg.xev + xorg.xbacklight + meld + + icedtea8_web + + # tools & office + feh + gimp + imagemagick + libreoffice-fresh + pandoc + xournal + musescore + handbrake + octave + + # look & feel + libertine + nerdfonts + + # media + ncmpcpp + pavucontrol + deluge + mpd + gmpc + calibre + mpv + ]; +}; + +} diff --git a/home-manager/latex.nix b/home-manager/modules/latex.nix similarity index 66% rename from home-manager/latex.nix rename to home-manager/modules/latex.nix index 51fb6207..8849b63c 100644 --- a/home-manager/latex.nix +++ b/home-manager/modules/latex.nix @@ -1,5 +1,10 @@ -{ pkgs, ... }: +{ lib, pkgs, config, ... }: +with lib; { + +options.m-0.latex.enable = mkEnableOption "Latex"; + +config = mkIf config.m-0.latex.enable { programs = { texlive = { enable = true; @@ -9,7 +14,7 @@ collection-latexextra collection-bibtexextra collection-luatex - # collection-math + collection-scimath collection-fontsextra; }; }; @@ -17,4 +22,6 @@ home.packages = [ pkgs.biber ]; +}; + } diff --git a/home-manager/modules/mpd.nix b/home-manager/modules/mpd.nix deleted file mode 100644 index cabf1d50..00000000 --- a/home-manager/modules/mpd.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib, config, pkgs, ... }: - -with lib; -{ - options = { - mpd = { - mkOption { - default = false; - type = types.bool; - }; - }; - }; - systemd.user = { - services.morgenreport = - let - morgenreport-script = pkgs.writeShellScriptBin "morgenreport" '' - cd $HOME/data/aktuell/media/ebooks/morgenreport/ - DATE=`date +%Y-%m-%d` - ${pkgs.calibre}/bin/ebook-convert $HOME/data/aktuell/it/code/calibre-recipes/morgenreport.recipe morgenreport-$DATE.mobi --output-profile=kindle_pw3 - echo "File created, sending to kindle now …" - PATH=$PATH:/run/wrappers/bin/ - echo 'Siehe Anhang' | ${pkgs.mutt}/bin/mutt -s "Morgenreport $DATE" -a morgenreport-$DATE.mobi -- maralorn@kindle.com - ''; - in { - Unit = { - Description = "Send morgenreport to kindle"; - }; - - Service = { - Type = "oneshot"; - ExecStart="/bin/sh ${morgenreport-script}/bin/morgenreport"; - }; - }; - timers.morgenreport = { - Timer = { - OnCalendar = "20:00"; - }; - }; - }; -} diff --git a/home-manager/modules/rustdev.nix b/home-manager/modules/rustdev.nix new file mode 100644 index 00000000..d033947b --- /dev/null +++ b/home-manager/modules/rustdev.nix @@ -0,0 +1,14 @@ +{ lib, pkgs, config, ...}: +with lib; +{ + +options.m-0.rustdev.enable = mkEnableOption "Rust Dev"; + +config = mkIf config.m-0.rustdev.enable { + home.packages = with pkgs; [ + gnome3.glade + rustracer + ]; +}; + +} diff --git a/home-manager/sleep-nag.nix b/home-manager/modules/sleep-nag.nix similarity index 80% rename from home-manager/sleep-nag.nix rename to home-manager/modules/sleep-nag.nix index 2e7b8295..a99acf4c 100644 --- a/home-manager/sleep-nag.nix +++ b/home-manager/modules/sleep-nag.nix @@ -1,4 +1,5 @@ -{pkgs, ... }: +{ lib, pkgs, config, ... }: +with lib; let sleep-nag = pkgs.writeShellScriptBin "sleep-nag" '' while true @@ -10,6 +11,10 @@ do done ''; in { + +options.m-0.sleep-nag.enable = mkEnableOption "Sleep Nag"; + +config = mkIf config.m-0.sleep-nag.enable { systemd.user = { services.sleep-nag = { Unit = { @@ -23,4 +28,6 @@ in { }; }; }; +}; + } diff --git a/home-manager/taskwarrior.nix b/home-manager/modules/taskwarrior.nix similarity index 90% rename from home-manager/taskwarrior.nix rename to home-manager/modules/taskwarrior.nix index 04c66e20..1efb129a 100644 --- a/home-manager/taskwarrior.nix +++ b/home-manager/modules/taskwarrior.nix @@ -1,5 +1,8 @@ -{ pkgs, lib, ... }: +{ lib, pkgs, config, ...}: +with lib; { +options.m-0.taskwarrior.enable = mkEnableOption "Taskwarrior"; +config = mkIf config.m-0.taskwarrior.enable { home = { packages = [ pkgs.taskwarrior ]; file = { @@ -53,7 +56,7 @@ }; xdg = let taskAction = name: template: { - "eventd/task-${name}.action".text = lib.generators.toINI {} { + "eventd/task-${name}.action".text = generators.toINI {} { Action = { Name = "task-${name}"; }; @@ -67,7 +70,7 @@ }; in { configFile = { - "eventd/task.event".text = lib.generators.toINI {} { + "eventd/task.event".text = generators.toINI {} { "Event task add" = { Actions = "task-new"; }; @@ -79,4 +82,6 @@ taskAction "changed" "Changes in task:\\n\${description}\${status:+\\nStatus: }\${status}\${tags:+\\nTags: }\${tags}\${project:+\\nProject: }\${project}" // taskAction "new" "New \${status} task\${tags:! in inbox}:\\n\${description}\${tags:+\\nTags: }\${tags}\${project:+\\nProject: }\${project}"; }; +}; + } diff --git a/home-manager/nvim/default.nix b/home-manager/nvim/default.nix new file mode 100644 index 00000000..85690089 --- /dev/null +++ b/home-manager/nvim/default.nix @@ -0,0 +1,39 @@ +pkgs: mkRust: +pkgs.neovim.override { + vimAlias = true; + withPython3 = true; + configure = { + customRC = if mkRust then '' + let $RUST_SRC_PATH="${pkgs.rustPlatform.rustcSrc}" + let g:rustfmt_command = "${pkgs.rustfmt}/bin/rustfmt" + let g:racer_cmd = "${pkgs.rustracer}/bin/racer" + let g:deoplete#sources#rust#racer_binary='${pkgs.rustracer}/bin/racer' + let g:syntastic_rust_rustc_exe = '${pkgs.cargo}/bin/cargo check' + let g:rustfmt_autosave = 1 + let g:syntastic_rust_checkers = [ 'cargo'] + let g:rust_recommend_style = 1 + let g:rust_fold =1 + ${builtins.readFile ./vimrc} + '' else builtins.readFile ./vimrc; + packages.myVimPackage = with pkgs.vimPlugins; { + start = [ + vim-nix + ctrlp + vimtex + Syntastic + UltiSnips + airline + rust-vim + fugitive + airline + vim-trailing-whitespace + vim-polyglot + nvim-cm-racer + nvim-completion-manager + vim-pandoc + nerdcommenter + vim-signify + ]; + }; + }; +} diff --git a/home-manager/configs/vimrc b/home-manager/nvim/vimrc similarity index 78% rename from home-manager/configs/vimrc rename to home-manager/nvim/vimrc index 15ac16b1..b2273115 100644 --- a/home-manager/configs/vimrc +++ b/home-manager/nvim/vimrc @@ -54,17 +54,5 @@ let g:syntastic_check_on_wq = 0 let g:syntastic_aggregate_errors = 1 let g:syntastic_enable_highlighting = 1 let g:syntastic_loc_list_height = 5 -let g:rustfmt_autosave = 1 -"let g:ycm_rust_src_path = '/usr/src/rust/src' -"let g:ftplugin_rust_source_path = '/usr/src/rust/src' -let g:syntastic_rust_checkers = [ 'cargo'] -let g:rust_recommend_style = 1 -let g:rust_fold =1 -"let g:syntastic_rust_rustc_exe = 'cargo check' - let g:deoplete#enable_at_startup = 1 let g:deoplete#auto_complete_start_length = 1 - -"let g:deoplete#sources#rust#racer_binary='racer' -"let g:rustfmt_command = "rustfmt" -"let g:racer_cmd = "racer" diff --git a/home-manager/packages/jali/default.nix b/home-manager/packages/jali/default.nix index 73274ecd..a1186897 100644 --- a/home-manager/packages/jali/default.nix +++ b/home-manager/packages/jali/default.nix @@ -1,4 +1,4 @@ -{ jinja2, pendulum, GitPython, aqbanking, python36Packages, fetchgit }: +{ aqbanking, python36Packages, fetchgit }: with python36Packages; buildPythonApplication rec { name = "${pname}-${version}"; pname = "jali"; diff --git a/home-manager/graphical/st/config.h b/home-manager/packages/st/config.h similarity index 100% rename from home-manager/graphical/st/config.h rename to home-manager/packages/st/config.h diff --git a/home-manager/graphical/st/default.nix b/home-manager/packages/st/default.nix similarity index 100% rename from home-manager/graphical/st/default.nix rename to home-manager/packages/st/default.nix diff --git a/home-manager/graphical/st/st-alpha-0.7.diff b/home-manager/packages/st/st-alpha-0.7.diff similarity index 100% rename from home-manager/graphical/st/st-alpha-0.7.diff rename to home-manager/packages/st/st-alpha-0.7.diff diff --git a/home-manager/graphical/st/st-externalpipe-0.7.diff b/home-manager/packages/st/st-externalpipe-0.7.diff similarity index 100% rename from home-manager/graphical/st/st-externalpipe-0.7.diff rename to home-manager/packages/st/st-externalpipe-0.7.diff diff --git a/home-manager/Makefile b/home-manager/unused/Makefile similarity index 100% rename from home-manager/Makefile rename to home-manager/unused/Makefile diff --git a/home-manager/dovecot.sieve b/home-manager/unused/dovecot.sieve similarity index 100% rename from home-manager/dovecot.sieve rename to home-manager/unused/dovecot.sieve diff --git a/home-manager/morgenreport.nix b/home-manager/unused/morgenreport.nix similarity index 100% rename from home-manager/morgenreport.nix rename to home-manager/unused/morgenreport.nix diff --git a/home-manager/my-systems.nix b/home-manager/unused/my-systems.nix similarity index 100% rename from home-manager/my-systems.nix rename to home-manager/unused/my-systems.nix diff --git a/home-manager/sort-mail.nix b/home-manager/unused/sort-mail.nix similarity index 100% rename from home-manager/sort-mail.nix rename to home-manager/unused/sort-mail.nix diff --git a/home-manager/update-hm.nix b/home-manager/unused/update-hm.nix similarity index 100% rename from home-manager/update-hm.nix rename to home-manager/unused/update-hm.nix diff --git a/home-manager/zsh/default.nix b/home-manager/zsh/default.nix new file mode 100644 index 00000000..15e373f2 --- /dev/null +++ b/home-manager/zsh/default.nix @@ -0,0 +1,20 @@ +{ + +programs = { + zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + history = { + save = 100000; + size = 100000; + }; + initExtra = builtins.readFile ./zshrc; + oh-my-zsh = { + enable = true; + plugins = [ "colored-man-pages" "git-prompt" ]; + }; + }; +}; + +} diff --git a/home-manager/configs/zshrc b/home-manager/zsh/zshrc similarity index 100% rename from home-manager/configs/zshrc rename to home-manager/zsh/zshrc diff --git a/hosts/apollo/configuration.nix b/hosts/apollo/configuration.nix index 7c29521a..f2e1056d 100644 --- a/hosts/apollo/configuration.nix +++ b/hosts/apollo/configuration.nix @@ -1,10 +1,14 @@ { config, pkgs, ... }: -{ - imports = [ - - ./hardware-configuration.nix - ../../system +let + me = config.m-0.private.me; +in { + +imports = [ + + ./secret + ./hardware-configuration.nix + ../../system ]; networking = { @@ -15,9 +19,7 @@ m-0 = { laptop.enable = true; }; -home-manager.users.maralorn = { - imports = [ ./home.nix ]; -}; +home-manager.users."${me.user}" = (import ./home.nix); # Use the systemd-boot EFI boot loader. boot = { @@ -30,11 +32,20 @@ boot = { cdark_net = { enable = true; - hostName = "maralorn_apollo"; + hostName = "${me.user}_${config.networking.hostName}"; ed25519PrivateKeyFile = /etc/nixos/hosts/apollo/secret/tinc/ed25519_key.priv; hostsDirectory = /etc/nixos/system/modules/cdarknet/hosts; ip6address = "fd23:42:cda:4342::2"; ip4address = "172.20.71.2"; }; +services = { + mpd = { + enable = true; + network.listenAddress = "::0"; + musicDirectory = "/home/maralorn/data/aktuell/media/musik"; + }; +}; + + } diff --git a/hosts/apollo/home.nix b/hosts/apollo/home.nix index bc30d2a1..523b0b3b 100644 --- a/hosts/apollo/home.nix +++ b/hosts/apollo/home.nix @@ -1,108 +1,17 @@ { pkgs, ... }: -let - jali = with pkgs.python36Packages; buildPythonApplication rec { - name = "${pname}-${version}"; - pname = "jali"; - doCheck = false; - version = "1d1c5d0a"; - src = pkgs.fetchgit { - url = "https://git.darmstadt.ccc.de/jali/jali.git"; - rev = version; - sha256 = "1nzzangp7yr2gq66qz7wk2cqqwjlhrfaqmc85qigjv4vpfmlphl0"; - }; - propagatedBuildInputs = with pkgs; [ jinja2 pendulum GitPython aqbanking ]; - }; -in - { - imports = [ - ../../home-manager - ../../home-common/my-systems.nix - ../../home-common/graphical - ../../home-common/latex.nix - ./battery.nix - ./sleep-nag.nix - ]; +imports = [ + ../../home-manager +]; - programs = { - firefox = { - enable = true; - }; - git = { - signing = { - signByDefault = true; - key = "6C3D12CD88CDF46C5EAF4D12226A2D41EF5378C9"; - }; - }; - }; - home.sessionVariables = { - MOZ_USE_XINPUT2 = "1"; - }; +m-0.laptop.enable = true; +m-0.sleep-nag.enable = true; +m-0.battery.enable = true; +m-0.latex.enable = true; +m-0.accounting.enable = true; +m-0.graphical.enable = true; +m-0.rustdev.enable = true; +m-0.taskwarrior.enable = true; - services = { - udiskie = { - enable = true; - notify = true; - }; - }; - - home.packages = with pkgs.gnome3; [ - glade - ] ++ (with pkgs; [ - # web - chromium - signal-desktop - tdesktop - acpi - dino - - rustracer - - arandr - qutebrowser - - mumble - - xorg.xev - xorg.xbacklight - meld - - icedtea8_web - - hledger - haskellPackages.hledger-ui - ledger - jali - - # tools & office - feh - gimp - imagemagick - libreoffice-fresh - pandoc - xournal - musescore - handbrake - octave - - # look & feel - libertine - nerdfonts - dina-font - envypn-font - google-fonts - gnome3.gnome-font-viewer - unscii - xfontsel - - # media - ncmpcpp - pavucontrol - deluge - mpd - gmpc - calibre - mpv - ]); } diff --git a/hosts/apollo/secret/default.nix b/hosts/apollo/secret/default.nix new file mode 100644 index 00000000..744ce81e Binary files /dev/null and b/hosts/apollo/secret/default.nix differ diff --git a/hosts/poseidon/home.nix b/hosts/hephaistos/home.nix similarity index 100% rename from hosts/poseidon/home.nix rename to hosts/hephaistos/home.nix diff --git a/hosts/poseidon/nix-gc.nix b/hosts/hephaistos/nix-gc.nix similarity index 100% rename from hosts/poseidon/nix-gc.nix rename to hosts/hephaistos/nix-gc.nix diff --git a/hosts/poseidon/nix-update-channel.nix b/hosts/hephaistos/nix-update-channel.nix similarity index 100% rename from hosts/poseidon/nix-update-channel.nix rename to hosts/hephaistos/nix-update-channel.nix diff --git a/hosts/poseidon/syncthing.nix b/hosts/hephaistos/syncthing.nix similarity index 100% rename from hosts/poseidon/syncthing.nix rename to hosts/hephaistos/syncthing.nix diff --git a/system/admin.nix b/system/admin.nix index e47beb6b..97c1588d 100644 --- a/system/admin.nix +++ b/system/admin.nix @@ -1,17 +1,18 @@ +{config, ...}: let -in -{ + me = config.m-0.private.me; +in { users.users = { - "${me}" = { + "${me.user}" = { description = "${me.name}"; isNormalUser = true; uid = 1000; extraGroups = [ "wheel" "systemd-journal" "networkmanager" "docker" ]; - openssh.authorizedKeys.keys = keys; + openssh.authorizedKeys.keys = me.keys; passwordFile = "${me.pw-file}"; }; root = { - openssh.authorizedKeys.keys = keys; + openssh.authorizedKeys.keys = me.keys; passwordFile = "${me.pw-file}"; }; }; diff --git a/system/default.nix b/system/default.nix index d6bf02eb..3ee3ce81 100644 --- a/system/default.nix +++ b/system/default.nix @@ -3,11 +3,12 @@ # channel = 18.03 imports = [ - ./secret-option.nix - ./laptop.nix + ./secret + ./modules/private-options.nix + ./modules/laptop.nix ./admin.nix - ./syncthing.nix - ./cdarknet +# ./syncthing.nix + ./modules/cdarknet ]; i18n = { @@ -37,22 +38,9 @@ }; environment = { - systemPackages = with pkgs; [ - git-crypt - git - gnumake - python3 - mkpasswd - rxvt_unicode.terminfo - htop - file - tmux - socat - tcpdump - wget - curl - neovim - ]; + # Put these into an extra file so the essential packages can also be included on non selfadminstrated systems from home-manager + systemPackages = let essentials = import ../system/essentials.nix; + in (essentials.core pkgs) ++ (essentials.extra pkgs); sessionVariables = { TERMINFO = "/run/current-system/sw/share/terminfo"; }; @@ -65,6 +53,5 @@ enableCompletion = true; syntaxHighlighting.enable = true; }; - vim.defaultEditor = true; }; } diff --git a/system/essentials.nix b/system/essentials.nix new file mode 100644 index 00000000..593aadce --- /dev/null +++ b/system/essentials.nix @@ -0,0 +1,33 @@ +{ + core = pkgs: with pkgs; [ + git + gnumake + python3 + mkpasswd + file + wget + curl + (pkgs.neovim.override {vimAlias = true;}) + ]; + extra = pkgs: with pkgs; [ + git-crypt + htop + tree + rxvt_unicode.terminfo + st.terminfo + + socat + nmap + tcpdump + + git-crypt + tmux + tig + exa + fzf + ag + + pythonPackages.qrcode + ranger + ]; +} diff --git a/system/cdarknet/default.nix b/system/modules/cdarknet/default.nix similarity index 100% rename from system/cdarknet/default.nix rename to system/modules/cdarknet/default.nix diff --git a/system/cdarknet/hosts b/system/modules/cdarknet/hosts similarity index 100% rename from system/cdarknet/hosts rename to system/modules/cdarknet/hosts diff --git a/system/cdarknet/nixdark b/system/modules/cdarknet/nixdark similarity index 100% rename from system/cdarknet/nixdark rename to system/modules/cdarknet/nixdark diff --git a/system/laptop.nix b/system/modules/laptop.nix similarity index 100% rename from system/laptop.nix rename to system/modules/laptop.nix diff --git a/system/secret-option.nix b/system/modules/private-options.nix similarity index 79% rename from system/secret-option.nix rename to system/modules/private-options.nix index 5b4bc69b..0cfc5420 100644 --- a/system/secret-option.nix +++ b/system/modules/private-options.nix @@ -2,7 +2,7 @@ with lib; { options = { - m-0.secrets = mkOption { + m-0.private = mkOption { default = {}; type = types.attrs; }; diff --git a/system/server.nix b/system/modules/server.nix similarity index 100% rename from system/server.nix rename to system/modules/server.nix diff --git a/system/secret/default.nix b/system/secret/default.nix index f3c12ad6..a20cc1ef 100644 Binary files a/system/secret/default.nix and b/system/secret/default.nix differ