Init Config

This commit is contained in:
DerGrumpf
2026-04-03 23:37:52 +02:00
parent a8ec840d21
commit 62d3c12930
111 changed files with 5652 additions and 1 deletions

12
nixos/audio.nix Normal file
View File

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

99
nixos/default.nix Normal file
View File

@@ -0,0 +1,99 @@
{ pkgs, inputs, primaryUser, ... }: {
imports = [
./fonts.nix
./sops.nix
./regreet.nix
./plymouth.nix
./audio.nix
./ssh.nix
./locale.nix
./tailscale.nix
./virt.nix
./webcam.nix
inputs.catppuccin.nixosModules.catppuccin
];
catppuccin = {
enable = true;
accent = "sky";
flavor = "mocha";
cache.enable = true;
cursors = {
enable = true;
accent = "sapphire";
};
fcitx5.enable = false;
forgejo.enable = false;
gitea.enable = false;
sddm.enable = false;
};
# nix config
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
max-jobs = "auto";
cores = 0;
substituters =
[ "https://hyprland.cachix.org" "https://nix-community.cachix.org" ];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
# Garbage collection
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
# Disable Docs
documentation = {
enable = true;
doc.enable = false; # Skip large documentation
man.enable = false; # Keep man pages
info.enable = false; # Skip info pages
};
nixpkgs.config = { allowUnfree = true; };
programs = {
fish.enable = true;
hyprland = {
enable = true;
package =
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
};
steam.enable = true;
dconf.enable = true;
appimage = {
enable = true;
binfmt = true;
};
};
security = {
pam.services.swaylock = { };
polkit.enable = true;
apparmor.enable = false;
};
services.gnome = {
tinysparql.enable = true;
localsearch.enable = true;
};
users.users.${primaryUser} = {
home = "/home/${primaryUser}";
shell = pkgs.fish;
isNormalUser = true;
openssh.authorizedKeys.keyFiles = [ ./ssh-key ];
extraGroups = [ "wheel" "video" "audio" "libvirtd" ];
};
}

8
nixos/fonts.nix Normal file
View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
fonts.packages = with pkgs; [
nerd-fonts.fira-code
nerd-fonts.fira-mono
nerd-fonts.hack
];
}

18
nixos/locale.nix Normal file
View File

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

20
nixos/plymouth.nix Normal file
View File

@@ -0,0 +1,20 @@
{ ... }:
{
boot = {
plymouth = {
enable = true;
};
# Enable "Silent boot"
consoleLogLevel = 3;
initrd.verbose = false;
kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"udev.log_priority=3"
"rd.systemd.show_status=auto"
];
loader.timeout = 0;
};
}

66
nixos/regreet.nix Normal file
View File

@@ -0,0 +1,66 @@
{
lib,
...
}:
{
environment.etc = {
"greetd/background.png".source = ../assets/wallpapers/lucy_with_cat.png;
"greetd/environments".text = ''
Hyprland
niri-session
fish
'';
};
programs.regreet = {
enable = true;
cageArgs = [
"-s"
"-m"
"last"
];
settings = {
background = {
path = "/etc/greetd/background.png";
fit = "Fill";
};
GTK = {
application_prefer_dark_theme = true;
cursor_theme_name = lib.mkForce "catppuccin-mocha-dark-cursors";
font_name = lib.mkForce "FiraCode Nerd Font Propo 12";
icon_theme_name = lib.mkForce "Papirus-Dark";
theme_name = lib.mkForce "catppuccin-mocha-standard-mauve-dark";
};
commands = {
reboot = [
"systemctl"
"reboot"
];
poweroff = [
"systemctl"
"poweroff"
];
x11_prefix = [
"startx"
"/usr/bin/env"
];
};
appearance = {
greeting_msg = "Hey there!";
};
widget.clock = {
format = "%A %d.%m.%Y %T";
resolution = "500ms";
timezone = "Europe/Berlin";
label_width = 150;
};
};
};
}

18
nixos/sops.nix Normal file
View File

@@ -0,0 +1,18 @@
{ primaryUser, ... }:
{
sops = {
defaultSopsFile = ../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
age.keyFile = "/home/phil/.config/sops/age/keys.txt";
secrets = {
GROQ_API_KEY = { };
OPENWEATHER_API_KEY = { };
ssh_private_key = {
path = "/home/${primaryUser}/.ssh/ssh";
owner = primaryUser;
mode = "0600";
};
};
};
}

1
nixos/ssh-key Normal file
View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuYuGhqRC/QLoRBH91c3DG5JHlAdRLQsvde18k5ipY2 phil@cyperpunk.de

14
nixos/ssh.nix Normal file
View File

@@ -0,0 +1,14 @@
{ ... }:
{
services.openssh = {
enable = true;
openFirewall = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
programs.ssh.startAgent = true;
}

7
nixos/tailscale.nix Normal file
View File

@@ -0,0 +1,7 @@
{ ... }:
{
services.tailscale = {
enable = true;
openFirewall = true;
};
}

20
nixos/virt.nix Normal file
View File

@@ -0,0 +1,20 @@
{ pkgs, ... }:
{
virtualisation.libvirtd.enable = true;
boot.binfmt.emulatedSystems = [
"aarch64-linux"
"riscv64-linux"
];
environment.systemPackages = with pkgs; [
qemu
quickemu
quickgui
nemu
];
systemd.tmpfiles.rules = [
"L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware"
];
environment.etc."qemu/bridge.conf".text = ''
allow br0
'';
}

27
nixos/webcam.nix Normal file
View File

@@ -0,0 +1,27 @@
{ pkgs, ... }:
{
services.udev.extraRules = ''
ACTION=="add", \
SUBSYSTEM=="usb", \
ATTR{idVendor}=="04a9", \
ATTR{idProduct}=="31ea", \
RUN+="${pkgs.systemd}/bin/systemctl restart webcam"
'';
systemd.services.webcam = {
enable = true;
description = "Canon Camera Webcam";
script = ''
${pkgs.gphoto2}/bin/gphoto2 --stdout --capture-movie | \
${pkgs.ffmpeg}/bin/ffmpeg \
-i - \
-vcodec rawvideo \
-pix_fmt yuv420p \
-threads 0 \
-framerate 30 \
-f v4l2 \
/dev/video0
'';
wantedBy = [ "multi-user.target" ];
};
}