init
This commit is contained in:
2025-08-04 15:37:38 +02:00
parent 3ae535f1b1
commit 703e3f8adf
57 changed files with 674 additions and 3283 deletions

74
profiles/base/default.nix Normal file
View File

@@ -0,0 +1,74 @@
{
agenix,
config,
pkgs,
lib,
user,
...
}:
{
imports = [
agenix.darwinModules.default
];
nixpkgs = {
config = {
allowUnfree = true;
allowBroken = true;
allowInsecure = false;
allowUnsupportedSystem = true;
};
overlays =
let
path = ../../overlays;
in
with builtins;
map (n: import (path + ("/" + n))) (
filter (n: match ".*\\.nix" n != null || pathExists (path + ("/" + n + "/default.nix"))) (
attrNames (readDir path)
)
);
};
nix = {
package = pkgs.nix;
settings = {
trusted-users = [
"@admin"
"${user}"
];
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org"
];
trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
};
gc = {
automatic = true;
interval = {
Weekday = 0;
Hour = 2;
Minute = 0;
};
options = "--delete-older-than 30d";
};
extraOptions = ''
experimental-features = nix-command flakes
'';
};
environment.systemPackages =
with pkgs;
[
agenix.packages."${pkgs.system}".default
]
++ (import ./packages.nix { inherit pkgs; });
programs.fish.enable = true;
system = {
primaryUser = user;
stateVersion = 5;
};
}

View File

@@ -0,0 +1,9 @@
{
programs.atuin = {
enable = true;
enableFishIntegration = true;
daemon = {
enable = true;
};
};
}

View File

@@ -0,0 +1,25 @@
{
pkgs,
...
}:
{
programs.bat = {
enable = true;
config = {
theme = "Catppuccin Latte";
pager = "ov";
};
themes = {
"Catppuccin Latte" = {
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "bat";
rev = "6810349b28055dce54076712fc05fc68da4b8ec0";
sha256 = "lJapSgRVENTrbmpVyn+UQabC9fpV1G1e+CdlJ090uvg=";
};
file = "Themes/Catppuccin Latte.tmTheme";
};
};
};
}

View File

@@ -0,0 +1,6 @@
{
programs.eza = {
enable = true;
enableFishIntegration = true;
};
}

View File

@@ -0,0 +1,9 @@
{
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting # Disable greeting
set -gx LS_COLORS "$(vivid generate catppuccin-latte)"
'';
};
}

View File

@@ -0,0 +1,57 @@
{
pkgs,
...
}:
{
programs.ghostty = {
enable = true;
package = pkgs.ghostty-bin;
settings = {
command = "${pkgs.fish}/bin/fish";
theme = "catppuccin-latte";
window-padding-x = 8;
window-padding-y = 2;
window-padding-balance = true;
font-family = "Iosevka";
font-size = 15.5;
font-feature = [
"-calt"
"-dlig"
];
cursor-style = "block";
mouse-hide-while-typing = true;
mouse-scroll-multiplier = 1.25;
shell-integration = "detect";
shell-integration-features = "no-cursor";
keybind = [
"global:ctrl+shift+space=toggle_quick_terminal"
"shift+enter=text:\\n"
"ctrl+one=goto_tab:1"
"ctrl+two=goto_tab:2"
"ctrl+three=goto_tab:3"
"ctrl+four=goto_tab:4"
"ctrl+five=goto_tab:5"
"ctrl+six=goto_tab:6"
"ctrl+seven=goto_tab:7"
"ctrl+eight=goto_tab:8"
"ctrl+nine=goto_tab:9"
"ctrl+left=previous_tab"
"ctrl+right=next_tab"
"ctrl+h=previous_tab"
"ctrl+l=next_tab"
"ctrl+shift+left=goto_split:left"
"ctrl+shift+right=goto_split:right"
"ctrl+shift+h=goto_split:left"
"ctrl+shift+j=goto_split:down"
"ctrl+shift+k=goto_split:up"
"ctrl+shift+l=goto_split:right"
"ctrl+shift+enter=new_split:right"
"ctrl+t=new_tab"
"ctrl+w=close_tab"
"ctrl+shift+w=close_surface"
];
};
};
}

View File

@@ -0,0 +1,27 @@
{
...
}:
let
name = "Christoph Schmatzler";
in
{
programs.git = {
enable = true;
ignores = [ "*.swp" ];
userName = name;
lfs = {
enable = true;
};
extraConfig = {
init.defaultBranch = "main";
core = {
editor = "vim";
autocrlf = "input";
};
# commit.gpgsign = true;
pull.rebase = true;
rebase.autoStash = true;
};
};
}

View File

@@ -0,0 +1,5 @@
{
programs.jujutsu = {
enable = true;
};
}

View File

@@ -0,0 +1,25 @@
{
pkgs,
lib,
user,
...
}:
{
programs.ssh = {
enable = true;
includes = [
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux "/home/${user}/.ssh/config_external")
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin "/Users/${user}/.ssh/config_external")
];
matchBlocks = {
"github.com" = {
identitiesOnly = true;
identityFile = [
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux "/home/${user}/.ssh/id_ed25519")
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin "/Users/${user}/.ssh/id_ed25519")
];
};
};
};
}

View File

@@ -0,0 +1,66 @@
{
lib,
...
}:
{
programs.starship = {
enable = true;
enableFishIntegration = true;
settings = {
add_newline = true;
command_timeout = 750;
format = lib.concatStrings [
"$directory"
"$\{custom.jj\}"
"$line_break"
"$character"
];
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
};
custom.jj = {
ignore_timeout = true;
description = "The current jj status";
when = "jj root";
symbol = "🥋 ";
command = lib.concatStrings [
"jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template '"
"separate(\" \","
" change_id.shortest(4),"
" bookmarks,"
" \"|\","
" concat("
" if(conflict, \"💥\"),"
" if(divergent, \"🚧\"),"
" if(hidden, \"👻\"),"
" if(immutable, \"🔒\"),"
" ),"
" raw_escape_sequence(\"\\x1b[1;32m\") ++ if(empty, \"(empty)\"),"
" raw_escape_sequence(\"\\x1b[1;32m\") ++ coalesce("
" truncate_end(29, description.first_line(), \"\"),"
" \"(no description set)\","
" ) ++ raw_escape_sequence(\"\\x1b[0m\"),"
")'"
];
};
git_state = {
disabled = true;
};
git_commit = {
disabled = true;
};
git_metrics = {
disabled = true;
};
git_branch = {
disabled = true;
};
};
};
}

View File

@@ -0,0 +1,6 @@
{
programs.zoxide = {
enable = true;
enableFishIntegration = true;
};
}

View File

@@ -0,0 +1,5 @@
{
programs.zsh = {
enable = true;
};
}

View File

@@ -0,0 +1,29 @@
{ pkgs }:
with pkgs;
[
age
age-plugin-yubikey
docker
docker-compose
git
gnupg
iosevka
jjui
jq
killall
libfido2
neovim
nixfmt
nodejs_24
opencode
openssh
ripgrep
sqlite
tree
unrar
unzip
vivid
wget
zip
]

View File

@@ -0,0 +1,74 @@
{
config,
pkgs,
lib,
home-manager,
user,
...
}:
{
imports = [
./dock
./system.nix
./homebrew.nix
./secrets.nix
];
users.users.${user} = {
name = "${user}";
home = "/Users/${user}";
isHidden = false;
shell = pkgs.fish;
};
home-manager = {
useGlobalPkgs = true;
users.${user} =
{
pkgs,
config,
lib,
...
}:
{
_module.args = { inherit user; };
imports = [
../base/home-manager/atuin.nix
../base/home-manager/bat.nix
../base/home-manager/eza.nix
../base/home-manager/fish.nix
../base/home-manager/ghostty.nix
../base/home-manager/git.nix
../base/home-manager/jujutsu.nix
../base/home-manager/ssh.nix
../base/home-manager/starship.nix
../base/home-manager/zoxide.nix
../base/home-manager/zsh.nix
];
home = {
packages = pkgs.callPackage ./packages.nix { };
stateVersion = "23.11";
};
};
};
local = {
dock = {
enable = true;
username = user;
entries = [
{ path = "/Applications/Safari.app/"; }
{ path = "/${pkgs.ghostty-bin}/Applications/Ghostty.app/"; }
{ path = "/System/Applications/Notes.app/"; }
{ path = "/System/Applications/Music.app/"; }
{ path = "/System/Applications/System Settings.app/"; }
{
path = "${config.users.users.${user}.home}/Downloads";
section = "others";
options = "--sort name --view grid --display stack";
}
];
};
};
}

View File

@@ -0,0 +1,105 @@
{
config,
pkgs,
lib,
...
}:
with lib;
let
cfg = config.local.dock;
inherit (pkgs) stdenv dockutil;
in
{
options = {
local.dock = {
enable = mkOption {
description = "Enable dock";
default = stdenv.isDarwin;
example = false;
};
entries = mkOption {
description = "Entries on the Dock";
type =
with types;
listOf (submodule {
options = {
path = lib.mkOption { type = str; };
section = lib.mkOption {
type = str;
default = "apps";
};
options = lib.mkOption {
type = str;
default = "";
};
};
});
readOnly = true;
};
username = mkOption {
description = "Username to apply the dock settings to";
type = types.str;
};
};
};
config = mkIf cfg.enable (
let
normalize = path: if hasSuffix ".app" path then path + "/" else path;
entryURI =
path:
"file://"
+ (builtins.replaceStrings
[
" "
"!"
"\""
"#"
"$"
"%"
"&"
"'"
"("
")"
]
[
"%20"
"%21"
"%22"
"%23"
"%24"
"%25"
"%26"
"%27"
"%28"
"%29"
]
(normalize path)
);
wantURIs = concatMapStrings (entry: "${entryURI entry.path}\n") cfg.entries;
createEntries = concatMapStrings (
entry:
"${dockutil}/bin/dockutil --no-restart --add '${entry.path}' --section ${entry.section} ${entry.options}\n"
) cfg.entries;
in
{
system.activationScripts.postActivation.text = ''
echo >&2 "Setting up the Dock for ${cfg.username}..."
su ${cfg.username} -s /bin/sh <<'USERBLOCK'
haveURIs="$(${dockutil}/bin/dockutil --list | ${pkgs.coreutils}/bin/cut -f2)"
if ! diff -wu <(echo -n "$haveURIs") <(echo -n '${wantURIs}') >&2 ; then
echo >&2 "Resetting Dock."
${dockutil}/bin/dockutil --no-restart --remove all
${createEntries}
killall Dock
else
echo >&2 "Dock setup complete."
fi
USERBLOCK
'';
}
);
}

View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
homebrew = {
enable = true;
masApps = { };
};
}

View File

@@ -0,0 +1,8 @@
{ pkgs }:
with pkgs;
[
_1password-gui
dockutil
raycast
]

View File

@@ -0,0 +1,13 @@
{
config,
pkgs,
agenix,
secrets,
user,
...
}:
{
age.identityPaths = [
"/Users/${user}/.ssh/id_ed25519"
];
}

View File

@@ -0,0 +1,32 @@
{ lib, ... }:
{
system.defaults = {
NSGlobalDomain = {
AppleShowAllExtensions = true;
ApplePressAndHoldEnabled = false;
KeyRepeat = 2;
InitialKeyRepeat = 15;
"com.apple.mouse.tapBehavior" = 1;
"com.apple.sound.beep.volume" = 0.0;
"com.apple.sound.beep.feedback" = 0;
};
dock = {
autohide = false;
show-recents = false;
launchanim = true;
orientation = "bottom";
tilesize = 48;
};
finder = {
_FXShowPosixPathInTitle = false;
};
trackpad = {
Clicking = true;
TrackpadThreeFingerDrag = true;
};
};
}

View File

@@ -0,0 +1,59 @@
{
config,
pkgs,
lib,
home-manager,
user,
...
}:
let
sharedFiles = import ../base/files.nix { inherit config pkgs; };
additionalFiles = import ./files.nix { inherit config pkgs; };
in
{
imports = [
./packages.nix
./secrets.nix
./disk-config.nix
];
users.users.${user} = {
isNormalUser = true;
home = "/home/${user}";
extraGroups = [
"wheel"
"sudo"
"audio"
"video"
"network"
"systemd-journal"
];
shell = pkgs.fish;
};
home-manager = {
useGlobalPkgs = true;
users.${user} =
{
pkgs,
config,
lib,
...
}:
{
_module.args = { inherit user; };
imports = [
../base/home-manager.nix
];
home = {
packages = pkgs.callPackage ./packages.nix { };
file = lib.mkMerge [
sharedFiles
additionalFiles
];
stateVersion = "23.11";
};
};
};
}