feat: Nix flake build for Darwin #23
|
@ -1,10 +1,27 @@
|
||||||
# Desktop Environment for MacOS
|
# Configuration for MacOS
|
||||||
|
|
||||||
* Installation
|
* Installation
|
||||||
|
|
||||||
Install Homebrew.
|
Install
|
||||||
|
- [[https://brew.sh/][Homebrew]]
|
||||||
|
- [[https://lix.systems/install/][Lix]]
|
||||||
|
|
||||||
* Desktop Manager
|
and use ~nix-darwin~ to install the system flake
|
||||||
|
#+begin_src sh
|
||||||
|
nix run nix-darwin -- switch --flake ~/.config/nix-darwin
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
To update the system after flake changes,
|
||||||
|
#+begin_src sh
|
||||||
|
darwin-rebuild switch --flake .
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Optionally, run
|
||||||
|
#+begin_src
|
||||||
|
nix-collect-garbage --delete-old
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* Desktop Environment
|
||||||
|
|
||||||
- [[https://github.com/koekeishiya/yabai][yabai]]: Window manager, see [[https://github.com/koekeishiya/yabai/wiki][setup guide]]
|
- [[https://github.com/koekeishiya/yabai][yabai]]: Window manager, see [[https://github.com/koekeishiya/yabai/wiki][setup guide]]
|
||||||
|
|
||||||
|
@ -18,7 +35,4 @@ Install Homebrew.
|
||||||
~fn~ key is used as the workspace leader key and ~cmd~ key is used as window
|
~fn~ key is used as the workspace leader key and ~cmd~ key is used as window
|
||||||
leader key. The reason is that ~fn~ and arrow key combinations disable arrow
|
leader key. The reason is that ~fn~ and arrow key combinations disable arrow
|
||||||
keys for other applications.
|
keys for other applications.
|
||||||
- ~Karabiner-elements~: Install and remap Caps Lock to Meh key. This is the
|
- Sketchybar: Status Bar
|
||||||
master key for window operations in ~yabai~.
|
|
||||||
- [[https://github.com/felixhageloh/uebersicht][Uebersicht]]: Widgets manager
|
|
||||||
- [[https://github.com/Jean-Tinland/simple-bar][simple-bar]]: Status bar (see page for installation guide)
|
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nix-darwin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-darwin"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1741126078,
|
||||||
|
"narHash": "sha256-ng0a4cIq3c9E3iGKomlwqKzVYs2RLOzQho2U1Mc2sqU=",
|
||||||
|
"owner": "LnL7",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"rev": "c172f50b55b087f8e7801631de977461603bb976",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "LnL7",
|
||||||
|
"ref": "nix-darwin-24.11",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-darwin": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1741029734,
|
||||||
|
"narHash": "sha256-0+dlOH+9mut5mtw8iUukJ3Q9cx/DXgBarK05W7MKggA=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c3d6c20a6a16cbfdc11405c4dd0fdf64ec3a3899",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-24.11-darwin",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nix-darwin": "nix-darwin",
|
||||||
|
"nixpkgs-darwin": "nixpkgs-darwin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
description = "Leni Aniva's Systems";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.11-darwin";
|
||||||
|
nix-darwin = {
|
||||||
|
url = "github:LnL7/nix-darwin/nix-darwin-24.11";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = inputs@{ self, nixpkgs-darwin, nix-darwin }: {
|
||||||
|
darwinConfigurations = {
|
||||||
|
tetrahedrite = nix-darwin.lib.darwinSystem {
|
||||||
|
modules = [
|
||||||
|
./nix-darwin/configuration.nix
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform = "x86_64-darwin";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
sphalerite = nix-darwin.lib.darwinSystem {
|
||||||
|
modules = [
|
||||||
|
./nix-darwin/configuration.nix
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
imports = [ ./homebrew.nix ./yabai-skhd.nix ];
|
||||||
|
# List packages installed in system profile. To search by name, run:
|
||||||
|
# $ nix-env -qaP | grep wget
|
||||||
|
environment = {
|
||||||
|
variables = {
|
||||||
|
EDITOR = "vim";
|
||||||
|
VISUAL = "vim";
|
||||||
|
};
|
||||||
|
systemPackages = with pkgs; [
|
||||||
|
vim
|
||||||
|
ripgrep
|
||||||
|
fd
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
git
|
||||||
|
direnv
|
||||||
|
nix-direnv
|
||||||
|
rustup
|
||||||
|
elan
|
||||||
|
poetry
|
||||||
|
(import ./tex.nix { inherit pkgs; })
|
||||||
|
cmake
|
||||||
|
nodejs_23
|
||||||
|
pnpm
|
||||||
|
typst
|
||||||
|
|
||||||
|
ispell
|
||||||
|
biber
|
||||||
|
lilypond-unstable-with-fonts
|
||||||
|
|
||||||
|
# Media
|
||||||
|
imagemagick
|
||||||
|
fontconfig
|
||||||
|
|
||||||
|
pass
|
||||||
|
python312Packages.pygments
|
||||||
|
];
|
||||||
|
};
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
lilypond-with-fonts
|
||||||
|
];
|
||||||
|
|
||||||
|
# Auto upgrade nix package and the daemon service.
|
||||||
|
services = {
|
||||||
|
nix-daemon.enable = true;
|
||||||
|
#karabiner-elements.enable = true;
|
||||||
|
sketchybar = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nix = {
|
||||||
|
package = pkgs.nix;
|
||||||
|
settings.experimental-features = "nix-command flakes";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable alternative shell support in nix-darwin.
|
||||||
|
programs.fish.enable = true;
|
||||||
|
|
||||||
|
# Used for backwards compatibility, please read the changelog before changing.
|
||||||
|
# $ darwin-rebuild changelog
|
||||||
|
system = {
|
||||||
|
stateVersion = 5;
|
||||||
|
defaults = {
|
||||||
|
dock = {
|
||||||
|
autohide = true;
|
||||||
|
orientation = "bottom";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
homebrew = {
|
||||||
|
enable = true;
|
||||||
|
onActivation = {
|
||||||
|
cleanup = "zap";
|
||||||
|
autoUpdate = false;
|
||||||
|
upgrade = false;
|
||||||
|
};
|
||||||
|
brews = [
|
||||||
|
"pinentry-mac"
|
||||||
|
|
||||||
|
# Building tools
|
||||||
|
"libtool"
|
||||||
|
"pkgconf"
|
||||||
|
"autoconf"
|
||||||
|
"poppler"
|
||||||
|
"automake"
|
||||||
|
|
||||||
|
"emacs-plus"
|
||||||
|
];
|
||||||
|
casks = [
|
||||||
|
# System monitoring
|
||||||
|
"grandperspective"
|
||||||
|
"lulu"
|
||||||
|
"xrg"
|
||||||
|
|
||||||
|
# Desktop Environment
|
||||||
|
"karabiner-elements"
|
||||||
|
"kando"
|
||||||
|
|
||||||
|
# Inputs
|
||||||
|
"wacom-tablet"
|
||||||
|
"ukelele"
|
||||||
|
|
||||||
|
# Multimedia
|
||||||
|
"vlc"
|
||||||
|
"darktable"
|
||||||
|
"adobe-dng-converter"
|
||||||
|
"adobe-acrobat-reader"
|
||||||
|
|
||||||
|
# Communications
|
||||||
|
"signal"
|
||||||
|
"slack"
|
||||||
|
"discord"
|
||||||
|
"zoom"
|
||||||
|
"zulip"
|
||||||
|
"tuta-mail"
|
||||||
|
|
||||||
|
# Browsing
|
||||||
|
"firefox"
|
||||||
|
"zotero"
|
||||||
|
"anki"
|
||||||
|
"skim"
|
||||||
|
|
||||||
|
# Editors
|
||||||
|
#"emacs-mac"
|
||||||
|
"arduino-ide"
|
||||||
|
"blender"
|
||||||
|
"inkscape"
|
||||||
|
|
||||||
|
# Terminal
|
||||||
|
"iterm2"
|
||||||
|
|
||||||
|
# Fonts
|
||||||
|
"font-noto-mono"
|
||||||
|
"font-source-code-pro"
|
||||||
|
];
|
||||||
|
taps = [
|
||||||
|
"koekeishiya/formulae"
|
||||||
|
#"railwaycat/emacsmacport"
|
||||||
|
"d12frosted/emacs-plus"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
pkgs.texlive.combine {
|
||||||
|
inherit (pkgs.texlive) scheme-medium
|
||||||
|
latexmk
|
||||||
|
|
||||||
|
# Symbols
|
||||||
|
amsmath
|
||||||
|
cancel
|
||||||
|
hyphenat
|
||||||
|
xstring
|
||||||
|
mnsymbol
|
||||||
|
scalerel
|
||||||
|
|
||||||
|
# Typesetting
|
||||||
|
pdfcol
|
||||||
|
changepage
|
||||||
|
upquote
|
||||||
|
anyfontsize
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
svg
|
||||||
|
datetime2
|
||||||
|
makecell
|
||||||
|
tcolorbox
|
||||||
|
type1cm
|
||||||
|
environ
|
||||||
|
minted
|
||||||
|
transparent
|
||||||
|
|
||||||
|
# Graphics
|
||||||
|
tikzmark
|
||||||
|
tikzfill
|
||||||
|
pgfplots
|
||||||
|
|
||||||
|
# Classes
|
||||||
|
llncs
|
||||||
|
beamerposter
|
||||||
|
|
||||||
|
# Fonts
|
||||||
|
gnu-freefont
|
||||||
|
raleway
|
||||||
|
lato
|
||||||
|
|
||||||
|
biblatex
|
||||||
|
;
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
yabai = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = builtins.readFile ../yabai/yabairc;
|
||||||
|
};
|
||||||
|
skhd = {
|
||||||
|
enable = true;
|
||||||
|
skhdConfig = builtins.readFile ../skhd/skhdrc;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue