mirror of
https://github.com/nix-community/comma.git
synced 2024-09-11 03:55:24 +03:00
add overlay
this way avoids importing nixpkgs
This commit is contained in:
parent
034a9ca440
commit
13102d58c2
24
flake.lock
24
flake.lock
@ -3,11 +3,11 @@
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1648199409,
|
||||
"narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=",
|
||||
"lastModified": 1650374568,
|
||||
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "64a525ee38886ab9028e6f61790de0832aa3ef03",
|
||||
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -23,11 +23,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1650101877,
|
||||
"narHash": "sha256-IYxYc5Z1ZHQDTQbTWsOZ9HlZepsVjgV5oZwmbKzxSJs=",
|
||||
"lastModified": 1653413650,
|
||||
"narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "naersk",
|
||||
"rev": "8cc379478819e6a22ce7595a761fe1e17c8d7458",
|
||||
"rev": "69daaceebe12c070cd5ae69ba38f277bbf033695",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -39,11 +39,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1650109093,
|
||||
"narHash": "sha256-tqlnKrAdJktRLXTou9le0oTqrYBAFpGscV5RADdpArU=",
|
||||
"lastModified": 1654398695,
|
||||
"narHash": "sha256-Kw/KeoFXszNsF5mORP45mrxCP+k9Aq03hWcuWCL9sdI=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "faad370edcb37162401be50d45526f52bb16a713",
|
||||
"rev": "c5d810f4c74c824ae0fb788103003c6c9d366a08",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -63,11 +63,11 @@
|
||||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1649676176,
|
||||
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
|
||||
"lastModified": 1653893745,
|
||||
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678",
|
||||
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
66
flake.nix
66
flake.nix
@ -15,36 +15,48 @@
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, naersk, flake-compat }:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
naersk-lib = pkgs.callPackage naersk { };
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
default = self.packages."${system}".comma;
|
||||
comma = naersk-lib.buildPackage {
|
||||
pname = "comma";
|
||||
root = ./.;
|
||||
nativeBuildInputs = with pkgs; [ makeWrapper ];
|
||||
overrideMain = _: {
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/comma \
|
||||
--prefix PATH : ${lib.makeBinPath (with pkgs; [ nix fzy nix-index-unwrapped ])}
|
||||
ln -s $out/bin/comma $out/bin/,
|
||||
'';
|
||||
};
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
commaLambda = pkgs:
|
||||
let
|
||||
naersk-lib = pkgs.callPackage naersk { };
|
||||
in
|
||||
naersk-lib.buildPackage {
|
||||
pname = "comma";
|
||||
root = ./.;
|
||||
nativeBuildInputs = with pkgs; [ makeWrapper ];
|
||||
overrideMain = _: {
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/comma \
|
||||
--prefix PATH : ${lib.makeBinPath (with pkgs; [ nix fzy nix-index-unwrapped ])}
|
||||
ln -s $out/bin/comma $out/bin/,
|
||||
'';
|
||||
};
|
||||
};
|
||||
in
|
||||
utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
default = self.packages."${system}".comma;
|
||||
comma = commaLambda pkgs;
|
||||
};
|
||||
|
||||
apps.default = utils.lib.mkApp {
|
||||
drv = self.packages."${system}".default;
|
||||
};
|
||||
apps.default = utils.lib.mkApp {
|
||||
drv = self.packages."${system}".default;
|
||||
};
|
||||
|
||||
devShells.default = with pkgs; mkShell {
|
||||
nativeBuildInputs = [ cargo rustc rustfmt rustPackages.clippy fzy ];
|
||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
||||
};
|
||||
devShells.default = with pkgs; mkShell {
|
||||
nativeBuildInputs = [ cargo rustc rustfmt rustPackages.clippy fzy ];
|
||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
||||
};
|
||||
})
|
||||
// {
|
||||
overlays.default = (final: prev: {
|
||||
comma = commaLambda prev;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user