Skip to content

Commit

Permalink
clean namings
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Apr 18, 2024
1 parent c579887 commit a066774
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

outputs = { self, nixpkgs, gitignore, fenix, naersk, ... }:
let
inherit (nixpkgs) lib;
inherit (gitignore.lib) gitignoreSource;

staticRustFlags = [ "-Ctarget-feature=+crt-static" ];
Expand Down Expand Up @@ -191,8 +192,9 @@
in
rust.buildPackage package;

# TODO: move this to postInstall
buildArchives = targetSystem:
let himalaya = pkgs.lib.getExe self.apps.${buildSystem}.${targetSystem};
let himalaya = self.apps.${buildSystem}.${targetSystem}.program;
in pkgs.writeShellScriptBin "himalaya-archives" ''
export WINEPREFIX="$(mktemp -d)"
mkdir -p {man,completions}
Expand All @@ -208,12 +210,10 @@

defaultPackage = buildPackage buildSystem crossSystems.${buildSystem}.${buildSystem};
packages = builtins.mapAttrs buildPackage crossSystems.${buildSystem};
archives = pkgs.lib.foldlAttrs (p: k: _: p // { "${k}-archives" = buildArchives k; }) { } crossSystems.${buildSystem};
archives = lib.foldlAttrs (p: k: _: p // { "${k}-archives" = buildArchives k; }) { } crossSystems.${buildSystem};

in
{
default = defaultPackage;
} // packages // archives;
{ default = defaultPackage; } // packages // archives;

mkApps = buildSystem:
let
Expand All @@ -237,12 +237,12 @@
in
{ default = defaultApp; } // apps;

supportedSystems = builtins.attrNames crossSystems;
mapSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
eachSystem = lib.genAttrs (builtins.attrNames crossSystems);

in
{
apps = mapSupportedSystem mkApps;
packages = mapSupportedSystem mkPackages;
devShells = mapSupportedSystem mkDevShells;
apps = eachSystem mkApps;
packages = eachSystem mkPackages;
devShells = eachSystem mkDevShells;
};
}

0 comments on commit a066774

Please sign in to comment.