packages: don't include self and inputs in perSystem

This commit is contained in:
Max Headroom 2023-01-08 19:07:20 +01:00
parent 43bc27c281
commit af019b1079
10 changed files with 291 additions and 279 deletions

View file

@ -1,11 +1,11 @@
{ pkgs, ... }:
{ {
imports = [ imports = [
./options.nix
./drv-parts ./drv-parts
]; ];
perSystem = { pkgs, ... }: {
imports = [
./options.nix
];
builders = rec { builders = rec {
fetchAsset = pkgs.callPackage ./fetch-asset { }; fetchAsset = pkgs.callPackage ./fetch-asset { };
@ -14,4 +14,5 @@
inherit fetchAsset; inherit fetchAsset;
}; };
}; };
};
} }

View file

@ -1,6 +1,6 @@
{ config, inputs, ... }: { inputs, ... }:
{ {
perSystem = { config, ... }: {
imports = [ imports = [
./backends ./backends
./dependency-sets ./dependency-sets
@ -8,4 +8,5 @@
_module.args = { _module.args = {
drv-backends = inputs.drv-parts.drv-backends // config.drv-backends; drv-backends = inputs.drv-parts.drv-backends // config.drv-backends;
}; };
};
} }

View file

@ -1,5 +1,7 @@
{ filters, pkgs, self, self', ... }: { self, ... }:
{ {
perSystem = { filters, pkgs, self', ... }: {
checks = filters.doFilter filters.checks { checks = filters.doFilter filters.checks {
keycloak = pkgs.callPackage ./keycloak-custom-jre.nix { keycloak = pkgs.callPackage ./keycloak-custom-jre.nix {
jre = self'.packages.jre17_standard; jre = self'.packages.jre17_standard;
@ -12,4 +14,5 @@
inherit (self'.packages) tempo; inherit (self'.packages) tempo;
}; };
}; };
};
} }

View file

@ -1,6 +1,9 @@
{ lib, config, inputs', system, ... }: { lib, ... }:
with lib;
let {
perSystem = { config, inputs', system, ... }:
with lib;
let
inherit (inputs'.devshell.legacyPackages) mkShell; inherit (inputs'.devshell.legacyPackages) mkShell;
wrapInAttrs = value: if builtins.isAttrs value then value else { inherit value; }; wrapInAttrs = value: if builtins.isAttrs value then value else { inherit value; };
@ -34,7 +37,7 @@ let
} }
]; ];
}; };
in { in {
options.projectShells = mkOption { options.projectShells = mkOption {
default = {}; default = {};
type = types.attrsOf (types.submodule { type = types.attrsOf (types.submodule {
@ -63,5 +66,5 @@ in {
}); });
}; };
config.devShells = lib.mkIf (system == "x86_64-linux") (mapAttrs (_: mkProjectShell) config.projectShells); config.devShells = lib.mkIf (system == "x86_64-linux") (mapAttrs (_: mkProjectShell) config.projectShells);
};
} }

View file

@ -1,6 +1,7 @@
{ inputs, lib, pkgs, ... }: { lib, inputs, ... }:
{ {
perSystem = { pkgs, ... }: {
projectShells.hyprspace = { projectShells.hyprspace = {
tools = [ tools = [
pkgs.go_1_18 pkgs.go_1_18
@ -37,4 +38,5 @@
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.linux ++ platforms.darwin;
}; };
}; };
};
} }

View file

@ -1,6 +1,6 @@
{ inputs, lib, pkgs, ... }: { inputs, ... }:
{ {
perSystem = { lib, pkgs, ... }: {
projectShells.ipfs-cluster = { projectShells.ipfs-cluster = {
tools = [ tools = [
pkgs.go_1_19 pkgs.go_1_19
@ -55,4 +55,5 @@
maintainers = with maintainers; [ Luflosi jglukasik ]; maintainers = with maintainers; [ Luflosi jglukasik ];
}; };
}; };
};
} }

View file

@ -1,6 +1,17 @@
{ inputs, self, ... }: { inputs, self, ... }:
{ {
imports = [
./checks
./modules/devshell.nix
./build-support
./networking/hyprspace/project.nix
./networking/ipfs-cluster/project.nix
./servers/reflex-cache/project.nix
./websites/landing/project.nix
./websites/stop-using-nix-env/project.nix
];
perSystem = { filters, pkgs, self', ... }: perSystem = { filters, pkgs, self', ... }:
let let
inherit (self'.packages) nix-super; inherit (self'.packages) nix-super;
@ -16,19 +27,6 @@
}; };
in in
{ {
_module.args = { inherit inputs self; };
imports = [
./checks
./modules/devshell.nix
./build-support
./networking/hyprspace/project.nix
./networking/ipfs-cluster/project.nix
./servers/reflex-cache/project.nix
./websites/landing/project.nix
./websites/stop-using-nix-env/project.nix
];
packages = filters.doFilter filters.packages rec { packages = filters.doFilter filters.packages rec {
cinny = pkgs.callPackage ./web-apps/cinny { inherit pins; }; cinny = pkgs.callPackage ./web-apps/cinny { inherit pins; };

View file

@ -1,6 +1,7 @@
{ config, drv-backends, inputs, lib, pkgs, ... }: { inputs, ... }:
let {
perSystem = { config, drv-backends, lib, pkgs, ... }: let
deps = with config.dependencySets.python3Packages; [ deps = with config.dependencySets.python3Packages; [
poetry-core poetry-core
requests-unixsocket requests-unixsocket
@ -9,8 +10,8 @@ let
]; ];
pythonForDev = pkgs.python3.withPackages (lib.const deps); pythonForDev = pkgs.python3.withPackages (lib.const deps);
in in
{ {
projectShells.reflex-cache = { projectShells.reflex-cache = {
tools = [ tools = [
pythonForDev pythonForDev
@ -35,4 +36,5 @@ in
]; ];
}; };
}; };
};
} }

View file

@ -1,5 +1,5 @@
{ builders, lib, pkgs, self', ... }: {
let perSystem = { builders, lib, pkgs, self', ... }: let
configFile = pkgs.writeText "hugo-config.json" (builtins.toJSON { configFile = pkgs.writeText "hugo-config.json" (builtins.toJSON {
title = "Private Void | Zero-maintenance perfection"; title = "Private Void | Zero-maintenance perfection";
baseURL = "https://www.privatevoid.net/"; baseURL = "https://www.privatevoid.net/";
@ -17,8 +17,8 @@ let
"--config" configFile "--config" configFile
]; ];
hugoArgsStr = lib.concatStringsSep " " hugoArgs; hugoArgsStr = lib.concatStringsSep " " hugoArgs;
in in
{ {
projectShells.landing = { projectShells.landing = {
commands.hugo = { commands.hugo = {
help = pkgs.hugo.meta.description; help = pkgs.hugo.meta.description;
@ -51,4 +51,5 @@ in
}; };
}; };
in site; in site;
};
} }

View file

@ -1,6 +1,5 @@
{ pkgs, ... }:
{ {
perSystem = { pkgs, ... }: {
packages.stop-using-nix-env = let packages.stop-using-nix-env = let
site = with pkgs; stdenvNoCC.mkDerivation rec { site = with pkgs; stdenvNoCC.mkDerivation rec {
pname = "stop-using-nix-env"; pname = "stop-using-nix-env";
@ -16,4 +15,5 @@
}; };
}; };
in site; in site;
};
} }