!SlMumQZnFjwLRjWFbW:nixos.org

Nix + Doom Emacs

232 Members
Running Doom Emacs with Nix | You probably want https://github.com/nix-community/nix-doom-emacs48 Servers

Load older messages


SenderMessageTime
12 Sep 2022
@k0kada:matrix.orgk0kada (he/him) * But you know, it is always that "ohh, there are so much repetition here. I know, I will create an abstraction"21:58:01
@ckie:ckie.devckie (they/them)where do you have repetition?21:58:16
@mon:tchncs.deribosomerocker thankfully i'm one of the rare programmers that rewrites their projects/configurations the moment I notice it isn't as good as i want it to be :P 21:58:19
@mon:tchncs.deribosomerocker it's been small until now, though im not really a giant nix nerd 21:58:39
@ckie:ckie.devckie (they/them)

i have this everywhere:

    services.nginx = {
      virtualHosts."${cfg.host}" = {
       # …
        extraConfig = ''
          access_log /var/log/nginx/foo.access.log;
        '';
      };
    };
    cookie.services.prometheus.nginx-vhosts = [ "foo" ];
21:59:23
@k0kada:matrix.orgk0kada (he/him)
In reply to @ckie:ckie.dev
where do you have repetition?
The one that I am lamenting right now to have abstract
21:59:32
@k0kada:matrix.orgk0kada (he/him)Is the fact that I needed to declare the hostname twice21:59:39
@ckie:ckie.devckie (they/them)well that is dumb!21:59:50
@ckie:ckie.devckie (they/them)config.networking.hostName!21:59:53
@ckie:ckie.devckie (they/them)spray that shit everywhere21:59:56
@k0kada:matrix.orgk0kada (he/him)
In reply to @ckie:ckie.dev
config.networking.hostName!
Not this
22:00:09
@mon:tchncs.deribosomerocker
In reply to@k0kada:matrix.org
Ok, this is not working, let me fix it
if it requires mkMerge, then I think we should go back to the specialArguments solution since it's really elegant IMO
22:00:21
@k0kada:matrix.orgk0kada (he/him)I mean, one for that config22:00:20
@k0kada:matrix.orgk0kada (he/him) Another one for the nixosConfiguration.${hostname} 22:00:33
@k0kada:matrix.orgk0kada (he/him)I had the brilliant idea to create a function that returned a attrset just to avoid this22:00:51
@ckie:ckie.devckie (they/them)you're supposed to do _module.args in a module now22:00:55
@k0kada:matrix.orgk0kada (he/him)And know I am really lamenting my life choices...22:01:00
@mon:tchncs.deribosomerocker
In reply to@ckie:ckie.dev
you're supposed to do _module.args in a module now
i used to do that but i switched it for specialArguments
22:01:16
@mon:tchncs.deribosomerocker since the latter is much more readable 22:01:26
@ckie:ckie.devckie (they/them) k0kada: that seems probably reasonable 22:01:54
@k0kada:matrix.orgk0kada (he/him)
{
  description = "nix-doom-emacs in NixOS+HM example";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    home-manager.url = "github:nix-community/home-manager";
    nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
  };

  outputs =
    { self
    , nixpkgs
    , home-manager
    , nix-doom-emacs
    , ...
    }:
    {
      nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          home-manager.nixosModules.home-manager
          {
            home-manager.users.exampleUser = { ... }: {
              imports = [ nix-doom-emacs.hmModule ];
              programs.doom-emacs = {
                enable = true;
                doomPrivateDir = true;
              };
            };
          }
        ];
      };
    };
}
22:01:57
@k0kada:matrix.orgk0kada (he/him)This will not work but should at least eval22:02:05
@k0kada:matrix.orgk0kada (he/him)Having a proper example will need much more useless things22:02:14
@mon:tchncs.deribosomerocker oh wait, can't we just add nix-doom-emacs.hmModule to the modules list? 22:02:35
@k0kada:matrix.orgk0kada (he/him) And of course, set doomPrivateDir for something 22:02:36
@ckie:ckie.devckie (they/them)i think it'd be cool if we had a nixos test for fun22:02:41
@k0kada:matrix.orgk0kada (he/him)
In reply to @mon:tchncs.de
oh wait, can't we just add nix-doom-emacs.hmModule to the modules list?
nde.hmModule is a home-manager module
22:02:56
@k0kada:matrix.orgk0kada (he/him)Not a NixOS one22:02:59
@ckie:ckie.devckie (they/them) start graphical doom, nix-shell '<nixpkgs>' --run unpackPhase -A hello emacs SPC pp hello RET 22:03:39
@ckie:ckie.devckie (they/them) * nix-shell '<nixpkgs>' --run unpackPhase -A hello emacs SPC pp hello RET 22:03:44

Show newer messages


Back to Room ListRoom Version: 9