mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 09:28:27 +02:00
refactor: do not hardcode username/email in sub modules
This commit is contained in:
@@ -99,6 +99,9 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
username = "ryan";
|
username = "ryan";
|
||||||
|
userfullname = "Ryan Yin";
|
||||||
|
useremail = "xiaoyin_c@qq.com";
|
||||||
|
|
||||||
x64_system = "x86_64-linux";
|
x64_system = "x86_64-linux";
|
||||||
x64_darwin = "x86_64-darwin";
|
x64_darwin = "x86_64-darwin";
|
||||||
allSystems = [x64_system x64_darwin];
|
allSystems = [x64_system x64_darwin];
|
||||||
@@ -150,7 +153,7 @@
|
|||||||
system = x64_system;
|
system = x64_system;
|
||||||
specialArgs =
|
specialArgs =
|
||||||
{
|
{
|
||||||
inherit username;
|
inherit username userfullname useremail;
|
||||||
# use unstable branch for some packages to get the latest updates
|
# use unstable branch for some packages to get the latest updates
|
||||||
pkgs-unstable = import nixpkgs-unstable {
|
pkgs-unstable = import nixpkgs-unstable {
|
||||||
system = x64_system; # refer the `system` parameter form outer scope recursively
|
system = x64_system; # refer the `system` parameter form outer scope recursively
|
||||||
@@ -199,6 +202,7 @@
|
|||||||
system = x64_darwin;
|
system = x64_darwin;
|
||||||
specialArgs =
|
specialArgs =
|
||||||
{
|
{
|
||||||
|
inherit username userfullname useremail;
|
||||||
# use unstable branch for some packages to get the latest updates
|
# use unstable branch for some packages to get the latest updates
|
||||||
pkgs-unstable = import nixpkgs-unstable {
|
pkgs-unstable = import nixpkgs-unstable {
|
||||||
inherit system; # refer the `system` parameter form outer scope recursively
|
inherit system; # refer the `system` parameter form outer scope recursively
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
|
||||||
|
userfullname,
|
||||||
|
useremail,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# `programs.git` will generate the config file: ~/.config/git/config
|
# `programs.git` will generate the config file: ~/.config/git/config
|
||||||
@@ -16,8 +19,8 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
|
|
||||||
userName = "Ryan Yin";
|
userName = userfullname;
|
||||||
userEmail = "xiaoyin_c@qq.com";
|
userEmail = useremail;
|
||||||
|
|
||||||
includes = [
|
includes = [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user