about summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/by-name/ri/river/module.nix49
-rw-r--r--modules/common/abstract-nord.pngbin0 -> 140219 bytes
-rw-r--r--modules/common/default.nix197
-rw-r--r--modules/home.legacy/conf/mail/default.nix4
-rw-r--r--modules/home.legacy/pkgs/default.nix69
5 files changed, 249 insertions, 70 deletions
diff --git a/modules/by-name/ri/river/module.nix b/modules/by-name/ri/river/module.nix
index c0b38bc5..c8fb973c 100644
--- a/modules/by-name/ri/river/module.nix
+++ b/modules/by-name/ri/river/module.nix
@@ -187,29 +187,32 @@ in {
         pkgs.river-start
       ];
 
-      xdg.configFile."river/init".text = let
-        mkHeading = text: other_stuff: ''
-          # ${text}
-          ${other_stuff}
-        '';
-      in
-        builtins.readFile ./init_base.sh
-        +
-        # bash
-        mkHeading "Environment variables" ''
-          err_fail ${riverctl} spawn "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --verbose --systemd SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river"
-          export XDG_CURRENT_DESKTOP=river DESKTOP_SESSION=river;
-        ''
-        + mkHeading "Key Mappings" keymappings
-        + mkHeading "Rules" ruleSetup
-        + mkHeading "General Settings" generalSettings
-        + mkHeading "Input Section" inputs
-        + mkHeading "Screen setup code" screenSetupCode
-        + mkHeading "Background services" longRunningPrograms
-        + mkHeading "Layout Setup" ''
-          err_fail ${riverctl} default-layout rivertile
-          ${lib.getExe' pkgs.river "rivertile"} -main-ratio 0.5 -view-padding 1 -outer-padding 0
-        '';
+      xdg.configFile."river/init" = {
+        executable = true;
+        text = let
+          mkHeading = text: other_stuff: ''
+            # ${text}
+            ${other_stuff}
+          '';
+        in
+          builtins.readFile ./init_base.sh
+          +
+          # bash
+          mkHeading "Environment variables" ''
+            err_fail ${riverctl} spawn "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --verbose --systemd SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river"
+            export XDG_CURRENT_DESKTOP=river DESKTOP_SESSION=river;
+          ''
+          + mkHeading "Key Mappings" keymappings
+          + mkHeading "Rules" ruleSetup
+          + mkHeading "General Settings" generalSettings
+          + mkHeading "Input Section" inputs
+          + mkHeading "Screen setup code" screenSetupCode
+          + mkHeading "Background services" longRunningPrograms
+          + mkHeading "Layout Setup" ''
+            err_fail ${riverctl} default-layout rivertile
+            ${lib.getExe' pkgs.river "rivertile"} -main-ratio 0.5 -view-padding 1 -outer-padding 0
+          '';
+      };
     };
   };
 }
diff --git a/modules/common/abstract-nord.png b/modules/common/abstract-nord.png
new file mode 100644
index 00000000..5ef498bf
--- /dev/null
+++ b/modules/common/abstract-nord.png
Binary files differdiff --git a/modules/common/default.nix b/modules/common/default.nix
new file mode 100644
index 00000000..232c329d
--- /dev/null
+++ b/modules/common/default.nix
@@ -0,0 +1,197 @@
+# This file contains common configuration applied to every host.
+# It should only `enable` options defined in the `modules/by-name` directory.
+{
+  config,
+  pkgs,
+  lib,
+  ...
+}: {
+  soispha = {
+    boot.enable = true;
+    cleanup.enable = true;
+    documentation.enable = true;
+
+    fonts = {
+      enable = true;
+      enableEmoji = true;
+    };
+
+    home-manager.enable = true;
+    impermanence = {
+      enable = true;
+
+      directories = [
+        "/etc/nixos"
+        "/var/log"
+        "/var/lib/systemd"
+        "/var/lib/nixos"
+      ];
+    };
+    polkit.enable = true;
+    power.enable = true;
+
+    services = {
+      adb = {
+        enable = true;
+        user = "soispha";
+      };
+      fwupd.enable = true;
+      mpd = {
+        enable = true;
+        directories = let
+          data = "${config.home-manager.users.soispha.xdg.dataHome}/mpd";
+        in {
+          inherit data;
+          playlists = "${data}/playlists";
+          runtime = "/run/user/${builtins.toString config.users.users.soispha.uid}/mpd";
+          music = config.home-manager.users.soispha.programs.beets.settings.directory;
+        };
+        mpc = {
+          enable = true;
+          beetsPkg = config.home-manager.users.soispha.programs.beets.package;
+        };
+      };
+      ollama.enable = false;
+      postgresql.enable = false;
+      printing.enable = true;
+      scanning.enable = true;
+      snapper.enable = true;
+      steam.enable = false;
+      systemDiff.enable = true;
+      unison = {
+        enable = true;
+
+        foreign.userName = "soispha";
+        dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison";
+        userSourceDir = "/srv/home/soispha";
+        pathsToIgnore = let
+          extractTarget = attr: "~/${attr.target}";
+          homeManagerSymlinks =
+            builtins.map extractTarget
+            (builtins.attrValues
+              config.home-manager.users.soispha.home.file);
+        in
+          [
+            # already synchronized by the taskserver
+            "~/.local/share/task"
+
+            # Should not be synchronized
+            "~/.local/share/unison"
+
+            # Is just to big to be synchronized (# TODO: Work around that <2024-08-31> )
+            "~/media/music"
+          ]
+          ++ homeManagerSymlinks;
+
+        pathsToSync = [
+          "~/.local/state/mpv"
+          "~/.local/state/nvim"
+          "~/.local/share"
+          "~/.local/.Trash-1000"
+
+          "~/.mozilla/firefox"
+
+          "~/media"
+          "~/school"
+          "~/repos"
+        ];
+      };
+    };
+
+    programs = {
+      nvim = {
+        enable = true;
+        shell = pkgs.zsh;
+      };
+      atuin.enable = true;
+      direnv.enable = true;
+      git.enable = true;
+      imv.enable = true;
+      less.enable = true;
+      lf.enable = true;
+      river = {
+        enable = true;
+        init = {
+          rules = [
+            {
+              app-id = "float";
+              title = "*";
+              action = "float";
+            }
+            {
+              app-id = "mpv";
+              title = "*";
+              action = "float";
+            }
+            {
+              app-id = "ModernGL";
+              title = "*";
+              action = "float";
+            }
+            {
+              app-id = "*";
+              title = "Manim Slides";
+              action = "float";
+            }
+            {
+              app-id = "*";
+              title = "floating please";
+              action = "float";
+            }
+
+            {
+              app-id = "*";
+              title = "*";
+              action = "ssd";
+            }
+            # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.)
+            {
+              app-id = "firefox";
+              title = "*";
+              action = "csd";
+            }
+          ];
+          generalSettings = {
+            # background
+            background-color = "0x002b36";
+            border-color-focused = "0x93a1a1";
+            border-color-unfocused = "0x586e75";
+
+            # keyboard repeat rate
+            set-repeat = ["50" "300"];
+
+            # Cursor
+            focus-follows-cursor = "normal";
+            # hide-cursor = ["timeout" "2000"];
+            hide-cursor = ["when-typing" "enabled"];
+            set-cursor-warp = "on-output-change";
+            xcursor-theme = ["Nordzy-cursors" "24"];
+          };
+          inputs = {
+            pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]];
+            pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]];
+          };
+          backgroundStart = [
+            pkgs.gammastep
+            pkgs.yambar
+
+            pkgs.mako
+            ["${lib.getExe pkgs.swaybg}" "--image" "${./abstract-nord.png}"]
+            pkgs.swayidle
+            pkgs.alacritty
+          ];
+        };
+      };
+      mpv.enable = true;
+      swaylock.enable = true;
+      taskwarrior.enable = true;
+      yambar.enable = true;
+      yt.enable = true;
+      zathura.enable = true;
+      zsh.enable = true;
+    };
+
+    sound.enable = true;
+    version.enable = true;
+  };
+}
diff --git a/modules/home.legacy/conf/mail/default.nix b/modules/home.legacy/conf/mail/default.nix
index 5e35c002..9c2554ee 100644
--- a/modules/home.legacy/conf/mail/default.nix
+++ b/modules/home.legacy/conf/mail/default.nix
@@ -31,9 +31,9 @@
     # TODO: This will result in only one of them being defined, as we duplicate the
     # attribute key<2025-02-03>
     lib.mapAttrs' (_: value: {
-      name = "credential";
+      name = "credential.smtp://${value.smtp.host}:${builtins.toString value.smtp.port}";
       value = {
-        "smtp://${value.smtp.host}:${builtins.toString value.smtp.port}" = mkHelper value;
+        "helper" = mkHelper value;
       };
     })
     accounts;
diff --git a/modules/home.legacy/pkgs/default.nix b/modules/home.legacy/pkgs/default.nix
index 1a4c4a1b..1d77c7de 100644
--- a/modules/home.legacy/pkgs/default.nix
+++ b/modules/home.legacy/pkgs/default.nix
@@ -5,44 +5,37 @@
   nixosConfig,
   ...
 }:
-# TODO: Remove this whole file, and move each pkgs to a separate module. <2024-11-16>
+# TODO: Remove this whole file, and move each package to a separate module. <2024-11-16>
 with pkgs; let
+  neorgFinal =
+    neorg.override
+    {
+      defaultNeorgProjectDir = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces.projects;
+      allProjectsNewline = config.soispha.taskwarrior.projects.projects_newline;
+      allProjectsComma = config.soispha.taskwarrior.projects.projects_comma;
+      allProjectsPipe = config.soispha.taskwarrior.projects.projects_pipe;
+      allWorkspaces = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces;
+      xdgConfigHome = config.xdg.configHome;
+      xdgDataHome = config.xdg.dataHome;
+    };
+
   Gui = {
     Terminals = [
-      # foot # wayland native terminal
       alacritty # default terminal
     ];
-    Browsers = [
-      #ungoogled-chromium # web browser (only for web programming)
-      #brave
-    ];
-
-    ImageManipulation = [
-      #krita # new, and better (KDE)
-      #gimp # conservative, and old (GNOME)
-    ];
 
     Social = [
-      mumble # voice chat software (client)
-      # lutris # multiple game store clients
-
-      # nheko # best matrix client (as of today)
-      # element-desktop  # nheko didn't work
       signal-desktop # to avoid encryption problems with signal-bridge
     ];
 
     Misc = [
-      #kalzium # Periodic Table of Elements (`element` is [sort of] better)
       keepassxc # password manager
-      #onlykey # OnlyKey Chrome Desktop App
       anki-bin # spaced repetition
     ];
   };
 
   TuiCli = {
     EyeCandy = [
-      #banner # Print large banners to ASCII terminals
-      cmatrix # A curses-based scrolling 'Matrix'-like screen
       hyfetch # Neofetch with LGBTQ pride flags.
     ];
 
@@ -58,7 +51,6 @@ with pkgs; let
       android-file-transfer # Android MTP client with minimalistic UI
       #xdg-ninja # A shell script which checks your $HOME for unwanted files and directories.
       xdg-utils # open urls and such things
-      yokadi # Command line oriented, sqlite powered, todo list
       killall # kill a application by name
       snap-sync-forked # A btrfs based backup solution
       bc # Smart calculator
@@ -77,33 +69,18 @@ with pkgs; let
       Firefox = [
         # `neorg` handles the integration between Firefox profiles and task
         # contexts
-        (neorg.override
-          {
-            defaultNeorgProjectDir = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces.projects;
-            allProjectsNewline = config.soispha.taskwarrior.projects.projects_newline;
-            allProjectsComma = config.soispha.taskwarrior.projects.projects_comma;
-            allProjectsPipe = config.soispha.taskwarrior.projects.projects_pipe;
-            allWorkspaces = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces;
-            xdgConfigHome = config.xdg.configHome;
-            xdgDataHome = config.xdg.dataHome;
-          })
+        neorgFinal
       ];
     };
 
     WM = {
-      river = [river]; # A dynamic tiling wayland compositor
-
       CLITools = [
         lswt # List Wayland toplevels.
         wl-clipboard # Command-line copy/paste utilities.
-        swaylock # My current lockscreen implementation.
       ];
 
       Media = [
-        wf-recorder # Screen recorder.
         libnotify # a command to send a notification.
-        screenshot_persistent # Creates a persisting screenshot.
-        screenshot_temporary # Takes a screenshot and stores it in the clipboard.
       ];
     };
 
@@ -120,13 +97,11 @@ with pkgs; let
 
       Listen = [
         spodi # Wrapper around `spotdl`.
-        sort_song # Sorts songs in the current directory.
       ];
     };
 
     Hardware = {
       Storage = [
-        #compsize # Calculate compression ratio of a set of files on Btrfs
         # TODO: smartmontools # Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives
       ];
 
@@ -144,10 +119,6 @@ with pkgs; let
             backlightName = nixosConfig.soispha.laptop.backlight;
           }
         );
-
-      Input = [
-        #piper # GTK application to configure gaming mice
-      ];
     };
 
     SystemUpdate = [
@@ -176,7 +147,6 @@ with pkgs; let
       GeneralTools = [
         stamp # Add a license header to a file
         git # the fast distributed version control system
-        git-absorb # git commit --fixup, but automatic
         git-edit-index # Allows you to edit the indexed version of a file
         git-cm # A wrapper that re-adds the last commit's subject
         git-cleanup # An automatic merged branch deleter
@@ -194,7 +164,16 @@ with pkgs; let
       else builtins.attrValues x
     else [x];
 in {
-  home.packages =
+  options.soispha.programs.neorg = {
+    package = lib.mkOption {
+      type = lib.types.package;
+      default = neorgFinal;
+      description = ''
+        The neorg package to use.
+      '';
+    };
+  };
+  config.home.packages =
     []
     ++ (with builtins;
       concatLists