Update to (somewhat?) dendritic pattern

Heavily inspired by https://github.com/Doc-Steve/dendritic-design-with-flake-parts.

> Atomic commits? Never heard of them!
This commit is contained in:
Weckyy702
2026-03-15 15:04:47 +01:00
parent 5f41ff2b1b
commit e34b5ecce3
81 changed files with 1413 additions and 1073 deletions

View File

@@ -0,0 +1,22 @@
{ inputs, ... }: {
config.flake.factory.autologin = username: {
imports = with inputs.self.modules.nixos; [
];
services.getty.autologinUser = username;
home-manager.sharedModules = [
inputs.self.modules.homeManager.autologin
];
};
config.flake.modules.homeManager.autologin = {
imports = with inputs.self.modules.homeManager; [
];
programs.zsh.profileExtra = ''
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then
exec hyprland
fi
'';
};
}

View File

@@ -0,0 +1,6 @@
{ lib, ... }: {
options.flake.factory = lib.mkOption {
type = lib.types.attrsOf lib.types.unspecified;
default = { };
};
}

View File

@@ -0,0 +1,9 @@
{
config.flake.factory.grub-boot = device: {
boot.loader.grub = {
enable = true;
inherit device;
configurationLimit = 10;
};
};
}

View File

@@ -0,0 +1,19 @@
{
config.flake.factory.hyprpaper =
{ wallpaper_path
, monitor_names
,
}: { config, ... }: {
services.hyprpaper =
/*
TODO: assert that hyprland is enabled
*/
{
enable = true;
settings = {
preload = [ wallpaper_path ];
wallpaper = map (mon: "mon,${wallpaper_path}") monitor_names;
};
};
};
}

View File

@@ -0,0 +1,36 @@
{
config.flake.factory.mount-cifs =
{ host
, resource
, destination
, credentials_path
, UID
, GID
,
}: {
fileSystems."${destination}" = {
device = "//${host}/${resource}";
fsType = "cifs";
options = [
# automount
"x-systemd.automount"
"noauto"
"nofail"
"soft"
"x-systemd.idle-timeout=60"
"x-systemd.device-timeout=5s"
"x-systemd.mount-timeout=5s"
# mount options
"rw"
"iocharset=utf8"
# user
"uid=${UID}"
"gid=${GID}"
"credentials=${credentials_path}"
];
};
};
}

30
modules/factory/user.nix Normal file
View File

@@ -0,0 +1,30 @@
{ self, ... }: {
config.flake.factory.user = username: isAdmin: {
nixos."${username}" =
{ lib
, pkgs
, ...
}: {
users.users."${username}" = {
isNormalUser = true;
home = "/home/${username}";
extraGroups = lib.optionals isAdmin [ "wheel" ];
shell = pkgs.zsh;
};
programs.zsh.enable = true;
# required for zsh completion
environment.pathsToLink = [ "/share/zsh" ];
home-manager.users."${username}" = {
imports = [
self.modules.homeManager."${username}"
];
};
};
homeManager."${username}" = {
home.username = "${username}";
};
};
}

View File

@@ -0,0 +1,14 @@
{ inputs, ... }: {
flake.modules.nixos.keith = {
imports = with inputs.self.modules.nixos;
with inputs.self.factory; [
system-desktop
(autologin "weckyy702")
(grub-boot "/dev/nvme0n1")
development-tools
i18n-de
#TODO: moar aspects
];
};
}

View File

@@ -0,0 +1,12 @@
{
flake.modules.nixos.keith = {
fileSystems."/" = {
device = "/dev/disk/by-uuid/0869e843-348d-47e3-b6a1-79ad814ff62b";
fsType = "ext4";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/40b22e5b-839d-4189-93e7-246407cc76c7"; }
];
};
}

View File

@@ -0,0 +1,3 @@
{ inputs, ... }: {
flake.nixosConfigurations = inputs.self.lib.mkNixos "x86_64-linux" "keith";
}

View File

@@ -0,0 +1,13 @@
{ inputs, ... }: {
flake.modules.nixos.keith = { lib, ... }: {
hardware.enableRedistributableFirmware = true;
imports = with inputs.self.modules.nixos; [
amd-gpu
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
nixpkgs.hostPlatform = "x86_64-linux";
hardware.cpu.amd.updateMicrocode = true;
};
}

View File

@@ -0,0 +1,31 @@
{
flake.modules.nixos.keith = {
networking.hostName = "keith";
networking.networkmanager = {
enable = true;
ensureProfiles.profiles = {
p2p-nas = {
connection = {
id = "p2p-nas";
type = "ethernet";
interface-name = "enp1s0";
autoconnect = true;
};
ipv6 = {
method = "manual";
addresses = "fd00:fa57::1/64";
};
ipv4.method = "disabled";
ethernet.mtu = 9000;
};
};
};
networking.extraHosts = ''
fd00:fa57::2 duke.veltnet
'';
networking.firewall.enable = false;
};
}

View File

@@ -0,0 +1,6 @@
{
flake.modules.nixos.keith.fileSystems."/home/weckyy702/Documents" = {
device = "/dev/disk/by-uuid/2d6f2255-eca4-489b-9f0f-6c455cd394fc";
fsType = "ext4";
};
}

View File

@@ -0,0 +1,16 @@
{ inputs, ... }: {
flake.modules.nixos.keith = { config, ... }: {
age.secrets."nas-creds".file = "${inputs.secrets}/nas-creds.age";
imports = with inputs.self.factory; [
(mount-cifs {
host = "duke.veltnet";
resource = "home";
destination = "/home/weckyy702/duke";
credentials_path = "${config.age.secrets.nas-creds.path}";
UID = "weckyy702";
GID = "users";
})
];
};
}

View File

@@ -0,0 +1,25 @@
{ inputs, ... }: {
flake.modules.nixos.keith = { config, ... }: {
imports = with inputs.self.modules.nixos; [
weckyy702
steam
];
home-manager.users.weckyy702 = { config, ... }: {
imports = with inputs.self.modules.homeManager;
with inputs.self.factory; [
(hyprpaper {
wallpaper_path = "${inputs.assets}/horizontal_16x9.png";
monitor_names = [
"DP-1"
"HDMI-A-1"
];
})
vesktop
spicetify
borgmatic
qbittorrent
];
};
};
}

8
modules/nix/assets.nix Normal file
View File

@@ -0,0 +1,8 @@
{
flake-file.inputs = {
assets = {
url = "path:./assets";
flake = false;
};
};
}

View File

@@ -0,0 +1,22 @@
{ inputs, ... }: {
imports = [
inputs.flake-parts.flakeModules.modules
inputs.flake-file.flakeModules.default
];
flake-file.inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
flake-file.url = "github:vic/flake-file";
import-tree.url = "github:vic/import-tree";
};
flake-file.outputs = ''
inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules)
'';
systems = [
# f Darwin >:(
"aarch64-linux"
"x86_64-linux"
];
}

View File

@@ -0,0 +1,33 @@
{ inputs
, lib
, ...
}: {
# Helper functions for creating system / home-manager configurations
options.flake.lib = lib.mkOption {
type = lib.types.attrsOf lib.types.unspecified;
default = { };
};
config.flake.lib = {
mkNixos = system: name: {
${name} = inputs.nixpkgs.lib.nixosSystem {
modules = [
inputs.self.modules.nixos.${name}
{ nixpkgs.hostPlatform = lib.mkDefault system; }
{ nixpkgs.config.allowUnfree = true; }
];
};
};
mkHomeManager = system: name: {
${name} = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.${system};
modules = [
inputs.self.modules.homeManager.${name}
{ nixpkgs.config.allowUnfree = true; }
];
};
};
};
}

View File

@@ -0,0 +1,23 @@
{ inputs
, config
, ...
}: {
# Add home-manager input
flake-file.inputs = {
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
imports = [ inputs.home-manager.flakeModules.home-manager ];
flake.modules.nixos.home-manager = {
imports = [
inputs.home-manager.nixosModules.home-manager
];
home-manager = {
verbose = true;
useGlobalPkgs = true;
};
};
}

View File

@@ -0,0 +1,26 @@
{ inputs, ... }: {
flake-file.inputs = {
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
secrets = {
url = "path:./secrets";
flake = false;
};
};
flake.modules.nixos.secrets = { pkgs, ... }: {
imports = [
inputs.agenix.nixosModules.default
];
environment.systemPackages = [ inputs.agenix.packages.${pkgs.stdenv.hostPlatform.system}.default ];
};
flake.modules.homeManager.secrets = { pkgs, ... }: {
imports = [
inputs.agenix.homeManagerModules.default
];
};
}

View File

@@ -0,0 +1,14 @@
{ inputs, ... }: {
flake-file.inputs = {
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};
flake.modules.homeManager.browser = { pkgs, ... }: {
home.packages = [
inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default
];
};
}

View File

@@ -0,0 +1,7 @@
{
flake.modules.homeManager.btop = { pkgs, ... }: {
home.packages = with pkgs; [
btop
];
};
}

View File

@@ -0,0 +1,48 @@
{ inputs, ... }: {
flake-file.inputs = {
catppuccin.url = "github:catppuccin/nix/release-25.11";
catppuccin.inputs.nixpkgs.follows = "nixpkgs";
};
flake.modules.nixos.catppuccin = {
imports = [
inputs.catppuccin.nixosModules.catppuccin
];
home-manager.sharedModules = [
inputs.self.modules.homeManager.catppuccin
];
catppuccin.enable = true;
};
flake.modules.homeManager.catppuccin = { pkgs, ... }: {
imports = [
inputs.catppuccin.homeModules.catppuccin
];
# Catppuccin cursor
home.pointerCursor =
let
size = 24;
in
{
enable = true;
package = pkgs.catppuccin-cursors.mochaMauve;
name = "catppuccin-mocha-mauve-cursors";
inherit size;
dotIcons.enable = true;
gtk.enable = true;
hyprcursor.enable = true;
hyprcursor.size = size;
};
catppuccin.enable = true;
# Required for QT apps to use the catppuccin colors
qt = {
enable = true;
style.name = "kvantum";
};
};
}

View File

@@ -0,0 +1,9 @@
{
flake.modules.nixos.cli-tools = { pkgs, ... }: {
environment.systemPackages = with pkgs; [
git
htop
vim
];
};
}

View File

@@ -0,0 +1,14 @@
{ inputs, ... }: {
flake.modules.nixos.development-tools = { pkgs, ... }: {
imports = with inputs.self.modules.nixos; [
rust
];
environment.systemPackages = with pkgs; [
cmake
gnumake
clang
gcc
];
};
}

View File

@@ -0,0 +1,18 @@
{ inputs, ... }: {
flake-file.inputs = {
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
flake.modules.nixos.rust = { pkgs, ... }: {
nixpkgs.overlays = [
inputs.rust-overlay.overlays.default
];
environment.systemPackages = with pkgs; [
rust-bin.stable.latest.default
];
};
}

View File

@@ -0,0 +1,9 @@
{
flake.modules.homeManager.direnv = {
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
};
}

8
modules/programs/fzf.nix Normal file
View File

@@ -0,0 +1,8 @@
{
flake.modules.homeManager.fzf = {
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
};
}

16
modules/programs/git.nix Normal file
View File

@@ -0,0 +1,16 @@
{
flake.modules.nixos.git = { pkgs, ... }: {
environment.systemPackages = [ pkgs.git ];
};
flake.modules.homeManager.git = {
programs.git = {
enable = true;
settings.user = {
email = "weckyy702@gmail.com";
name = "Weckyy702";
};
#TODO: signing
};
};
}

View File

@@ -0,0 +1,8 @@
{
flake.modules.nixos.gnupg = {
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};
}

View File

@@ -0,0 +1,20 @@
{ inputs, ... }: {
flake.modules.nixos.hyprland = {
programs.hyprland.enable = true;
# Force electron apps to use wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
home-manager.sharedModules = [
inputs.self.modules.homeManager.hyprland
];
};
flake.modules.homeManager.hyprland = { pkgs, ... }: {
wayland.windowManager.hyprland.enable = true;
services.hyprpolkitagent.enable = true;
home.packages = with pkgs; [
hyprpicker
];
};
}

View File

@@ -0,0 +1,89 @@
{
flake.modules.homeManager.hyprland = {
wayland.windowManager.hyprland.settings = {
"$mod" = "SUPER";
"$browser" = "zen";
"$term" = "kitty";
general = {
border_size = 2;
gaps_in = 0;
gaps_out = 5;
layout = "dwindle";
allow_tearing = false;
resize_on_border = true;
};
snap = { };
input = {
kb_layout = "de";
follow_mouse = 1;
};
exec-once = [
"hyprctl setcursor catppuccin-mocha-mauve-cursors 24"
];
bind =
[
"$mod, Q, exit"
"$mod, Return, exec, $term"
"$mod, D, exec, rofi -show drun -modes drun,calc"
"$mod, F2, exec, $browser"
"$mod, c, killactive"
"$mod, f, fullscreen"
"$mod, h, movefocus, l"
"$mod, j, movefocus, d"
"$mod, k, movefocus, u"
"$mod, l, movefocus, r"
"$mod+SHIFT, h, movewindow, l"
"$mod+SHIFT, j, movewindow, d"
"$mod+SHIFT, k, movewindow, u"
"$mod+SHIFT, l, movewindow, r"
", Print, exec, grim -g \"$(slurp)\" \"/home/weckyy702/Pictures/screenshots/$(date -Iseconds).png\""
"$mod+SHIFT, s, exec, hyprlock"
]
++
# Switch workspaces
(map (i: "$mod, ${builtins.toString i}, workspace, ${builtins.toString i}") [ 0 1 2 3 4 5 6 7 8 9 ])
++ (map (i: "$mod+SHIFT, ${builtins.toString i}, movetoworkspacesilent, ${builtins.toString i}") [ 0 1 2 3 4 5 6 7 8 9 ]);
bindm = [
"$mod, mouse:272, movewindow"
];
bindel = [
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
bindl = [
", XF86AudioNext, exec, playerctl position 5+"
", XF86AudioPrev, exec, playerctl position 5-"
", XF86AudioPlay, exec, playerctl play-pause"
];
bindo = [
", XF86AudioNext, exec, playerctl next"
", XF86AudioPrev, exec, playerctl previous"
];
decoration = {
shadow.enabled = false;
blur.enabled = true;
active_opacity = 0.8;
inactive_opacity = 0.8;
};
animations.enabled = false;
misc.disable_hyprland_logo = true;
cursor.inactive_timeout = 3;
ecosystem.no_update_news = true;
ecosystem.no_donation_nag = true;
};
};
}

View File

@@ -0,0 +1,5 @@
{
flake.modules.homeManager.kitty = {
#TODO: kitty config
};
}

View File

@@ -0,0 +1,14 @@
{
flake.modules.homeManager.kitty = {
programs.kitty = {
enable = true;
enableGitIntegration = true;
font = {
name = "JetBrains Mono";
size = 10;
};
shellIntegration.enableZshIntegration = true;
#TODO: kitty config
};
};
}

View File

@@ -0,0 +1,11 @@
{
flake.modules.homeManager.multimedia = { pkgs, ... }: {
home.packages = with pkgs; [
feh
mpv
playerctl
file
zathura
];
};
}

View File

@@ -0,0 +1,19 @@
{ ... }: {
imports = [
./keymaps.nix
./options.nix
./plugins
];
clipboard.register = "unnamedplus";
colorschemes.catppuccin = {
enable = true;
settings.flavour = "mocha";
settings.integrations = {
gitsigns = true;
treesitter = true;
cmp = true;
};
};
}

View File

@@ -0,0 +1,25 @@
{ ... }: {
globals.mapleader = " ";
keymaps = [
{
key = "<esc>";
action = ":noh<CR>";
mode = "n";
options = {
silent = true;
desc = "Clear search highlight";
};
}
{
key = "j";
action = "gj";
mode = "n";
}
{
key = "k";
action = "gk";
mode = "n";
}
];
}

View File

@@ -0,0 +1,50 @@
{ ... }: {
opts = {
# Expand tabs to 4 spaces
shiftwidth = 4;
softtabstop = 4;
expandtab = true;
signcolumn = "yes:3";
# automatically indent and try to be smart about it
autoindent = true;
smartindent = true;
# Relative line numbers
number = true;
relativenumber = true;
# See search result as you type
inccommand = "split";
# Visualize whitespace
list = true;
listchars = {
tab = "» ";
trail = "·";
nbsp = "";
};
# Show which line the cursor is on
cursorline = true;
# Keep the cursor somewhat centered on the screen
scrolloff = 25;
# Ask if operations would fail due to unsaved buffers
confirm = true;
# ignore case in search unless multiple capital case letter have been typed
smartcase = true;
ignorecase = true;
completeopt = "menu,menuone,noselect";
# Persistent undos :)
undofile = true;
# enable resize by mouse
mouse = "n";
};
}

View File

@@ -0,0 +1,42 @@
{ ... }: {
imports = [
./keymaps.nix
];
plugins = {
lspkind.enable = true;
cmp-nvim-lsp-signature-help.enable = true;
cmp = {
enable = true;
autoEnableSources = true;
autoLoad = true;
settings.sources = [
{ name = "nvim_lsp"; }
{ name = "nvim_lsp_signature_help"; }
{ name = "path"; }
];
settings.mapping = {
"<Tab>" = "cmp.mapping.select_next_item()";
"<S-Tab>" = "cmp.mapping.select_prev_item()";
"<C-Space>" = "cmp.mapping.complete()";
"<C-S-Space>" = "cmp.mapping.close()";
"<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
};
};
lsp-format.enable = true;
none-ls = {
enable = true;
enableLspFormat = true;
sources.formatting = {
alejandra.enable = true;
nixpkgs_fmt.enable = true;
};
};
};
}

View File

@@ -0,0 +1,16 @@
{ ... }: {
keymaps = [
{
key = "grd";
action = "<cmd>Telescope lsp_definitions<CR>";
mode = "n";
options.desc = "LSP: [G]oto [D]efinition";
}
{
key = "gri";
action = "<cmd>Telescope lsp_implementations<CR>";
mode = "n";
options.desc = "LSP: [G]oto [I]mplementations";
}
];
}

View File

@@ -0,0 +1,24 @@
{ ... }: {
imports = [
./lsp.nix
./telescope
./cmp
];
plugins = {
lualine.enable = true;
web-devicons.enable = true;
treesitter = {
enable = true;
autoLoad = true;
};
gitsigns.enable = true;
which-key.enable = true;
glow.enable = true;
};
}

View File

@@ -0,0 +1,36 @@
{ ... }: {
dependencies.rust-analyzer.enable = true;
lsp = {
inlayHints.enable = true;
servers = {
"*" = {
config.capabilities.textDocument.semanticTokens.multilineTokenSupport = true;
config.root_markers = [
".git"
];
};
clangd = {
enable = true;
config.root_markers = [
"compile_commands.json"
];
};
rust_analyzer = {
enable = true;
};
rnix.enable = true;
};
keymaps = [
{
key = "<leader>e";
action = "<cmd>lua vim.diagnostic.open_float()<CR>";
options.desc = "Open Diagnostics";
}
];
};
plugins.lspconfig.enable = true;
plugins.clangd-extensions.enable = true;
}

View File

@@ -0,0 +1,20 @@
{ ... }: {
imports = [
./keymaps.nix
];
dependencies.ripgrep.enable = true;
plugins.telescope = {
enable = true;
extensions.file-browser = {
enable = true;
settings = {
git_status = true;
hijack_netrw = true;
respect_gitignore = true;
fzf-native.enable = true;
fzf-native.settings.case_mode = "ignore_case";
};
};
};
}

View File

@@ -0,0 +1,24 @@
{ ... }: {
keymaps = [
{
key = "<leader>sf";
action = "<cmd>Telescope find_files<CR>";
options.desc = "[S]earch [F]iles";
}
{
key = "<leader>sg";
action = "<cmd>Telescope live_grep<CR>";
options.desc = "[S]earch by [G]rep";
}
{
key = "<leader>sw";
action = "<cmd>Telescope grep_string<CR>";
options.desc = "[S]earch current [W]ord";
}
{
key = "<leader>q";
action = "<cmd>Telescope diagnostics<CR>";
options.desc = "Lsp Diagnostics";
}
];
}

View File

@@ -0,0 +1,19 @@
{ inputs, ... }: {
flake-file.inputs = {
nixvim.url = "github:nix-community/nixvim/nixos-25.11";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
};
flake.modules.homeManager.nixvim = {
imports = [
inputs.nixvim.homeModules.nixvim
];
programs.nixvim = {
enable = true;
imports = [ ./_nixvim-config ];
};
home.sessionVariables.EDITOR = "nvim";
};
}

View File

@@ -0,0 +1,7 @@
{
flake.modules.homeManager.qbittorrent = { pkgs, ... }: {
home.packages = with pkgs; [
qbittorrent
];
};
}

15
modules/programs/rofi.nix Normal file
View File

@@ -0,0 +1,15 @@
{
flake.modules.homeManager.rofi = { pkgs, ... }: {
programs.rofi = {
enable = true;
modes = [
"combi"
"drun"
"calc"
];
plugins = [
pkgs.rofi-calc
];
};
};
}

View File

@@ -0,0 +1,30 @@
{ inputs, ... }: {
flake-file.inputs = {
spicetify-nix.url = "github:Gerg-L/spicetify-nix";
spicetify-nix.inputs.nixpkgs.follows = "nixpkgs";
};
flake.modules.homeManager.spicetify = { pkgs, ... }: {
imports = [
inputs.spicetify-nix.homeManagerModules.default
];
programs.spicetify =
let
spkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
{
enable = true;
enabledExtensions = with spkgs.extensions; [
fullAppDisplay
shuffle
aiBandBlocker
];
enabledCustomApps = with spkgs.apps; [
newReleases
];
theme = spkgs.themes.catppuccin;
colorScheme = "mocha";
};
};
}

View File

@@ -0,0 +1,16 @@
{
flake.modules.nixos.steam = { pkgs, ... }: {
programs.steam = {
enable = true;
extraCompatPackages = [
pkgs.proton-ge-bin
];
protontricks = {
enable = true;
};
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
remotePlay.openFirewall = true;
};
};
}

View File

@@ -0,0 +1,9 @@
# might make this bad boy a factory later
{
flake.modules.homeManager.thunderbird = {
programs.thunderbird = {
enable = true;
profiles.default.isDefault = true;
};
};
}

View File

@@ -0,0 +1,5 @@
{
flake.modules.homeManager.vesktop = {
programs.vesktop.enable = true;
};
}

View File

@@ -0,0 +1,5 @@
{
flake.modules.homeManager.zathura = {
programs.zathura.enable = true;
};
}

View File

@@ -0,0 +1,9 @@
{
flake.modules.homeManager.zoxide = {
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = [ "--cmd cd" ];
};
};
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
{ inputs, ... }: {
flake.modules.nixos.zsh = {
programs.zsh.enable = true;
environment.pathsToLink = [ "/share/zsh" ];
};
flake.modules.homeManager.zsh = { pkgs, ... }: {
imports = with inputs.self.modules.homeManager; [
fzf
zoxide
];
programs.zsh = {
enable = true;
autocd = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initContent = pkgs.lib.mkBefore ''
date
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
'';
plugins = [
{
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/";
file = "powerlevel10k.zsh-theme";
}
{
name = "p10k-config";
src = ./p10k;
file = "p10k.zsh";
}
];
oh-my-zsh = {
enable = true;
plugins = [
"git"
];
theme = "robbyrussell";
};
};
};
}

View File

@@ -0,0 +1,67 @@
{
flake.modules.homeManager.borgmatic =
{ config
, pkgs
, ...
}:
let
hostname = config.networking.hostname;
username = config.home.username;
in
{
home.packages = with pkgs; [
libnotify
];
programs.borgmatic = {
backups.default = {
location = {
repositories = [
{
label = "duke";
path = "ssh://borg@duke.veltnet:2222/home/borg/backups/${hostname}-${username}";
}
];
excludeHomeManagerSymlinks = true;
patterns = [
#TODO: home.homeDirectory might be usable here
"R /home/${username}/Documents"
"R /home/${username}/.ssh"
"- /home/${username}/Documents/SteamLibrary"
"- /home/${username}/Documents/PrismLauncher instances"
"- /home/${username}/Documents/.Trash-1000"
"- /home/${username}/Documents/VMs/Data"
"- **/node_modules"
"- **/.git"
"- **/.cache"
"- **/*build"
"- **/target"
"- **/.venv"
"- **/venv"
"- **/.gradle"
"- **/out"
"- **/dist"
"- **/.pio"
];
};
retention.keepWeekly = 2;
storage.extraConfig.ssh_command = "ssh -i /home/${username}/.ssh/id_ed25519_borg";
#FIXME: consistency checks!!!
};
};
systemd.user.services.borgmatic = {
Unit.Description = "Create a backup using borgmatic";
Service.ExecStart = "${pkgs.borgmatic}/bin/borgmatic create --stats";
};
systemd.user.timers.borgmatic = {
Unit.Description = "Create weekly backups using borgmatic";
Timer = {
OnCalendar = "Weekly";
Persistent = true;
};
Install.WantedBy = [ "timers.target" ];
};
};
}

View File

@@ -0,0 +1,5 @@
{
flake.modules.nixos.debuginfod = {
services.nixseparatedebuginfod2.enable = true;
};
}

View File

@@ -0,0 +1,47 @@
{
flake.modules.nixos.kanata = {
services.kanata = {
enable = true;
#TODO: move kanata config to module
keyboards.remap-specials = {
config = ''
(deflocalkeys-linux
ö 39
)
(defsrc
a s d j k l ö
)
(defvar
tap-time 200
hold-time 200
)
(defalias
a (tap-hold $tap-time $hold-time a lmet)
s (tap-hold $tap-time $hold-time s lctl)
d (tap-hold $tap-time $hold-time d lsft)
k (tap-hold $tap-time $hold-time k rsft)
l (tap-hold $tap-time $hold-time l rctl)
ö (tap-hold $tap-time $hold-time ö ralt)
activate (tap-dance $tap-time (j _ _ (layer-switch home-mods)))
deactivate (tap-dance $tap-time (j _ _ (layer-switch base)))
)
(deflayer base
a s d @activate k l ö
)
(deflayer home-mods
@a @s @d @deactivate @k @l @ö
)
'';
extraDefCfg = ''
process-unmapped-keys yes
'';
};
};
};
}

View File

@@ -0,0 +1,5 @@
{
flake.modules.nixos.mullvad = {
services.mullvad-vpn.enable = true;
};
}

View File

@@ -0,0 +1,6 @@
{
flake.modules.nixos.openssh = { lib, ... }: {
services.openssh.enable = true;
services.openssh.openFirewall = lib.mkDefault false;
};
}

View File

@@ -0,0 +1,9 @@
{
flake.modules.nixos.pipewire = {
services.pipewire = {
alsa.enable = true;
enable = true;
wireplumber.enable = true;
};
};
}

View File

@@ -0,0 +1,18 @@
{
flake.modules.nixos.amd-gpu = { pkgs, ... }: {
environment.systemPackages = with pkgs; [
rocmPackages.amdsmi
];
boot.kernelModules = [ "kvm-amd" ];
hardware.graphics = {
enable = true;
extraPackages = [ pkgs.rocmPackages.clr.icd ];
};
hardware.amdgpu = {
initrd.enable = true;
opencl.enable = true;
};
};
}

View File

@@ -0,0 +1,23 @@
{
flake.modules.nixos.i18n-de = {
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";
};
# Configure console keymap
console.keyMap = "de";
};
}

View File

@@ -0,0 +1,5 @@
{
flake.modules.nixos.linux-latest = { pkgs, ... }: {
boot.kernelPackages = pkgs.linuxPackages_latest;
};
}

View File

@@ -0,0 +1,11 @@
{
flake.modules.nixos.nerdfonts = { pkgs, ... }: {
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
fontDir.enable = true;
};
};
}

View File

@@ -0,0 +1,9 @@
{ inputs, ... }: {
flake.modules.homeManager.system-base = { config, ... }: {
imports = with inputs.self.modules.homeManager; [
];
home.homeDirectory = "/home/${config.home.username}";
home.stateVersion = "25.11";
};
}

View File

@@ -0,0 +1,65 @@
{ inputs, ... }: {
flake-file.inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
};
flake.modules.nixos.system-base = { pkgs, ... }: {
imports = with inputs.self.modules.nixos; [
home-manager
secrets
openssh
linux-latest
cli-tools
zsh
gnupg
];
# Make unstable nixpkgs available as pkgs.unstable
nixpkgs.overlays = [
(final: _prev: {
unstable = import inputs.nixpkgs-unstable {
inherit (final) config;
system = pkgs.stdenv.hostPlatform.system;
};
})
];
nixpkgs.config.allowUnfree = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
nix.settings = {
substituters = [
# high priority since it's almost always used
"https://cache.nixos.org?priority=10"
"https://install.determinate.systems"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM"
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
experimental-features = [
"nix-command"
"flakes"
# "allow-import-from-derivation"
];
download-buffer-size = 1024 * 1024 * 1024;
trusted-users = [
"root"
"@wheel"
];
};
system.stateVersion = "25.11";
};
}

View File

@@ -0,0 +1,28 @@
{ inputs, ... }: {
flake.modules.nixos.system-desktop = {
imports = with inputs.self.modules.nixos; [
system-base
hyprland
#TODO: moar aspects
];
home-manager.sharedModules = [
inputs.self.modules.homeManager.system-desktop
];
};
flake.modules.homeManager.system-desktop = {
imports = with inputs.self.modules.homeManager; [
system-base
rofi
kitty
browser
multimedia
zsh
thunderbird
];
};
}

View File

@@ -0,0 +1,29 @@
{ inputs
, self
, lib
, ...
}: {
flake.homeConfigurations = inputs.self.lib.mkHomeManager "x86_64-linux" "weckyy702";
flake.modules = lib.mkMerge [
(self.factory.user "weckyy702" true)
{
nixos.weckyy702 = {
imports = with self.modules.nixos; [
kanata
catppuccin
];
users.users.weckyy702.extraGroups = [ "networkmanager" "dialout" ];
};
homeManager.weckyy702 = { pkgs, ... }: {
imports = with self.modules.homeManager; [
nixvim
btop
#TODO: moar aspects
];
};
}
];
}