about summary refs log tree commit diff
path: root/modules/common/profiles/dev/default.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
committerAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
commit91fb4f28ef5d87e8bcf7749928d30ba4a9cbbd34 (patch)
treee07291fcb1cf62a561ffe58d1fd8e2968ff6fcb3 /modules/common/profiles/dev/default.nix
parent2023-02-15 (diff)
2023-02-19
Diffstat (limited to 'modules/common/profiles/dev/default.nix')
-rw-r--r--modules/common/profiles/dev/default.nix89
1 files changed, 89 insertions, 0 deletions
diff --git a/modules/common/profiles/dev/default.nix b/modules/common/profiles/dev/default.nix
new file mode 100644
index 0000000..b05aeac
--- /dev/null
+++ b/modules/common/profiles/dev/default.nix
@@ -0,0 +1,89 @@
+{
+  config,
+  lib,
+  pkgs,
+  this,
+  ...
+}:
+with lib; let
+  cfg = config.nixfiles.modules.profiles.dev.default;
+in {
+  imports = [
+    ./containers.nix
+    ./sql.nix
+  ];
+
+  options.nixfiles.modules.profiles.dev.default.enable =
+    mkEnableOption "Catch-all profile for stuff related to software development and etc.";
+
+  config = mkIf cfg.enable {
+    nixfiles.modules = {
+      bat.enable = true;
+      curl.enable = true;
+      direnv.enable = true;
+      git.client.enable = true;
+      gnupg.enable = true;
+      nmap.enable = true;
+      wget.enable = true;
+    };
+
+    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) ${author-name} <${author-email}>";
+            github-username = my.username;
+          };
+        };
+
+        ".stack/global-project/stack.yaml".text = generators.toYAML {} {
+          packages = [];
+          resolver = "lts-20.3";
+        };
+      };
+
+      sessionVariables = with config.dirs; rec {
+        CABAL_DIR = "${config.my.home}/.cabal";
+        CABAL_CONFIG = pkgs.writeText "cabal-config" ''
+          repository hackage.haskell.org
+            url: https://hackage.haskell.org/
+            secure: True
+
+          jobs: $ncpus
+
+          remote-repo-cache: ${CABAL_DIR}/packages
+
+          world-file: ${CABAL_DIR}/world
+
+          logs-dir: ${CABAL_DIR}/logs
+          build-summary: ${CABAL_DIR}/logs/build.log
+
+          installdir: ${CABAL_DIR}/bin
+          extra-prog-path: ${CABAL_DIR}/bin
+        '';
+
+        STACK_ROOT = "${config.my.home}/.stack";
+
+        CARGO_HOME = "${config.my.home}/.cargo";
+
+        GOPATH = "${config.my.home}/.go";
+
+        PYTHONSTARTUP = ./pystartup.py;
+      };
+
+      packages = with pkgs; [
+        htmlq
+        jq
+        yq
+      ];
+    };
+  };
+}

Consider giving Nix/NixOS a try! <3