more silly refactors

This commit is contained in:
Daylin Morgan 2024-08-09 11:57:03 -05:00
parent 8c1f72b605
commit df15bc9621
Signed by: daylin
GPG key ID: 950D13E9719334AD
3 changed files with 36 additions and 19 deletions

View file

@ -2,10 +2,10 @@
inputs, inputs,
system, system,
lib, lib,
self,
}: }:
let let
inherit (builtins) map; inherit (lib) flakeFromSystem attrValues;
inherit (lib) flakeFromSystem;
flake = flakeFromSystem system; flake = flakeFromSystem system;
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
@ -16,25 +16,23 @@ let
(flake.overlay "nixpkgs-wayland") (flake.overlay "nixpkgs-wayland")
]; ];
}; };
myPackages = map [
"tsm"
"hyprman"
"zls"
] flake.pkg;
hyprPackages = with (flake.pkgs "hyprland"); [ hyprPackages = with (flake.pkgs "hyprland"); [
default default
xdg-desktop-portal-hyprland xdg-desktop-portal-hyprland
]; ];
selfPackages = (attrValues self.packages.${pkgs.system});
in in
# selfPackages = self.packages.${pkgs.system} |> attrValues;
{ {
makePackages = makePackages =
pkgs.runCommandLocal "build-third-party" pkgs.runCommandLocal "build-third-party"
{ {
src = ./.; src = ./.;
nativeBuildInputs = nativeBuildInputs =
# packages from overlays
(with pkgs; [ (with pkgs; [
pixi
swww swww
nixVersions.stable nixVersions.stable
]) ])
@ -42,9 +40,8 @@ in
(flake.pkgs "roc").full (flake.pkgs "roc").full
(flake.pkgs "zig2nix").zig.master.bin (flake.pkgs "zig2nix").zig.master.bin
] ]
++ myPackages ++ hyprPackages
++ hyprPackages; ++ selfPackages;
} }
'' ''
mkdir "$out" mkdir "$out"

View file

@ -3,22 +3,40 @@ let
lib = nixpkgs.lib.extend (import ./extended.nix inputs); lib = nixpkgs.lib.extend (import ./extended.nix inputs);
inherit (builtins) mapAttrs readDir listToAttrs; inherit (builtins) mapAttrs readDir listToAttrs;
inherit (lib) genAttrs; inherit (lib) genAttrs pkgFromSystem pkgsFromSystem;
inherit (import ./find-modules.nix { inherit lib; }) findModulesList; inherit (import ./find-modules.nix { inherit lib; }) findModulesList;
inherit (import ./generators.nix { inherit lib self inputs; }) mkIso mkSystem; inherit (import ./generators.nix { inherit lib self inputs; }) mkIso mkSystem;
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; #supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
supportedSystems = [ "x86_64-linux" ]; supportedSystems = [ "x86_64-linux" ];
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; })); forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
inheritFlakePkgs =
pkgs: flakes:
listToAttrs (
map (name: {
inherit name;
value = pkgFromSystem pkgs.system name;
}) flakes
);
oizysFlake = { oizysFlake = {
nixosModules = listToAttrs (findModulesList ../modules); nixosModules = listToAttrs (findModulesList ../modules);
nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts); nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
packages = forAllSystems (pkgs: rec { packages = forAllSystems (
pkgs:
rec {
default = oizys-cli;
oizys-cli = pkgs.callPackage ../pkgs/oizys { };
iso = mkIso.config.system.build.isoImage; iso = mkIso.config.system.build.isoImage;
oizys-go = pkgs.callPackage ../pkgs/oizys { }; roc = (pkgsFromSystem pkgs.system "roc").full;
default = oizys-go; }
}); // (inheritFlakePkgs pkgs [
"pixi"
"f1multiviewer"
"tsm"
])
);
devShells = forAllSystems (pkgs: { devShells = forAllSystems (pkgs: {
default = pkgs.mkShell { default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
@ -30,7 +48,7 @@ let
checks = forAllSystems ( checks = forAllSystems (
pkgs: pkgs:
import ./checks.nix { import ./checks.nix {
inherit inputs lib; inherit inputs lib self;
system = pkgs.system; system = pkgs.system;
} }
); );

View file

@ -24,5 +24,7 @@ buildGoModule {
installShellCompletion --cmd oizys \ installShellCompletion --cmd oizys \
--zsh <(OIZYS_SKIP_CHECK=true $out/bin/oizys completion zsh) --zsh <(OIZYS_SKIP_CHECK=true $out/bin/oizys completion zsh)
''; '';
meta = {
description = "nix begat oizys";
};
} }