Skip to content

Commit

Permalink
build(nix): drop rust-overlay and simplify (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses authored Nov 23, 2024
1 parent 0d52962 commit c36c9fe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 119 deletions.
63 changes: 4 additions & 59 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 18 additions & 59 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

outputs =
{
self,
nixpkgs,
rust-overlay,
...
}:
let
systems = [
Expand All @@ -23,58 +13,27 @@
"x86_64-darwin"
"x86_64-linux"
];
inherit (nixpkgs) lib;
forEachSystem =
f:
(lib.listToAttrs (
map (system: {
name = system;
value = f {
inherit system;
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
};
}) systems
));
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsFor = nixpkgs.legacyPackages;
in
{
devShells = forEachSystem (
{ pkgs, system }:
{
default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.default ];
devShells = forEachSystem (system: {
default = pkgsFor.${system}.mkShell {
inputsFrom = [ self.packages.${system}.default ];

packages = [
(pkgs.rust-bin.stable.latest.default.override {
extensions = [
"rustfmt"
"rust-analyzer"
"clippy"
];
})
];
};
}
);
packages = with pkgsFor.${system}; [
cargo
clippy
rust-analyzer
rustfmt
];
};
});

packages = forEachSystem (
{ pkgs, system }:
{
default = self.packages.${system}.whiskers;
whiskers = pkgs.callPackage ./default.nix {
rustPlatform =
let
toolchain = pkgs.rust-bin.stable.latest.default;
in
pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
};
};
}
);
packages = forEachSystem (system: {
default = self.packages.${system}.whiskers;
whiskers = pkgsFor.${system}.callPackage ./default.nix { };
});

overlays.default = final: _: { catppuccin-whiskers = final.callPackage ./default.nix { }; };
};
Expand Down
2 changes: 1 addition & 1 deletion src/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn from_values(
tera::Value::String(s) => {
let iterable = iterables
.get(s.as_str())
.ok_or(Error::UnknownIterable { name: s.clone() })?;
.ok_or_else(|| Error::UnknownIterable { name: s.clone() })?;
Ok((s, iterable.clone()))
}
tera::Value::Object(o) => {
Expand Down

0 comments on commit c36c9fe

Please sign in to comment.