From fd2214f778c851b89c7b17ab4868e86fc5709027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 25 Jul 2020 11:57:23 +0100 Subject: [PATCH] port git --- nixos/boxes/foureighty/default.nix | 2 +- nixos/boxes/skinnyv/default.nix | 25 +++++++++++++------------ nixos/git/default.nix | 26 ++++++++++++++++++++++++++ nixos/home-manager/programs/git.nix | 24 ------------------------ 4 files changed, 40 insertions(+), 37 deletions(-) create mode 100644 nixos/git/default.nix delete mode 100644 nixos/home-manager/programs/git.nix diff --git a/nixos/boxes/foureighty/default.nix b/nixos/boxes/foureighty/default.nix index a3d940e5..7131e163 100644 --- a/nixos/boxes/foureighty/default.nix +++ b/nixos/boxes/foureighty/default.nix @@ -14,6 +14,7 @@ ../../backups.nix ../../gui ../../gnome + ../../git ]; boot.kernelPackages = pkgs.linuxPackages_latest; @@ -40,7 +41,6 @@ home-manager.users.cyryl = {...}: { imports = [ ../../home-manager - ../../home-manager/programs/git.nix ]; home.stateVersion = config.system.stateVersion; diff --git a/nixos/boxes/skinnyv/default.nix b/nixos/boxes/skinnyv/default.nix index 2b108ca4..9c342ed6 100644 --- a/nixos/boxes/skinnyv/default.nix +++ b/nixos/boxes/skinnyv/default.nix @@ -2,6 +2,19 @@ { networking.hostName = "skinnyv"; + imports = [ + + /etc/nixos/hardware-configuration.nix + ../../boot.nix + ../../common.nix + ../../gfx-intel.nix + ../../zerotier.nix + ../../i3/system.nix + ../../distributed-builds.nix + ../../gui + ../../git + ]; + boot = { kernelPackages = pkgs.linuxPackages_latest; initrd.luks.devices = { @@ -25,8 +38,6 @@ imports = [ imports = [ ../../home-manager - ../../home-manager/gui.nix - ../../home-manager/programs/git.nix ]; ]; home.stateVersion = config.system.stateVersion; @@ -37,14 +48,4 @@ home.file.".config/i3/status.toml".source = ../../../.config/i3/status-single-bat.toml; }; - imports = [ - - /etc/nixos/hardware-configuration.nix - ../../boot.nix - ../../common.nix - ../../gfx-intel.nix - ../../zerotier.nix - ../../i3/system.nix - ../../distributed-builds.nix - ]; } diff --git a/nixos/git/default.nix b/nixos/git/default.nix new file mode 100644 index 00000000..ca7591ad --- /dev/null +++ b/nixos/git/default.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, ... }: +{ + home-manager.users.cyryl = {...}: { + programs.git = { + enable = true; + lfs.enable = true; + userName = "Cyryl PÅ‚otnicki"; + userEmail = "cyplo@cyplo.net"; + extraConfig = { + credential = { helper ="cache"; }; + core = { pager = "cat"; }; + pager = { + diff = "${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | less --tabs=1,5 -RFX"; + show = "${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | less --tabs=1,5 -RFX"; + }; + }; + aliases = + { + tree = "log --show-signature --color --decorate --date=short --all --graph -n 3"; + newbranch = "!git checkout master && git fetch -p && git reset --hard origin/master && git checkout -b $2"; + head = "log HEAD -n1"; + vacuum = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D && git gc --aggressive --auto"; + }; + }; + }; + } diff --git a/nixos/home-manager/programs/git.nix b/nixos/home-manager/programs/git.nix deleted file mode 100644 index c37526bd..00000000 --- a/nixos/home-manager/programs/git.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - programs.git = { - enable = true; - lfs.enable = true; - userName = "Cyryl PÅ‚otnicki"; - userEmail = "cyplo@cyplo.net"; - extraConfig = { - credential = { helper ="cache"; }; - core = { pager = "cat"; }; - pager = { - diff = "${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | less --tabs=1,5 -RFX"; - show = "${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | less --tabs=1,5 -RFX"; - }; - }; - aliases = - { - tree = "log --show-signature --color --decorate --date=short --all --graph -n 3"; - newbranch = "!git checkout master && git fetch -p && git reset --hard origin/master && git checkout -b $2"; - head = "log HEAD -n1"; - vacuum = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D && git gc --aggressive --auto"; - }; - }; - }