this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Migrate a bunch of apps + dock settings to Nix

+287 -41
+8
.config/fish/functions/thefuck.fish
··· 1 + if not status is-interactive 2 + # workround for thefuck not being in PATH for non-interactive sessions, 3 + # which breaks e.g. SCP/SFTP by echoing output; see 4 + # https://github.com/oh-my-fish/plugin-thefuck/blob/master/conf.d/thefuck.fish 5 + # 6 + # Probably just echoing to stderr or skipping the echo for non-interactive would fix 7 + function thefuck; end 8 + end
+76
.config/flake.lock
··· 1 1 { 2 2 "nodes": { 3 + "brew-src": { 4 + "flake": false, 5 + "locked": { 6 + "lastModified": 1718075954, 7 + "narHash": "sha256-4TeUhv5VLEufP+Z/NkKnUk4NUaf59cMsj6NvsVbE+8w=", 8 + "owner": "Homebrew", 9 + "repo": "brew", 10 + "rev": "3f08c75e7b950d4340dab462f3e7f77e8093fa2b", 11 + "type": "github" 12 + }, 13 + "original": { 14 + "owner": "Homebrew", 15 + "ref": "4.3.5", 16 + "repo": "brew", 17 + "type": "github" 18 + } 19 + }, 20 + "flake-utils": { 21 + "inputs": { 22 + "systems": "systems" 23 + }, 24 + "locked": { 25 + "lastModified": 1710146030, 26 + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", 27 + "owner": "numtide", 28 + "repo": "flake-utils", 29 + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", 30 + "type": "github" 31 + }, 32 + "original": { 33 + "owner": "numtide", 34 + "repo": "flake-utils", 35 + "type": "github" 36 + } 37 + }, 3 38 "home-manager": { 4 39 "inputs": { 5 40 "nixpkgs": [ ··· 39 74 "type": "indirect" 40 75 } 41 76 }, 77 + "nix-homebrew": { 78 + "inputs": { 79 + "brew-src": "brew-src", 80 + "flake-utils": "flake-utils", 81 + "nix-darwin": [ 82 + "nix-darwin" 83 + ], 84 + "nixpkgs": [ 85 + "nixpkgs-darwin" 86 + ] 87 + }, 88 + "locked": { 89 + "lastModified": 1719720211, 90 + "narHash": "sha256-FNK5ZxmNC+V/wOuioc5HqkUy0ld4eW3NqcsZHLYg9HI=", 91 + "owner": "zhaofengli-wip", 92 + "repo": "nix-homebrew", 93 + "rev": "0afc51fd86693c73e4b60be8ed8c782c4c09b4cc", 94 + "type": "github" 95 + }, 96 + "original": { 97 + "owner": "zhaofengli-wip", 98 + "repo": "nix-homebrew", 99 + "type": "github" 100 + } 101 + }, 42 102 "nixos-unstable": { 43 103 "locked": { 44 104 "lastModified": 1720768451, ··· 103 163 "inputs": { 104 164 "home-manager": "home-manager", 105 165 "nix-darwin": "nix-darwin", 166 + "nix-homebrew": "nix-homebrew", 106 167 "nixos-unstable": "nixos-unstable", 107 168 "nixpkgs": "nixpkgs", 108 169 "nixpkgs-darwin": "nixpkgs-darwin", 109 170 "nixpkgs-unstable": "nixpkgs-unstable" 171 + } 172 + }, 173 + "systems": { 174 + "locked": { 175 + "lastModified": 1681028828, 176 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 177 + "owner": "nix-systems", 178 + "repo": "default", 179 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 180 + "type": "github" 181 + }, 182 + "original": { 183 + "owner": "nix-systems", 184 + "repo": "default", 185 + "type": "github" 110 186 } 111 187 } 112 188 },
+20 -8
.config/flake.nix
··· 35 35 }; 36 36 }; 37 37 38 - outputs = inputs @ { self, nixpkgs, nix-darwin, home-manager, ... }: 38 + outputs = inputs @ { self, nixpkgs, nix-darwin, home-manager, nix-homebrew, ... }: 39 39 let 40 40 inherit (builtins) mapAttrs; 41 41 inherit (nixpkgs) lib; 42 42 43 43 # TODO: maybe use https://github.com/numtide/flake-utils to help abstract 44 44 # the per-system logic stuff... 45 + # Should I define `yadm.class` type things here too? 45 46 systems = { 46 47 MacBook-Pro = { 47 48 system = "aarch64-darwin"; ··· 52 53 system = "x86_64-darwin"; 53 54 user = "ichamberlain"; 54 55 }; 55 - ichamberlain-mbp = { 56 + ichamberlain-mbp-M3 = { 56 57 system = "aarch64-darwin"; 57 58 user = "ichamberlain"; 58 59 }; ··· 80 81 (hostname: { system, user }: nix-darwin.lib.darwinSystem { 81 82 inherit system; 82 83 84 + # https://discourse.nixos.org/t/allow-unfree-in-flakes/29904/2 85 + pkgs = import inputs.nixpkgs-darwin { 86 + inherit system; 87 + # TODO: add an allowlist instead of blanket allowing 88 + config.allowUnfree = true; 89 + }; 90 + 83 91 modules = [ 84 92 ./nix-darwin/configuration.nix 85 93 nix-homebrew.darwinModules.nix-homebrew 94 + home-manager.darwinModules.home-manager 86 95 { 87 96 nix-homebrew = { 88 97 enable = true; ··· 90 99 inherit user; 91 100 # TODO: Declarative tap management 92 101 }; 93 - } 94 - { 102 + 95 103 # home-manager module expects this to be set: 96 104 users.users.${user}.home = "/Users/${user}"; 97 - } 98 - home-manager.darwinModules.home-manager 99 - { 105 + 100 106 home-manager = { 101 107 useGlobalPkgs = true; 102 108 ··· 104 110 105 111 extraSpecialArgs = { 106 112 unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 113 + nix-homebrew = inputs.nix-homebrew; 107 114 }; 108 115 }; 109 116 } ··· 124 131 self.darwinConfigurations.${host}.config.home-manager.users.${user} 125 132 else 126 133 home-manager.lib.homeManagerConfiguration { 127 - pkgs = nixpkgs.legacyPackages.${system}; 134 + # https://discourse.nixos.org/t/allow-unfree-in-flakes/29904/2 135 + pkgs = import nixpkgs { 136 + inherit system; 137 + # TODO: add an allowlist instead of blanket allowing 138 + config.allowUnfree = true; 139 + }; 128 140 129 141 modules = [ 130 142 ./home-manager/home.nix
+31 -25
.config/home-manager/home.nix
··· 3 3 , pkgs 4 4 , user ? "ianchamberlain" 5 5 , unstable ? import <nixos-unstable> { } 6 + , nix-homebrew 6 7 , ... 7 8 }: 8 9 let ··· 11 12 in 12 13 { 13 14 # These defaults are mainly just for nixOS which I haven't converted to flakes yet 14 - # so it needs to be deprioritized to avoid conflict with e.g. darwinModules 15 + # so it needs to be deprioritized with mkDefault to avoid conflict with e.g. darwinModules 15 16 home.username = lib.mkDefault user; 16 17 home.homeDirectory = lib.mkDefault inputs.homeDirectory or "/home/${config.home.user}"; 17 18 ··· 54 55 ".git".source = mkOutOfStoreSymlink /${config.xdg.dataHome}/yadm/repo.git; 55 56 }; 56 57 58 + # TODO: this should probably be handled by nix-homebrew and/or `brew completions link` 59 + xdg.dataFile = { 60 + "fish/vendor_completions.d/brew.fish".source = "${nix-homebrew.inputs.brew-src}/completions/fish/brew.fish"; 61 + }; 62 + 57 63 services = { 58 64 # Automount disks when plugged in 59 65 # udiskie = { ··· 64 70 # }; 65 71 66 72 # syncthing.enable = true; 67 - } // lib.optionalAttrs stdenv.isLinux { 73 + 68 74 # For commit signing, git-crypt, etc. 69 75 gpg-agent = { 70 - enable = true; 76 + # https://github.com/nix-community/home-manager/issues/3864 77 + # TODO: it would be nice to setup gpg-agent.conf on macOS properly 78 + # during activation... Maybe nix-darwin has something? 79 + enable = stdenv.isLinux; 80 + 71 81 defaultCacheTtl = 432000; # 5 days 72 82 maxCacheTtl = 432000; 73 - # TODO: guess this got removed on nixos?? 74 - # pinentryPackage = pkgs.pinentry-curses; 83 + pinentryPackage = pkgs.pinentry-curses; 75 84 }; 76 85 }; 77 86 78 - # TODO: should try to convert these to flake inputs probably 79 - nixpkgs.overlays = [ 80 - (final: prev: { 81 - /* TODO 82 - htop = prev.htop.overrideAttrs (_: { 83 - src = pkgs.fetchFromGitHub { 84 - owner = "ian-h-chamberlain"; 85 - repo = "htop"; 86 - rev = "feat/non-fkey-menubar"; 87 - sha256 = ""; 88 - }; 89 - }); 90 - #*/ 91 - }) 92 - ]; 93 - 94 87 home.packages = with pkgs; [ 95 88 cacert 89 + clang-tools 90 + docker-credential-helpers 91 + docker 96 92 docker-compose 93 + gh 97 94 git-crypt 98 95 git-lfs 99 - unstable.lnav 100 96 nil 101 - unstable.nixd 102 97 nixpkgs-fmt 98 + openssh 99 + pre-commit 100 + pyenv 103 101 python3 104 102 rustup 105 - openssh 106 103 shellcheck 107 104 thefuck 108 - tree 109 105 tmux 110 106 tmux.terminfo 107 + tree 108 + unstable.lnav 109 + unstable.nixd 111 110 unzip 111 + watch 112 112 yadm 113 113 114 114 # Fish completions + path setup stuff, needed since I'm not letting ··· 117 117 # 118 118 # This may cause trouble on nixOS but I can't remember why... 119 119 config.nix.package 120 + 121 + ] ++ lib.optionals stdenv.isDarwin [ 122 + # Might also consider pinentry-touchid 123 + pinentry_mac 124 + swiftdefaultapps 125 + colima 120 126 ]; 121 127 122 128 # TODO: https://github.com/nix-community/home-manager/issues/5602
+71 -6
.config/nix-darwin/configuration.nix
··· 1 1 { self, config, pkgs, user, ... }: { 2 - # List packages installed in system profile. To search by name, run: 3 - # $ nix-env -qaP | grep wget 4 - environment.systemPackages = [ ]; 2 + imports = [ 3 + ./homebrew.nix 4 + ]; 5 + 6 + # Basic packages that are needed by nearly everything 7 + environment.systemPackages = with pkgs; [ 8 + curl 9 + cacert 10 + ]; 5 11 6 12 # https://github.com/LnL7/nix-darwin/issues/239#issuecomment-719873331 7 13 programs.fish.enable = true; 14 + 15 + # Doesn't seem to work: https://github.com/LnL7/nix-darwin/issues/811 16 + users.users.${user}.shell = pkgs.fish; 17 + environment.shells = [ pkgs.fish ]; 18 + environment.loginShell = "${pkgs.fish}/bin/fish"; 8 19 9 20 # Symlink to dotfiles flake for easier activation 10 21 # See https://github.com/LnL7/nix-darwin/pull/741 ··· 21 32 22 33 security.pam.enableSudoTouchIdAuth = true; 23 34 24 - system.keyboard = { 25 - enableKeyMapping = true; 26 - remapCapsLockToEscape = true; 35 + system = { 36 + keyboard = { 37 + enableKeyMapping = true; 38 + remapCapsLockToEscape = true; 39 + }; 40 + 41 + # TODO: defaults might get big enough to deserve its own module 42 + defaults = { 43 + 44 + dock = 45 + let 46 + # How is there not a builtin or lib function for this??? 47 + appdir = 48 + if config.homebrew.caskArgs.appdir == null then 49 + "/Applications" 50 + else 51 + config.homebrew.caskArgs.appdir; 52 + in 53 + { 54 + # TODO: these might vary by class, ~/Applications for some apps 55 + persistent-apps = 56 + [ 57 + "/System/Applications/System Settings.app" 58 + "${appdir}/KeePassXC.app" 59 + "/${appdir}/Firefox.app" 60 + # TODO: can we stick a spacer in here somehow? 61 + 62 + "/${appdir}/Slack.app" 63 + "/${appdir}/Microsoft Teams.app" 64 + "/${appdir}/Visual Studio Code.app" 65 + "/${appdir}/iTerm.app/" 66 + 67 + "/${appdir}/Fork.app/" 68 + # "/${appdir}/Insomnium.app/" # Not installable atm 69 + "/${appdir}/Emacs.app" # requires a symlink, not a macOS alias as the brew caveat describes 70 + 71 + 72 + "/System/Applications/Calculator.app" 73 + "/System/Applications/Utilities/Activity Monitor.app" 74 + "/${appdir}/Spotify.app/" 75 + ]; 76 + 77 + # TODO: file docs issue that "~" doesn't work here. Would also be nice 78 + # if it's possible to specify display options... 79 + persistent-others = let home = config.users.users.${user}.home; in [ 80 + "${home}/Library/Application Support" 81 + home 82 + appdir 83 + "${home}/Documents" 84 + "${home}/Downloads" 85 + ]; 86 + }; 87 + }; 27 88 }; 89 + 90 + 28 91 29 92 #endregion 30 93 ··· 42 105 43 106 #endregion 44 107 } 108 + 109 +
+70
.config/nix-darwin/homebrew.nix
··· 1 + { ... }: { 2 + homebrew = { 3 + enable = true; 4 + 5 + onActivation = { 6 + # TODO: zap would be nice but I'm scared of accidentally losing settings or 7 + # data. AppCleaner hopefully will help with this a bit too 8 + cleanup = "uninstall"; 9 + }; 10 + 11 + global.autoUpdate = false; 12 + 13 + taps = [ 14 + { 15 + name = "kde-mac/kde"; 16 + clone_target = "https://invent.kde.org/packaging/homebrew-kde.git"; 17 + } 18 + "d12frosted/emacs-plus" 19 + ]; 20 + 21 + # TODO: most of ~/.config/brew/Brewfile is probably available in nixpkgs already 22 + brews = [ 23 + "wakeonlan" 24 + "d12frosted/emacs-plus/emacs-plus@29" 25 + ]; 26 + 27 + casks = [ 28 + "appcleaner" 29 + # "archgpt/tap/insomnium" # Checksum failure on install... 30 + "balance-lock" 31 + "bettertouchtool" 32 + "betterzip" 33 + "darkmodebuddy" 34 + "disk-inventory-x" 35 + "firefox" 36 + "flux" 37 + "font-monaspace" 38 + "font-monaspace-nerd-font" 39 + "fork" 40 + "gimp" 41 + "google-chrome" 42 + "hex-fiend" 43 + "instantview" 44 + "iterm2" 45 + "kde-mac/kde/kdeconnect" 46 + "keepassxc" 47 + "logitech-g-hub" 48 + "proxy-audio-device" 49 + "qlimagesize" 50 + "qlmarkdown" 51 + "qlvideo" 52 + "quicklook-json" 53 + "spotify" 54 + "slack" # TODO: Work-only 55 + "stretchly" 56 + "syncthing" 57 + "syntax-highlight" 58 + "termhere" 59 + "visual-studio-code" 60 + "vlc" 61 + "wacom-tablet" 62 + "wireshark" 63 + "xquartz" 64 + "zoom" 65 + ]; 66 + 67 + # TODO: vscodes could be added in here, since nix-darwin doesn't seem to support natively 68 + extraConfig = ""; 69 + }; 70 + }
+11 -2
README.md
··· 10 10 11 11 1. Install Lix 12 12 2. `nix develop 'github:ian-h-chamberlain/dotfiles?dir=.config'` 13 - 3. Clone dotfiles repo to `~` and proceed with the rest of bootstrapping 14 - `YADM_BOOTSTRAP_FULL=1 yadm clone --bootstrap https://github.com/ian-h-chamberlain/dotfiles` 13 + 3. Clone dotfiles repo to `~` 14 + `yadm clone https://github.com/ian-h-chamberlain/dotfiles` 15 + 4. Import GPG keys to decrypt repo 16 + ``` 17 + gpg --import 18 + yadm git-crypt unlock 19 + ``` 20 + 5. Bootstrap the remainder of the system 21 + `yadm bootstrap` 22 + 23 + <!-- TODO: Verify the rest of the directory structure is accurate --> 15 24 16 25 ## High level directory structure 17 26