about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/common/default.nix2
-rw-r--r--modules/common/editorconfig.nix129
-rw-r--r--modules/common/neovim/default.nix27
-rw-r--r--modules/common/profiles/dev/default.nix18
-rw-r--r--modules/common/profiles/dev/editorconfig.ini96
-rw-r--r--modules/common/profiles/headful.nix1
-rw-r--r--modules/common/vscode.nix2
-rw-r--r--modules/nixos/firefox/default.nix2
-rw-r--r--modules/nixos/games/minecraft.nix4
-rw-r--r--modules/nixos/nsd.nix2
-rw-r--r--modules/nixos/vim/default.nix8
11 files changed, 139 insertions, 152 deletions
diff --git a/modules/common/default.nix b/modules/common/default.nix
index 3b42031..c6c7c81 100644
--- a/modules/common/default.nix
+++ b/modules/common/default.nix
@@ -6,6 +6,7 @@ _: {
     ./common
     ./curl.nix
     ./direnv.nix
+    ./editorconfig.nix
     ./emacs
     ./eza.nix
     ./fonts.nix
@@ -13,7 +14,6 @@ _: {
     ./gnupg.nix
     ./htop.nix
     ./mpv.nix
-    ./neovim
     ./nmap.nix
     ./openssh.nix
     ./password-store.nix
diff --git a/modules/common/editorconfig.nix b/modules/common/editorconfig.nix
new file mode 100644
index 0000000..822acf6
--- /dev/null
+++ b/modules/common/editorconfig.nix
@@ -0,0 +1,129 @@
+{
+  config,
+  lib,
+  ...
+}:
+with lib; let
+  cfg = config.nixfiles.modules.editorconfig;
+in {
+  options.nixfiles.modules.editorconfig.enable = mkEnableOption "Editorconfig";
+
+  config = mkIf cfg.enable {
+    hm.editorconfig = {
+      enable = true;
+      settings = {
+        "*" = {
+          charset = "utf-8";
+          end_of_line = "lf";
+          indent_size = 2;
+          indent_style = "space";
+          insert_final_newline = true;
+          max_line_length = 80;
+          trim_trailing_whitespace = true;
+        };
+
+        # https://google.github.io/styleguide/cppguide.html#Spaces_vs._Tabs
+        "*.{c,cc,cpp,cxx,h,hh,hpp,hxx}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://go.dev/doc/effective_go#formatting
+        "*.go" = {
+          indent_size = 2;
+          indent_style = "tab";
+        };
+
+        # https://google.github.io/styleguide/pyguide.html#s3.4-indentation
+        # https://peps.python.org/pep-0008/#indentation
+        "*.py" = {
+          indent_size = 4;
+          indent_style = "space";
+        };
+
+        # https://google.github.io/styleguide/shellguide.html#s5-formatting
+        "*.{sh,bash}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://www.haskell.org/onlinereport/haskell2010/haskellch10.html#x17-17800010.3
+        # https://en.wikibooks.org/wiki/Haskell/Indentation
+        "*.hs" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://google.github.io/styleguide/lispguide.xml#Formatting
+        "*.{lisp,cl,rkt,scm,el}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://github.com/ziglang/zig/wiki/FAQ#why-does-zig-fmt-use-spaces-instead-of-tabs
+        "*.zig" = {
+          indent_size = 4;
+          indent_style = "space";
+        };
+
+        "*.{asm,s}" = {
+          indent_size = 4;
+          indent_style = "spaces";
+        };
+
+        # https://www.gnu.org/software/make/manual/html_node/Rule-Syntax.html
+        "{Makefile*,*.mk}" = {
+          indent_size = 4;
+          indent_style = "tab";
+        };
+
+        # https://cmake-format.readthedocs.io/en/latest/configopts.html#tab-size
+        # https://cmake-format.readthedocs.io/en/latest/configopts.html#use-tabchars
+        "{CMakeLists.txt,*.cmake}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://github.com/NixOS/rfcs/pull/166
+        "*.nix" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://developer.hashicorp.com/terraform/language/syntax/style
+        "*.{tf,hcl}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        "*.{json,jsn}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://yaml.org/spec/1.2.2/#61-indentation-spaces
+        "*.{yaml,yml}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        "*.{toml,tml}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://google.github.io/styleguide/htmlcssguide.html#Indentation
+        "*.{html,css}" = {
+          indent_size = 2;
+          indent_style = "space";
+        };
+
+        # https://latexindentpl.readthedocs.io/en/latest/sec-default-user-local.html
+        "*.{tex,cls}" = {
+          indent_size = 4;
+          indent_style = "tab";
+        };
+      };
+    };
+  };
+}
diff --git a/modules/common/neovim/default.nix b/modules/common/neovim/default.nix
deleted file mode 100644
index 1e5f103..0000000
--- a/modules/common/neovim/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  config,
-  inputs,
-  lib,
-  ...
-}:
-with lib; let
-  cfg = config.nixfiles.modules.neovim;
-in {
-  options.nixfiles.modules.neovim.enable = mkEnableOption "NeoVim";
-
-  config = mkIf cfg.enable {
-    hm = {
-      imports = [inputs.nixvim.homeManagerModules.nixvim];
-
-      programs.nixvim = {
-        enable = true;
-
-        plugins = {
-          lsp.enable = true;
-          nix.enable = true;
-          surround.enable = true;
-        };
-      };
-    };
-  };
-}
diff --git a/modules/common/profiles/dev/default.nix b/modules/common/profiles/dev/default.nix
index 2d0c0f6..ecd586a 100644
--- a/modules/common/profiles/dev/default.nix
+++ b/modules/common/profiles/dev/default.nix
@@ -20,6 +20,7 @@ in {
       bat.enable = true;
       curl.enable = true;
       direnv.enable = true;
+      editorconfig.enable = true;
       git.client.enable = true;
       gnupg.enable = true;
       nmap.enable = true;
@@ -28,25 +29,9 @@ in {
 
     hm.home = {
       file = {
-        ".editorconfig".source = ./editorconfig.ini;
-
         ".gdbinit".source = ./gdbinit;
 
         ".ghc/ghci.conf".source = ./ghci.conf;
-
-        ".stack/config.yaml".text = generators.toYAML {} {
-          templates.params = rec {
-            author-name = my.fullname;
-            author-email = my.email;
-            copyright = "Copyright (c) 2023 ${author-name} <${author-email}>";
-            github-username = my.username;
-          };
-        };
-
-        ".stack/global-project/stack.yaml".text = generators.toYAML {} {
-          packages = [];
-          resolver = "lts-21.20";
-        };
       };
 
       sessionVariables = rec {
@@ -74,6 +59,7 @@ in {
         CARGO_HOME = "${config.my.home}/.cargo";
 
         GOPATH = "${config.my.home}/.go";
+        GORE_HOME = "${config.my.home}/.gore";
 
         PYTHONSTARTUP = ./pystartup.py;
       };
diff --git a/modules/common/profiles/dev/editorconfig.ini b/modules/common/profiles/dev/editorconfig.ini
deleted file mode 100644
index 87f47eb..0000000
--- a/modules/common/profiles/dev/editorconfig.ini
+++ /dev/null
@@ -1,96 +0,0 @@
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-indent_size = 4
-indent_style = space
-insert_final_newline = true
-max_line_length = 80
-trim_trailing_whitespace = true
-
-# C/C++
-[*.{c,cc,cpp,cxx,h,hh,hpp,hxx,ixx}]
-indent_size = 4
-indent_style = tab
-
-# Go
-[*.go]
-indent_size = 4
-indent_style = tab
-
-# Python
-[*.py]
-indent_size = 4
-indent_style = space
-max_line_length = 72
-
-# Haskell
-[*.hs]
-indent_size = 2
-indent_style = space
-
-# Lisp(s)
-[*.{lisp,cl,rkt,scm,el}]
-indent_size = 2
-indent_style = space
-
-# Zig
-[*.zig]
-indent_size = 4
-indent_style = tab
-
-# Assembly
-[*.{asm,s}]
-indent_size = 4
-indent_style = tab
-
-# GNU Cringetools
-[configure.ac]
-indent_size = 4
-indent_style = tab
-
-# Make
-[{Makefile*,*.mk}]
-indent_size = 4
-indent_style = tab
-
-# CMake
-[{CMakeLists.txt,*.cmake}]
-indent_size = 8
-indent_style = tab
-
-# Nix
-[*.nix]
-indent_size = 2
-indent_style = space
-
-# HCL
-[*.{tf,hcl}]
-indent_size = 2
-indent_style = space
-
-# JSON
-[*.json]
-indent_size = 2
-indent_style = space
-
-# YAML
-[*.{yaml,yml}]
-indent_size = 2
-indent_style = space
-
-# TOML
-[*.{toml,tml}]
-indent_size = 4
-indent_style = space
-
-# Markup
-[*.{html,xml}]
-indent_size = 4
-indent_style = tab
-
-# (La)TeX
-[*.{tex,cls}]
-indent_size = 4
-indent_style = tab
diff --git a/modules/common/profiles/headful.nix b/modules/common/profiles/headful.nix
index 094d5dd..dc8e1d6 100644
--- a/modules/common/profiles/headful.nix
+++ b/modules/common/profiles/headful.nix
@@ -19,7 +19,6 @@ in {
       aria2.enable = true;
       emacs.enable = true;
       mpv.enable = true;
-      neovim.enable = true;
       openssh.client.enable = true;
       password-store.enable = true;
       vscode.enable = true;
diff --git a/modules/common/vscode.nix b/modules/common/vscode.nix
index 62abcf8..074f6f2 100644
--- a/modules/common/vscode.nix
+++ b/modules/common/vscode.nix
@@ -241,6 +241,6 @@ in {
       };
     };
 
-    nixpkgs.overlays = [inputs.nix-vscode-extensions.overlays.default];
+    nixpkgs.overlays = [inputs.vscode-extensions.overlays.default];
   };
 }
diff --git a/modules/nixos/firefox/default.nix b/modules/nixos/firefox/default.nix
index 10d5e98..4c9437c 100644
--- a/modules/nixos/firefox/default.nix
+++ b/modules/nixos/firefox/default.nix
@@ -18,7 +18,7 @@ in {
     ];
 
     hm = {
-      imports = [inputs.arkenfox-nixos.hmModules.arkenfox];
+      imports = [inputs.arkenfox.hmModules.arkenfox];
 
       home.packages = with pkgs; [profile-cleaner];
 
diff --git a/modules/nixos/games/minecraft.nix b/modules/nixos/games/minecraft.nix
index e5cee32..8a1a0b5 100644
--- a/modules/nixos/games/minecraft.nix
+++ b/modules/nixos/games/minecraft.nix
@@ -8,7 +8,7 @@
 with lib; let
   cfg = config.nixfiles.modules.games.minecraft;
 in {
-  imports = [inputs.nix-minecraft.nixosModules.minecraft-servers];
+  imports = [inputs.minecraft.nixosModules.minecraft-servers];
 
   options.nixfiles.modules.games.minecraft = {
     client.enable = mkEnableOption "Minecraft client";
@@ -78,7 +78,7 @@ in {
         };
       };
 
-      nixpkgs.overlays = [inputs.nix-minecraft.overlay];
+      nixpkgs.overlays = [inputs.minecraft.overlay];
 
       my.extraGroups = [config.services.minecraft-servers.group];
     })
diff --git a/modules/nixos/nsd.nix b/modules/nixos/nsd.nix
index 2266ea5..ae72f1d 100644
--- a/modules/nixos/nsd.nix
+++ b/modules/nixos/nsd.nix
@@ -48,7 +48,7 @@ in {
         ratelimit.enable = true;
 
         zones = let
-          dns = inputs.dns-nix.lib;
+          dns = inputs.dns.lib;
         in
           with dns.combinators; let
             ips = hostname:
diff --git a/modules/nixos/vim/default.nix b/modules/nixos/vim/default.nix
index 16e2d51..2fdf064 100644
--- a/modules/nixos/vim/default.nix
+++ b/modules/nixos/vim/default.nix
@@ -2,7 +2,6 @@
   config,
   lib,
   pkgs,
-  this,
   ...
 }:
 with lib; let
@@ -11,13 +10,10 @@ in {
   config = mkIf cfg.enable {
     programs.vim.package =
       (pkgs.vim-full.override {
-        features = "normal";
         cscopeSupport = false;
         darwinSupport = false;
-        guiSupport =
-          if this.isHeadful
-          then "gtk3"
-          else false;
+        features = "normal";
+        guiSupport = "gtk3";
         luaSupport = false;
         multibyteSupport = false;
         netbeansSupport = false;

Consider giving Nix/NixOS a try! <3