feat(git): add git module, set user config
This commit is contained in:
parent
a71cbb544a
commit
f78770d4f1
5 changed files with 15 additions and 2 deletions
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
flake.homes.rafiq = {
|
flake.homes.rafiq = {
|
||||||
# Testing the import in home-manager.nix
|
|
||||||
home.shellAliases = {
|
home.shellAliases = {
|
||||||
gs = "git status";
|
gs = "git status";
|
||||||
gc = "git commit";
|
gc = "git commit";
|
||||||
|
|
|
@ -15,7 +15,7 @@ in
|
||||||
flake.manifest = {
|
flake.manifest = {
|
||||||
users.rafiq = {
|
users.rafiq = {
|
||||||
primary = true;
|
primary = true;
|
||||||
username = "rafiq"; # If we don't set this here we have to do some weird shit
|
name = "Mohammad Rafiq";
|
||||||
email = "rafiq@rrv.sh";
|
email = "rafiq@rrv.sh";
|
||||||
shell = "fish";
|
shell = "fish";
|
||||||
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n rafiq";
|
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n rafiq";
|
||||||
|
|
12
nix/modules/git.nix
Normal file
12
nix/modules/git.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
flake.modules.homeManager.default =
|
||||||
|
{ manifest, config, ... }:
|
||||||
|
{
|
||||||
|
home.sessionVariables.GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";
|
||||||
|
programs.git = {
|
||||||
|
userName = manifest.users.${config.home.username}.name;
|
||||||
|
userEmail = manifest.users.${config.home.username}.email;
|
||||||
|
signing.key = "~/.ssh/id_ed25519.pub";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ let
|
||||||
globalCfg = {
|
globalCfg = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
|
extraSpecialArgs = { inherit (cfg) manifest; };
|
||||||
sharedModules = [
|
sharedModules = [
|
||||||
(flattenAttrs (cfg.modules.homeManager or { }))
|
(flattenAttrs (cfg.modules.homeManager or { }))
|
||||||
];
|
];
|
||||||
|
|
|
@ -18,6 +18,7 @@ let
|
||||||
nixosSystem {
|
nixosSystem {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
|
inherit (cfg) manifest;
|
||||||
hostName = name;
|
hostName = name;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue