change structure to make it more readable

This commit is contained in:
lucy 2026-07-30 17:20:40 +02:00
commit ad86712653
31 changed files with 259 additions and 234 deletions

80
nixos/configuration.nix Normal file
View file

@ -0,0 +1,80 @@
{
pkgs,
...
}:
{
imports = [
./stylix.nix
./nixvim/nixvim.nix
./programs/common.nix
./programs/steam.nix
./programs/system-packages.nix
./programs/xppen.nix
./programs/zsh.nix
./hardware/common.nix
./hardware/bluetooth.nix
./services/common.nix
./services/pipewire.nix
./stylix/stylix.nix
./easyroam.nix
];
boot.loader.systemd-boot = {
edk2-uefi-shell.enable = true;
configurationLimit = 5;
};
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.package = pkgs.lixPackageSets.stable.lix;
nix.settings.trusted-users = [ "lucy" ];
networking.hostName = "nixos"; # Define your hostname.
networking.networkmanager.enable = true;
networking.networkmanager.wifi.powersave = false;
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";
};
services.xserver.xkb = {
layout = "eu";
variant = "";
};
security.doas.enable = true;
security.sudo.enable = false;
security.doas.extraRules = [
{
users = [
"lucy"
"root"
];
groups = [ "wheel" ];
keepEnv = true;
persist = true; # Optional, only require password verification a single time
}
];
users.users."lucy" = {
shell = pkgs.zsh;
isNormalUser = true;
description = "lucy";
extraGroups = [
"networkmanager"
"wheel"
];
};
nixpkgs.config.allowUnfree = true;
system.stateVersion = "26.05"; # Did you read the comment?
}

12
nixos/easyroam.nix Normal file
View file

@ -0,0 +1,12 @@
{
services.easyroam = {
enable = true;
pkcsFile = "/home/lucy/.certs/nixos-manual.p12";
networkmanager = {
enable = true;
};
wpa-supplicant = {
enable = true;
};
};
}

View file

@ -0,0 +1,15 @@
{
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Experimental = true;
FastConnectable = true;
};
Policy = {
AutoEnable = true;
};
};
};
}

View file

View file

@ -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 + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/64a37727-0c5f-41d4-afac-dc26978916c1";
fsType = "xfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/F424-0E3E";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

33
nixos/hardware/laptop.nix Normal file
View file

@ -0,0 +1,33 @@
# 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 = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/751981d7-36b5-4759-b0eb-7db70b5d7b8c";
fsType = "xfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/65BD-721E";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/889d88f6-0a64-482a-88e1-7a091a019373"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

43
nixos/nixvim/keymaps.nix Normal file
View file

@ -0,0 +1,43 @@
{
programs.nixvim = {
keymaps = [
{
key = "<C-f>";
action = "<cmd> lua vim.lsp.buf.format() <cr>";
}
{
key = "<c-t>";
action = "<cmd>ToggleTerm size=10<cr>";
}
{
key = "<leader>tf";
action = "<cmd>ToggleTerm size=10 direction=float<cr>";
}
{
key = "<esc>";
action = "<c-\\><c-n>";
mode = "t";
}
{
key = "<leader>w";
action = "<cmd>bdelete! <cr>";
}
{
key = "<C-l>";
action = "<C-W>l";
}
{
key = "<C-k>";
action = "<C-W>k";
}
{
key = "<C-j>";
action = "<C-W>j";
}
{
key = "<C-h>";
action = "<C-W>h";
}
];
};
}

62
nixos/nixvim/nixvim.nix Normal file
View file

@ -0,0 +1,62 @@
{
inputs,
config,
lib,
pkgs,
...
}:
{
imports = [
./plugins.nix
./keymaps.nix
];
programs.nixvim = {
nixpkgs.config.allowUnfree = true;
enable = true;
extraConfigLuaPost = ''
local map = vim.keymap.set
for i = 1, 10 do
map('n', '<A-' .. i .. '>', '<cmd> BufferGoto ' .. i .. '<cr>')
end
'';
opts = {
relativenumber = true;
number = true;
tabstop = 8;
shiftwidth = 8;
expandtab = true;
swapfile = false;
};
extraPackages = with pkgs; [
nixfmt
];
lsp = {
inlayHints.enable = true;
servers = {
clangd.enable = true;
qmlls.enable = true;
lua-language-server.enable = true;
rust_analyzer.enable = true;
nixd = {
enable = true;
config = {
formatting = {
command = "nixfmt";
};
};
};
};
};
globals = {
mapleader = " ";
};
diagnostic = {
settings = {
virtual_text = {
spacing = 4;
source = true;
};
};
};
};
}

95
nixos/nixvim/plugins.nix Normal file
View file

@ -0,0 +1,95 @@
{
programs.nixvim = {
plugins = {
lspconfig.enable = true;
web-devicons.enable = true;
blink-cmp = {
enable = true;
};
blink-indent = {
enable = true;
};
toggleterm = {
enable = true;
settings = {
size = 30;
direction = "horizontal";
};
};
cord = {
enable = true;
settings = {
display = {
theme = "atom";
};
editor = {
tooltip = "ur gay :3";
};
};
};
barbar = {
enable = true;
settings = {
icons = {
buffer_index = true;
};
};
};
lualine = {
enable = true;
settings = {
extensions = [ "toggleterm" ];
options = {
section_separators = {
left = "▎";
right = "▕";
};
component_separators = {
left = "";
right = "";
};
};
inactive_sections = {
lualine_a = [
"mode"
];
lualine_b = [
"filename"
"filetype"
];
lualine_c = [
"diagnostics"
];
lualine_x = [
"lsp_status"
];
lualine_y = [ ];
lualine_z = [
"location"
];
};
sections = {
lualine_a = [
"mode"
];
lualine_b = [
"filename"
"filetype"
];
lualine_c = [
"diagnostics"
];
lualine_x = [
"lsp_status"
];
lualine_y = [ ];
lualine_z = [
"location"
];
};
};
};
};
};
}

10
nixos/programs/common.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }: {
programs.hyprland = {
package = pkgs.hyprland;
enable = true;
withUWSM = true; # recommended for most users
xwayland.enable = true; # Xwayland can be disabled.
};
programs.direnv.enable = true;
}

10
nixos/programs/fonts.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs }: {
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
nerd-fonts.symbols-only
];
}

8
nixos/programs/steam.nix Normal file
View file

@ -0,0 +1,8 @@
{
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
}

View file

@ -0,0 +1,15 @@
{ pkgs }: {
environment.systemPackages = with pkgs; [
wl-clipboard
btop
ripgrep
fd
bat
grimblast
git
blueman
devenv
inetutils
filezilla
];
}

16
nixos/programs/xppen.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs }: {
programs.xppen = {
enable = true;
package = pkgs.xppen_4.overrideAttrs (old: {
src = pkgs.fetchurl {
url = "https://download01.xp-pen.com/file/2026/04/XPPenLinux4.0.15-260422.tar.gz";
hash = "sha256-Jady+pbqnzmVMuM0Io4/aE5B7dqNlDKPsnRj/Fbln6U=";
};
buildInputs = (old.buildInputs or [ ]) ++ [
pkgs.libXtst
pkgs.libXrandr
];
});
};
}

11
nixos/programs/zsh.nix Normal file
View file

@ -0,0 +1,11 @@
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
ohMyZsh.enable = true;
ohMyZsh.theme = "gentoo";
interactiveShellInit = ''eval "$(devenv hook zsh)"'';
};
}

View file

@ -0,0 +1,5 @@
{
services.printing.enable = true;
services.libinput.enable = true;
services.displayManager.ly.enable = true;
}

View file

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

91
nixos/stylix/stylix.nix Normal file
View file

@ -0,0 +1,91 @@
{
inputs,
config,
pkgs,
lib,
...
}:
let
keep = [
"neovim"
"qt"
"gtk"
"hyprland"
"foot"
"fuzzel"
"nixcord"
"console"
];
dir = "${inputs.stylix}/modules";
drop = builtins.filter (n: !(builtins.elem n keep)) (
builtins.attrNames (lib.filterAttrs (_: t: t == "directory") (builtins.readDir dir))
);
disable =
platform:
map (n: "${dir}/${n}/${platform}.nix") (
builtins.filter (n: builtins.pathExists "${dir}/${n}/${platform}.nix") drop
);
in
{
disabledModules = disable "nixos";
stylix.opacity = {
terminal = 0.8;
desktop = 1.0;
popups = 1.0;
};
stylix.cursor = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
size = 24;
};
stylix.icons = {
enable = true;
dark = "Papirus-Dark";
light = "Papirus-Light";
package = pkgs.papirus-icon-theme;
};
stylix = {
enable = true;
autoEnable = false;
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
polarity = "dark";
image = ./wallpaper.png;
targets = {
console.enable = true;
gtk.enable = true;
qt.enable = true;
qt.platform = lib.mkForce "qtct";
nixvim = {
enable = true;
plugin = "base16-nvim";
};
};
fonts = {
sizes = {
terminal = 12;
popups = 10;
desktop = 10;
};
serif = {
package = config.stylix.fonts.monospace.package;
name = config.stylix.fonts.monospace.name;
};
sansSerif = {
package = config.stylix.fonts.monospace.package;
name = config.stylix.fonts.monospace.name;
};
monospace = {
name = "Maple Mono";
package = pkgs.maple-mono.truetype;
};
emoji = {
package = pkgs.noto-fonts-color-emoji;
name = "Noto Color Emoji";
};
};
};
}

BIN
nixos/stylix/wallpaper.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB