flake.packages: dont export stuff from nixpkgs package sets

This commit is contained in:
chayleaf 2023-10-26 22:22:39 +07:00
parent 598044863f
commit ceeb526ec5
Signed by: chayleaf
GPG key ID: 78171AD46227E68E
5 changed files with 24 additions and 75 deletions

View file

@ -100,7 +100,7 @@
if nixpkgs.lib.hasInfix ":" addr then "[${addr}]" else addr; if nixpkgs.lib.hasInfix ":" addr then "[${addr}]" else addr;
}; };
# can't use callPackage ./pkgs here, idk why; use import instead # can't use callPackage ./pkgs here, idk why; use import instead
overlay = self: super: import ./pkgs { overlay' = args: self: super: import ./pkgs ({
pkgs = super; pkgs = super;
pkgs' = self; pkgs' = self;
lib = super.lib; lib = super.lib;
@ -109,16 +109,17 @@
nurpkgs = super; nurpkgs = super;
}; };
nix-gaming = nix-gaming.packages.${super.system}; nix-gaming = nix-gaming.packages.${super.system};
}; } // args);
overlay = overlay' { };
# I override some settings down the line, but overlays always stay the same # I override some settings down the line, but overlays always stay the same
mkPkgs = config: import nixpkgs (config // { mkPkgs = config: import nixpkgs (config // {
overlays = (config.overlays or [ ]) ++ [ overlay ]; overlays = config.overlays or [ ] ++ [ overlay ];
}); });
# this is actual config, it gets processed below # this is actual config, it gets processed below
config = let config = let
mkBpiR3 = args: config: config // { mkBpiR3 = args: config: config // {
system = "aarch64-linux"; system = "aarch64-linux";
modules = (config.modules or [ ]) ++ [ (import ./system/devices/bpi-r3-router.nix args) ]; modules = config.modules or [ ] ++ [ (import ./system/devices/bpi-r3-router.nix args) ];
}; };
routerConfig = rec { routerConfig = rec {
system = "aarch64-linux"; system = "aarch64-linux";
@ -304,7 +305,7 @@
packages = lib.genAttrs [ packages = lib.genAttrs [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
] (system: let self = overlay ((mkPkgs { inherit system; }) // self) (import nixpkgs { inherit system; }); in self); ] (system: let self = overlay' { isOverlay = false; } (mkPkgs { inherit system; } // self) (import nixpkgs { inherit system; }); in self);
nixosImages.router = let pkgs = mkPkgs { inherit (config.router-emmc) system; }; in { nixosImages.router = let pkgs = mkPkgs { inherit (config.router-emmc) system; }; in {
emmcImage = pkgs.callPackage ./system/hardware/bpi-r3/image.nix { emmcImage = pkgs.callPackage ./system/hardware/bpi-r3/image.nix {
inherit (nixosConfigurations.router-emmc) config; inherit (nixosConfigurations.router-emmc) config;

View file

@ -13,7 +13,7 @@
cfg.enableKeePassXC = true; cfg.enableKeePassXC = true;
}; };
profiles.chayleaf = { profiles.chayleaf = {
extensions = with config.nur.repos.rycee.firefox-addons; [ extensions = (with config.nur.repos.rycee.firefox-addons; [
cookies-txt cookies-txt
don-t-fuck-with-paste don-t-fuck-with-paste
greasemonkey greasemonkey
@ -32,7 +32,7 @@
unpaywall unpaywall
vimium-c vimium-c
youtube-shorts-block youtube-shorts-block
] ++ (with pkgs.firefox-addons; [ ]) ++ (with pkgs.firefoxAddons; [
fastforwardteam fastforwardteam
middle-mouse-button-scroll middle-mouse-button-scroll
rikaitan rikaitan

View file

@ -3,6 +3,7 @@
, nur , nur
, nix-gaming , nix-gaming
, pkgs' ? pkgs , pkgs' ? pkgs
, isOverlay ? true
, ... }: , ... }:
let let
inherit (pkgs') callPackage; inherit (pkgs') callPackage;
@ -98,8 +99,8 @@ in
})); }));
techmino = callPackage ./techmino { }; techmino = callPackage ./techmino { };
firefox-addons = lib.recurseIntoAttrs (callPackage ./firefox-addons { inherit nur sources; }); firefoxAddons = lib.recurseIntoAttrs (callPackage ./firefox-addons { inherit nur sources; });
mpvScripts = pkgs.mpvScripts // callPackage ./mpv-scripts { }; mpvScripts = lib.optionalAttrs isOverlay pkgs.mpvScripts // callPackage ./mpv-scripts { };
qemu_7 = callPackage ./qemu/7.nix { qemu_7 = callPackage ./qemu/7.nix {
stdenv = pkgs'.ccacheStdenv; stdenv = pkgs'.ccacheStdenv;
@ -127,6 +128,6 @@ in
stdenv = pkgs'.ccacheStdenv; stdenv = pkgs'.ccacheStdenv;
}; };
} }
// import ./postgresql-packages { inherit pkgs pkgs' lib sources; } // import ./postgresql-packages { inherit pkgs pkgs' lib sources isOverlay; }
// import ./ccache.nix { inherit pkgs pkgs' lib sources; } // import ./ccache.nix { inherit pkgs pkgs' lib sources; }
// import ../system/hardware/bpi-r3/pkgs.nix { inherit pkgs pkgs' lib sources; } // import ../system/hardware/bpi-r3/pkgs.nix { inherit pkgs pkgs' lib sources; }

View file

@ -1,5 +1,7 @@
{ pkgs { pkgs
, pkgs' , pkgs'
, isOverlay
, lib
, ... }: , ... }:
let let
@ -9,7 +11,9 @@ let
tsja = callPackage ./tsja.nix { }; tsja = callPackage ./tsja.nix { };
}; };
gen' = postgresql: builtins.mapAttrs (k: v: v.override { inherit postgresql; }) extraPackages; gen' = postgresql: builtins.mapAttrs (k: v: v.override { inherit postgresql; }) extraPackages;
gen = ver: pkgs."postgresql${toString ver}Packages" // gen' pkgs."postgresql${if ver == "" then "" else "_" + toString ver}"; gen = ver:
lib.optionalAttrs isOverlay pkgs."postgresql${toString ver}Packages"
// gen' pkgs."postgresql${if ver == "" then "" else "_" + toString ver}";
psql = ver: let psql = ver: let
old = pkgs."postgresql${if ver == "" then "" else "_" + toString ver}"; old = pkgs."postgresql${if ver == "" then "" else "_" + toString ver}";
in old // { pkgs = old.pkgs // gen' old; }; in old // { pkgs = old.pkgs // gen' old; };
@ -23,18 +27,19 @@ let
''; '';
}); });
postgresqlPackages = gen ""; postgresqlPackages = gen "";
postgresql = psql "";
postgresql11Packages = gen 11; postgresql11Packages = gen 11;
postgresql_11 = psql 11;
postgresql12Packages = gen 12; postgresql12Packages = gen 12;
postgresql_12 = psql 12;
postgresql13Packages = gen 13; postgresql13Packages = gen 13;
postgresql_13 = psql 13;
postgresql14Packages = gen 14; postgresql14Packages = gen 14;
postgresql_14 = psql 14;
postgresql15Packages = gen 15; postgresql15Packages = gen 15;
postgresql_15 = psql 15;
postgresql16Packages = gen 16; postgresql16Packages = gen 16;
} // lib.optionalAttrs isOverlay {
postgresql = psql "";
postgresql_11 = psql 11;
postgresql_12 = psql 12;
postgresql_13 = psql 13;
postgresql_14 = psql 14;
postgresql_15 = psql 15;
postgresql_16 = psql 16; postgresql_16 = psql 16;
}; };
in self in self

View file

@ -1,58 +0,0 @@
{ config
, lib
, ... }:
let
cfg = config.server;
in {
services.nginx.virtualHosts."git.${cfg.domainName}" = let inherit (config.services.forgejo) settings; in {
quic = true;
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://${lib.quoteListenAddr settings.server.HTTP_ADDR}:${toString settings.server.HTTP_PORT}";
};
services.forgejo = {
enable = true;
database = {
createDatabase = false;
user = "gitea";
passwordFile = "/secrets/forgejo_db_password";
type = "postgres";
};
lfs.enable = true;
settings = {
federation.ENABLED = true;
"git.timeout" = {
DEFAULT = 6000;
MIGRATE = 60000;
MIRROR = 60000;
GC = 120;
};
mailer = {
ENABLED = true;
FROM = "Forgejo <noreply@${cfg.domainName}>";
PROTOCOL = "smtp";
SMTP_ADDR = "mail.${cfg.domainName}";
SMTP_PORT = 587;
USER = "noreply@${cfg.domainName}";
PASSWD = cfg.unhashedNoreplyPassword;
FORCE_TRUST_SERVER_CERT = true;
};
session = {
COOKIE_SECURE = true;
};
server = {
ROOT_URL = "https://git.${cfg.domainName}";
HTTP_ADDR = "::1";
HTTP_PORT = 3310;
DOMAIN = "git.${cfg.domainName}";
# START_SSH_SERVER = true;
# SSH_PORT = 2222;
};
service = {
DISABLE_REGISTRATION = false;
REGISTER_MANUAL_CONFIRM = true;
};
};
};
}