Skip to content

Commit

Permalink
Add flake.nix (#226)
Browse files Browse the repository at this point in the history
* Add nix flake support

* Use derivation from nixpkgs in flake

---------

Co-authored-by: b3nj5m1n <b3nj4m1n@gmx.net>
  • Loading branch information
nullishamy and b3nj5m1n authored Mar 12, 2023
1 parent 72a7791 commit b03a94b
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
dist-newstyle
.stack-work
result/
result
41 changes: 41 additions & 0 deletions flake.lock

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

37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
inputs = {
nixpkgs.url = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system:
let
runtimeDependencies = with pkgs; [
glow
jq
];
overlays = [
(self: super: {
xdg-ninja = super.xdg-ninja.overrideAttrs (old: {
version = "git";
src = ./.;
});
})
];
pkgs = import nixpkgs { inherit system overlays; };
in rec {
packages = flake-utils.lib.flattenTree {
xdg-ninja = pkgs.xdg-ninja;
};
defaultPackage = packages.xdg-ninja;
apps = {
xdg-ninja = flake-utils.lib.mkApp { drv = packages.xdg-ninja; };
};
defaultApp = apps.xdg-ninja;
}
);
}

0 comments on commit b03a94b

Please # to comment.