Compare commits
12 Commits
efce5c6293
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
db850552e3
|
|||
|
63afac3d04
|
|||
|
645fc64ead
|
|||
|
6561d4c979
|
|||
|
f1ed339968
|
|||
|
50d14ecf83
|
|||
|
1cdc3f25e0
|
|||
|
9e62f755bb
|
|||
|
d0e6fe072a
|
|||
|
86ea11c8e8
|
|||
|
1adacf5e1e
|
|||
|
e53787deae
|
BIN
Darwin.png
Normal file
BIN
Darwin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 MiB |
@ -3,6 +3,7 @@
|
||||
Modular NixOS configuration, using [Niri](https://github.com/niri-wm/niri) and [Waybar](https://github.com/Alexays/Waybar) for a light desktop.
|
||||
|
||||

|
||||

|
||||
|
||||
To install, run `nixos-rebuild` with the `--flake` parameter from the `NixFlake` directory: `nixos-rebuild switch --flake .#nixinator`.
|
||||
Alternatively, use `nh os switch` or `nh os boot`.
|
||||
|
||||
12
flake.nix
12
flake.nix
@ -152,7 +152,17 @@
|
||||
config.allowUnfree = true;
|
||||
config.allowUnfreePredicate = pkg: true;
|
||||
|
||||
overlays = [];
|
||||
overlays = let
|
||||
pkgs-stable = import inputs.nixpkgs-stable {
|
||||
system = darwinSystem;
|
||||
|
||||
config.allowUnfree = true;
|
||||
config.allowUnfreePredicate = pkg: true;
|
||||
};
|
||||
in [
|
||||
# All my own overlays (derivations + modifications)
|
||||
(import ./overlays {inherit inputs nixpkgs pkgs-stable;})
|
||||
];
|
||||
};
|
||||
|
||||
# My own library functions are imported here.
|
||||
|
||||
@ -8,7 +8,9 @@
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
config = {
|
||||
config = let
|
||||
inherit (config.homemodules) color;
|
||||
in {
|
||||
paths = rec {
|
||||
nixflake = "${config.home.homeDirectory}/NixFlake";
|
||||
dotfiles = "${nixflake}/config";
|
||||
@ -53,6 +55,13 @@
|
||||
homeDirectory = "/Users/${config.home.username}";
|
||||
enableNixpkgsReleaseCheck = true;
|
||||
|
||||
sessionVariables = {
|
||||
LANG = "en_US.UTF-8";
|
||||
EDITOR = "nvim";
|
||||
MANPAGER = "nvim +Man!";
|
||||
TERMINAL = "kitty";
|
||||
};
|
||||
|
||||
packages = with pkgs; [
|
||||
(ripgrep.override {withPCRE2 = true;})
|
||||
gdu
|
||||
@ -72,6 +81,7 @@
|
||||
unzip
|
||||
progress
|
||||
tokei
|
||||
nix-search-tv
|
||||
nix-tree
|
||||
just
|
||||
|
||||
@ -84,7 +94,6 @@
|
||||
|
||||
dig
|
||||
tcpdump
|
||||
traceroute
|
||||
gping
|
||||
curlie
|
||||
wget
|
||||
@ -105,10 +114,40 @@
|
||||
stateVersion = "25.11";
|
||||
};
|
||||
|
||||
# TODO: Deduplicate with other configs
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
|
||||
# TODO: Module
|
||||
bat = {
|
||||
enable = true;
|
||||
|
||||
themes = {
|
||||
catppuccin-latte = {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "catppuccin";
|
||||
repo = "bat";
|
||||
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
|
||||
sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
|
||||
};
|
||||
file = "Catppuccin-latte.tmTheme";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
theme = "catppuccin-latte";
|
||||
};
|
||||
};
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
enableFishIntegration = config.homemodules.fish.enable;
|
||||
};
|
||||
|
||||
fastfetch = {
|
||||
enable = true;
|
||||
|
||||
@ -257,6 +296,104 @@
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
fd.enable = true;
|
||||
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = config.homemodules.fish.enable;
|
||||
};
|
||||
|
||||
navi = {
|
||||
enable = true;
|
||||
enableFishIntegration = config.homemodules.fish.enable;
|
||||
};
|
||||
|
||||
ssh = {
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
|
||||
matchBlocks = {
|
||||
"*" = {
|
||||
forwardAgent = false;
|
||||
addKeysToAgent = "yes";
|
||||
compression = true;
|
||||
serverAliveInterval = 0;
|
||||
serverAliveCountMax = 3;
|
||||
hashKnownHosts = false;
|
||||
userKnownHostsFile = "~/.ssh/known_hosts";
|
||||
controlMaster = "no";
|
||||
controlPath = "~/.ssh/master-%r@%n:%p";
|
||||
controlPersist = "no";
|
||||
};
|
||||
"nixinator" = {
|
||||
user = "christoph";
|
||||
hostname = "192.168.86.50";
|
||||
};
|
||||
"servenix" = {
|
||||
user = "christoph";
|
||||
hostname = "local.chriphost.de";
|
||||
};
|
||||
"thinknix" = {
|
||||
user = "christoph";
|
||||
hostname = "think.chriphost.de";
|
||||
};
|
||||
"vps" = {
|
||||
user = "root";
|
||||
hostname = "vps.chriphost.de";
|
||||
};
|
||||
"mars" = {
|
||||
user = "smchurla";
|
||||
hostname = "mars.cs.tu-dortmund.de";
|
||||
serverAliveInterval = 60;
|
||||
localForwards = [
|
||||
{
|
||||
# Resultbrowser
|
||||
bind.port = 22941;
|
||||
host.address = "127.0.0.1";
|
||||
host.port = 22941;
|
||||
}
|
||||
{
|
||||
# Mysql
|
||||
bind.port = 3306;
|
||||
host.address = "127.0.0.1";
|
||||
host.port = 3306;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
tmux = {
|
||||
enable = true;
|
||||
|
||||
clock24 = true;
|
||||
escapeTime = 0; # Delay after pressing escape
|
||||
# keyMode = "vi";
|
||||
terminal = "xterm-256color";
|
||||
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
plugin = tmuxPlugins.catppuccin;
|
||||
extraConfig = ''
|
||||
set -g @plugin 'catppuccin/tmux'
|
||||
set -g @catppuccin_flavour 'latte' # or frappe, macchiato, mocha
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
set -g default-terminal "xterm-256color"
|
||||
set-option -ga terminal-overrides ",xterm-256color:Tc"
|
||||
'';
|
||||
};
|
||||
|
||||
yt-dlp.enable = true;
|
||||
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableFishIntegration = config.homemodules.fish.enable;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
|
||||
@ -300,7 +300,6 @@ in
|
||||
nix-tree # Browse the nix store sorted by size (gdu for closures)
|
||||
nurl # Generate nix fetcher sections based on URLs
|
||||
python313 # Nicer scripting than bash
|
||||
binsider # Analyze binaries
|
||||
lazyjournal # Journalctl viewer
|
||||
systemctl-tui
|
||||
restic # Backups
|
||||
@ -757,7 +756,7 @@ in
|
||||
};
|
||||
|
||||
tmux = {
|
||||
enable = false;
|
||||
enable = true;
|
||||
|
||||
clock24 = true;
|
||||
escapeTime = 0; # Delay after pressing escape
|
||||
|
||||
@ -43,10 +43,46 @@ in {
|
||||
'';
|
||||
|
||||
programs.fish = lib.mkMerge [
|
||||
# Darwin exclusive config
|
||||
(lib.mkIf pkgs.stdenv.isDarwin {
|
||||
shellInit = ''
|
||||
set fish_greeting
|
||||
yes | fish_config theme save "system-theme"
|
||||
|
||||
set --global --export HOMEBREW_PREFIX "/opt/homebrew"
|
||||
set --global --export HOMEBREW_CELLAR "/opt/homebrew/Cellar"
|
||||
set --global --export HOMEBREW_REPOSITORY "/opt/homebrew"
|
||||
fish_add_path --global --move --path "/opt/homebrew/bin" "/opt/homebrew/sbin"
|
||||
if test -n "$MANPATH[1]"; set --global --export MANPATH ''' $MANPATH; end;
|
||||
if not contains "/opt/homebrew/share/info" $INFOPATH; set --global --export INFOPATH "/opt/homebrew/share/info" $INFOPATH; end;
|
||||
'';
|
||||
|
||||
shellAbbrs = let
|
||||
# These can be used for my config.homemodules and for HM config.programs,
|
||||
# as both of these add the package to home.packages
|
||||
hasHomePackage = package: (mylib.modules.contains config.home.packages package);
|
||||
|
||||
# Only add fish abbr if package is installed
|
||||
abbrify = package: abbr: (lib.optionalAttrs (hasHomePackage package) abbr);
|
||||
in
|
||||
lib.mkMerge [
|
||||
{
|
||||
rebuild = "sudo darwin-rebuild switch --flake .#darwinix";
|
||||
}
|
||||
|
||||
(abbrify pkgs.nix-search-tv {search = "nix-search-tv print --indexes 'darwin,home-manager,nixpkgs,nur' | fzf --preview 'nix-search-tv preview {}' --scheme history";})
|
||||
];
|
||||
})
|
||||
|
||||
# Linux exclusive config
|
||||
(lib.mkIf pkgs.stdenv.isLinux {
|
||||
generateCompletions = nixosConfig.programs.fish.generateCompletions;
|
||||
|
||||
shellInit = ''
|
||||
set fish_greeting
|
||||
yes | fish_config theme save "system-theme"
|
||||
'';
|
||||
|
||||
functions = lib.mergeAttrsList [
|
||||
(lib.optionalAttrs config.homemodules.nnn.enable {
|
||||
nnncd = {
|
||||
@ -110,12 +146,8 @@ in {
|
||||
abbrs = batifyWithArgs "abbr" "-l fish";
|
||||
|
||||
# Tools
|
||||
cd = "z"; # zoxide for quickjump to previously visited locations
|
||||
cdd = "zi";
|
||||
b = "z -"; # jump to previous dir
|
||||
blk = batify "lsblk -o NAME,LABEL,PARTLABEL,FSTYPE,SIZE,FSUSE%,MOUNTPOINT";
|
||||
blkids = batify "lsblk -o NAME,LABEL,FSTYPE,SIZE,PARTLABEL,MODEL,ID,UUID";
|
||||
nps = "nps -e";
|
||||
nd = "nix develop";
|
||||
nb = "nix build -L";
|
||||
ns = "nix shell nixpkgs#";
|
||||
@ -134,11 +166,6 @@ in {
|
||||
|
||||
(lib.optionalAttrs config.homemodules.rmpc.enable {r = "rcmp";})
|
||||
|
||||
(abbrify pkgs.rsync rec {
|
||||
rsync = "rsync -ahv --inplace --partial --info=progress2";
|
||||
copy = rsync;
|
||||
})
|
||||
|
||||
# (abbrify pkgs.sd {sed = "sd";})
|
||||
];
|
||||
})
|
||||
@ -163,9 +190,17 @@ in {
|
||||
mkdir = "mkdir -p"; # also create parents (-p)
|
||||
watch = "watch -d -c -n 0.5";
|
||||
sy = "sudo -u ${username} yazi";
|
||||
cd = "z"; # zoxide for quickjump to previously visited locations
|
||||
cdd = "zi";
|
||||
b = "z -"; # jump to previous dir
|
||||
nps = "nps -e";
|
||||
}
|
||||
|
||||
# Abbrs only available if package is installed
|
||||
(abbrify pkgs.rsync rec {
|
||||
rsync = "rsync -ahv --inplace --partial --info=progress2";
|
||||
copy = rsync;
|
||||
})
|
||||
|
||||
(abbrify pkgs.duf {
|
||||
disks = "duf --hide-mp '/var/*,/etc/*,/usr/*,/home/christoph/.*' -width 120";
|
||||
@ -210,11 +245,6 @@ in {
|
||||
];
|
||||
|
||||
plugins = [];
|
||||
|
||||
shellInit = ''
|
||||
set fish_greeting
|
||||
yes | fish_config theme save "system-theme"
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ in {
|
||||
maplocalleader = ",";
|
||||
};
|
||||
|
||||
opts = import ./vim_opts.nix {inherit lib mylib;};
|
||||
opts = import ./vim_opts.nix {inherit config lib mylib;};
|
||||
extraConfigLuaPost = builtins.readFile ./extraConfigLuaPost.lua;
|
||||
extraConfigLua = builtins.readFile ./extraConfigLua.lua;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
_: {
|
||||
{config, ...}: {
|
||||
showmode = false; # Status line already shows this
|
||||
backspace = ["indent" "eol" "start"];
|
||||
termguicolors = true; # Required by multiple plugins
|
||||
@ -37,7 +37,7 @@ _: {
|
||||
# swapfile = true;
|
||||
# backup = false;
|
||||
undofile = true;
|
||||
undodir = "/home/christoph/.vim/undo";
|
||||
undodir = "${config.home.homeDirectory}/.vim/undo";
|
||||
undolevels = 10000;
|
||||
# autochdir = true;
|
||||
confirm = true;
|
||||
|
||||
@ -7,9 +7,12 @@
|
||||
config,
|
||||
inputs,
|
||||
publicKeys,
|
||||
hostname,
|
||||
...
|
||||
}: {
|
||||
nix = {
|
||||
enable = true;
|
||||
|
||||
package = pkgs.nixVersions.stable;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes pipe-operators
|
||||
@ -30,6 +33,67 @@
|
||||
];
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "${hostname}";
|
||||
localHostName = "${hostname}";
|
||||
computerName = "${hostname}";
|
||||
|
||||
applicationFirewall = {
|
||||
enable = true;
|
||||
enableStealthMode = false;
|
||||
allowSigned = true;
|
||||
allowSignedApp = true;
|
||||
blockAllIncoming = false;
|
||||
};
|
||||
|
||||
knownNetworkServices = [
|
||||
"Wi-Fi"
|
||||
"Thunderbold Bridge"
|
||||
];
|
||||
|
||||
dns = [
|
||||
"192.168.86.26"
|
||||
"8.8.8.8"
|
||||
"8.8.4.4"
|
||||
];
|
||||
|
||||
# wg-quick = {};
|
||||
};
|
||||
|
||||
power = {
|
||||
# restartAfterFreeze = false;
|
||||
# restartAfterPowerFailure = false;
|
||||
|
||||
sleep = {
|
||||
computer = 10; # 10 minutes until sleep
|
||||
display = 5;
|
||||
harddisk = 5;
|
||||
};
|
||||
};
|
||||
|
||||
system = {
|
||||
primaryUser = "${username}";
|
||||
|
||||
# TODO:
|
||||
defaults = {
|
||||
# dock = {};
|
||||
|
||||
trackpad = {
|
||||
ActuateDetents = true; # Haptic feedback
|
||||
ActuationStrength = 1;
|
||||
Clicking = true; # Tap to click
|
||||
Dragging = true; # Double tap to drag
|
||||
TrackpadRightClick = true;
|
||||
};
|
||||
};
|
||||
|
||||
keyboard = {
|
||||
enableKeyMapping = true;
|
||||
swapLeftCtrlAndFn = true;
|
||||
swapLeftCommandAndLeftAlt = true;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${username} = {
|
||||
isHidden = false;
|
||||
description = "Christoph";
|
||||
@ -46,16 +110,34 @@
|
||||
# packages = with pkgs; [];
|
||||
};
|
||||
|
||||
environment.shells = with pkgs; [pkgs.fish];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
alejandra
|
||||
neovim
|
||||
wget
|
||||
];
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
nerd-fonts.jetbrains-mono
|
||||
monolisa
|
||||
];
|
||||
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
# aerospace = {};
|
||||
};
|
||||
|
||||
# NOTE: Not installed automatically
|
||||
homebrew = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
# brews = [];
|
||||
};
|
||||
|
||||
# Set Git commit hash for darwin-version.
|
||||
# system.configurationRevision = self.rev or self.dirtyRev or null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user