about summary refs log tree commit diff stats
path: root/flake
diff options
context:
space:
mode:
Diffstat (limited to 'flake')
-rw-r--r--flake/default.nix4
-rw-r--r--flake/nixosConfigurations/common.nix122
-rw-r--r--flake/nixosConfigurations/default.nix4
-rw-r--r--flake/packages/default.nix5
4 files changed, 11 insertions, 124 deletions
diff --git a/flake/default.nix b/flake/default.nix
index be6d2b70..c942c678 100644
--- a/flake/default.nix
+++ b/flake/default.nix
@@ -4,6 +4,7 @@
   pkgs,
   pkgsStable,
   nixLib,
+  baseLib,
   myPkgs,
   system,
   sysLib,
@@ -43,6 +44,7 @@
       shell_library
       sysLib
       nixLib
+      baseLib
       templates
       # modules
       home-manager
@@ -111,6 +113,8 @@ in {
 
   formatter."${system}" = treefmtEval.config.build.wrapper;
 
+  baseLib."${system}" = baseLib;
+
   apps."${system}" = import ./apps {inherit self system;};
 
   devShells."${system}" = {
diff --git a/flake/nixosConfigurations/common.nix b/flake/nixosConfigurations/common.nix
deleted file mode 100644
index b8601c75..00000000
--- a/flake/nixosConfigurations/common.nix
+++ /dev/null
@@ -1,122 +0,0 @@
-# This file contains common configuration applied to every host.
-# It should only `enable` options defined in the `modules/by-name` directory.
-{
-  config,
-  pkgs,
-  ...
-}: {
-  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/.Trash-1000"
-          "~/.mozilla/firefox"
-
-          "~/media"
-          "~/school"
-          "~/repos"
-        ];
-      };
-    };
-
-    programs = {
-      nvim = {
-        enable = true;
-        shell = pkgs.zsh;
-      };
-      atuin.enable = true;
-      git.enable = true;
-      imv.enable = true;
-      less.enable = true;
-      lf.enable = true;
-      river.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/flake/nixosConfigurations/default.nix b/flake/nixosConfigurations/default.nix
index b0a02580..0c2f8c90 100644
--- a/flake/nixosConfigurations/default.nix
+++ b/flake/nixosConfigurations/default.nix
@@ -9,6 +9,7 @@
   shell_library,
   sysLib,
   nixLib,
+  baseLib,
   templates,
   # modules
   home-manager,
@@ -38,7 +39,7 @@
     serverphone.nixosModules.default
 
     ../../modules
-    ./common.nix
+    ../../modules/common
   ];
 
   specialArgs = {
@@ -50,6 +51,7 @@
       shell_library
       sysLib
       nixLib
+      baseLib
       # extra information
       system
       # modules
diff --git a/flake/packages/default.nix b/flake/packages/default.nix
index a8fc2d64..82924a25 100644
--- a/flake/packages/default.nix
+++ b/flake/packages/default.nix
@@ -23,7 +23,10 @@
         # NOTE: This is copied from `nixvim`, and could be achieved by setting
         # `config.wrapRc` to `true`. But I have yet to find a way to set this in this
         # context, but not in the general context.  <2024-11-09>
-        wrapped = config.build.package.override (prev: {
+        # NOTE: I'm not sure why we need `nvimPackage` instead of just the `package`
+        # attribute here, but the bare `package` attribute does not provide a `override`
+        # function. <2025-02-02>
+        wrapped = config.build.nvimPackage.override (prev: {
           wrapperArgs =
             (
               if lib.isString prev.wrapperArgs