From 5b08244f11a2d953fa834dd34fe0464a683c1b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Tue, 19 Nov 2024 01:37:56 +0100 Subject: [PATCH] :lipstick: Customized emacs with a minimal configuration --- #flake.nix# | 120 +++++++++++++++++++++++++ docs/docs/tasks.md | 2 +- modules/home/editors/emacs/default.nix | 7 ++ 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 #flake.nix# diff --git a/#flake.nix# b/#flake.nix# new file mode 100644 index 0000000..9d441fe --- /dev/null +++ b/#flake.nix# @@ -0,0 +1,120 @@ +{ + description = "theobori's Nix/NixOS Config"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11-small"; + + # We assume this version of nixpkgs is more updated than the `nixpkgs` input. + # Will be used within overlay to get the latest version of specific packages. + unstable.url = "github:nixos/nixpkgs"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nur = { + url = "github:nix-community/NUR"; + }; + + snowfall-lib = { + url = "github:snowfallorg/lib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixos-hardware = { + url = "github:nixos/nixos-hardware"; + }; + + sops-nix = { + url = "github:mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + stylix.url = "github:danth/stylix"; + nixgl.url = "github:nix-community/nixGL"; + nix-index-database.url = "github:nix-community/nix-index-database"; + + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixos-anywhere = { + url = "github:numtide/nixos-anywhere"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.disko.follows = "disko"; + }; + + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix"; + + mkdocs-flake.url = "github:applicative-systems/mkdocs-flake"; + + nixcord.url = "github:kaylorben/nixcord"; + + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + }; + + outputs = + inputs: + let + lib = inputs.snowfall-lib.mkLib { + inherit inputs; + src = ./.; + + snowfall = { + metadata = "theobori-nix"; + namespace = "theobori-nix"; + meta = { + name = "theobori-nix"; + title = "theobori's Nix Flake"; + }; + }; + }; + in + lib.mkFlake { + channels-config = { + allowUnfree = true; + }; + + overlays = with inputs; [ + nur.overlay + nixgl.overlay + ]; + + homes.modules = with inputs; [ + nix-index-database.hmModules.nix-index + stylix.homeManagerModules.stylix + sops-nix.homeManagerModules.sops + nixcord.homeManagerModules.nixcord + plasma-manager.homeManagerModules.plasma-manager + ]; + + systems = { + modules = { + nixos = with inputs; [ + stylix.nixosModules.stylix + home-manager.nixosModules.home-manager + disko.nixosModules.disko + ]; + }; + }; + + outputs-builder = channels: { formatter = channels.nixpkgs.nixfmt-rfc-style; }; + + templates = { + xdp-c.description = "My template for building a XDP program in C"; + python.description = "My template for a base project in Python"; + latex.description = "My template for a base project in Latex"; + }; + }; +} diff --git a/docs/docs/tasks.md b/docs/docs/tasks.md index eb91be9..fd10f78 100644 --- a/docs/docs/tasks.md +++ b/docs/docs/tasks.md @@ -7,5 +7,5 @@ Here are a non-exhaustive list of tasks. - [x] Fix `gpg-agent` not finding a pinetry binary - [x] Support multi-user on my user nixos module - [ ] Install Steam -- [ ] Customize emacs +- [x] Customize emacs - [ ] Better email accounts management diff --git a/modules/home/editors/emacs/default.nix b/modules/home/editors/emacs/default.nix index 8086d9a..64abd0a 100644 --- a/modules/home/editors/emacs/default.nix +++ b/modules/home/editors/emacs/default.nix @@ -21,6 +21,13 @@ in enable = true; package = pkgs.emacs-nox; + + extraConfig = '' + (menu-bar-mode -1) + (global-display-line-numbers-mode) + (setq standard-indent 2) + (setq font-lock-maximum-decoration t) + ''; }; }; }