···11# The current version of the config schema
22-version: 1
22+version: "1"
33# What protocol to use when performing git operations. Supported values: ssh, https
44git_protocol: https
55# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
···22, config
33, lib
44, pkgs
55-, unstable ? import <nixos-unstable> { }
66-, # backwards compat for non-flake
77- homeDirectory ? "/home/${config.home.user}"
55+, homeDirectory ? "/home/${config.home.user}"
86, host
97, ...
108}:
···1816 # ugh this will be different between nixos and others won't it
19172018 packpathDirs = config.programs.neovim.finalPackage.packpathDirs;
2121- finalPackdir = (unstable.neovimUtils.packDir packpathDirs);
1919+ finalPackdir = (pkgs.neovimUtils.packDir packpathDirs);
2220 packdirPackage =
2321 pkgs.runCommand "pack" { } # bash
2422 ''
···7876 bat = {
7977 enable = true;
8078 # Not working for whatever reason:
8181- extraPackages = with unstable.bat-extras; [
7979+ extraPackages = with pkgs.bat-extras; [
8280 batdiff
8381 batman
8482 batgrep
···9189 gpg.enable = true;
9290 helix = {
9391 enable = true;
9494- package = unstable.helix;
9292+ package = pkgs.helix;
9593 settings = {
9694 theme = "monokai";
9795 };
···10098 neovim = {
10199 enable = true;
102100 # https://github.com/NixOS/nixpkgs/issues/137829
103103- package = unstable.neovim-unwrapped;
101101+ package = pkgs.neovim-unwrapped;
104102105103 plugins = [
106106- (unstable.vimPlugins.nvim-treesitter.withPlugins (
104104+ (pkgs.vimPlugins.nvim-treesitter.withPlugins (
107105 # Include default bundled languages as well here:
108106 # https://github.com/nvim-treesitter/nvim-treesitter/issues/3092
109107 plugins: with plugins; [
···220218 with pkgs;
221219 [
222220 buildifier
223223- # unstable.bacon # also available as a flake if I need bleeding-edge
221221+ # bacon # also available as a flake if I need bleeding-edge
224222 clang-tools
225225- comby
226223 difftastic
227224 docker
228225 docker-compose
···238235 ncurses # Newer version including tset/reset, can understand tmux terminfo etc.
239236 nil
240237 nixpkgs-fmt
241241- unstable.nixfmt-rfc-style
238238+ nixfmt-rfc-style
242239 openssh
243240 python3
244241 rustup
245242 shellcheck
246246- thefuck
247243 tmux
248244 tree
249249- unstable.lnav
250250- unstable.nixd
245245+ lnav
246246+ nixd
251247 unzip
252248 watch
253249 yadm
···267263 ]
268264 ++ lib.optionals stdenv.isLinux [
269265 pinentry-curses
266266+ comby # failing to build on macOS: https://github.com/NixOS/nixpkgs/issues/359193
267267+ thefuck # also failing on macOS can't quite figure why
270268 ]
271269 ++ lib.optionals host.wsl [
272270 podman # use podman --remote to access host WSL podman instance
+14-18
.config/nix-darwin/configuration.nix
···11-{
22- self,
33- lib,
44- config,
55- pkgs,
66- unstable,
77- host,
88- ...
11+{ self
22+, lib
33+, config
44+, pkgs
55+, host
66+, ...
97}:
108let
119 # https://discourse.nixos.org/t/ssl-ca-cert-error-on-macos/31171/6
···4038 ];
41394240 shells = [ pkgs.fish ];
4343- loginShell = "${lib.getExe pkgs.fish}";
44414542 etc =
4643 let
···5451 variables = mkIfWork systemCABundleEnv;
5552 };
56535757- # Auto upgrade nix package and the daemon service.
5858- services.nix-daemon.enable = true;
5959-6060- nix.package = unstable.lix;
5454+ nix.package = pkgs.lix;
6155 # Necessary for using flakes on this system.
6256 nix.settings.experimental-features = [
6357 "nix-command"
···71657266 #region macOS settings
73677474- security.pam.enableSudoTouchIdAuth = true;
6868+ security.pam.services.sudo_local.touchIdAuth = true;
7569 security.sudo.extraConfig = lib.mkIf (host.class == "work") ''
7670 # workaround for sudo awkwardness caused by BeyondTrust.
7771 # It doesn't make sudo touchID work, but at least `darwin-rebuild switch` works
···121115 "${appdir}/Stretchly.app"
122116 "${appdir}/Syncthing.app"
123117 ];
124124- appEntries = map (app: {
125125- path = app;
126126- hidden = true;
127127- }) apps;
118118+ appEntries = map
119119+ (app: {
120120+ path = app;
121121+ hidden = true;
122122+ })
123123+ apps;
128124129125 # This somehow seems to be the only way to add apps to "Open at Login" that doesn't
130126 # involve launchd, and there doesn't seem to be any `defaults` for it anymore
+3-2
.config/nix-darwin/homebrew.nix
···1010 cleanupCmd = builtins.concatStringsSep " " (
1111 # Basically copied from ${nix-darwin}/modules/homebrew.nix:
1212 lib.optional (!config.homebrew.onActivation.autoUpdate) "HOMEBREW_NO_AUTO_UPDATE=1"
1313- ++ [ "brew bundle cleanup --file='${brewfileFile}' --no-lock" ]
1313+ ++ [ "brew bundle cleanup --file='${brewfileFile}'" ]
1414 );
1515in
1616{
···2828 # sense to define this as an alternative to `cleanup = "uninstall" instead of
2929 # a complement to it?
3030 system.checks.text = ''
3131- if test ''${checkActivation:-0} -eq 1; then
3131+ if test "''${checkActivation:-0}" -eq 1; then
3232 if ! PATH="${config.homebrew.brewPrefix}":$PATH ${cleanupCmd}; then
3333 # Make it easy to run the cleanup command with --force to apply changes
3434 echo '${cleanupCmd} --force'
···6363 brews = [
6464 "curl"
6565 "ian-h-chamberlain/dotfiles/neovim@0.9.5"
6666+ "mas"
6667 "pre-commit"
6768 "pyenv-virtualenv" # doesn't seem to be in nixpkgs
6869 "pyenv" # use same installation method as pyenv-virtualenv
···11-{
22- config,
33- lib,
44- pkgs,
55- unstable,
66- host,
77- lix-module,
88- ...
11+{ config
22+, lib
33+, pkgs
44+, host
55+, lix-module
66+, ...
97}:
108{
119 # TODO: when converting prismo, will probably import ./prismo.nix or something
···2321 # This might make more sense in home.nix to work on darwin etc too
2422 flake-registry = null;
2523 };
2626- package = unstable.lix;
2727-2828- # TODO: figure out a way to add registry entries so I can do e.g.
2929- # `nix run pkgs#htop` and get my custom htop instead of upstream
3030- registry.unstable.to = {
3131- type = "github";
3232- owner = "NixOS";
3333- repo = "nixpkgs";
3434- ref = "nixos-unstable";
3535- };
2424+ package = pkgs.lix;
3625 };
37263827 time.timeZone = "America/New_York";
+1-1
.config/nixos/prismo/configuration.nix
···188188 wget
189189 ];
190190191191- # TODO: use podman from unstable instead of docker?
191191+ # TODO: use podman instead of docker?
192192 virtualisation.docker = {
193193 enable = true;
194194 };
+58-39
.config/nixpkgs/flake-overlays.nix
···88 It's *not* named overlays.nix so that it isn't picked up automatically by nix
99 commands.
1010*/
1111-{
1212- lib,
1313- unstable,
1414- pkgs,
1515- ...
1616-}:
1111+{ host, lib, ... }:
1712let
1813 appendPatches =
1914 pkg: patches:
2015 pkg.overrideAttrs (old: {
2116 patches = (old.patches or [ ]) ++ patches;
2217 });
1818+2319in
2420{
2521 nixpkgs.overlays = [
···2824 ./patches/htop/0001-Re-title-the-main-menu-bar-for-its-shortcuts.patch
2925 ];
30263131- # Pulling from unsable is probably not _really_ how overlays are meant to be used
3232- # and I should be calling unstable.extend or something, but meh it's fine for now
3333- nil = unstable.nil.overrideAttrs (
3434- prev:
3535- let
3636- src = pkgs.fetchFromGitHub {
2727+ nil = prev.nil.overrideAttrs
2828+ (old: {
2929+ version = "2024-11-19";
3030+ src = prev.fetchFromGitHub {
3731 owner = "oxalica";
3832 repo = "nil";
3933 rev = "2e24c9834e3bb5aa2a3701d3713b43a6fb106362";
4034 hash = "sha256-DCIVdlb81Fct2uwzbtnawLBC/U03U2hqx8trqTJB7WA=";
4135 };
4242- in
4343- {
4444- version = "2024-11-19";
4545- inherit src;
4646-4736 # https://wiki.nixos.org/wiki/Overlays#Rust_packages
4848- cargoDeps = prev.cargoDeps.overrideAttrs (_: {
4949- name = "oxalica-nil-vendor.tar.gz";
5050- inherit src;
5151- outputHash = "sha256-qW6xqYVQbvZUL5mJAzh8T6udUYIpk8nKoOihoD1UmXA=";
5252- });
5353- }
5454- );
3737+ cargoDeps = prev.rustPlatform.fetchCargoVendor {
3838+ inherit (final.nil) src;
3939+ name = "nil-cargo-vendor-deps";
4040+ hash = "sha256-Q4wBZtX77v8CjivCtyw4PdRe4OZbW00iLgExusbHbqc=";
4141+ };
4242+ });
55435644 # Some packages (mainly bash-based) get built as a wrapped "resholve" script, so we
5745 # actually want to patch the source of the unwrapped pre-resholve derivation (i.e.
5858- # the src attribute on the final derivation).
4646+ # the unresholved package's src attribute).
4747+ nix-direnv = prev.nix-direnv.overrideAttrs
4848+ (unresholved: {
4949+ src = appendPatches unresholved.src [
5050+ ./patches/nix-direnv/0001-Supress-stderr-for-nix-flake-archive.patch
5151+ ];
5252+ });
5353+5454+ yadm =
5555+ let
5656+ # Sheesh, patching this is kinda messy; upstream nixpkgs is only on 3.3.0
5757+ version = "3.5.0";
5858+ src = prev.fetchFromGitHub {
5959+ owner = "yadm-dev";
6060+ repo = "yadm";
6161+ rev = "366c3ec418547af2837e5f486669a838cc99563c";
6262+ hash = "sha256-5TUL4aQ/i+RNp5PtcoTSWJa8RSiB042zc8xoJSpWVMQ=";
6363+ };
6464+ # TODO: upstream this patch in a PR for 3.5.1 or 3.6.0
6565+ patches = [
6666+ (prev.fetchpatch {
6767+ url = "https://github.com/yadm-dev/yadm/commit/3fa4b3cf60cc9befb2b3a5b740aca2674bc6ac35.patch";
6868+ hash = "sha256-87XqVBu9OB6RsQaWfJJ2MCaEAGnxLtvslQ8NNt+J2N4=";
6969+ })
7070+ ];
7171+ patchedYadm = prev.yadm.overrideAttrs (unresholved: {
7272+ src = appendPatches
7373+ (unresholved.src.overrideAttrs { inherit src version; })
7474+ patches;
7575+ });
7676+ # 3.5.0 had some refactors which requires more resholve directives:
7777+ mkResholve = args @ { solutions, ... }:
7878+ prev.resholve.mkDerivation (args // {
7979+ # Helpful post: https://t-ravis.com/post/nix/advanced_shell_packaging_resholve_yadm/
8080+ solutions = lib.recursiveUpdate solutions {
8181+ yadm.keep = {
8282+ "$processor" = true;
8383+ "$log" = true;
8484+ };
8585+ };
8686+ });
8787+ in
8888+ patchedYadm.override {
8989+ inherit (prev.python311Packages) j2cli;
9090+ resholve = prev.resholve // { mkDerivation = mkResholve; };
9191+ };
59926060- yadm = prev.yadm.overrideAttrs (unresholved: {
6161- src = appendPatches unresholved.src [
6262- (prev.fetchpatch {
6363- url = "https://github.com/TheLocehiliosan/yadm/pull/495.patch";
6464- hash = "sha256-xIXqXo8pQywufvcfY+j3jne5WdYnS9/t5DQdpXAkZbo=";
6565- excludes = [ "test/*" ];
6666- })
6767- ];
6868- });
69937070- nix-direnv = unstable.nix-direnv.overrideAttrs (unresholved: {
7171- src = appendPatches unresholved.src [
7272- ./patches/nix-direnv/0001-Supress-stderr-for-nix-flake-archive.patch
7373- ];
7474- });
7594 })
7695 ];
7796}