From 0cf00f5fbf8a2f8a1e5df59d7dbbb51742d15ee9 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Thu, 1 Feb 2024 13:27:30 +0100 Subject: [PATCH] Move rofi and emacs to home config --- .dotter/local.laptop.toml | 2 +- homes/x86_64-linux/julian@aspi/default.nix | 3 +- modules/home/emacs/default.nix | 35 +++++++++++++++++++ .../home}/emacs/doom/config.el | 0 {non-nix => modules/home}/emacs/doom/init.el | 0 .../home}/emacs/doom/org-agenda-files | 0 .../home}/emacs/doom/packages.el | 0 .../doom/snippets/latex-mode/dof-acronym | 7 ++++ .../emacs/doom/snippets/latex-mode/equation | 10 ++++++ {non-nix/i3 => modules/home}/rofi/config.rasi | 0 modules/home/rofi/default.nix | 9 ++--- 11 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 modules/home/emacs/default.nix rename {non-nix => modules/home}/emacs/doom/config.el (100%) rename {non-nix => modules/home}/emacs/doom/init.el (100%) rename {non-nix => modules/home}/emacs/doom/org-agenda-files (100%) rename {non-nix => modules/home}/emacs/doom/packages.el (100%) create mode 100644 modules/home/emacs/doom/snippets/latex-mode/dof-acronym create mode 100644 modules/home/emacs/doom/snippets/latex-mode/equation rename {non-nix/i3 => modules/home}/rofi/config.rasi (100%) diff --git a/.dotter/local.laptop.toml b/.dotter/local.laptop.toml index e6091c3..dca3c4c 100644 --- a/.dotter/local.laptop.toml +++ b/.dotter/local.laptop.toml @@ -1,2 +1,2 @@ includes = [".dotter/laptop.toml"] -packages = ["emacs", "i3"] +packages = ["i3"] diff --git a/homes/x86_64-linux/julian@aspi/default.nix b/homes/x86_64-linux/julian@aspi/default.nix index d19fe49..8f11dfd 100644 --- a/homes/x86_64-linux/julian@aspi/default.nix +++ b/homes/x86_64-linux/julian@aspi/default.nix @@ -31,8 +31,9 @@ config, ... }: { topgrade.enable = true; neovim.enable = true; alacritty.enable = true; + emacs.enable = true; # i3.enable = true; - # rofi.enable = true; + rofi.enable = true; }; home.packages = with pkgs; [ diff --git a/modules/home/emacs/default.nix b/modules/home/emacs/default.nix new file mode 100644 index 0000000..ce2a6f7 --- /dev/null +++ b/modules/home/emacs/default.nix @@ -0,0 +1,35 @@ +{ +# Snowfall Lib provides a customized `lib` instance with access to your flake's library +# as well as the libraries available from your flake's inputs. +lib, +# An instance of `pkgs` with your overlays and packages applied is also available. +pkgs, +# You also have access to your flake's inputs. +inputs, + +# Additional metadata is provided by Snowfall Lib. +system, # The system architecture for this host (eg. `x86_64-linux`). +target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). +format, # A normalized name for the system target (eg. `iso`). +virtual +, # A boolean to determine whether this system is a virtual target using nixos-generators. +systems, # An attribute map of your defined hosts. + +# All other arguments come from the module system. +config, ... }: + +with lib; + +let cfg = config.modules.emacs; +in { + options.modules.emacs = { enable = mkOption { default = false; }; }; + + config = mkIf cfg.enable { + home.file = { + ".config/doom" = { + source = ./doom; + recursive = false; + }; + }; + }; +} diff --git a/non-nix/emacs/doom/config.el b/modules/home/emacs/doom/config.el similarity index 100% rename from non-nix/emacs/doom/config.el rename to modules/home/emacs/doom/config.el diff --git a/non-nix/emacs/doom/init.el b/modules/home/emacs/doom/init.el similarity index 100% rename from non-nix/emacs/doom/init.el rename to modules/home/emacs/doom/init.el diff --git a/non-nix/emacs/doom/org-agenda-files b/modules/home/emacs/doom/org-agenda-files similarity index 100% rename from non-nix/emacs/doom/org-agenda-files rename to modules/home/emacs/doom/org-agenda-files diff --git a/non-nix/emacs/doom/packages.el b/modules/home/emacs/doom/packages.el similarity index 100% rename from non-nix/emacs/doom/packages.el rename to modules/home/emacs/doom/packages.el diff --git a/modules/home/emacs/doom/snippets/latex-mode/dof-acronym b/modules/home/emacs/doom/snippets/latex-mode/dof-acronym new file mode 100644 index 0000000..a360ac4 --- /dev/null +++ b/modules/home/emacs/doom/snippets/latex-mode/dof-acronym @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: dof acronym +# uuid: dof +# key: dof +# condition: t +# -- +\ac{DOF} \ No newline at end of file diff --git a/modules/home/emacs/doom/snippets/latex-mode/equation b/modules/home/emacs/doom/snippets/latex-mode/equation new file mode 100644 index 0000000..2c436a4 --- /dev/null +++ b/modules/home/emacs/doom/snippets/latex-mode/equation @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: equation +# uuid: eq +# key: eq +# condition: t +# -- +\begin{equation} + \label{eqn:$1} + $0 +\end{equation} diff --git a/non-nix/i3/rofi/config.rasi b/modules/home/rofi/config.rasi similarity index 100% rename from non-nix/i3/rofi/config.rasi rename to modules/home/rofi/config.rasi diff --git a/modules/home/rofi/default.nix b/modules/home/rofi/default.nix index 6627686..54bcf37 100644 --- a/modules/home/rofi/default.nix +++ b/modules/home/rofi/default.nix @@ -25,10 +25,11 @@ in { options.modules.rofi = { enable = mkOption { default = false; }; }; config = mkIf cfg.enable { - programs.rofi = { enable = true; }; + # this would need you to config rofi using home-manager + # programs.rofi = { enable = true; }; - home.file = { - ".config/rofi/config.rasi".source = ../../i3/rofi/config.rasi; - }; + home.packages = with pkgs; [ rofi ]; + + home.file = { ".config/rofi/config.rasi".source = ./config.rasi; }; }; }