| 12 Sep 2022 |
k0kada (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 (they/them) | where do you have repetition? | 21:58:16 |
ribosomerocker | 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 |
ribosomerocker | it's been small until now, though im not really a giant nix nerd | 21:58:39 |
ckie (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 (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 (he/him) | Is the fact that I needed to declare the hostname twice | 21:59:39 |
ckie (they/them) | well that is dumb! | 21:59:50 |
ckie (they/them) | config.networking.hostName! | 21:59:53 |
ckie (they/them) | spray that shit everywhere | 21:59:56 |
k0kada (he/him) | In reply to @ckie:ckie.dev config.networking.hostName! Not this | 22:00:09 |
ribosomerocker | 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 (he/him) | I mean, one for that config | 22:00:20 |
k0kada (he/him) | Another one for the nixosConfiguration.${hostname} | 22:00:33 |
k0kada (he/him) | I had the brilliant idea to create a function that returned a attrset just to avoid this | 22:00:51 |
ckie (they/them) | you're supposed to do _module.args in a module now | 22:00:55 |
k0kada (he/him) | And know I am really lamenting my life choices... | 22:01:00 |
ribosomerocker | 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 |
ribosomerocker | since the latter is much more readable | 22:01:26 |
ckie (they/them) | k0kada: that seems probably reasonable | 22:01:54 |
k0kada (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 (he/him) | This will not work but should at least eval | 22:02:05 |
k0kada (he/him) | Having a proper example will need much more useless things | 22:02:14 |
ribosomerocker | oh wait, can't we just add nix-doom-emacs.hmModule to the modules list? | 22:02:35 |
k0kada (he/him) | And of course, set doomPrivateDir for something | 22:02:36 |
ckie (they/them) | i think it'd be cool if we had a nixos test for fun | 22:02:41 |
k0kada (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 (he/him) | Not a NixOS one | 22:02:59 |
ckie (they/them) | start graphical doom, nix-shell '<nixpkgs>' --run unpackPhase -A hello emacs SPC pp hello RET | 22:03:39 |
ckie (they/them) | * nix-shell '<nixpkgs>' --run unpackPhase -A hello emacs SPC pp hello RET | 22:03:44 |