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 ./vars
./modules ./modules
./pkgs
nur.nixosModules.nur nur.nixosModules.nur
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
@ -100,7 +99,6 @@
./home ./home
./home/trash-d ./home/trash-d
./pkgs
]; ];
home.packages = home.packages =

View file

@ -1,10 +1,10 @@
{ {
config,
pkgs, pkgs,
self,
... ...
}: { }: {
home.packages = home.packages =
(with config.customPkgs; [ (with self.packages.${pkgs.system}; [
pokemon-colorscripts pokemon-colorscripts
repl 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, config,
nms, nms,
pkgs, pkgs,
self,
... ...
}: let }: let
inherit (config.vars) mainUser; inherit (config.vars) mainUser;
@ -9,7 +10,7 @@ in {
imports = [nms.nixosModules.default]; imports = [nms.nixosModules.default];
environment.systemPackages = [ environment.systemPackages = [
config.customPkgs.curseforge-server-downloader self.packages.${pkgs.system}.curseforge-server-downloader
]; ];
systemd.services.mc-steampunk.path = with pkgs; [curl]; systemd.services.mc-steampunk.path = with pkgs; [curl];

View file

@ -1,18 +1,19 @@
{ {
config,
lib, lib,
pkgs,
self,
... ...
}: let }: let
inherit (lib) mkDefault mkBefore; 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"; pam_fprintd_grosshackSo = "${pam-fprint-grosshack}/lib/security/pam_fprintd_grosshack.so";
# https://wiki.archlinux.org/title/Fprint#Login_configuration # https://wiki.archlinux.org/title/Fprint#Login_configuration
grosshackConf = '' grosshackConf = ''
# pam-fprint-grosshack # pam-fprint-grosshack
auth sufficient ${pam_fprintd_grosshackSo} timeout=99 auth sufficient ${pam_fprintd_grosshackSo} timeout=99
auth sufficient pam_unix.so try_first_pass nullok auth sufficient pam_unix.so try_first_pass nullok
''; '';
in { in {
services.fprintd.enable = true; services.fprintd.enable = true;

View file

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

View file

@ -5,6 +5,7 @@
gtk-session-lock, gtk-session-lock,
lib, lib,
pkgs, pkgs,
self,
... ...
}: let }: let
inherit (lib) boolToString; inherit (lib) boolToString;
@ -101,7 +102,7 @@ in {
// (import ./icons.nix {inherit pkgs agsConfigDir;}); // (import ./icons.nix {inherit pkgs agsConfigDir;});
packages = packages =
[config.customPkgs.coloryou] [self.packages.${pkgs.system}.coloryou]
++ (with pkgs; [ ++ (with pkgs; [
# ags # ags
dart-sass 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 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 else
nix repl --arg flakePath $(${coreutils}/bin/readlink -f $1 | ${gnused}/bin/sed 's|/flake.nix||') --file ${repl} nix repl --arg flakePath $(${coreutils}/bin/readlink -f $1 | ${gnused}/bin/sed 's|/flake.nix||') --file ${repl}
fi fi