dev.fron.io rc / 0d637fd
git: enable for bao Tony Olagbaiye 1 year, 6 months ago
8 changed file(s) with 108 addition(s) and 27 deletion(s). Raw diff Collapse all Expand all
184184 nixosModules = let
185185 mergeAll = lib.fold lib.recursiveUpdate {};
186186 pathsToAttrs = map (file:
187 let
188 cleanFile = lib.removeSuffix ".nix" (lib.removePrefix "./" (toString file));
187 let cleanFile = lib.removeSuffix ".nix" (lib.removePrefix "./" (toString file));
189188 in lib.setAttrByPath (lib.splitString "/" cleanFile) (import file)
190189 );
191190
192 # modules
193191 moduleList = import ./modules/list.nix;
194192 modulesAttrs = mergeAll (pathsToAttrs moduleList);
195193
196 # profiles
197194 profilesList = import ./profiles/list.nix;
198195 profilesAttrs = { profiles = mergeAll (pathsToAttrs profilesList); };
199196 in modulesAttrs // profilesAttrs;
200197
201 secrets = concatStringsSep "\n" ([]
198 secrets = with lib.strings; concatMapStringsSep "\n" (replaceStrings [" "] ["\\s"]) ([
199 ] ++ (attrNames (import ./secrets/wifi.networks.nix))
200 ++ (map (n: n.psk) (attrValues (import ./secrets/wifi.networks.nix)))
201 ++ (attrValues (import ./secrets/root.password.nix))
202 ++ (attrValues (import ./secrets/user.password.nix))
203 ++ (attrValues (import ./secrets/user.description.nix))
204 ++ (attrValues (import ./secrets/git.user.nix))
202205 ++ (attrValues (import ./secrets/domains.nix))
203206 ++ (lib.flatten (map attrValues (attrValues (import ./secrets/hosts.nix))))
204207 );
Binary diff not shown
Binary diff not shown
Binary diff not shown
99 users.users.bao = {
1010 uid = 1000;
1111 group = "users";
12 description = "Tony";
1312 shell = pkgs.fish;
1413 isNormalUser = true;
1514 extraGroups = [ "wheel" "adbusers" ];
16 } // import ../secrets/user.password.nix;
15 } // import ../secrets/user.password.nix
16 // import ../secrets/user.description.nix;
1717
1818 home-manager.users.bao = let
1919 home-config = config.home-manager.users.bao;
5151 programs.gpodder.enable = true;
5252 programs.mpv.enable = true;
5353 programs.feh.enable = true;
54 programs.git.enable = false; # TODO
54 programs.git.enable = true;
5555 programs.ssh.enable = false; # TODO
5656
5757 services.lorri.enable = true;
0 { config ? {}, lib, pkgs, ... }:
0 { config, lib, pkgs, ... }:
11
22 with lib; let
33 cfg = config.programs.neovim;
1313 vim-nix # nix language
1414 ];
1515 extraConfig = ''
16 set inccommand=nosplit
17 set nohlsearch
18 set number
1916 colorscheme slate
17
18 set inccommand=nosplit " previews
19 set nohlsearch " unpersist highlights
20 set number " line numbering
2021 '';
2122 };
2223 };
0 { config ? {}, lib, pkgs, ... }:
0 { config, lib, pkgs, domains, ... }:
11
22 with lib; let
33 cfg = config.programs.git;
44 in {
55 config = mkIf cfg.enable {
6 home.packages = with pkgs; let
7 git-crypt = pkgs.git-crypt.overrideAttrs (attrs: rec {
8 worktreePatch = fetchurl {
9 url = "https://github.com/AGWA/git-crypt/files/2771938/git-crypt-support-worktree-simple-version-patch.txt";
10 sha256 = "1k477m6g3zjdarjr38lndh0kpgkp0yi8lg2iqdispfd4c85krrax";
6 home.packages = with pkgs;
7 let
8 git-crypt = pkgs.git-crypt.overrideAttrs (attrs: rec {
9 worktreePatch = fetchurl {
10 url = "https://github.com/AGWA/git-crypt/files/2771938/git-crypt-support-worktree-simple-version-patch.txt";
11 sha256 = "1k477m6g3zjdarjr38lndh0kpgkp0yi8lg2iqdispfd4c85krrax";
12 };
13 patches = [ worktreePatch ];
14 });
15 in [ dgit git git-crypt ] ++ (with gitAndTools; [ hub lab ]);
16
17 programs.git = {
18 inherit (import ../../../secrets/git.user.nix) userName userEmail;
19
20 package = pkgs.hiPrio pkgs.gitAndTools.gitFull;
21 aliases = lib.mkForce { }; # We hate aliases
22 ignores = [ ];
23 delta = {
24 enable = true;
25 options = [ "--dark --width=variable" ];
26 };
27 signing = {
28 gpgPath = "${pkgs.gnupg}/bin/gpg2";
29 key = "9E2FF3BDEBDFC910";
30 signByDefault = true;
31 };
32
33 attributes = [ ".rs filter=spacify_trim" ];
34 extraConfig = {
35 credential.helper = "store";
36
37 extensions.worktreeConfig = "true";
38 pull.rebase = "merges";
39 push = {
40 default = "simple";
41 followTags = true;
1142 };
12 patches = [ worktreePatch ];
13 });
14 in [
15 dgit
16 git
17 git-crypt
18 gitAndTools.hub
19 gitAndTools.lab
20 ];
43 rebase.abbreviateCommands = true;
44
45 url = {
46 "git://github.com/" = {
47 insteadOf = "github:";
48 };
49 "git@github.com:" = {
50 insteadOf = "gh:";
51 pushInsteadOf = [ "github:" "git://github.com/" ];
52 };
53
54 "git://gitlab.com/" = {
55 insteadOf = "gitlab:";
56 };
57 "git@gitlab.com:" = {
58 insteadOf = "gl:";
59 pushInsteadOf = [ "gitlab:" "git://gitlab.com/" ];
60 };
61
62 "git://gist.github.com/" = {
63 insteadOf = "gist:";
64 };
65 "git@gist.github.com:" = {
66 insteadOf = "gst:";
67 pushInsteadOf = [ "gist:" "git://gist.github.com/" ];
68 };
69 };
70 github = import ../../../secrets/git.github.nix;
71
72 format.pretty = "oneline";
73 log.decorate = "full";
74 diff = {
75 guitool = "gvimdiff";
76 tool = "vimdiff";
77 };
78 merge = {
79 guitool = "gvimdiff";
80 tool = "vimdiff";
81 };
82 filter = {
83 spacify = {
84 clean = "expand --tabs=4 --initial";
85 required = true;
86 };
87 spacify_trim = {
88 clean = ''sh -c "expand --tabs=4 --initial %f | git-stripspace"'';
89 required = true;
90 };
91 trim = {
92 clean = "git-stripspace";
93 required = true;
94 };
95 };
96 };
97 };
2198 };
2299 }