Compare commits

...

2 commits

Author SHA1 Message Date
Payas Relekar
4a2f00c222 meta: reindent flake.nix (as per nix-ts-mode) 2023-11-11 16:37:49 +05:30
Payas Relekar
b515b7a807 doom: replace Nix module with nix-ts-mode custom config
The new config is much smaller, the new mode uses native tree-sitter
integration, and appears to be actively developed. It does not have all
the features as the doom module, but I didn't seem to use any of it
anyway.
2023-11-11 16:35:45 +05:30
3 changed files with 151 additions and 136 deletions

253
flake.nix
View file

@ -36,154 +36,153 @@
./modules/common.nix
./modules/fish.nix
];
in
{
overlay = final: prev: {
inherit (nixpkgs-pihole.legacyPackages.${prev.system})
in
{
overlay = final: prev: {
inherit (nixpkgs-pihole.legacyPackages.${prev.system})
pihole pihole-ftl pihole-adminlte;
};
};
homeConfigurations."payasrelekar" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-darwin";
};
modules = [ ./hosts/charles/home.nix ];
homeConfigurations."payasrelekar" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-darwin";
};
modules = [ ./hosts/charles/home.nix ];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
};
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
};
nixosConfigurations = {
nixosConfigurations = {
# The Workhorse: WSL2 edition
hermes = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = common-modules ++ [
# The Workhorse: WSL2 edition
hermes = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = common-modules ++ [
# Modules and module config
./modules/users.nix
./modules/fonts.nix
./modules/plasma-desktop.nix
./modules/audio.nix
# Modules and module config
./modules/users.nix
./modules/fonts.nix
./modules/plasma-desktop.nix
./modules/audio.nix
# Host-specific config
./hosts/hermes/configuration.nix
./hosts/hermes/syncthing.nix
agenix.nixosModules.age
./hosts/hermes/secrets/agenix.nix
# Host-specific config
./hosts/hermes/configuration.nix
./hosts/hermes/syncthing.nix
agenix.nixosModules.age
./hosts/hermes/secrets/agenix.nix
# User-specific config
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users = {
payas = import ./hosts/hermes/home.nix;
root = import ./modules/root-home.nix;
# User-specific config
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users = {
payas = import ./hosts/hermes/home.nix;
root = import ./modules/root-home.nix;
};
};
};
}
];
};
}
];
};
# GPD MicroPC
phoebe = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = common-modules ++ [
# GPD MicroPC
phoebe = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = common-modules ++ [
# Modules and module config
./modules/users.nix
./modules/fonts.nix
./modules/plasma-desktop.nix
./modules/audio.nix
# Modules and module config
./modules/users.nix
./modules/fonts.nix
./modules/plasma-desktop.nix
./modules/audio.nix
# Host-specific config
nixos-hardware.nixosModules.gpd-micropc
./hosts/phoebe/configuration.nix
./hosts/phoebe/syncthing.nix
agenix.nixosModules.age
./hosts/phoebe/secrets/agenix.nix
# Host-specific config
nixos-hardware.nixosModules.gpd-micropc
./hosts/phoebe/configuration.nix
./hosts/phoebe/syncthing.nix
agenix.nixosModules.age
./hosts/phoebe/secrets/agenix.nix
# User-specific config
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users = {
payas = import ./hosts/phoebe/home.nix;
root = import ./modules/root-home.nix;
# User-specific config
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users = {
payas = import ./hosts/phoebe/home.nix;
root = import ./modules/root-home.nix;
};
};
};
}
];
};
}
];
};
# My Pi
bebop = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = common-modules ++ [
# My Pi
bebop = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = common-modules ++ [
{ nixpkgs.overlays = [ self.overlay ]; }
"${nixpkgs-pihole}/nixos/modules/services/networking/pihole-ftl.nix"
"${nixpkgs-pihole}/nixos/modules/services/web-apps/pihole-adminlte.nix"
{ nixpkgs.overlays = [ self.overlay ]; }
"${nixpkgs-pihole}/nixos/modules/services/networking/pihole-ftl.nix"
"${nixpkgs-pihole}/nixos/modules/services/web-apps/pihole-adminlte.nix"
# Modules and module config
./modules/mail.nix
./modules/monitoring/monitoring.nix
./modules/books.nix
./modules/paperless.nix
./modules/minio.nix
./modules/plausible.nix
./modules/vaultwarden.nix
./modules/hledger.nix
./modules/etesync.nix
./modules/uptime_kuma.nix
./modules/rss.nix
./modules/wiki.nix
# Modules and module config
./modules/mail.nix
./modules/monitoring/monitoring.nix
./modules/books.nix
./modules/paperless.nix
./modules/minio.nix
./modules/plausible.nix
./modules/vaultwarden.nix
./modules/hledger.nix
./modules/etesync.nix
./modules/uptime_kuma.nix
./modules/rss.nix
./modules/wiki.nix
# Host-specific config
nixos-hardware.nixosModules.raspberry-pi-4
./hosts/bebop/configuration.nix
./hosts/bebop/syncthing.nix
./hosts/bebop/navidrome.nix
./hosts/bebop/pihole.nix
./hosts/bebop/ssh.nix
./hosts/bebop/cloudflared.nix
./hosts/bebop/gitea.nix
# Host-specific config
nixos-hardware.nixosModules.raspberry-pi-4
./hosts/bebop/configuration.nix
./hosts/bebop/syncthing.nix
./hosts/bebop/navidrome.nix
./hosts/bebop/pihole.nix
./hosts/bebop/ssh.nix
./hosts/bebop/cloudflared.nix
./hosts/bebop/gitea.nix
agenix.nixosModules.age
./hosts/bebop/secrets/agenix.nix
agenix.nixosModules.age
./hosts/bebop/secrets/agenix.nix
# User-specific config : Home-manager
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.payas = import ./hosts/bebop/home.nix;
};
}
];
};
};
deploy.nodes = {
bebop = {
hostname = "bebop";
fastConnection = true;
remoteBuild = true;
profiles.system = {
sshUser = "payas";
user = "root";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.bebop;
# User-specific config : Home-manager
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.payas = import ./hosts/bebop/home.nix;
};
}
];
};
};
};
# This is highly advised, and will prevent many possible mistakes
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
deploy.nodes = {
bebop = {
hostname = "bebop";
fastConnection = true;
remoteBuild = true;
profiles.system = {
sshUser = "payas";
user = "root";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.bebop;
};
};
};
# This is highly advised, and will prevent many possible mistakes
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
}

View file

@ -191,6 +191,17 @@ Tangle ~packages.el~ from within org-mode.
:recipe (:type git :host github :repo "gleam-lang/gleam-mode"))
(package! eat)
(package! nix-ts-mode)
(package! nix3
:recipe (:type git :host github :repo "emacs-twist/nix3.el"))
(package! magit-nix3
:recipe (:type git
:host github
:repo "emacs-twist/nix3.el"
:files ("extra/magit-nix3.el")))
#+end_src
* Modus-themes
Customize Modus-themes a little to make it more peppy and vibrant.
@ -925,12 +936,17 @@ All the modifications that are necessary enough to exist, but not big enough to
#+end_src
** Nix
- Use ~nixpkgs-fmt~ for .nix file formatting
Nixpkgs PRs use this instead of ~nixfmt~ and gave me many a wondering annoyances on my PRs. So fudge it, I'm switching to it full-time.
#+begin_src emacs-lisp :lexical t
(use-package! nix-mode
:custom
(nix-nixfmt-bin "nixpkgs-fmt" "Path to nixfmt executable."))
(after! tramp
(add-to-list 'tramp-remote-path "/run/current-system/sw/bin"))
(use-package! nix-ts-mode
:mode "\\.nix\\'"
:init
;; Treat flake.lock files as json
(add-to-list 'auto-mode-alist (cons "/flake\\.lock\\'" 'json-ts-mode))
:config
(add-hook 'nix-ts-mode-hook #'eglot-ensure'append))
#+end_src
** EditorConfig
@ -1102,7 +1118,7 @@ When Emacs is opened in Windows Subsystem for Linux, open web links in Firefox o
;; You can manually enable Combobulate with `M-x
;; combobulate-mode'.
:after (treesit)
:hook ((nix-mode . combobulate-mode)
:hook ((nix-ts-mode . combobulate-mode)
(python-ts-mode . combobulate-mode)
(js-ts-mode . combobulate-mode)
(css-ts-mode . combobulate-mode)

View file

@ -168,9 +168,9 @@
lua ; one-based indices? one-based indices
;;markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
(nix ; I hereby declare "nix geht mehr!"
+lsp
+tree-sitter)
;;(nix ; I hereby declare "nix geht mehr!"
;; +lsp
;; +tree-sitter)
;;ocaml ; an objective camel
(org ; organize your plain life in plain text
+babel ; run inline code from org files