1

Compare commits

...

12 Commits

9 changed files with 282 additions and 23 deletions

BIN
Darwin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

View File

@ -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. Modular NixOS configuration, using [Niri](https://github.com/niri-wm/niri) and [Waybar](https://github.com/Alexays/Waybar) for a light desktop.
![](FastFetch.png) ![](FastFetch.png)
![](Darwin.png)
To install, run `nixos-rebuild` with the `--flake` parameter from the `NixFlake` directory: `nixos-rebuild switch --flake .#nixinator`. 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`. Alternatively, use `nh os switch` or `nh os boot`.

View File

@ -152,7 +152,17 @@
config.allowUnfree = true; config.allowUnfree = true;
config.allowUnfreePredicate = pkg: 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. # My own library functions are imported here.

View File

@ -8,7 +8,9 @@
inputs, inputs,
... ...
}: { }: {
config = { config = let
inherit (config.homemodules) color;
in {
paths = rec { paths = rec {
nixflake = "${config.home.homeDirectory}/NixFlake"; nixflake = "${config.home.homeDirectory}/NixFlake";
dotfiles = "${nixflake}/config"; dotfiles = "${nixflake}/config";
@ -53,6 +55,13 @@
homeDirectory = "/Users/${config.home.username}"; homeDirectory = "/Users/${config.home.username}";
enableNixpkgsReleaseCheck = true; enableNixpkgsReleaseCheck = true;
sessionVariables = {
LANG = "en_US.UTF-8";
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
TERMINAL = "kitty";
};
packages = with pkgs; [ packages = with pkgs; [
(ripgrep.override {withPCRE2 = true;}) (ripgrep.override {withPCRE2 = true;})
gdu gdu
@ -72,6 +81,7 @@
unzip unzip
progress progress
tokei tokei
nix-search-tv
nix-tree nix-tree
just just
@ -84,7 +94,6 @@
dig dig
tcpdump tcpdump
traceroute
gping gping
curlie curlie
wget wget
@ -105,10 +114,40 @@
stateVersion = "25.11"; stateVersion = "25.11";
}; };
# TODO: Deduplicate with other configs
programs = { programs = {
home-manager.enable = true; 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 = { fastfetch = {
enable = true; 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 = { services = {

View File

@ -300,7 +300,6 @@ in
nix-tree # Browse the nix store sorted by size (gdu for closures) nix-tree # Browse the nix store sorted by size (gdu for closures)
nurl # Generate nix fetcher sections based on URLs nurl # Generate nix fetcher sections based on URLs
python313 # Nicer scripting than bash python313 # Nicer scripting than bash
binsider # Analyze binaries
lazyjournal # Journalctl viewer lazyjournal # Journalctl viewer
systemctl-tui systemctl-tui
restic # Backups restic # Backups
@ -757,7 +756,7 @@ in
}; };
tmux = { tmux = {
enable = false; enable = true;
clock24 = true; clock24 = true;
escapeTime = 0; # Delay after pressing escape escapeTime = 0; # Delay after pressing escape

View File

@ -43,10 +43,46 @@ in {
''; '';
programs.fish = lib.mkMerge [ 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 # Linux exclusive config
(lib.mkIf pkgs.stdenv.isLinux { (lib.mkIf pkgs.stdenv.isLinux {
generateCompletions = nixosConfig.programs.fish.generateCompletions; generateCompletions = nixosConfig.programs.fish.generateCompletions;
shellInit = ''
set fish_greeting
yes | fish_config theme save "system-theme"
'';
functions = lib.mergeAttrsList [ functions = lib.mergeAttrsList [
(lib.optionalAttrs config.homemodules.nnn.enable { (lib.optionalAttrs config.homemodules.nnn.enable {
nnncd = { nnncd = {
@ -110,12 +146,8 @@ in {
abbrs = batifyWithArgs "abbr" "-l fish"; abbrs = batifyWithArgs "abbr" "-l fish";
# Tools # 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"; blk = batify "lsblk -o NAME,LABEL,PARTLABEL,FSTYPE,SIZE,FSUSE%,MOUNTPOINT";
blkids = batify "lsblk -o NAME,LABEL,FSTYPE,SIZE,PARTLABEL,MODEL,ID,UUID"; blkids = batify "lsblk -o NAME,LABEL,FSTYPE,SIZE,PARTLABEL,MODEL,ID,UUID";
nps = "nps -e";
nd = "nix develop"; nd = "nix develop";
nb = "nix build -L"; nb = "nix build -L";
ns = "nix shell nixpkgs#"; ns = "nix shell nixpkgs#";
@ -134,11 +166,6 @@ in {
(lib.optionalAttrs config.homemodules.rmpc.enable {r = "rcmp";}) (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";}) # (abbrify pkgs.sd {sed = "sd";})
]; ];
}) })
@ -163,9 +190,17 @@ in {
mkdir = "mkdir -p"; # also create parents (-p) mkdir = "mkdir -p"; # also create parents (-p)
watch = "watch -d -c -n 0.5"; watch = "watch -d -c -n 0.5";
sy = "sudo -u ${username} yazi"; 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 # Abbrs only available if package is installed
(abbrify pkgs.rsync rec {
rsync = "rsync -ahv --inplace --partial --info=progress2";
copy = rsync;
})
(abbrify pkgs.duf { (abbrify pkgs.duf {
disks = "duf --hide-mp '/var/*,/etc/*,/usr/*,/home/christoph/.*' -width 120"; disks = "duf --hide-mp '/var/*,/etc/*,/usr/*,/home/christoph/.*' -width 120";
@ -210,11 +245,6 @@ in {
]; ];
plugins = []; plugins = [];
shellInit = ''
set fish_greeting
yes | fish_config theme save "system-theme"
'';
} }
]; ];

View File

@ -126,7 +126,7 @@ in {
maplocalleader = ","; maplocalleader = ",";
}; };
opts = import ./vim_opts.nix {inherit lib mylib;}; opts = import ./vim_opts.nix {inherit config lib mylib;};
extraConfigLuaPost = builtins.readFile ./extraConfigLuaPost.lua; extraConfigLuaPost = builtins.readFile ./extraConfigLuaPost.lua;
extraConfigLua = builtins.readFile ./extraConfigLua.lua; extraConfigLua = builtins.readFile ./extraConfigLua.lua;

View File

@ -1,4 +1,4 @@
_: { {config, ...}: {
showmode = false; # Status line already shows this showmode = false; # Status line already shows this
backspace = ["indent" "eol" "start"]; backspace = ["indent" "eol" "start"];
termguicolors = true; # Required by multiple plugins termguicolors = true; # Required by multiple plugins
@ -37,7 +37,7 @@ _: {
# swapfile = true; # swapfile = true;
# backup = false; # backup = false;
undofile = true; undofile = true;
undodir = "/home/christoph/.vim/undo"; undodir = "${config.home.homeDirectory}/.vim/undo";
undolevels = 10000; undolevels = 10000;
# autochdir = true; # autochdir = true;
confirm = true; confirm = true;

View File

@ -7,9 +7,12 @@
config, config,
inputs, inputs,
publicKeys, publicKeys,
hostname,
... ...
}: { }: {
nix = { nix = {
enable = true;
package = pkgs.nixVersions.stable; package = pkgs.nixVersions.stable;
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes pipe-operators 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} = { users.users.${username} = {
isHidden = false; isHidden = false;
description = "Christoph"; description = "Christoph";
@ -46,16 +110,34 @@
# packages = with pkgs; []; # packages = with pkgs; [];
}; };
environment.shells = with pkgs; [pkgs.fish];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
alejandra alejandra
neovim neovim
wget wget
]; ];
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
monolisa
];
programs = { programs = {
fish.enable = true; fish.enable = true;
}; };
services = {
# aerospace = {};
};
# NOTE: Not installed automatically
homebrew = {
enable = true;
enableFishIntegration = true;
# brews = [];
};
# Set Git commit hash for darwin-version. # Set Git commit hash for darwin-version.
# system.configurationRevision = self.rev or self.dirtyRev or null; # system.configurationRevision = self.rev or self.dirtyRev or null;