refactor: flake.parts!
This commit is contained in:
parent
7e5b7accfb
commit
be35fad15d
16 changed files with 91 additions and 87 deletions
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
|
@ -27,24 +27,6 @@ jobs:
|
||||||
- run: nix build '.#rimgo'
|
- run: nix build '.#rimgo'
|
||||||
- run: nix build '.#website-docs-nifoc-pw'
|
- run: nix build '.#website-docs-nifoc-pw'
|
||||||
|
|
||||||
build-x86_64-darwin:
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: cachix/install-nix-action@v20
|
|
||||||
with:
|
|
||||||
nix_path: nixpkgs=channel:nixpkgs-unstable
|
|
||||||
- uses: cachix/cachix-action@v12
|
|
||||||
with:
|
|
||||||
name: nifoc
|
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
||||||
- run: nix build '.#cliclick'
|
|
||||||
- run: nix build '.#fennel-ls'
|
|
||||||
- run: nix build '.#liblpeg-darwin'
|
|
||||||
- run: nix build '.#neovim-nightly'
|
|
||||||
- run: nix build '.#phantomjs'
|
|
||||||
- run: nix build '.#q'
|
|
||||||
|
|
||||||
build-arm64-linux:
|
build-arm64-linux:
|
||||||
runs-on: buildjet-2vcpu-ubuntu-2204-arm
|
runs-on: buildjet-2vcpu-ubuntu-2204-arm
|
||||||
steps:
|
steps:
|
||||||
|
|
37
flake.lock
37
flake.lock
|
@ -1,5 +1,23 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1683560683,
|
||||||
|
"narHash": "sha256-XAygPMN5Xnk/W2c1aW0jyEa6lfMDZWlQgiNtmHXytPc=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "006c75898cf814ef9497252b022e91c946ba8e17",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1667395993,
|
||||||
|
@ -54,8 +72,27 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"dir": "lib",
|
||||||
|
"lastModified": 1682879489,
|
||||||
|
"narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"dir": "lib",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
"neovim-flake": "neovim-flake",
|
"neovim-flake": "neovim-flake",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
|
50
flake.nix
50
flake.nix
|
@ -3,31 +3,55 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
|
|
||||||
neovim-flake = {
|
neovim-flake = {
|
||||||
url = "github:neovim/neovim?dir=contrib";
|
url = "github:neovim/neovim?dir=contrib";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ self, nixpkgs, ... }: {
|
outputs = inputs@{ flake-parts, ... }:
|
||||||
packages = nixpkgs.lib.genAttrs
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
[
|
systems = [
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
"x86_64-darwin"
|
"x86_64-darwin"
|
||||||
"aarch64-linux"
|
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
]
|
"aarch64-linux"
|
||||||
(system: import ./packages.nix {
|
];
|
||||||
inherit system;
|
|
||||||
inherit (nixpkgs) lib;
|
|
||||||
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
imports = [
|
||||||
|
flake-parts.flakeModules.easyOverlay
|
||||||
|
];
|
||||||
|
|
||||||
otherPkgs = {
|
perSystem = { inputs', system, config, pkgs, lib, ... }: {
|
||||||
neovim = inputs.neovim-flake.packages.${system};
|
packages =
|
||||||
|
let
|
||||||
|
darwinPackages =
|
||||||
|
if lib.hasSuffix "darwin" system then rec {
|
||||||
|
agilebits-op = import ./packages/agilebits-op.nix { inherit pkgs lib; };
|
||||||
|
cliclick = import ./packages/cliclick.nix { inherit pkgs lib; };
|
||||||
|
liblpeg = import ./packages/liblpeg-darwin.nix { inherit pkgs; };
|
||||||
|
neovim-nightly = import ./packages/neovim-nightly.nix { inherit (inputs'.neovim-flake.packages) neovim; inherit liblpeg lib; };
|
||||||
|
phantomjs = import ./packages/phantomjs.nix { inherit pkgs lib; };
|
||||||
|
} else {
|
||||||
|
neovim-nightly = import ./packages/neovim-nightly.nix { inherit (inputs'.neovim-flake.packages) neovim; inherit lib; };
|
||||||
};
|
};
|
||||||
});
|
in
|
||||||
|
{
|
||||||
|
anonymous-overflow = import ./packages/anonymous-overflow.nix { inherit pkgs lib; };
|
||||||
|
fennel-ls = import ./packages/fennel-ls.nix { inherit pkgs lib; };
|
||||||
|
nitter-unstable = import ./packages/nitter-unstable.nix { inherit pkgs lib; };
|
||||||
|
q = import ./packages/q.nix { inherit pkgs lib; };
|
||||||
|
rimgo = import ./packages/rimgo.nix { inherit pkgs lib; };
|
||||||
|
website-docs-nifoc-pw = import ./packages/website-docs-nifoc-pw.nix { inherit pkgs; };
|
||||||
|
} // darwinPackages;
|
||||||
|
|
||||||
overlay = import ./overlay.nix;
|
overlayAttrs = config.packages;
|
||||||
|
};
|
||||||
|
|
||||||
|
flake = {
|
||||||
|
overlay = inputs.self.overlays.default;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
19
overlay.nix
19
overlay.nix
|
@ -1,19 +0,0 @@
|
||||||
_: super:
|
|
||||||
|
|
||||||
let
|
|
||||||
custom = super.callPackage ./packages.nix { };
|
|
||||||
in
|
|
||||||
{
|
|
||||||
inherit (custom) agilebits-op;
|
|
||||||
inherit (custom) anonymous-overflow;
|
|
||||||
inherit (custom) cliclick;
|
|
||||||
inherit (custom) fennel-ls;
|
|
||||||
inherit (custom) nitter-unstable;
|
|
||||||
inherit (custom) phantomjs;
|
|
||||||
inherit (custom) q;
|
|
||||||
inherit (custom) rimgo;
|
|
||||||
inherit (custom) website-docs-nifoc-pw;
|
|
||||||
|
|
||||||
inherit (custom) liblpeg-darwin;
|
|
||||||
inherit (custom) neovim-nightly;
|
|
||||||
}
|
|
16
packages.nix
16
packages.nix
|
@ -1,16 +0,0 @@
|
||||||
{ system, lib, pkgs, otherPkgs }:
|
|
||||||
|
|
||||||
rec {
|
|
||||||
agilebits-op = import ./packages/agilebits-op.nix { inherit system lib pkgs; };
|
|
||||||
anonymous-overflow = import ./packages/anonymous-overflow.nix { inherit system lib pkgs; };
|
|
||||||
cliclick = import ./packages/cliclick.nix { inherit system lib pkgs; };
|
|
||||||
fennel-ls = import ./packages/fennel-ls.nix { inherit system lib pkgs; };
|
|
||||||
nitter-unstable = import ./packages/nitter-unstable.nix { inherit system lib pkgs; };
|
|
||||||
phantomjs = import ./packages/phantomjs.nix { inherit system lib pkgs; };
|
|
||||||
q = import ./packages/q.nix { inherit system lib pkgs; };
|
|
||||||
rimgo = import ./packages/rimgo.nix { inherit system lib pkgs; };
|
|
||||||
website-docs-nifoc-pw = import ./packages/website-docs-nifoc-pw.nix { inherit system lib pkgs; };
|
|
||||||
|
|
||||||
liblpeg-darwin = import ./packages/liblpeg-darwin.nix { inherit system lib pkgs; };
|
|
||||||
neovim-nightly = import ./packages/neovim-nightly.nix { inherit system lib pkgs otherPkgs liblpeg-darwin; };
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs, lib }:
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation rec {
|
||||||
pname = "agilebits-op";
|
pname = "agilebits-op";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs, lib }:
|
||||||
|
|
||||||
pkgs.buildGoModule rec {
|
pkgs.buildGoModule rec {
|
||||||
pname = "anonymous-overflow";
|
pname = "anonymous-overflow";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs, lib }:
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation rec {
|
||||||
pname = "cliclick";
|
pname = "cliclick";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs, lib }:
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation rec {
|
||||||
pname = "fennel-ls";
|
pname = "fennel-ls";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs }:
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
pname = "liblpeg";
|
pname = "liblpeg";
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
{ pkgs, otherPkgs, lib, liblpeg-darwin, ... }:
|
{ neovim, liblpeg ? null, lib, ... }:
|
||||||
|
|
||||||
let
|
neovim.overrideAttrs (oa: {
|
||||||
inherit (pkgs.stdenv) isDarwin;
|
nativeBuildInputs = oa.nativeBuildInputs ++ lib.optionals (liblpeg != null) [
|
||||||
inherit (lib) optionals;
|
liblpeg
|
||||||
in
|
|
||||||
otherPkgs.neovim.neovim.overrideAttrs (oa: {
|
|
||||||
nativeBuildInputs = oa.nativeBuildInputs ++ optionals isDarwin [
|
|
||||||
liblpeg-darwin
|
|
||||||
];
|
];
|
||||||
|
|
||||||
patches = builtins.filter
|
patches = builtins.filter
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs, lib }:
|
||||||
|
|
||||||
let
|
let
|
||||||
nimPackages = pkgs.nimPackages;
|
nimPackages = pkgs.nimPackages;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs, lib }:
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation rec {
|
||||||
pname = "phantomjs";
|
pname = "phantomjs";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs, lib }:
|
||||||
|
|
||||||
pkgs.buildGoModule rec {
|
pkgs.buildGoModule rec {
|
||||||
pname = "q";
|
pname = "q";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs, lib }:
|
||||||
|
|
||||||
pkgs.buildGoModule rec {
|
pkgs.buildGoModule rec {
|
||||||
pname = "rimgo";
|
pname = "rimgo";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ system, lib, pkgs }:
|
{ pkgs }:
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation {
|
||||||
pname = "website-docs-nifoc-pw";
|
pname = "website-docs-nifoc-pw";
|
||||||
version = "2021-08-30";
|
version = "2021-08-30";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue