From df15bc96215b2537957c4fa399219cfe2b926825 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 9 Aug 2024 11:57:03 -0500 Subject: [PATCH] more silly refactors --- lib/checks.nix | 19 ++++++++----------- lib/default.nix | 32 +++++++++++++++++++++++++------- pkgs/oizys/default.nix | 4 +++- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/lib/checks.nix b/lib/checks.nix index 188baf1..cec1c69 100644 --- a/lib/checks.nix +++ b/lib/checks.nix @@ -2,10 +2,10 @@ inputs, system, lib, + self, }: let - inherit (builtins) map; - inherit (lib) flakeFromSystem; + inherit (lib) flakeFromSystem attrValues; flake = flakeFromSystem system; pkgs = import inputs.nixpkgs { @@ -16,25 +16,23 @@ let (flake.overlay "nixpkgs-wayland") ]; }; - myPackages = map [ - "tsm" - "hyprman" - "zls" - ] flake.pkg; hyprPackages = with (flake.pkgs "hyprland"); [ default xdg-desktop-portal-hyprland ]; + + selfPackages = (attrValues self.packages.${pkgs.system}); in +# selfPackages = self.packages.${pkgs.system} |> attrValues; { makePackages = pkgs.runCommandLocal "build-third-party" { src = ./.; nativeBuildInputs = + # packages from overlays (with pkgs; [ - pixi swww nixVersions.stable ]) @@ -42,9 +40,8 @@ in (flake.pkgs "roc").full (flake.pkgs "zig2nix").zig.master.bin ] - ++ myPackages - ++ hyprPackages; - + ++ hyprPackages + ++ selfPackages; } '' mkdir "$out" diff --git a/lib/default.nix b/lib/default.nix index bf9cd53..5d8460e 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -3,22 +3,40 @@ let lib = nixpkgs.lib.extend (import ./extended.nix inputs); inherit (builtins) mapAttrs readDir listToAttrs; - inherit (lib) genAttrs; + inherit (lib) genAttrs pkgFromSystem pkgsFromSystem; inherit (import ./find-modules.nix { inherit lib; }) findModulesList; 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" ]; 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 = { nixosModules = listToAttrs (findModulesList ../modules); nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts); - packages = forAllSystems (pkgs: rec { - iso = mkIso.config.system.build.isoImage; - oizys-go = pkgs.callPackage ../pkgs/oizys { }; - default = oizys-go; - }); + packages = forAllSystems ( + pkgs: + rec { + default = oizys-cli; + oizys-cli = pkgs.callPackage ../pkgs/oizys { }; + iso = mkIso.config.system.build.isoImage; + roc = (pkgsFromSystem pkgs.system "roc").full; + } + // (inheritFlakePkgs pkgs [ + "pixi" + "f1multiviewer" + "tsm" + ]) + ); + devShells = forAllSystems (pkgs: { default = pkgs.mkShell { packages = with pkgs; [ @@ -30,7 +48,7 @@ let checks = forAllSystems ( pkgs: import ./checks.nix { - inherit inputs lib; + inherit inputs lib self; system = pkgs.system; } ); diff --git a/pkgs/oizys/default.nix b/pkgs/oizys/default.nix index cbd480f..2c58a8a 100644 --- a/pkgs/oizys/default.nix +++ b/pkgs/oizys/default.nix @@ -24,5 +24,7 @@ buildGoModule { installShellCompletion --cmd oizys \ --zsh <(OIZYS_SKIP_CHECK=true $out/bin/oizys completion zsh) ''; - + meta = { + description = "nix begat oizys"; + }; }