Complete overhaul

This commit is contained in:
SebastianStork 2024-03-12 21:10:35 +01:00
commit d30d11566d
38 changed files with 1373 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.direnv/

7
.sops.yaml Normal file
View file

@ -0,0 +1,7 @@
keys:
- &dell-laptop age1jl9s4vp78wuwymjxaje6fg4ax0gg5aq8pn8khfmtn5rvap0d83tqfr05dv
creation_rules:
- path_regex: hosts/dell-laptop/secrets.yaml$
key_groups:
- age:
- *dell-laptop

107
flake.lock generated Normal file
View file

@ -0,0 +1,107 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1710164657,
"narHash": "sha256-l64+ZjaQAVkHDVaK0VHwtXBdjcBD6nLBD+p7IfyBp/w=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "017b12de5b899ef9b64e2c035ce257bfe95b8ae2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1710120787,
"narHash": "sha256-tlLuB73OCOKtU2j83bQzSYFyzjJo3rjpITZE5MoofG8=",
"owner": "Mic92",
"repo": "nix-index-database",
"rev": "e76ff2df6bfd2abe06abd8e7b9f217df941c1b07",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "nix-index-database",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1709961763,
"narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1710033658,
"narHash": "sha256-yiZiVKP5Ya813iYLho2+CcFuuHpaqKc/CoxOlANKcqM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b17375d3bb7c79ffc52f3538028b2ec06eb79ef8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1710195194,
"narHash": "sha256-KFxCJp0T6TJOz1IOKlpRdpsCr9xsvlVuWY/VCiAFnTE=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "e52d8117b330f690382f1d16d81ae43daeb4b880",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

40
flake.nix Normal file
View file

@ -0,0 +1,40 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {nixpkgs, ...} @ inputs: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
dell-laptop = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs;};
modules = [
./hosts/dell-laptop
./users/seb
];
};
};
devShells.${system}.default = pkgs.mkShell {
packages = [pkgs.sops];
};
};
}

34
hosts/default.nix Normal file
View file

@ -0,0 +1,34 @@
{pkgs, ...}: {
imports = [../modules/system];
system.stateVersion = "23.11";
nix.settings = {
experimental-features = ["nix-command" "flakes"];
auto-optimise-store = true;
warn-dirty = false;
trusted-users = ["root" "@wheel"];
};
nixpkgs.config.allowUnfree = true;
console.keyMap = "de-latin1-nodeadkeys";
time.timeZone = "Europe/Berlin";
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";
};
environment.systemPackages = [
pkgs.git
pkgs.neovim
];
}

View file

@ -0,0 +1,52 @@
{pkgs, ...}: {
imports = [
../default.nix
./hardware.nix
];
networking.hostName = "dell-laptop";
myConfig = {
boot.systemd.enable = true;
dm.lightdm.enable = true;
de.qtile.enable = true;
wlan.enable = true;
bluetooth.enable = true;
sound.pipewire.enable = true;
auto-gc.enable = true;
vm.qemu.enable = true;
flatpak.enable = true;
vpn.lgs.enable = true;
comma.enable = true;
sops.enable = true;
powersave.enable = true;
doas.enable = false;
};
boot.kernelPackages = pkgs.linuxPackages_latest;
services.gvfs.enable = true;
services.autorandr = {
enable = true;
profiles = {
"laptop" = {
fingerprint = {
"eDP-1" = "00ffffffffffff000dae221500000000161e0104a52213780328659759548e271e5054000000010101010101010101010101010101015c6f80a070383e403020a50058c11000001a000000fd00307889891d010a202020202020000000fe00594d485748803135364852410a000000000001410f99001000000b010a2020016970137900000301145c6f00047f079f002f001f003704b4040900040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a90";
};
config = {
"eDP-1" = {
enable = true;
primary = true;
position = "0x0";
mode = "1920x1080";
rate = "60";
};
};
};
};
};
services.xserver.displayManager.sessionCommands = "autorandr -c";
}

View file

@ -0,0 +1,34 @@
{
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/92437114-de06-4a78-9ee3-c7d0ffcabf95";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D8B4-1218";
fsType = "vfat";
};
swapDevices = [
{device = "/dev/disk/by-uuid/1eba93d1-4853-4534-8cfd-5c14e29c6ff6";}
];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,27 @@
password:
seb: ENC[AES256_GCM,data:tD5uKTwRbIR/h9zr6LC0t4k9MFQwJ33Ie4WeWuS8iYAdwz/oM5uYNitg7UVZShqoCD9hHRcz6oUIY/0cs/y0idx9p8ANpSvJRg==,iv:v+3/3KiZnauiyW/dx1S0125Dq5+nbw/0g8CcQ89WPOs=,tag:mqpTaTqKv6c3Eofr3ZfjoQ==,type:str]
wlan.env: ENC[AES256_GCM,data:rHT226tpqdze1P875A9E8yiXe27RztJld9hY4Zzxo+6Ik1DrXA1x7LAr/Hfbp9hr6GPuvtBKBR+pAg+AcoB5qN21FZ6LP6lvsAbjOrGRfUlphl6oEa4xBpWdN8vVeNUEGbCxB0M+7XK65fHE5UDP4FdeJpC5XH1k2ZKqYA7o/CENBA1+uxoI8cAEMlGhu04hJkY9VBhC3zcOtszcUKAxJASDicLKJ18+,iv:u5Wud1pDuvYlTu0Ls50eDtkc7rpnWz3dPo68fxJq/Qk=,tag:GpONClKtiDGmM9O0BlcSdg==,type:str]
vpn:
lgs:
crt: ENC[AES256_GCM,data:9Qlb3FocGtzE6YHaT3stDUqsdpW4mj8SnJ04LBiJLSxFxwRt8XTgdLcIhfBhrIRPkk3UEyX/JrELgvBa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91ypK4fwkaQ=,tag:8WKxT6zHdkp3N5brtckoPA==,type:str]
key: ENC[AES256_GCM,data:DQLmzYLWTwR2kBvnxaPh1KyWKhxnfTO1bBmEBFZl16lAlGatLUXtUW+g37tCSRrgAVVgzYTBYQ9YKd0OicPIot3/rh6FsnpUmxW2C0GztgPxqejU+vwisbdfWuv2JFUbfAekhMvhfHWckoCZpSWqpSvOBa1MaHCyUArIPkhEo3B1opRxCx56k6W5RaoXxUId4imtu9z26G9aOQy9FqiFIWmW54UUa32wqEBbuByf1ycLjTR7d6/G/XslOIOXIFdntO3fX2VCHlBrrg7c/rOb3V7YvNMCqjBeYhjHePdySmDsq7arQks1gORzclEeWESS+gqAQX1kp0yGzobf2qDFmYMcw3XJIAtmnB50bc+xPC5ZUJnfoO1sELcRgdzQxKLq0LMq4r7PyoOh5RRhzobVkbtZKQJAiT12t1zg5FkzlutrMXZoWIevbLkkkK1F1OqdF39tJ+Rwm6WQ2XMh0YzEC6ndgkT5NL7+pLRPtzk8O8XBWjoZpL7wtN05J7cTPbIkI5oH0v8EhNx2cc8D2SXB9S/pdJWekx6kUaG/JRIteL7YI2M8JsYxEisFLlg0e+WDpvuGO+O9e3f5e/xgUouMVL5nCxfQmjY/gIFW5mI9OlrZJPvyNpsEXndTcx+S+AxVbcxbjtGpsOmEH6yDQJB4tBJBa4/IirWaMIRZNIRxZN/IzA+gActNOK8z4/xSj/7MTKWlTW5HigZVaZvqaC6jitxT59+TsS/v4VWkIrc829lx0T/wC+wzYGQ5HVWSZlxxuBBfibbUk7ZiF9YMZcBpSqQNA3Q1kAT6xCg=,iv:1MDyvxhRI7FkvQuA5iI19HaTJs3lCJw2sutlyF4GQiw=,tag:/BBc5sqZ/Cjapd/cEezlmA==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1jl9s4vp78wuwymjxaje6fg4ax0gg5aq8pn8khfmtn5rvap0d83tqfr05dv
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSArSTZjT1llekd3aFdpQ01Q
SUppY3JSaTI2TFNNeXd5MDREeHE3am5HeDFVClhRNHJPZkZnclluRFVFUEZuSjk5
b1AxZWdMZHNsbDh5QWNMdHFqbzVadlEKLS0tIFJtQ0F4eWtwNEtyd29PY2wvU0Fv
N2dzR01qQnVxb3UvdUZLZ05jcDdjUGMKjx1BGh8c+OqXwUKeceUMUjuZgo04H0oy
t3HZbqg62Bj+Ucun+lt9sOA1uHHSQsn91i8WTxdrOyiX7WpfiASE1w==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-03-05T14:47:55Z"
mac: ENC[AES256_GCM,data:BSZKxzFil5+rX5rMn/Sm6TEtQN+5CBasTHVwnIVBq91e4XY6VaC1Awhecr6Jez6Ssw35x1p7r/j1xs9MqaZQFzRu/dIQotsKIcLbWX/BAMEMVguvwNRMPH6cDjfG5l7Ptu02SXVKGZ2DCT2lsS9yM77zK3iC3vf7ggJ6g4JepAA=,iv:nBaGH5QBCw9fh1ffDp3/wDTz3znhUZ9DH5T52LqBOeA=,tag:vhlqdnqu/2XuZ+Fucl8nGQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

10
modules/home/default.nix Normal file
View file

@ -0,0 +1,10 @@
{
imports = [
./qtile
./vscode.nix
./shell.nix
./theming.nix
./ssh-client.nix
./git.nix
];
}

20
modules/home/git.nix Normal file
View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}: {
options.myConfig.git.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.git.enable {
programs.git = {
enable = true;
userName = "SebastianStork";
userEmail = "sebastian.stork@pm.me";
extraConfig = {
init.defaultBranch = "main";
};
};
};
}

View file

@ -0,0 +1,44 @@
{
config,
pkgs,
lib,
osConfig,
...
}: {
options.myConfig.qtile.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.qtile.enable {
assertions = [
{
assertion = osConfig.services.xserver.windowManager.qtile.enable;
message = "Qtile has to be enabled on the system level";
}
];
home.file.".config/qtile/config.py".source = ./files/qtile.py;
home.file.".background-image".source = ./files/background-image;
home.packages = [
# Widget dependencies
pkgs.python311Packages.iwlib
pkgs.python311Packages.psutil
pkgs.lm_sensors
# Hotkey dependencies
pkgs.playerctl
pkgs.brightnessctl
];
programs.rofi = {
enable = true;
theme = ./files/rofi-theme.rasi;
};
services.picom = {
enable = true;
vSync = true;
};
services.dunst.enable = true;
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

View file

@ -0,0 +1,171 @@
import os
import subprocess
from libqtile import bar, layout, widget
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy
from libqtile import hook
# Constants
mod = "mod4"
terminal = "kitty"
browser = "brave"
editor = "notepadqq --new-window"
fileManager = "nemo"
lightBlue = "#739BD0"
lightGrey = "#bcbcbc"
left = "Left"
right = "Right"
down = "Down"
up = "Up"
### SHORTCUTS ###
keys = [
# Essentials
Key([mod, "shift"], "c", lazy.window.kill(), desc="Kill focused window"),
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
# Launch programs
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
Key([mod], "r", lazy.spawn("rofi -show drun"), desc="Spawn a command using a prompt widget"),
Key([mod, "shift"], "r", lazy.spawn("rofi -show run"), desc="Spawn a command using a prompt widget"),
Key([mod], "b", lazy.spawn(browser), desc="launch browser"),
Key([mod], "n", lazy.spawn(editor), desc="launch notepadqq"),
Key([mod], "f", lazy.spawn(fileManager), desc="launch file manager"),
Key([mod], "c", lazy.spawn("codium"), desc="launch vscodium"),
Key([mod], "s", lazy.spawn("spotify"), desc="launch spotify"),
Key([mod], "v", lazy.spawn("clipmenu"), desc="launch clipmenu"),
# Media controls
Key([], "XF86AudioPlay", lazy.spawn("playerctl --player=ncspot,spotify play-pause "), desc="Play and pause spotify"),
Key([], "XF86AudioMute", lazy.spawn("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), desc="Mute and unmute"),
Key([], "XF86AudioLowerVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), desc="Lower volume"),
Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), desc="Raise volume"),
# Brightness controls
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +5%"), desc="Raise brightness"),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 5%-"), desc="Lower brightness"),
# Move window focus
Key([mod], left, lazy.layout.left(), desc="Move focus to left"),
Key([mod], right, lazy.layout.right(), desc="Move focus to right"),
Key([mod], down, lazy.layout.down(), desc="Move focus down"),
Key([mod], up, lazy.layout.up(), desc="Move focus up"),
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"),
# Move windows
Key([mod, "shift"], left, lazy.layout.shuffle_left(), desc="Move window to the left"),
Key([mod, "shift"], right, lazy.layout.shuffle_right(), desc="Move window to the right"),
Key([mod, "shift"], down, lazy.layout.shuffle_down(), desc="Move window down"),
Key([mod, "shift"], up, lazy.layout.shuffle_up(), desc="Move window up"),
# Size windows
Key([mod, "shift"], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
Key([mod], "plus", lazy.layout.grow().when(layout=["monadtall", "monadwide"]), desc="Grow window"),
Key([mod], "minus", lazy.layout.shrink().when(layout=["monadtall", "monadwide"]), desc="Shrink window"),
# Manage layouts
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
Key([mod, "shift"], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen on the focused window"),
Key([mod, "shift"], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"),
Key([mod, "shift"], "b", lazy.hide_show_bar(), desc="Toggle bar visibility"),
]
### LAYOUTS ###
groups = [Group(i) for i in "123456789"]
# Switching between layouts
for i in groups:
keys.extend(
[
Key([mod], i.name, lazy.group[i.name].toscreen(), desc="Switch to group {}".format(i.name)),
Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=False), desc="Switch to & move focused window to group {}".format(i.name)),
]
)
# Available layouts
layouts = [
layout.MonadTall(border_focus=lightBlue, border_normal=lightGrey, border_width=2, margin=8, single_margin=0, single_border_width=0),
layout.Floating(),
]
# Drag floating layouts.
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
Click([mod], "Button1", lazy.window.bring_to_front()),
]
### WIDGETS ###
widget_defaults = dict(
font="sans, JetBrainsMono Nerd Font",
fontsize=15,
padding=3,
)
extension_defaults = widget_defaults.copy()
# Display widgets on the bar
screens = [
Screen(
top=bar.Bar(
[
widget.Clock(format="%H:%M"),
widget.Sep(),
widget.Clock(format="󰃮 %a. %d.%m.%y"),
widget.Spacer(),
widget.GroupBox(highlight_method="line", this_current_screen_border=lightBlue),
widget.Spacer(),
widget.WidgetBox(text_closed="", text_open="" , widgets=[
widget.Systray()
]),
widget.Sep(),
widget.Wlan(format="󰖩 {essid}", interface="wlp2s0", update_interval=5, max_chars=4),
widget.Sep(),
widget.ThermalSensor(format="{temp:.1f}{unit}", tag_sensor="CPU", threshold=90, update_interval=5),
widget.Sep(),
widget.PulseVolume(fmt="󰕾 {}"),
widget.Sep(),
widget.Backlight(fmt="󰃠 {}", backlight_name='amdgpu_bl0'),
widget.Sep(),
widget.Battery(format="󰁹 {percent:2.0%}"),
],
26,
),
),
]
### RULES ###
dgroups_key_binder = None
dgroups_app_rules = [] # type: list
follow_mouse_focus = True
bring_front_click = False
floats_kept_above = True
cursor_warp = False
floating_layout = layout.Floating(
float_rules=[
# Run the utility of `xprop` to see the wm class and name of an X client.
*layout.Floating.default_float_rules,
Match(wm_class="confirmreset"), # gitk
Match(wm_class="makebranch"), # gitk
Match(wm_class="maketag"), # gitk
Match(wm_class="ssh-askpass"), # ssh-askpass
Match(title="branchdialog"), # gitk
Match(title="pinentry"), # GPG key password entry
]
)
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True
auto_minimize = True
wl_input_rules = None
wmname = "LG3D"

View file

@ -0,0 +1,95 @@
/*******************************************************************************
* ROFI SQUARED THEME USING THE NORD PALETTE
* User : LR-Tech
* Theme Repo : https://github.com/lr-tech/rofi-themes-collection
*******************************************************************************/
* {
font: "JetBrainsMono Nerd Font Medium 12";
bg0: #2E3440;
bg1: #3B4252;
fg0: #D8DEE9;
accent-color: #88C0D0;
urgent-color: #EBCB8B;
background-color: transparent;
text-color: @fg0;
margin: 0;
padding: 0;
spacing: 0;
}
window {
location: center;
width: 480;
background-color: @bg0;
}
inputbar {
spacing: 8px;
padding: 8px;
background-color: @bg1;
}
prompt, entry, element-icon, element-text {
vertical-align: 0.5;
}
prompt {
text-color: @accent-color;
}
textbox {
padding: 8px;
background-color: @bg1;
}
listview {
padding: 4px 0;
lines: 8;
columns: 1;
fixed-height: false;
}
element {
padding: 8px;
spacing: 8px;
}
element normal normal {
text-color: @fg0;
}
element normal urgent {
text-color: @urgent-color;
}
element normal active {
text-color: @accent-color;
}
element selected {
text-color: @bg0;
}
element selected normal, element selected active {
background-color: @accent-color;
}
element selected urgent {
background-color: @urgent-color;
}
element-icon {
size: 0.8em;
}
element-text {
text-color: inherit;
}

71
modules/home/shell.nix Normal file
View file

@ -0,0 +1,71 @@
{
config,
lib,
...
}: let
cfg = config.myConfig.shell;
in {
options.myConfig.shell = {
bash.enable = lib.mkEnableOption "";
zsh.enable = lib.mkEnableOption "";
starship.enable = lib.mkEnableOption "";
nixAliases.enable = lib.mkEnableOption "";
improvedCommands.enable = lib.mkEnableOption "";
direnv.enable = lib.mkEnableOption "";
};
config = {
programs.bash.enable = cfg.bash.enable;
programs.zsh.enable = cfg.zsh.enable;
programs.starship = lib.mkIf cfg.starship.enable {
enable = true;
enableBashIntegration = cfg.bash.enable;
enableZshIntegration = cfg.zsh.enable;
settings = {
cmd_duration.disabled = true;
directory = {
truncation_length = 0;
truncation_symbol = "/";
truncate_to_repo = false;
};
};
};
home.shellAliases = let
nixAliases = lib.mkIf cfg.nixAliases.enable {
nrs = "sudo nixos-rebuild switch";
nrb = "sudo nixos-rebuild boot";
nrrb = "nrb && reboot";
nrt = "sudo nixos-rebuild test";
nu = "sudo nix flake update";
};
commandAliases = lib.mkIf cfg.improvedCommands.enable {
".." = "cd ..";
cat = "bat -p";
};
in
lib.mkMerge [nixAliases commandAliases];
programs.lsd = lib.mkIf cfg.improvedCommands.enable {
enable = true;
enableAliases = true;
};
programs.bat.enable = cfg.improvedCommands.enable;
programs.fzf.enable = cfg.improvedCommands.enable;
programs.zoxide = lib.mkIf cfg.improvedCommands.enable {
enable = true;
options = ["--cmd cd"];
};
programs.direnv = lib.mkIf cfg.direnv.enable {
enable = true;
nix-direnv.enable = true;
config.global.hide_env_diff = true;
};
};
}

View file

@ -0,0 +1,21 @@
{
config,
lib,
...
}: {
options.myConfig.ssh-client.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.ssh-client.enable {
programs.ssh = {
enable = true;
matchBlocks.kluebero-vm1 = {
hostname = "10.5.251.175";
user = "seb";
identitiesOnly = true;
identityFile = ["~/.ssh/kluebero/id_ed25519"];
};
};
services.ssh-agent.enable = true;
};
}

45
modules/home/theming.nix Normal file
View file

@ -0,0 +1,45 @@
{
config,
pkgs,
lib,
...
}: {
options.myConfig.theming.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.theming.enable {
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
gtk = {
enable = true;
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
theme.name = "Adwaita-dark";
theme.package = pkgs.gnome.gnome-themes-extra;
iconTheme.name = "Adwaita";
iconTheme.package = pkgs.gnome.adwaita-icon-theme;
font.name = "Open Sans";
font.package = pkgs.open-sans;
};
qt = {
enable = true;
platformTheme = "gnome";
style.name = "adwaita-dark";
style.package = pkgs.adwaita-qt;
};
home.pointerCursor = {
name = "Bibata-Original-Classic";
package = pkgs.bibata-cursors;
size = 24;
x11.enable = true;
x11.defaultCursor = "X_cursor";
gtk.enable = true;
};
fonts.fontconfig.enable = true;
};
}

50
modules/home/vscode.nix Normal file
View file

@ -0,0 +1,50 @@
{
config,
pkgs,
lib,
...
}: {
options.myConfig.vscode.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vscode.enable {
home.packages = [pkgs.nil];
programs.vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = false;
extensions = [
pkgs.vscode-extensions.jnoortheen.nix-ide
pkgs.vscode-extensions.kamadorueda.alejandra
pkgs.vscode-extensions.pkief.material-icon-theme
pkgs.vscode-extensions.mkhl.direnv
];
};
systemd.user.tmpfiles.rules = let
settings = builtins.replaceStrings ["\n"] ["\\n"] ''
{
"editor.fontFamily": "JetBrainsMono Nerd Font",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"extensions.autoCheckUpdates": false,
"files.autoSave": "afterDelay",
"git.autofetch": true,
"git.confirmSync": false,
"nix.enableLanguageServer": true,
"nix.serverPath": "nil",
"update.mode": "none",
"git.suggestSmartCommit": false,
"workbench.sideBar.location": "right",
"editor.renderWhitespace": "none",
"workbench.iconTheme": "material-icon-theme",
"editor.minimap.enabled": false
}
'';
in [
"f+ %h/.config/VSCodium/User/settings.json - - - - ${settings}"
"f+ %h/.config/VSCodium/User/settings-default.json - - - - ${settings}"
];
};
}

View file

@ -0,0 +1,15 @@
{
config,
lib,
...
}: {
options.myConfig.auto-gc.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.auto-gc.enable {
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
}

View file

@ -0,0 +1,16 @@
{
config,
lib,
...
}: {
options.myConfig.bluetooth.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.bluetooth.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
hardware.logitech.wireless.enable = true;
};
}

20
modules/system/boot.nix Normal file
View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}: {
options.myConfig.boot.systemd.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.boot.systemd.enable {
boot.tmp.cleanOnBoot = true;
boot.loader = {
systemd-boot = {
enable = true;
editor = false;
configurationLimit = 50;
};
efi.canTouchEfiVariables = true;
timeout = 3;
};
};
}

16
modules/system/comma.nix Normal file
View file

@ -0,0 +1,16 @@
{
inputs,
config,
lib,
...
}: {
imports = [inputs.nix-index-database.nixosModules.nix-index];
options.myConfig.comma.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.comma.enable {
programs.command-not-found.enable = false;
programs.nix-index.enable = true;
programs.nix-index-database.comma.enable = true;
};
}

18
modules/system/de.nix Normal file
View file

@ -0,0 +1,18 @@
{
config,
lib,
...
}: {
options.myConfig.de.qtile.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.qtile.enable {
services.xserver = {
enable = true;
windowManager.qtile.enable = true;
desktopManager.wallpaper.mode = "fill";
};
myConfig.x-input.enable = true;
};
}

View file

@ -0,0 +1,19 @@
{
imports = [
./flatpak.nix
./vm.nix
./wlan.nix
./doas.nix
./vpn.nix
./comma.nix
./auto-gc.nix
./sops.nix
./bluetooth.nix
./powersave.nix
./x-input.nix
./de.nix
./dm.nix
./sound.nix
./boot.nix
];
}

20
modules/system/dm.nix Normal file
View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}: {
options.myConfig.dm.lightdm.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.dm.lightdm.enable {
services.xserver = {
enable = true;
displayManager.lightdm = {
enable = true;
greeters.slick.enable = true;
};
};
myConfig.x-input.enable = true;
};
}

25
modules/system/doas.nix Normal file
View file

@ -0,0 +1,25 @@
{
config,
lib,
...
}: {
options.myConfig.doas.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.doas.enable {
security.sudo.enable = false;
security.doas = {
enable = true;
extraRules = [
{
groups = ["wheel"];
keepEnv = true;
persist = true;
}
];
};
environment.shellAliases.sudo = "doas";
programs.bash.interactiveShellInit = lib.mkIf config.myConfig.shell.bash.enable "complete -F _command doas";
};
}

View file

@ -0,0 +1,30 @@
{
config,
pkgs,
lib,
...
}: {
options.myConfig.flatpak.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.flatpak.enable {
services.flatpak.enable = true;
xdg.portal = {
enable = true;
extraPortals = [pkgs.xdg-desktop-portal-gtk];
config.common.default = "*";
};
home-manager.sharedModules = [
{
xdg = {
enable = true;
systemDirs.data = [
"/var/lib/flatpak/exports/share"
"/home/seb/.local/share/flatpak/exports/share"
];
};
}
];
};
}

View file

@ -0,0 +1,25 @@
{
config,
lib,
...
}: {
options.myConfig.powersave.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.powersave.enable {
services.auto-cpufreq = {
enable = true;
settings = {
charger = {
governor = "powersave";
turbo = "never";
energy_performance_preference = "power";
};
battery = {
governor = "powersave";
turbo = "never";
energy_performance_preference = "power";
};
};
};
};
}

17
modules/system/sops.nix Normal file
View file

@ -0,0 +1,17 @@
{
inputs,
config,
lib,
...
}: {
imports = [inputs.sops-nix.nixosModules.sops];
options.myConfig.sops.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.sops.enable {
sops = {
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
defaultSopsFile = ../../hosts/dell-laptop/secrets.yaml;
};
};
}

19
modules/system/sound.nix Normal file
View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: {
options.myConfig.sound.pipewire.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.sound.pipewire.enable {
security.rtkit.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
}

28
modules/system/vm.nix Normal file
View file

@ -0,0 +1,28 @@
{
config,
pkgs,
lib,
...
}: {
options.myConfig.vm.qemu.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vm.qemu.enable {
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
environment.systemPackages = [
pkgs.quickemu
pkgs.quickgui
];
home-manager.sharedModules = [
{
dconf.settings."org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
}
];
};
}

37
modules/system/vpn.nix Normal file
View file

@ -0,0 +1,37 @@
{
config,
lib,
...
}: {
options.myConfig.vpn.lgs.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vpn.lgs.enable {
sops.secrets = {
"vpn/lgs/crt" = {};
"vpn/lgs/key" = {};
};
services.openvpn.servers.lgs = {
autoStart = false;
config = ''
dev tap
persist-tun
persist-key
data-ciphers AES-128-GCM:AES-256-CBC
data-ciphers-fallback AES-256-CBC
auth SHA1
tls-client
client
resolv-retry infinite
remote 194.9.190.11 1194 udp4
nobind
auth-user-pass
ca ${config.sops.secrets."vpn/lgs/crt".path}
tls-auth ${config.sops.secrets."vpn/lgs/key".path} 1
remote-cert-tls server
explicit-exit-notify
'';
};
};
}

96
modules/system/wlan.nix Normal file
View file

@ -0,0 +1,96 @@
{
config,
lib,
...
}: {
options.myConfig.wlan.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.wlan.enable {
sops.secrets."wlan.env" = {};
networking.networkmanager = {
enable = true;
ensureProfiles = {
environmentFiles = [config.sops.secrets."wlan.env".path];
profiles = {
home = {
connection = {
id = "home";
uuid = "24b856a6-27eb-4c4f-b85c-f59ab0824965";
type = "wifi";
interface-name = "wlp2s0";
};
wifi = {
mode = "infrastructure";
ssid = "$HOME_SSID";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$HOME_PSK";
};
ipv4 = {method = "auto";};
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
};
mobile = {
connection = {
id = "mobile";
uuid = "e3a749cf-a103-4e1e-a50c-4a4898bafcf6";
type = "wifi";
interface-name = "wlp2s0";
};
wifi = {
mode = "infrastructure";
ssid = "$MOBILE_SSID";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$MOBILE_PSK";
};
ipv4 = {method = "auto";};
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
};
school = {
connection = {
id = "school";
uuid = "bfdf4e7f-d2c4-4ab6-b833-37ecd5199b22";
type = "wifi";
interface-name = "wlp2s0";
};
wifi = {
mode = "infrastructure";
ssid = "$SCHOOL_SSID";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-eap";
};
"802-1x" = {
domain-suffix-match = "lgs-hu.eu";
eap = "ttls;";
identity = "$SCHOOL_ID";
password = "$SCHOOL_PSK";
phase2-auth = "pap";
};
ipv4 = {method = "auto";};
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
};
};
};
};
};
}

View file

@ -0,0 +1,29 @@
{
config,
lib,
...
}: {
options.myConfig.x-input.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.x-input.enable {
services.xserver = {
enable = true;
xkb = {
layout = "de";
variant = "nodeadkeys";
};
libinput = {
enable = true;
touchpad = {
accelProfile = "adaptive";
naturalScrolling = true;
disableWhileTyping = true;
};
mouse.accelProfile = "flat";
};
};
};
}

26
users/default.nix Normal file
View file

@ -0,0 +1,26 @@
{inputs, ...}: {
imports = [inputs.home-manager.nixosModules.home-manager];
users.mutableUsers = false;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [
../modules/home
{
programs.home-manager.enable = true;
home.stateVersion = "23.11";
systemd.user.startServices = "sd-switch";
xdg = {
enable = true;
userDirs = {
enable = true;
createDirectories = true;
};
};
}
];
}

14
users/seb/default.nix Normal file
View file

@ -0,0 +1,14 @@
{config, ...}: {
imports = [../default.nix];
sops.secrets."password/seb".neededForUsers = true;
users.users.seb = {
isNormalUser = true;
description = "Sebastian Stork";
hashedPasswordFile = config.sops.secrets."password/seb".path;
extraGroups = ["wheel" "networkmanager" "libvirtd"];
};
home-manager.users.seb = import ./home.nix;
}

73
users/seb/home.nix Normal file
View file

@ -0,0 +1,73 @@
{pkgs, ...}: {
myConfig = {
qtile.enable = true;
vscode.enable = true;
shell = {
bash.enable = true;
starship.enable = true;
nixAliases.enable = true;
improvedCommands.enable = true;
direnv.enable = true;
};
theming.enable = true;
ssh-client.enable = true;
git.enable = true;
};
programs.kitty = {
enable = true;
settings = {
font_family = "JetBrainsMono Nerd Font";
confirm_os_window_close = 0;
background_opacity = "0.7";
scrollback_lines = 10000;
enable_audio_bell = false;
update_check_interval = 0;
};
};
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
};
services.clipmenu = {
enable = true;
launcher = "rofi";
};
home.packages = with pkgs; [
# CLI
fastfetch
btop
# GUI
notepadqq
brave
spotify
cinnamon.nemo-with-extensions
discord
flameshot
jetbrains.idea-community
vlc
obs-studio
libsForQt5.kdenlive
gimp
libreoffice
hunspell
hunspellDicts.de_DE
hunspellDicts.en_US
steam
networkmanagerapplet
# Fonts
(nerdfonts.override {fonts = ["JetBrainsMono"];})
corefonts
roboto
open-sans
ubuntu_font_family
];
}