this repo has no description
0
fork

Configure Feed

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

Miscelleneous cleanups + fish setups for nix

+138 -325
+31 -3
.config/Code/User/settings.json
··· 86 86 "editor.tabSize": 2, 87 87 "editor.defaultFormatter": "DavidAnson.vscode-markdownlint", 88 88 }, 89 + "[nix]": { 90 + "editor.formatOnSave": true 91 + }, 89 92 "[org]": { 90 93 "editor.autoIndent": "advanced", 91 94 "editor.tabSize": 1, ··· 408 411 "editor.minimap.enabled": true, 409 412 "editor.minimap.sectionHeaderFontSize": 12, 410 413 "editor.minimap.sectionHeaderLetterSpacing": 0, 414 + "editor.minimap.maxColumn": 60, 415 + "editor.minimap.scale": 2, 411 416 "editor.minimap.showSlider": "always", 412 417 "editor.multiCursorModifier": "alt", 413 418 "editor.lineNumbers": "on", ··· 520 525 "fontStyle": "" 521 526 }, 522 527 "tomlTableKey:toml": "#F92672", 528 + 529 + "boolean:nix": "#AE81FF", 530 + "struct.builtin:nix": { 531 + "foreground": "#66D9EF", 532 + "fontStyle": "italic", 533 + } 523 534 }, 524 535 } 525 536 }, ··· 1054 1065 1055 1066 "nginx-conf-hint.syntax": "sublime", 1056 1067 1057 - "nix.enableLanguageServer": false, 1068 + "nix.enableLanguageServer": true, 1069 + // nixd seems nicer, but keeps crashing :/ 1070 + "nix.serverPath": "nil", 1071 + "nix.serverSettings": { 1072 + // https://github.com/oxalica/nil/blob/main/docs/configuration.md 1073 + "nil": { 1074 + "formatting": { 1075 + "command": [ "nixpkgs-fmt" ], 1076 + }, 1077 + "nix": { 1078 + "maxMemoryMB": 3072, 1079 + "flake": { 1080 + "autoEvalInputs": true, 1081 + } 1082 + } 1083 + }, 1084 + // https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md 1085 + "nixd": {}, 1086 + }, 1058 1087 1059 1088 "notebook.output.textLineLimit": 500, 1060 1089 "notebook.cellToolbarVisibility": "hover", ··· 1278 1307 }, 1279 1308 "terminal.integrated.rightClickBehavior": "default", 1280 1309 "terminal.integrated.scrollback": 10000, 1281 - "terminal.integrated.stickyScroll.enabled": true, 1282 1310 "terminal.integrated.stickyScroll.maxLineCount": 3, 1283 1311 "terminal.integrated.shellIntegration.enabled": true, 1284 1312 "terminal.integrated.tabStopWidth": 4, ··· 1366 1394 1367 1395 "typescript.check.npmIsInstalled": false, 1368 1396 1369 - "vscode-neovim.logOutputToConsole": true, 1397 + "vscode-neovim.logOutputToConsole": false, 1370 1398 "vscode-neovim.neovimClean": false, 1371 1399 "vscode-neovim.afterInitConfig": [], 1372 1400 "vscode-neovim.neovimExecutablePaths.darwin": "nvim",
+21
.config/fish/completions/darwin-rebuild.fish
··· 1 + set command_names edit switch activate build check changelog 2 + 3 + complete -c darwin-rebuild -n "not __fish_seen_subcommand_from $command_names" -fa "$command_names" 4 + complete -c darwin-rebuild -n "__fish_seen_subcommand_from $command_names" \ 5 + -l flake -x \ 6 + -s I -r \ 7 + -l substituters -x 8 + 9 + complete -c darwin-rebuild -n "__fish_seen_subcommand_from $command_names" \ 10 + -l no-flake \ 11 + -s v -l verbose \ 12 + -l dry-run \ 13 + -l keep-going -s k \ 14 + -l keep-failed -s k \ 15 + -l fallback \ 16 + -l show-trace \ 17 + -l impure \ 18 + -l recreate-lock-file \ 19 + -l no-update-lock-file \ 20 + -l refresh \ 21 + -l offline
+8 -4
.config/fish/conf.d/50-config.fish
··· 78 78 ]' 79 79 80 80 # Set fish_user_paths here instead of fish_variables to expand $HOME per-machine 81 - set -Ux fish_user_paths \ 81 + set -gx fish_user_paths \ 82 82 $DEVKITARM/bin \ 83 83 $DEVKITPRO/tools/bin \ 84 84 ~/.cargo/bin \ 85 85 ~/.local/share/rbenv/shims \ 86 86 ~/.local/bin \ 87 + /run/current-system/sw/bin \ 87 88 $GOPATH/bin \ 88 89 node_modules/.bin \ 89 90 /usr/local/sbin \ 90 91 /opt/homebrew/bin 91 92 92 - # Set up miscellaneous nix paths, session vars, completions etc. 93 - test -f ~/.nix-profile/etc/profile.d/nix.fish 94 - and source ~/.nix-profile/etc/profile.d/nix.fish 93 + # Manually active nix-managed fish profile. 94 + # Sets up miscellaneous nix paths, session vars, completions etc. 95 + if not set -q NIX_PROFILES 96 + set -l nix_fish_profile ~/.nix-profile/etc/profile.d/nix.fish 97 + test -f $nix_fish_profile; and source $nix_fish_profile 98 + end 95 99 96 100 test -d ~/.nix-profile/share/terminfo 97 101 and set -gx TERMINFO_DIRS ":$HOME/.nix-profile/share/terminfo"
+3
.config/fish/functions/futi.fish
··· 1 + function futi 2 + mdls -name kMDItemContentType -name kMDItemContentTypeTree -name kMDItemKind $argv 3 + end
+2 -2
.config/fish/functions/upfind.fish
··· 4 4 set dir $argv[2] 5 5 end 6 6 7 - test (realpath $dir) != / 7 + test (builtin realpath --no-symlinks $dir) != / 8 8 or return 1 9 9 10 10 if test -e $dir/$argv[1] 11 - realpath $dir/$argv[1] 11 + builtin realpath --no-symlinks $dir/$argv[1] 12 12 else 13 13 upfind $argv[1] $dir/.. 14 14 end
+46 -45
.config/flake.nix
··· 30 30 }; 31 31 }; 32 32 33 - outputs = inputs @ {self, nixpkgs, nix-darwin, home-manager, ... }: 33 + outputs = inputs @ { self, nixpkgs, nix-darwin, home-manager, ... }: 34 34 let 35 35 inherit (builtins) mapAttrs; 36 36 inherit (nixpkgs) lib; ··· 60 60 (_: { system, ... }: lib.hasSuffix "darwin" system) 61 61 systems; 62 62 63 - # TODO: actually use this 63 + # TODO: actually use this and switch prismo over to flakes 64 64 nixosSystems = { inherit (systems) prismo; }; 65 - in { 66 - darwinConfigurations = mapAttrs 67 - (hostname: { system, user }: nix-darwin.lib.darwinSystem { 68 - inherit system; 65 + in 66 + { 67 + darwinConfigurations = mapAttrs 68 + (hostname: { system, user }: nix-darwin.lib.darwinSystem { 69 + inherit system; 69 70 70 - modules = [ 71 - ./nix-darwin/configuration.nix 72 - { 73 - # home-manager module expects this to be set: 74 - users.users.${user}.home = "/Users/${user}"; 75 - } 76 - home-manager.darwinModules.home-manager 77 - { 78 - home-manager = { 79 - useGlobalPkgs = true; 80 - users.${user} = import ./home-manager/home.nix; 81 - extraSpecialArgs = { 82 - unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 71 + modules = [ 72 + ./nix-darwin/configuration.nix 73 + { 74 + # home-manager module expects this to be set: 75 + users.users.${user}.home = "/Users/${user}"; 76 + } 77 + home-manager.darwinModules.home-manager 78 + { 79 + home-manager = { 80 + useGlobalPkgs = true; 81 + users.${user} = import ./home-manager/home.nix; 82 + extraSpecialArgs = { 83 + unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 84 + }; 85 + verbose = true; 83 86 }; 84 - verbose = true; 85 - }; 86 - } 87 - ]; 87 + } 88 + ]; 88 89 89 - specialArgs = { inherit self ; }; 90 - }) 91 - darwinSystems; 90 + specialArgs = { inherit self user; }; 91 + }) 92 + darwinSystems; 92 93 93 - darwinPackages = mapAttrs (host: _: self.darwinConfigurations.${host}.pkgs) darwinSystems; 94 + darwinPackages = mapAttrs (host: _: self.darwinConfigurations.${host}.pkgs) darwinSystems; 94 95 95 - homeConfigurations = mapAttrs 96 - (host: { system, user }: home-manager.lib.homeManagerConfiguration { 97 - modules = [ 98 - ./home-manager/home.nix 99 - { 100 - home.username = "${user}"; 101 - # TODO This is different on most Linuxes: 102 - home.homeDirectory = "/Users/${user}"; 103 - } 104 - ]; 96 + homeConfigurations = mapAttrs 97 + (host: { system, user }: home-manager.lib.homeManagerConfiguration { 98 + modules = [ 99 + ./home-manager/home.nix 100 + { 101 + home.username = "${user}"; 102 + # TODO This is different on most Linuxes: 103 + home.homeDirectory = "/Users/${user}"; 104 + } 105 + ]; 105 106 106 - extraSpecialArgs = { 107 - username = user; 108 - pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 109 - }; 110 - }) 111 - systems; 107 + extraSpecialArgs = { 108 + username = user; 109 + pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 110 + }; 111 + }) 112 + systems; 112 113 113 - homePackages = mapAttrs (host: { user, ... }: self.homeConfigurations."${user}".pkgs) systems; 114 - }; 114 + homePackages = mapAttrs (host: { user, ... }: self.homeConfigurations."${user}".pkgs) systems; 115 + }; 115 116 }
-65
.config/home-manager/flake.lock
··· 1 - { 2 - "nodes": { 3 - "home-manager": { 4 - "inputs": { 5 - "nixpkgs": [ 6 - "nixpkgs" 7 - ] 8 - }, 9 - "locked": { 10 - "lastModified": 1715486357, 11 - "narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=", 12 - "owner": "nix-community", 13 - "repo": "home-manager", 14 - "rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1", 15 - "type": "github" 16 - }, 17 - "original": { 18 - "owner": "nix-community", 19 - "repo": "home-manager", 20 - "type": "github" 21 - } 22 - }, 23 - "nixpkgs": { 24 - "locked": { 25 - "lastModified": 1718208800, 26 - "narHash": "sha256-US1tAChvPxT52RV8GksWZS415tTS7PV42KTc2PNDBmc=", 27 - "owner": "nixos", 28 - "repo": "nixpkgs", 29 - "rev": "cc54fb41d13736e92229c21627ea4f22199fee6b", 30 - "type": "github" 31 - }, 32 - "original": { 33 - "owner": "nixos", 34 - "ref": "nixos-24.05", 35 - "repo": "nixpkgs", 36 - "type": "github" 37 - } 38 - }, 39 - "nixpkgs-unstable": { 40 - "locked": { 41 - "lastModified": 1720418205, 42 - "narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=", 43 - "owner": "nixos", 44 - "repo": "nixpkgs", 45 - "rev": "655a58a72a6601292512670343087c2d75d859c1", 46 - "type": "github" 47 - }, 48 - "original": { 49 - "owner": "nixos", 50 - "ref": "nixos-unstable", 51 - "repo": "nixpkgs", 52 - "type": "github" 53 - } 54 - }, 55 - "root": { 56 - "inputs": { 57 - "home-manager": "home-manager", 58 - "nixpkgs": "nixpkgs", 59 - "nixpkgs-unstable": "nixpkgs-unstable" 60 - } 61 - } 62 - }, 63 - "root": "root", 64 - "version": 7 65 - }
+1 -27
.config/home-manager/flake.nix
··· 1 - { 2 - description = "Home Manager flake configuration"; 3 - 4 - inputs = { 5 - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; 6 - home-manager = { 7 - url = "github:nix-community/home-manager"; 8 - inputs.nixpkgs.follows = "nixpkgs"; 9 - }; 10 - 11 - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 12 - }; 13 - 14 - outputs = { nixpkgs, home-manager, nixpkgs-unstable, ... }: 15 - let 16 - system = "x86_64-linux"; 17 - pkgs = nixpkgs.legacyPackages.${system}; 18 - pkgsUnstable = nixpkgs-unstable.legacyPackages.${system}; 19 - in { 20 - homeConfigurations."ichamberlain" = home-manager.lib.homeManagerConfiguration { 21 - inherit pkgs; 22 - 23 - extraSpecialArgs = { inherit pkgsUnstable; }; 24 - modules = [ ./home.nix ]; 25 - }; 26 - }; 27 - } 1 + ../flake.nix
+7 -2
.config/home-manager/home.nix
··· 1 1 { config, lib, pkgs, unstable, ... }: 2 2 let 3 3 stdenv = pkgs.stdenv; 4 - in { 4 + in 5 + { 5 6 programs = { 6 7 # Let Home Manager install and manage itself. 7 8 home-manager.enable = true; ··· 45 46 }; 46 47 }; 47 48 49 + # TODO: should try to convert these to flake inputs probably 48 50 nixpkgs.overlays = [ 49 51 (final: prev: { 50 52 lnav = prev.lnav.overrideAttrs (_: rec { ··· 68 70 sha256 = ""; 69 71 }; 70 72 }); 71 - }) 73 + }) 72 74 ]; 73 75 74 76 home.packages = with pkgs; [ ··· 81 83 docker-compose 82 84 git-crypt 83 85 unstable.lnav 86 + nil 87 + unstable.nixd 88 + nixpkgs-fmt 84 89 shellcheck 85 90 thefuck 86 91 tree
+19 -5
.config/nix-darwin/configuration.nix
··· 1 - { self, pkgs, ... }: { 1 + { self, config, pkgs, user, ... }: { 2 2 # List packages installed in system profile. To search by name, run: 3 3 # $ nix-env -qaP | grep wget 4 - environment.systemPackages = []; 4 + environment.systemPackages = [ ]; 5 + 6 + # https://github.com/LnL7/nix-darwin/issues/239#issuecomment-719873331 7 + programs.fish.enable = true; 8 + 9 + # Symlink to dotfiles flake for easier activation 10 + # See https://github.com/LnL7/nix-darwin/pull/741 11 + environment.etc."nix-darwin/flake.nix".source = 12 + "${config.users.users.${user}.home}/.config/flake.nix"; 5 13 6 14 # Auto upgrade nix package and the daemon service. 7 15 services.nix-daemon.enable = true; 8 16 nix.package = pkgs.lix; 9 - 10 17 # Necessary for using flakes on this system. 11 18 nix.settings.experimental-features = "nix-command flakes"; 19 + 20 + #region macOS settings 12 21 13 22 security.pam.enableSudoTouchIdAuth = true; 14 23 ··· 17 26 remapCapsLockToEscape = true; 18 27 }; 19 28 29 + #endregion 30 + 20 31 # TODO idea: a module that installs 21 32 # https://github.com/Lord-Kamina/SwiftDefaultApps (possible via homebrew) 22 33 # and allows for declaration of default app handlers 23 34 24 - # Set Git commit hash for darwin-version. 25 - system.configurationRevision = self.rev or self.dirtyRev or null; 35 + #region nix-darwin 26 36 27 37 # Used for backwards compatibility, please read the changelog before changing. 28 38 # $ darwin-rebuild changelog 29 39 system.stateVersion = 4; 40 + # Set Git commit hash for darwin-version. 41 + system.configurationRevision = self.rev or self.dirtyRev or null; 42 + 43 + #endregion 30 44 }
-113
.config/nix-darwin/flake.lock
··· 1 - { 2 - "nodes": { 3 - "home-manager": { 4 - "inputs": { 5 - "nixpkgs": [ 6 - "home-manager-config", 7 - "nixpkgs" 8 - ] 9 - }, 10 - "locked": { 11 - "lastModified": 1715486357, 12 - "narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=", 13 - "owner": "nix-community", 14 - "repo": "home-manager", 15 - "rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1", 16 - "type": "github" 17 - }, 18 - "original": { 19 - "owner": "nix-community", 20 - "repo": "home-manager", 21 - "type": "github" 22 - } 23 - }, 24 - "home-manager-config": { 25 - "inputs": { 26 - "home-manager": "home-manager", 27 - "nixpkgs": [ 28 - "nixpkgs" 29 - ], 30 - "unstable": [ 31 - "unstable" 32 - ] 33 - }, 34 - "locked": { 35 - "dir": ".config/home-manager", 36 - "lastModified": 1720706550, 37 - "narHash": "sha256-veZwGvG2tqKsAXxxr2nn2K+Vg+s7pFNUig8UU0p4bnk=", 38 - "ref": "refs/heads/main", 39 - "rev": "51848d027e1a066f8d724df0688ac52884402563", 40 - "revCount": 634, 41 - "type": "git", 42 - "url": "file:///Users/ichamberlain/.local/share/yadm/repo.git?dir=.config/home-manager" 43 - }, 44 - "original": { 45 - "id": "home-manager-configuration", 46 - "type": "indirect" 47 - } 48 - }, 49 - "nix-darwin": { 50 - "inputs": { 51 - "nixpkgs": [ 52 - "nixpkgs" 53 - ] 54 - }, 55 - "locked": { 56 - "lastModified": 1720515095, 57 - "narHash": "sha256-MvRtrTwdWfs5P1Ggpkxzrhoh6IbQn+g9SwxJOHvDhQ0=", 58 - "owner": "Enzime", 59 - "repo": "nix-darwin", 60 - "rev": "da0b8b10b0587806c15653325491760d4d2668df", 61 - "type": "github" 62 - }, 63 - "original": { 64 - "owner": "Enzime", 65 - "ref": "default-flake-location", 66 - "repo": "nix-darwin", 67 - "type": "github" 68 - } 69 - }, 70 - "nixpkgs": { 71 - "locked": { 72 - "lastModified": 1720691131, 73 - "narHash": "sha256-CWT+KN8aTPyMIx8P303gsVxUnkinIz0a/Cmasz1jyIM=", 74 - "owner": "nixos", 75 - "repo": "nixpkgs", 76 - "rev": "a046c1202e11b62cbede5385ba64908feb7bfac4", 77 - "type": "github" 78 - }, 79 - "original": { 80 - "owner": "nixos", 81 - "ref": "nixos-24.05", 82 - "repo": "nixpkgs", 83 - "type": "github" 84 - } 85 - }, 86 - "root": { 87 - "inputs": { 88 - "home-manager-config": "home-manager-config", 89 - "nix-darwin": "nix-darwin", 90 - "nixpkgs": "nixpkgs", 91 - "unstable": "unstable" 92 - } 93 - }, 94 - "unstable": { 95 - "locked": { 96 - "lastModified": 1720687749, 97 - "narHash": "sha256-nqJ+iK/zyqCJ/YShqCpZ2cJKE1UtjZIEUWLUFZqvxcA=", 98 - "owner": "NixOS", 99 - "repo": "nixpkgs", 100 - "rev": "6af55cb91ca2005516b9562f707bb99c8f79bf77", 101 - "type": "github" 102 - }, 103 - "original": { 104 - "owner": "NixOS", 105 - "ref": "nixpkgs-unstable", 106 - "repo": "nixpkgs", 107 - "type": "github" 108 - } 109 - } 110 - }, 111 - "root": "root", 112 - "version": 7 113 - }
-59
.config/nix-darwin/flake.nix
··· 1 - { 2 - description = "Darwin flake configuration"; 3 - 4 - inputs = { 5 - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; 6 - unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 7 - 8 - nix-darwin = { 9 - # https://github.com/LnL7/nix-darwin/pull/741 10 - url = "github:Enzime/nix-darwin/default-flake-location"; 11 - inputs.nixpkgs.follows = "nixpkgs"; 12 - }; 13 - 14 - home-manager-config = { 15 - # This seems to be the only way to properly deal with the dotfiles 16 - # checkout being in a different place for different usernames: 17 - # https://discourse.nixos.org/t/flake-input-from-local-git-repo/27609/3 18 - # In theory I could probably even add the registry as part of nix-darwin activation, 19 - # although it's kinda chicken + egg. Maybe just part of yadm bootstrap? 20 - # 21 - # Also TBD: does it require things to be checked in? At least it's still local, 22 - # so I guess it would just require committing home-manager config before evaluation, 23 - # which is a pain but better than having to push to github first. 24 - url = "flake:home-manager-configuration"; 25 - inputs.nixpkgs.follows = "nixpkgs"; 26 - inputs.unstable.follows = "unstable"; 27 - }; 28 - }; 29 - 30 - outputs = { self, nix-darwin, nixpkgs, home-manager-config, ... } @ inputs: 31 - let 32 - hosts = { 33 - MacBook-Pro = { 34 - system = "aarch64-darwin"; 35 - user = "ianchamberlain"; 36 - }; 37 - ichamberlain-mbp-2 = { 38 - system = "x86_64-darwin"; 39 - user = "ichamberlain"; 40 - }; 41 - }; 42 - inherit (nixpkgs) lib; 43 - inherit (nix-darwin.lib) darwinSystem; 44 - in { 45 - darwinConfigurations = lib.mapAttrs (hostname: host: darwinSystem { 46 - inherit (host) system; 47 - 48 - modules = [ 49 - ./configuration.nix 50 - home-manager-config.inputs.home-manager.darwinModules.home-manager 51 - home-manager-config.homeConfigurations.${host.user} 52 - ]; 53 - specialArgs = { inherit self host; }; 54 - }) hosts; 55 - 56 - # Expose the package set, including overlays, for convenience. 57 - darwinPackages = lib.mapAttrs (hostname: _: self.darwinConfigurations.${hostname}.pkgs) hosts; 58 - }; 59 - }