summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSilas Schöffel <sils@sils.li>2024-06-02 14:45:33 +0200
committerSilas Schöffel <sils@sils.li>2024-06-02 14:45:33 +0200
commit2e40cb3f38403115984eb3bbe609f43c9614c8ad (patch)
treea5d4c9b8b8ca39eafc790f77da7a346797377961
parentsys/desktop: remove (diff)
downloadnix-config-2e40cb3f38403115984eb3bbe609f43c9614c8ad.tar.gz
nix-config-2e40cb3f38403115984eb3bbe609f43c9614c8ad.zip
environment: init module
-rw-r--r--modules/nixos/sils/default.nix1
-rw-r--r--modules/nixos/sils/environment.nix45
-rw-r--r--modules/nixos/sils/roles.nix1
-rw-r--r--sys/default.nix1
-rw-r--r--sys/environment/default.nix36
5 files changed, 47 insertions, 37 deletions
diff --git a/modules/nixos/sils/default.nix b/modules/nixos/sils/default.nix
index 0098644..9324c46 100644
--- a/modules/nixos/sils/default.nix
+++ b/modules/nixos/sils/default.nix
@@ -2,6 +2,7 @@
   imports = [
     ./basesystem.nix
     ./bluetooth.nix
+    ./environment.nix
     ./hyprland.nix
     ./meta.nix
     ./networking.nix
diff --git a/modules/nixos/sils/environment.nix b/modules/nixos/sils/environment.nix
new file mode 100644
index 0000000..0ffa422
--- /dev/null
+++ b/modules/nixos/sils/environment.nix
@@ -0,0 +1,45 @@
+{
+  config,
+  lib,
+  ...
+}: let
+  cfg = config.sils.environment;
+in {
+  options.sils.environment.enable = lib.mkEnableOption "custom env vars";
+  config = lib.mkIf cfg.enable {
+    environment = {
+      sessionVariables = {
+        XDG_CACHE_HOME = "\${HOME}/.cache";
+        XDG_CONFIG_HOME = "\${HOME}/.config";
+        XDG_BIN_HOME = "\${HOME}/.local/bin";
+        XDG_DATA_HOME = "\${HOME}/.local/share";
+        XDG_STATE_HOME = "\${HOME}/.local/state";
+        ZDOTDIR = "\${HOME}/.config/zsh";
+        CARGO_HOME = "\${HOME}/.local/share/cargo";
+        ANDROID_HOME = "\${HOME}/.local/share/android";
+        ANSIBLE_HOME = "\${HOME}/.local/share/ansible";
+        #_JAVA_OPTIONS	= '-Djava.util.prefs.userRoot="\${XDG_CONFIG_HOME}/java"';
+        WINEPREFIX = "\${HOME}/.local/share/wine";
+        GRADLE_USER_HOME = "\${HOME}/.local/share/gradle";
+        GTK2_RC_FILES = "\${HOME}/.config/gtk-2.0/gtkrc";
+        EDITOR = "nvim";
+        GOPATH = "\${HOME}/.local/share/go";
+        XCOMPOSECACHE = "\${HOME}/.cache/X11/xcompose";
+        CDPATH = ".:\${HOME}:\${HOME}/repos/:\${HOME}/srv";
+        NIXOS_OZONE_WL = "1"; # wayland for electron apps
+
+        #PYTHONSTARTUP="/etc/python/pythonrc";
+
+        PATH = [
+          "\${XDG_BIN_HOME}"
+        ];
+      };
+      etc.crypttab = {
+        enable = true;
+        text = ''
+          storage UUID=f4ba9aae-e34f-4a72-98ab-88787f7c1986 none tpm2-device=auto,noauto
+        '';
+      };
+    };
+  };
+}
diff --git a/modules/nixos/sils/roles.nix b/modules/nixos/sils/roles.nix
index bd7cb50..8ab2df3 100644
--- a/modules/nixos/sils/roles.nix
+++ b/modules/nixos/sils/roles.nix
@@ -6,6 +6,7 @@ in {
     then {
       basesystem.enable = true;
       bluetooth.enable = true;
+      environment.enable = true;
       hyprland.enable = true;
       networking.enable = true;
       nix-config.enable = true;
diff --git a/sys/default.nix b/sys/default.nix
index a6ccb88..18698e2 100644
--- a/sys/default.nix
+++ b/sys/default.nix
@@ -1,6 +1,5 @@
 {...}: {
   imports = [
-    ./environment
     ./font
     ./impermanence
     ./keyboard
diff --git a/sys/environment/default.nix b/sys/environment/default.nix
deleted file mode 100644
index e5b8c69..0000000
--- a/sys/environment/default.nix
+++ /dev/null
@@ -1,36 +0,0 @@
-{lib, ...}: {
-  environment = {
-    sessionVariables = {
-      XDG_CACHE_HOME = "\${HOME}/.cache";
-      XDG_CONFIG_HOME = "\${HOME}/.config";
-      XDG_BIN_HOME = "\${HOME}/.local/bin";
-      XDG_DATA_HOME = "\${HOME}/.local/share";
-      XDG_STATE_HOME = "\${HOME}/.local/state";
-      ZDOTDIR = "\${HOME}/.config/zsh";
-      CARGO_HOME = "\${HOME}/.local/share/cargo";
-      ANDROID_HOME = "\${HOME}/.local/share/android";
-      ANSIBLE_HOME = "\${HOME}/.local/share/ansible";
-      #_JAVA_OPTIONS	= '-Djava.util.prefs.userRoot="\${XDG_CONFIG_HOME}/java"';
-      WINEPREFIX = "\${HOME}/.local/share/wine";
-      GRADLE_USER_HOME = "\${HOME}/.local/share/gradle";
-      GTK2_RC_FILES = "\${HOME}/.config/gtk-2.0/gtkrc";
-      EDITOR = "nvim";
-      GOPATH = "\${HOME}/.local/share/go";
-      XCOMPOSECACHE = "\${HOME}/.cache/X11/xcompose";
-      CDPATH = ".:\${HOME}:\${HOME}/repos/:\${HOME}/srv";
-      NIXOS_OZONE_WL = "1"; # wayland for electron apps
-
-      #PYTHONSTARTUP="/etc/python/pythonrc";
-
-      PATH = [
-        "\${XDG_BIN_HOME}"
-      ];
-    };
-    etc.crypttab = {
-      enable = true;
-      text = ''
-        storage UUID=f4ba9aae-e34f-4a72-98ab-88787f7c1986 none tpm2-device=auto,noauto
-      '';
-    };
-  };
-}