From 37ba6126b7d33dbe3e201cc734a04e8bdcc54c5f Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Tue, 26 Sep 2023 15:45:31 -0400 Subject: [PATCH] home-manager gburd builds --- home-manager/_mixins/cli/default.nix | 4 +- home-manager/_mixins/cli/fish.nix | 2 +- home-manager/_mixins/cli/git.nix | 51 +++++++++++++++++--- home-manager/_mixins/cli/gpg.nix | 4 +- home-manager/_mixins/console/default.nix | 23 ++++++--- home-manager/_mixins/nvim/default.nix | 7 --- home-manager/_mixins/users/gburd/default.nix | 47 +----------------- home-manager/modules/default.nix | 3 -- nixos/floki/default.nix | 3 +- overlays/default.nix | 13 +++-- 10 files changed, 77 insertions(+), 80 deletions(-) delete mode 100644 home-manager/modules/default.nix diff --git a/home-manager/_mixins/cli/default.nix b/home-manager/_mixins/cli/default.nix index fbb0dab..be06a2e 100644 --- a/home-manager/_mixins/cli/default.nix +++ b/home-manager/_mixins/cli/default.nix @@ -13,7 +13,7 @@ ./ranger.nix ./screen.nix ./ssh.nix -# ./xpo.nix + # ./xpo.nix ]; home.packages = with pkgs; [ @@ -40,6 +40,6 @@ tly # Tally counter - inputs.nh.default # nixos-rebuild and home-manager CLI wrapper + # inputs.nh.default # nixos-rebuild and home-manager CLI wrapper ]; } diff --git a/home-manager/_mixins/cli/fish.nix b/home-manager/_mixins/cli/fish.nix index 6329012..f4017ae 100644 --- a/home-manager/_mixins/cli/fish.nix +++ b/home-manager/_mixins/cli/fish.nix @@ -7,7 +7,7 @@ let hasNeovim = config.programs.neovim.enable; hasEmacs = config.programs.emacs.enable; hasNeomutt = config.programs.neomutt.enable; - hasShellColor = config.programs.shellcolor.enable; + hasShellColor = if builtins.hasAttr "shellcolor" config.programs then config.programs.shellcolor.enable else false; hasKitty = config.programs.kitty.enable; shellcolor = "${pkgs.shellcolord}/bin/shellcolor"; in diff --git a/home-manager/_mixins/cli/git.nix b/home-manager/_mixins/cli/git.nix index 0308099..cc737b4 100644 --- a/home-manager/_mixins/cli/git.nix +++ b/home-manager/_mixins/cli/git.nix @@ -2,7 +2,7 @@ let ssh = "${pkgs.openssh}/bin/ssh"; - git-m7 = pkgs.writeShellScriptBin "git-m7" '' + git-gburd = pkgs.writeShellScriptBin "git-gburd" '' repo="$(git remote -v | grep git@burd.me | head -1 | cut -d ':' -f2 | cut -d ' ' -f1)" # Add a .git suffix if it's missing if [[ "$repo" != *".git" ]]; then @@ -27,22 +27,59 @@ let ''; in { - home.packages = [ git-m7 ]; + home.packages = [ git-gburd ]; programs.git = { enable = true; package = pkgs.gitAndTools.gitFull; aliases = { - pushall = "!git remote | xargs -L1 git push --all"; - graph = "log --decorate --oneline --graph"; + aa = "add --all"; add-nowhitespace = "!git diff -U0 -w --no-color | git apply --cached --ignore-whitespace --unidiff-zero -"; + amend = "commit --amend"; + ci = "commit"; + co = "checkout"; + dag = "log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)\"%an\" <%ae>%C(reset) %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)%n%s' --date-order"; + dc = "diff --cached"; + di = "diff"; + div = "divergence"; + fa = "fetch --all"; fast-forward = "merge --ff-only"; + ff = "merge --ff-only"; + files = "show --oneline"; + gn = "goodness"; + gnc = "goodness --cached"; + graph = "log --decorate --oneline --graph"; + h = "!git head"; + head = "!git l -1"; + l = "log --graph --abbrev-commit --date=relative"; + la = "!git l --all"; + lastchange = "log -n 1 -p"; + lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"; + lol = "log --graph --decorate --pretty=oneline --abbrev-commit"; + lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all"; + mend = "commit --amend --no-edit"; + pom = "push origin master"; + pullff = "pull --ff-only"; + pushall = "!git remote | xargs -L1 git push --all"; + r = "!git --no-pager l -20"; + ra = "!git r --all"; + st = "status --short"; + subdate = "submodule update --init --recursive"; + sync = "pull --rebase"; + unadd = "reset --"; + unedit = "checkout --"; + unrm = "checkout --"; + unstage = "reset HEAD"; + unstash = "stash pop"; + update = "merge --ff-only origin/master"; }; userName = "Greg Burd"; - userEmail = "gburd@symas.com"; + userEmail = "greg@burd.me"; + signing = { + key = "D4BB42BE729AEFBD2EFEBF8822931AF7895E82DF"; + signByDefault = true; + }; extraConfig = { init.defaultBranch = "main"; - user.signing.key = "1FC1E7793410DE46"; - commit.gpgSign = true; gpg.program = "${config.programs.gpg.package}/bin/gpg2"; }; lfs.enable = true; diff --git a/home-manager/_mixins/cli/gpg.nix b/home-manager/_mixins/cli/gpg.nix index ecc466c..7865109 100644 --- a/home-manager/_mixins/cli/gpg.nix +++ b/home-manager/_mixins/cli/gpg.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, config, username, ... }: let pinentry = if config.gtk.enable then { @@ -42,7 +42,7 @@ in trust-model = "tofu+pgp"; }; publicKeys = [{ - source = ../../pgp.asc; + source = ../users/${username}/pgp.asc; trust = 5; }]; }; diff --git a/home-manager/_mixins/console/default.nix b/home-manager/_mixins/console/default.nix index 5e692bb..55ab36e 100644 --- a/home-manager/_mixins/console/default.nix +++ b/home-manager/_mixins/console/default.nix @@ -1,4 +1,15 @@ -{ config, lib, pkgs, ... }: { +{ config, lib, pkgs, ... }: +let + pinentry = + if config.gtk.enable then { + packages = [ pkgs.pinentry-gnome pkgs.gcr ]; + name = "gnome3"; + } else { + packages = [ pkgs.pinentry-curses ]; + name = "curses"; + }; +in +{ home = { file = { "${config.xdg.configHome}/neofetch/config.conf".text = builtins.readFile ./neofetch.conf; @@ -7,10 +18,10 @@ neofetch ]; sessionVariables = { - EDITOR = "micro"; + EDITOR = "vi"; MANPAGER = "sh -c 'col --no-backspaces --spaces | bat --language man'"; - SYSTEMD_EDITOR = "micro"; - VISUAL = "micro"; + SYSTEMD_EDITOR = "vi"; + VISUAL = "vi"; }; }; @@ -114,7 +125,7 @@ }; }; aliases = { - lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"; }; extraConfig = { push = { @@ -165,7 +176,7 @@ gpg-agent = { enable = true; enableSshSupport = true; - pinentryFlavor = "curses"; + pinentryFlavor = pinentry.name; }; }; diff --git a/home-manager/_mixins/nvim/default.nix b/home-manager/_mixins/nvim/default.nix index ef17b03..53eb860 100644 --- a/home-manager/_mixins/nvim/default.nix +++ b/home-manager/_mixins/nvim/default.nix @@ -1,14 +1,10 @@ { config, pkgs, ... }: -let - color = pkgs.writeText "color.vim" (import ./theme.nix config.colorscheme); -in { imports = [ ./lsp.nix ./syntaxes.nix ./ui.nix ]; - home.sessionVariables.EDITOR = "nvim"; programs.neovim = { enable = true; @@ -16,9 +12,6 @@ in extraConfig = /* vim */ '' "Use system clipboard set clipboard=unnamedplus - "Source colorscheme - source ${color} - "Set fold level to highest in file "so everything starts out unfolded at just the right level augroup initial_fold diff --git a/home-manager/_mixins/users/gburd/default.nix b/home-manager/_mixins/users/gburd/default.nix index 336714a..9975539 100644 --- a/home-manager/_mixins/users/gburd/default.nix +++ b/home-manager/_mixins/users/gburd/default.nix @@ -138,52 +138,6 @@ speedtest = "speedtest-go"; }; }; - git = { - userEmail = "greg@burd.me"; - userName = "Greg Burd"; - signing = { - key = "D4BB42BE729AEFBD2EFEBF8822931AF7895E82DF"; - signByDefault = true; - }; - aliases = { - st = "status --short"; - ci = "commit"; - co = "checkout"; - di = "diff"; - dc = "diff --cached"; - amend = "commit --amend"; - aa = "add --all"; - head = "!git l -1"; - h = "!git head"; - r = "!git --no-pager l -20"; - ra = "!git r --all"; - ff = "merge --ff-only"; - pullff = "pull --ff-only"; - l = "log --graph --abbrev-commit --date=relative"; - la = "!git l --all"; - div = "divergence"; - gn = "goodness"; - gnc = "goodness --cached"; - fa = "fetch --all"; - pom = "push origin master"; - files = "show --oneline"; - graph = "log --graph --decorate --all"; - lol = "log --graph --decorate --pretty=oneline --abbrev-commit"; - lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all"; - lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"; - sync = "pull --rebase"; - update = "merge --ff-only origin/master"; - mend = "commit --amend --no-edit"; - unadd = "reset --"; - unedit = "checkout --"; - unstage = "reset HEAD"; - unrm = "checkout --"; - unstash = "stash pop"; - lastchange = "log -n 1 -p"; - dag = "log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)\"%an\" <%ae>%C(reset) %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)%n%s' --date-order"; - subdate = "submodule update --init --recursive"; - }; - }; }; systemd.user.tmpfiles.rules = [ @@ -197,4 +151,5 @@ "d ${config.home.homeDirectory}/Websites 0755 ${username} users - -" "L+ ${config.home.homeDirectory}/.config/obs-studio/ - - - - ${config.home.homeDirectory}/Studio/OBS/config/obs-studio/" ]; + } diff --git a/home-manager/modules/default.nix b/home-manager/modules/default.nix deleted file mode 100644 index c3f2553..0000000 --- a/home-manager/modules/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - pass-secret-service = import ./pass-secret-service.nix; -} diff --git a/nixos/floki/default.nix b/nixos/floki/default.nix index ef30d03..0977687 100644 --- a/nixos/floki/default.nix +++ b/nixos/floki/default.nix @@ -1,4 +1,5 @@ -{ inputs, lib, pkgs, ... }: { +{ inputs, lib, pkgs, ... }: +{ imports = [ inputs.nixos-hardware.nixosModules.common-cpu-intel #inputs.nixos-hardware.nixosModules.common-gpu-nvidia diff --git a/overlays/default.nix b/overlays/default.nix index 19da260..2966f3e 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -6,13 +6,16 @@ let }); in { - # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ../pkgs { pkgs = final; }; + # Add our custom packages from the 'pkgs' directory + additions = final: prev: import ../pkgs { pkgs = final; } // { + formats = prev.formats // import ../pkgs/formats { pkgs = final; }; + vimPlugins = prev.vimPlugins // final.callPackage ../pkgs/vim-plugins { }; + }; - # This one contains whatever you want to overlay - # You can change versions, add patches, set compilation flags, anything really. + # Modify existing packages; change versions, add patches, set compilation + # flags, anything really. # https://nixos.wiki/wiki/Overlays - modifications = final: prev: { + modifications = _final: prev: { # example = prev.example.overrideAttrs (oldAttrs: rec { # ... # });