initial commit

This commit is contained in:
2025-06-15 18:21:36 +02:00
commit fd4e2a19cc
23 changed files with 2290 additions and 0 deletions

84
flake.lock generated Normal file
View File

@@ -0,0 +1,84 @@
{
"nodes": {
"catppuccin": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1749223974,
"narHash": "sha256-/GAQYRW1duU81KG//2wI9ax8EkHVG/e1UOD97NdwLOY=",
"owner": "catppuccin",
"repo": "nix",
"rev": "3a42cd79c647360ee8742659e42aeec0947dd3b4",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1749154018,
"narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1749794982,
"narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1749727998,
"narHash": "sha256-mHv/yeUbmL91/TvV95p+mBVahm9mdQMJoqaTVTALaFw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd487183437963a59ba763c0cc4f27e3447dd6dd",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"catppuccin": "catppuccin",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2"
}
}
},
"root": "root",
"version": 7
}

45
flake.nix Normal file
View File

@@ -0,0 +1,45 @@
{
description = "NixOS + Home Manager config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
catppuccin.url = "github:catppuccin/nix";
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, catppuccin, home-manager, ... }: {
nixosConfigurations = {
segfault-machine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/segfault-machine/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.backupFileExtension = "backup";
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.lukas.imports = [
./home/lukas/default.nix
];
home-manager.extraSpecialArgs = { inherit inputs; };
}
];
};
};
};
}

16
home/lukas/brave.nix Normal file
View File

@@ -0,0 +1,16 @@
{
programs.brave = {
enable = true;
extensions = [
# Catppuccin for GitHub File Explorer Icons
{ id = "lnjaiaapbakfhlbjenjkhffcdpoompki"; }
# uBlock Origin
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; }
# Return YouTube dislike
{ id = "gebbhagfogifgggkldgodflihgfeippi"; }
# Sponsorblock for YouTube
{ id = "mnjggcdmjocbbbhaepdhchncahnbgone"; }
];
};
}

14
home/lukas/catppuccin.nix Normal file
View File

@@ -0,0 +1,14 @@
{ inputs, ... }:
{
imports = [ inputs.catppuccin.homeModules.catppuccin ];
catppuccin = {
accent = "mauve";
flavor = "mocha";
enable = true;
bat.enable = true; # <- installs Catppuccin-Mocha.tmTheme
delta.enable = true; # <- colours delta with your mauve accent
};
}

19
home/lukas/default.nix Normal file
View File

@@ -0,0 +1,19 @@
{ config, pkgs, ... }:
{
imports = [
./packages.nix
./terminal.nix
./emacs.nix
./shell.nix
./catppuccin.nix
./brave.nix
./git.nix
./direnv.nix
];
home.username = "lukas";
home.homeDirectory = "/home/lukas";
home.stateVersion = "25.05";
}

9
home/lukas/direnv.nix Normal file
View File

@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.direnv = {
enable = true;
nix-direnv.enable = true; # provides `use flake`
};
}

18
home/lukas/emacs.nix Normal file
View File

@@ -0,0 +1,18 @@
{ pkgs, ... }:
let
grammars = pkgs.emacsPackages.treesit-grammars.with-all-grammars;
in
{
programs.emacs = {
enable = true;
package = pkgs.emacs30; # or emacs29-pgtk / emacs30
extraPackages = epkgs: [
grammars # <-- the real derivation
];
};
# Make sure Emacs can find the .so files
home.sessionVariables.TREE_SITTER_LIBDIR = "${grammars}/lib";
}

22
home/lukas/git.nix Normal file
View File

@@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
let
userPubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII1DsMfyMUK0snbTeVWMmdzLP9NIvPoQ4tjqyREUMHwZ mail@lukas.contact";
in {
home.file.".ssh/allowed_signers".text = "* ${userPubKey}";
programs.git = {
enable = true;
userName = "Lukas";
userEmail = "mail@lukas.contact";
extraConfig = {
commit.gpgsign = true;
gpg.format = "ssh";
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
user.signingkey = "~/.ssh/id_ed25519.pub";
};
};
}

22
home/lukas/hyprland.nix Normal file
View File

@@ -0,0 +1,22 @@
{ config, pkgs, ... }:
{
wayland.windowManager.hyprland = {
enable = true;
settings = {
monitor = ",preferred,auto,1";
exec-once = "hyprpaper & waybar";
input = {
kb_layout = "de";
follow_mouse = 1;
};
bind = [
"SUPER,Return,exec,alacritty"
"SUPER,q,killactive"
"SUPER,space,togglefloating"
];
decoration.rounding = 8;
misc.vfr = true;
};
};
}

1739
home/lukas/p10k.zsh Normal file

File diff suppressed because it is too large Load Diff

22
home/lukas/packages.nix Normal file
View File

@@ -0,0 +1,22 @@
{ pkgs, ... }:
{
fonts.fontconfig.enable = true;
home.packages = [
pkgs.thunderbird
pkgs.nextcloud-client
pkgs.keepassxc
pkgs.tree
pkgs.htop
pkgs.neovim
pkgs.wget
pkgs.unzip
pkgs.nerd-fonts.fira-code
pkgs.meslo-lgs-nf
pkgs.eza
pkgs.bat
];
}

40
home/lukas/shell.nix Normal file
View File

@@ -0,0 +1,40 @@
{ pkgs, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
autosuggestion.enable = true;
initContent = "source /etc/nixos/home/lukas/p10k.zsh";
sessionVariables = {
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD = "true";
};
zplug = {
enable = true;
plugins = [
{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; }
];
};
shellAliases = {
ls = "eza --icons"; # plain directory listing
ll = "eza --icons -alh --git"; # long list, all, human, git status
la = "eza --icons -a"; # show all dot-files, short
lt = "eza -T --icons --git-ignore --level=2"; # pretty tree, two levels deep
cat ="bat --style=plain"; # pretty cat
less ="bat --style=plain --pager=less"; # pretty less
diff = "delta --paging=always"; # quick standalone diff
};
};
}

24
home/lukas/terminal.nix Normal file
View File

@@ -0,0 +1,24 @@
{ pkgs, ... }:
{
programs.tmux = {
enable = true;
clock24 = true;
extraConfig = ''
set-option -g mouse on
set-option -g history-limit 50000
set -g default-shell "${pkgs.zsh}/bin/zsh"
set -g default-terminal "tmux-256color"
'';
};
programs.alacritty = {
enable = true;
settings.terminal.shell = {
program = "${pkgs.tmux}/bin/tmux";
args = [ "new-session" "-A" "-s" "main" ];
};
};
}

44
home/lukas/waybar.nix Normal file
View File

@@ -0,0 +1,44 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
waybar networkmanagerapplet
];
programs.waybar = {
catppuccin.enable = true;
enable = true;
systemd.enable = true; # auto-restart on crashes
settings = {
mainBar = {
layer = "top";
position = "top";
height = 32;
modules-left = [ "hyprland/workspaces" ];
modules-center = [ "clock" ];
modules-right = [
"network"
"pulseaudio"
"battery"
"tray"
];
# `network` module shows SSID + signal; no need for nm-applet text
"network" = {
format-wifi = "{ssid} {signalStrength}%";
format-disconnected = "";
};
};
};
};
# Start nm-applet once; Waybar's SNI tray picks it up.
systemd.user.services."nm-applet" = {
Unit.Description = "NetworkManager Applet";
Service = {
ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator";
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
};
}

View File

@@ -0,0 +1,29 @@
{ config, pkgs, ... }: {
imports = [
./hardware.nix
../../users/lukas.nix
../../modules/desktop/plasma.nix
../../modules/networking/networkmanager.nix
../../modules/system/locale.nix
../../modules/system/audio.nix
../../modules/system/printing.nix
];
networking.hostName = "segfault-machine";
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
# luks setup
boot.initrd.luks.devices."luks-4fb890ca-7670-49c3-8bc2-f5041492d454".device = "/dev/disk/by-uuid/4fb890ca-7670-49c3-8bc2-f5041492d454";
# Version festlegen
system.stateVersion = "25.05";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

View File

@@ -0,0 +1,49 @@
# 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 + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/5af0ed50-72c4-4bee-8c6e-7b0556cffbc7";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-8b6f4d96-6a79-4add-9e28-14e2152a1b24".device = "/dev/disk/by-uuid/8b6f4d96-6a79-4add-9e28-14e2152a1b24";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/85F9-3F33";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b01b125b-77ea-4c51-8390-b7b22ce4530a"; }
];
# 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.enp1s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
}

View File

@@ -0,0 +1,22 @@
{ pkgs, lib, ... }:
{
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
services.greetd = {
enable = true;
settings.default_session = {
command = "Hyprland";
user = "lukas";
};
};
environment.systemPackages = with pkgs; [
hyprpicker hyprpaper hyprcursor
waybar swaylock grim slurp wl-clipboard kitty
];
}

View File

@@ -0,0 +1,18 @@
{ config, pkgs, ... }:
{
# X11/KDE Plasma
services.xserver.enable = true;
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
# Tastatur
services.xserver.xkb = {
layout = "de";
variant = "";
# swap caps and esc
options = "caps:swapescape";
};
# Konsole-Tastatur
console.keyMap = "de";
}

View File

@@ -0,0 +1,5 @@
{ config, pkgs, ... }:
{
networking.networkmanager.enable = true;
}

12
modules/system/audio.nix Normal file
View File

@@ -0,0 +1,12 @@
{ config, pkgs, ... }:
{
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}

18
modules/system/locale.nix Normal file
View File

@@ -0,0 +1,18 @@
{ config, pkgs, ... }:
{
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "de_DE.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";
};
}

View File

@@ -0,0 +1,5 @@
{ config, pkgs, ... }:
{
services.printing.enable = true;
}

14
users/lukas.nix Normal file
View File

@@ -0,0 +1,14 @@
{ config, pkgs, ... }:
{
users.users.lukas = {
isNormalUser = true;
description = "lukas";
extraGroups = [ "networkmanager" "wheel" ];
};
# Autologin
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "lukas";
}