about summary refs log tree commit diff
path: root/modules/profiles
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/profiles/default.nix15
-rw-r--r--modules/profiles/dev/containers.nix7
-rw-r--r--modules/profiles/dev/default.nix23
-rw-r--r--modules/profiles/dev/sql.nix11
-rw-r--r--modules/profiles/email.nix26
-rw-r--r--modules/profiles/headful.nix54
6 files changed, 87 insertions, 49 deletions
diff --git a/modules/profiles/default.nix b/modules/profiles/default.nix
index ae03bcc..cbfb665 100644
--- a/modules/profiles/default.nix
+++ b/modules/profiles/default.nix
@@ -5,20 +5,19 @@
   this,
   ...
 }:
-with lib;
 let
   cfg = config.nixfiles.modules.profiles.default;
 in
 {
-  imports = attrValues (modulesIn ./.);
+  imports = lib.modulesIn ./. |> lib.attrValues;
 
   options.nixfiles.modules.profiles.default.enable =
-    mkEnableOption "The most default profile of them all."
+    lib.mkEnableOption "The most default profile of them all."
     // {
       default = true;
     };
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     assertions = [
       {
         assertion = !(with this; isHeadless && isHeadful);
@@ -29,13 +28,13 @@ in
       }
     ];
 
-    ark.directories = [ "/var/log" ];
+    ark.directories = [
+      "/var/lib/nixos"
+      "/var/log"
+    ];
 
     nixfiles.modules = {
-      bat.enable = true;
-      eza.enable = true;
       htop.enable = true;
-      tmux.enable = true;
       vim.enable = true;
     };
 
diff --git a/modules/profiles/dev/containers.nix b/modules/profiles/dev/containers.nix
index 598289c..ce686b5 100644
--- a/modules/profiles/dev/containers.nix
+++ b/modules/profiles/dev/containers.nix
@@ -4,18 +4,17 @@
   pkgs,
   ...
 }:
-with lib;
 let
   cfg = config.nixfiles.modules.profiles.dev.containers;
 in
 {
   options.nixfiles.modules.profiles.dev.containers.enable =
-    mkEnableOption "Tools for working with containers and container orchestration"
+    lib.mkEnableOption "Tools for working with containers and container orchestration"
     // {
       default = config.nixfiles.modules.profiles.dev.enable;
     };
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     nixfiles.modules = {
       common.shell.aliases = {
         h = "helm";
@@ -63,7 +62,7 @@ in
         ];
       };
 
-      xdg.dataFile."minikube/config/config.json".text = generators.toJSON { } {
+      xdg.dataFile."minikube/config/config.json".text = lib.generators.toJSON { } {
         config.Rootless = true;
         driver = "podman";
         container-runtime = "cri-o";
diff --git a/modules/profiles/dev/default.nix b/modules/profiles/dev/default.nix
index b0755d2..89ed7a3 100644
--- a/modules/profiles/dev/default.nix
+++ b/modules/profiles/dev/default.nix
@@ -4,17 +4,21 @@
   pkgs,
   ...
 }:
-with lib;
 let
   cfg = config.nixfiles.modules.profiles.dev;
 in
 {
-  imports = attrValues (modulesIn ./.);
+  imports = lib.modulesIn ./. |> lib.attrValues;
 
-  options.nixfiles.modules.profiles.dev.enable = mkEnableOption "Catch-all profile for stuff related to software development and etc.";
+  options.nixfiles.modules.profiles.dev.enable =
+    lib.mkEnableOption "Catch-all profile for stuff related to software development and etc.";
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     nixfiles.modules = {
+      common.nix.allowedUnfreePackages = [
+        "terraform" # source-available
+      ];
+
       bat.enable = true;
       curl.enable = true;
       direnv.enable = true;
@@ -58,9 +62,13 @@ in
         };
 
         packages = with pkgs; [
+          (google-cloud-sdk.withExtraComponents [
+            google-cloud-sdk.components.gke-gcloud-auth-plugin
+          ])
           age
+          dbeaver-bin
+          devenv
           distrobox
-          google-cloud-sdk
           htmlq
           httpie
           hydra-check
@@ -69,8 +77,13 @@ in
           logcli
           nix-update
           nixpkgs-review
+          opentofu
           scaleway-cli
+          scanmem
           sops
+          sqlitebrowser
+          terraform
+          toolbox
           vultr-cli
           yq
         ];
diff --git a/modules/profiles/dev/sql.nix b/modules/profiles/dev/sql.nix
index c2d4894..cbab14a 100644
--- a/modules/profiles/dev/sql.nix
+++ b/modules/profiles/dev/sql.nix
@@ -4,18 +4,17 @@
   pkgs,
   ...
 }:
-with lib;
 let
   cfg = config.nixfiles.modules.profiles.dev.sql;
 in
 {
   options.nixfiles.modules.profiles.dev.sql.enable =
-    mkEnableOption "SQL stuff and database management tools"
+    lib.mkEnableOption "SQL stuff and database management tools"
     // {
       default = config.nixfiles.modules.profiles.dev.enable;
     };
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     hm = {
       home.packages = with pkgs; [
         pgcli
@@ -63,15 +62,15 @@ in
             { name, custom }:
             {
               "${name}/config" = {
-                text = generators.toINI { } {
+                text = lib.generators.toINI { } {
                   main = mainSection // custom;
-                  colors = mapAttrs (_: v: "'${v}'") colorsSection;
+                  colors = lib.mapAttrs (_: v: "'${v}'") colorsSection;
                 };
               };
             };
         in
         {
-          configFile = mkMerge (
+          configFile = lib.mkMerge (
             map mkCliConfig [
               {
                 name = "pgcli";
diff --git a/modules/profiles/email.nix b/modules/profiles/email.nix
index 4c8d6eb..5f142dc 100644
--- a/modules/profiles/email.nix
+++ b/modules/profiles/email.nix
@@ -5,16 +5,15 @@
   this,
   ...
 }:
-with lib;
 let
   cfg = config.nixfiles.modules.profiles.email;
 in
 {
-  options.nixfiles.modules.profiles.email.enable = mkEnableOption "Local Email management" // {
+  options.nixfiles.modules.profiles.email.enable = lib.mkEnableOption "Local Email management" // {
     default = this.isHeadful;
   };
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     nixfiles.modules.gnupg.enable = true;
 
     hm = {
@@ -25,7 +24,7 @@ in
           let
             mkAccount =
               attrs:
-              mkMerge [
+              lib.mkMerge [
                 {
                   mbsync = {
                     enable = true;
@@ -52,15 +51,15 @@ in
                 line ? 0,
               }:
               assert (builtins.isInt line);
-              concatStringsSep " " (
+              lib.concatStringsSep " " (
                 [
-                  (getExe config.hm.programs.password-store.package)
+                  (lib.getExe config.hm.programs.password-store.package)
                   "show"
                   path
                 ]
-                ++ optionals (line > 0) [
+                ++ lib.optionals (line > 0) [
                   "|"
-                  (getExe pkgs.gnused)
+                  (lib.getExe pkgs.gnused)
                   "-e"
                   "'${toString line}!d'"
                 ]
@@ -68,22 +67,23 @@ in
           in
           {
             shire = mkAccount rec {
-              address = my.email;
+              address = lib.my.email;
               aliases = [
                 address
                 "frodo@rohan.net"
                 "azahi@shire.net"
               ];
-              realName = my.fullname;
+              realName = lib.my.fullname;
               signature = {
                 showSignature = "append";
                 text = ''
-                  Please consider using plain text when replying!
-                  ~    https://useplaintext.email/#etiquette    ~
+                  Firstname Lastname     | Азат Багавиев
+                  frodo@gondor.net | frodo@rohan.net
+                          https://azahi.cc/
                 '';
               };
               gpg = {
-                inherit (my.pgp) key;
+                inherit (lib.my.pgp) key;
                 signByDefault = false;
                 encryptByDefault = false;
               };
diff --git a/modules/profiles/headful.nix b/modules/profiles/headful.nix
index 3a795f1..62a036c 100644
--- a/modules/profiles/headful.nix
+++ b/modules/profiles/headful.nix
@@ -6,27 +6,29 @@
   this,
   ...
 }:
-with lib;
 let
   cfg = config.nixfiles.modules.profiles.headful;
 in
 {
-  options.nixfiles.modules.profiles.headful.enable = mkEnableOption "headful profile" // {
+  options.nixfiles.modules.profiles.headful.enable = lib.mkEnableOption "headful profile" // {
     default = this.isHeadful;
   };
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     nixfiles.modules = {
+      common.xdg.defaultApplications."org.telegram.desktop" = [ "x-scheme-handler/tg" ];
+
       profiles.dev.enable = true;
 
-      alacritty.enable = mkDefault true;
+      alacritty.enable = true;
       aria2.enable = true;
+      bat.enable = true;
       chromium.enable = true;
-      dwm.enable = mkDefault false;
       emacs.enable = true;
+      eza.enable = true;
       firefox.enable = true;
-      foot.enable = mkDefault true;
-      kde.enable = mkDefault true;
+      foot.enable = true;
+      kde.enable = true;
       mpv.enable = true;
       nullmailer.enable = true;
       openssh.client.enable = true;
@@ -34,8 +36,8 @@ in
       sound.enable = true;
       thunderbird.enable = true;
       vscode.enable = true;
-      wayland.enable = mkDefault true;
-      x11.enable = mkDefault true;
+      wayland.enable = true;
+      x11.enable = true;
       zathura.enable = true;
     };
 
@@ -52,11 +54,16 @@ in
         packages = with pkgs; [
           anki
           audacity
+          ayugram-desktop
+          bitwarden-cli
+          bitwarden-desktop
           byedpi
           eaglemode
+          easyeffects
           element-desktop
           fd
           gimp
+          helvum
           imv
           kdenlive
           libreoffice-fresh
@@ -80,7 +87,21 @@ in
     };
 
     boot = {
-      kernelPackages = mkDefault pkgs.linuxPackages_latest;
+      kernelPackages = lib.mkDefault (
+        if config.boot.zfs.enabled then
+          pkgs.linuxKernel.packages
+          |> lib.filterAttrs (
+            k: v:
+            (builtins.match "linux_[0-9]+_[0-9]+" k) != null
+            && (builtins.tryEval v).success
+            && (!v.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken)
+          )
+          |> builtins.attrValues
+          |> lib.sort (a: b: lib.versionOlder a.kernel.version b.kernel.version)
+          |> lib.last
+        else
+          pkgs.linuxPackages_latest
+      );
 
       kernelParams = [
         # https://wiki.archlinux.org/title/improving_performance#Watchdogs
@@ -122,9 +143,16 @@ in
 
     services = {
       fwupd.enable = true;
+
       libinput.enable = true;
-      psd.enable = true;
+
       upower.enable = true;
+
+      languagetool = {
+        enable = true;
+        port = 8081;
+        allowOrigin = "*";
+      };
     };
 
     time.timeZone = "Europe/Moscow";
@@ -147,8 +175,8 @@ in
     system.extraDependencies =
       let
         collectFlakeInputs =
-          input: [ input ] ++ concatMap collectFlakeInputs (attrValues (input.inputs or { }));
+          input: [ input ] ++ (lib.attrValues (input.inputs or { }) |> lib.concatMap collectFlakeInputs);
       in
-      concatMap collectFlakeInputs (attrValues inputs);
+      lib.concatMap collectFlakeInputs (lib.attrValues inputs);
   };
 }

Consider giving Nix/NixOS a try! <3