Adds overlays and restructures package directories

- Applies overlays in flake to make custom packages available
- Replaces recursive package import with explicit package scanning
- Moves packages from `pkgs/common` to `pkgs/` and updates overlay paths
- Updates snapraid-runner email configuration (from, host, port, credentials)
This commit is contained in:
Chris Toph 2025-04-20 13:27:09 -04:00
parent 55634220ae
commit f44e48c1ba
10 changed files with 35 additions and 25 deletions

View file

@ -114,7 +114,15 @@
# see: https://github.com/nix-community/home-manager/pull/3454 # see: https://github.com/nix-community/home-manager/pull/3454
lib = nixpkgs.lib.extend (self: super: { custom = import ./lib { inherit (nixpkgs) lib; }; }); lib = nixpkgs.lib.extend (self: super: { custom = import ./lib { inherit (nixpkgs) lib; }; });
}; };
modules = [ ./hosts/nixos/${host} ]; modules = [
# Apply the overlays to make custom packages available
{
nixpkgs.overlays = [
self.overlays.default
];
}
./hosts/nixos/${host}
];
}; };
}; };
# Invoke mkHost for each host config that is declared for either X86 or ARM # Invoke mkHost for each host config that is declared for either X86 or ARM
@ -136,7 +144,6 @@
# Building configurations is available through `just rebuild` or `nixos-rebuild --flake .#hostname` # Building configurations is available through `just rebuild` or `nixos-rebuild --flake .#hostname`
nixosConfigurations = mkHostConfigs (readHosts "nixos") false; nixosConfigurations = mkHostConfigs (readHosts "nixos") false;
#
# ========= Packages ========= # ========= Packages =========
# #
# Add custom packages to be shared or upstreamed. # Add custom packages to be shared or upstreamed.
@ -147,11 +154,22 @@
inherit system; inherit system;
overlays = [ self.overlays.default ]; overlays = [ self.overlays.default ];
}; };
# Get all package directories from pkgs/
packageDirs = builtins.attrNames (builtins.readDir ./pkgs);
# Filter to only include names that resulted in valid packages
validPackages = builtins.filter (name: builtins.hasAttr name pkgs) packageDirs;
# Create a set with all the packages
customPackages = builtins.listToAttrs (
builtins.map (name: {
inherit name;
value = pkgs.${name};
}) validPackages
);
in in
lib.packagesFromDirectoryRecursive { customPackages
callPackage = lib.callPackageWith pkgs;
directory = pkgs/common;
}
); );
}; };
} }

View file

@ -6,13 +6,15 @@
let let
# Adds my custom packages # Adds my custom packages
# FIXME: Add per-system packages
additions = additions =
final: prev: final: prev:
(prev.lib.packagesFromDirectoryRecursive { let
packages = prev.lib.packagesFromDirectoryRecursive {
callPackage = prev.lib.callPackageWith final; callPackage = prev.lib.callPackageWith final;
directory = ../pkgs/common; directory = ../pkgs; # Changed from ../pkgs/common to ../pkgs
}); };
in
packages;
linuxModifications = final: prev: prev.lib.mkIf final.stdenv.isLinux { }; linuxModifications = final: prev: prev.lib.mkIf final.stdenv.isLinux { };
@ -20,20 +22,12 @@ let
# example = prev.example.overrideAttrs (oldAttrs: let ... in { # example = prev.example.overrideAttrs (oldAttrs: let ... in {
# ... # ...
# }); # });
# flameshot = prev.flameshot.overrideAttrs {
# cmakeFlags = [
# (prev.lib.cmakeBool "USE_WAYLAND_GRIM" true)
# (prev.lib.cmakeBool "USE_WAYLAND_CLIPBOARD" true)
# ];
# };
}; };
stable-packages = final: _prev: { stable-packages = final: _prev: {
stable = import inputs.nixpkgs-stable { stable = import inputs.nixpkgs-stable {
inherit (final) system; inherit (final) system;
config.allowUnfree = true; config.allowUnfree = true;
# overlays = [
# ];
}; };
}; };
@ -41,8 +35,6 @@ let
unstable = import inputs.nixpkgs-unstable { unstable = import inputs.nixpkgs-unstable {
inherit (final) system; inherit (final) system;
config.allowUnfree = true; config.allowUnfree = true;
# overlays = [
# ];
}; };
}; };

View file

@ -20,19 +20,19 @@ sendon = success,error
; set to false to get full programm output via email ; set to false to get full programm output via email
short = true short = true
subject = [SnapRAID] Status Report: subject = [SnapRAID] Status Report:
from = cloud@ryot.foo from = [REDACTED]
to = [REDACTED] to = [REDACTED]
; maximum email size in KiB ; maximum email size in KiB
maxsize = 500 maxsize = 500
[smtp] [smtp]
host = ryot.foo host = smtp.protonmail.ch
; leave empty for default port ; leave empty for default port
port = port = 587
; set to "true" to activate ; set to "true" to activate
ssl = true ssl = true
tls = true tls = true
user = admin user = [REDACTED]
password = [REDACTED] password = [REDACTED]
[scrub] [scrub]