From 27b66ec830e09413edcdca6c54f69f580800b8c7 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Wed, 10 Jul 2024 08:17:30 +0200 Subject: [PATCH] feat: use user and theme attributes --- flake.nix | 8 ++++++-- horsch/bat.nix | 4 ++-- horsch/git.nix | 6 +++--- horsch/home.nix | 6 +++--- horsch/neovim/default.nix | 4 ++-- private/home.nix | 6 +++--- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 50e0349..09c265e 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,9 @@ ]; extraSpecialArgs = { - username = "mandlm"; + user = "mandlm"; + userName = "Michael Mandl"; + userEmail = "mandlm@molez.net"; theme = "dark"; }; }; @@ -37,7 +39,9 @@ ]; extraSpecialArgs = { - username = "mmandl"; + user = "mmandl"; + userName = "Michael Mandl"; + userEmail = "michael.mandl@horsch.com"; theme = "dark"; }; }; diff --git a/horsch/bat.nix b/horsch/bat.nix index 4e4b56a..6583e65 100644 --- a/horsch/bat.nix +++ b/horsch/bat.nix @@ -1,7 +1,7 @@ -{ ... }: +{ theme, ... }: let - theme_name = "Solarized (dark)"; + theme_name = "Solarized (${theme})"; in { programs = { diff --git a/horsch/git.nix b/horsch/git.nix index b843736..1fb9730 100644 --- a/horsch/git.nix +++ b/horsch/git.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, userName, userEmail, ... }: { programs = { @@ -7,8 +7,8 @@ git = { enable = true; - userName = "Michael Mandl"; - userEmail = "michael.mandl@horsch.com"; + inherit userName; + inherit userEmail; signing = { key = "088ED38F036C7AF2"; diff --git a/horsch/home.nix b/horsch/home.nix index 84f0575..1364f46 100644 --- a/horsch/home.nix +++ b/horsch/home.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: +{ pkgs, user, ... }: { - home.username = "mmandl"; - home.homeDirectory = "/home/mmandl"; + home.username = user; + home.homeDirectory = "/home/${user}"; home.stateVersion = "24.05"; # Please read the comment before changing. diff --git a/horsch/neovim/default.nix b/horsch/neovim/default.nix index c1501e2..d144971 100644 --- a/horsch/neovim/default.nix +++ b/horsch/neovim/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, theme, ... }: let pkg_src = pkgs; in @@ -160,7 +160,7 @@ in ${builtins.readFile ./telescope.lua } ${builtins.readFile ./themes.lua } - vim.opt.background = 'dark' + vim.opt.background = '${theme}' ${builtins.readFile ./project-nvim.lua } ${builtins.readFile ./dap.lua } diff --git a/private/home.nix b/private/home.nix index b7b354c..45080d4 100644 --- a/private/home.nix +++ b/private/home.nix @@ -1,8 +1,8 @@ -{ pkgs, username, ... }: +{ pkgs, user, ... }: { - home.username = "${username}"; - home.homeDirectory = "/home/${username}"; + home.username = user; + home.homeDirectory = "/home/${user}"; home.stateVersion = "24.05"; # Please read the comment before changing.