modularizes config
This commit is contained in:
parent
8d24fc479e
commit
d1f446410a
7 changed files with 229 additions and 189 deletions
|
|
@ -35,6 +35,12 @@
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# Custom nixosModules
|
||||||
|
nixosModules.base = import ./modules/base;
|
||||||
|
nixosModules.macos = import ./modules/macos;
|
||||||
|
nixosModules.homebrew = import ./modules/homebrew;
|
||||||
|
nixosModules.aerospace = import ./modules/aerospace;
|
||||||
|
|
||||||
nixosConfigurations.dnsc-machine = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.dnsc-machine = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit inputs outputs; };
|
specialArgs = { inherit inputs outputs; };
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
home.username = "dennis";
|
home.username = "dennis";
|
||||||
|
|
@ -10,6 +10,14 @@
|
||||||
GOPATH = "$HOME/go";
|
GOPATH = "$HOME/go";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
yt-dlp
|
||||||
|
fnm
|
||||||
|
devenv
|
||||||
|
zellij
|
||||||
|
zellij-switch
|
||||||
|
];
|
||||||
|
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
|
|
||||||
|
|
@ -1,206 +1,64 @@
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
outputs,
|
outputs,
|
||||||
_lib,
|
lib,
|
||||||
_config,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.home-manager.darwinModules.home-manager
|
inputs.home-manager.darwinModules.home-manager
|
||||||
../../modules/aerospace
|
outputs.nixosModules.base
|
||||||
|
outputs.nixosModules.macos
|
||||||
|
outputs.nixosModules.homebrew
|
||||||
|
outputs.nixosModules.aerospace
|
||||||
];
|
];
|
||||||
|
|
||||||
# Setting the user
|
# Device & user-specific settings
|
||||||
networking.hostName = "dnsc-air";
|
networking.hostName = "dnsc-air";
|
||||||
networking.computerName = "dnsc-air";
|
networking.computerName = "dnsc-air";
|
||||||
|
system.defaults.smb.NetBIOSName = "dnsc-air";
|
||||||
users.users."dennis" = {
|
users.users."dennis" = {
|
||||||
home = "/Users/dennis";
|
home = "/Users/dennis";
|
||||||
description = "Dennis Schoepf";
|
description = "Dennis Schoepf";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.settings.trusted-users = [ "dennis" ];
|
nix.settings.trusted-users = [ "dennis" ];
|
||||||
|
|
||||||
nixpkgs = {
|
# Device specific overlays
|
||||||
config = {
|
# Overlays for all devices are defined
|
||||||
allowUnfree = true;
|
# in modules/default.nix
|
||||||
allowUnsupportedSystem = true;
|
nixpkgs.overlays = [
|
||||||
};
|
|
||||||
overlays = [
|
|
||||||
inputs.zellij-switch.overlays.default
|
inputs.zellij-switch.overlays.default
|
||||||
];
|
];
|
||||||
};
|
|
||||||
|
|
||||||
# System Packages
|
# System Packages
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = lib.mkAfter (with pkgs; [ ]);
|
||||||
git
|
|
||||||
btop
|
|
||||||
fish
|
|
||||||
ripgrep
|
|
||||||
fzf
|
|
||||||
fd
|
|
||||||
sd
|
|
||||||
bat
|
|
||||||
neovim
|
|
||||||
just
|
|
||||||
tldr
|
|
||||||
fortune
|
|
||||||
stylua
|
|
||||||
typescript-language-server
|
|
||||||
vscode-langservers-extracted
|
|
||||||
astro-language-server
|
|
||||||
tailwindcss-language-server
|
|
||||||
lua-language-server
|
|
||||||
prettierd
|
|
||||||
eslint_d
|
|
||||||
atuin
|
|
||||||
nil
|
|
||||||
shellcheck
|
|
||||||
lazygit
|
|
||||||
ffmpeg
|
|
||||||
yt-dlp
|
|
||||||
zoxide
|
|
||||||
sqlite
|
|
||||||
tree-sitter
|
|
||||||
rsync
|
|
||||||
fnm
|
|
||||||
imagemagick
|
|
||||||
restic
|
|
||||||
devenv
|
|
||||||
zellij
|
|
||||||
zellij-switch
|
|
||||||
];
|
|
||||||
|
|
||||||
# Homebrew
|
# Install additional homebrew apps
|
||||||
nix-homebrew = {
|
homebrew.masApps = {
|
||||||
enable = true;
|
|
||||||
# enableRosetta = true;
|
|
||||||
user = "dennis";
|
|
||||||
autoMigrate = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
homebrew = {
|
|
||||||
user = "dennis";
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
onActivation = {
|
|
||||||
autoUpdate = true;
|
|
||||||
upgrade = true;
|
|
||||||
cleanup = "zap";
|
|
||||||
};
|
|
||||||
|
|
||||||
taps = [
|
|
||||||
"homebrew/services"
|
|
||||||
"d12frosted/emacs-plus"
|
|
||||||
];
|
|
||||||
|
|
||||||
masApps = {
|
|
||||||
Bitwarden = 1352778147;
|
Bitwarden = 1352778147;
|
||||||
"Wipr 2" = 1662217862;
|
"Wipr 2" = 1662217862;
|
||||||
"Yesterday For Old Reddit" = 1603279883;
|
"Yesterday For Old Reddit" = 1603279883;
|
||||||
"Final Cut Pro" = 424389933;
|
"Final Cut Pro" = 424389933;
|
||||||
};
|
};
|
||||||
|
|
||||||
brews = [
|
homebrew.brews = lib.mkAfter ([
|
||||||
"harfbuzz"
|
"harfbuzz"
|
||||||
"openexr"
|
"openexr"
|
||||||
"openjph"
|
"openjph"
|
||||||
"p11-kit"
|
"p11-kit"
|
||||||
"mas"
|
|
||||||
"go"
|
|
||||||
"ca-certificates"
|
"ca-certificates"
|
||||||
"gettext"
|
"gettext"
|
||||||
];
|
]);
|
||||||
|
|
||||||
casks = [
|
homebrew.casks = lib.mkAfter ([
|
||||||
"chromium"
|
|
||||||
"font-victor-mono"
|
|
||||||
"font-victor-mono-nerd-font"
|
|
||||||
"vlc"
|
|
||||||
"wezterm"
|
|
||||||
"ghostty"
|
|
||||||
"hiddenbar"
|
|
||||||
"eurkey"
|
|
||||||
"karabiner-elements"
|
|
||||||
"wezterm"
|
|
||||||
"cyberduck"
|
"cyberduck"
|
||||||
"caffeine"
|
]);
|
||||||
"tailscale-app"
|
|
||||||
"raycast"
|
|
||||||
"spotify"
|
|
||||||
"zen"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Shells
|
# Shells
|
||||||
environment.shells = [ pkgs.fish ];
|
environment.shells = [ pkgs.fish ];
|
||||||
|
|
||||||
programs.direnv.enable = true;
|
programs.direnv.enable = true;
|
||||||
|
|
||||||
# System settings
|
|
||||||
system = {
|
|
||||||
primaryUser = "dennis";
|
|
||||||
stateVersion = 5;
|
|
||||||
activationScripts.postActivation.text = ''
|
|
||||||
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
|
||||||
'';
|
|
||||||
|
|
||||||
defaults = {
|
|
||||||
smb.NetBIOSName = "dnsc-air";
|
|
||||||
|
|
||||||
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/WezTerm.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 = "λ dnsc-air (powered by nix-darwin)";
|
|
||||||
};
|
|
||||||
|
|
||||||
menuExtraClock = {
|
|
||||||
Show24Hour = true;
|
|
||||||
ShowDate = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
screencapture = {
|
|
||||||
location = "/Users/dennis/Downloads";
|
|
||||||
target = "file";
|
|
||||||
};
|
|
||||||
|
|
||||||
spaces.spans-displays = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Add ability to used TouchID for sudo authentication
|
|
||||||
security.pam.services.sudo_local.touchIdAuth = true;
|
|
||||||
|
|
||||||
# Home Manager Setup
|
# Home Manager Setup
|
||||||
home-manager = {
|
home-manager = {
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
extraSpecialArgs = { inherit inputs outputs; };
|
||||||
|
|
@ -210,17 +68,4 @@
|
||||||
dennis = import ../../home/darwin.nix;
|
dennis = import ../../home/darwin.nix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Nix settings
|
|
||||||
# Enable new Nix CLI and flakes
|
|
||||||
nix.settings.experimental-features = [
|
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
|
|
||||||
nix.package = pkgs.nix;
|
|
||||||
nix.gc = {
|
|
||||||
automatic = true;
|
|
||||||
options = "--delete-older-than 1w";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
59
modules/base/default.nix
Normal file
59
modules/base/default.nix
Normal 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
|
||||||
|
];
|
||||||
|
}
|
||||||
42
modules/homebrew/default.nix
Normal file
42
modules/homebrew/default.nix
Normal 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
59
modules/macos/default.nix
Normal 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;
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,29 @@
|
||||||
{ config, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
xdg.configFile."nvim" = {
|
xdg.configFile."nvim" = {
|
||||||
# mkOutOfStoreSymlink needs an absolute path, otherwise it does not work: https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685
|
# 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";
|
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
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue