From 1cde5d109961e0a6d9195c0d3e64e4390c28a970 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Mon, 2 Apr 2018 17:52:16 +0200 Subject: [PATCH] Sorry, badcommit --- .gitmodules | 12 + Makefile | 20 ++ home-common/default.nix | 210 +++++++++++++++++ home-common/graphical/default.nix | 99 ++++++++ home-common/graphical/eventd.nix | 212 ++++++++++++++++++ home-common/graphical/i3.nix | 134 +++++++++++ home-common/graphical/rofi/default.nix | 77 +++++++ home-common/graphical/rofi/tasklauncher.py | 29 +++ home-common/graphical/rofi/zzzfoo | 1 + home-common/graphical/urxvt.nix | 35 +++ {home/snippets => home-common}/latex.nix | 4 +- {home/snippets => home-common}/my-systems.nix | 3 + home-common/taskwarrior.nix | 79 +++++++ {home/snippets => home-common}/update-hm.nix | 0 home/snippets/everywhere.nix | 112 --------- home/snippets/graphical.nix | 107 --------- {home/hosts => homes}/apollo/home.nix | 36 +-- {home/hosts => homes}/charon/habitask.nix | 4 +- {home/hosts => homes}/charon/home.nix | 0 {home/hosts => homes}/charon/morgenreport.nix | 4 +- {home/hosts => homes}/charon/sort-mail.nix | 8 +- {home/hosts => homes}/fb4/home.nix | 0 {home/hosts => homes}/fb4/nix-gc.nix | 0 .../fb4/nix-update-channel.nix | 0 {home/hosts => homes}/fb4/syncthing.nix | 0 {system/snippets => host-common}/admin.nix | 0 {system/snippets => host-common}/common.nix | 5 +- {system/snippets => host-common}/init_ssh.nix | 0 {system/snippets => host-common}/server.nix | 0 .../snippets => host-common}/syncthing.nix | 5 - hosts/apollo/configuration.nix | 70 ++++++ .../apollo/hardware-configuration.nix | 0 .../hosts => hosts}/charon/configuration.nix | 0 {system/hosts => hosts}/charon/dav.nix | 0 .../charon/hardware-configuration.nix | 0 {system/hosts => hosts}/charon/mail.nix | 4 - {system/hosts => hosts}/charon/matrix.nix | 5 +- {system/hosts => hosts}/charon/web.nix | 0 .../modules => modules}/cdarknet/default.nix | 0 modules/cdarknet/hosts | 1 + {system/modules => modules}/cdarknet/nixdark | 0 modules/force-copies.nix | 35 +++ modules/home-options.nix | 21 ++ packages/blezz/default.nix | 18 ++ packages/eventd/default.nix | 38 ++++ packages/tasktree/default.nix | 38 ++++ system/hosts/apollo/configuration.nix | 80 ------- system/modules/cdarknet/hosts | 1 - 48 files changed, 1165 insertions(+), 342 deletions(-) create mode 100644 Makefile create mode 100644 home-common/default.nix create mode 100644 home-common/graphical/default.nix create mode 100644 home-common/graphical/eventd.nix create mode 100644 home-common/graphical/i3.nix create mode 100644 home-common/graphical/rofi/default.nix create mode 100644 home-common/graphical/rofi/tasklauncher.py create mode 160000 home-common/graphical/rofi/zzzfoo create mode 100644 home-common/graphical/urxvt.nix rename {home/snippets => home-common}/latex.nix (87%) rename {home/snippets => home-common}/my-systems.nix (83%) create mode 100644 home-common/taskwarrior.nix rename {home/snippets => home-common}/update-hm.nix (100%) delete mode 100644 home/snippets/everywhere.nix delete mode 100644 home/snippets/graphical.nix rename {home/hosts => homes}/apollo/home.nix (54%) rename {home/hosts => homes}/charon/habitask.nix (76%) rename {home/hosts => homes}/charon/home.nix (100%) rename {home/hosts => homes}/charon/morgenreport.nix (88%) rename {home/hosts => homes}/charon/sort-mail.nix (85%) rename {home/hosts => homes}/fb4/home.nix (100%) rename {home/hosts => homes}/fb4/nix-gc.nix (100%) rename {home/hosts => homes}/fb4/nix-update-channel.nix (100%) rename {home/hosts => homes}/fb4/syncthing.nix (100%) rename {system/snippets => host-common}/admin.nix (100%) rename {system/snippets => host-common}/common.nix (98%) rename {system/snippets => host-common}/init_ssh.nix (100%) rename {system/snippets => host-common}/server.nix (100%) rename {system/snippets => host-common}/syncthing.nix (60%) create mode 100644 hosts/apollo/configuration.nix rename {system/hosts => hosts}/apollo/hardware-configuration.nix (100%) rename {system/hosts => hosts}/charon/configuration.nix (100%) rename {system/hosts => hosts}/charon/dav.nix (100%) rename {system/hosts => hosts}/charon/hardware-configuration.nix (100%) rename {system/hosts => hosts}/charon/mail.nix (95%) rename {system/hosts => hosts}/charon/matrix.nix (91%) rename {system/hosts => hosts}/charon/web.nix (100%) rename {system/modules => modules}/cdarknet/default.nix (100%) create mode 160000 modules/cdarknet/hosts rename {system/modules => modules}/cdarknet/nixdark (100%) create mode 100644 modules/force-copies.nix create mode 100644 modules/home-options.nix create mode 100644 packages/blezz/default.nix create mode 100644 packages/eventd/default.nix create mode 100644 packages/tasktree/default.nix delete mode 100644 system/hosts/apollo/configuration.nix delete mode 160000 system/modules/cdarknet/hosts diff --git a/.gitmodules b/.gitmodules index c7279f52..8f6164a1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,15 @@ [submodule "system/modules/cdarknet/hosts"] path = system/modules/cdarknet/hosts url = git@git.darmstadt.ccc.de:cdark.net/hosts +[submodule "home-common/rofi/zzzfoo"] + path = home-common/rofi/zzzfoo + url = https://github.com/andersju/zzzfoo.git +[submodule "home-common/graphical/rofi/zzzfoo"] + path = home-common/graphical/rofi/zzzfoo + url = https://github.com/andersju/zzzfoo.git +[submodule "modules/cdarknet/hosts"] + path = modules/cdarknet/hosts + url = git@git.darmstadt.ccc.de:cdark.net/hosts +[submodule "modules/cdarknet/nixdark"] + path = modules/cdarknet/nixdark + url = git@git.darmstadt.ccc.de:cdark.net/nixdark diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..d103829b --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +default: all + +all: links config + +links: + ln -sfT data/aktuell/it/config ~/config + ln -sfT data/aktuell/it/config/dotfiles ~/.dotfiles + ln -sfT data/aktuell/it/config/bin ~/bin + ln -sfT ~/data/aktuell/it/config/nixos ~/.config/nixpkgs/config + ln -sfT data/aktuell/it/secrets/password-store ~/.password-store + ln -sfT data/aktuell/it/secrets/gnupg ~/.gnupg + +system-links: + sudo ln -sfT ${HOME}/data/aktuell/it/config/nixos /etc/nixos/config + +config: + rcup rcrc + rcup + mkdir -p ~/.vimhist/bak + touch .chpwd-recent-dirs diff --git a/home-common/default.nix b/home-common/default.nix new file mode 100644 index 00000000..92eabb58 --- /dev/null +++ b/home-common/default.nix @@ -0,0 +1,210 @@ +{ pkgs, ... }: +{ + programs = { + home-manager = { + enable = true; + path = https://github.com/rycee/home-manager/archive/master.tar.gz; + }; + git = { + enable = true; + ignores = [ + ".syncthing*.tmp" + "*.swp" + "*.autosave~" + "*.aux" + "*.bbl" + "*.fls" + "*.idx" + "*.ilg" + "*.ind" + "*.log" + "*.out" + "*.toc" + "*.bcf" + "*.blg" + "*.fdb*" + "*.thm" + "*.run.xml" + "*.slnc" + "*.glade~" + "__pycache__" + ".hledger-web_client_session_key.aes" + ".nix-gc-roots" + ]; + userEmail = "malte.brandy@maralorn.de"; + userName = "Malte Brandy"; + }; + htop = { + enable = true; + hideThreads = true; + hideUserlandThreads = true; + highlightBaseName = true; + shadowOtherUsers = true; + showProgramPath = false; + treeView = true; + }; + ssh = { + controlMaster = "autoask"; + enable = true; + matchBlocks = let + matheGwProxy = "ssh -q gw nc -q0 %h %p"; + kivaHost = "fb04386.mathematik.tu-darmstadt.de"; + agHost = "fb04217.mathematik.tu-darmstadt.de"; + in [ + { host = "charon"; hostname = "charon.olymp.space"; } + { host = "*.olymp.space"; user = "maralorn"; } + { host = "ag-forward"; hostname = agHost; proxyCommand = matheGwProxy; } + { host = "ag"; hostname = agHost; } + { host = "kiva-forward"; hostname = kivaHost; proxyCommand = matheGwProxy; } + { host = "kiva"; hostname = kivaHost; } + { host = "gw"; hostname = "gwres4.mathematik.tu-darmstadt.de"; } + { host = "*.mathematik.tu-darmstadt.de"; user = "brandy"; } + { host = "shells"; hostname = "shells.darmstadt.ccc.de"; } + { host = "vorstand"; hostname = "vorstand.darmstadt.ccc.de"; } + { host = "*.darmstadt.ccc.de"; user = "maralorn"; } + { host = "whisky"; hostname = "whisky.w17.io"; user = "chaos"; } + ]; + }; + zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + history = { + save = 100000; + size = 100000; + }; + initExtra = '' + if [[ -z "$TMUX" ]] { + session=$(tmux ls | grep -v attached | head -1 | cut -f1 -d:) + if [[ -n $session ]] { + exec tmux attach -t $session; + } else { + exec tmux; + } + } + precmd() { + local s=$? c=( $(fc -l -D -1 ) ) + if [[ $launched && "''${c[2]}" != "0:00" ]] { + eventc command $([[ ''${s} == 0 ]] && echo success || echo failure) -d command="\"''${c[3,-1]}\"" -d time="\"''${c[2]}\"" -d host="\"$HOST\"" + } else { + export launched=true; + } + } + + alias c=cdr + alias s='sudo systemctl' + alias u='systemctl --user' + alias m=man + alias t="tmux attach" + alias tn="tmux new-session" + alias w="develop-here" + alias ls=exa + + export BROWSER=qutebrowser + export EDITOR=nvim + export MANPAGER="most -s" + ''; + }; + }; + + systemd.user.startServices = true; + + imports = [ + ./taskwarrior.nix + ../modules/force-copies.nix + ]; + + home.packages = with pkgs; [ + htop + tree + rxvt_unicode.terminfo + most + + socat + nmap + tcpdump + + rcm + tmux + tig + exa + fzf + + pythonPackages.qrcode + ranger + + + (pkgs.neovim.override { + vimAlias = true; + configure = { + customRC = '' + set spell spelllang=de,en + set background=dark + set autoindent + set nosmartindent + set listchars=tab:ยป\ ,trail:.,extends:# + set list + set ts=3 + set number + set scrolloff=5 + set sidescrolloff=5 + set laststatus=2 + set incsearch + set mouse= + set dir=~/.vimhist/ + set backupdir=~/.vimhist/bak + set showcmd + nnoremap :nohlsearch + vnoremap < >gv + nnoremap :nohlsearch + vnoremap < >gv u + nnoremap + nnoremap + nnoremap + nnoremap + nnoremap gT + nnoremap gt + + set colorcolumn=81,121 + hi ColorColumn ctermbg=black + + set winaltkeys=no + set noai + set si + set sw=3 + set pt= + set ignorecase + set wildmenu + set hlsearch + noremap gk + noremap gj + noremap g + noremap g + ''; + packages.myVimPackage = with pkgs.vimPlugins; { + start = [ + deoplete-nvim + vim-nix + vimtex + Syntastic + UltiSnips + airline + rust-vim + deoplete-rust + fugitive + airline + vim-snippets + vim-trailing-whitespace + vim-racer + vim-pandoc + nerdcommenter + ]; + }; + }; + withPython3 = true; + }) + ]; + xdg.enable = true; +} diff --git a/home-common/graphical/default.nix b/home-common/graphical/default.nix new file mode 100644 index 00000000..ef62f138 --- /dev/null +++ b/home-common/graphical/default.nix @@ -0,0 +1,99 @@ +{ pkgs, lib, ... }: +let + tasktree = with pkgs; callPackage ../../packages/tasktree {}; +in { + imports = [ + ./i3.nix + ../../modules/home-options.nix + ]; + common = { + workspaces = [ + "tasks" + "chat" + "mail" + "code" + "research" + "work" + "ccc" + "orga" + "leisure" + "config" + ]; + terminal = "xterm"; + 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; [ + tasktree + ]; + keyboard = { + layout = "de"; + variant = "neo"; + options = [ "altwin:swap_lalt_lwin" ]; + }; + }; + gtk = { + enable = true; + iconTheme = { + name = "Arc"; + package = pkgs.arc-icon-theme; + }; + theme = { + name = "Arc-Dark"; + package = pkgs.arc-theme; + }; + }; + xdg.enable = true; + services = { + compton = { + enable = true; + fade = true; + fadeDelta = 5; + }; + gnome-keyring = { + enable = true; + components = [ + "secrets" + "ssh" + ]; + }; + random-background = { + enable = true; + imageDirectory = "%h/data/aktuell/media/bilder/wallpaper/"; + interval = "15minutes"; + }; + gpg-agent = { + enable = true; + }; + redshift = { + enable = true; + temperature.day = 6500; + latitude = "49.86667"; + longitude = "8.65"; + }; + screen-locker = { + enable = true; + lockCmd = "${pkgs.i3lock}/bin/i3lock -n -f -i ~/data/aktuell/media/bilder/lockscreen.png"; + }; + }; + xsession.enable = true; +} diff --git a/home-common/graphical/eventd.nix b/home-common/graphical/eventd.nix new file mode 100644 index 00000000..37dbbb65 --- /dev/null +++ b/home-common/graphical/eventd.nix @@ -0,0 +1,212 @@ +{ pkgs, lib, config, ... }: +let + eventd-pkgs = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/fe61c3b84e8e81a8ec2bf6b3ed2a0e8652cea190.tar.gz) {}; + eventd = with eventd-pkgs; callPackage ../../packages/eventd {}; + colors = config.common.colors; +in { + home = { + packages = with pkgs; [ + eventd + ]; + }; + systemd.user = { + services = { + eventd = { + Unit = { + Description = "eventd"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + Service = { + Type="notify"; + Sockets="eventd-control.socket eventd.socket"; + ExecStart="${eventd}/bin/eventd --listen systemd"; + ExecReload="${eventd}/bin/eventdctl reload"; + }; + }; + }; + sockets = { + eventd-control = { + Unit = { + Description = "eventd control socket"; + }; + Socket = { + Service = "eventd.service"; + SocketMode = "0600"; + ListenStream = "%t/eventd/private"; + }; + }; + eventd = { + Unit = { + Description = "eventd sockets"; + }; + Socket = { + SocketMode = "0660"; + ListenStream= "%t/eventd/evp"; + }; + }; + }; + }; + xdg = { + configFile = { + "eventd/eventd.conf".text = lib.generators.toINI {} { + "Queue default" = { + Margin = 10; + Spacing = 2; + Limit = 10; + }; + "Queue mode" = { + Anchor = "top"; + Margin = 300; + Limit = 1; + }; + "Queue feedback" = { + Anchor = "top"; + Margin = 450; + Limit = 1; + }; + "Queue workspace" = { + Anchor = "bottom-left"; + Margin = 10; + Limit = 1; + }; + "Queue command" = { + Anchor = "bottom-right"; + Margin = 10; + Spacing = 2; + Limit = 10; + }; + "Queue critical" = { + Anchor = "top"; + Margin = 10; + Spacing = 2; + Limit = 10; + }; + "Queue state" = { + Anchor = "top-left"; + Margin = 10; + Spacing = 2; + Limit = 10; + }; + "Queue music" = { + Anchor = "bottom"; + Margin = 10; + Limit = 1; + }; + Notification = { + Text = "\${message}"; + }; + NotificationBubble = { + Padding = 10; + Radius = 0; + Border = 4; + BorderBlur = 4; + Timeout = 5000; + Colour = colors.background; + }; + NotificationText = { + Font = "Linux Libertine 12"; + Colour = colors.foreground; + }; + }; + "eventd/notification.event".text = lib.generators.toINI {} { + "Event mode *" = { + Actions = "mode"; + }; + "Event notification *" = { + Actions = "notification"; + }; + "Event feedback *" = { + Actions = "feedback"; + }; + "Event workspace *" = { + Actions = "workspace"; + }; + "Event command success" = { + Actions = "command-success"; + }; + "Event command failure" = { + Actions = "command-failure"; + }; + "Event critical *" = { + Actions = "critical"; + }; + "Event state *" = { + Actions = "state"; + }; + }; + "eventd/mode.action".text = lib.generators.toINI {} { + Action = { + Name = "mode"; + }; + Notification = { + }; + NotificationBubble = { + Timeout = 0; + Queue = "mode"; + Padding = 40; + MinWidth = 10; + }; + NotificationText = { + Font = "Linux Libertine 40"; + }; + }; + "eventd/command-success.action".text = lib.generators.toINI {} { + Action = { + Name = "command-success"; + }; + Notification = { + Text="\${command}\\nsucceeded after \${time} @ \${host}"; + }; + NotificationBubble = { + Colour = colors.black; + }; + }; + "eventd/command-failure.action".text = lib.generators.toINI {} { + Action = { + Name = "command-failure"; + }; + Notification = { + Text="\${command}\\nfailed after \${time} @ \${host}"; + }; + NotificationBubble = { + Colour = colors.red; + }; + }; + "eventd/workspace.action".text = lib.generators.toINI {} { + Action = { + Name = "workspace"; + }; + Notification = { + }; + NotificationBubble = { + Queue = "workspace"; + MinWidth = 10; + }; + }; + "eventd/feedback.action".text = lib.generators.toINI {} { + Action = { + Name = "feedback"; + }; + Notification = { + }; + NotificationBubble = { + Timeout = 500; + Queue = "feedback"; + Colour = colors.red; + }; + }; + "eventd/notification.action".text = lib.generators.toINI {} { + Action = { + Name = "notification"; + }; + Notification = { + Text = "\${title}\${message/^/\\n}"; + }; + }; + }; + }; +} diff --git a/home-common/graphical/i3.nix b/home-common/graphical/i3.nix new file mode 100644 index 00000000..2467dca1 --- /dev/null +++ b/home-common/graphical/i3.nix @@ -0,0 +1,134 @@ +{ pkgs, lib, config, ... }: +let + colors = config.common.colors; + workspaces = config.common.workspaces; + terminal = config.common.terminal; + exec = "exec --no-startup-id"; + addMods = oldbindings: builtins.foldl' (newbindings: key: + newbindings // { + "Mod4+${key}" = oldbindings.${key}; + "Mod3+Mod4+${key}" = oldbindings.${key}; + }) + {} + (builtins.attrNames oldbindings); +in { + imports = [ + ./eventd.nix + ./rofi + ./urxvt.nix + ]; + home.packages = [ pkgs.skippy-xd ]; + xsession = { + windowManager.i3 = { + enable = true; + config = { + focus = { + followMouse = false; + forceWrapping = true; + }; + colors = { + focused = { + background = colors.blue; + border = colors.blue; + childBorder = colors.blue; + indicator = colors.green; + text = colors.foreground; + }; + focusedInactive = { + background = colors.background; + border = colors.background; + childBorder = colors.background; + indicator = colors.green; + text = colors.foreground; + }; + unfocused = { + background = colors.background; + border = colors.background; + childBorder = colors.background; + indicator = colors.green; + text = colors.foreground; + }; + urgent = { + background = colors.red; + border = colors.red; + childBorder = colors.red; + indicator = colors.green; + text = colors.foreground; + }; + }; + bars = [ { + mode = "hide"; + colors = { + separator = colors.white; + background = colors.background; + activeWorkspace = { + background = colors.blue; + border = colors.blue; + text = colors.white; + }; + bindingMode = { + background = colors.red; + border = colors.red; + text = colors.white; + }; + focusedWorkspace = { + background = colors.blue; + border = colors.blue; + text = colors.white; + }; + inactiveWorkspace = { + background = colors.background; + border = colors.background; + text = colors.white; + }; + }; + } ]; + window = { + titlebar = false; + border = 1; + }; + gaps = { + inner = 0; + outer = 0; + smartBorders = "off"; + smartGaps = false; + }; + keybindings = addMods ({ + "Left" = "focus left"; + "Down" = "focus down"; + "Up" = "focus up"; + "Right" = "focus right"; + "Tab" = "${exec} rofi -show window"; + "w" = "${exec} skippy-xd"; + "Prior" = "focus parent"; + "Next" = "focus child"; + "Ctrl+Escape" = "${exec} loginctl lock-session;"; + "Return" = "${exec} ${terminal}"; + "p" = "${exec} rofi-pass"; + "r" = "${exec} rofi -show combi"; + "o" = "${exec} rofi -show web"; + "n" = "${exec} rofi -show ssh"; + "a" = "${exec} tasklauncher"; + "shift+Left" = "move left"; + "shift+Down" = "move down"; + "shift+Up" = "move up"; + "shift+Right" = "move right"; + "d" = "split h"; + "f" = "fullscreen toggle"; + "t" = "layout tabbed"; + "s" = "layout toggle split"; + "q" = "kill"; + "shift+space" = "floating toggle"; + "shift+q" = "exec i3-nagbar -t warning -m 'do you want to exit i3?' -b 'yes' 'i3-msg exit'"; + } // builtins.foldl' (bindings: name: let + number = toString ((builtins.length (builtins.attrNames bindings)) / 2); + in + bindings // { + "${number}" = "workspace ${number}:${name}"; + "Shift+${number}" = "move container to workspace ${number}:${name}"; + }) {} workspaces + ); + }; + }; + }; +} diff --git a/home-common/graphical/rofi/default.nix b/home-common/graphical/rofi/default.nix new file mode 100644 index 00000000..12b3911b --- /dev/null +++ b/home-common/graphical/rofi/default.nix @@ -0,0 +1,77 @@ +{ 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,web:rofi-script-web,i3:rofi-script-i3 + rofi.sidebar-mode: true + rofi.combi-modi: window,drun,run + ''; + separator = "solid"; + terminal = terminal; + location = "left"; + scrollbar = false; + width = 1500; + yoffset = -10; + lines = 35; + colors = { + window = { + background = 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; + }; + }; + }; + }; + }; + }; +} diff --git a/home-common/graphical/rofi/tasklauncher.py b/home-common/graphical/rofi/tasklauncher.py new file mode 100644 index 00000000..a8e2b3db --- /dev/null +++ b/home-common/graphical/rofi/tasklauncher.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +import subprocess +import os +import sys + +def call_task(args): + return subprocess.Popen(["task", "rc.verbose=nothing"] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].strip() + +runtime_dir = os.getenv("XDG_RUNTIME_DIR") +if not os.path.exists(runtime_dir): + os.makedirs(runtime_dir) +filename = os.path.join(runtime_dir, "taskfilter") +if not os.path.exists(filename): + with open(filename, 'w') as filterfile: + filterfile.write("inboxall") + +lastresult = "" +while True: + with open(filename) as filterfile: + filter = filterfile.read().strip() + tasklist = call_task(["default"] + filter.split()) + rofi_list_cmd = ['rofi', '-dmenu', '-p', 'task: ', '-mesg', '\n'.join([lastresult, "filter: {}".format(filter)]).strip()] + rofi = subprocess.Popen(rofi_list_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + entered_command = rofi.communicate(input=tasklist)[0].decode('utf8').strip() + if entered_command == "": + sys.exit(0) + task_result = subprocess.Popen(["task"] + entered_command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + lastresult = '\n'.join([task_result[0].decode('utf8'), task_result[1].decode('utf8')]).strip() diff --git a/home-common/graphical/rofi/zzzfoo b/home-common/graphical/rofi/zzzfoo new file mode 160000 index 00000000..4800c1c6 --- /dev/null +++ b/home-common/graphical/rofi/zzzfoo @@ -0,0 +1 @@ +Subproject commit 4800c1c645b24ef7b7638f2a31f45826b8fc2973 diff --git a/home-common/graphical/urxvt.nix b/home-common/graphical/urxvt.nix new file mode 100644 index 00000000..f66e9e4c --- /dev/null +++ b/home-common/graphical/urxvt.nix @@ -0,0 +1,35 @@ +{ pkgs, lib, config, ... }: +let + colors = config.common.colors; +in { + home = { + packages = with pkgs; [ + rxvt_unicode-with-plugins + ]; + }; + xresources.properties = { + "*transparent" = true; + "*tintColor" = colors.background; + "*scrollBar" = false; + "*urgentOnBell" = true; + "*background" = colors.background; + "*foreground" = colors.foreground; + "*color0" = colors.black; + "*color8" = colors.brightBlack; + "*color1" = colors.red; + "*color9" = colors.brightRed; + "*color2" = colors.green; + "*color10" = colors.brightGreen; + "*color3" = colors.yellow; + "*color11" = colors.brightYellow; + "*color4" = colors.blue; + "*color12" = colors.brightBlue; + "*color5" = colors.magenta; + "*color13" = colors.brightMagenta; + "*color6" = colors.cyan; + "*color14" = colors.brightCyan; + "*color7" = colors.white; + "*color15" = colors.brightWhite; + "*boldFont" = ""; + }; +} diff --git a/home/snippets/latex.nix b/home-common/latex.nix similarity index 87% rename from home/snippets/latex.nix rename to home-common/latex.nix index 2288dfef..51fb6207 100644 --- a/home/snippets/latex.nix +++ b/home-common/latex.nix @@ -9,12 +9,12 @@ collection-latexextra collection-bibtexextra collection-luatex - collection-mathscience + # collection-math collection-fontsextra; }; }; }; home.packages = [ - pgks.biber + pkgs.biber ]; } diff --git a/home/snippets/my-systems.nix b/home-common/my-systems.nix similarity index 83% rename from home/snippets/my-systems.nix rename to home-common/my-systems.nix index 09ac0daf..d5c28857 100644 --- a/home/snippets/my-systems.nix +++ b/home-common/my-systems.nix @@ -7,5 +7,8 @@ sshuttle mtr youtubeDL + + cargo + rustfmt ]; } diff --git a/home-common/taskwarrior.nix b/home-common/taskwarrior.nix new file mode 100644 index 00000000..5636d609 --- /dev/null +++ b/home-common/taskwarrior.nix @@ -0,0 +1,79 @@ +{ pkgs, lib, ... }: +{ + home = { + packages = with pkgs; [ taskwarrior ]; + file = { + taskwarrior-on-add-hook = { + target = ".task/hooks/on-add.eventd-notification"; + text = '' + #!${pkgs.python3}/bin/python + import sys + import json + import subprocess + + input_string = sys.stdin.readline() + original = json.loads(input_string) + command = ['eventc', 'task', 'add'] + for name, value in original.items(): + command.append("-d") + if type(value) == list: + value = ', '.join(value) + command.append(name+"='"+value+"'") + subprocess.Popen(command) + print(input_string) + ''; + executable = true; + }; + taskwarrior-on-modify-hook = { + target = ".task/hooks/on-modify.eventd-notification"; + text = '' + #!${pkgs.python3}/bin/python + import sys + import json + import subprocess + + input_string = sys.stdin.readline() + original = json.loads(input_string) + input_string = sys.stdin.readline() + new = json.loads(input_string) + command = ['eventc', 'task', 'modify'] + for name in set(new.keys()).union(set(original.keys())): + if new.get(name) != original.get(name) or name == "description": + value = new.get(name, "") + command.append("-d") + if type(value) == list: + value = ', '.join(value) + command.append(name+"='"+value+"'") + subprocess.Popen(command) + print(input_string) + ''; + executable = true; + }; + }; + }; + xdg = let + taskAction = name: template: { + "eventd/task-${name}.action".text = lib.generators.toINI {} { + Action = { + Name = "task-${name}"; + }; + Notification = { + Text = template; + }; + }; + }; + in { + configFile = { + "eventd/task.event".text = lib.generators.toINI {} { + "Event task add" = { + Actions = "task-new"; + }; + "Event task modify" = { + Actions = "task-changed"; + }; + }; + } // + 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/snippets/update-hm.nix b/home-common/update-hm.nix similarity index 100% rename from home/snippets/update-hm.nix rename to home-common/update-hm.nix diff --git a/home/snippets/everywhere.nix b/home/snippets/everywhere.nix deleted file mode 100644 index fde7e0f8..00000000 --- a/home/snippets/everywhere.nix +++ /dev/null @@ -1,112 +0,0 @@ -{ pkgs, ... }: -{ - programs.home-manager = { - enable = true; - path = https://github.com/rycee/home-manager/archive/release-17.09.tar.gz; - }; - systemd.user.startServices = true; - - imports = [ -# ./update-hm.nix - ]; - - home.packages = with pkgs; [ - htop - tree - rxvt_unicode.terminfo - - socat - nmap - tcpdump - - rcm - tmux - tig - exa - - neovim - taskwarrior - - vimPlugins.vundle - vimPlugins.deoplete-nvim - vimPlugins.vim-nix - pythonPackages.qrcode - ranger - ]; - programs = { - git = { - enable = true; - ignores = [ - ".syncthing*.tmp" - "*.swp" - "*.autosave~" - "*.aux" - "*.bbl" - "*.fls" - "*.idx" - "*.ilg" - "*.ind" - "*.log" - "*.out" - "*.toc" - "*.bcf" - "*.blg" - "*.fdb*" - "*.thm" - "*.run.xml" - "*.slnc" - "*.glade~" - "__pycache__" - ".hledger-web_client_session_key.aes" - ".nix-gc-roots" - ]; - signing = { - signByDefault = true; - }; - userEmail = "malte.brandy@maralorn.de"; - userName = "Malte Brandy"; - }; - htop.enable = true; - neovim = { - enable = true; - configure = { - }; - }; - rofi = { - enable = true; - }; - ssh = { - controlPath = true; - enable = true; - matchBlocks = let - matheGwProxy = "ssh -q gw nc -q0 %h %p"; - kivaHost = "fb04386.mathematik.tu-darmstadt.de"; - agHost = "fb04217.mathematik.tu-darmstadt.de"; - in [ - { host = "charon"; hostname = "charon.olymp.space"; } - { host = "*.olymp.space"; user = "maralorn"; } - { host = "ag-forward"; hostname = agHost; proxyCommand = matheGwProxy; } - { host = "ag"; hostname = agHost; } - { host = "kiva-forward"; hostname = kivaHost; proxyCommand = matheGwProxy; } - { host = "kiva"; hostname = kivaHost; } - { host = "gw"; hostname = "gwres4.mathematik.tu-darmstadt.de"; } - { host = "*.mathematik.tu-darmstadt.de"; user = "brandy"; } - { host = "shells"; hostname = "shells.darmstadt.ccc.de"; } - { host = "vorstand"; hostname = "vorstand.darmstadt.ccc.de"; } - { host = "*.darmstadt.ccc.de"; user = "maralorn"; } - { host = "whisky"; hostname = "whisky.w17.io"; user = "chaos"; } - ]; - }; - zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - history = { - path = "~/.zsh_history"; - save = 100000; - size = 100000; - }; - }; - xdg.enable = true; - }; -} diff --git a/home/snippets/graphical.nix b/home/snippets/graphical.nix deleted file mode 100644 index e3533882..00000000 --- a/home/snippets/graphical.nix +++ /dev/null @@ -1,107 +0,0 @@ -with import {}; -{ pkgs, ... }: -let - desktopItem = makeDesktopItem { - name = "Tasktree"; - exec = "tasktree"; - icon = "tasktree"; - comment = "A taskwarrior UI"; - desktopName = "Tasktree"; - genericName = "Tasktree"; - categories = "Office;"; - }; - tasktree = with pkgs; with rustPlatform; buildRustPackage rec { - name = "tasktree"; - version = "abb312f"; - src = fetchFromGitHub { - rev = version; - owner = "maralorn"; - repo = "tasktree"; - sha256 = "139xjvi7b62k3075b4md9hdkb1xafhhiyz2yhbb96d73j1gkqs77"; - }; - depsSha256 = "1iw9n1bj7h1v6nz2m3y6045qjavvim3hk5cli3y8x2zakmx88mia"; - cargoSha256 = "1iw9n1bj7h1v6nz2m3y6045qjavvim3hk5cli3y8x2zakmx88mia"; - - propagatedBuildInputs = [ gnome3.gtk atk cairo gdk_pixbuf glib pango ]; - postInstall = '' - function installIcon () { - mkdir -p $out/share/icons/hicolor/$1/apps/ - cp icons/$1.png $out/share/icons/hicolor/$1/apps/tasktree.png - } - installIcon "16x16" - installIcon "32x32" - installIcon "64x64" - - mkdir -p $out/share/applications - ln -s ${desktopItem}/share/applications/* $out/share/applications/ - ''; - }; -in { - home = { - packages = with pkgs; [ - vimPlugins.vimtex - redshift - python27Packages.syncthing-gtk - rxvt_unicode - tasktree - tilda - ]; - keyboard = { - layout = "de"; - variant = "neo"; - }; - }; - gtk = { - enable = true; - iconeTheme = { - name = "Arc"; - package = "arc-icon-theme"; - }; - theme = { - name = "Arc"; - packages = "arc-theme"; - }; - }; - service = { - compton = { - enable = true; - fade = true; - shadow = true; - }; - dunst = { - enable = true; - }; - gnome-keyring = { - enable = true; - components = [ - "secrets" - "ssh" - ]; - }; - gpg-agent = { - enable = true; - }; - network-manager-applet.enable = true; - redshift = { - enable = true; - temperature.day = 6500; - latitude = 49.86667; - longitude = 8.65; - }; - screen-locker = { - enable = true; - lockCmd = "${pkgs.i3lock}/bin/i3lock"; - }; - }; - xsession = { - enable = true; - windowManager.i3 = { - enable = true; - gaps = { - inner = 3; - outer = 6; - smartBorders = "on"; - }; - }; - }; -} diff --git a/home/hosts/apollo/home.nix b/homes/apollo/home.nix similarity index 54% rename from home/hosts/apollo/home.nix rename to homes/apollo/home.nix index 3735a0f7..d21fa436 100644 --- a/home/hosts/apollo/home.nix +++ b/homes/apollo/home.nix @@ -1,19 +1,22 @@ { pkgs, ... }: -let - unstable = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz) {}; -in { +{ imports = [ - ../../snippets/everywhere.nix - ../../snippets/my-systems.nix - ../../snippets/graphical.nix - ../../snippets/latex.nix + ../../home-common + ../../home-common/my-systems.nix + ../../home-common/graphical + ../../home-common/latex.nix ]; programs = { firefox = { enable = true; - package = unstable.firefox; + }; + git = { + signing = { + signByDefault = true; + key = "6C3D12CD88CDF46C5EAF4D12226A2D41EF5378C9"; + }; }; }; @@ -21,13 +24,18 @@ in { udiskie = { enable = true; notify = true; - tray = "auto"; }; }; - home.packages = with pkgs; [ + home.packages = with pkgs.gnome3; [ + glade + ] ++ (with pkgs; [ # web chromium + acpi + + arandr + qutebrowser # tools & office gimp @@ -39,10 +47,6 @@ in { handbrake octave - # dev - rustup - gnome3.glade - # look & feel libertine nerdfonts @@ -54,6 +58,6 @@ in { mpd gmpc calibre - gnome-mpv - ]; + mpv + ]); } diff --git a/home/hosts/charon/habitask.nix b/homes/charon/habitask.nix similarity index 76% rename from home/hosts/charon/habitask.nix rename to homes/charon/habitask.nix index 010f2df9..7c63b876 100644 --- a/home/hosts/charon/habitask.nix +++ b/homes/charon/habitask.nix @@ -1,6 +1,6 @@ +{ pkgs, ... }: let - unstable = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz) {}; - habitask = with unstable; with rustPlatform; buildRustPackage rec { + habitask = with pkgs; with rustPlatform; buildRustPackage rec { name = "habitask"; version = "0.1.0"; src = ~/data/aktuell/it/code/habitask; diff --git a/home/hosts/charon/home.nix b/homes/charon/home.nix similarity index 100% rename from home/hosts/charon/home.nix rename to homes/charon/home.nix diff --git a/home/hosts/charon/morgenreport.nix b/homes/charon/morgenreport.nix similarity index 88% rename from home/hosts/charon/morgenreport.nix rename to homes/charon/morgenreport.nix index 3d0cd5e8..f29a1af7 100644 --- a/home/hosts/charon/morgenreport.nix +++ b/homes/charon/morgenreport.nix @@ -1,7 +1,5 @@ { pkgs, ... }: -let - unstable = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz) {}; -in { +{ systemd.user = { services.morgenreport = let diff --git a/home/hosts/charon/sort-mail.nix b/homes/charon/sort-mail.nix similarity index 85% rename from home/hosts/charon/sort-mail.nix rename to homes/charon/sort-mail.nix index 1e8c48c6..bd24e7b5 100644 --- a/home/hosts/charon/sort-mail.nix +++ b/homes/charon/sort-mail.nix @@ -1,12 +1,10 @@ { pkgs, ... }: -let - unstable = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz) {}; -in { +{ systemd.user = { services.sort-mail = let sort-mail-script = pkgs.writeShellScriptBin "sort-mail" '' - ${unstable.isync}/bin/mbsync -a + ${pkgs.isync}/bin/mbsync -a mv $HOME/data/aktuell/it/mail/.Move.kiva/cur/* $HOME/data/aktuell/it/mail-accounts/fb4/INBOX/new/ mv $HOME/data/aktuell/it/mail/.Move.Auslandskoordination/cur/* $HOME/data/aktuell/it/mail-accounts/auslandskoordination/Malte/bearbeiten/new/ @@ -17,7 +15,7 @@ in { mv $HOME/data/aktuell/it/mail-accounts/auslandskoordination/Malte/privat/cur/* $HOME/data/aktuell/it/mail/new/ mv $HOME/data/aktuell/it/mail-accounts/auslandskoordination/Malte/kiva/cur/* $HOME/data/aktuell/it/mail-accounts/fb4/INBOX/new/ - ${unstable.isync}/bin/mbsync -a + ${pkgs.isync}/bin/mbsync -a ''; in { Unit = { diff --git a/home/hosts/fb4/home.nix b/homes/fb4/home.nix similarity index 100% rename from home/hosts/fb4/home.nix rename to homes/fb4/home.nix diff --git a/home/hosts/fb4/nix-gc.nix b/homes/fb4/nix-gc.nix similarity index 100% rename from home/hosts/fb4/nix-gc.nix rename to homes/fb4/nix-gc.nix diff --git a/home/hosts/fb4/nix-update-channel.nix b/homes/fb4/nix-update-channel.nix similarity index 100% rename from home/hosts/fb4/nix-update-channel.nix rename to homes/fb4/nix-update-channel.nix diff --git a/home/hosts/fb4/syncthing.nix b/homes/fb4/syncthing.nix similarity index 100% rename from home/hosts/fb4/syncthing.nix rename to homes/fb4/syncthing.nix diff --git a/system/snippets/admin.nix b/host-common/admin.nix similarity index 100% rename from system/snippets/admin.nix rename to host-common/admin.nix diff --git a/system/snippets/common.nix b/host-common/common.nix similarity index 98% rename from system/snippets/common.nix rename to host-common/common.nix index f06f927e..bc504449 100644 --- a/system/snippets/common.nix +++ b/host-common/common.nix @@ -1,10 +1,13 @@ { pkgs, ... }: { + # channel = 18.03 + imports = [ ./admin.nix ./syncthing.nix ]; + i18n = { defaultLocale = "en_US.UTF-8"; }; @@ -18,8 +21,8 @@ automatic = true; options = "--delete-older-than 5d"; }; - optimise.automatic = true; package = pkgs.nixUnstable; + optimise.automatic = true; }; system.autoUpgrade.enable = true; system.autoUpgrade.dates = "22:00"; diff --git a/system/snippets/init_ssh.nix b/host-common/init_ssh.nix similarity index 100% rename from system/snippets/init_ssh.nix rename to host-common/init_ssh.nix diff --git a/system/snippets/server.nix b/host-common/server.nix similarity index 100% rename from system/snippets/server.nix rename to host-common/server.nix diff --git a/system/snippets/syncthing.nix b/host-common/syncthing.nix similarity index 60% rename from system/snippets/syncthing.nix rename to host-common/syncthing.nix index 3410336f..7a1b0b62 100644 --- a/system/snippets/syncthing.nix +++ b/host-common/syncthing.nix @@ -1,6 +1,3 @@ -let - unstable = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz) {}; -in { boot.kernel.sysctl = { "fs.inotify.max_user_watches" = 204800; }; services = { @@ -10,8 +7,6 @@ in group = "users"; user = "maralorn"; openDefaultPorts = true; - useInotify = true; - package = unstable.syncthing; }; }; } diff --git a/hosts/apollo/configuration.nix b/hosts/apollo/configuration.nix new file mode 100644 index 00000000..f61ee757 --- /dev/null +++ b/hosts/apollo/configuration.nix @@ -0,0 +1,70 @@ +{ config, pkgs, ... }: +{ + +networking = { + hostName = "apollo"; + networkmanager.enable = true; + hostId = "38d29f92"; +}; + +i18n.consoleKeyMap = "neo"; + +imports = [ + ./hardware-configuration.nix + ../../modules/cdarknet + ../../host-common/common.nix +]; + +# Use the systemd-boot EFI boot loader. +boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + supportedFilesystems = [ "exfat" ]; +}; + +security.rngd.enable = true; + +cdark_net = { + enable = true; + hostName = "maralorn_apollo"; + ed25519PrivateKeyFile = /etc/nixos/local/tinc/ed25519_key.priv; + hostsDirectory = /etc/nixos/config/modules/cdarknet/hosts; + ip6address = "fd23:42:cda:4342::2"; + ip4address = "172.20.71.2"; +}; + + +hardware.pulseaudio.enable = true; +services = { +# printing = { +# enable = true; +# drivers = [pkgs.hplip]; +# }; +# gnome3 = { +# gnome-keyring.enable = true; +# evolution-data-server.enable = true; +# gnome-disks.enable = true; +# }; + xserver = { + enable = true; + layout = "de"; + xkbVariant = "neo"; + libinput.enable = true; + desktopManager.gnome3.enable = true; + displayManager.auto = { + enable = true; + user = "maralorn"; + }; + config = '' + Section "InputClass" + Identifier "Enable libinput for TrackPoint" + MatchIsPointer "on" + Driver "libinput" + EndSection + ''; + }; +}; +#virtualisation.docker.enable = true; +} diff --git a/system/hosts/apollo/hardware-configuration.nix b/hosts/apollo/hardware-configuration.nix similarity index 100% rename from system/hosts/apollo/hardware-configuration.nix rename to hosts/apollo/hardware-configuration.nix diff --git a/system/hosts/charon/configuration.nix b/hosts/charon/configuration.nix similarity index 100% rename from system/hosts/charon/configuration.nix rename to hosts/charon/configuration.nix diff --git a/system/hosts/charon/dav.nix b/hosts/charon/dav.nix similarity index 100% rename from system/hosts/charon/dav.nix rename to hosts/charon/dav.nix diff --git a/system/hosts/charon/hardware-configuration.nix b/hosts/charon/hardware-configuration.nix similarity index 100% rename from system/hosts/charon/hardware-configuration.nix rename to hosts/charon/hardware-configuration.nix diff --git a/system/hosts/charon/mail.nix b/hosts/charon/mail.nix similarity index 95% rename from system/hosts/charon/mail.nix rename to hosts/charon/mail.nix index 97d87137..216171eb 100644 --- a/system/hosts/charon/mail.nix +++ b/hosts/charon/mail.nix @@ -1,8 +1,4 @@ { config, pkgs, ... }: - -let - unstable = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz) {}; -in { networking.firewall.allowedTCPPorts = [ 25 587 443 993 ]; diff --git a/system/hosts/charon/matrix.nix b/hosts/charon/matrix.nix similarity index 91% rename from system/hosts/charon/matrix.nix rename to hosts/charon/matrix.nix index d8343906..81b238b6 100644 --- a/system/hosts/charon/matrix.nix +++ b/hosts/charon/matrix.nix @@ -1,8 +1,5 @@ { config, pkgs, ... }: -let - unstable = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/f022cc679486ec5f21a13dab9a336ba1f5543910.tar.gz) {}; -in { networking.firewall.allowedTCPPorts = [ 8448 ]; @@ -52,7 +49,7 @@ in # Synapse matrix-synapse = { enable = true; - package = unstable.matrix-synapse; + package = pkgs.matrix-synapse; server_name = "maralorn.de"; database_type = "psycopg2"; max_upload_size = "30M"; diff --git a/system/hosts/charon/web.nix b/hosts/charon/web.nix similarity index 100% rename from system/hosts/charon/web.nix rename to hosts/charon/web.nix diff --git a/system/modules/cdarknet/default.nix b/modules/cdarknet/default.nix similarity index 100% rename from system/modules/cdarknet/default.nix rename to modules/cdarknet/default.nix diff --git a/modules/cdarknet/hosts b/modules/cdarknet/hosts new file mode 160000 index 00000000..6a05b795 --- /dev/null +++ b/modules/cdarknet/hosts @@ -0,0 +1 @@ +Subproject commit 6a05b795d7333f23212427501c6d9dfbe1b73170 diff --git a/system/modules/cdarknet/nixdark b/modules/cdarknet/nixdark similarity index 100% rename from system/modules/cdarknet/nixdark rename to modules/cdarknet/nixdark diff --git a/modules/force-copies.nix b/modules/force-copies.nix new file mode 100644 index 00000000..bbd1cec1 --- /dev/null +++ b/modules/force-copies.nix @@ -0,0 +1,35 @@ +{ lib, config, ... }: +let + paths = config.home.forceCopies.paths; + disableCollisionCheck = path: '' + if [[ -a $HOME/${path} ]]; then + echo "Removing $HOME/${path}" because it is probably from a previous generation. + rm -f $HOME/${path} + fi + ''; + copyPath = path: '' + canonical=`readlink -f $newGenPath/home-files/${path}` + if [[ ! -a $canonical ]]; then + echo "File $newGenPath/home-files/${path} does not exist." + exit 1 + fi + if [[ ! -a $HOME/${path} ]]; then + echo "There is no file at $HOME/${path} this is weird." + exit 1 + fi + echo "Overwriting $HOME/${path}" + cp --remove-destination -T $canonical $HOME/${path}; + ''; +in with lib; +{ + options.home.forceCopies.paths = mkOption { + default = []; + type = types.listOf types.str; + }; + config.home.activation = { + deleteForcedCopies = config.lib.dag.entryBefore ["checkLinkTargets"] + (builtins.concatStringsSep "\n" (builtins.map disableCollisionCheck paths)); + forceCopies = config.lib.dag.entryAfter ["linkGeneration"] + (builtins.concatStringsSep "\n" (builtins.map copyPath paths)); + }; +} diff --git a/modules/home-options.nix b/modules/home-options.nix new file mode 100644 index 00000000..27b84e3d --- /dev/null +++ b/modules/home-options.nix @@ -0,0 +1,21 @@ +{ 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; + }; + }; + }; +} diff --git a/packages/blezz/default.nix b/packages/blezz/default.nix new file mode 100644 index 00000000..4d1cc8c9 --- /dev/null +++ b/packages/blezz/default.nix @@ -0,0 +1,18 @@ +{ fetchFromGitHub, stdenv, libxcb, xcbutil, xcbutilwm }: +stdenv.mkDerivation rec { + name = "blezz"; + version = "8643772"; + src = fetchFromGitHub { + owner = "Blezzing"; + repo = "blezz"; + rev = version; + sha256 = "0kgbzkx49018wxli4agf2vwyq9lnin1qvh1hs6wr59384hmvrbnv"; + }; + buildInputs = [ libxcb xcbutil xcbutilwm ]; + patchPhase = '' + grep -v /usr/lib makefile > makefile1 + mv makefile1 makefile + sed s,/usr/bin/,$prefix/usr/bin/, -i makefile + mkdir -p $prefix/usr/bin + ''; +} diff --git a/packages/eventd/default.nix b/packages/eventd/default.nix new file mode 100644 index 00000000..0a16adcb --- /dev/null +++ b/packages/eventd/default.nix @@ -0,0 +1,38 @@ +{ fetchFromGitHub, stdenv, ninja, meson, pkgconfig, glib, cairo, gdk_pixbuf, glib_networking, pango, libudev, xorg, libxslt, docbook_xml_xslt, git, libuuid, dbus, libsoup, docbook_xml_dtd_45, docbook5_xsl, gettext, autoconf, libtool, utillinux, libxkbcommon }: +stdenv.mkDerivation rec { + name = "eventd"; + version = "279d3c3"; + src = fetchFromGitHub { + owner = "sardemff7"; + repo = "eventd"; + rev = version; + sha256 = "162gr3agmjn6d0wdj3lixv8qfvgfm9qg3wphbvwywdp4qcwvnjz8"; + fetchSubmodules = true; + }; + patchPhase = '' + sed s/0.44.1/0.43.0/ -i meson.build + ''; + buildInputs = [ + ninja + meson + pkgconfig + glib + cairo + gdk_pixbuf + glib_networking + pango + libudev + xorg.libxcb + xorg.xcbutil + xorg.xcbutilwm + libxkbcommon + libxslt + docbook_xml_xslt + docbook_xml_dtd_45 + libuuid + dbus + ]; + preConfigure = '' + export mesonFlags="-Denable-systemd=true -Denable-introspection=false -Denable-nd-wayland=false -Denable-im=false -Denable-sound=false -Ddbussessionservicedir=$prefix/share/dbus-1/services -Dsystemduserunitdir=$prefix/lib/systemd/user -Dsystemdsystemunitdir=$prefix/lib/systemd/system" + ''; +} diff --git a/packages/tasktree/default.nix b/packages/tasktree/default.nix new file mode 100644 index 00000000..7a77d925 --- /dev/null +++ b/packages/tasktree/default.nix @@ -0,0 +1,38 @@ +{ rustPlatform, gnome3, atk, cairo, gdk_pixbuf, glib, pango, makeDesktopItem, fetchFromGitHub }: +let + desktopItem = makeDesktopItem { + name = "Tasktree"; + exec = "tasktree"; + icon = "tasktree"; + comment = "A taskwarrior UI"; + desktopName = "Tasktree"; + genericName = "Tasktree"; + categories = "Office;"; + }; +in +with rustPlatform; buildRustPackage rec { + name = "tasktree"; + version = "abb312f"; + src = fetchFromGitHub { + rev = version; + owner = "maralorn"; + repo = "tasktree"; + sha256 = "139xjvi7b62k3075b4md9hdkb1xafhhiyz2yhbb96d73j1gkqs77"; + }; + depsSha256 = "14acvigygrrqyvxra2n01vpadc3mcf8981jrggpvwfbz58jrsa7h"; + cargoSha256 = "14acvigygrrqyvxra2n01vpadc3mcf8981jrggpvwfbz58jrsa7h"; + + propagatedBuildInputs = [ gnome3.gtk atk cairo gdk_pixbuf glib pango ]; + postInstall = '' + function installIcon () { + mkdir -p $out/share/icons/hicolor/$1/apps/ + cp icons/$1.png $out/share/icons/hicolor/$1/apps/tasktree.png + } + installIcon "16x16" + installIcon "32x32" + installIcon "64x64" + + mkdir -p $out/share/applications + ln -s ${desktopItem}/share/applications/* $out/share/applications/ + ''; +} diff --git a/system/hosts/apollo/configuration.nix b/system/hosts/apollo/configuration.nix deleted file mode 100644 index 79b30462..00000000 --- a/system/hosts/apollo/configuration.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ config, pkgs, ... }: -{ - -networking = { - hostName = "apollo"; - networkmanager.enable = true; - hostId = "38d29f92"; -}; - -i18n.consoleKeyMap = "neo"; - -imports = [ - ./hardware-configuration.nix - ../../modules/cdarknet - ../../snippets/common.nix -]; - -# Use the systemd-boot EFI boot loader. -boot = { - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - supportedFilesystems = [ "zfs" "exfat" ]; -}; - -environment.systemPackages = with pkgs; [ - zfstools - gnome3.caribou - xournal -]; - -security.rngd.enable = true; - -programs.gnupg.agent = { - enable = true; -}; - -cdark_net = { - enable = true; - hostName = "maralorn_apollo"; - ed25519PrivateKeyFile = /etc/nixos/local/tinc/ed25519_key.priv; - hostsDirectory = /etc/nixos/config/modules/cdarknet/hosts; - ip6address = "fd23:42:cda:4342::2"; - ip4address = "172.20.71.2"; -}; - - -services = { - printing = { - enable = true; - drivers = [pkgs.hplip]; - }; - xserver = { - enable = true; - layout = "de"; - xkbVariant = "neo"; - #desktopManager.gnome3.enable = true; - #windowManager.i3.enable = true; - # displayManager.gdm = { - # autoLogin = { - # delay = 3; - # enable = true; - # user = "maralorn"; - # }; - # wayland = false; - # enable = true; - # }; - libinput.enable = true; - config = '' - Section "InputClass" - Identifier "Enable libinput for TrackPoint" - MatchIsPointer "on" - Driver "libinput" - EndSection - ''; - }; -}; -#virtualisation.docker.enable = true; -} diff --git a/system/modules/cdarknet/hosts b/system/modules/cdarknet/hosts deleted file mode 160000 index 2bc5760b..00000000 --- a/system/modules/cdarknet/hosts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2bc5760b0c12502073a26314156e5afc1a6800a0