From 734c13664a4a3383a332b67b0566a34c2f8d05e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey?= Date: Thu, 5 Mar 2026 15:51:48 -0800 Subject: [PATCH 1/7] dev: rc.graphite installs graphite with settings --- modules/home/git.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/home/git.nix b/modules/home/git.nix index ffe4e5f8..19995cd3 100644 --- a/modules/home/git.nix +++ b/modules/home/git.nix @@ -7,8 +7,19 @@ inherit (lib) mkIf mkOption; cfg = config.rc.git; + graphiteCfg = config.rc.graphite; in { options = { + rc.graphite = { + enable = lib.mkEnableOption "Graphite CLI"; + + settings = mkOption { + default = {}; + description = "Settings for ~/.config/graphite/user_config."; + type = lib.types.attrs; + }; + }; + rc.git = { enable = lib.mkEnableOption "Git-related configuration"; @@ -105,5 +116,12 @@ in { enableJujutsuIntegration = true; }; }) + + (mkIf graphiteCfg.enable { + home.packages = [pkgs.graphite-cli]; + + home.file.".config/graphite/user_config".text = + builtins.toJSON graphiteCfg.settings; + }) ]; } From 36c47f40812e5b2393de8af15b94f144a33b49d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey?= Date: Thu, 5 Mar 2026 15:53:32 -0800 Subject: [PATCH 2/7] do not automatically update unless explicitly set --- modules/home/git.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home/git.nix b/modules/home/git.nix index 19995cd3..96be2d13 100644 --- a/modules/home/git.nix +++ b/modules/home/git.nix @@ -17,6 +17,7 @@ in { default = {}; description = "Settings for ~/.config/graphite/user_config."; type = lib.types.attrs; + apply = s: {updateAutomatically = false;} // s; }; }; From 670d963768234b6f2fabfa9bd74539f737dec628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey?= Date: Thu, 5 Mar 2026 15:59:44 -0800 Subject: [PATCH 3/7] generalize git.nix module --- home/default.nix | 2 +- modules/home/default.nix | 2 +- modules/home/{git.nix => scm.nix} | 54 +++++++++++++++---------------- 3 files changed, 28 insertions(+), 30 deletions(-) rename modules/home/{git.nix => scm.nix} (88%) diff --git a/home/default.nix b/home/default.nix index 67188913..9c3278e6 100644 --- a/home/default.nix +++ b/home/default.nix @@ -27,7 +27,7 @@ containers.enable = true; javascript.enable = true; }; - git.enableJujutsu = true; + jujutsu.enable = true; utilities = { file.enable = true; media.enable = true; diff --git a/modules/home/default.nix b/modules/home/default.nix index 85bc2b68..318cf79b 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -4,7 +4,7 @@ ./programs ./development.nix ./editor.nix - ./git.nix + ./scm.nix ./ssh.nix ./utilities.nix ]; diff --git a/modules/home/git.nix b/modules/home/scm.nix similarity index 88% rename from modules/home/git.nix rename to modules/home/scm.nix index 96be2d13..a307bd7b 100644 --- a/modules/home/git.nix +++ b/modules/home/scm.nix @@ -6,21 +6,11 @@ }: let inherit (lib) mkIf mkOption; - cfg = config.rc.git; + gitCfg = config.rc.git; graphiteCfg = config.rc.graphite; + jjCfg = config.rc.jujutsu; in { options = { - rc.graphite = { - enable = lib.mkEnableOption "Graphite CLI"; - - settings = mkOption { - default = {}; - description = "Settings for ~/.config/graphite/user_config."; - type = lib.types.attrs; - apply = s: {updateAutomatically = false;} // s; - }; - }; - rc.git = { enable = lib.mkEnableOption "Git-related configuration"; @@ -37,18 +27,26 @@ in { description = "Whether to enable interactive rebase."; type = lib.types.bool; }; + }; - enableJujutsu = mkOption { - default = false; - example = true; - description = "Whether to enable jujutsu."; - type = lib.types.bool; + rc.graphite = { + enable = lib.mkEnableOption "Graphite CLI"; + + settings = mkOption { + default = {}; + description = "Settings for ~/.config/graphite/user_config."; + type = lib.types.attrs; + apply = s: {updateAutomatically = false;} // s; }; }; + + rc.jujutsu = { + enable = lib.mkEnableOption "Jujutsu version control"; + }; }; config = lib.mkMerge [ - (mkIf cfg.enable { + (mkIf gitCfg.enable { home.packages = [ pkgs.onefetch ]; @@ -90,7 +88,7 @@ in { }; }) - (mkIf cfg.enableHubWrapper { + (mkIf gitCfg.enableHubWrapper { home.packages = [pkgs.hub]; programs.zsh.shellAliases = { @@ -98,13 +96,20 @@ in { }; }) - (mkIf cfg.enableInteractiveRebase { + (mkIf gitCfg.enableInteractiveRebase { home.packages = [pkgs.git-interactive-rebase-tool]; programs.git.settings.sequence.editor = "interactive-rebase-tool"; }) - (mkIf cfg.enableJujutsu { + (mkIf graphiteCfg.enable { + home.packages = [pkgs.graphite-cli]; + + home.file.".config/graphite/user_config".text = + builtins.toJSON graphiteCfg.settings; + }) + + (mkIf jjCfg.enable { programs.jujutsu = { enable = true; }; @@ -117,12 +122,5 @@ in { enableJujutsuIntegration = true; }; }) - - (mkIf graphiteCfg.enable { - home.packages = [pkgs.graphite-cli]; - - home.file.".config/graphite/user_config".text = - builtins.toJSON graphiteCfg.settings; - }) ]; } From 077832f7bed64207ca4a576fa2c8420339f87084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey?= Date: Thu, 5 Mar 2026 16:02:56 -0800 Subject: [PATCH 4/7] define static graphite config --- modules/home/scm.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/home/scm.nix b/modules/home/scm.nix index a307bd7b..9c78b882 100644 --- a/modules/home/scm.nix +++ b/modules/home/scm.nix @@ -31,13 +31,6 @@ in { rc.graphite = { enable = lib.mkEnableOption "Graphite CLI"; - - settings = mkOption { - default = {}; - description = "Settings for ~/.config/graphite/user_config."; - type = lib.types.attrs; - apply = s: {updateAutomatically = false;} // s; - }; }; rc.jujutsu = { @@ -105,8 +98,13 @@ in { (mkIf graphiteCfg.enable { home.packages = [pkgs.graphite-cli]; - home.file.".config/graphite/user_config".text = - builtins.toJSON graphiteCfg.settings; + home.file.".config/graphite/user_config".text = builtins.toJSON { + branchPrefix = "corey/"; + branchDate = false; + branchReplacement = "-"; + skipApplyingPrefixToNonGeneratedBranchNames = true; + updateAutomatically = false; + }; }) (mkIf jjCfg.enable { From 3fd3c3c142758d180de5b44d153bc54c651c9f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey?= Date: Thu, 5 Mar 2026 16:05:37 -0800 Subject: [PATCH 5/7] enable graphite on hosts except spore --- home/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/default.nix b/home/default.nix index 9c3278e6..35cbea5d 100644 --- a/home/default.nix +++ b/home/default.nix @@ -27,6 +27,7 @@ containers.enable = true; javascript.enable = true; }; + graphite.enable = true; jujutsu.enable = true; utilities = { file.enable = true; From 249c6d2f2bcf77bc7001ebe8a877fed55bdaa0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey?= Date: Thu, 5 Mar 2026 16:07:52 -0800 Subject: [PATCH 6/7] update allowUnfreePredicate --- modules/base/unfree-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/base/unfree-packages.nix b/modules/base/unfree-packages.nix index 4435407e..7e2b7e9f 100644 --- a/modules/base/unfree-packages.nix +++ b/modules/base/unfree-packages.nix @@ -10,6 +10,7 @@ "claude-code" "daisydisk" "fastscripts" + "graphite-cli" "mochi" "plexmediaserver" "roon-server" From 14f332a0d6ad659c6be2af2c9534b250b952eb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey?= Date: Thu, 5 Mar 2026 16:11:50 -0800 Subject: [PATCH 7/7] only write graphite config if not present --- modules/home/scm.nix | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/home/scm.nix b/modules/home/scm.nix index 9c78b882..a1f8b451 100644 --- a/modules/home/scm.nix +++ b/modules/home/scm.nix @@ -98,13 +98,23 @@ in { (mkIf graphiteCfg.enable { home.packages = [pkgs.graphite-cli]; - home.file.".config/graphite/user_config".text = builtins.toJSON { - branchPrefix = "corey/"; - branchDate = false; - branchReplacement = "-"; - skipApplyingPrefixToNonGeneratedBranchNames = true; - updateAutomatically = false; - }; + home.activation.graphiteConfig = lib.hm.dag.entryAfter ["writeBoundary"] '' + config_dir="$HOME/.config/graphite" + config_file="$config_dir/user_config" + run mkdir -p "$config_dir" + if [ ! -f "$config_file" ]; then + run cp ${ + pkgs.writeText "graphite-user-config" (builtins.toJSON { + branchPrefix = "corey/"; + branchDate = false; + branchReplacement = "-"; + skipApplyingPrefixToNonGeneratedBranchNames = true; + updateAutomatically = false; + }) + } "$config_file" + run chmod u+w "$config_file" + fi + ''; }) (mkIf jjCfg.enable {