add Nix flake
This commit is contained in:
parent
e08e44c43c
commit
5c20bd47f2
4 changed files with 136 additions and 0 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,2 +1,6 @@
|
|||
# Zig
|
||||
.zig-cache/
|
||||
zig-out/
|
||||
|
||||
# Nix
|
||||
result*
|
||||
|
|
27
deps.nix
Normal file
27
deps.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
# generated by zon2nix (https://github.com/nix-community/zon2nix)
|
||||
|
||||
{ linkFarm, fetchzip }:
|
||||
|
||||
linkFarm "zig-packages" [
|
||||
{
|
||||
name = "12201bbf05e1fb73323a9b13d2599dc4bf82851e6d328d7523a1af5b861a87edf286";
|
||||
path = fetchzip {
|
||||
url = "https://git.sr.ht/~leon_plickat/zig-ini/archive/879c74a3a801d49fa34343aebd55a22f591899b3.tar.gz";
|
||||
hash = "sha256-in7abjMSWtnmrri2tbTJW2WVL4ZLrKkTT8Bxy8njJT4=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "12202727aaaf0e742d4945be55af1ace8b25902095e0c1b0a24b70cc80a81b7ac518";
|
||||
path = fetchzip {
|
||||
url = "https://git.sr.ht/~leon_plickat/zig-spoon/archive/fdba8e643c9558254bf4e6c600dfbd782fa7a267.tar.gz";
|
||||
hash = "sha256-c8V+HqtDMW6JBDKilzrC39GizvWPp1eMton1X4PpxJI=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "1220c65aff8d8dd585df1ca026dc5d5860977cd0e303340029b77549ebb9c882b8c7";
|
||||
path = fetchzip {
|
||||
url = "https://git.sr.ht/~leon_plickat/zig-exre/archive/565ff0a83ea62389714ad439c49fa6bfdc21f5a9.tar.gz";
|
||||
hash = "sha256-JJ34UiOwbja2OUQ8bAnIXHfq7ezFd4MNk2+INNt4YLM=";
|
||||
};
|
||||
}
|
||||
]
|
61
flake.lock
Normal file
61
flake.lock
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1724224976,
|
||||
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"utils": "utils"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
44
flake.nix
Normal file
44
flake.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
description = "NFM - Neat File Manager.";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, utils
|
||||
,
|
||||
}: utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
rec
|
||||
{
|
||||
packages.nfm = pkgs.stdenv.mkDerivation {
|
||||
name = "nfm";
|
||||
src = ./.;
|
||||
dontConfigure = true;
|
||||
dontFixup = true;
|
||||
|
||||
nativeBuildInputs = with pkgs; [ zig_0_13.hook ];
|
||||
|
||||
postPatch = ''
|
||||
mkdir -p $ZIG_GLOBAL_CACHE_DIR
|
||||
ln -s ${pkgs.callPackage ./deps.nix { }} $ZIG_GLOBAL_CACHE_DIR/p
|
||||
'';
|
||||
};
|
||||
|
||||
packages.default = packages.nfm;
|
||||
|
||||
devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
zig_0_13
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in a new issue