my nixos/home-manager configuration
1
fork

Configure Feed

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

add conditional git/jj config when working on cc

youn 390dd6d3 3c9743f6

+43 -10
+2
flake.nix
··· 79 79 80 80 user = rec { 81 81 name = "youn"; 82 + family = "melois"; 83 + fullName = "Youn Mélois"; 82 84 email = "youn@melois.dev"; 83 85 homeDirectory = "/home/${name}"; 84 86 nixConfigDirectory = "${homeDirectory}/nixfiles";
+2 -1
home-manager/common.nix
··· 2 2 pkgs, 3 3 lib, 4 4 user, 5 + ssh, 5 6 ... 6 7 }: 7 8 ··· 14 15 home.file = { 15 16 ".ssh/master.pub" = { 16 17 enable = lib.mkDefault false; 17 - text = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFPO/hKBeNBJVbq8yPL13KRBLCn+gpXyNtAs1UyvyP9Z"; 18 + text = ssh.public.text; 18 19 }; 19 20 20 21 ".ssh/clever-cloud.pub" = {
+15 -1
home-manager/modules/git.nix
··· 18 18 extraConfig = { 19 19 init.defaultBranch = "main"; 20 20 pull.rebase = true; 21 + "includeIf \"gitdir:${user.homeDirectory}/clever-cloud\"" = { 22 + path = builtins.toString config.xdg.configFile."git/work".source; 23 + }; 24 + "includeIf \"gitdir:${user.homeDirectory}/Code/clever-cloud\"" = { 25 + path = builtins.toString config.xdg.configFile."git/work".source; 26 + }; 21 27 }; 22 - userName = user.name; 28 + userName = user.fullName; 23 29 userEmail = user.email; 24 30 signing = { 25 31 signByDefault = true; ··· 32 38 ".env" 33 39 ".envrc.local" 34 40 ]; 41 + }; 42 + 43 + xdg.configFile."git/work" = { 44 + text = '' 45 + [user] 46 + email = "${user.name}.${user.family}@clever-cloud.com" 47 + signingKey = "${config.home.file.".ssh/clever-cloud.pub".text}" 48 + ''; 35 49 }; 36 50 }; 37 51 }
+24 -8
home-manager/modules/jujutsu.nix
··· 13 13 config = lib.mkIf cfg.enable { 14 14 programs.jujutsu = { 15 15 settings = { 16 - inherit user; 16 + user = { 17 + name = user.fullName; 18 + email = user.email; 19 + }; 17 20 signing = { 18 21 behavior = "own"; 19 22 backend = "ssh"; ··· 22 25 ui = { 23 26 default-command = [ "log" ]; 24 27 pager = "less -FR"; 28 + conflict-marker-style = "git"; 29 + }; 30 + template = { 31 + git_push_bookmark = ''"${user.name}/push-" ++ change_id.short()''; 25 32 }; 26 33 git = { 27 - private-commits = "description(glob:'wip:*') | description(glob:'private:*')"; 34 + executable-path = "${config.programs.git.package}/bin/git"; 35 + push-new-bookmarks = true; 36 + private-commits = "description(glob:'private:*')"; 28 37 }; 38 + "--scope" = [ 39 + { 40 + "--when".repositories = [ 41 + "${user.homeDirectory}/clever-cloud" 42 + "${user.homeDirectory}/Code/clever-cloud" 43 + ]; 44 + user.email = "${user.name}.${user.family}@clever-cloud.com"; 45 + signing.key = config.home.file.".ssh/clever-cloud.pub".text; 46 + } 47 + ]; 29 48 }; 30 49 }; 31 50 51 + # jj doesn't seem to read `$XDG_CONFIG_HOME/git/ignore` although it should be: 52 + # https://jj-vcs.github.io/jj/latest/working-copy/#ignored-files 32 53 home.file.".gitignore" = { 33 - text = '' 34 - .zed/ 35 - .direnv/ 36 - .env 37 - .envrc.local 38 - ''; 54 + text = builtins.concatStringsSep "\n" config.programs.git.ignores; 39 55 }; 40 56 }; 41 57 }