Skip to content

Commit

Permalink
feat(devshell): update rust
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Sep 23, 2023
1 parent 37c2ae2 commit 355ee01
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 26 deletions.
21 changes: 21 additions & 0 deletions evalModules/devshell/modules/language/rust.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
options = with lib; {
overlays = mkOption {
type = types.lazyAttrsOf (
types.uniq (
types.functionTo (types.functionTo (types.lazyAttrsOf types.unspecified))
)
);
apply = lib.mapAttrs (
_k: f: final: prev:
f final prev
);
default = { };
example = lib.literalExpression or lib.literalExample ''
{
default = final: prev: {};
}
'';
};
};
}
8 changes: 6 additions & 2 deletions evalModules/devshell/profiles/rust.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
let
pkgs' = nixpkgs.appendOverlays [ fenix.overlays.default ];
pkgs' = nixpkgs.appendOverlays [ config.language.rust.overlays.default ];
in
{
imports = [ (extraModulesPath + "/language/rust.nix") ];
imports = [
POS.devshellModules.language.rust
(extraModulesPath + "/language/rust.nix")
];

language.rust = {
overlays = fenix.overlays;
packageSet = pkgs'.fenix.default;
enableDefaultToolchain = true;
tools = [ "toolchain" ];
Expand Down
26 changes: 6 additions & 20 deletions flake.lock

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

2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@
};
}).outputsForTarget.default;

test = self;

evalModules = {
devshell = rec {
loadModules = flops.lib.haumea.pops.default.setInit {
Expand Down
2 changes: 1 addition & 1 deletion tests/_snapshots/devshell
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#json
{"rust":"/nix/store/1fnvpi7rxxk8vayyi7kincsc4cz7sn1x-devshell"}
{"rust":"/nix/store/43i35s8ih0kk6hhnbidbpf9ip5bj1g1w-rust"}
2 changes: 1 addition & 1 deletion tests/devshell/expr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let
}).exports.default;

shell = inputs.devshell.mkShell {
name = "devshell";
name = "rust";
imports = [ devshellProfiles.rust ];
};
in
Expand Down

0 comments on commit 355ee01

Please sign in to comment.