From 4ae2e7e93611673356c3ae4159eb452e2d19e570 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Tue, 20 Dec 2022 19:35:36 -0700 Subject: [PATCH] configs/git: update config to use list of attrs to preserve order --- configs/git.nix | 108 +++++++++++++++++++++++++----------------------- flake.lock | 8 ++-- flake.nix | 9 ++-- 3 files changed, 66 insertions(+), 59 deletions(-) diff --git a/configs/git.nix b/configs/git.nix index 577bb2d..4c2d542 100644 --- a/configs/git.nix +++ b/configs/git.nix @@ -4,66 +4,72 @@ programs.git = { enable = true; lfs.enable = true; - config = { - init = { defaultBranch = "main"; }; + config = [ + { init = { defaultBranch = "main"; }; } - user = { - name = "Aaron Bieber"; - email = "aaron@bolddaemon.com"; - signingKey = if isUnstable then - "key::sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHrYWbbgBkGcOntDqdMaWVZ9xn+dHM+Ap6s1HSAalL28AAAACHNzaDptYWlu" - else - "35863350BFEAC101DB1A4AF01F81112D62A9ADCE"; - }; + { + user = { + name = "Aaron Bieber"; + email = "aaron@bolddaemon.com"; + signingKey = if isUnstable then + "key::sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHrYWbbgBkGcOntDqdMaWVZ9xn+dHM+Ap6s1HSAalL28AAAACHNzaDptYWlu" + else + "35863350BFEAC101DB1A4AF01F81112D62A9ADCE"; + }; + } - branch = { sort = "-committerdate"; }; - alias = { - log = "log --color=never"; - diff = "diff --color=always"; - pr = ''"!f() { git fetch-pr upstream $1; git checkout pr/$1; }; f"''; - fetch-pr = - ''"!f() { git fetch $1 refs/pull/$2/head:refs/remotes/pr/$2; }; f"''; - }; - push = { default = "current"; }; + { branch = { sort = "-committerdate"; }; } + { + alias = { + log = "log --color=never"; + diff = "diff --color=always"; + pr = ''"!f() { git fetch-pr upstream $1; git checkout pr/$1; }; f"''; + fetch-pr = '' + "!f() { git fetch $1 refs/pull/$2/head:refs/remotes/pr/$2; }; f"''; + }; + } + { push = { default = "current"; }; } - gpg = if isUnstable then { format = "ssh"; } else { }; - commit = if isUnstable then { gpgsign = true; } else { }; + { gpg = if isUnstable then { format = "ssh"; } else { }; } + { commit = if isUnstable then { gpgsign = true; } else { }; } - color = { - branch = false; - interactive = false; - log = false; - status = false; - ui = false; - }; + { + color = { + branch = false; + interactive = false; + log = false; + status = false; + ui = false; + }; + } - safe = { directory = "/home/qbit/src/nix-conf"; }; + { safe = { directory = "/home/qbit/src/nix-conf"; }; } - transfer = { fsckobjects = true; }; - fetch = { fsckobjects = true; }; - github = { user = "qbit"; }; + { transfer = { fsckobjects = true; }; } + { fetch = { fsckobjects = true; }; } + { github = { user = "qbit"; }; } - url = { - "ssh://git@github.com/" = { insteadOf = "https://github.com/"; }; - }; + { + url = { + "ssh://git@github.com/" = { insteadOf = "https://github.com/"; }; + }; + } - sendmail = { - smtpserver = "mail.messagingengine.com"; - smtpuser = "qbit@fastmail.com"; - smtpauth = "PLAIN"; - smtpencryption = "tls"; - smtpserverport = 587; - cc = "aaron@bolddaemon.com"; - confirm = "auto"; - }; + { + sendmail = { + smtpserver = "mail.messagingengine.com"; + smtpuser = "qbit@fastmail.com"; + smtpauth = "PLAIN"; + smtpencryption = "tls"; + smtpserverport = 587; + cc = "aaron@bolddaemon.com"; + confirm = "auto"; + }; + } - pull = { rebase = false; }; - }; - extraConfig = '' - - [include] - path = ~/work/git/gitconfig - ''; + { pull = { rebase = false; }; } + { include = { path = "~/work/git/gitconfig"; }; } + ]; }; } diff --git a/flake.lock b/flake.lock index 2462b80..a6a5ae0 100644 --- a/flake.lock +++ b/flake.lock @@ -487,17 +487,17 @@ }, "xinDev": { "locked": { - "lastModified": 1671573752, - "narHash": "sha256-ZKWE45bhj/6DSaDL7+/kHNIycYDn2g5qLY1VeK+89cc=", + "lastModified": 1671589301, + "narHash": "sha256-A9kIPTeI5gM2NsOrT3V2egYLJQT7Zzx+/j6sgcXCNo0=", "owner": "qbit", "repo": "nixpkgs", - "rev": "13ff4b1299d5d76c83854f571463deb89f5c0954", + "rev": "f9f4444cdf01270c5e463e84e02cc225d8208476", "type": "github" }, "original": { "owner": "qbit", "repo": "nixpkgs", - "rev": "13ff4b1299d5d76c83854f571463deb89f5c0954", + "rev": "f9f4444cdf01270c5e463e84e02cc225d8208476", "type": "github" } }, diff --git a/flake.nix b/flake.nix index f550f8c..77e44a1 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ url = "git+ssh://xin-secrets-ro/qbit/xin-secrets.git?ref=main"; }; - xinDev.url = "github:qbit/nixpkgs/13ff4b1299d5d76c83854f571463deb89f5c0954"; + xinDev.url = "github:qbit/nixpkgs/f9f4444cdf01270c5e463e84e02cc225d8208476"; unstable.url = "github:NixOS/nixpkgs"; unstableSmall.url = "github:NixOS/nixpkgs/nixos-unstable-small"; @@ -74,9 +74,10 @@ }; }; - outputs = { self, xinDev, unstable, unstableSmall, stable, oldStable, nixos-hardware - , reform, sshKnownHosts, microca, gostart, xintray, tsvnstat, taskobs - , mcchunkie, gqrss, darwin, xin-secrets, talon, peerix, ... }@inputs: + outputs = { self, xinDev, unstable, unstableSmall, stable, oldStable + , nixos-hardware, reform, sshKnownHosts, microca, gostart, xintray, tsvnstat + , taskobs, mcchunkie, gqrss, darwin, xin-secrets, talon, peerix, ... + }@inputs: let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];