Compare commits

..

1 Commits

Author SHA1 Message Date
genofire 1a88d263b4 home: wayland 2021-10-09 18:07:28 +02:00
30 changed files with 546 additions and 1994 deletions

View File

@ -1,27 +1,14 @@
# Home-Manager # Home-Manager
```bash
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
```
Create `~/.config/nixpkgs/home.nix` with: Create `~/.config/nixpkgs/home.nix` with:
```nix ```nix
{pkgs, ...}: {pkgs, ...}:
{ {
imports = [ imports = [
./repo/desktop-gnome.nix ./repo/default.nix
./repo/desktop.nix
./repo/sway.nix
]; ];
home.packages = with pkgs; [
# yaru-remix-theme
yaru-theme
];
# dconf.settings."org/gnome/shell/extensions/user-theme".name = "Yaru-remix-dark";
dconf.settings."org/gnome/shell/extensions/user-theme".name = "Yaru";
gtk.theme.name = "Flat-Remix-GTK-Violet-Darkest";
} }
``` ```

View File

@ -1,9 +0,0 @@
{pkgs, ...}:
{
imports = [./default.nix];
home.packages = with pkgs; [
poezio
iamb
];
}

View File

@ -1,181 +1,60 @@
{pkgs, lib, ...}: {pkgs, ...}:
{ {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ home.sessionVariables = {
"ookla-speedtest" EDITOR = "nvim";
]; };
home.packages = with pkgs; [ home.packages = with pkgs; [
(python3.withPackages(ps: with ps; [ python3
# ansible
dnspython
youtube-dl
boto3 # aws-s3 support for ansible
kubernetes # is in ansible kubernetes.core module
# dict_utils for an ansible filter_plugin
setuptools
deepmerge
pip
passlib # bcrypt
pyyaml
]))
ansible
killall killall
exa
# tree # use exa
htop htop
mosh mosh
dasel git
pre-commit
git-lfs git-lfs
git-crypt
git-annex
ghorg
tig tig
cocogitto
tea tea
glab glab
figlet figlet
grml-zsh-config
tmux tmux
w3m #neovim
wget
xh xh
minio-client
liboping # fix it liboping # fix it
mtr mtr
ookla-speedtest
hey
colordiff colordiff
git-annex
direnv direnv
## nice prompt together with grml pure-prompt
# pure-prompt #vimPlugins.nvim-lspconfig
# vimPlugins.nvim-lspconfig #vimPlugins.nerdtree
# vimPlugins.nerdtree
#go_1_18
go gcc libcap go gcc libcap
gopls go-langserver
# cargo pass-wayland
rustup
yarn
cmake
pwgen
hugo
asciidoctor-with-extensions
# gotify-cli # use ntfy.sh
glow glow
imagemagick
ffmpeg
# devOps
terraform
tflint
kubectl
kustomize
(wrapHelm kubernetes-helm {
plugins = with kubernetes-helmPlugins; [
helm-diff
helm-secrets
]; ];
})
helmfile
stern
kubeswitch
kubespy
fluxcd
kubeseal
# nixopsUnstable
];
home.shellAliases = {
k9sctx = "k9s --kubeconfig=$(switch)";
k9s = "k9s --headless";
kubectx = "export KUBECONFIG=$(switch)";
ls = "exa";
};
programs.home-manager.enable = false; # use OS
programs.password-store = {
enable = true;
package = pkgs.pass-wayland.withExtensions (exts: [
exts.pass-otp
]);
settings = {
PASSWORD_STORE_DIR = "$HOME/.password-store";
};
};
programs.nushell = {
enable = true;
# envFile.text = ''
# let-env config = {
# hooks: {
# pre_prompt: [{
# code: "
# let direnv = (direnv export json | from json)
# let direnv = if ($direnv | length) == 1 { $direnv } else { {} }
# $direnv | load-env
# "
# }]
# }
# }
# '';
};
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableAutosuggestions = true; enableAutosuggestions = true;
syntaxHighlighting.enable = true; # broken: enableSyntaxHighlighting = true;
# initExtra = '' # grml and pure enabled ....
# source ${pkgs.grml-zsh-config}/etc/zsh/zshrc
# prompt pure
# '';
}; };
programs.starship = {
enable = true;
settings = {
directory ={
truncation_length = 0;
};
helm = {
disabled = true;
};
kubernetes = {
disabled = false;
format = "[$symbol$cluster( \($namespace\))]($style) in ";
detect_extensions = [
"package" # helm
];
};
};
};
programs.atuin = {
enable = false;
settings = {
auto_sync = false;
style = "compact";
search_mode = "fulltext";
filter_mode_shell_up_key_binding = "directory";
exit_mode = "return-query";
};
};
programs.direnv.enable = true;
programs.btop.enable = true;
programs.tealdeer.enable = true; # man / tldr ...
programs.gitui.enable = true;
programs.git = { programs.git = {
enable = true; enable = true;
userName= "genofire";
userEmail = "geno+dev@fireorbit.de";
signing = {
signByDefault = false;
key = "386ED1BF848ABB4A6B4A3C45FC83907C125BC2BC";
};
extraConfig = { extraConfig = {
init.defaultBranch = "main"; init.defaultBranch = "main";
filter.lfs = { annex.sshcaching = true;
required = "true";
clean = "git-lfs clean -- %f";
smudge = "git-lfs smudge -- %f";
process = "git-lfs filter-process";
};
}; };
}; };
programs.neovim = { programs.neovim = {
enable = false; enable = true;
extraConfig = '' extraConfig = ''
syntax on syntax on
set number relativenumber set number relativenumber
@ -190,29 +69,4 @@
} }
]; ];
}; };
programs.helix = {
enable = true;
languages.language = [];
settings = {
theme = "base16_default";
editor = {
lsp.display-messages = true;
};
};
};
services.syncthing = {
enable = true;
tray.enable = true;
};
programs.k9s = {
enable = true;
# does not open ERROR with clusters settings
#settings.k9s = {
# headless = true;
# logger.fullScreenLogs = true;
#};
};
} }

68
home/desktop.nix Normal file
View File

@ -0,0 +1,68 @@
{pkgs, ...}:
{
home.sessionVariables = {
BROWSER = "firefox";
};
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
# env
libnotify
mpv
pavucontrol
# glib gsettings-desktop-schemas - # run gsettings for gnome
noto-fonts
noto-fonts-emoji
powerline-fonts
line-awesome
yubikey-manager
# yubikey-personalization
pinentry-gnome
# dbus
gcr
gnome3.dconf
# apps
gnome.seahorse
nextcloud-client
thunderbird-wayland
dino
homebank
gramps
tootle
fractal
];
gtk = {
enable = true;
theme = {
package = pkgs.flat-remix-gtk;
name = "Flat-Remix-GTK-Blue-Darkest-NoBorder";
};
iconTheme = {
package = pkgs.gnome.defaultIconTheme;
name = "Adwaita";
};
};
programs.gpg = {
enable = true;
settings = {
keyserver = "hkps://keys.openpgp.org";
};
};
services.gnome-keyring.enable = true;
services.gpg-agent = {
enable = true;
enableSshSupport = true;
pinentryFlavor = "gnome3";
};
programs.browserpass = {
enable = true;
browsers = ["firefox"];
};
programs.firefox = {
enable = true;
package = pkgs.firefox-wayland;
};
}

View File

@ -1,138 +0,0 @@
{pkgs, ...}:
{
imports = [../default.nix];
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
BROWSER = "firefox";
GDK_BACKEND = "wayland";
MOZ_ENABLE_WAYLAND = "1";
MOZ_WEBRENDER = "1";
};
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
# env
libnotify
mpv
pavucontrol
# glib gsettings-desktop-schemas - # run gsettings for gnome
noto-fonts
noto-fonts-emoji
powerline-fonts
line-awesome
yubikey-manager
# yubikey-personalization
pinentry-gnome
# dbus
gcr
dconf
# gotify-desktop # use ntfy.sh instatt
# apps
virt-manager
openlens
evince
gthumb
gnome.seahorse
gnome.cheese
nextcloud-client
dino # xmpp
onlyoffice-bin
libreoffice-fresh
inkscape
gimp
homebank
# ahnen
(gramps.override {
enableOSM = true;
enableGraphviz = true;
enableGhostscript = true;
# pythonPath = [ pythonPackages.keyring ];
})
python310Packages.keyring
graphviz-nox
tootle # mastodon
# fractal # matrix
fractal-next
# fluffychat
cozy # audiobooks
];
gtk = {
enable = true;
theme = {
# package = pkgs.yaru-theme;
# name = "Yaru-dark";
# package = pkgs.flat-remix-gtk;
# name = "Flat-Remix-GTK-Blue-Darkest";
# name = "Flat-Remix-GTK-Blue-Darkest-NoBorder";
# name = "Flat-Remix-GTK-Blue-Darker";
package = pkgs.colloid-gtk-theme.override {
sizeVariants = [ "compact" ];
tweaks = [ "black" "rimless" ];
themeVariants = [ "all" ];
};
name = "Colloid-Compact";
};
iconTheme = {
package = pkgs.yaru-theme;
name = "Yaru";
# package = pkgs.flat-remix-icon-theme;
# name = "Flat-Remix-Violet-Dark";
};
};
programs.gpg = {
enable = true;
scdaemonSettings = {
disable-ccid = true;
};
settings = {
keyserver = "hkps://keys.openpgp.org";
};
};
services.gnome-keyring.enable = true;
services.gpg-agent = {
enable = true;
enableSshSupport = true;
pinentryFlavor = "gnome3";
};
programs.browserpass = {
enable = true;
browsers = ["firefox"];
};
programs.librewolf = {
enable = false;
settings = {
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.downloads" = false;
"browser.sessionstore.privacy_level" = 0;
};
};
programs.firefox = {
enable = true;
# nixos not home-manager
# nativeMessagingHosts = {
# fxCast = true;
#};
# package = pkgs.firefox-beta-bin;
# # package = pkgs.firefox-devedition-bin;
# package = pkgs.librewolf;
};
programs.thunderbird = {
enable = true;
package = pkgs.thunderbird-wayland;
settings = {
"general.useragent.override" = "";
"privacy.donottrackheader.enabled" = true;
"mailnews.mark_message_read.auto" = false;
};
profiles.default = {
isDefault = true;
withExternalGnupg = true;
};
};
}

View File

@ -1,94 +0,0 @@
{ config, pkgs, lib, ...}:
{
imports = [./default.nix];
dconf.settings = {
"com/gexperts/Tilix" = {
"focus-follow-mouse" = true;
};
"org/gnome/mutter" = {
"workspaces-only-on-primary" = true;
# display: partly scale (like 150% or 125%)
"experimental-features" = [ "scale-monitor-framebuffer" ];
};
"org/gnome/desktop/input-sources" = {
"sources" = [
(lib.hm.gvariant.mkTuple ["xkb" "de"])
(lib.hm.gvariant.mkTuple ["xkb" "us"])
];
};
"org/gnome/desktop/sound" = {
"allow-volume-above-100-percent" = true;
};
"org/gnome/desktop/wm/keybindings" = {
"toggle-maximized" = [ "<Super>z" ];
"maximize" = [];
"unmaximize" = [];
"close" = [ "<Super>c" "<Alt>F4" ];
"switch-input-source" = [ "<Super>i" "XF86Keyboard" ];
"switch-input-source-backward" = [ "<Shift><Super>i" "<Shift>XF86Keyboard" ];
"switch-to-workspace-1" = [ "<Super>1" ];
"switch-to-workspace-2" = [ "<Super>2" ];
"switch-to-workspace-3" = [ "<Super>3" ];
"switch-to-workspace-4" = [ "<Super>4" ];
"switch-to-workspace-5" = [ "<Super>5" ];
"switch-to-workspace-6" = [ "<Super>6" ];
"switch-to-workspace-7" = [ "<Super>7" ];
"switch-to-workspace-8" = [ "<Super>8" ];
"switch-to-workspace-9" = [ "<Super>9" ];
"switch-to-workspace-10" = [ "<Super>0" ];
"move-to-workspace-1" = [ "<Shift><Super>1" ];
"move-to-workspace-2" = [ "<Shift><Super>2" ];
"move-to-workspace-3" = [ "<Shift><Super>3" ];
"move-to-workspace-4" = [ "<Shift><Super>4" ];
"move-to-workspace-5" = [ "<Shift><Super>5" ];
"move-to-workspace-6" = [ "<Shift><Super>6" ];
"move-to-workspace-7" = [ "<Shift><Super>7" ];
"move-to-workspace-8" = [ "<Shift><Super>8" ];
"move-to-workspace-9" = [ "<Shift><Super>9" ];
"move-to-workspace-10" = [ "<Shift><Super>0" ];
};
"org/gnome/shell" = {
"enabled-extensions" = [
"places-menu@gnome-shell-extensions.gcampax.github.com"
"drive-menu@gnome-shell-extensions.gcampax.github.com"
"screenshot-window-sizer@gnome-shell-extensions.gcampax.github.com"
"auto-move-windows@gnome-shell-extensions.gcampax.github.com"
"pop-shell@system76.com"
"gsconnect@andyholmes.github.io"
];
};
# key bindings
"org/gnome/shell/keybindings" = {
"switch-to-application-1" = [];
"switch-to-application-2" = [];
"switch-to-application-3" = [];
"switch-to-application-4" = [];
"switch-to-application-5" = [];
"switch-to-application-6" = [];
"switch-to-application-7" = [];
"switch-to-application-8" = [];
"switch-to-application-9" = [];
};
};
# programs.firefox.nativeMessagingHosts.gsconnect = true;
# new/replace
# programs.firefox.enableGnomeExtensions = true;
# TODO hä services.gnome.gnome-browser-connector.enable = true;
# programs.firefox.package = pkgs.firefox.overwrite {
# cfg = {
# enableGnomeExtensions = true;
# };
#};
home.packages = with pkgs; [
tilix
gnome.gnome-tweaks
];
}

View File

@ -1,107 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2016 James Murphy
# Licensed under the GPL version 2 only
#
# A battery indicator blocklet script for i3blocks
import re
from subprocess import check_output
status = check_output(['acpi'], universal_newlines=True)
if not status:
# stands for no battery found
fulltext = "<span color='red'>🔞🔋</span>"
percentleft = 100
else:
# if there is more than one battery in one laptop, the percentage left is
# available for each battery separately, although state and remaining
# time for overall block is shown in the status of the first battery
batteries = status.split("\n")
state_batteries=[]
commasplitstatus_batteries=[]
percentleft_batteries=[]
time = ""
for battery in batteries:
if battery!='':
state_batteries.append(battery.split(": ")[1].split(", ")[0])
commasplitstatus = battery.split(", ")
if not time:
time = commasplitstatus[-1].strip()
# check if it matches a time
time = re.match(r"(\d+):(\d+)", time)
if time:
time = ":".join(time.groups())
timeleft = " ({})".format(time)
else:
timeleft = ""
p = int(commasplitstatus[1].rstrip("%\n"))
if p>0:
percentleft_batteries.append(p)
commasplitstatus_batteries.append(commasplitstatus)
state = state_batteries[0]
commasplitstatus = commasplitstatus_batteries[0]
if percentleft_batteries:
percentleft = int(sum(percentleft_batteries)/len(percentleft_batteries))
else:
percentleft = 0
# stands for charging
#FA_LIGHTNING = "<span color='#E88939' font='FontAwesome'>\uf0e7</span>"
#FA_LIGHTNING = "<span color='#E88939'>⚡</span>"
FA_LIGHTNING = "<span color='#E88939'>⚡</span>"
# stands for plugged in
#FA_PLUG = "<span color='#E88939' font='FontAwesome'>\uf1e6</span>"
#FA_PLUG = "<span color='#E88939'>&#128268;</span>"
FA_PLUG = "<span color='#E88939'>🔌</span>"
# stands for using battery
#FA_BATTERY = "<span color='#E88939' font='FontAwesome'>\uf240</span>"
FA_BATTERY = "<span color='#E88939'>🔋</span>"
# stands for unknown status of battery
#FA_QUESTION = "<span color='#E88939' font='FontAwesome'>\uf128</span>"
FA_QUESTION = "<span color='#E88939'>❔</span>"
if state == "Discharging":
fulltext = FA_BATTERY + " "
elif state == "Full":
fulltext = FA_PLUG + " "
timeleft = ""
elif state == "Unknown":
fulltext = FA_BATTERY + " " + FA_QUESTION + " "
timeleft = ""
else:
fulltext = FA_LIGHTNING + " " + FA_PLUG + " "
percentcolor = "#FFFFFF"
if percentleft < 10:
# exit code 33 will turn background red
percentcolor = "#FFFFFF"
elif percentleft < 20:
percentcolor = "#FF3300"
elif percentleft < 30:
percentcolor = "#FF6600"
elif percentleft < 40:
percentcolor = "#FF9900"
elif percentleft < 50:
percentcolor = "#FFCC00"
elif percentleft < 60:
percentcolor = "#FFFF00"
elif percentleft < 70:
percentcolor = "#FFFF33"
elif percentleft < 80:
percentcolor = "#FFFF66"
fulltext += '<span color="{}">{}%</span>'.format(percentcolor, percentleft)
fulltext += timeleft
print(fulltext)
print(fulltext)
if percentleft < 10:
exit(33)

View File

@ -1,38 +0,0 @@
#!/bin/sh
# Copyright (C) 2014 Alexander Keller <github@nycroth.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------
INTERFACE="${BLOCK_INSTANCE:-wlan0}"
#------------------------------------------------------------------------
# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless
# connection (think desktop), the corresponding block should not be displayed.
[[ ! -d /sys/class/net/${INTERFACE}/wireless ]] ||
[[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit
COLOR_MAC="${COLOR_MAC:-grey}"
COLOR_FREQ="${COLOR_FREQ:-white}"
COLOR_SIGNAL="${COLOR_SIGNAL:-#589df6}"
COLOR_BANDWIDTH="${COLOR_BANDWIDTH:-grey}"
echo -n " ";
iw dev $INTERFACE link | head -8 | grep -vE '(SSID|TX|RX)' \
| sed -e "s/.*to .*\([0-9a-f:]\{5\}\) .on.*/<span color='$COLOR_MAC'>\1<\/span>/g; s/^\s//g" \
| tr -d "\n" \
| sed -e "s/freq: / <span color='$COLOR_FREQ'>/g; s/signal: /<\/span> <span color='$COLOR_SIGNAL'>/g; s/mrx bitrate: \([0-9\.]*\).*tx bitrate: \([0-9\.]*\).*/<\/span> <span color='$COLOR_BANDWIDTH'>\1\/\2<\/span>/g;"
echo ""

View File

@ -1,556 +0,0 @@
{ config, pkgs, lib, ...}:
with lib;
let
cfg = config.my.sway;
lock = "${pkgs.swaylock-effects}/bin/swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 10 --fade-in 0.2 --submit-on-touch";
in
{
imports = [./default.nix];
options.my.sway = with pkgs.lib; {
KDEConnect = mkOption {
default = true;
type = types.bool;
description = "enable KDEConnect support";
};
xwayland = mkOption {
default = false;
type = types.bool;
description = "enable xwayland support";
};
mail = mkOption {
default = true;
type = types.bool;
description = "enable mail support (thunderbird)";
};
nextcloud = mkOption {
default = true;
type = types.bool;
description = "enable nextcloud support";
};
XMPP = mkOption {
default = false;
type = types.bool;
description = "enable XMPP support ()";
};
};
config = mkMerge [
(mkIf cfg.KDEConnect {
services.kdeconnect = {
enable = true;
indicator = true;
};
})
{
home.sessionVariables = {
_JAVA_AWT_WM_NONREPARENTING = "1";
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
XDG_CURRENT_DESKTOP = "sway";
};
home.packages = with pkgs; [
# sway
# alacritty
# swayidle
# swaylock-effects
# mako
# wl-clipboard
#- xdg-desktop-portal-wlr
# bemenu
# i3blocks
# acpi
# lm_sensors
# ponymix
# brightnessctl
# gammastep
# grim
# slurp
# kdeconnect
# wdisplays
];
services.poweralertd.enable = true;
services.kanshi = {
enable = true;
profiles = {
way.outputs = [{
criteria = "Japan Display Inc. 0x364C Unknown";
status = "enable";
scale = 1.25;
}];
homeleft.outputs = [{
criteria = "Japan Display Inc. 0x364C Unknown";
status = "enable";
scale = 1.25;
position = "0,0";
} {
criteria = "LG Electronics LG HDR 4K 0x0000655D";
status = "enable";
scale = 1.0;
position = "2400,0";
mode = "3840x2160";
}];
};
};
wayland.windowManager.sway =
let
ws1 = "1💬";
#ws2 = "2📝";
ws2 = "2🌟";
ws3 = "3🍁";
ws4 = "4🍀";
ws5 = "5🌈";
ws6 = "6💎";
ws7 = "7🎥";
ws8 = "8🌍";
ws9 = "9🔒";
ws10 = "10🌀";
white = "#ffffff";
cyan = "#00afd7";
transcyan = "#00afd762";
aqua = "#00d787";
violet = "#800080";
wine = "#72003e";
magenta = "#af005f";
orange = "#ff8700";
silver = "#e4e4e4";
gray = "#353535";
elegant = "#1b1d1e";
black = "#000000";
transparent = "#000000b2";
modifier = "Mod4";
menu = "bemenu-run -i -p 'Run:' --fn 'pango:monospace 7'";
# config.wayland.windowManager.sway.config.modifier;
in {
enable = true;
xwayland = cfg.xwayland;
config = {
input = {
"*" = {
xkb_layout = "de";
xkb_model = "chromebook";
# no click needed
tap = "enabled";
};
"1452:544:Apple,_Inc_Apple_Keyboard" = {
xkb_layout = "us";
};
};
output = {
"*".bg = "~/.config/wallpaper.png fill";
## fireThink
#"Unknown 0x226D 0x00000000" = {
# enable = "";
#};
## fireG0
#"Unknown 0x405C 0x00000000" = {
# position = "0 0";
# # scale = "0.7";
# # resolution = "1920x1080";
# resolution = "1366x768@60Hz";
#};
## fireEmerald
#"Unknown 0x364C 0x00000000" = {
# position = "0 0";
# scale = "1.25";
# # does it work?
# enable = "";
#};
# "Japan Display Inc. 0x364C Unknown" = {
# position = "0 0";
# scale = "1.25";
# enable = "";
# };
# "LG Electronics LG HDR 4K 0x0000655D" = {
# position = "2400 0";
# enable = "";
# scale = "1.0";
# # disable = true;
# # resolution = "3840x2160@30Hz";
# resolution = "3840x2160";
# };
# "Goldstar Company Ltd LG HDR 4K 0x0000655D" = {
# position = "2400 0";
# enable = "";
# scale = "1.0";
# # disable = true;
# # resolution = "3840x2160@30Hz";
# resolution = "3840x2160";
# };
#"HEADLESS-1" = {
# resolution = "2560x1440";
#};
#"DP-1" = {
# position = "3000 0";
# # resolution = "2560x1440";
#};
# "DP-2" = {
# position = "1920 0";
# # position = "4480 0";
# # resolution = "1280x1024";
# };
};
modifier = "${modifier}";
menu = "${menu}";
terminal = "alacritty";
fonts = { names = ["monospace"]; style = "monospace"; size = 7.0;};
colors = {
focused = { background = "${transcyan}"; border = "${transcyan}"; childBorder = "${transcyan}"; indicator = "${white}"; text = "${elegant}"; };
focusedInactive = { background = "${transparent}"; border = "${transparent}"; childBorder = "${transparent}"; indicator = "${magenta}"; text = "${cyan}"; };
unfocused = { background = "${transparent}"; border = "${transparent}"; childBorder = "${transparent}"; indicator = "${white}"; text = "${orange}"; };
urgent = { background = "${magenta}"; border = "${magenta}"; childBorder = "${magenta}"; indicator = "${magenta}"; text = "${silver}"; };
placeholder = { background = "${magenta}"; border = "${magenta}"; childBorder = "${magenta}"; indicator = "${white}"; text = "${silver}"; };
background = "${transparent}";
};
bars = [{
position = "top";
statusCommand = "i3blocks";
trayOutput = "*";
colors = {
statusline = "${white}";
# focusedStatusline = "${white}";
background = "${transparent}";
# focusedBackground = "${transparent}";
activeWorkspace = { background = "${gray}"; border = "${gray}"; text = "${white}"; };
focusedWorkspace = { background = "${cyan}"; border = "${gray}"; text = "${white}"; };
inactiveWorkspace = { background = "${black}"; border = "${black}"; text = "${orange}"; };
urgentWorkspace = { background = "${magenta}"; border = "${magenta}"; text = "${white}"; };
bindingMode = { background = "${orange}"; border = "${orange}"; text = "${white}"; };
};
}];
window = {
border = 1;
titlebar = false;
# hideEdgeBorders = "smart_no_gaps";
hideEdgeBorders = "smart";
commands = [
{ command = "move to scratchpad"; criteria = { title = "Firefox.* Sharing Indicator"; }; }
{ command = "sticky enable"; criteria = { title = "Picture-in-Picture"; }; }
{ command = "floating enable"; criteria = { title = "Picture-in-Picture"; }; }
{ command = "floating enable"; criteria = { title = "Extension: \(Tree Style Tab\) - .*"; }; }
];
};
gaps = {
inner = 2;
outer = 0;
smartGaps = true;
smartBorders = "no_gaps";
};
modes.resize = {
Left = "resize shrink width 10 px or 10 ppt";
Down = "resize grow height 10 px or 10 ppt";
Up = "resize shrink height 10 px or 10 ppt";
Right = "resize grow width 10 px or 10 ppt";
j = "resize grow height 10 px or 10 ppt";
k = "resize shrink height 10 px or 10 ppt";
l = "resize grow width 10 px or 10 ppt";
h = "resize shrink width 10 px or 10 ppt";
Return = "mode default";
Escape = "mode default";
"${modifier}+r" = "mode default";
};
workspaceAutoBackAndForth = true;
keybindings = {
"${modifier}+Return" = "exec alacritty";
# "${modifier}+Return" = "exec ${config.wayland.windowManager.sway.config.terminal}";
"${modifier}+Shift+c" = "reload";
"${modifier}+Shift+r" = "restart";
"${modifier}+c" = "kill";
"${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway?' -b 'Yes, exit sway' 'swaymsg exit'";
"${modifier}+Shift+h" = "split h";
"${modifier}+Shift+v" = "split v";
"${modifier}+z" = "fullscreen toggle";
"${modifier}+s" = "layout stacking";
"${modifier}+w" = "layout tabbed";
"${modifier}+e" = "layout toggle split";
"${modifier}+Shift+space" = "floating toggle";
"${modifier}+space" = "focus mode_toggle";
"${modifier}+a" = "focus parent";
"${modifier}+d" = "focus child";
"${modifier}+v" = "exec ${menu}";
"${modifier}+x" = "sticky toggle";
"${modifier}+Shift+x" = "move workspace to output left";
"${modifier}+r" = "mode resize";
# window
"${modifier}+Left" = "focus left";
"${modifier}+Down" = "focus down";
"${modifier}+Up" = "focus up";
"${modifier}+Right" = "focus right";
"${modifier}+j" = "focus left";
"${modifier}+k" = "focus down";
"${modifier}+l" = "focus up";
"${modifier}+odiaeresis" = "focus right";
"${modifier}+Shift+Left" = "move left";
"${modifier}+Shift+Down" = "move down";
"${modifier}+Shift+Up" = "move up";
"${modifier}+Shift+Right" = "move right";
"${modifier}+Shift+j" = "move left";
"${modifier}+Shift+k" = "move down";
"${modifier}+Shift+l" = "move up";
"${modifier}+Shift+odiaeresis" = "move right";
# workspace
"${modifier}+1" = "workspace number ${ws1}";
"${modifier}+2" = "workspace number ${ws2}";
"${modifier}+3" = "workspace number ${ws3}";
"${modifier}+4" = "workspace number ${ws4}";
"${modifier}+5" = "workspace number ${ws5}";
"${modifier}+6" = "workspace number ${ws6}";
"${modifier}+7" = "workspace number ${ws7}";
"${modifier}+8" = "workspace number ${ws8}";
"${modifier}+9" = "workspace number ${ws9}";
"${modifier}+0" = "workspace number ${ws10}";
"${modifier}+Shift+1" = "move container to workspace number ${ws1}";
"${modifier}+Shift+2" = "move container to workspace number ${ws2}";
"${modifier}+Shift+3" = "move container to workspace number ${ws3}";
"${modifier}+Shift+4" = "move container to workspace number ${ws4}";
"${modifier}+Shift+5" = "move container to workspace number ${ws5}";
"${modifier}+Shift+6" = "move container to workspace number ${ws6}";
"${modifier}+Shift+7" = "move container to workspace number ${ws7}";
"${modifier}+Shift+8" = "move container to workspace number ${ws8}";
"${modifier}+Shift+9" = "move container to workspace number ${ws9}";
"${modifier}+Shift+0" = "move container to workspace number ${ws10}";
"XF86AudioLowerVolume" = "exec ponymix -N decrease 5";
"${modifier}+XF86AudioLowerVolume" = ''exec "ponymix -N -t source -d $(ponymix -t source list | grep source | grep -v -E '(monitor|fallback)' | sed -r 's/source\s([0-9]+):.*/\1/') decrease 5"'';
"XF86AudioRaiseVolume" = "exec ponymix -N increase 5";
"${modifier}+XF86AudioRaiseVolume" = ''exec "ponymix -N -t source -d $(ponymix -t source list | grep source | grep -v -E '(monitor|fallback)' | sed -r 's/source\s([0-9]+):.*/\1/') increase 5"'';
"XF86AudioMute" = "exec ponymix -N toggle";
"${modifier}+XF86AudioMute" = ''exec "ponymix -N -t source -d $(ponymix -t source list | grep source | grep -v -E '(monitor|fallback)' | sed -r 's/source\s([0-9]+):.*/\1/') toggle"'';
"XF86AudioMicMute" = ''exec "ponymix -N -t source -d $(ponymix -t source list | grep source | grep -v -E '(monitor|fallback)' | sed -r 's/source\s([0-9]+):.*/\1/') toggle"'';
"XF86MonBrightnessUp" = ''exec brightnessctl set +10% && \
notify-send -h "int:value:$(brightnessctl -m info | cut -d',' -f4)" -i display-brightness-symbolic -a Display Light -t 1000'';
"XF86MonBrightnessDown" = ''exec brightnessctl set 10%- && \
notify-send -h "int:value:$(brightnessctl -m info | cut -d',' -f4)" -i display-brightness-symbolic -a Display Light -t 1000'';
"XF86Display" = ''exec "swaymsg output eDP-1 toggle"'';
"${modifier}+p" = "exec passmenu";
"${modifier}+F11" = ''exec "${lock}"'';
"Print" = ''exec "grim -g \"$(slurp)\""'';
};
assigns = {
"${ws1}" = [
{ app_id = "(?i)empathy"; }
{ app_id = "(?i)gajim"; }
{ app_id = "(?i)dino"; }
{ app_id = "(?i)pidgin"; }
];
"${ws2}" = [
{ app_id = "(?i)thunderbird"; }
{ app_id = "(?i)evolution"; }
];
"${ws4}" = [
{ app_id = "(?i)atril"; }
{ app_id = "(?i)evince"; }
];
"${ws7}" = [
{ app_id = "(?i)mpv"; }
];
"${ws8}" = [
{ app_id = "(?i)firefox"; }
{ app_id = "(?i)firefoxdeveloperedition"; }
];
};
floating = {
modifier = modifier;
};
startup = [
# { command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK"; }
# { command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK" ; }
# { command = "swayidle -w \\
# timeout 300 'swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch' \\
# timeout 600 'swaymsg output * dpms off' \\
# resume 'swaymsg output * dpms on' \\
# before-sleep 'swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch'"; }
#{ command = "mako"; }
#{ command = "kanshi"; }
# indicator
{ command = "networkd-notify"; }
# needs x11
#{ command = "udiskie -t"; }
#{ command = "modem-manager-gui -i"; }
#{ command = "nm-applet"; }
# apps
{ command = "firefox"; }
#{ command = "firefoxdeveloperedition"; }
] ++ lib.optionals (cfg.mail) [
{ command = "thunderbird"; }
] ++ lib.optionals (cfg.nextcloud) [
{ command = "nextcloud"; }
] ++ lib.optionals (cfg.XMPP) [
{ command = "dino"; }
#{ command = "gajim"; }
];
};
extraConfig = ''
set $laptop eDP-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
exec_always "cat /proc/acpi/button/lid/*/state | grep -q open && swaymsg output $laptop enable || swaymsg output $laptop disable"
'';
};
services.swayidle = {
enable = true;
timeouts = [
{ timeout = 300; command = "${lock}"; }
{ timeout = 600; command = "${pkgs.sway}/bin/swaymsg output * dpms off"; }
];
events = [
{ event = "before-sleep"; command = "${lock}"; }
{ event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg output * dpms on"; }
];
};
# use nixos's ....
# from programs.sway:
# xdg.portal.enable = true;
# xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
services.mako = {
enable = true;
font = "monospace 7";
iconPath = "/home/genofire/.nix-profile/share/icons/Adwaita/:/home/genofire/.nix-profile/share/icons/hicolor/";
maxIconSize = 32;
margin = "2";
padding = "3";
width = 380;
format = "<b>[%a] %s %h</b>\\n%b";
maxVisible = 14;
# layer = "overlay";
groupBy = "app-name,summary";
sort = "+time";
backgroundColor = "#000000bf";
borderColor = "#000000bf";
#borderColor = "#00afd7";
borderRadius = 4;
extraConfig = ''
[app-name=""]
width=380
[app-name=""]
format=<b>%s %h</b>\n%b
[app-name="notify-send"]
format=<b>%s %h</b>\n%b
[grouped]
format=(%g) <b>[%a] %s %h</b>\n%b
[actionable]
border-radius=4
[urgency=low]
border-color=#00d787a0
progress-color=over #00d78760
[urgency=normal]
progress-color=over #1c1c1ca0
#progress-color=over #00afd7a0
[urgency=high]
border-color=#af005fa0
progress-color=over #af005f60
[app-icon="kdeconnect"]
format=<b>%s %h</b>\n%b
border-color=#353535
background-color=#1b1d1e
border-size=1
anchor=top-left
'';
};
services.gammastep = {
enable = true;
provider = "geoclue2";
# duskTime = "22:00-23:00";
# dawnTime = "6:00-10:00";
};
programs.alacritty = {
enable = true;
settings = {
window.opacity = 0.95;
font.size = 8;
colors.primary = {
background = "0x000000";
foreground = "0xffffff";
};
};
};
xdg.configFile."i3blocks/bin/wifi".source = ./sway-i3block/wifi;
xdg.configFile."i3blocks/bin/battery".source = ./sway-i3block/battery;
xdg.configFile."i3blocks/config".text = ''
align=center
separator=true
separator_block_width=15
markup=pango
# color=#f8f8f2
color=#e4e4e4
# background=#00afd7
[root]
label= 💽
command=df -h / | awk 'FNR==2 { gsub(/[A-Za-z]/, ""); printf " %i<span color=\"#589df6\">G</span>\n", $4 }'
interval=3
[memory]
label= 💾
command=free --giga | awk 'FNR==2{ printf " %i<span color=\"#589df6\">G</span>\n", $7 }'
interval=2
[wifi]
label=
command=~/.config/i3blocks/bin/wifi
interval=5
color=#589df6
[volume]
command=if ponymix -t sink is-muted; then echo '🔇'; else if test $(ponymix -t sink get-volume) -gt 50; then echo -n "🔊"; else echo -n "🔉"; fi; echo "$(ponymix -t sink get-volume)<span color=\"#589df6\">%</span>"; fi
interval=1
[mic]
command=if ponymix -t source is-muted; then echo '<span color="#ffffff"></span>'; else echo "<span color=\"#ff5555\"> $(ponymix -t source get-volume)%</span>"; fi
interval=1
[battery]
command=~/.config/i3blocks/bin/battery
interval=2
color=#ff5555
[time]
label=
command=date '+%T'
interval=1
'';
}];
}

8
home/home.nix Normal file
View File

@ -0,0 +1,8 @@
{pkgs, ...}:
{
imports = [
./repo/default.nix
./repo/desktop.nix
./repo/sway.nix
];
}

313
home/sway.nix Normal file
View File

@ -0,0 +1,313 @@
{ config, pkgs, ... }:
{
home.sessionVariables = {
XDG_CURRENT_DESKTOP = "sway";
MOZ_ENABLE_WAYLAND = "1";
};
home.packages = with pkgs; [
sway
alacritty
swayidle
swaylock-effects
mako
wl-clipboard
xdg-desktop-portal-wlr
bemenu
i3blocks
acpi
lm_sensors
ponymix
brightnessctl
#gammastep
grim
slurp
];
wayland.windowManager.sway =
let
ws1 = "1💬";
#ws2 = "2📝";
ws2 = "2🌟";
ws3 = "3🍁";
ws4 = "4🍀";
ws5 = "5🌈";
ws6 = "6💎";
ws7 = "7🎥";
ws8 = "8🌍";
ws9 = "9🔒";
ws10 = "10🌀";
white = "#ffffff";
cyan = "#00afd7";
acqua = "#00d787";
violet = "#800080";
wine = "#72003e";
magenta = "#af005f";
orange = "#ff8700";
silver = "#e4e4e4";
gray = "#353535";
elegant = "#1b1d1e";
# transparent = "#000000";
transparent = "#000000b2";
modifier = "Mod4";
menu = "bemenu-run -i -p 'Run:' --fn 'pango:monospace 7'";
# config.wayland.windowManager.sway.config.modifier;
in {
enable = true;
xwayland = false;
config = {
input = {
"*" = {
xkb_layout = "de";
xkb_model = "chromebook";
# no click needed
tap = "enabled";
};
"1452:544:Apple,_Inc_Apple_Keyboard" = {
xkb_layout = "us";
};
};
output = {
"*".bg = "~/.config/wallpaper.png fill";
# fireThink
"Unknown 0x226D 0x00000000" = {
enable = "";
};
# fireG0
"Unknown 0x405C 0x00000000" = {
position = "0 0";
# scale = "0.7";
# resolution = "1920x1080";
resolution = "1366x768@60Hz";
};
# fireEmerald
"Unknown 0x364C 0x00000000" = {
position = "0 0";
scale = "1.25";
};
"Goldstar Company Ltd LG HDR 4K 0x0000655D" = {
position = "3000 0";
enable = "";
# disable = true;
# resolution = "3840x2160@30Hz";
resolution = "3840x2160";
};
"HEADLESS-1" = {
resolution = "2560x1440";
};
"DP-1" = {
position = "3000 0";
# resolution = "2560x1440";
};
# "DP-2" = {
# position = "1920 0";
# # position = "4480 0";
# # resolution = "1280x1024";
# };
};
modifier = "${modifier}";
menu = "${menu}";
terminal = "alacritty";
# fonts = { names = ["monospace"]; style = "monospace"; size = 7;};
fonts = [ "pango:monospace 7" ];
colors = {
focused = { background = "${cyan}"; border = "${cyan}"; childBorder = "${cyan}"; indicator = "${white}"; text = "${elegant}"; };
focusedInactive = { background = "${gray}"; border = "${gray}"; childBorder = "${gray}"; indicator = "${magenta}"; text = "${cyan}"; };
unfocused = { background = "${elegant}"; border = "${elegant}"; childBorder = "${elegant}"; indicator = "${white}"; text = "${orange}"; };
urgent = { background = "${magenta}"; border = "${magenta}"; childBorder = "${magenta}"; indicator = "${magenta}"; text = "${silver}"; };
placeholder = { background = "${magenta}"; border = "${magenta}"; childBorder = "${magenta}"; indicator = "${white}"; text = "${silver}"; };
background = "${transparent}";
};
bars = [{
position = "top";
statusCommand = "i3blocks";
colors = {
statusline = "${white}";
# focusedStatusline = "${white}";
background = "${elegant}";
# focusedBackground = "${transparent}";
activeWorkspace = { background = "${cyan}"; border = "${gray}"; text = "${white}"; };
focusedWorkspace = { background = "${cyan}"; border = "${cyan}"; text = "${white}"; };
inactiveWorkspace = { background = "${transparent}"; border = "${elegant}"; text = "${orange}"; };
urgentWorkspace = { background = "${magenta}"; border = "${magenta}"; text = "${white}"; };
bindingMode = { background = "${orange}"; border = "${orange}"; text = "${white}"; };
};
}];
gaps = {
inner = 2;
outer = 0;
smartGaps = true;
smartBorders = "no_gaps";
};
modes.resize = {
Left = "resize shrink width 10 px or 10 ppt";
Down = "resize grow height 10 px or 10 ppt";
Up = "resize shrink height 10 px or 10 ppt";
Right = "resize grow width 10 px or 10 ppt";
j = "resize grow height 10 px or 10 ppt";
k = "resize shrink height 10 px or 10 ppt";
l = "resize grow width 10 px or 10 ppt";
h = "resize shrink width 10 px or 10 ppt";
Return = "mode default";
Escape = "mode default";
"${modifier}+r" = "mode default";
};
workspaceAutoBackAndForth = true;
keybindings = {
"${modifier}+Return" = "exec alacritty";
# "${modifier}+Return" = "exec ${config.wayland.windowManager.sway.config.terminal}";
"${modifier}+Shift+c" = "reload";
"${modifier}+Shift+r" = "restart";
"${modifier}+c" = "kill";
"${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway?' -b 'Yes, exit sway' 'swaymsg exit'";
"${modifier}+Shift+h" = "split h";
"${modifier}+Shift+v" = "split v";
"${modifier}+z" = "fullscreen toggle";
"${modifier}+s" = "layout stacking";
"${modifier}+w" = "layout tabbed";
"${modifier}+e" = "layout toggle split";
"${modifier}+Shift+space" = "floating toggle";
"${modifier}+space" = "focus mode_toggle";
"${modifier}+a" = "focus parent";
"${modifier}+d" = "focus child";
"${modifier}+v" = "exec ${menu}";
"${modifier}+x" = "sticky toggle";
"${modifier}+Shift+x" = "move workspace to output left";
"${modifier}+r" = "mode resize";
# workspace
"${modifier}+1" = "workspace number ${ws1}";
"${modifier}+2" = "workspace number ${ws2}";
"${modifier}+3" = "workspace number ${ws3}";
"${modifier}+4" = "workspace number ${ws4}";
"${modifier}+5" = "workspace number ${ws5}";
"${modifier}+6" = "workspace number ${ws6}";
"${modifier}+7" = "workspace number ${ws7}";
"${modifier}+8" = "workspace number ${ws8}";
"${modifier}+9" = "workspace number ${ws9}";
"${modifier}+0" = "workspace number ${ws10}";
"${modifier}+Shift+1" = "move container to workspace number ${ws1}";
"${modifier}+Shift+2" = "move container to workspace number ${ws2}";
"${modifier}+Shift+3" = "move container to workspace number ${ws3}";
"${modifier}+Shift+4" = "move container to workspace number ${ws4}";
"${modifier}+Shift+5" = "move container to workspace number ${ws5}";
"${modifier}+Shift+6" = "move container to workspace number ${ws6}";
"${modifier}+Shift+7" = "move container to workspace number ${ws7}";
"${modifier}+Shift+8" = "move container to workspace number ${ws8}";
"${modifier}+Shift+9" = "move container to workspace number ${ws9}";
"${modifier}+Shift+0" = "move container to workspace number ${ws10}";
"XF86AudioLowerVolume" = "exec ponymix -N decrease 5";
"${modifier}+XF86AudioLowerVolume" = ''exec "ponymix -N -t source -d $(ponymix -t source list | grep source | grep -v -E '(monitor|fallback)' | sed -r 's/source\s([0-9]+):.*/\1/') decrease 5"'';
"XF86AudioRaiseVolume" = "exec ponymix -N increase 5";
"${modifier}+XF86AudioRaiseVolume" = ''exec "ponymix -N -t source -d $(ponymix -t source list | grep source | grep -v -E '(monitor|fallback)' | sed -r 's/source\s([0-9]+):.*/\1/') increase 5"'';
"XF86AudioMute" = "exec ponymix -N toggle";
"${modifier}+XF86AudioMute" = ''exec "ponymix -N -t source -d $(ponymix -t source list | grep source | grep -v -E '(monitor|fallback)' | sed -r 's/source\s([0-9]+):.*/\1/') toggle"'';
"XF86AudioMicMute" = ''exec "ponymix -N -t source -d $(ponymix -t source list | grep source | grep -v -E '(monitor|fallback)' | sed -r 's/source\s([0-9]+):.*/\1/') toggle"'';
"XF86MonBrightnessUp" = ''exec "sh ~/.local/bin/key_light.sh up"'';
"XF86MonBrightnessDown" = ''exec "sh ~/.local/bin/key_light.sh down"'';
"XF86Display" = ''exec "swaymsg output eDP-1 toggle"'';
"${modifier}+p" = "exec passmenu";
"${modifier}+F11" = ''exec "swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch"'';
"Print" = ''exec "grim -g \"$(slurp)\""'';
};
assigns = {
"${ws1}" = [
{ app_id = "(?i)empathy"; }
{ app_id = "(?i)gajim"; }
{ app_id = "(?i)dino"; }
{ app_id = "(?i)pidgin"; }
];
"${ws2}" = [
{ app_id = "(?i)thunderbird"; }
{ app_id = "(?i)evolution"; }
];
"${ws4}" = [
{ app_id = "(?i)atril"; }
{ app_id = "(?i)evince"; }
];
"${ws7}" = [
{ app_id = "(?i)mpv"; }
];
"${ws8}" = [
{ app_id = "(?i)firefox"; }
{ app_id = "(?i)firefoxdeveloperedition"; }
];
};
floating = {
modifier = modifier;
};
window = {
border = 1;
# hideEdgeBorders = "smart_no_gaps";
hideEdgeBorders = "smart";
commands = [
{ command = "move to scratchpad"; criteria = { title = "Firefox.* Sharing Indicator"; }; }
{ command = "sticky enable"; criteria = { title = "Picture-in-Picture"; }; }
{ command = "floating enable"; criteria = { title = "Picture-in-Picture"; }; }
{ command = "floating enable"; criteria = { title = "Extension: \(Tree Style Tab\) - .*"; }; }
];
};
startup = [
{ command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK"; }
{ command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK" ; }
{ command = "swayidle -w \\
timeout 300 'swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch' \\
timeout 600 'swaymsg output * dpms off' \\
resume 'swaymsg output * dpms on' \\
before-sleep 'swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch'"; }
{ command = "mako"; }
#{ command = "kanshi"; }
# indicator
{ command = "/usr/lib/kdeconnectd"; }
{ command = "kdeconnect-indicator"; }
{ command = "networkd-notify"; }
# needs x11
#{ command = "udiskie -t"; }
#{ command = "modem-manager-gui -i"; }
#{ command = "nm-applet"; }
# apps
{ command = "thunderbird"; }
{ command = "firefox"; }
#{ command = "firefoxdeveloperedition"; }
{ command = "nextcloud"; }
{ command = "dino"; }
#{ command = "gajim"; }
];
};
};
services.gammastep = {
enable = true;
provider = "geoclue2";
# duskTime = "22:00-23:00";
# dawnTime = "6:00-10:00";
};
programs.alacritty = {
enable = false;
settings = {
background_opacity = 0.95;
font.size = 8;
schemes.base16.primary.background = "0x0a0a0a";
colors = "*base16";
};
};
}

View File

@ -1,82 +0,0 @@
{config, pkgs, lib, ...}:
let
createChromiumExtensionFor = browserVersion: { id, sha256, version }:
{
inherit id;
crxPath = builtins.fetchurl {
url = "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${browserVersion}&x=id%3D${id}%26installsource%3Dondemand%26uc";
name = "${id}.crx";
inherit sha256;
};
inherit version;
};
createChromiumExtension = createChromiumExtensionFor (lib.versions.major pkgs.ungoogled-chromium.version);
in
{
programs.browserpass.browsers = [ "chromium" ];
programs.chromium = {
enable = true;
package = (pkgs.ungoogled-chromium.override {
commandLineArgs = [
"--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer"
"--ozone-platform=wayland"
];
});
extensions = [
## browserpass
{
# id = "naepdomgkenhinolocfifgehidddafch";
id = "pjmbgaakjkbhpopmakjoedenlfdmcdgm";
# id = "klfoddkbhleoaabpmiigbmpbjfljimgb";
# crxPath = "/tmp/a.crx";
crxPath = (builtins.fetchurl {
url = "https://github.com/browserpass/browserpass-extension/releases/download/3.7.2/browserpass-github-3.7.2.crx";
name = "naepdomgkenhinolocfifgehidddafch.crx";
});
updateUrl = "https://github.com/browserpass/browserpass-extension/releases/download/3.7.2/browserpass-github-3.7.2.crx";
version = "3.7.2";
}
#(createChromiumExtension {
# id = "naepdomgkenhinolocfifgehidddafch";
## "naepdomgkenhinolocfifgehidddafch"
# sha256 = "1gwy7fa1076ynaspz8rsfrp29cizgp7dk2wbznaxhbmim9ys6hkq";
# version = "3.7.2";
#})
## ublock origin
(createChromiumExtension {
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
# "cjpalhdlnbpafiamejdnhcphjbkeiagm"
sha256 = "1i14y4sq9vl01wqhlgxmdv6knhjm622llc8ycbq3l2k389shj7ng";
version = "1.46.0";
})
## uMatrix
(createChromiumExtension {
id = "ogfcmafjalglgifnmanfmnieipoejdcf";
# "ogfcmafjalglgifnmanfmnieipoejdcf"
sha256 = "0l1i79naglp2xbqvkvrw7340749wncdql8dklrklz3b406c01cmf";
version = "1.4.4";
})
## ipvFoo
(createChromiumExtension {
id = "ecanpcehffngcegjmadlcijfolapggal";
# "ecanpcehffngcegjmadlcijfolapggal"
sha256 = "1b8ail2sj14xaisw25c29c0hvwn8qv612rg50x8lwajwxh143caf";
version = "2.3";
})
## Vertical Tabs by Michael
#(createChromiumExtension {
# id = "pddljdmihkpdfpkgmbhdomeeifpklgnm";
## "pddljdmihkpdfpkgmbhdomeeifpklgnm"
# sha256 = "19hb2gmkr4fb4mnsyvak0k1w33m3v9yjsad5lzcm8yamna18829y";
# version = "2.0.4";
#})
# Tabs in Sidebar
(createChromiumExtension {
id = "akahnknmcbmgodngfjcflnaljdbhnlfo";
sha256 = "0ydbfmhpkwrsf4zyhl4v5abjq7wm46j41r6scq5kbn536lih298q";
version = "0.0.5";
})
];
};
}

View File

@ -1,12 +0,0 @@
{ config, pkgs, ... }:
{
programs.vscode = {
enable = true;
package = (pkgs.vscodium.override {
# commandLineArgs = [
# "--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer"
# "--ozone-platform=wayland"
# ];
});
};
}

View File

@ -1,81 +0,0 @@
{ pkgs, ... }:
{
nixpkgs.config.packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
};
};
programs.firefox = {
# package = pkgs.librewolf;
# package = pkgs.firefox-wayland;
profiles."main" = {
id = 0;
bookmarks = {
"github".url = "https://github.com";
};
search.default = "DuckDuckGo";
settings = {
"extensions.pocket.enabled" = false;
#----
"browser.tabs.unloadOnLowMemory" = false;
# to enable userChrome
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
#----
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
#----
"privacy.donottrackheader.enabled" = true;
# all cockies from cross-site blocked
"network.cookie.cookieBehavior" = 1;
# tracking in all tabs
"privacy.trackingprotection.enabled" = true;
"privacy.trackingprotection.cryptomining.enabled" = true;
"privacy.trackingprotection.fingerprinting.enabled" = true;
# new
# https everywhere
"dom.security.https_only_mode" = true;
"dom.security.https_only_mode_ever_enabled" = true;
# DNS over HTTPS disabled
"doh-rollout.disable-heuristics" = true;
"network.trr.mode" = 5;
# autofill (TODO)
"dom.forms.autocomplete.formautofill" = false;
"extensions.formautofill.creditCards.enabled" = false;
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
umatrix
browserpass
tree-style-tab
];
userChrome = ''
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
// about:config - toolkit.legacyUserProfileCustomizations.stylesheets
// tab-toolbar - all versions
#titlebar {
display: none;
}
#tabbrowser-tabs,
#TabsToolbar,
#main-window:not([tabsintitlebar="true"]) #TabsToolbar {
visibility: collapse !important;
}
// hide sidebar-headers (Tree Style Tab)
#sidebar-header {
display: none;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
display: none;
}
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar > .toolbar-items {
opacity: 0;
pointer-events: none;
}
'';
};
};
}

View File

@ -1,33 +0,0 @@
{pkgs, ...}:
{
home.packages = with pkgs; [
buildah
podman
podman-tui
podman-compose
];
xdg.configFile."containers/registries.conf".text = ''
[registries.search]
registries = ['docker.io']
[registries.block]
registries = []
'';
xdg.configFile."containers/policy.json".text = ''
{
"default": [
{
"type": "insecureAcceptAnything"
}
],
"transports":
{
"docker-daemon":
{
"": [{"type":"insecureAcceptAnything"}]
}
}
}
'';
}

View File

@ -35,12 +35,3 @@ Create `/etc/nixos/configuration.nix` with:
``` ```
and run `nixos-rebuild switch --upgrade` and run `nixos-rebuild switch --upgrade`
## my current package channels
```
nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixos https://nixos.org/channels/nixos-unstable
nixpkgs https://nixos.org/channels/nixpkgs-unstable
```

35
nixos/configuration.nix Normal file
View File

@ -0,0 +1,35 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
./repo/default.nix
./repo/desktop.nix
./repo/genofire.nix
];
system.stateVersion = "21.05";
# boot
boot.zfs.requestEncryptionCredentials = []; # list -> default: true - always request for password
# --------
# specifical this maschine:
# --------
networking.hostId = "6a465f93"; # zfs needed
networking.hostName = "fireEmerald"; # Define your hostname.
# cryptsetup
# boot.initrd.luks.enable = true;
boot.initrd.luks.devices = {
"croot" = {
device = "/dev/disk/by-uuid/e75385e9-b733-49d4-91fd-6ac2fa821195" ;
};
};
}

View File

@ -3,42 +3,25 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, pkgs, ... }:
let
pkgsHomeManager = import <home-manager> {};
in
{ {
system.autoUpgrade.enable = true; system.autoUpgrade.enable = true;
nix.optimise.automatic = true;
nix.gc.automatic = true;
nixpkgs.config.allowUnfree = true;
# boot
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# zfs
boot.initrd.supportedFilesystems = ["zfs"]; # boot from zfs
boot.supportedFilesystems = [ "zfs" ];
#boot.kernelParams = [ "nohibernate" ];
services.zfs.autoScrub.enable = true;
networking.useNetworkd = true;
networking.useDHCP = false; networking.useDHCP = false;
# for k3s services.openssh.enable = true;
#networking.firewall.enable = true; # is already enabled ...
networking.firewall.allowedUDPPorts = [ 5355 ]; # LLMNR
services.openssh = {
enable = true;
openFirewall = true;
ports = [ 1512 ];
startWhenNeeded = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "without-password";
};
};
users.users.root.openssh.authorizedKeys.keys = [
"command=\"zrepl stdinserver fireStore\",restrict ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM1U9DTKueKuTuu/F9wxGr3we7y00V8HMyUjVBMwFQwo root-zrepl@fireStore"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIOr9wE3i1+Cl/06WOf0/6OjxsOnN7veV3LZcWgtHkcS genofire@fireYoga"
];
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_IE.UTF-8"; i18n.defaultLocale = "en_IE.UTF-8";
i18n.supportedLocales = [
"en_US.UTF-8/UTF-8"
"en_IE.UTF-8/UTF-8"
];
console = { console = {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";
keyMap = "de"; keyMap = "de";
@ -48,89 +31,28 @@ in
python3 python3
killall killall
htop htop
bat mosh
git git
git-lfs git-lfs
tig tig
helix
tcpdump
iperf3
bmon
figlet figlet
grml-zsh-config
tmux tmux
neovim
xh xh
liboping liboping
mtr mtr
jq home-manager
unzip
unrar
## nice prompt together with grml
# pure-prompt
nushell
] ++ [
pkgsHomeManager.home-manager
]; ];
environment.shellAliases = {
ip = "ip --color";
watch = "watch -c";
grep = "grep --color=always --exclude-dir=.git";
vim = "hx";
k9s = "k9s --headless";
};
environment.variables.EDITOR = "hx";
programs.mosh.enable = true; # open firewall
programs.neovim = {
enable = false;
defaultEditor = false;
configure.customRC = ''
syntax on
set number relativenumber
'';
};
# zsh # zsh
# users.defaultUserShell = pkgs.nushell;
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
programs.zsh = { programs.zsh.enable = true;
enable = true; programs.zsh.autosuggestions.enable = true;
autosuggestions.enable = true; programs.zsh.syntaxHighlighting.enable = true;
syntaxHighlighting.enable = true; programs.zsh.interactiveShellInit = ''
# interactiveShellInit = '' source ${pkgs.grml-zsh-config}/etc/zsh/zshrc
# promptInit = '' '';
# source ${pkgs.grml-zsh-config}/etc/zsh/zshrc programs.zsh.promptInit = "";
# prompt pure;
# '';
# promptInit = "";
};
programs.starship = {
enable = true;
settings = {
directory ={
truncation_length = 0;
};
helm = {
disabled = true;
};
kubernetes = {
disabled = false;
format = "[$symbol$cluster( \($namespace\))]($style) in ";
detect_extensions = [
"package" # helm
];
detect_folders = [
"flux-system"
"helm"
"templates"
];
};
};
};
imports = [
# tmux
./files/tmux.nix
];
} }

29
nixos/desktop.nix Normal file
View File

@ -0,0 +1,29 @@
{ pkgs, ... }:
{
networking.wireless.iwd.enable = true;
systemd.network.networks.wifi.matchConfig = { Name = "wlan0";};
systemd.network.networks.wifi.DHCP = "ipv4";
sound.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
#alsa.support32bit = true;
pulse.enable = true;
};
#services.acpid.enable = true;
environment.systemPackages = with pkgs; [
iw
];
# allow wayland / sway
hardware.opengl.enable = true;
# gtk config
programs.dconf.enable = true;
# smartcard
services.pcscd.enable = true;
}

View File

@ -1,14 +0,0 @@
{ pkgs, ... }:
{
imports = [
./default.nix
../hardware/network.nix
];
services.cage = {
enable = true;
extraArguments = [
"-d"
];
};
}

View File

@ -1,66 +0,0 @@
{ pkgs, lib, ... }:
{
networking.wireless.iwd = {
enable = true;
settings = {
General = {
AddressRandomization = "network";
# EnableNetworkConfiguration = false;
# RoamThreshold = -70;
# RoamThreshold5G = -90;
RoamRetryInterval = 10;
};
# Network.EnableIPv6 = true;
Rank.BandModifier5Ghz = 5.0;
# Scan.DisablePeriodicScan = true;
};
};
hardware.bluetooth.enable = true;
sound.enable = true;
hardware.pulseaudio.enable = false; #use pipewire
services.pipewire = {
enable = true;
alsa.enable = true;
# alsa.support32bit = true;
pulse.enable = true;
};
environment.systemPackages = with pkgs; [
iw
# pulseaudio-modules-bt
## android-tools
];
# syncthing
networking.firewall.allowedTCPPorts = [ 22000 ];
networking.firewall.allowedUDPPorts = [ 22000 21027 ];
programs.browserpass.enable = true;
# smartcard
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "gnome3";
};
programs.kdeconnect = {
enable = true;
};
services.udev.extraRules = lib.mkMerge [
# meine maus geht immer aus
# # autosuspend USB devices
# ''ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="auto"''
# # autosuspend PCI devices
# ''ACTION=="add", SUBSYSTEM=="pci", TEST=="power/control", ATTR{power/control}="auto"''
# disable Ethernet Wake-on-LAN
''ACTION=="add", SUBSYSTEM=="net", NAME=="enp*", RUN+="${pkgs.ethtool}/sbin/ethtool -s $name wol d"''
];
services.upower.enable = true;
}

View File

@ -1,29 +0,0 @@
{ pkgs, ... }:
{
imports = [./default.nix];
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
networking.networkmanager.wifi.backend = "iwd";
# systemd.network.networks.loop = {
# matchConfig.Name = "lo";
# linkConfig.RequiredForOnline = false;
# networkConfig.KeepConfiguration = true;
# };
systemd.network.networks.wifi = {
matchConfig.Name = "wlan0";
linkConfig.RequiredForOnline = false;
networkConfig.KeepConfiguration = true;
};
environment.systemPackages = with pkgs; [
gnome.networkmanager-openvpn
gnome.gnome-power-manager
gnomeExtensions.pop-shell
];
programs.kdeconnect.package = pkgs.gnomeExtensions.gsconnect;
}

View File

@ -1,64 +0,0 @@
{ pkgs, ... }:
{
imports = [
./default.nix
../hardware/network.nix
];
services.greetd = {
enable = true;
settings = {
default_session = {
# command = "${pkgs.greetd.greetd}/bin/agreety --cmd sway";
command = "${pkgs.greetd.tuigreet}/bin/tuigreet -t -r --remember-user-session --asterisks --cmd sway";
# missing compositor
# command = "${pkgs.greetd.wlgreet}/bin/wlgreet --command sway";
};
};
# package = pkgs.greetd.tuigreet;
# package = pkgs.greetd.wlgreet;
# package = pkgs.greetd.gtkgreet;
# package = pkgs.greetd.regreet;
};
programs.sway = {
enable = true;
wrapperFeatures = { gtk = true; };
extraPackages = with pkgs; [
alacritty
swayidle
swaylock-effects
mako
bemenu
# - bar
i3blocks
acpi
lm_sensors
# - tools
wl-clipboard
wdisplays
ponymix
brightnessctl
gammastep
grim
slurp
];
};
location.provider = "geoclue2";
xdg.portal.wlr = {
enable = true;
settings.screencast = {
chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
};
};
# done my sway:
# security.pam.services.swaylock = {};
# hardware.opengl.enable = true;
# fonts.enableDefaultFonts = true;
# programs.dconf.enable = true; # gtk theme
# services.acpid.enable = true;
}

View File

@ -1,113 +0,0 @@
{
environment.etc."tmux.conf".text = ''
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
# set scrollback history to 10000 (10k)
set -g history-limit 10000
# use send-prefix to pass C-a through to application
bind C-a send-prefix
# shorten command delay
set -sg escape-time 1
# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1
# reload ~/.tmux.conf using PREFIX r
bind r source-file /etc/tmux.conf \; display "Reloaded!"
# use PREFIX | to split window horizontally and PREFIX - to split vertically
bind | split-window -h
bind - split-window -v
# Make the current window the first window
bind T swap-window -t 1
# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# and use C-h and C-l to cycle thru panes
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# resize panes using PREFIX H, J, K, L
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5
set -g mouse on
######################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-style fg=black
set -g pane-active-border-style fg=brightred
## Status bar design
# status line
##set -g status-utf8 on
set -g status-justify left
set -g status-style bg=default,fg=colour12
set -g status-interval 2
# messaging
set -g message-style fg=black,bg=yellow
set -g message-command-style fg=blue,bg=black
#window mode
setw -g mode-style bg=colour6,fg=colour0
# window status
setw -g window-status-separator ""
setw -g window-status-style bg=colour234,fg=colour7
setw -g window-status-format "#[fg=colour234]#[fg=white,bold]#I#[nobold] #W #[reverse,fg=colour234]"
setw -g window-status-current-style bg=colour240
setw -g window-status-current-format "#[fg=colour234]#[fg=white,bold]#I#[nobold] #W #[reverse,fg=colour234]"
setw -g window-status-bell-style fg=black,bg=colour1,bold
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
# The modes {
setw -g clock-mode-colour colour135
setw -g mode-style fg=colour196,bg=colour238,bold
# }
# The panes {
set -g pane-border-style bg=colour235,fg=colour238
set -g pane-active-border-style bg=colour236,fg=colour51
# }
# The statusbar {
set -g status-position top
set -g status-style bg=colour16,fg=colour137
set -g status-left "#[bg=colour202,fg=colour15,bold]#h #[reverse,fg=colour12,nobold]#[reverse,bg=colour15] #S(#{session_attached}) #I-#P #[bg=colour232,noreverse,nobold]"
set -g status-right "#[fg=colour14,nobold]#[reverse,bg=colour15] #{client_prefix} #[reverse,bg=colour13]#[noreverse,fg=colour15] %H:%M:%S"
set -g status-right-length 30
set -g status-left-length 26
# }
# The messages {
set -g message-style fg=colour16,bg=colour202,bold
# }
'';
}

20
nixos/genofire.nix Normal file
View File

@ -0,0 +1,20 @@
{pkgs, config, ... }:
{
services.postgresql = {
enable = true;
package = pkgs.postgresql_14;
dataDir = "/var/lib/postgres/${config.services.postgresql.package.psqlSchema}";
# dataDir = /var/lib/postgres/data;
};
users.users.genofire = {
uid = 1021;
home = "/home/genofire";
extraGroups = ["wheel"];
isNormalUser = true;
useDefaultShell = true;
};
security.pam.services.swaylock = {};
}

View File

@ -1,61 +0,0 @@
{ config, pkgs, ... }:
{
imports = [../default.nix];
# boot
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# zfs
boot.initrd.supportedFilesystems = ["zfs"]; # boot from zfs
boot.supportedFilesystems = [ "zfs" ];
#boot.kernelParams = [ "nohibernate" ];
services.zfs.autoScrub.enable = true;
networking.firewall.allowedTCPPorts = [ 9091 ];
services.zrepl = {
enable = true;
settings = {
global.monitoring = [{
type = "prometheus";
listen = ":9091";
}];
jobs = [{
name = "fireStore";
type = "source";
serve = {
type = "stdinserver";
client_identities = [ "fireStore" ];
};
snapshotting = {
type = "periodic";
interval = "24h";
prefix = "zrepl_fireStore_";
};
send.encrypted = false;
filesystems = {
"zroot/ROOT<" = true;
"zroot/ROOT" = false;
"zroot/local<" = false;
"zroot/local/nix" = false;
"zroot/data<" = true;
"zroot/data" = false;
"zroot/home<" = true;
"zroot/home" = false;
};
}];
};
};
networking.useNetworkd = true;
networking.useDHCP = false;
services.udev.packages = with pkgs; [
android-udev-rules
];
environment.systemPackages = with pkgs; [
pciutils
wireguard-tools
];
}

View File

@ -1,16 +0,0 @@
{pkgs, ...}:
{
imports = [
./default.nix
];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
# vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
];
};
}

View File

@ -1,70 +0,0 @@
{ pkgs, ... }:
{
imports = [
./default.nix
];
systemd.network.networks.wifi = {
matchConfig = {
Name = "wlan0";
SSID = [
"!HotoHo-v6"
];
};
DHCP = "ipv4";
networkConfig = {
IPv6AcceptRA = true;
IPv6PrivacyExtensions = true;
};
};
systemd.network.networks.wifi-v6 = {
matchConfig = {
Name = "wlan0";
SSID = [
"urbanForest-v6"
];
};
networkConfig = {
DNSSEC = false;
IPv6AcceptRA = true;
IPv6PrivacyExtensions = true;
};
};
systemd.network.networks.wifi-unsec = {
matchConfig = {
Name = "wlan0";
SSID = [
"wanderverein" # fake to keep
# "urbanForest"
];
};
DHCP = "ipv4";
networkConfig = {
IPv6AcceptRA = true;
IPv6PrivacyExtensions = true;
DNSSEC = false;
DNS = [
"2001:4860:4860::8888"
"8.8.8.8"
];
};
dhcpV4Config = {
UseDomains = false;
UseDNS = false;
};
dhcpV6Config = {
UseDNS = false;
};
ipv6AcceptRAConfig = {
UseDNS = false;
};
};
systemd.network.networks.eth = {
matchConfig.Name = "en*";
DHCP = "ipv4";
networkConfig = {
IPv6AcceptRA = true;
IPv6PrivacyExtensions = true;
};
};
}

View File

@ -1,28 +0,0 @@
{ pkgs, ... }:
{
networking.firewall.allowedTCPPorts = [
# k8s api
6443
# metrics-server
10250
];
services.k3s = {
enable = true;
role = "server";
extraFlags = toString [
"--disable traefik,metrics-server" # manuelle ... with ipv6 enable
];
};
systemd.services.k3s = {
wants = [ "containerd.service" ];
after = [ "containerd.service" ];
serviceConfig.MemoryMax = "2G";
};
environment.systemPackages = with pkgs; [
k3s
k9s
kubectl
];
}

View File

@ -1,64 +0,0 @@
{
imports = [
./default.nix
];
networking.firewall.allowedTCPPorts = [
80
443
];
networking.firewall.allowedUDPPorts = [
443
];
# for quic3 - max size to 2.5MB
boot.kernelParams = [
"net.core.rmem_max=2500000"
"net.core.wmem_max=2500000"
];
services.traefik = {
enable = true;
staticConfigOptions = {
experimental.http3 = true;
entryPoints = {
web = {
address = ":80";
};
websecure = {
address = ":443";
http3 = {};
};
};
providers = {
kubernetesIngress = {
allowEmptyServices = true;
allowExternalNameServices = true;
};
kubernetesCRD = {
allowCrossNamespace = true;
allowEmptyServices = true;
allowExternalNameServices = true;
};
};
api.dashboard = true;
metrics.prometheus.entryPoint = "websecure";
certificatesResolvers.letsencrypt.acme = {
storage = "/var/lib/traefik/acme/acme.json";
caServer = "https://acme-v02.api.letsencrypt.org/directory";
tlsChallenge = {};
};
};
dynamicConfigOptions = {
http.middlewares = {
"redirect-https".redirectScheme = {
scheme = "https";
permanent = true;
};
};
};
};
systemd.services.traefik.environment = {
KUBECONFIG = "/var/lib/traefik/k3s-kubeconfig.yaml";
};
}