refactor: move customPkgs to self.packages
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-06-08 22:21:04 -04:00
parent 14081936af
commit fe7b03dd4a
19 changed files with 39 additions and 37 deletions

View file

@ -13,7 +13,6 @@
./vars
./modules
./pkgs
nur.nixosModules.nur
home-manager.nixosModules.home-manager
@ -100,7 +99,6 @@
./home
./home/trash-d
./pkgs
];
home.packages =

View file

@ -1,10 +1,10 @@
{
config,
pkgs,
self,
...
}: {
home.packages =
(with config.customPkgs; [
(with self.packages.${pkgs.system}; [
pokemon-colorscripts
repl
])

View file

@ -1,26 +0,0 @@
{
lib,
pkgs,
...
} @ inputs: let
inherit (lib) concatMapAttrs filterAttrs mkOption pathExists types;
mkPackage = name: v: {
${name} = pkgs.callPackage ./${name} inputs;
};
rmNotPackage = name: value:
value
== "directory"
&& pathExists ./${name}/default.nix;
packages = filterAttrs rmNotPackage (builtins.readDir ./.);
pkgSet = concatMapAttrs mkPackage packages;
in {
options.customPkgs = mkOption {
type = types.attrs;
};
config.customPkgs = pkgSet;
}

View file

@ -2,6 +2,7 @@
config,
nms,
pkgs,
self,
...
}: let
inherit (config.vars) mainUser;
@ -9,7 +10,7 @@ in {
imports = [nms.nixosModules.default];
environment.systemPackages = [
config.customPkgs.curseforge-server-downloader
self.packages.${pkgs.system}.curseforge-server-downloader
];
systemd.services.mc-steampunk.path = with pkgs; [curl];

View file

@ -1,10 +1,11 @@
{
config,
lib,
pkgs,
self,
...
}: let
inherit (lib) mkDefault mkBefore;
inherit (config.customPkgs) pam-fprint-grosshack;
inherit (self.packages.${pkgs.system}) pam-fprint-grosshack;
pam_fprintd_grosshackSo = "${pam-fprint-grosshack}/lib/security/pam_fprintd_grosshack.so";

View file

@ -95,6 +95,10 @@
nixOnDroidConfigurations.default = mkNixOnDroid [./devices/android];
packages =
perSystem (system: pkgs:
import ./pkgs ({inherit self system pkgs;} // inputs));
devShells = perSystem (_: pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [

View file

@ -5,6 +5,7 @@
gtk-session-lock,
lib,
pkgs,
self,
...
}: let
inherit (lib) boolToString;
@ -101,7 +102,7 @@ in {
// (import ./icons.nix {inherit pkgs agsConfigDir;});
packages =
[config.customPkgs.coloryou]
[self.packages.${pkgs.system}.coloryou]
++ (with pkgs; [
# ags
dart-sass

23
pkgs/default.nix Normal file
View file

@ -0,0 +1,23 @@
{
pkgs,
curseforge-server-downloader-src,
pam-fprint-grosshack-src,
pokemon-colorscripts-src,
...
}: {
coloryou = pkgs.callPackage ./coloryou {};
curseforge-server-downloader = pkgs.callPackage ./curseforge-server-downloader {
inherit curseforge-server-downloader-src;
};
pam-fprint-grosshack = pkgs.callPackage ./pam-fprint-grosshack {
inherit pam-fprint-grosshack-src;
};
pokemon-colorscripts = pkgs.callPackage ./pokemon-colorscripts {
inherit pokemon-colorscripts-src;
};
repl = pkgs.callPackage ./repl {};
}

View file

@ -17,7 +17,7 @@ in
;;
*)
if [ -z "$1" ]; then
nix repl --arg flakePath $(${coreutils}/bin/readlink -f "/etc/nixos") --file ${repl}
nix repl --arg flakePath $(${coreutils}/bin/readlink -f "$FLAKE") --file ${repl}
else
nix repl --arg flakePath $(${coreutils}/bin/readlink -f $1 | ${gnused}/bin/sed 's|/flake.nix||') --file ${repl}
fi