Skip to content

Commit 25e9418

Browse files
committed
feat: devshell with rust versions
1 parent e152714 commit 25e9418

File tree

1 file changed

+47
-36
lines changed

1 file changed

+47
-36
lines changed

flake.nix

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -633,41 +633,52 @@
633633
# ambient $PATH environment when you run 'nix develop'. This is useful
634634
# for development and puts many convenient devtools instantly within
635635
# reach.
636-
devShells = {
637-
default = pkgs.mkShell {
638-
packages = with pkgs; [
639-
coreutils
640-
just
641-
nix-update
642-
#pg_prove
643-
shellcheck
644-
ansible
645-
ansible-lint
646-
(packer.overrideAttrs (oldAttrs: {
647-
version = "1.7.8";
648-
}))
649-
650-
basePackages.start-server
651-
basePackages.start-client
652-
basePackages.start-replica
653-
basePackages.migrate-tool
654-
basePackages.sync-exts-versions
655-
];
656-
shellHook = ''
657-
export HISTFILE=.history
658-
'';
659-
};
660-
cargo-pgrx_0_11_3 = pkgs.mkShell {
661-
packages = with basePackages; [
662-
cargo-pgrx_0_11_3
663-
];
664-
};
665-
cargo-pgrx_0_12_6 = pkgs.mkShell {
666-
packages = with basePackages; [
667-
cargo-pgrx_0_12_6
668-
];
669-
};
636+
637+
devShells = let
638+
mkCargoPgrxDevShell = { pgrxVersion, rustVersion }: pkgs.mkShell {
639+
packages = with pkgs; [
640+
basePackages."cargo-pgrx_${pgrxVersion}"
641+
(rust-bin.stable.${rustVersion}.default.override {
642+
extensions = [ "rust-src" ];
643+
})
644+
];
645+
shellHook = ''
646+
export HISTFILE=.history
647+
'';
648+
};
649+
in {
650+
default = pkgs.mkShell {
651+
packages = with pkgs; [
652+
coreutils
653+
just
654+
nix-update
655+
#pg_prove
656+
shellcheck
657+
ansible
658+
ansible-lint
659+
(packer.overrideAttrs (oldAttrs: {
660+
version = "1.7.8";
661+
}))
662+
663+
basePackages.start-server
664+
basePackages.start-client
665+
basePackages.start-replica
666+
basePackages.migrate-tool
667+
basePackages.sync-exts-versions
668+
];
669+
shellHook = ''
670+
export HISTFILE=.history
671+
'';
672+
};
673+
cargo-pgrx_0_11_3 = mkCargoPgrxDevShell {
674+
pgrxVersion = "0_11_3";
675+
rustVersion = "1.80.0";
676+
};
677+
cargo-pgrx_0_12_6 = mkCargoPgrxDevShell {
678+
pgrxVersion = "0_12_6";
679+
rustVersion = "1.80.0";
670680
};
671-
}
672-
);
681+
};
682+
}
683+
);
673684
}

0 commit comments

Comments
 (0)