Boilerplate reduction (I understand strings in nix now!)

This commit is contained in:
Emmet 2023-06-22 14:53:10 -05:00
parent c7f3327147
commit b4a0d72a92
17 changed files with 136 additions and 144 deletions

View file

@ -1,6 +1,7 @@
{ config, lib, pkgs, eaf, eaf-browser, org-nursery, myThemePolarity, ... }:
{ config, lib, pkgs, eaf, eaf-browser, org-nursery, theme, ... }:
let
myDashboardLogo = ./. + "/nix-" + myThemePolarity + ".png";
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+theme)+"/polarity.txt"));
dashboardLogo = ./. + "/nix-" + themePolarity + ".png";
in
{
programs.doom-emacs = {
@ -78,7 +79,7 @@ in
home.file.".emacs.d/org-nursery" = {
source = "${org-nursery}";
};
home.file.".emacs.d/dashboard-logo.png".source = myDashboardLogo;
home.file.".emacs.d/dashboard-logo.png".source = dashboardLogo;
home.file.".emacs.d/scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh" = {
source = ./scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh;
executable = true;

View file

@ -1409,9 +1409,10 @@ Any git package can be configured for a particular commit or branch:
* Nix Integration
In order to have Nix load my Doom Emacs configuration [[./doom.nix][doom.nix]], which I source in the =imports= block of my [[../../home.nix][home.nix]].
#+BEGIN_SRC nix :tangle doom.nix
{ config, lib, pkgs, eaf, eaf-browser, org-nursery, myThemePolarity, ... }:
{ config, lib, pkgs, eaf, eaf-browser, org-nursery, theme, ... }:
let
myDashboardLogo = ./. + "/nix-" + myThemePolarity + ".png";
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+theme)+"/polarity.txt"));
dashboardLogo = ./. + "/nix-" + themePolarity + ".png";
in
{
programs.doom-emacs = {
@ -1489,7 +1490,7 @@ in
home.file.".emacs.d/org-nursery" = {
source = "${org-nursery}";
};
home.file.".emacs.d/dashboard-logo.png".source = myDashboardLogo;
home.file.".emacs.d/dashboard-logo.png".source = dashboardLogo;
home.file.".emacs.d/scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh" = {
source = ./scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh;
executable = true;