dotfiles/nix/packages/atom-shell/flake.nix
Richard Brežák b26266a917 Flake changes
2021-03-04 19:23:32 +01:00

46 lines
1.5 KiB
Nix

{
inputs = {
# Omitted, not a flake...
};
outputs = { self, nixpkgs, atom, nixpkgs-mozilla, rlib, .. }:
let
cargoLock = ./Cargo.lock;
rustChannelsOverlay = import "${nixpkgs-mozilla}/rust-overlay.nix";
in
{
overlay = system: final: prev:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
rustChannelsOverlay
(self: super: let
nightlyChannel = (super.rustChannelOf { sha256 = "y5iX4AJfCWccwgbeYVZbEYs2B8w9UplvivKlNEv+wRk="; channel = "nightly"; });
in {
rustc = nightlyChannel.rust;
inherit (nightlyChannel) cargo rust rust-std;
})
];
};
atomNix = derivation {
name = "atom-shell-locked";
builder = pkgs.writeShellScript "builder.sh" ''
${pkgs.coreutils}/bin/mkdir $out
${pkgs.coreutils}/bin/cp -r ${atom}/* $out
${pkgs.coreutils}/bin/cp ${./Cargo.nix} $out/Cargo.nix
'';
inherit system;
};
in
with final; {
atom-shell = (import "${atomNix}/Cargo.nix" { inherit nixpkgs pkgs; }).rootCrate.build;
};
defaultPackage = forAllSystems (system: (import nixpkgs {
inherit system;
overlays = [ (self.overlay system) ];
}).atom-shell);
};
}