Compare commits

..

7 commits

69 changed files with 1334 additions and 1957 deletions

View file

@ -471,6 +471,28 @@
"type": "github"
}
},
"kmonad": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "nix",
"lastModified": 1673185501,
"narHash": "sha256-uEtWPpl9nH7QqochHo1z+giPga1zXR1Ko3dOXHIapFY=",
"owner": "kmonad",
"repo": "kmonad",
"rev": "3413f1be996142c8ef4f36e246776a6df7175979",
"type": "github"
},
"original": {
"dir": "nix",
"owner": "kmonad",
"repo": "kmonad",
"type": "github"
}
},
"landingpage": {
"inputs": {
"flake-utils": "flake-utils_4",
@ -858,6 +880,7 @@
"grocy-scanner": "grocy-scanner",
"home-manager": "home-manager",
"home-manager-utils": "home-manager-utils",
"kmonad": "kmonad",
"landingpage": "landingpage",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",

View file

@ -67,6 +67,10 @@
#url = "git+file:///home/palo/dev/landingpage";
url = "github:mrVanDalo/landingpage";
};
kmonad = {
url = "github:kmonad/kmonad?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@ -89,6 +93,7 @@
, sops-nix
, retiolum
, landingpage
, kmonad
}:
let
system = "x86_64-linux";
@ -186,7 +191,16 @@
grocy-scanner.nixosModule
nixos-hardware.nixosModules.framework-12th-gen-intel
#retiolum.nixosModules.retiolum
#kmonad.nixosModules.default
];
# todo : check out => https://github.com/terlar/nix-config/blob/ad35fbfc20e58626eb9fbd5f67716bc07bb98fc9/home-manager/modules/profiles/user/terje/keyboards.nix
#services.kmonad = {
# enable = false;
# keyboards.laptop-keyboard = {
# name = "laptop-keyboard";
# device = "";
# };
#};
home-manager.users.mainUser = {
imports = [

View file

@ -0,0 +1,6 @@
{
imports = [
./gui
./network
];
}

View file

@ -0,0 +1,59 @@
{ config, lib, ... }:
let
backupFolder = "~/desktop/browser-images";
homeFolder = "/browsers";
in
{
config = lib.mkIf config.components.gui.enable {
programs.custom.browser = {
enable = lib.mkDefault true;
configList = {
development = {
home = "${homeFolder}/development-browser";
homeBackup = "${backupFolder}/development-browser";
gpu = false;
};
google = {
home = "${homeFolder}/google-browser";
homeBackup = "${backupFolder}/google-browser";
gpu = true;
};
finance = {
home = "${homeFolder}/finance-browser";
homeBackup = "${backupFolder}/finance-browser";
gpu = false;
};
facebook = {
home = "${homeFolder}/facebook-browser";
homeBackup = "${backupFolder}/facebook-browser";
gpu = false;
};
shopping = {
home = "${homeFolder}/shopping-browser";
homeBackup = "${backupFolder}/shopping-browser";
gpu = false;
};
firefox-tmp = {
browserType = "firefox";
home = "${homeFolder}/firefox-tmp";
homeBackup = "${backupFolder}/firefox-tmp-browser";
gpu = false;
};
chromium-tmp = {
browserType = "chrome";
home = "${homeFolder}/chromium-tmp";
homeBackup = "${backupFolder}/chrome-tmp-browser";
gpu = false;
};
google-tmp = {
browserType = "google";
home = "${homeFolder}/google-tmp";
homeBackup = "${backupFolder}google-tmp-browser";
gpu = false;
};
};
};
};
}

View file

@ -0,0 +1,20 @@
{ pkgs, lib, ... }:
with lib;
{
options.components.gui = {
enable = lib.mkEnableOption "GUI configurations";
};
imports = [
# todo : structure with home-manager and such is not cool, create another structure
./xorg
./home-manager
./browser.nix
./suspend.nix
./pass.nix
];
config = mkIf config.components.gui.enable {
# todo extract xorg stuff to prepare wayland
};
}

View file

@ -0,0 +1,317 @@
{ pkgs, lib, config, ... }:
with lib;
let
# todo : use kmonad
xmodmapConfig = pkgs.writeText "xmodmap" ''
!
! Swap Caps_Lock and Control_L
!
! replace capslock keys with Escape Keys
! remove Lock = Caps_Lock
clear Lock
add Lock = Scroll_Lock
keysym Caps_Lock = Escape
! Set Right function Key to Windows-key
keycode 135 = Super_R NoSymbol Super_R NoSymbol Super_R
! Map umlauts to RIGHT ALT + <key>
keycode 108 = Mode_switch
keysym e = e E EuroSign
keysym c = c C cent
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
'';
in
{
imports = [
./dunst.nix
./doom-emacs.nix
./ssh.nix
./i3.nix
];
config = lib.mkIf config.components.gui.enable {
# don't run autoload -U compinit && compinit before ~/.zshrc
programs.zsh.enableGlobalCompInit = false;
home-manager.users.mainUser = {
home.stateVersion = "22.11";
# a better cat
programs.bat = {
enable = true;
config.theme = "Gruvbox (light)";
};
# notify me when a command is finished
programs.noti.enable = true;
# a better ls
programs.exa = {
enable = true;
enableAliases = true;
};
# use z instead of cd
# use zi to fuzzy search through all registered directories
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
# provide better `Ctrl+r` command in terminal
programs.mcfly = {
enable = true;
keyScheme = "vim";
fuzzySearchFactor = 3;
enableZshIntegration = true;
};
programs.zsh = {
enable = true;
defaultKeymap = "viins";
};
home.file.".config/bugwarrior/bugwarriorrc".text = ''
[general]
targets = terranix, github_private
static_fields = priority
log.level = INFO
[terranix]
service = github
github.login = mrVanDalo
github.token = @oracle:eval:${pkgs.pass}/bin/pass development/github/mrVanDalo/bugwarriorAccessToken
github.username = mrVanDalo
github.default_priority =
github.description_template = {{githubtitle}} {{githuburl}}
github.add_tags = github
github.project_name = terranix
github.involved_issues = True
github.query = org:terranix is:open
github.include_user_issues = False
github.include_user_repos = False
[github_private]
service = github
github.login = mrVanDalo
github.token = @oracle:eval:${pkgs.pass}/bin/pass development/github/mrVanDalo/bugwarriorAccessToken
github.username = mrVanDalo
github.description_template = {{githubtitle}} {{githuburl}}
github.add_tags = github
github.involved_issues = True
github.include_user_issues = True
github.include_user_repos = True
'';
xdg.configFile."ncmpcpp/config".text = ''
mpd_host = "pepe.private"
mpd_port = 6600
'';
programs.git = {
enable = true;
userName = "Ingolf Wagner";
userEmail = "contact@ingolf-wagner.de";
signing = {
key = "42AC51C9482D0834CF488AF1389EC2D64AC71EAC";
signByDefault = true;
};
ignores = [ "*.swp" "*~" ".idea" ".*penis.*" "result" ];
extraConfig = {
init.defaultBranch = "main";
pull.ff = "only";
};
};
programs.gpg = {
enable = true;
settings = {
auto-key-locate = "local";
keyid-format = "long";
utf8-strings = "";
verbose = "";
with-fingerprint = "";
keyserver = "keyserver.ubuntu.com";
personal-digest-preferences = "SHA512";
cert-digest-algo = "SHA512";
default-preference-list =
"SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
};
};
programs.htop = {
enable = true;
settings.highlight_base_name = true;
settings.tree_view = true;
};
xdg.configFile."albert/albert.conf".text = ''
[General]
hotkey=Meta+Space
showTray=false
telemetry=false
terminal=urxvt -e
[org.albert.extension.applications]
enabled=true
fuzzy=true
use_generic_name=true
use_keywords=true
[org.albert.extension.calculator]
enabled=true
[org.albert.extension.hashgenerator]
enabled=true
[org.albert.frontend.widgetboxmodel]
alwaysOnTop=true
clearOnHide=false
displayIcons=true
displayScrollbar=false
displayShadow=false
hideOnClose=false
hideOnFocusLoss=true
itemCount=5
showCentered=true
theme=SolarizedBrightViolet
'';
xdg.configFile."Code/User/settings.json".text = builtins.toJSON {
"keyboard.dispatch" = "keyCode";
"explorer.confirmDragAndDrop" = false;
"editor.tabSize" = 2;
"window.zoomLevel" = -1;
"git.enableSmartCommit" = true;
"files.autoSave" = "onFocusChange";
"terminal.integrated.setLocaleVariables" = true;
"terminal.external.linuxExec" = "xterm";
"explorer.confirmDelete" = false;
"todo-tree.tags" = [ "todo" "TODO" "fixme" "FIXME" ];
"workbench.colorTheme" = "Solarized Light";
};
xdg.configFile."mimeapps.list".text = ''
[Default Applications]
text/html=browser-select.desktop
x-scheme-handler/http=browser-select.desktop
x-scheme-handler/https=browser-select.desktop
x-scheme-handler/about=browser-select.desktop
x-scheme-handler/mailto=thunderbird.desktop;
x-scheme-handler/unknown=browser-select.desktop
x-scheme-handler/postman=Postman.desktop
image/png=sxiv.desktop
image/jpeg=sxiv.desktop
'';
# todo : still needed?
home.file.".xprofile".text = ''
# load keyboard mappings
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
# to allow sudo commands to access X
# todo : only allow the browsers and rambox access
${pkgs.xorg.xhost}/bin/xhost +
# no shitty pcspkr crap
${pkgs.xorg.xset}/bin/xset -b
# no sleeping monitor
${pkgs.xorg.xset}/bin/xset -dpms
${pkgs.xorg.xset}/bin/xset s off
${pkgs.flameshot}/bin/flameshot &
# cleanup xmonad
rm -f ~/.xmonad/xmonad.state
'';
xdg.configFile."khal/config".text = ''
[calendars]
[[local_calendar]]
path = ~/.calendars/*
type = discover
[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d
longdateformat = %Y-%m-%d
datetimeformat = %Y-%m-%d %H:%M
longdatetimeformat = %Y-%m-%d %H:%M
'';
xdg.configFile."vdirsyncer/config".text = ''
[general]
# A folder where vdirsyncer can store some metadata about each pair.
status_path = "~/.vdirsyncer/status/"
# CALDAV
[pair my_calendar]
a = "nextcloud_calendar"
b = "local_calendar"
collections = ["from a", "from b"]
[storage nextcloud_calendar]
type = "caldav"
url = "https://nextcloud.ingolf-wagner.de/"
username = "palo"
password.fetch = ["command", "${pkgs.pass}/bin/pass", "home/nextcloud/palo/nextcloudcmd-token"]
[storage local_calendar]
type = "filesystem"
path = "~/.calendars/"
fileext = ".ics"
'';
};
environment.systemPackages =
let
fixKeyboard = pkgs.writeScriptBin "fix-Keyboard" # sh
''
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
'';
fixXhost = pkgs.writeScriptBin "fix-xhost" # sh
''
${pkgs.xorg.xhost}/bin/xhost + &> /dev/null
'';
fixX = pkgs.writeScriptBin "fix-X" # sh
''
${fixKeyboard}/bin/fix-Keyboard
for file in `ls ~/.screenlayout`
do
echo $file
~/.screenlayout/$file &> /dev/null
RETURN_CODE=$?
if [[ $RETURN_CODE -eq 0 ]]
then
exit 0;
fi
done
'';
in
[
fixX
fixXhost
fixKeyboard
];
};
}

View file

@ -0,0 +1,28 @@
{ config, pkgs, lib, ... }: {
config = lib.mkIf config.components.gui.enable {
home-manager.users.mainUser = {
programs.doom-emacs = {
enable = lib.mkDefault true;
doomPrivateDir = ./doom.d;
extraConfig = ''
;; "monospace" means use the system default. However, the default is usually two
;; points larger than I'd like, so I specify size 12 here.
(setq doom-font
(font-spec :family "Jetbrains Mono" :size ${toString config.programs.custom.urxvt.fontSize} :weight 'light))
;(setq doom-font
; (font-spec :family "Terminus" :size ${toString config.programs.custom.urxvt.fontSize} :weight 'light))
'';
emacsPackagesOverlay = self: super: {
# fixes https://github.com/vlaci/nix-doom-emacs/issues/394
gitignore-mode = pkgs.emacsPackages.git-modes;
gitconfig-mode = pkgs.emacsPackages.git-modes;
};
};
};
environment.systemPackages = [
pkgs.ripgrep
];
};
}

View file

@ -0,0 +1,267 @@
{ pkgs, config, lib, ... }:
{
config = lib.mkIf config.components.gui.enable {
home-manager.users.mainUser = {
services.dunst = {
enable = true;
settings = {
global = {
font = "JetBrains Mono";
# Allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the
# message.
markup = "yes";
plain_text = "no";
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# Markup is allowed
format = ''
%a
<b>%s</b>
%b'';
# Sort messages by urgency.
sort = "yes";
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = "yes";
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = "center";
# The frequency with wich text that is longer than the notification
# window allows bounces back and forth.
# This option conflicts with "word_wrap".
# Set to 0 to disable.
bounce_freq = 0;
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 1;
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = "yes";
# Ignore newlines '\n' in notifications.
ignore_newline = "no";
# Hide duplicate's count and stack them
stack_duplicates = "yes";
hide_duplicates_count = "no";
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectevly.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "500x10-0+0";
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = "no";
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
idle_threshold = 0;
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing windowmanager is
# present (e.g. xcompmgr, compiz, etc.).
# transparency = 5
# Which monitor should the notifications be displayed on.
#monitor = keyboard
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = "none";
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = "yes";
# Maximum amount of notifications kept in history
history_length = 15;
# Display indicators for URLs (U) and actions (A).
show_indicators = "no";
# The height of a single line. If the height is smaller than the
# font height, it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 3;
# Draw a line of "separatpr_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 1;
# Padding between text and separator.
padding = 1;
# Horizontal padding.
horizontal_padding = 1;
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = "frame";
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = true;
# dmenu path.
#dmenu = "${pkgs.dmenu}/bin/dmenu -p dunst:";
# Browser for opening urls in context menu.
# browser = /usr/bin/firefox -new-tab
# Align icons left/right/off
icon_position = "off";
max_icon_size = 80;
frame_width = 2;
frame_color = "#8EC07C";
};
shortcuts = {
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = "ctrl+space";
# Close all notifications.
close_all = "ctrl+shift+space";
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1".
#history = "ctrl+grave";
# Context menu.
context = "mod4+u";
};
urgency_low = {
frame_color = "#268bd2";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
urgency_normal = {
frame_color = "#b58900";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
urgency_critical = {
frame_color = "#dc322f";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
};
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg
};
};
};
}

View file

@ -0,0 +1,365 @@
{ config, lib, pkgs, ... }:
let
cfg = config.home-manager.users.mainUser.xsession.windowManager.i3;
colorTheme =
let
theme = (import ../../../library/colorThemes.nix).solarized.light.hex;
in
theme // {
foreground = theme.base3;
background = theme.base03;
};
# switch to named workspaces
# todo : add version assert
i3-wk-switch = pkgs.i3-wk-switch.overrideAttrs (old: {
src = pkgs.fetchFromGitHub {
owner = "tmfink";
repo = "i3-wk-switch";
rev = "5f43bb8cbe7938eff476fc534b61c8fb6a700c8f";
sha256 = "sha256-DOBPI/wO+S8a6EzWJeVGODXeSixFl7SHTtHAq5DG8GU=";
};
});
backgroundCommand = pkgs.writers.writeDash "background" ''
${pkgs.xorg.xrandr}/bin/xrandr | grep " connected" | \
${pkgs.gnused}/bin/sed -E "s/primary //" | \
${pkgs.coreutils-full}/bin/cut -d' ' -f 3 | \
${pkgs.gnused}/bin/sed -E 's/\+.*$//g' | \
${pkgs.coreutils-full}/bin/sort -r | \
${pkgs.coreutils-full}/bin/head -n 1 | \
${pkgs.gawk}/bin/awk -F 'x' '{print "--width="$1" --height="$2}' | \
${pkgs.findutils}/bin/xargs \
${pkgs.polygon-art.polygon-art}/bin/rings \
/dev/shm/background.png && \
${pkgs.feh}/bin/feh --bg-scale /dev/shm/background.png
'';
in
{
config = lib.mkIf config.components.gui.enable {
home-manager.users.mainUser = {
programs.i3status-rust = {
enable = true;
bars = {
my = {
icons = "awesome5";
theme = "solarized-light";
# https://github.com/greshake/i3status-rust/blob/v0.22.0/doc/blocks.md
blocks = [
{
block = "cpu";
interval = 1;
}
{
block = "memory";
display_type = "memory";
format_mem = "{mem_used_percents}";
format_swap = "{swap_used_percents}";
}
{
block = "load";
interval = 1;
format = "{1m}";
}
{
block = "battery";
interval = 10;
format = "{percentage} {time}";
}
{ block = "uptime"; }
{
block = "time";
interval = 60;
format = "%Y-%m-%d %R";
}
];
};
};
};
programs.kitty = {
enable = true;
# kitty +kitten themes
theme = "Gruvbox Light Hard";
settings = {
font_family = "JetBrains Mono";
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
font_size = 11;
};
};
programs.alacritty = {
enable = true;
settings = {
import =
let
themes = pkgs.fetchFromGitHub {
owner = "alacritty";
repo = "alacritty-theme";
rev = "024c5c0dfb65197d5796e29e307b321af9a5e198";
sha256 = "sha256-zXyGXZSmmTup5o7Dx6he+57vSFpygR+GSD+3PTxDbVk=";
};
in
[ "${themes}/themes/gruvbox_light.yaml" ];
font = {
normal = {
family = "JetBrains Mono";
style = "Regular";
};
bold = {
family = "JetBrains Mono";
style = "Bold";
};
italic = {
family = "JetBrains Mono";
style = "Italic";
};
size = 6.0;
};
};
};
xsession.windowManager.i3 = {
enable = true;
extraConfig = ''
default_border pixel
'';
config = {
modifier = "Mod4";
terminal = "alacritty";
startup =
let
height = config.configuration.desktop.height;
width = config.configuration.desktop.width;
in
[
{ command = "${pkgs.albert}/bin/albert"; always = true; }
{ command = toString backgroundCommand; always = true; }
#{ command = "${pkgs.flameshot}/bin/flameshot"; always = true; }
# { command = "systemctl --user restart polybar"; always = true; notification = false; }
];
fonts = {
names = [ "JetBrains Mono" ];
size = 11.0;
};
bars =
with colorTheme;
let
selected = blue;
in
[{
mode = "hide";
hiddenState = "hide";
position = "top";
workspaceButtons = true;
workspaceNumbers = true;
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${config.users.users.mainUser.home}/.config/i3status-rust/config-my.toml";
fonts = {
names = [ "JetBrains Mono" ];
size = 11.0;
};
trayOutput = "primary";
colors = {
background = background;
statusline = background;
separator = background;
focusedWorkspace = {
border = selected;
background = base02;
text = foreground;
};
activeWorkspace = {
border = background;
background = base02;
text = foreground;
};
inactiveWorkspace = {
border = background;
background = base02;
text = foreground;
};
urgentWorkspace = {
border = red;
background = base02;
text = foreground;
};
bindingMode = {
border = red;
background = red;
text = background;
};
};
}];
colors = with colorTheme; {
background = background;
focused = {
background = blue;
border = blue;
childBorder = blue;
indicator = blue;
text = foreground;
};
focusedInactive = {
background = base01;
border = base01;
childBorder = base02;
indicator = base02;
text = foreground;
};
unfocused = {
background = base02;
border = base02;
childBorder = base02;
indicator = base02;
text = foreground;
};
urgent = {
background = orange;
border = orange;
childBorder = background;
indicator = background;
text = foreground;
};
};
keybindings = {
"Print" = "exec ${pkgs.flameshot}/bin/flameshot gui -c -p /share/";
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
"${cfg.config.modifier}+Shift+q" = "exit";
"${cfg.config.modifier}+q" = "kill";
"${cfg.config.modifier}+Left" = "focus left";
"${cfg.config.modifier}+Down" = "focus down";
"${cfg.config.modifier}+Up" = "focus up";
"${cfg.config.modifier}+Right" = "focus right";
"${cfg.config.modifier}+j" = "focus next";
"${cfg.config.modifier}+k" = "focus prev";
"${cfg.config.modifier}+Shift+Left" = "move left";
"${cfg.config.modifier}+Shift+Down" = "move down";
"${cfg.config.modifier}+Shift+Up" = "move up";
"${cfg.config.modifier}+Shift+Right" = "move right";
"${cfg.config.modifier}+h" = "split h";
"${cfg.config.modifier}+v" = "split v";
"${cfg.config.modifier}+f" = "fullscreen toggle";
"${cfg.config.modifier}+s" = "layout stacking";
"${cfg.config.modifier}+w" = "layout tabbed";
"${cfg.config.modifier}+e" = "layout toggle split";
"${cfg.config.modifier}+t" = "floating toggle";
#"${cfg.config.modifier}+space" = "focus mode_toggle";
"${cfg.config.modifier}+b" = "exec ${backgroundCommand}";
"${cfg.config.modifier}+p" = "focus parent";
"${cfg.config.modifier}+Shift+minus" = "move scratchpad";
"${cfg.config.modifier}+minus" = "scratchpad show";
"${cfg.config.modifier}+1" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 1";
"${cfg.config.modifier}+2" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 2";
"${cfg.config.modifier}+3" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 3";
"${cfg.config.modifier}+4" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 4";
"${cfg.config.modifier}+5" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 5";
"${cfg.config.modifier}+6" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 6";
"${cfg.config.modifier}+7" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 7";
"${cfg.config.modifier}+8" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 8";
"${cfg.config.modifier}+9" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 9";
"${cfg.config.modifier}+0" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 10";
"${cfg.config.modifier}+Shift+1" = "move container to workspace number 1";
"${cfg.config.modifier}+Shift+2" = "move container to workspace number 2";
"${cfg.config.modifier}+Shift+3" = "move container to workspace number 3";
"${cfg.config.modifier}+Shift+4" = "move container to workspace number 4";
"${cfg.config.modifier}+Shift+5" = "move container to workspace number 5";
"${cfg.config.modifier}+Shift+6" = "move container to workspace number 6";
"${cfg.config.modifier}+Shift+7" = "move container to workspace number 7";
"${cfg.config.modifier}+Shift+8" = "move container to workspace number 8";
"${cfg.config.modifier}+Shift+9" = "move container to workspace number 9";
"${cfg.config.modifier}+Shift+0" = "move container to workspace number 10";
"${cfg.config.modifier}+Escape" = "workspace back_and_forth";
# rename workspace
"${cfg.config.modifier}+n" = ''
exec i3-input -F 'rename workspace to "%s"' -P 'New name for this workspace: '
'';
"${cfg.config.modifier}+grave" =
let
script = pkgs.writers.writeBash "select-workspace" ''
set -e
set -o pipefail
${pkgs.i3}/bin/i3-msg -t get_workspaces | \
${pkgs.jq}/bin/jq --raw-output '.[] | .name' | \
${pkgs.rofi}/bin/rofi -dmenu -p 'Select Workspace' | \
while read line
do
${i3-wk-switch}/bin/i3-wk-switch "$line"
done
'';
in
"exec ${script}";
"${cfg.config.modifier}+Shift+c" = "reload";
"${cfg.config.modifier}+Shift+r" = "restart";
"${cfg.config.modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
"${cfg.config.modifier}+r" = "mode resize";
# multiple monitors
# autorandr --save docked # to save setup
# autorandr --save undocked # to save setup
# autorandr --change # automatically detects the setup
"${cfg.config.modifier}+BackSpace" =
let
xmodmapConfig = pkgs.writeText "xmodmap" ''
!
! Swap Caps_Lock and Control_L
!
! replace capslock keys with Escape Keys
! remove Lock = Caps_Lock
clear Lock
add Lock = Scroll_Lock
keysym Caps_Lock = Escape
! Set Right function Key to Windows-key
keycode 135 = Super_R NoSymbol Super_R NoSymbol Super_R
! Map umlauts to RIGHT ALT + <key>
keycode 108 = Mode_switch
keysym e = e E EuroSign
keysym c = c C cent
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
'';
script = pkgs.writers.writeBash "autorandr" ''
${pkgs.autorandr}/bin/autorandr --change
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
${backgroundCommand}
'';
in
"exec ${toString script}";
# like vimperator
"${cfg.config.modifier}+a" = "exec ${pkgs.i3-easyfocus}/bin/i3-easyfocus";
};
};
};
};
};
}

View file

@ -0,0 +1,47 @@
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.components.gui.enable {
home-manager.users.mainUser = {
programs.ssh.enable = true;
programs.ssh.matchBlocks = {
"*" = {
identityFile = "~/.ssh/palo_rsa.pub";
identitiesOnly = true;
};
"lassul.us" = {
user = "download";
port = 45621;
};
"*.r" = {
user = "root";
};
"*.secret" = {
user = "root";
};
"*.private" = {
user = "root";
};
"*.lan" = {
user = "root";
};
"github.com" = {
hostname = "ssh.github.com";
user = "root";
};
"es5.siteground.eu" = {
user = "ingolfwa";
port = 18765;
};
"*.onion" = {
user = "root";
};
#"*.compute.amazonaws.com".extraOptions = {
# ProxyCommand = ''
# sh -c "${pkgs.awscli2}/bin/aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
# '';
#};
};
};
};
}

View file

@ -1,7 +1,5 @@
{ lib, pkgs, ... }:
{ lib, pkgs, config, ... }:
with lib;
let
# desktop file
@ -26,16 +24,18 @@ let
in
{
config = mkIf config.components.gui.enable {
environment.systemPackages = [
(pkgs.pass.withExtensions (ext: [ ext.pass-otp ]))
(desktopFile "passmenu" "${pkgs.pass.withExtensions (ext: [ext.pass-otp])}/bin/passmenu --type -l 10")
environment.systemPackages = [
(pkgs.pass.withExtensions (ext: [ ext.pass-otp ]))
# todo : use upstream desktop file creator
(desktopFile "passmenu" "${pkgs.pass.withExtensions (ext: [ext.pass-otp])}/bin/passmenu --type -l 10")
# todo ein script machen was hier tut
# zbarimg -q --raw 2018-12-18-114509.png | pass otp insert mindcurv/cloudamqp/otp
pkgs.zbar
pkgs.otpmenu
pkgs.otpmenu
];
# todo ein script machen was hier tut
# zbarimg -q --raw 2018-12-18-114509.png | pass otp insert mindcurv/cloudamqp/otp
pkgs.zbar
];
};
}

View file

@ -1,15 +1,12 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.system.custom.suspend;
in
{
options.components.gui.suspend.enable = mkOption {
type = lib.types.bool;
default = true;
};
options.system.custom.suspend.enable = mkEnableOption "use xlock in suspend";
config = mkIf cfg.enable {
config = mkIf (config.components.gui.enable && config.components.gui.suspend.enable) {
systemd.services.screenlock = {
before = [ "sleep.target" ];

View file

@ -1,21 +1,10 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.system.custom.x11;
in
{
options.system.custom.x11 = {
enable = mkEnableOption "enable x11";
autoLoginUser = mkOption {
type = with types; str;
description = "user to login";
};
};
config = mkIf config.components.gui.enable {
config = mkIf cfg.enable {
system.custom.fonts.enable = true;
services.xserver = {
@ -26,7 +15,7 @@ in
displayManager = {
defaultSession = lib.mkDefault "none+i3";
autoLogin.enable = lib.mkDefault true;
autoLogin.user = cfg.autoLoginUser;
autoLogin.user = config.users.users.mainUser.name;
lightdm.enable = lib.mkDefault true;
};
@ -61,11 +50,15 @@ in
# --------
environment.systemPackages = with pkgs; [
xclip
xtrlock-pam
xorg.xev
xorg.xmodmap
dmenu
arandr
xcalib
flameshot
xorg.xmodmap
feh
];

View file

@ -1,7 +1,5 @@
{ lib, pkgs, ... }:
with lib;
let
name = "lock";
@ -32,6 +30,7 @@ let
in
{
environment.systemPackages = [ lockProgram desktopFile ];
config = mkIf config.components.gui.enable {
environment.systemPackages = [ lockProgram desktopFile ];
};
}

View file

@ -4,7 +4,7 @@ with lib;
with types;
let
cfg = config.component.network.sshd;
cfg = config.components.network.sshd;
defaultRootKeyFiles = [ (toString ../../../assets/ssh/palo_rsa.pub) ];
in
{
@ -15,7 +15,7 @@ in
./known-hosts-public.nix
];
options.component.network.sshd = {
options.components.network.sshd = {
enable = mkOption {
type = bool;
default = true;

View file

@ -64,7 +64,7 @@
'';
services.openssh.enable = true;
component.network.sshd.onlyTincAccess = false;
components.network.sshd.onlyTincAccess = false;
nix.settings.max-jobs = lib.mkDefault 1;

View file

@ -2,6 +2,7 @@
imports = [
../../components
../../system/desktop
../../system/server/netdata.nix
@ -9,6 +10,7 @@
./packages.nix
./syncthing.nix
./tinc.nix
./cups.nix
#./wifi-access-point.nix
#./wireshark.nix
@ -19,6 +21,8 @@
];
components.gui.enable = true;
services.nginx.enable = true;
networking.hostName = "cream";
@ -40,9 +44,8 @@
};
};
programs.custom.steam.enable = true;
programs.custom.video.enable = false;
programs.custom.steam.enable = true;
services.printing.enable = true;
# fonts
@ -83,11 +86,9 @@
# for congress and streaming
hardware.opengl = {
enable = true; # todo I actually want opengl
#driSupport = true;
#driSupport32Bit = true;
enable = true;
};
system.stateVersion = "22.11"; # Did you read the comment?
system.stateVersion = "22.11";
}

View file

@ -0,0 +1,18 @@
{
hardware.printers.ensurePrinters = [
{
description = "Lexmark E350d";
deviceUri = "usb://Lexmark/E350d?serial=622Z9ZC";
location = "office";
name = "Lexmark_E350d";
model = "drv:///sample.drv/generic.ppd";
ppdOptions = {
job-sheets = "none, none";
media = "na_letter_8.5x11in";
sides = "one-sided";
};
}
];
}

View file

@ -70,4 +70,5 @@
# high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true;
}

View file

@ -2,7 +2,7 @@
let
nextcloudSync = folder:
let
password = "$( pass show home/nextcloud/palo/nextcloudcmd-token)";
password = "$( ${pkgs.pass}/bin/pass show home/nextcloud/palo/nextcloudcmd-token )";
user = "palo";
in
pkgs.writers.writeBashBin "nextcloud-sync-${folder}" ''

View file

@ -64,7 +64,7 @@
'';
services.openssh.enable = true;
component.network.sshd.onlyTincAccess = false;
components.network.sshd.onlyTincAccess = false;
users.users.root.openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6uza62+Go9sBFs3XZE2OkugBv9PJ7Yv8ebCskE5WYPcahMZIKkQw+zkGI8EGzOPJhQEv2xk+XBf2VOzj0Fto4nh8X5+Llb1nM+YxQPk1SVlwbNAlhh24L1w2vKtBtMy277MF4EP+caGceYP6gki5+DzlPUSdFSAEFFWgN1WPkiyUii15Xi3QuCMR8F18dbwVUYbT11vwNhdiAXWphrQG+yPguALBGR+21JM6fffOln3BhoDUp2poVc5Qe2EBuUbRUV3/fOU4HwWVKZ7KCFvLZBSVFutXCj5HuNWJ5T3RuuxJSmY5lYuFZx9gD+n+DAEJt30iXWcaJlmUqQB5awcB1S2d9pJ141V4vjiCMKUJHIdspFrI23rFNYD9k2ZXDA8VOnQE33BzmgF9xOVh6qr4G0oEpsNqJoKybVTUeSyl4+ifzdQANouvySgLJV/pcqaxX1srSDIUlcM2vDMWAs3ryCa0aAlmAVZIHgRhh6wa+IXW8gIYt+5biPWUuihJ4zGBEwkyVXXf2xsecMWCAGPWPDL0/fBfY9krNfC5M2sqxey2ShFIq+R/wMdaI7yVjUCF2QIUNiIdFbJL6bDrDyHnEXJJN+rAo23jUoTZZRv7Jq3DB/A5H7a73VCcblZyUmwMSlpg3wos7pdw5Ctta3zQPoxoAKGS1uZ+yTeZbPMmdbw== contact@ingolf-wagner.de" ];

View file

@ -20,7 +20,7 @@
./grocy.nix
./taskwarrior-pushover.nix
#./neo4j.nix
./jellyfin.nix
#./jellyfin.nix
./wireguard.nix
#./tts.nix
@ -29,28 +29,18 @@
./loki-promtail.nix
./prometheus.nix
./grafana.nix
./telegraf.nix
];
sops.defaultSopsFile = ../../secrets/pepe.yaml;
networking.hostName = "pepe";
# fonts
# -----
programs.custom.urxvt.fontSize = 12;
programs.custom.xterm.fontSize = 12;
system.custom.fonts.dpi = 100;
# networking
# ----------
#system.custom.wifi = {
#enable = false;
#interfaces = [ "wlp3s0" ];
#configurationFile = <secrets/wpa_supplicant>;
#};
programs.custom. zsh.enable = true;
users.users.root.shell = pkgs.zsh;
# todo : rename to component.init.ssh
configuration.init-ssh = {
enable = "enabled";
kernelModules = [ "e1000e" ];
@ -74,7 +64,5 @@
# todo move to some place else
home-manager.users.mailUser.home.stateVersion = "22.11";
}

View file

@ -50,6 +50,10 @@
job_name = "systemd";
static_configs = [{
targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
labels = {
service = "node-exporter";
server = "pepe";
};
}];
}
{
@ -66,6 +70,18 @@
};
}];
}
{
# see https://www.home-assistant.io/integrations/prometheus/
job_name = "telgraf";
metrics_path = "/metrics";
static_configs = [{
targets = [ "localhost:9273" ];
labels = {
service = "telegraf";
server = "pepe";
};
}];
}
];
};
}

View file

@ -68,12 +68,12 @@
books = {
enable = true;
path = "/media/syncthing/books";
rescanInterval = 8 * 3600;
rescanInterval = 40 * 24 * 3600;
};
lost-fotos = {
enable = true;
path = "/media/syncthing/lost-fotos.ct";
rescanInterval = 8 * 3600;
rescanInterval = 5 * 31 * 24 * 3600;
};
movies = {
enable = true;

View file

@ -0,0 +1,34 @@
let
urls = [
"https://bitwarden.ingolf-wagner.de"
"https://flix.ingolf-wagner.de"
"https://git.ingolf-wagner.de"
"https://ingolf-wagner.de"
"https://nextcloud.ingolf-wagner.de"
"https://nextcloud.ingolf-wagner.de"
"https://tech.ingolf-wagner.de"
];
in
{
services.telegraf = {
enable = true;
extraConfig = {
outputs.prometheus_client = {
listen = ":9273";
metric_version = 2;
};
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins
inputs = {
x509_cert = [{
sources = (map (url: "${url}:443") urls);
interval = "30m"; # agent.interval = "10s" is default
}];
http_response = [{ inherit urls; }];
processes = { };
systemd_units = { };
internet_speed.interval = "50m";
nginx.urls = [ "http://localhost/nginx_status" ];
};
};
};
}

View file

@ -52,6 +52,7 @@
./loki-promtail.nix
./prometheus.nix
./grafana.nix
./telegraf.nix
];
@ -70,10 +71,8 @@
# Shell configuration
# -------------------
programs.custom = {
bash.enable = true;
zsh.enable = true;
};
programs.custom. zsh.enable = true;
users.users.root.shell = pkgs.zsh;
security.acme.acceptTerms = true;
security.acme.defaults.email = "contact@ingolf-wagner.de";

View file

@ -8,23 +8,28 @@
driSupport = true;
driSupport32Bit = true;
};
services.nginx = {
enable = true;
virtualHosts. "flix.ingolf-wagner.de" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
# Security / XSS Mitigation Headers
# NOTE: X-Frame-Options may cause issues with the webOS app
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
'';
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://localhost:8096";
services.nginx =
let
flixConfig = {
forceSSL = true;
enableACME = true;
extraConfig = ''
# Security / XSS Mitigation Headers
# NOTE: X-Frame-Options may cause issues with the webOS app
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
'';
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://localhost:8096";
};
};
in
{
enable = true;
virtualHosts. "flix.ingolf-wagner.de" = flixConfig;
virtualHosts. "video.ingolf-wagner.de" = flixConfig;
};
};
}

View file

@ -47,6 +47,22 @@
job_name = "systemd";
static_configs = [{
targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
labels = {
service = "node-exporter";
server = "robi";
};
}];
}
{
# see https://www.home-assistant.io/integrations/prometheus/
job_name = "telgraf";
metrics_path = "/metrics";
static_configs = [{
targets = [ "localhost:9273" ];
labels = {
service = "telegraf";
server = "robi";
};
}];
}
];

View file

@ -39,16 +39,19 @@
lost-fotos = {
enable = true;
path = "/media/syncthing/lost-fotos.ct";
rescanInterval = 40 * 24 * 3600;
};
movies = {
enable = true;
watch = true;
path = "/media/syncthing/movies";
rescanInterval = 16 * 3600;
};
music-library = {
enable = true;
watch = true;
path = "/media/syncthing/music";
rescanInterval = 2 * 24 * 3600;
};
music-projects = {
enable = true;
@ -59,16 +62,19 @@
enable = true;
watch = true;
path = "/media/syncthing/nextcloud_backup";
rescanInterval = 23 * 3600;
};
samples = {
enable = true;
watch = true;
path = "/media/syncthing/samples";
rescanInterval = 41 * 24 * 3600;
};
series = {
enable = true;
watch = true;
path = "/media/syncthing/series";
rescanInterval = 15 * 3600;
};
};

View file

@ -0,0 +1,17 @@
{
services.telegraf = {
enable = true;
extraConfig = {
outputs.prometheus_client = {
listen = ":9273";
metric_version = 2;
};
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins
inputs = {
processes = { };
systemd_units = { };
nginx.urls = [ "http://localhost/nginx_status" ];
};
};
};
}

View file

@ -2,6 +2,7 @@
imports = [
../../components
../../system/desktop
../../system/server/netdata.nix
@ -18,10 +19,10 @@
];
components.gui.enable = true;
services.nginx.enable = true;
#sops.defaultSopsFile = ../../secrets/sterni.yaml;
networking.hostName = "sterni";
@ -47,11 +48,12 @@
services.printing.enable = true;
home-manager.users.mainUser.home.stateVersion = "22.11";
# fonts
# -----
programs.custom.urxvt.fontSize = 12;
programs.custom.xterm.fontSize = 12;
system.custom.fonts.dpi = 100;
virtualisation = {
docker.enable = true;

View file

@ -2,7 +2,7 @@
let
nextcloudSync = folder:
let
password = "$( pass show home/nextcloud/palo/nextcloudcmd-token)";
password = "$( ${pkgs.pass}/bin/pass show home/nextcloud/palo/nextcloudcmd-token )";
user = "palo";
in
pkgs.writers.writeBashBin "nextcloud-sync-${folder}" ''

View file

@ -36,7 +36,6 @@
./system/font.nix
./system/mainUser.nix
./system/wifi.nix
./system/x11.nix
./system/on-failure.nix
];

View file

@ -1,17 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.programs.custom.zsh;
in
{
options.programs.custom.zsh = {
enable = mkEnableOption "enable zsh";
mainUser = mkOption {
type = with types; nullOr str;
default = null;
@ -19,7 +14,6 @@ in
the main User if available
'';
};
};
config = mkIf cfg.enable {

View file

@ -1,58 +0,0 @@
{ config, lib, ... }:
let
backupFolder = "~/desktop/browser-images";
homeFolder = "/browsers";
in
{
programs.custom.browser = {
enable = lib.mkDefault true;
configList = {
development = {
home = "${homeFolder}/development-browser";
homeBackup = "${backupFolder}/development-browser";
gpu = false;
};
google = {
home = "${homeFolder}/google-browser";
homeBackup = "${backupFolder}/google-browser";
gpu = true;
};
finance = {
home = "${homeFolder}/finance-browser";
homeBackup = "${backupFolder}/finance-browser";
gpu = false;
};
facebook = {
home = "${homeFolder}/facebook-browser";
homeBackup = "${backupFolder}/facebook-browser";
gpu = false;
};
shopping = {
home = "${homeFolder}/shopping-browser";
homeBackup = "${backupFolder}/shopping-browser";
gpu = false;
};
firefox-tmp = {
browserType = "firefox";
home = "${homeFolder}/firefox-tmp";
homeBackup = "${backupFolder}/firefox-tmp-browser";
gpu = false;
};
chromium-tmp = {
browserType = "chrome";
home = "${homeFolder}/chromium-tmp";
homeBackup = "${backupFolder}/chrome-tmp-browser";
gpu = false;
};
google-tmp = {
browserType = "google";
home = "${homeFolder}/google-tmp";
homeBackup = "${backupFolder}google-tmp-browser";
gpu = false;
};
};
};
}

View file

@ -6,29 +6,19 @@
#./icecast.nix
./audio.nix
./browser.nix
./cachix.nix
./direnv.nix
./hoard.nix
./home-manager.nix
./mail-stuff.nix
#./mc.nix
./network.nix
./packages.nix
./pass.nix
./remote-install.nix
./size.nix
./suspend.nix
./user.nix
./x11.nix
./xlock.nix
./yubikey.nix
./wtf.nix
];
component.network.sshd.onlyTincAccess = lib.mkDefault true;
system.custom.suspend.enable = lib.mkDefault true;
components.network.sshd.onlyTincAccess = lib.mkDefault true;
backup.dirs = [
"${config.users.users.mainUser.home}/.config/noti"

View file

@ -1,21 +0,0 @@
{ config, lib, pkgs, ... }:
let
package = pkgs.unstable.hoard;
in
{
environment.systemPackages = [ package ];
#home-manager.users.mainUser.programs.direnv.enable = true;
#programs.zsh.interactiveShellInit = ''
# source ${package}/src/shell/hoard.zsh
#'';
#programs.bash.interactiveShellInit = ''
# source ${package}/src/shell/hoard.bash
#'';
backup.dirs = [
"${config.users.users.mainUser.home}/.config/hoard"
];
}

View file

@ -1,396 +0,0 @@
{ pkgs, lib, config, ... }:
with lib;
let
xmodmapConfig = pkgs.writeText "xmodmap" ''
!
! Swap Caps_Lock and Control_L
!
! replace capslock keys with Escape Keys
! remove Lock = Caps_Lock
clear Lock
add Lock = Scroll_Lock
keysym Caps_Lock = Escape
! Set Right function Key to Windows-key
keycode 135 = Super_R NoSymbol Super_R NoSymbol Super_R
! Map umlauts to RIGHT ALT + <key>
keycode 108 = Mode_switch
keysym e = e E EuroSign
keysym c = c C cent
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
'';
in
{
imports = [
./home-manager/dunst.nix
./home-manager/doom-emacs.nix
./home-manager/ssh.nix
./home-manager/xmonad.nix
./home-manager/i3.nix
];
# don't run autoload -U compinit && compinit before ~/.zshrc
programs.zsh.enableGlobalCompInit = lib.mkForce false;
home-manager.users.mainUser = {
home.stateVersion = "22.11";
# nushell is the new shit yeah
programs.nushell = {
enable = lib.mkDefault true;
package = pkgs.unstable.nushell;
};
# a better cat
programs.bat = {
enable = true;
config.theme = "Solarized (light)";
};
# notify me when a command is finished
programs.noti.enable = true;
# a better ls
programs.exa = {
enable = true;
enableAliases = true;
};
# use z instead of cd
# use zi to fuzzy search through all registered directories
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
# provide better `Ctrl+r` command in terminal
programs.mcfly = {
enable = true;
keyScheme = "vim";
#enableLightTheme = true;
fuzzySearchFactor = 3;
enableZshIntegration = true;
};
programs.zsh = {
enable = true;
defaultKeymap = "viins";
};
home.git-pull = {
enable = mkDefault false;
repositories = [
# krebs
#{
# source = "git@github.com:krebs/stockholm.git";
# target = "~/dev/krebs/stockholm";
#}
{
source = "git@github.com:krebs/rc3-map.git";
target = "~/dev/krebs/rc3-map";
}
# spaceleft
{
source = "git@git.space-left.org:space-left/rc3-map.git";
target = "~/dev/space-left/rc3-map";
}
# nixos
{
source = "git@github.com:mrVanDalo/home-manager-utils.git";
target = "~/dev/home-manager-utils";
}
{
source = "gitea@git.ingolf-wagner.de:palo/nixos-config.git";
target = "~/dev/nixos/nixos-config";
}
{
source = "gitea@git.ingolf-wagner.de:palo/nixos-private-assets.git";
target = "~/dev/nixos/nixos-private-assets";
}
{
source = "gitea@git.ingolf-wagner.de:palo/nixos-secrets.git";
target = "~/dev/nixos/nixos-secrets";
}
# terranix
{
source = "git@github.com:terranix/terranix.git";
target = "~/dev/terranix/terranix";
}
{
source = "git@github.com:terranix/terranix-website.git";
target = "~/dev/terranix/website";
}
{
source = "git@github.com:terranix/terranix-hcloud.git";
target = "~/dev/terranix/module-hcloud";
}
{
source = "git@github.com:terranix/terranix-module-github.git";
target = "~/dev/terranix/module-github";
}
{
source = "git@github.com:terranix/terranix-github-configuration.git";
target = "~/dev/terranix/configuration-github";
}
{
source = "git@github.com:terranix/terranix-examples.git";
target = "~/dev/terranix/examples";
}
{
source = "git@github.com:terranix/terranix-artwork.git";
target = "~/dev/terranix/artwork";
}
# private
{
source = "gitea@git.ingolf-wagner.de:palo/tech-ingolf-wagner-de.git";
target = "~/dev/tech.ingolf-wagner.de";
}
];
};
home.file.".config/bugwarrior/bugwarriorrc".text = ''
[general]
targets = terranix, github_private
static_fields = priority
log.level = INFO
[terranix]
service = github
github.login = mrVanDalo
github.token = @oracle:eval:${pkgs.pass}/bin/pass development/github/mrVanDalo/bugwarriorAccessToken
github.username = mrVanDalo
github.default_priority =
github.description_template = {{githubtitle}} {{githuburl}}
github.add_tags = github
github.project_name = terranix
github.involved_issues = True
github.query = org:terranix is:open
github.include_user_issues = False
github.include_user_repos = False
[github_private]
service = github
github.login = mrVanDalo
github.token = @oracle:eval:${pkgs.pass}/bin/pass development/github/mrVanDalo/bugwarriorAccessToken
github.username = mrVanDalo
github.description_template = {{githubtitle}} {{githuburl}}
github.add_tags = github
github.involved_issues = True
github.include_user_issues = True
github.include_user_repos = True
'';
xdg.configFile."ncmpcpp/config".text = ''
mpd_host = "pepe.private"
mpd_port = 6600
'';
programs.git = {
enable = true;
userName = "Ingolf Wagner";
userEmail = "contact@ingolf-wagner.de";
signing = {
key = "42AC51C9482D0834CF488AF1389EC2D64AC71EAC";
signByDefault = true;
};
ignores = [ "*.swp" "*~" ".idea" ".*penis.*" "result" ];
extraConfig = {
init.defaultBranch = "main";
pull.ff = "only";
};
};
programs.gpg = {
enable = true;
settings = {
auto-key-locate = "local";
keyid-format = "long";
utf8-strings = "";
verbose = "";
with-fingerprint = "";
keyserver = "keyserver.ubuntu.com";
personal-digest-preferences = "SHA512";
cert-digest-algo = "SHA512";
default-preference-list =
"SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
};
};
programs.htop = {
enable = true;
settings.highlight_base_name = true;
settings.tree_view = true;
};
xdg.configFile."albert/albert.conf".text = ''
[General]
hotkey=Meta+Space
showTray=false
telemetry=false
terminal=urxvt -e
[org.albert.extension.applications]
enabled=true
fuzzy=true
use_generic_name=true
use_keywords=true
[org.albert.extension.calculator]
enabled=true
[org.albert.extension.hashgenerator]
enabled=true
[org.albert.frontend.widgetboxmodel]
alwaysOnTop=true
clearOnHide=false
displayIcons=true
displayScrollbar=false
displayShadow=false
hideOnClose=false
hideOnFocusLoss=true
itemCount=5
showCentered=true
theme=SolarizedBrightViolet
'';
xdg.configFile."Code/User/settings.json".text = builtins.toJSON {
"keyboard.dispatch" = "keyCode";
"explorer.confirmDragAndDrop" = false;
"editor.tabSize" = 2;
"window.zoomLevel" = -1;
"git.enableSmartCommit" = true;
"files.autoSave" = "onFocusChange";
"terminal.integrated.setLocaleVariables" = true;
"terminal.external.linuxExec" = "xterm";
"explorer.confirmDelete" = false;
"todo-tree.tags" = [ "todo" "TODO" "fixme" "FIXME" ];
"workbench.colorTheme" = "Solarized Light";
};
xdg.configFile."mimeapps.list".text = ''
[Default Applications]
text/html=browser-select.desktop
x-scheme-handler/http=browser-select.desktop
x-scheme-handler/https=browser-select.desktop
x-scheme-handler/about=browser-select.desktop
x-scheme-handler/mailto=thunderbird.desktop;
x-scheme-handler/unknown=browser-select.desktop
x-scheme-handler/postman=Postman.desktop
image/png=sxiv.desktop
image/jpeg=sxiv.desktop
'';
home.file.".xprofile".text = ''
# load keyboard mappings
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
# to allow sudo commands to access X
# todo : only allow the browsers and rambox access
${pkgs.xorg.xhost}/bin/xhost +
# no shitty pcspkr crap
${pkgs.xorg.xset}/bin/xset -b
# no sleeping monitor
${pkgs.xorg.xset}/bin/xset -dpms
${pkgs.xorg.xset}/bin/xset s off
${pkgs.flameshot}/bin/flameshot &
# cleanup xmonad
rm -f ~/.xmonad/xmonad.state
'';
xdg.configFile."khal/config".text = ''
[calendars]
[[local_calendar]]
path = ~/.calendars/*
type = discover
[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d
longdateformat = %Y-%m-%d
datetimeformat = %Y-%m-%d %H:%M
longdatetimeformat = %Y-%m-%d %H:%M
'';
xdg.configFile."vdirsyncer/config".text = ''
[general]
# A folder where vdirsyncer can store some metadata about each pair.
status_path = "~/.vdirsyncer/status/"
# CALDAV
[pair my_calendar]
a = "nextcloud_calendar"
b = "local_calendar"
collections = ["from a", "from b"]
[storage nextcloud_calendar]
type = "caldav"
url = "https://nextcloud.ingolf-wagner.de/"
username = "palo"
password.fetch = ["command", "${pkgs.pass}/bin/pass", "home/nextcloud/vdirsyncer/password"]
[storage local_calendar]
type = "filesystem"
path = "~/.calendars/"
fileext = ".ics"
'';
};
environment.systemPackages =
let
library = import ../../library { inherit pkgs lib; };
fixKeyboard = pkgs.writeScriptBin "fix-Keyboard" # sh
''
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
'';
fixXhost = pkgs.writeScriptBin "fix-xhost" # sh
''
${pkgs.xorg.xhost}/bin/xhost + &> /dev/null
'';
fixX = pkgs.writeScriptBin "fix-X" # sh
''
${fixKeyboard}/bin/fix-Keyboard
for file in `ls ~/.screenlayout`
do
echo $file
~/.screenlayout/$file &> /dev/null
RETURN_CODE=$?
if [[ $RETURN_CODE -eq 0 ]]
then
exit 0;
fi
done
'';
in
[
fixX
fixXhost
(library.desktopFile fixX { longName = "fix X"; })
fixKeyboard
(library.desktopFile fixKeyboard { longName = "fix keyboard"; })
];
}

View file

@ -1,25 +0,0 @@
{ config, pkgs, lib, ... }: {
home-manager.users.mainUser = {
programs.doom-emacs = {
enable = lib.mkDefault true;
doomPrivateDir = ./doom.d;
extraConfig = ''
;; "monospace" means use the system default. However, the default is usually two
;; points larger than I'd like, so I specify size 12 here.
(setq doom-font
(font-spec :family "Jetbrains Mono" :size ${toString config.programs.custom.urxvt.fontSize} :weight 'light))
;(setq doom-font
; (font-spec :family "Terminus" :size ${toString config.programs.custom.urxvt.fontSize} :weight 'light))
'';
emacsPackagesOverlay = self: super: {
# fixes https://github.com/vlaci/nix-doom-emacs/issues/394
gitignore-mode = pkgs.emacsPackages.git-modes;
gitconfig-mode = pkgs.emacsPackages.git-modes;
};
};
};
environment.systemPackages = [
pkgs.ripgrep
];
}

View file

@ -1,264 +0,0 @@
{ pkgs, ... }: {
home-manager.users.mainUser = {
services.dunst = {
enable = false;
settings = {
global = {
font = "Iosevka Term 11";
# Allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the
# message.
markup = "yes";
plain_text = "no";
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# Markup is allowed
format = ''
%a
<b>%s</b>
%b'';
# Sort messages by urgency.
sort = "yes";
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = "yes";
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = "center";
# The frequency with wich text that is longer than the notification
# window allows bounces back and forth.
# This option conflicts with "word_wrap".
# Set to 0 to disable.
bounce_freq = 0;
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 1;
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = "yes";
# Ignore newlines '\n' in notifications.
ignore_newline = "no";
# Hide duplicate's count and stack them
stack_duplicates = "yes";
hide_duplicates_count = "no";
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectevly.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "500x10-0+0";
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = "no";
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
idle_threshold = 0;
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing windowmanager is
# present (e.g. xcompmgr, compiz, etc.).
# transparency = 5
# Which monitor should the notifications be displayed on.
#monitor = keyboard
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = "none";
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = "yes";
# Maximum amount of notifications kept in history
history_length = 15;
# Display indicators for URLs (U) and actions (A).
show_indicators = "no";
# The height of a single line. If the height is smaller than the
# font height, it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 3;
# Draw a line of "separatpr_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 1;
# Padding between text and separator.
padding = 1;
# Horizontal padding.
horizontal_padding = 1;
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = "frame";
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = true;
# dmenu path.
#dmenu = "${pkgs.dmenu}/bin/dmenu -p dunst:";
# Browser for opening urls in context menu.
# browser = /usr/bin/firefox -new-tab
# Align icons left/right/off
icon_position = "off";
max_icon_size = 80;
frame_width = 2;
frame_color = "#8EC07C";
};
shortcuts = {
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = "ctrl+space";
# Close all notifications.
close_all = "ctrl+shift+space";
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1".
#history = "ctrl+grave";
# Context menu.
context = "mod4+u";
};
urgency_low = {
frame_color = "#268bd2";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
urgency_normal = {
frame_color = "#b58900";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
urgency_critical = {
frame_color = "#dc322f";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
};
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg
};
};
}

View file

@ -1,365 +0,0 @@
{ config, lib, pkgs, ... }:
let
cfg = config.home-manager.users.mainUser.xsession.windowManager.i3;
colorTheme =
let
theme = (import ../../../library/colorThemes.nix).solarized.light.hex;
in
theme // {
foreground = theme.base3;
background = theme.base03;
};
# switch to named workspaces
i3-wk-switch = pkgs.i3-wk-switch.overrideAttrs (old: {
src = pkgs.fetchFromGitHub {
owner = "tmfink";
repo = "i3-wk-switch";
rev = "5f43bb8cbe7938eff476fc534b61c8fb6a700c8f";
sha256 = "sha256-DOBPI/wO+S8a6EzWJeVGODXeSixFl7SHTtHAq5DG8GU=";
};
});
backgroundCommand = pkgs.writers.writeDash "background" ''
${pkgs.xorg.xrandr}/bin/xrandr | grep " connected" | \
${pkgs.gnused}/bin/sed -E "s/primary //" | \
${pkgs.coreutils-full}/bin/cut -d' ' -f 3 | \
${pkgs.gnused}/bin/sed -E 's/\+.*$//g' | \
${pkgs.coreutils-full}/bin/sort -r | \
${pkgs.coreutils-full}/bin/head -n 1 | \
${pkgs.gawk}/bin/awk -F 'x' '{print "--width="$1" --height="$2}' | \
${pkgs.findutils}/bin/xargs \
${pkgs.polygon-art.polygon-art}/bin/rings \
/dev/shm/background.png && \
${pkgs.feh}/bin/feh --bg-scale /dev/shm/background.png
'';
in
{
home-manager.users.mainUser = {
programs.i3status-rust = {
enable = true;
bars = {
my = {
icons = "awesome5";
theme = "solarized-light";
# https://github.com/greshake/i3status-rust/blob/v0.22.0/doc/blocks.md
blocks = [
{
block = "cpu";
interval = 1;
}
{
block = "memory";
display_type = "memory";
format_mem = "{mem_used_percents}";
format_swap = "{swap_used_percents}";
}
{
block = "load";
interval = 1;
format = "{1m}";
}
{
block = "battery";
interval = 10;
format = "{percentage} {time}";
}
{ block = "uptime"; }
{
block = "time";
interval = 60;
format = "%Y-%m-%d %R";
}
];
};
};
};
programs.kitty = {
enable = true;
# kitty +kitten themes
theme = "Gruvbox Light Hard";
settings = {
font_family = "JetBrains Mono";
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
font_size = 11;
};
};
programs.alacritty = {
enable = true;
settings = {
import =
let
themes = pkgs.fetchFromGitHub {
owner = "alacritty";
repo = "alacritty-theme";
rev = "024c5c0dfb65197d5796e29e307b321af9a5e198";
sha256 = "sha256-zXyGXZSmmTup5o7Dx6he+57vSFpygR+GSD+3PTxDbVk=";
};
in
[ "${themes}/themes/gruvbox_light.yaml" ];
font = {
normal = {
family = "JetBrains Mono";
style = "Regular";
};
bold = {
family = "JetBrains Mono";
style = "Bold";
};
italic = {
family = "JetBrains Mono";
style = "Italic";
};
size = 6.0;
};
};
};
xsession.windowManager.i3 = {
enable = true;
extraConfig = ''
default_border pixel
'';
config = {
modifier = "Mod4";
terminal = "alacritty";
startup =
let
height = config.configuration.desktop.height;
width = config.configuration.desktop.width;
in
[
{ command = "${pkgs.albert}/bin/albert"; always = true; }
{ command = toString backgroundCommand; always = true; }
#{ command = "${pkgs.flameshot}/bin/flameshot"; always = true; }
# { command = "systemctl --user restart polybar"; always = true; notification = false; }
];
fonts = {
names = [ "JetBrains Mono" ];
size = 11.0;
};
bars =
with colorTheme;
let
selected = blue;
in
[{
mode = "hide";
hiddenState = "hide";
position = "top";
workspaceButtons = true;
workspaceNumbers = true;
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${config.users.users.mainUser.home}/.config/i3status-rust/config-my.toml";
fonts = {
names = [ "JetBrains Mono" ];
size = 11.0;
};
trayOutput = "primary";
colors = {
background = background;
statusline = background;
separator = background;
focusedWorkspace = {
border = selected;
background = base02;
text = foreground;
};
activeWorkspace = {
border = background;
background = base02;
text = foreground;
};
inactiveWorkspace = {
border = background;
background = base02;
text = foreground;
};
urgentWorkspace = {
border = red;
background = base02;
text = foreground;
};
bindingMode = {
border = red;
background = red;
text = background;
};
};
}];
colors = with colorTheme; {
background = background;
focused = {
background = blue;
border = blue;
childBorder = blue;
indicator = blue;
text = foreground;
};
focusedInactive = {
background = base01;
border = base01;
childBorder = base02;
indicator = base02;
text = foreground;
};
unfocused = {
background = base02;
border = base02;
childBorder = base02;
indicator = base02;
text = foreground;
};
urgent = {
background = orange;
border = orange;
childBorder = background;
indicator = background;
text = foreground;
};
};
keybindings = {
"Print" = "exec ${pkgs.flameshot}/bin/flameshot gui -c -p /share/";
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
"${cfg.config.modifier}+Shift+q" = "exit";
"${cfg.config.modifier}+q" = "kill";
"${cfg.config.modifier}+Left" = "focus left";
"${cfg.config.modifier}+Down" = "focus down";
"${cfg.config.modifier}+Up" = "focus up";
"${cfg.config.modifier}+Right" = "focus right";
"${cfg.config.modifier}+j" = "focus next";
"${cfg.config.modifier}+k" = "focus prev";
"${cfg.config.modifier}+Shift+Left" = "move left";
"${cfg.config.modifier}+Shift+Down" = "move down";
"${cfg.config.modifier}+Shift+Up" = "move up";
"${cfg.config.modifier}+Shift+Right" = "move right";
"${cfg.config.modifier}+h" = "split h";
"${cfg.config.modifier}+v" = "split v";
"${cfg.config.modifier}+f" = "fullscreen toggle";
"${cfg.config.modifier}+s" = "layout stacking";
"${cfg.config.modifier}+w" = "layout tabbed";
"${cfg.config.modifier}+e" = "layout toggle split";
"${cfg.config.modifier}+t" = "floating toggle";
#"${cfg.config.modifier}+space" = "focus mode_toggle";
"${cfg.config.modifier}+b" = "exec ${backgroundCommand}";
"${cfg.config.modifier}+p" = "focus parent";
"${cfg.config.modifier}+Shift+minus" = "move scratchpad";
"${cfg.config.modifier}+minus" = "scratchpad show";
"${cfg.config.modifier}+1" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 1";
"${cfg.config.modifier}+2" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 2";
"${cfg.config.modifier}+3" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 3";
"${cfg.config.modifier}+4" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 4";
"${cfg.config.modifier}+5" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 5";
"${cfg.config.modifier}+6" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 6";
"${cfg.config.modifier}+7" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 7";
"${cfg.config.modifier}+8" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 8";
"${cfg.config.modifier}+9" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 9";
"${cfg.config.modifier}+0" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 10";
"${cfg.config.modifier}+Shift+1" = "move container to workspace number 1";
"${cfg.config.modifier}+Shift+2" = "move container to workspace number 2";
"${cfg.config.modifier}+Shift+3" = "move container to workspace number 3";
"${cfg.config.modifier}+Shift+4" = "move container to workspace number 4";
"${cfg.config.modifier}+Shift+5" = "move container to workspace number 5";
"${cfg.config.modifier}+Shift+6" = "move container to workspace number 6";
"${cfg.config.modifier}+Shift+7" = "move container to workspace number 7";
"${cfg.config.modifier}+Shift+8" = "move container to workspace number 8";
"${cfg.config.modifier}+Shift+9" = "move container to workspace number 9";
"${cfg.config.modifier}+Shift+0" = "move container to workspace number 10";
"${cfg.config.modifier}+Escape" = "workspace back_and_forth";
# rename workspace
"${cfg.config.modifier}+n" = ''
exec i3-input -F 'rename workspace to "%s"' -P 'New name for this workspace: '
'';
"${cfg.config.modifier}+grave" =
let
script = pkgs.writers.writeBash "select-workspace" ''
set -e
set -o pipefail
${pkgs.i3}/bin/i3-msg -t get_workspaces | \
${pkgs.jq}/bin/jq --raw-output '.[] | .name' | \
${pkgs.rofi}/bin/rofi -dmenu -p 'Select Workspace' | \
while read line
do
${i3-wk-switch}/bin/i3-wk-switch "$line"
done
'';
in
"exec ${script}";
"${cfg.config.modifier}+Shift+c" = "reload";
"${cfg.config.modifier}+Shift+r" = "restart";
"${cfg.config.modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
"${cfg.config.modifier}+r" = "mode resize";
# multiple monitors
# autorandr --save docked # to save setup
# autorandr --save undocked # to save setup
# autorandr --change # automatically detects the setup
"${cfg.config.modifier}+BackSpace" =
let
xmodmapConfig = pkgs.writeText "xmodmap" ''
!
! Swap Caps_Lock and Control_L
!
! replace capslock keys with Escape Keys
! remove Lock = Caps_Lock
clear Lock
add Lock = Scroll_Lock
keysym Caps_Lock = Escape
! Set Right function Key to Windows-key
keycode 135 = Super_R NoSymbol Super_R NoSymbol Super_R
! Map umlauts to RIGHT ALT + <key>
keycode 108 = Mode_switch
keysym e = e E EuroSign
keysym c = c C cent
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
'';
script = pkgs.writers.writeBash "autorandr" ''
${pkgs.autorandr}/bin/autorandr --change
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
${backgroundCommand}
'';
in
"exec ${toString script}";
# like vimperator
"${cfg.config.modifier}+a" = "exec ${pkgs.i3-easyfocus}/bin/i3-easyfocus";
};
};
};
};
}

View file

@ -1,262 +0,0 @@
{ pkgs, lib, config, ... }:
let
user = "mainUser";
userName = config.users.users.mainUser.name;
home = config.users.users.mainUser.home;
fontSize = config.programs.custom.urxvt.fontSize;
startupBanner = pkgs.fetchurl {
url =
"https://github.com/NixOS/nixos-homepage/raw/master/logo/nix-wiki.png";
sha256 = "1hrz7wr7i0b2bips60ygacbkmdzv466lsbxi22hycg42kv4m0173";
};
ticks = "\"''\"";
in
{
environment.systemPackages = [
# needed for the SPC p g
pkgs.universal-ctags
pkgs.nodePackages.tern
pkgs.emacs
];
# download git repositories into the home folder
systemd.services =
let
clone = repository: folder: branch: {
enable = true;
wantedBy = [ "multi-user.target" ];
description = "clone ${repository} to ${folder}";
serviceConfig.User = userName;
unitConfig.ConditionPathExists = "!${folder}";
script = ''
${pkgs.git}/bin/git clone ${repository} --branch ${branch} ${folder}
'';
};
in
{
spacemacs-pull =
clone "https://github.com/syl20bnr/spacemacs" "${home}/.emacs.d" "master";
# todo move this to spacevim.nix
spacevim-pull =
clone "https://github.com/SpaceVim/SpaceVim.git" "${home}/.SpaceVim"
"master";
};
home-manager.users."${user}" = {
# a file which needs to be included at the end
home.file.".spacemacs.d/hook-init.el".text = ''
;; -*- mode: emacs-lisp -*-
;; just add (load "~/.spacemacs.d/hook-init.el") in your dotspacemacs/init function
;; overrides of dotspacemacs/init ()
(setq
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press <SPC> T n to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one lixft:inconsolata:pixelsizeght)
dotspacemacs-themes '(solarized-light solarized-dark)
;; Specify the startup banner. Default value is `official', it displays
;; the official spacemacs logo. An integer value is the index of text
;; banner, `random' chooses a random text banner in `core/banners'
;; directory. A string value must be a path to an image format supported
;; by your Emacs build.
;; If the value is nil then no banner is displayed. (default 'official)
dotspacemacs-startup-banner "${startupBanner}"
;; Default font, or prioritized list of fonts. `powerline-scale' allows to
;; quickly tweak the mode-line size to make separators look not too crappy.
dotspacemacs-default-font '("Terminus"
:size ${toString fontSize}
:weight normal
:width normal
:powerline-scale 1.1)
) ;; eof
'';
home.file.".spacemacs.d/hook-layers.el".text = ''
;; -*- mode: emacs-lisp -*-
;; just add (load "~/.spacemacs.d/hook-layers.el") in your dotspacemacs/layers function
(let
((user-layers dotspacemacs-configuration-layers))
(setq
dotspacemacs-configuration-layers
(append user-layers
'( python
ansible
rust
windows-scripts
javascript
typescript
html
yaml
auto-completion
git
markdown
restclient
emacs-lisp
nixos
spell-checking
syntax-checking
systemd
lua
terraform
graphviz
c-c++
;; (haskell :variables
;; haskell-enable-hindent t
;; haskell-completion-backend 'lsp
;; haskell-enable-hindent-style "gibiansky"
;; haskell-process-type 'cabal-new-repl)
))))
(let
((user-packages dotspacemacs-additional-packages ))
(setq
dotspacemacs-additional-packages
(append user-packages
'(
;; lsp-mode
;; lsp-ui
;; lsp-haskell
direnv
))))
'';
# a file which needs to be included at the end
home.file.".spacemacs.d/hook-user-config.el".text = ''
;; -*- mode: emacs-lisp -*-
;; just add (load "~/.spacemacs.d/hook-user-config.el") in your dotspacemacs/user-config function
;; turn of smartparens mode off globally
;; https://github.com/Fuco1/smartparens
;;(spacemacs/toggle-smartparens-globally-off)
;;(remove-hook 'prog-mode-hook #'smartparens-mode)
(setq powerline-default-separator 'nil)
(let ((n 2))
(setq coffee-tab-width n)
(setq javascript-indent-level n)
(setq js-indent-level n)
(setq js2-basic-offset n)
(setq web-mode-markup-indent-offset n)
(setq web-mode-css-indent-offset n)
(setq web-mode-code-indent-offset n)
(setq css-indent-offset n))
;; configure indent function correctly
(add-hook 'nix-mode-hook
'(lambda ()
(setq indent-tabs-mode nil)
(setq tab-width 2)
(setq indent-line-function (quote nix-indent-line))))
;; lsp setup for haskell
;; hie-wrapper must be configured in the direnv setup
;; make sure cabal update was executed once on the machine
;; (setq lsp-haskell-process-path-hie "hie-wrapper")
;; (setq lsp-response-timeout 60)
;; (require 'lsp-haskell)
;; (add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-mode-hook #'direnv-update-environment)
;; setup run-assoc
;; in dired mode use C-<RETURN> to open file in associated program
(load "~/.spacemacs.d/run-assoc.el")
(setq associated-program-alist
'(
("${pkgs.evince}/bin/evince" "\\.pdf$")
("${pkgs.libreoffice}/bin/libreoffice" "\\.odt$")
("${pkgs.libreoffice}/bin/libreoffice" "\\.ods$")
${
let
suffixes = [ "jpg" "jpeg" "png" ];
rule = suffix: ''("${pkgs.sxiv}/bin/sxiv" "\\.${suffix}$")'';
in lib.concatStringsSep "\n " (builtins.map rule suffixes)
}
${
let
suffixes = [ "mp4" "mkv" "avi" ];
rule = suffix: ''("${pkgs.mpv}/bin/mpv" "\\.${suffix}$")'';
in lib.concatStringsSep "\n " (builtins.map rule suffixes)
}
)
)
'';
home.file.".spacemacs.d/run-assoc.el".source = pkgs.fetchurl {
url = "https://www.emacswiki.org/emacs/download/run-assoc.el";
sha256 = "1rg0pa09zfslgqnhbqvaa6vdi2fmanrpyzq67ppiin0h1kdgs4im";
};
home.file.".ctags.d/terraform.ctags".text = ''
--langdef=terraform
--langmap=terraform:.tf.tfvars
--regex-terraform=/^[[:space:]]*resource[[:space:]]*"([^"]*)"[[:space:]]*"([^"]*)"/\1.\2/r,Resource/
--regex-terraform=/^[[:space:]]*data[[:space:]]*"([^"]*)"[[:space:]]*"([^"]*)"/\1.\2/d,Data/
--regex-terraform=/^[[:space:]]*variable[[:space:]]*"([^"]*)"/\1/v,Variable/
--regex-terraform=/^[[:space:]]*provider[[:space:]]*"([^"]*)"/\1/p,Provider/
--regex-terraform=/^[[:space:]]*module[[:space:]]*"([^"]*)"/\1/m,Module/
--regex-terraform=/^[[:space:]]*output[[:space:]]*"([^"]*)"/\1/o,Output/
--regex-terraform=/^([a-z0-9_]+)[[:space:]]*=/\1/f,TFVar/
'';
home.file.".spacemacs.d/old/polymode.el".text = ''
;; not used at the moment
(define-hostmode poly-nix-hostmode
:mode 'nix-mode)
(define-innermode poly-nix-lisp-metadata-innermode
:mode 'emacs-lisp-mode
:head-matcher (rx "/* lisp */" (one-or-more space) ${ticks} (zero-or-more space) line-end)
:tail-matcher (rx ${ticks} (zero-or-more space) ";" (zero-or-more space) line-end)
:head-mode 'host
:tail-mode 'host)
(define-innermode poly-nix-shell-metadata-innermode
:mode 'shell-script-mode
:head-matcher (rx "/* sh */" (one-or-more space) ${ticks} (zero-or-more space) line-end)
:tail-matcher (rx ${ticks} (zero-or-more space) ";" (zero-or-more space) line-end)
:head-mode 'host
:tail-mode 'host)
(define-innermode poly-nix-python-metadata-innermode
:mode 'python-mode
:head-matcher (rx "/* python */" (one-or-more space) ${ticks} (zero-or-more space) line-end)
:tail-matcher (rx ${ticks} (zero-or-more space) ";" (zero-or-more space) line-end)
:head-mode 'host
:tail-mode 'host)
(define-innermode poly-nix-haskell-metadata-innermode
:mode 'haskell-mode
:head-matcher (rx "/* haskell */" (one-or-more space) ${ticks} (zero-or-more space) line-end)
:tail-matcher (rx ${ticks} (zero-or-more space) ";" (zero-or-more space) line-end)
:head-mode 'host
:tail-mode 'host)
(define-polymode poly-nix-mode
:hostmode 'poly-nix-hostmode
:innermodes '(poly-nix-lisp-metadata-innermode
poly-nix-shell-metadata-innermode
poly-nix-haskell-metadata-innermode
poly-nix-python-metadata-innermode))
;; remove nix-mode from auto load and replace it with poly-nix-mode
(setq auto-mode-alist (rassq-delete-all 'nix-mode auto-mode-alist))
(add-to-list 'auto-mode-alist '("\\.nix\\'" . poly-nix-mode))
'';
};
}

View file

@ -1,40 +0,0 @@
{ lib, pkgs, ... }: {
environment.systemPackages =
let
spacevimRepo = pkgs.fetchgit {
url = "https://github.com/SpaceVim/SpaceVim.git";
rev = "9b354e05b4716b645ba6366e1265a5048a0c23d5";
sha256 = "1mn28hf857kp0jmbgd89cf5mk4dg53jcbqqrbr9zi3b854sa9ads";
};
vimRc = pkgs.writeText "vimrc" ''
" search/grep case insensitive
:set ignorecase
" tabs should always be 2 spaces
set et ts=2 sts=2 sw=2
" show Trailing Whitespaces
:set list listchars=tab:»·,trail:
" start spacevim
source ${spacevimRepo}/init.vim
" configure command cross
"":hi CursorLine cterm=NONE ctermbg=0 guibg=#073642
"":hi CursorColumn cterm=NONE ctermbg=0 guibg=#073642
""set cursorline
""set cursorcolumn
" disable noisy indentLine
let g:indentLine_enabled = 0
'';
in
[
# vim
(pkgs.writers.writeDashBin "spacevim" ''
exec ${pkgs.neovim}/bin/nvim -u ${vimRc} "$@"
'')
];
}

View file

@ -1,45 +0,0 @@
{ pkgs, lib, ... }:
with lib; {
home-manager.users.mainUser = {
programs.ssh.enable = true;
programs.ssh.matchBlocks = {
"*" = {
identityFile = "~/.ssh/palo_rsa.pub";
identitiesOnly = true;
};
"lassul.us" = {
user = "download";
port = 45621;
};
"*.r" = {
user = "root";
};
"*.secret" = {
user = "root";
};
"*.private" = {
user = "root";
};
"*.lan" = {
user = "root";
};
"github.com" = {
hostname = "ssh.github.com";
user = "root";
};
"es5.siteground.eu" = {
user = "ingolfwa";
port = 18765;
};
"*.onion" = {
user = "root";
};
#"*.compute.amazonaws.com".extraOptions = {
# ProxyCommand = ''
# sh -c "${pkgs.awscli2}/bin/aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
# '';
#};
};
};
}

View file

@ -1,344 +0,0 @@
{ config, pkgs, ... }:
let
mcExt = pkgs.writeText "mc.ext" ''
# gitfs changeset
regex/^\[git\]
Open=%cd %p/changesetfs://
View=%cd %p/patchsetfs://
### Archives ###
# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk, .gem
regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$|\.gem$
Open=%cd %p/utar://
shell/.tar.bz
# Open=%cd %p/utar://
regex/\.t(ar\.bz2|bz2?|b2)$
Open=%cd %p/utar://
# .tar.lzma, .tlz
regex/\.t(ar\.lzma|lz)$
Open=%cd %p/utar://
# .tar.xz, .txz
regex/\.t(ar\.xz|xz)$
Open=%cd %p/utar://
# .tar.F - used in QNX
shell/.tar.F
# Open=%cd %p/utar://
# .qpr/.qpk - QNX Neutrino package installer files
regex/\.qp[rk]$
Open=%cd %p/utar://
# tar
shell/i/.tar
Open=%cd %p/utar://
# lha
type/^LHa\ .*archive
Open=%cd %p/ulha://
# arj
regex/i/\.a(rj|[0-9][0-9])$
Open=%cd %p/uarj://
# cab
shell/i/.cab
Open=%cd %p/ucab://
# ha
shell/i/.ha
Open=%cd %p/uha://
# rar
regex/i/\.r(ar|[0-9][0-9])$
Open=%cd %p/urar://
# ALZip
shell/i/.alz
Open=%cd %p/ualz://
# cpio
shell/.cpio.Z
Open=%cd %p/ucpio://
shell/.cpio.xz
Open=%cd %p/ucpio://
shell/.cpio.gz
Open=%cd %p/ucpio://
shell/i/.cpio
Open=%cd %p/ucpio://
# 7zip archives (they are not man pages)
shell/i/.7z
Open=%cd %p/u7z://
# patch
regex/\.(diff|patch)(\.bz2)$
Open=%cd %p/patchfs://
regex/\.(diff|patch)(\.(gz|Z))$
Open=%cd %p/patchfs://
# ls-lR
regex/(^|\.)ls-?lR(\.gz|Z|bz2)$
Open=%cd %p/lslR://
# trpm
shell/.trpm
Open=%cd %p/trpm://
# RPM packages (SuSE uses *.spm for source packages)
regex/\.(src\.rpm|spm)$
Open=%cd %p/rpm://
shell/.rpm
Open=%cd %p/rpm://
# deb
regex/\.u?deb$
Open=%cd %p/deb://
# dpkg
shell/.debd
Open=%cd %p/debd://
# apt
shell/.deba
Open=%cd %p/deba://
# ISO9660
shell/i/.iso
Open=%cd %p/iso9660://
regex/\.(diff|patch)$
Open=%cd %p/patchfs://
# ar library
regex/\.s?a$
Open=%cd %p/uar://
# gplib
shell/i/.lib
Open=%cd %p/ulib://
# Mailboxes
type/^ASCII\ mail\ text
Open=%cd %p/mailfs://
### Sources ###
# C/C++
regex/i/\.(c|cc|cpp)$
Include=editor
# C/C++ header
regex/i/\.(h|hh|hpp)$
Include=editor
# Fortran
shell/i/.f
Include=editor
# Assembler
regex/i/\.(s|asm)$
Include=editor
include/editor
Open=%var{EDITOR:${pkgs.vim}/bin/vim} %f
### Images ###
shell/i/.gif
Include=image
regex/i/\.jpe?g$
Include=image
shell/i/.bmp
Include=image
shell/i/.png
Include=image
shell/i/.jng
Include=image
shell/i/.mng
Include=image
shell/i/.tiff
Include=image
shell/.ico
Include=image
include/image
Open=${pkgs.sxiv}/bin/sxiv %f
View=${pkgs.sxiv}/bin/sxiv %f
### Sound files ###
regex/i/\.(wav|snd|voc|au|smp|aiff|snd|m4a|ape|aac|wv)$
Include=audio
regex/i/\.(mod|s3m|xm|it|mtm|669|stm|ult|far)$
Include=audio
shell/i/.waw22
Include=audio
shell/i/.mp3
Include=audio
regex/i/\.og[gax]$
Include=audio
regex/i/\.(spx|flac)$
Include=audio
regex/i/\.(midi?|rmid?)$
Include=audio
shell/i/.wma
Include=audio
include/audio
Open=${pkgs.mpv}/bin/mpv %f
View=${pkgs.mpv}/bin/mpv %f
### Video ###
shell/i/.avi
Include=video
regex/i/\.as[fx]$
Include=video
shell/i/.divx
Include=video
shell/i/.mkv
Include=video
regex/i/\.(mov|qt)$
Include=video
regex/i/\.(mp4|m4v|mpe?g)$
Include=video
# MPEG-2 TS container + H.264 codec
shell/i/.mts
Include=video
shell/i/.ts
Include=video
shell/i/.vob
Include=video
shell/i/.wmv
Include=video
regex/i/\.fl[icv]$
Include=video
shell/i/.ogv
Include=video
# WebM
shell/i/.webm
Include=video
type/WebM
Include=video
include/video
Open=${pkgs.mpv}/bin/mpv %f
View=${pkgs.mpv}/bin/mpv %f
### Documents ###
# PDF
shell/i/.pdf
Open=zathura %f
View=zathura %f
### Miscellaneous ###
# Makefile
regex/[Mm]akefile$
Open=make -f %f %{Enter parameters}
### Plain compressed files ###
# ace
shell/i/.ace
Open=%cd %p/uace://
Extract=unace x %f
# arc
shell/i/.arc
Open=%cd %p/uarc://
Extract=arc x %f '*'
Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi
# zip
shell/i/.zip
Open=%cd %p/uzip://
# zip
type/i/^zip\ archive
Open=%cd %p/uzip://
# jar(zip)
type/i/^Java\ Jar\ file\ data\ \(zip\)
Open=%cd %p/uzip://
# zoo
shell/i/.zoo
Open=%cd %p/uzoo://
### Default ###
# Default target for anything not described above
default/*
Open=vim %f
View=vim %f
'';
in
{
environment.systemPackages = [
(pkgs.symlinkJoin {
name = "mc";
paths = [
(pkgs.writers.writeDashBin "mc" ''
export MC_DATADIR=${
pkgs.writers.write "mc-ext" {
"/mc.ext".link = mcExt;
"/sfs.ini".text = "";
}
};
export TERM=xterm-256color
exec ${pkgs.mc}/bin/mc -S xoria256 "$@"
'')
pkgs.mc
];
})
];
}

View file

@ -1,24 +0,0 @@
{ config, pkgs, lib, ... }: {
environment.systemPackages = with pkgs; [ xclip xtrlock-pam xorg.xev ];
system.custom.x11 = {
enable = lib.mkDefault true;
autoLoginUser = config.users.users.mainUser.name;
};
system.custom.fonts.enable = true;
# xinput list < to show devices
# https://unix.stackexchange.com/questions/90572/how-can-i-set-mouse-sensitivity-not-just-mouse-acceleration
#services.xserver.displayManager.sessionCommands = let
# mouseSpeed = name: speed: ''
# ${pkgs.xlibs.xinput}/bin/xinput set-prop "${name}" "Coordinate Transformation Matrix" ${
# toString speed
# } 0 0 0 ${toString speed} 0 0 0 1 || true
# '';
#in lib.concatStringsSep "\n"
#[ (mouseSpeed "Logitech Gaming Mouse G400" 3.1) ];
}

View file

@ -79,7 +79,7 @@
lvs = {
root = {
type = "lvm_lv";
size = "100G";
size = "200G";
content = {
type = "filesystem";
format = "ext4";
@ -91,7 +91,7 @@
};
home = {
type = "lvm_lv";
size = "150G";
size = "250G";
content = {
type = "filesystem";
format = "ext4";