summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2024-12-21 16:04:31 +0100
committerLinnnus <[email protected]>2024-12-21 16:19:09 +0100
commit334250012b41c3fd2b2dc177b0a14bd23e13d672 (patch)
tree20a61d1e40614f4864f679ec02987c1b7c1cd647
parentc7a50827e444e08a6e14d18c90a85109121ecda3 (diff)
Define packages in overlays/additions
-rw-r--r--flake.nix12
-rw-r--r--overlays/additions.nix38
-rw-r--r--overlays/compat.nix10
-rw-r--r--overlays/default.nix49
-rw-r--r--overlays/modifications.nix43
-rw-r--r--pkgs/default.nix40
-rw-r--r--shared/home-manager/noweb/default.nix2
-rw-r--r--shared/nixos/common-nix-settings/default.nix5
8 files changed, 94 insertions, 105 deletions
diff --git a/flake.nix b/flake.nix
index 65db1a5..0a7d4bf 100644
--- a/flake.nix
+++ b/flake.nix
@@ -97,14 +97,14 @@
forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
packages = forAllSystems (system: let
- pkgs = import nixpkgs {
- inherit system;
- overlays = builtins.attrValues self.overlays;
- };
+ pkgs = import nixpkgs {inherit system;};
in
- import ./pkgs pkgs);
+ import ./overlays/additions.nix pkgs pkgs);
- overlays = import ./overlays;
+ overlays = {
+ additions = import ./overlays/additions.nix;
+ modifications = import ./overlays/modifications.nix;
+ };
# We export the generally applicable modules.
darwinModules = import ./modules/darwin;
diff --git a/overlays/additions.nix b/overlays/additions.nix
new file mode 100644
index 0000000..fc399f2
--- /dev/null
+++ b/overlays/additions.nix
@@ -0,0 +1,38 @@
+# This file contains an overlay which adds all the custom packages from `pkgs/`.
+final: prev: {
+ duksebot = prev.callPackage ../pkgs/duksebot {};
+
+ tcl-cmark = prev.callPackage ../pkgs/tcl-cmark {};
+
+ still-awake = prev.callPackage ../pkgs/still-awake {};
+
+ trash = prev.callPackage ../pkgs/trash {};
+
+ mcping = prev.callPackage ../pkgs/mcping {};
+
+ # This is not wrapping the YaLafi python library, just a particular example
+ # from the repo where they spellcheck LaTex files.
+ yalafi-shell = prev.callPackage ../pkgs/yalafi-shell {};
+
+ pbv = prev.callPackage ../pkgs/pbv {};
+
+ vemf-unwrapped = prev.callPackage ../pkgs/vemf-unwrapped {};
+
+ vemf = prev.callPackage ../pkgs/vemf {};
+
+ cscript = prev.callPackage ../pkgs/cscript {};
+
+ human-sleep = prev.callPackage ../pkgs/human-sleep {};
+
+ disable-sleep = prev.callPackage ../pkgs/disable-sleep {};
+
+ nowrap = prev.callPackage ../pkgs/nowrap {};
+
+ echoargs = prev.callPackage ../pkgs/echoargs {};
+
+ vimPlugins = prev.vimPlugins.extend (final': prev': {
+ vim-crystal = prev.callPackage ../pkgs/vim-crystal {};
+ vim-noweb = prev.callPackage ../pkgs/vim-noweb {};
+ vim-janet = prev.callPackage ../pkgs/vim-janet {};
+ });
+}
diff --git a/overlays/compat.nix b/overlays/compat.nix
index 76bef87..0f7aeb4 100644
--- a/overlays/compat.nix
+++ b/overlays/compat.nix
@@ -1,11 +1,9 @@
# Returns a list of overlays such that this file can be used for the value of
# nixpkgs-overlays in NIX_PATH.
#
-# See: hosts/common.nix
+# See: shared/nixos/common-nix-options/
# See: https://nixos.org/manual/nixpkgs/stable/#sec-overlays-lookup
-let
- overlays = import ./default.nix;
-in [
- overlays.additions
- overlays.modifications
+[
+ (import ./additions.nix)
+ (import ./modifications.nix)
]
diff --git a/overlays/default.nix b/overlays/default.nix
deleted file mode 100644
index e7892dc..0000000
--- a/overlays/default.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-# This module lists the different overlays. These are exported in `flake.nix`.
-{
- # This overlay adds all of our custom packages.
- additions = final: _prev: import ../pkgs final;
-
- # This overlay does typical overlay stuff such as adding patches, bumping versions, etc.
- modifications = final: prev: {
- # Use patched version from Karl.
- smu = prev.smu.overrideAttrs (old: {
- version = "2022-08-01";
- src = final.fetchFromGitHub {
- owner = "karlb";
- repo = "smu";
- rev = "bd03c5944b7146d07a88b58a2dd0d264836e3322";
- hash = "sha256-Jx7lJ9UTHAOCgPxF2p7ZoZBZ476bLXN5dI0vspusmGo=";
- };
- env.NIX_CFLAGS_COMPILE =
- (old.env.NIX_CFLAGS_COMPILE or "")
- + (final.lib.strings.optionalString (final.stdenv.cc.isGNU or false) " -Wno-maybe-uninitialized");
- });
-
- # Use a slightly newer version of qBittorrent that doesn't include the password bug.
- #
- # See: https://old.reddit.com/r/qBittorrent/comments/1827zqn/locked_out_of_qbittorrent/kahat1u/?context=3
- # See: https://www.qbittorrent.org/news#mon-nov-27th-2023---qbittorrent-v4.6.2-release
- qbittorrent-nox = prev.qbittorrent-nox.overrideAttrs (old: rec {
- version = "4.6.2";
- src = final.fetchFromGitHub {
- owner = "qbittorrent";
- repo = "qBittorrent";
- rev = "release-${version}";
- hash = "sha256-+leX0T+yJUG6F7WbHa3nCexQZmd7RRfK8Uc+suMJ+vI=";
- };
- });
-
- # Use newest version.
- noweb = prev.noweb.overrideAttrs (old: rec {
- version = "2_13rc3";
- src = final.fetchFromGitHub {
- owner = "nrnrnr";
- repo = "noweb";
- rev = "v${builtins.replaceStrings ["."] ["_"] version}";
- sha256 = "COcWyrYkheRaSr2gqreRRsz9SYRTX2PSl7km+g98ljs=";
- };
- # Have to discard old patches as the no longer apply cleanly.
- patches = (old.patches or []) ++ [./noweb-no-unnecessary-cflags.patch];
- });
- };
-}
diff --git a/overlays/modifications.nix b/overlays/modifications.nix
new file mode 100644
index 0000000..59a5fef
--- /dev/null
+++ b/overlays/modifications.nix
@@ -0,0 +1,43 @@
+# This file defines an overlay overlay does typical overlay stuff such as adding patches, bumping versions, etc.
+final: prev: {
+ # Use patched version from Karl.
+ smu = prev.smu.overrideAttrs (old: {
+ version = "2022-08-01";
+ src = final.fetchFromGitHub {
+ owner = "karlb";
+ repo = "smu";
+ rev = "bd03c5944b7146d07a88b58a2dd0d264836e3322";
+ hash = "sha256-Jx7lJ9UTHAOCgPxF2p7ZoZBZ476bLXN5dI0vspusmGo=";
+ };
+ env.NIX_CFLAGS_COMPILE =
+ (old.env.NIX_CFLAGS_COMPILE or "")
+ + (final.lib.strings.optionalString (final.stdenv.cc.isGNU or false) " -Wno-maybe-uninitialized");
+ });
+
+ # Use a slightly newer version of qBittorrent that doesn't include the password bug.
+ #
+ # See: https://old.reddit.com/r/qBittorrent/comments/1827zqn/locked_out_of_qbittorrent/kahat1u/?context=3
+ # See: https://www.qbittorrent.org/news#mon-nov-27th-2023---qbittorrent-v4.6.2-release
+ qbittorrent-nox = prev.qbittorrent-nox.overrideAttrs (old: rec {
+ version = "4.6.2";
+ src = final.fetchFromGitHub {
+ owner = "qbittorrent";
+ repo = "qBittorrent";
+ rev = "release-${version}";
+ hash = "sha256-+leX0T+yJUG6F7WbHa3nCexQZmd7RRfK8Uc+suMJ+vI=";
+ };
+ });
+
+ # Use newest version.
+ noweb = prev.noweb.overrideAttrs (old: rec {
+ version = "2_13rc3";
+ src = final.fetchFromGitHub {
+ owner = "nrnrnr";
+ repo = "noweb";
+ rev = "v${builtins.replaceStrings ["."] ["_"] version}";
+ sha256 = "COcWyrYkheRaSr2gqreRRsz9SYRTX2PSl7km+g98ljs=";
+ };
+ # Have to discard old patches as the no longer apply cleanly.
+ patches = (old.patches or []) ++ [./noweb-no-unnecessary-cflags.patch];
+ });
+}
diff --git a/pkgs/default.nix b/pkgs/default.nix
deleted file mode 100644
index 4737efb..0000000
--- a/pkgs/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-pkgs: {
- duksebot = pkgs.callPackage ./duksebot {};
-
- tcl-cmark = pkgs.callPackage ./tcl-cmark {};
-
- still-awake = pkgs.callPackage ./still-awake {};
-
- trash = pkgs.callPackage ./trash {};
-
- mcping = pkgs.callPackage ./mcping {};
-
- # This is not wrapping the YaLafi python library, just a particular example
- # from the repo where they spellcheck LaTex files.
- yalafi-shell = pkgs.callPackage ./yalafi-shell {};
-
- pbv = pkgs.callPackage ./pbv {};
-
- vemf-unwrapped = pkgs.callPackage ./vemf-unwrapped {};
-
- vemf = pkgs.callPackage ./vemf {};
-
- cscript = pkgs.callPackage ./cscript {};
-
- human-sleep = pkgs.callPackage ./human-sleep {};
-
- disable-sleep = pkgs.callPackage ./disable-sleep {};
-
- nowrap = pkgs.callPackage ./nowrap {};
-
- echoargs = pkgs.callPackage ./echoargs {};
-
- # TODO: These should be contained in the 'vimPlugins' attrset. This turns out
- # to be non-trivial because this module is both consumed in a flake output
- # context and an overlay context.
- #
- # See: https://nixos.wiki/wiki/Overlays#Overriding_a_package_inside_an_extensible_attribute_set
- vim-crystal = pkgs.callPackage ./vim-crystal {};
- vim-noweb = pkgs.callPackage ./vim-noweb {};
- vim-janet = pkgs.callPackage ./vim-janet {};
-}
diff --git a/shared/home-manager/noweb/default.nix b/shared/home-manager/noweb/default.nix
index 1506431..72a1568 100644
--- a/shared/home-manager/noweb/default.nix
+++ b/shared/home-manager/noweb/default.nix
@@ -5,7 +5,7 @@
yalafi-shell
];
- programs.neovim.plugins = with pkgs; [
+ programs.neovim.plugins = with pkgs.vimPlugins; [
vim-noweb
];
diff --git a/shared/nixos/common-nix-settings/default.nix b/shared/nixos/common-nix-settings/default.nix
index b5c0a02..6a34cac 100644
--- a/shared/nixos/common-nix-settings/default.nix
+++ b/shared/nixos/common-nix-settings/default.nix
@@ -37,10 +37,9 @@ lib.mkMerge [
# Use overlays from this repo for building system configuration as well as system-wide.
# See: https://nixos.wiki/wiki/Overlays#Using_nixpkgs.overlays_from_configuration.nix_as_.3Cnixpkgs-overlays.3E_in_your_NIX_PATH
"nixpkgs-overlays=${flakeInputs.self}/overlays/compat.nix"
-
- # This will additionally add out inputs to the system's legacy channels
- # Making legacy nix commands consistent as well, awesome!
]
+ # This will additionally add out inputs to the system's legacy channels
+ # Making legacy nix commands consistent as well, awesome!
++ lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
# Add shell-utilities which are only relevant if Nix is enabled.