modularizes config

This commit is contained in:
Dennis Schoepf 2025-12-06 15:16:21 +01:00
parent 8d24fc479e
commit d1f446410a
7 changed files with 229 additions and 189 deletions

59
modules/base/default.nix Normal file
View file

@ -0,0 +1,59 @@
{
pkgs,
inputs,
...
}:
{
nix = {
channel.enable = false;
package = pkgs.nix;
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
settings = {
experimental-features = [
"nix-command"
"flakes"
];
};
gc = {
automatic = true;
dates = "weekly";
options = "delete-older-than 7d";
persistent = false;
};
optimise = {
automatic = true;
dates = [ "weekly" ];
};
};
nixpkgs = {
config = {
allowUnfree = true;
allowUnsupportedSystem = true;
};
};
environment.systemPackages = with pkgs; [
git
btop
fish
ripgrep
fzf
fd
sd
bat
neovim
just
tldr
fortune
ffmpeg
zoxide
sqlite
rsync
restic
imagemagick
sqlite
fortune
];
}

View file

@ -0,0 +1,42 @@
{
nix-homebrew = {
enable = true;
user = "dennis";
autoMigrate = true;
};
homebrew = {
user = "dennis";
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
cleanup = "zap";
};
taps = [
"homebrew/services"
];
brews = [
"go"
"mas"
];
casks = [
"font-victor-mono"
"font-victor-mono-nerd-font"
"vlc"
"ghostty"
"hiddenbar"
"eurkey"
"karabiner-elements"
"caffeine"
"raycast"
"spotify"
"zen"
"tailscale-app"
];
};
}

59
modules/macos/default.nix Normal file
View file

@ -0,0 +1,59 @@
{
system = {
primaryUser = "dennis";
stateVersion = 5;
activationScripts.postActivation.text = ''
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
'';
defaults = {
NSGlobalDomain."com.apple.swipescrolldirection" = false;
dock = {
autohide = true;
autohide-delay = 0.01;
autohide-time-modifier = 0.01;
expose-group-apps = true;
launchanim = false;
minimize-to-application = true;
orientation = "right";
show-recents = false;
persistent-apps = [
"/Applications/Zen.app"
"/Applications/Ghostty.app"
"/System/Applications/System Settings.app/"
];
persistent-others = [
"/Users/dennis/Downloads"
];
};
finder = {
AppleShowAllExtensions = true;
CreateDesktop = false;
FXEnableExtensionChangeWarning = false;
FXPreferredViewStyle = "clmv";
ShowPathbar = true;
ShowStatusBar = true;
};
loginwindow = {
LoginwindowText = "(λ) powered by nix-darwin";
};
menuExtraClock = {
Show24Hour = true;
ShowDate = 0;
};
screencapture = {
location = "/Users/dennis/Downloads";
target = "file";
};
spaces.spans-displays = false;
};
};
security.pam.services.sudo_local.touchIdAuth = true;
}

View file

@ -1,8 +1,29 @@
{ config, ... }:
{
pkgs,
config,
lib,
...
}:
{
xdg.configFile."nvim" = {
# mkOutOfStoreSymlink needs an absolute path, otherwise it does not work: https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/nvim/config";
};
home.packages = lib.mkAfter (
with pkgs;
[
stylua
typescript-language-server
vscode-langservers-extracted
astro-language-server
tailwindcss-language-server
lua-language-server
prettierd
eslint_d
nil
tree-sitter
]
);
}