The general configuration of my development environment and many other general computer things.
fork

Configure Feed

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

Update configuration to first deployed version

+216 -65
-2
darwin/casks.nix
··· 11 11 12 12 # Communication Tools 13 13 "discord" 14 - "signal" 15 14 "zoom" 16 15 "zulip" 17 16 18 17 # Utility Tools 19 18 "calibre" 20 - "mirrorop" 21 19 22 20 # Productivity Tools 23 21 "alfred"
+18
darwin/default.nix
··· 12 12 # Auto upgrade nix package and the daemon service. 13 13 services.nix-daemon.enable = true; 14 14 15 + # Setup user, packages, programs 16 + nix = { 17 + package = pkgs.nixUnstable; 18 + settings.trusted-users = [ "@admin" "${user}" ]; 19 + 20 + gc = { 21 + user = "root"; 22 + automatic = true; 23 + interval = { Weekday = 0; Hour = 2; Minute = 0; }; 24 + options = "--delete-older-than 30d"; 25 + }; 26 + 27 + # Turn this on to make command line easier 28 + extraOptions = '' 29 + experimental-features = nix-command flakes 30 + ''; 31 + }; 32 + 15 33 # Turn off NIX_PATH warnings now that we're using flakes 16 34 system.checks.verifyNixPath = false; 17 35
+4 -3
darwin/files.nix
··· 2 2 3 3 let 4 4 xdg_configHome = "${config.users.users.${user}.home}/.config"; 5 - xdg_dataHome = "${config.users.users.${user}.home}/.local/share"; 6 - xdg_stateHome = "${config.users.users.${user}.home}/.local/state"; in 7 - {} 5 + xdg_dataHome = "${config.users.users.${user}.home}/.local/share"; 6 + xdg_stateHome = "${config.users.users.${user}.home}/.local/state"; 7 + in 8 + { }
+9 -5
darwin/home-manager.nix
··· 14 14 shell = pkgs.zsh; 15 15 }; 16 16 17 - homebrew.enable = false; 18 - homebrew.casks = pkgs.callPackage ./casks.nix {}; 17 + homebrew.enable = true; 18 + homebrew.casks = pkgs.callPackage ./casks.nix { }; 19 + homebrew.brews = [ 20 + "yabai" 21 + "skhd" 22 + ]; 19 23 20 24 # These app IDs are from using the mas CLI app 21 25 # mas = mac app store ··· 47 51 # Enable home-manager 48 52 home-manager = { 49 53 useGlobalPkgs = true; 50 - users.${user} = { pkgs, config, lib, ... }:{ 54 + users.${user} = { pkgs, config, lib, ... }: { 51 55 home.enableNixpkgsReleaseCheck = false; 52 - home.packages = pkgs.callPackage ./packages.nix {}; 56 + home.packages = pkgs.callPackage ./packages.nix { }; 53 57 home.file = lib.mkMerge [ 54 58 sharedFiles 55 59 additionalFiles 56 60 ]; 57 61 home.stateVersion = "21.11"; 58 - programs = {} // import ../shared/home-manager.nix { inherit config pkgs lib; }; 62 + programs = { } // import ../shared/home-manager.nix { inherit config pkgs lib; }; 59 63 }; 60 64 }; 61 65 }
+48 -14
flake.lock
··· 61 61 "nixpkgs": "nixpkgs" 62 62 }, 63 63 "locked": { 64 - "lastModified": 1702195734, 65 - "narHash": "sha256-MvQa1qT+10dqJyMKtACCpFOcFYIv9i/REek1bHaIhS4=", 64 + "lastModified": 1702203126, 65 + "narHash": "sha256-4BhN2Vji19MzRC7SUfPZGmtZ2WZydQeUk/ogfRBIZMs=", 66 66 "owner": "nix-community", 67 67 "repo": "home-manager", 68 - "rev": "9a00befa13126e318fa4b895adeb84d383c9ab3f", 68 + "rev": "defbb9c5857e157703e8fc7cf3c2ceb01cb95883", 69 69 "type": "github" 70 70 }, 71 71 "original": { ··· 93 93 "homebrew-cask": { 94 94 "flake": false, 95 95 "locked": { 96 - "lastModified": 1702174207, 97 - "narHash": "sha256-P7mCkLiuqnnjfle3mDc0oFhQreubAnCP0DWKt3ksLDs=", 96 + "lastModified": 1702255628, 97 + "narHash": "sha256-Q46Mgw3oLVafoo2mRzDdR6IQ9hdCnfk59uaWoiaAnjE=", 98 98 "owner": "homebrew", 99 99 "repo": "homebrew-cask", 100 - "rev": "f9965c0cadc974f2b8706ecab78c5ff0972cd5a9", 100 + "rev": "204e8eea0c0f3f1a26bf6f3f238595fdd3fc869c", 101 101 "type": "github" 102 102 }, 103 103 "original": { ··· 106 106 "type": "github" 107 107 } 108 108 }, 109 + "homebrew-cask-fonts": { 110 + "flake": false, 111 + "locked": { 112 + "lastModified": 1702265088, 113 + "narHash": "sha256-pU63NGMzYZ/4m4JWu5HmxZCU9pKJoUK++W46awmGtdc=", 114 + "owner": "homebrew", 115 + "repo": "homebrew-cask-fonts", 116 + "rev": "a7fb1a6146ccd9a8d164c4c7f529da56d56310e9", 117 + "type": "github" 118 + }, 119 + "original": { 120 + "owner": "homebrew", 121 + "repo": "homebrew-cask-fonts", 122 + "type": "github" 123 + } 124 + }, 109 125 "homebrew-core": { 110 126 "flake": false, 111 127 "locked": { 112 - "lastModified": 1702193388, 113 - "narHash": "sha256-fqUIwK1YXIYGu3ZU1g/gRmfaOy8ZKyUgJhGSvSsYAyU=", 128 + "lastModified": 1702252550, 129 + "narHash": "sha256-QMPC/VNrE706F1sWXokP5k5npM7blXMLc8g8R0iqvHA=", 114 130 "owner": "homebrew", 115 131 "repo": "homebrew-core", 116 - "rev": "75ca7b621f326dcafe2ff834e9cde10d354d7080", 132 + "rev": "fe91ea92d9b89f099209ab8252623c337ac13cd7", 117 133 "type": "github" 118 134 }, 119 135 "original": { ··· 122 138 "type": "github" 123 139 } 124 140 }, 141 + "homebrew-koekeishiya": { 142 + "flake": false, 143 + "locked": { 144 + "lastModified": 1699812011, 145 + "narHash": "sha256-1pXKOdZz1KADlAU3410afYq97Icxq0At5c9HClwLeFo=", 146 + "owner": "koekeishiya", 147 + "repo": "homebrew-formulae", 148 + "rev": "d4c95802ca991ea41512320af412072e775c1eb7", 149 + "type": "github" 150 + }, 151 + "original": { 152 + "owner": "koekeishiya", 153 + "repo": "homebrew-formulae", 154 + "type": "github" 155 + } 156 + }, 125 157 "nix-darwin": { 126 158 "inputs": { 127 159 "nixpkgs": "nixpkgs_2" ··· 150 182 "locked": { 151 183 "lastModified": 1695057498, 152 184 "narHash": "sha256-wn3j7u5tOgLLbNxZC542rJiP5iX323m+CoGPMgPOxp4=", 153 - "owner": "zhaofengli-wip", 185 + "owner": "zhaofengli", 154 186 "repo": "nix-homebrew", 155 187 "rev": "6ab33c5e9249e74401144a7c667d96a757c5d341", 156 188 "type": "github" 157 189 }, 158 190 "original": { 159 - "owner": "zhaofengli-wip", 191 + "owner": "zhaofengli", 160 192 "repo": "nix-homebrew", 161 193 "type": "github" 162 194 } ··· 208 240 }, 209 241 "nixpkgs_4": { 210 242 "locked": { 211 - "lastModified": 1701718080, 212 - "narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=", 243 + "lastModified": 1702151865, 244 + "narHash": "sha256-9VAt19t6yQa7pHZLDbil/QctAgVsA66DLnzdRGqDisg=", 213 245 "owner": "nixos", 214 246 "repo": "nixpkgs", 215 - "rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335", 247 + "rev": "666fc80e7b2afb570462423cb0e1cf1a3a34fedd", 216 248 "type": "github" 217 249 }, 218 250 "original": { ··· 228 260 "home-manager": "home-manager", 229 261 "homebrew-bundle": "homebrew-bundle", 230 262 "homebrew-cask": "homebrew-cask", 263 + "homebrew-cask-fonts": "homebrew-cask-fonts", 231 264 "homebrew-core": "homebrew-core", 265 + "homebrew-koekeishiya": "homebrew-koekeishiya", 232 266 "nix-homebrew": "nix-homebrew", 233 267 "nixpkgs": "nixpkgs_4" 234 268 }
+40 -18
flake.nix
··· 1 - 2 1 { 3 2 description = "Starter Configuration for NixOS and MacOS"; 4 3 ··· 10 9 inputs.nixpkgs.follows = "nixpkgs"; 11 10 }; 12 11 nix-homebrew = { 13 - url = "github:zhaofengli-wip/nix-homebrew"; 12 + url = "github:zhaofengli/nix-homebrew"; 14 13 }; 15 14 homebrew-bundle = { 16 15 url = "github:homebrew/homebrew-bundle"; 17 16 flake = false; 18 17 }; 18 + homebrew-cask = { 19 + url = "github:homebrew/homebrew-cask"; 20 + flake = false; 21 + }; 22 + homebrew-cask-fonts = { 23 + url = "github:homebrew/homebrew-cask-fonts"; 24 + flake = false; 25 + }; 19 26 homebrew-core = { 20 27 url = "github:homebrew/homebrew-core"; 21 28 flake = false; 22 29 }; 23 - homebrew-cask = { 24 - url = "github:homebrew/homebrew-cask"; 30 + homebrew-koekeishiya = { 31 + url = "github:koekeishiya/homebrew-formulae"; 25 32 flake = false; 26 33 }; 27 34 }; 28 - outputs = { self, darwin, nix-homebrew, homebrew-bundle, homebrew-core, homebrew-cask, home-manager, nixpkgs } @inputs: 35 + outputs = 36 + { self 37 + , darwin 38 + , home-manager 39 + , homebrew-bundle 40 + , homebrew-cask 41 + , homebrew-cask-fonts 42 + , homebrew-core 43 + , homebrew-koekeishiya 44 + , nix-homebrew 45 + , nixpkgs 46 + } @inputs: 29 47 let 30 48 user = "dekker1"; 31 49 linuxSystems = [ "x86_64-linux" "aarch64-linux" ]; ··· 33 51 forAllLinuxSystems = f: nixpkgs.lib.genAttrs linuxSystems (system: f system); 34 52 forAllDarwinSystems = f: nixpkgs.lib.genAttrs darwinSystems (system: f system); 35 53 forAllSystems = f: nixpkgs.lib.genAttrs (linuxSystems ++ darwinSystems) (system: f system); 36 - devShell = system: let 37 - pkgs = nixpkgs.legacyPackages.${system}; 38 - in 39 - { 40 - default = with pkgs; mkShell { 41 - nativeBuildInputs = with pkgs; [ bashInteractive git ]; 42 - shellHook = with pkgs; '' 54 + devShell = system: 55 + let 56 + pkgs = nixpkgs.legacyPackages.${system}; 57 + in 58 + { 59 + default = with pkgs; mkShell { 60 + nativeBuildInputs = with pkgs; [ bashInteractive git ]; 61 + shellHook = with pkgs; '' 43 62 ''; 63 + }; 44 64 }; 45 - }; 46 65 in 47 66 { 48 67 devShells = forAllSystems devShell; ··· 55 74 home-manager.darwinModules.home-manager 56 75 { 57 76 nix-homebrew = { 58 - enable = false; 77 + enable = true; 59 78 user = "${user}"; 60 79 taps = { 61 80 "homebrew/homebrew-core" = homebrew-core; 62 81 "homebrew/homebrew-cask" = homebrew-cask; 63 - "homebrew/homebrew-bundle" = homebrew-bundle; 82 + "homebrew/homebrew-cask-fonts" = homebrew-cask-fonts; 83 + "homebrew/homebrew-bundle" = homebrew-bundle; 84 + "koekeishiya/homebrew-formulae" = homebrew-koekeishiya; 64 85 }; 65 86 mutableTaps = false; 66 87 autoMigrate = true; ··· 74 95 system = system; 75 96 specialArgs = inputs; 76 97 modules = [ 77 - home-manager.nixosModules.home-manager { 98 + home-manager.nixosModules.home-manager 99 + { 78 100 home-manager.useGlobalPkgs = true; 79 101 home-manager.useUserPackages = true; 80 102 home-manager.users.${user} = import ./nixos/home-manager.nix; 81 103 } 82 104 ./nixos 83 105 ]; 84 - }); 85 - }; 106 + }); 107 + }; 86 108 }
+4 -2
nixos/default.nix
··· 1 1 { config, inputs, pkgs, ... }: 2 2 3 - let user = "dekker1"; 4 - keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICwXNVel0w1f4nbmu2iJsqCoeiUsENzTLyhCZjSL+jT+" ]; in 3 + let 4 + user = "dekker1"; 5 + keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICwXNVel0w1f4nbmu2iJsqCoeiUsENzTLyhCZjSL+jT+" ]; 6 + in 5 7 { 6 8 imports = [ 7 9 ../shared
+6 -6
nixos/files.nix
··· 1 - { user, ... }: 1 + { user, pkgs, ... }: 2 2 3 3 let 4 - home = builtins.getEnv "HOME"; 4 + home = builtins.getEnv "HOME"; 5 5 xdg_configHome = "${home}/.config"; 6 - xdg_dataHome = "${home}/.local/share"; 7 - xdg_stateHome = "${home}/.local/state"; in 8 - { 9 - } 6 + xdg_dataHome = "${home}/.local/share"; 7 + xdg_stateHome = "${home}/.local/state"; 8 + in 9 + { }
+3 -3
nixos/home-manager.nix
··· 2 2 3 3 let 4 4 user = "dekker1"; 5 - xdg_configHome = "/home/${user}/.config"; 5 + xdg_configHome = "/home/${user}/.config"; 6 6 shared-programs = import ../shared/home-manager.nix { inherit config pkgs lib; }; 7 7 shared-files = import ../shared/files.nix { inherit config pkgs; }; 8 8 in ··· 11 11 enableNixpkgsReleaseCheck = false; 12 12 username = "${user}"; 13 13 homeDirectory = "/home/${user}"; 14 - packages = pkgs.callPackage ./packages.nix {}; 14 + packages = pkgs.callPackage ./packages.nix { }; 15 15 file = shared-files // import ./files.nix { inherit user; }; 16 16 stateVersion = "21.05"; 17 17 }; 18 18 19 - programs = shared-programs // {}; 19 + programs = shared-programs // { }; 20 20 21 21 }
+4 -3
shared/default.nix
··· 14 14 # Apply each overlay found in the /overlays directory 15 15 let path = ../overlays; in with builtins; 16 16 map (n: import (path + ("/" + n))) 17 - (filter (n: match ".*\\.nix" n != null || 18 - pathExists (path + ("/" + n + "/default.nix"))) 19 - (attrNames (readDir path))); 17 + (filter 18 + (n: match ".*\\.nix" n != null || 19 + pathExists (path + ("/" + n + "/default.nix"))) 20 + (attrNames (readDir path))); 20 21 }; 21 22 }
+1 -2
shared/files.nix
··· 1 1 { pkgs, config, ... }: 2 2 3 - { 4 - } 3 + { }
+75 -4
shared/home-manager.nix
··· 1 1 { config, pkgs, lib, ... }: 2 2 3 - let name = "Jip J. Dekker"; 4 - user = "dekker1"; 5 - email = "jip@dekker.one"; in 3 + let 4 + name = "Jip J. Dekker"; 5 + user = "dekker1"; 6 + email = "jip@dekker.one"; 7 + in 6 8 { 7 9 8 10 git = { ··· 37 39 pull.ff = true; 38 40 push.default = "simple"; 39 41 rebase.autoStash = true; 40 - 42 + 41 43 credential.helper = "osxkeychain"; 42 44 43 45 commit.gpgsign = true; ··· 50 52 # Shared shell configuration 51 53 nushell = { 52 54 enable = true; 55 + shellAliases = { 56 + edit = "^($env.VISUAL)"; 57 + start = "^open"; 58 + less = "bat"; 59 + set-light-theme = "kitty +kitten themes Catppuccin-Latte"; 60 + set-dark-theme = "kitty +kitten themes Night Owl"; 61 + brew-backup = "brew bundle dump --global --no-lock --formula --cask --mas --tap --force"; 62 + brew-cleanup = "brew bundle cleanup --global --no-lock --force --zap"; 63 + brew-restore = "brew bundle install --global --no-lock"; 64 + }; 65 + environmentVariables = { 66 + # Set default editor 67 + EDITOR = ''"nvim"''; 68 + VISUAL = ''"codium"''; 69 + # DISABLE VI INDICATORS 70 + PROMPT_INDICATOR_VI_INSERT = ''""''; 71 + PROMPT_INDICATOR_VI_NORMAL = ''""''; 72 + # Alias for Monash compute cluster 73 + OPTCLUSTER = ''"compute.optimisation-2020.cloud.edu.au"''; 74 + # CMake settings 75 + CMAKE_EXPORT_COMPILE_COMMANDS = ''"1"''; # output compile-commands.json for clangd 76 + CMAKE_GENERATOR = ''"Ninja Multi-Config"''; # use Ninja generator by default 77 + CMAKE_C_COMPILER_LAUNCHER = ''"ccache"''; 78 + CMAKE_CXX_COMPILER_LAUNCHER = ''"ccache"''; 79 + # Homebrew shell setup (brew shellenv) 80 + HOMEBREW_PREFIX = ''"/opt/homebrew"''; 81 + HOMEBREW_CELLAR = ''"/opt/homebrew/Cellar"''; 82 + HOMEBREW_REPOSITORY = ''"/opt/homebrew"''; 83 + INFOPATH = ''"/opt/homebrew/share/info"''; 84 + # Set MANPATH 85 + MANPATH = ''"/usr/share/man:/usr/local/share/man:/Library/TeX/Distributions/.DefaultTeX/Contents/Man:/opt/homebrew/share/man"''; 86 + NIX_PROFILES = ''$"/nix/var/nix/profiles/default:($env.HOME)/.nix-profile"''; 87 + }; 88 + envFile.text = '' 89 + if not 'config' in $env { 90 + $env.config = ([] | into record) 91 + } 92 + $env.config = ($env.config | upsert show_banner false) 93 + $env.config = ($env.config | upsert rm.always_trash true) 94 + $env.config = ($env.config | upsert edit_mode vi) 95 + $env.config = ($env.config | upsert history.max_size 100000) 96 + $env.config = ($env.config | upsert footer_mode auto) 97 + $env.config = ($env.config | upsert history.file_format "sqlite") 98 + ''; 99 + configFile.text = '' 100 + # Specifies how environment variables are: 101 + # - converted from a string to a value on Nushell startup (from_string) 102 + # - converted from a value back to a string when running external commands (to_string) 103 + # Note: The conversions happen *after* config.nu is loaded 104 + $env.ENV_CONVERSIONS = { 105 + "PATH": { 106 + from_string: { |s| $s | split row (char esep) | path expand --no-symlink } 107 + to_string: { |v| $v | path expand --no-symlink | str join (char esep) } 108 + } 109 + } 110 + 111 + # Add entries to PATH: 112 + # From MacOS helper (/usr/libexec/path_helper) 113 + $env.PATH = ($env.PATH | split row (char esep) | append $"($env.HOME)/.nix-profile/bin") 114 + $env.PATH = ($env.PATH | split row (char esep) | append "/nix/var/nix/profiles/default/bin") 115 + $env.PATH = ($env.PATH | split row (char esep) | append "/Library/TeX/texbin") 116 + $env.PATH = ($env.PATH | split row (char esep) | append "/Library/Apple/usr/bin") 117 + $env.PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/bin") 118 + $env.PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/sbin") 119 + $env.PATH = ($env.PATH | split row (char esep) | append "/usr/local/bin") 120 + # Other package managers 121 + $env.PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.local/bin") 122 + $env.PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.cargo/bin") 123 + ''; 53 124 }; 54 125 55 126 starship = {
+4 -3
shared/packages.nix
··· 17 17 18 18 # Text and terminal utilities 19 19 bat 20 - eza 21 20 neovim 22 21 zoxide 23 22 24 23 # C(++) development tools 25 - bison 26 24 ccache 27 25 cmake 28 - flex 29 26 llvm 30 27 ninja 31 28 ··· 37 34 # MiniZinc solvers 38 35 gecode 39 36 # or-tools 37 + 38 + # Nix development tools 39 + nixpkgs-fmt 40 + nixd 40 41 41 42 # Node.js development tools 42 43 nodePackages.prettier