Compare commits

...

15 Commits

@ -0,0 +1,31 @@
[bell]
animation = "EaseOutExpo"
color = "#666666"
duration = 30
[colors.primary]
background = "#1d1f21"
foreground = "#c5c8c6"
[font]
size = 7.0
[[keyboard.bindings]]
action = "Paste"
key = "V"
mode = "~Vi"
mods = "Control|Shift"
[[keyboard.bindings]]
action = "Copy"
key = "C"
mods = "Control|Shift"
[[keyboard.bindings]]
action = "SearchForward"
key = "F"
mode = "~Search"
mods = "Control|Shift"
[window]
opacity = 0.8

@ -0,0 +1,20 @@
[bell]
animation = "EaseOutExpo"
color = "#333333"
duration = 100
[colors.primary]
background = "#1d1f21"
foreground = "#c5c8c6"
[font]
size = 9.0
[window]
decorations = "none"
opacity = 0.75
startup_mode = "Maximized"
[window.position]
x = 0
y = 0

@ -0,0 +1,258 @@
#!/bin/bash
# Copyright (C) 2011 by Wayne Walker <wwalker@solid-constructs.com>
#
# Released under one of the versions of the MIT License.
#
# Copyright (C) 2011 by Wayne Walker <wwalker@solid-constructs.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
sfa_init() {
_ssh_agent_sockets=()
_live_agent_list=()
_live_agent_sock_list=()
_sorted_live_agent_list=()
# Set $sfa_path array to the dirs to search for ssh-agent sockets
sfa_set_path
if ! command -v 'timeout' &>/dev/null; then
printf "ssh-find-agent.sh: 'timeout' command could not be found.\n"
printf " Please install 'coreutils' via your system's package manager.\n"
fi
}
# Allow users to override the default path to search for ssh-agent sockets
# The first of the variable found is used to set the path:
# SSH_FIND_AGENT_PATH (colon separated dir list)
# _TMPDIR_OVERRIDE for legacy compatibility
# TMPDIR (if set) (plus /tmp due to ssh bug)
sfa_set_path() {
sfa_path=()
if [[ -n "$SSH_FIND_AGENT_PATH" ]]; then
IFS=':' read -r -a sfa_path <<<"$SSH_FIND_AGENT_PATH"
else
# Maintain backwards compatibility with the old _TMPDIR_OVERRIDE variable
if [[ -n "$_TMPDIR_OVERRIDE" ]]; then
sfa_path=("$_TMPDIR_OVERRIDE")
else
if [[ -n "$TMPDIR" ]]; then
sfa_path=("/tmp" "$TMPDIR")
else
sfa_path=("/tmp")
fi
fi
fi
}
sfa_err() {
# shellcheck disable=SC2059
printf "$@" 1>&2
}
sfa_debug() {
if ((_DEBUG > 0)); then
sfa_err "$@" 1>&2
fi
}
sfa_find_all_agent_sockets() {
_ssh_agent_sockets=$(
find "${sfa_path[@]}" -maxdepth 2 -type s -name agent.\* 2>/dev/null | grep '/ssh-.*/agent.*'
find "${sfa_path[@]}" -maxdepth 2 -type s -name S.gpg-agent.ssh 2>/dev/null | grep '/gpg-.*/S.gpg-agent.ssh'
find "${sfa_path[@]}" -maxdepth 2 -type s -name ssh 2>/dev/null | grep '/keyring-.*/ssh$'
find "${sfa_path[@]}" -maxdepth 2 -type s -regex '.*/ssh-.*/agent..*$' 2>/dev/null
)
sfa_debug "$_ssh_agent_sockets"
}
sfa_test_agent_socket() {
local socket=$1
local output
output=$(SSH_AUTH_SOCK=$socket timeout 0.4 ssh-add -l 2>&1)
result=$?
[[ "$output" == "error fetching identities: communication with agent failed" ]] && result=2
sfa_debug $result
case $result in
0 | 1 | 141)
# contactible and has keys loaded
{
OIFS="$IFS"
IFS=$'\n'
# shellcheck disable=SC2207
_keys=($(SSH_AUTH_SOCK=$socket ssh-add -l 2>/dev/null))
IFS="$OIFS"
}
_live_agent_list+=("${#_keys[@]}:$socket")
return 0
;;
2 | 124)
# socket is dead, delete it
sfa_err 'socket (%s) is dead, removing it.\n' "$socket"
sfa_debug "rm -rf ${socket%/*}"
rm -rf "${socket%/*}"
;;
125 | 126 | 127)
sfa_err 'timeout returned <%s>\n' "$result" 1>&2
;;
*)
sfa_err 'Unknown failure timeout returned <%s>\n' "$result" 1>&2
;;
esac
case $result in
0 | 1)
_live_agent_list+=("$_key_count:$socket")
return 0
;;
esac
return 1
}
sfa_verify_sockets() {
for i in $_ssh_agent_sockets; do
sfa_test_agent_socket "$i"
done
}
sfa_fingerprints() {
local file="$1"
while read -r l; do
[[ -n "$l" && ${l##\#} = "$l" ]] && ssh-keygen -l -f /dev/stdin <<<"$l"
done <"$file"
}
sfa_print_choose_menu() {
# find all the apparent socket files
# the sockets go into $_ssh_agent_sockets[]
sfa_find_all_agent_sockets
# verify each socket, discarding if dead
# the live sockets go into $_live_agent_list[]
sfa_verify_sockets
sfa_debug '<%s>\n' "${_live_agent_list[@]}"
# shellcheck disable=SC2207
IFS=$'\n' _sorted_live_agent_list=($(sort -u <<<"${_live_agent_list[*]}"))
unset IFS
sfa_debug "SORTED:\n"
sfa_debug ' <%s>\n' "${_sorted_live_agent_list[@]}"
local i=0
local sock
for agent in "${_sorted_live_agent_list[@]}"; do
i=$((i + 1))
sock=${agent/*:/}
if [[ "$1" = "-i" ]]; then
_live_agent_sock_list[$i]=$sock
printf '#%i)\n' "$i"
printf ' export SSH_AUTH_SOCK=%s\n' "$sock"
# Get all the forwarded keys for this agent, parse them and print them
SSH_AUTH_SOCK=$sock ssh-add -l 2>&1 |
grep -v 'error fetching identities for protocol 1: agent refused operation' |
while IFS= read -r key; do
parts=("$key")
key_size="${parts[0]}"
fingerprint="${parts[1]}"
remote_name="${parts[2]}"
key_type="${parts[3]}"
printf ' %s %s\t%s\t%s\n' "$key_size" "$key_type" "$remote_name" "$fingerprint"
done
else
printf '%s\n' "$sock"
fi
done
}
sfa_set_ssh_agent_socket() {
case $1 in
-c | --choose)
sfa_print_choose_menu -i
((0 == ${#_live_agent_list[@]})) && {
sfa_err 'No agents found.\n'
return 1
}
read -p "Choose (1-${#_live_agent_sock_list[@]})? " -r choice
if [ "$choice" -eq "$choice" ]; then
[[ -z "${_live_agent_sock_list[$choice]}" ]] && {
sfa_err 'Invalid choice.\n'
return 1
}
printf 'Setting export SSH_AUTH_SOCK=%s\n' "${_live_agent_sock_list[$choice]}"
export SSH_AUTH_SOCK=${_live_agent_sock_list[$choice]}
fi
;;
-a | --auto)
# Choose the last one, as they are sorted numerically by how many keys they have
sock=$(sfa_print_choose_menu | tail -n -1)
[[ -z "$sock" ]] && return 1
sfa_debug 'export SSH_AUTH_SOCK=%s\n' "$sock"
export SSH_AUTH_SOCK=$sock
;;
*)
sfa_usage
;;
esac
# set agent pid - this is unreliable as the pid may be of the child rather than the agent
if [ -n "$SSH_AUTH_SOCK" ]; then
export SSH_AGENT_PID=$(($(basename "$SSH_AUTH_SOCK" | cut -d. -f2) + 1))
fi
return 0
}
sfa_usage() {
sfa_err 'ssh-find-agent <[-c|--choose|-a|--auto|-h|--help]>\n'
return 1
}
# Renamed for https://github.com/wwalker/ssh-find-agent/issues/12
ssh_find_agent() {
sfa_init
case $1 in
-c | --choose | -a | --auto)
sfa_set_ssh_agent_socket "$1"
return $?
;;
-l | --list)
sfa_print_choose_menu -i
;;
*)
sfa_usage
;;
esac
}
# Original function name is still supported.
# https://github.com/wwalker/ssh-find-agent/issues/12 points out that I
# should use ssh_find_agent() for best compatibility.
ssh-find-agent() {
ssh_find_agent "$@"
}

@ -0,0 +1,185 @@
# 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, secrets, ... }:
{
# Enable OpenGL
hardware.graphics.enable = true;
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
programs.nix-ld.enable = true;
# Bootloader.
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
networking.hostName = "Felix-Desktop"; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
services.xserver = {
enable = true;
xkb = {
layout = "de";
variant = "";
};
};
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
services.xrdp = {
defaultWindowManager = "startplasma-x11";
enable = true;
openFirewall = true;
};
# Configure console keymap
console.keyMap = "de";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
programs.zsh.enable = true;
users.users.felix = {
isNormalUser = true;
description = "Felix";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs.kdePackages; [
kate
kcalc
partitionmanager
kmail
];
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIkbAVXWPpN7jAJrf/1h8QHNW3LMQ0LaMTl8gnVzufPV fheitmann@fheitmann-flip"
# secrets.ssh-key-pub
];
};
# Install firefox.
programs.firefox.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
rustdesk-flutter
wget
ncdu
eza
zsh
jq
iperf3
dnsutils
file
which
tree
gawk
zstd
gnupg
btop
iotop
iftop
lm_sensors
ethtool
pciutils
usbutils
neofetch
zip
xz
unzip
pinentry
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
services.pcscd.enable = true;
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.05"; # Did you read the comment?
}

@ -0,0 +1,73 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1751810233,
"narHash": "sha256-kllkNbIqQi3VplgTMeGzuh1t8Gk8TauvkTRt93Km+tQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "9b0873b46c9f9e4b7aa01eb634952c206af53068",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1751582995,
"narHash": "sha256-u7ubvtxdTnFPpV27AHpgoKn7qHuE7sgWgza/1oj5nzA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7a732ed41ca0dd64b4b71b563ab9805a80a7d693",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"plasma-manager": {
"inputs": {
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1748196248,
"narHash": "sha256-1iHjsH6/5UOerJEoZKE+Gx1BgAoge/YcnUsOA4wQ/BU=",
"owner": "nix-community",
"repo": "plasma-manager",
"rev": "b7697abe89967839b273a863a3805345ea54ab56",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "plasma-manager",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"plasma-manager": "plasma-manager"
}
}
},
"root": "root",
"version": 7
}

@ -0,0 +1,62 @@
{
description = "Felix' first NixOS System Flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
# sopswarden.url = "github:pfassina/sopswarden";
};
outputs = { self, nixpkgs, home-manager, plasma-manager, ... }@inputs: {
nixosConfigurations = {
Felix-Desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# sopswarden.nixosModules.default{
# services.sopswarden = {
# enable = true;
# secrets = {
# ssh-key-priv = "Personal SSH-Key (Priv)";
# ssh-key-pub = "Personal SSH-Key (Pub)";
# age-key = "AGE-Key";
# };
# ageKeyFile = "./key.txt";
# };
# }
./configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.felix = import ./home.nix;
home-manager.sharedModules = [
plasma-manager.homeManagerModules.plasma-manager
# sopswarden.homeManagerModules.sopswarden
];
}
];
};
Felix-Thinclient = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.felix = import ./home.nix;
home-manager.sharedModules = [
plasma-manager.homeManagerModules.plasma-manager
];
}
];
};
};
};
}

@ -0,0 +1,31 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/1c22fc0b-9b19-4509-a695-2be590eb71f8";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.ens18.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

@ -0,0 +1,100 @@
{ config, lib, pkgs, ... }:
{
home.username = "felix";
home.homeDirectory = "/home/felix";
imports = [ ./plasma.nix ];
home.file.".config/ssh-find-agent.sh".source = ./.config/ssh-find-agent.sh;
home.file.".config/alacritty" = {
source = ./.config/alacritty;
recursive = true;
};
# home.file.".config/i3/scripts" = {
# source = ./scripts;
# recursive = true; # link recursively
# executable = true; # make all files executable
# };
# encode the file content in nix configuration file directly
# home.file.".xxx".text = ''
# xxx
# '';
home.packages = with pkgs; [
# nix related
nix-output-monitor
bitwarden-desktop
] ++ (with pkgs.kdePackages; [
kcalc
kmail
partitionmanager
krita
]);
programs.git = {
enable = true;
userName = "Felix Bruns";
userEmail = "felix@bruns.hamburg";
};
programs.vscode = {
enable = true;
};
# starship - an customizable prompt for any shell
programs.starship = {
enable = true;
# custom settings
settings = {
add_newline = false;
aws.disabled = true;
gcloud.disabled = true;
line_break.disabled = true;
};
};
programs.alacritty = {
enable = true;
settings = {
env.TERM = "xterm-256color";
font = {
size = 12;
draw_bold_text_with_bright_colors = true;
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
};
};
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ls = "exa -lh";
ll = "ls -a";
update = "sudo nixos-rebuild switch --impure";
};
initContent = lib.mkOrder 1500 ''
# source "~/.config/ssh-find-agend.sh"
emulate ksh -c "source ~/.config/ssh-find-agent.sh"
ssh-add -l >&/dev/null || ssh-find-agent -a || eval $(ssh-agent) > /dev/null
'';
history.size = 10000;
oh-my-zsh = {
enable = true;
plugins = [ "git" ];
theme = "robbyrussell";
};
};
home.stateVersion = "25.05";
}

@ -0,0 +1,143 @@
{ config, pkgs, ... }:
{
programs.plasma = {
enable = true;
panels = [
{
location = "left";
alignment = "center";
floating = true;
hiding = "autohide";
height = 32;
lengthMode = "fit";
opacity = "translucent";
offset = 50;
widgets = [
"org.kde.plasma.kickoff"
{
name = "org.kde.plasma.icontasks";
config = {
General = {
launchers = [
preferred://browser
preferred://filemanager
applications:Alacritty.desktop
applications:code.desktop
];
};
};
}
"org.kde.plasma.pager"
"org.kde.plasma.systemtray"
"org.kde.plasma.digitalclock"
];
}
];
workspace.lookAndFeel = "org.kde.breezedark.desktop";
desktop = {
widgets = [
{
name = "org.kde.plasma.digitalclock";
config = {
Appearance = {
showDate = false;
};
};
position = {
horizontal = 51;
vertical = 100;
};
size = {
height = 250;
width = 250;
};
}
# I can't use a non-default widget
# {
# name = "com.github.prayag2.modernclock";
# config = {
# Appearance = {
# date_font_color="222,217,190";
# date_font_size=32;
# day_font_color="222,217,190";
# day_font_size=94;
# time_font_color="222,217,190";
# time_font_size=32;
# use_24_hour_format=true;
# };
# };
# position = {
# horizontal = 51;
# vertical = 100;
# };
# size = {
# height = 250;
# width = 250;
# };
# }
{
name = "org.kde.plasma.comic";
config = {
UserBackgroundHints = "ShadowBackground";
arrowsOnHover = true;
checkNewComicStripsIntervall = 30;
tabIdentifier="xkcd";
};
position = {
horizontal = 51;
vertical = 500;
};
size = {
height = 250;
width = 250;
};
}
];
};
# fonts.fixedWidth = {
# family = "Fira Mono";
# pointSize = 11;
# };
powerdevil = let settings = {
autoSuspend.action = "sleep";
autoSuspend.idleTimeout = 600;
dimDisplay.enable = true;
dimDisplay.idleTimeout = 300;
powerButtonAction = "shutDown";
whenLaptopLidClosed = "sleep";
}; in {
AC = settings;
battery = settings;
};
hotkeys.commands = {
"alacritty-full" = {
name = "Launch Alacritty Fullscreen";
keys = ["Meta+Backspace"];
command = "alacritty --config-file /home/felix/.config/alacritty/alacritty_full.toml";
comment = "start alacritty in full screen borderless mode";
};
"launch-konsole" = {
name = "Konsole";
keys = ["Meta+K"];
command = "konsole";
};
};
};
programs.okular.enable = true;
programs.plasma.input.keyboard.layouts = [
{
layout = "de";
}
];
programs.plasma.workspace.wallpaper = ./wallpaper.jpg;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Loading…
Cancel
Save