diff --git a/flake.lock b/flake.lock index 80b0961..591c941 100644 --- a/flake.lock +++ b/flake.lock @@ -139,6 +139,27 @@ "type": "github" } }, + "emacs-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1736874824, + "narHash": "sha256-9s38tF1Eqmk1zNnZx4LOQAlVwHFT+F0q9m0z5iwDmxg=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "7a1e649ab6a73e0b8b728530318142f784b47054", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "emacs-overlay", + "type": "github" + } + }, "firefox-gnome-theme": { "flake": false, "locked": { @@ -921,6 +942,22 @@ "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1736754065, + "narHash": "sha256-hcETjfECLklW1ND8svDvN0Nw6H/1qtuoz3rbFNQ1Lrk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "67e9c880898889470f153157a96b595e758167fc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1736012469, @@ -3198,6 +3235,7 @@ "inputs": { "apple-silicon-support": "apple-silicon-support", "disko": "disko", + "emacs-overlay": "emacs-overlay", "home-manager": "home-manager", "hyprland": "hyprland", "impermanence": "impermanence", diff --git a/flake.nix b/flake.nix index 9366c88..7413014 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,10 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; }; + emacs-overlay = { + url = "github:nix-community/emacs-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 27b1422..1d99a9c 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -25,6 +25,7 @@ ./modules/sddm ./modules/services/autoupgrade ./modules/sops + ./modules/emacs ./hosts/${hwconfig.hostname} ] ++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence; diff --git a/nixos/modules/emacs/default.nix b/nixos/modules/emacs/default.nix new file mode 100644 index 0000000..7cc3647 --- /dev/null +++ b/nixos/modules/emacs/default.nix @@ -0,0 +1,42 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: let + emacs = pkgs.emacs; +in { + services.emacs.enable = true; + services.emacs.startWithGraphical = true; + services.emacs.install = true; + services.emacs.package = emacs; #pkgs.emacs-unstable + + environment.systemPackages = with pkgs; [ + git + emacs + ripgrep + fd + coreutils + clang + (pkgs.writeShellScriptBin "doom-install" '' + ${pkgs.git}/bin/git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.emacs.d + ${pkgs.git}/bin/git clone https://github.com/KyleKrein/doomemacs.git ~/.doom.d + ~/.emacs.d/bin/doom install + ~/.emacs.d/bin/doom sync + pidof emacs || ${emacs}/bin/emacs --daemon & + '') + (pkgs.writeShellScriptBin "doom-sync" '' + ~/.emacs.d/bin/doom sync + '') + (pkgs.writeShellScriptBin "doom-upgrade" '' + ~/.emacs.d/bin/doom upgrade + '') + (pkgs.writeShellScriptBin "doom" '' + ${emacs}/bin/emacsclient -c + '') + ]; + nixpkgs.overlays = [ + inputs.emacs-overlay.overlays.default + ]; +} diff --git a/nixos/modules/hyprland/hyprland.nix b/nixos/modules/hyprland/hyprland.nix index ff2341b..e2aa035 100644 --- a/nixos/modules/hyprland/hyprland.nix +++ b/nixos/modules/hyprland/hyprland.nix @@ -49,6 +49,7 @@ in { "${pkgs.clipse}/bin/clipse -listen &" "${pkgs.swww}/bin/swww-daemon &" "${pkgs.swww}/bin/swww img ${wallpaper-image} &" + "emacs --daemon &" #"${pkgs.kando}/bin/kando" ]; exec = [ diff --git a/nixos/modules/impermanence/home.nix b/nixos/modules/impermanence/home.nix index b0abe3a..0313283 100644 --- a/nixos/modules/impermanence/home.nix +++ b/nixos/modules/impermanence/home.nix @@ -20,6 +20,8 @@ ".gnupg" ".ssh" ".nixops" + ".doom.d" + ".emacs.d" ".local/share/keyrings" ".local/share/direnv" {