Skip to content

Commit

Permalink
Update flake inputs; move to buildNimPackage
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimschmidt557 committed Feb 19, 2024
1 parent 58eae7f commit 5feac28
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 85 deletions.
71 changes: 18 additions & 53 deletions flake.lock

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

37 changes: 5 additions & 32 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,26 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";

inputs.nimbox = {
url = "github:dom96/nimbox";
flake = false;
};

inputs.lscolors = {
url = "github:joachimschmidt557/nim-lscolors/v0.3.3";
flake = false;
};

inputs.wcwidth = {
url = "github:shoyu777/wcwidth-nim/v0.1.3";
flake = false;
};

outputs = { self, nixpkgs, flake-utils, nimbox, lscolors, wcwidth }:
outputs = { self, nixpkgs, flake-utils }:
(flake-utils.lib.eachDefaultSystem
(system:

let pkgs = nixpkgs.legacyPackages.${system}; in
rec {

packages.nimmm =
pkgs.stdenv.mkDerivation {
pkgs.buildNimPackage {
pname = "nimmm";
version = "master";

src = self;

nativeBuildInputs = with pkgs; [ nim ];
buildInputs = with pkgs; [ termbox pcre ];

NIX_LDFLAGS = "-lpcre";
lockFile = ./lock.json;

buildPhase = ''
export HOME=$TMPDIR;
nim --threads:on -p:${nimbox} -p:${lscolors}/src -p:${wcwidth}/src c -d:release src/nimmm.nim
'';

installPhase = ''
install -Dt $out/bin src/nimmm
'';
buildInputs = with pkgs; [ termbox pcre ];
};

defaultPackage = packages.nimmm;

})) // {
hydraJobs.nimmm.x86_64-linux = self.packages.x86_64-linux.nimmm;
};
}));
}
40 changes: 40 additions & 0 deletions lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"depends": [
{
"method": "fetchzip",
"packages": [
"lscolors"
],
"path": "/nix/store/h2rqjnvjg3xihh88f2hm72506vpklilz-source",
"ref": "v0.3.3",
"rev": "668b46c835944254a445b9cc6dfb887e38fa13f1",
"sha256": "0526hqh46lcfsvymb67ldsc8xbfn24vicn3b8wrqnh6mag8wynf4",
"srcDir": "src",
"url": "https://github.com/joachimschmidt557/nim-lscolors/archive/668b46c835944254a445b9cc6dfb887e38fa13f1.tar.gz"
},
{
"method": "fetchzip",
"packages": [
"nimbox"
],
"path": "/nix/store/dyv48md5gaz0x61fxi2zc69h05a3jvfq-source",
"ref": "master",
"rev": "6a56e76c01481176f16ae29b7d7c526bd83f229b",
"sha256": "15x1sdfxa1xcqnr68705jfnlv83lm0xnp2z9iz3pgc4bz5vwn4x1",
"srcDir": "",
"url": "https://github.com/dom96/nimbox/archive/6a56e76c01481176f16ae29b7d7c526bd83f229b.tar.gz"
},
{
"method": "fetchzip",
"packages": [
"wcwidth"
],
"path": "/nix/store/inpq6nm27r7ixyjsdsm4sg6qna7d2vbc-source",
"ref": "v0.1.3",
"rev": "fd60d2dd10fd945a471450551ba471c3be80df52",
"sha256": "06b9ylqbjcxgm9mjfzljbi8gr9sbajykcqpcxgyqymynqyhxmqjn",
"srcDir": "src",
"url": "https://github.com/shoyu777/wcwidth-nim/archive/fd60d2dd10fd945a471450551ba471c3be80df52.tar.gz"
}
]
}

0 comments on commit 5feac28

Please sign in to comment.