···11+if not status is-interactive
22+ # workround for thefuck not being in PATH for non-interactive sessions,
33+ # which breaks e.g. SCP/SFTP by echoing output; see
44+ # https://github.com/oh-my-fish/plugin-thefuck/blob/master/conf.d/thefuck.fish
55+ #
66+ # Probably just echoing to stderr or skipping the echo for non-interactive would fix
77+ function thefuck; end
88+end
···33, pkgs
44, user ? "ianchamberlain"
55, unstable ? import <nixos-unstable> { }
66+, nix-homebrew
67, ...
78}:
89let
···1112in
1213{
1314 # These defaults are mainly just for nixOS which I haven't converted to flakes yet
1414- # so it needs to be deprioritized to avoid conflict with e.g. darwinModules
1515+ # so it needs to be deprioritized with mkDefault to avoid conflict with e.g. darwinModules
1516 home.username = lib.mkDefault user;
1617 home.homeDirectory = lib.mkDefault inputs.homeDirectory or "/home/${config.home.user}";
1718···5455 ".git".source = mkOutOfStoreSymlink /${config.xdg.dataHome}/yadm/repo.git;
5556 };
56575858+ # TODO: this should probably be handled by nix-homebrew and/or `brew completions link`
5959+ xdg.dataFile = {
6060+ "fish/vendor_completions.d/brew.fish".source = "${nix-homebrew.inputs.brew-src}/completions/fish/brew.fish";
6161+ };
6262+5763 services = {
5864 # Automount disks when plugged in
5965 # udiskie = {
···6470 # };
65716672 # syncthing.enable = true;
6767- } // lib.optionalAttrs stdenv.isLinux {
7373+6874 # For commit signing, git-crypt, etc.
6975 gpg-agent = {
7070- enable = true;
7676+ # https://github.com/nix-community/home-manager/issues/3864
7777+ # TODO: it would be nice to setup gpg-agent.conf on macOS properly
7878+ # during activation... Maybe nix-darwin has something?
7979+ enable = stdenv.isLinux;
8080+7181 defaultCacheTtl = 432000; # 5 days
7282 maxCacheTtl = 432000;
7373- # TODO: guess this got removed on nixos??
7474- # pinentryPackage = pkgs.pinentry-curses;
8383+ pinentryPackage = pkgs.pinentry-curses;
7584 };
7685 };
77867878- # TODO: should try to convert these to flake inputs probably
7979- nixpkgs.overlays = [
8080- (final: prev: {
8181- /* TODO
8282- htop = prev.htop.overrideAttrs (_: {
8383- src = pkgs.fetchFromGitHub {
8484- owner = "ian-h-chamberlain";
8585- repo = "htop";
8686- rev = "feat/non-fkey-menubar";
8787- sha256 = "";
8888- };
8989- });
9090- #*/
9191- })
9292- ];
9393-9487 home.packages = with pkgs; [
9588 cacert
8989+ clang-tools
9090+ docker-credential-helpers
9191+ docker
9692 docker-compose
9393+ gh
9794 git-crypt
9895 git-lfs
9999- unstable.lnav
10096 nil
101101- unstable.nixd
10297 nixpkgs-fmt
9898+ openssh
9999+ pre-commit
100100+ pyenv
103101 python3
104102 rustup
105105- openssh
106103 shellcheck
107104 thefuck
108108- tree
109105 tmux
110106 tmux.terminfo
107107+ tree
108108+ unstable.lnav
109109+ unstable.nixd
111110 unzip
111111+ watch
112112 yadm
113113114114 # Fish completions + path setup stuff, needed since I'm not letting
···117117 #
118118 # This may cause trouble on nixOS but I can't remember why...
119119 config.nix.package
120120+121121+ ] ++ lib.optionals stdenv.isDarwin [
122122+ # Might also consider pinentry-touchid
123123+ pinentry_mac
124124+ swiftdefaultapps
125125+ colima
120126 ];
121127122128 # TODO: https://github.com/nix-community/home-manager/issues/5602
+71-6
.config/nix-darwin/configuration.nix
···11{ self, config, pkgs, user, ... }: {
22- # List packages installed in system profile. To search by name, run:
33- # $ nix-env -qaP | grep wget
44- environment.systemPackages = [ ];
22+ imports = [
33+ ./homebrew.nix
44+ ];
55+66+ # Basic packages that are needed by nearly everything
77+ environment.systemPackages = with pkgs; [
88+ curl
99+ cacert
1010+ ];
511612 # https://github.com/LnL7/nix-darwin/issues/239#issuecomment-719873331
713 programs.fish.enable = true;
1414+1515+ # Doesn't seem to work: https://github.com/LnL7/nix-darwin/issues/811
1616+ users.users.${user}.shell = pkgs.fish;
1717+ environment.shells = [ pkgs.fish ];
1818+ environment.loginShell = "${pkgs.fish}/bin/fish";
819920 # Symlink to dotfiles flake for easier activation
1021 # See https://github.com/LnL7/nix-darwin/pull/741
···21322233 security.pam.enableSudoTouchIdAuth = true;
23342424- system.keyboard = {
2525- enableKeyMapping = true;
2626- remapCapsLockToEscape = true;
3535+ system = {
3636+ keyboard = {
3737+ enableKeyMapping = true;
3838+ remapCapsLockToEscape = true;
3939+ };
4040+4141+ # TODO: defaults might get big enough to deserve its own module
4242+ defaults = {
4343+4444+ dock =
4545+ let
4646+ # How is there not a builtin or lib function for this???
4747+ appdir =
4848+ if config.homebrew.caskArgs.appdir == null then
4949+ "/Applications"
5050+ else
5151+ config.homebrew.caskArgs.appdir;
5252+ in
5353+ {
5454+ # TODO: these might vary by class, ~/Applications for some apps
5555+ persistent-apps =
5656+ [
5757+ "/System/Applications/System Settings.app"
5858+ "${appdir}/KeePassXC.app"
5959+ "/${appdir}/Firefox.app"
6060+ # TODO: can we stick a spacer in here somehow?
6161+6262+ "/${appdir}/Slack.app"
6363+ "/${appdir}/Microsoft Teams.app"
6464+ "/${appdir}/Visual Studio Code.app"
6565+ "/${appdir}/iTerm.app/"
6666+6767+ "/${appdir}/Fork.app/"
6868+ # "/${appdir}/Insomnium.app/" # Not installable atm
6969+ "/${appdir}/Emacs.app" # requires a symlink, not a macOS alias as the brew caveat describes
7070+7171+7272+ "/System/Applications/Calculator.app"
7373+ "/System/Applications/Utilities/Activity Monitor.app"
7474+ "/${appdir}/Spotify.app/"
7575+ ];
7676+7777+ # TODO: file docs issue that "~" doesn't work here. Would also be nice
7878+ # if it's possible to specify display options...
7979+ persistent-others = let home = config.users.users.${user}.home; in [
8080+ "${home}/Library/Application Support"
8181+ home
8282+ appdir
8383+ "${home}/Documents"
8484+ "${home}/Downloads"
8585+ ];
8686+ };
8787+ };
2788 };
8989+9090+28912992 #endregion
3093···4210543106 #endregion
44107}
108108+109109+
+70
.config/nix-darwin/homebrew.nix
···11+{ ... }: {
22+ homebrew = {
33+ enable = true;
44+55+ onActivation = {
66+ # TODO: zap would be nice but I'm scared of accidentally losing settings or
77+ # data. AppCleaner hopefully will help with this a bit too
88+ cleanup = "uninstall";
99+ };
1010+1111+ global.autoUpdate = false;
1212+1313+ taps = [
1414+ {
1515+ name = "kde-mac/kde";
1616+ clone_target = "https://invent.kde.org/packaging/homebrew-kde.git";
1717+ }
1818+ "d12frosted/emacs-plus"
1919+ ];
2020+2121+ # TODO: most of ~/.config/brew/Brewfile is probably available in nixpkgs already
2222+ brews = [
2323+ "wakeonlan"
2424+ "d12frosted/emacs-plus/emacs-plus@29"
2525+ ];
2626+2727+ casks = [
2828+ "appcleaner"
2929+ # "archgpt/tap/insomnium" # Checksum failure on install...
3030+ "balance-lock"
3131+ "bettertouchtool"
3232+ "betterzip"
3333+ "darkmodebuddy"
3434+ "disk-inventory-x"
3535+ "firefox"
3636+ "flux"
3737+ "font-monaspace"
3838+ "font-monaspace-nerd-font"
3939+ "fork"
4040+ "gimp"
4141+ "google-chrome"
4242+ "hex-fiend"
4343+ "instantview"
4444+ "iterm2"
4545+ "kde-mac/kde/kdeconnect"
4646+ "keepassxc"
4747+ "logitech-g-hub"
4848+ "proxy-audio-device"
4949+ "qlimagesize"
5050+ "qlmarkdown"
5151+ "qlvideo"
5252+ "quicklook-json"
5353+ "spotify"
5454+ "slack" # TODO: Work-only
5555+ "stretchly"
5656+ "syncthing"
5757+ "syntax-highlight"
5858+ "termhere"
5959+ "visual-studio-code"
6060+ "vlc"
6161+ "wacom-tablet"
6262+ "wireshark"
6363+ "xquartz"
6464+ "zoom"
6565+ ];
6666+6767+ # TODO: vscodes could be added in here, since nix-darwin doesn't seem to support natively
6868+ extraConfig = "";
6969+ };
7070+}
+11-2
README.md
···101011111. Install Lix
12122. `nix develop 'github:ian-h-chamberlain/dotfiles?dir=.config'`
1313-3. Clone dotfiles repo to `~` and proceed with the rest of bootstrapping
1414- `YADM_BOOTSTRAP_FULL=1 yadm clone --bootstrap https://github.com/ian-h-chamberlain/dotfiles`
1313+3. Clone dotfiles repo to `~`
1414+ `yadm clone https://github.com/ian-h-chamberlain/dotfiles`
1515+4. Import GPG keys to decrypt repo
1616+ ```
1717+ gpg --import
1818+ yadm git-crypt unlock
1919+ ```
2020+5. Bootstrap the remainder of the system
2121+ `yadm bootstrap`
2222+2323+<!-- TODO: Verify the rest of the directory structure is accurate -->
15241625## High level directory structure
1726