added basic example

This commit is contained in:
didier amyot committed 2022-10-27 14:48:40 -04:00
commit 8e82650fb4
5 files changed
+181

No files matched your search

+1
View File
@@ -0,0 +1 @@
result
+62
View File
@@ -0,0 +1,62 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, llvmPackages
, libxml2
, zlib
}:
stdenv.mkDerivation rec {
pname = "zig";
version = "0.9.1";
src = fetchFromGitHub {
owner = "ziglang";
repo = pname;
rev = version;
hash = "sha256-x2c4c9RSrNWGqEngio4ArW7dJjW0gg+8nqBwPcR721k=";
};
# Fix index out of bounds reading RPATH (cherry-picked from 0.10-dev)
patches = [ ./rpath.patch ];
nativeBuildInputs = [
cmake
llvmPackages.llvm.dev
];
buildInputs = [
libxml2
zlib
] ++ (with llvmPackages; [
libclang
lld
llvm
]);
preBuild = ''
export HOME=$TMPDIR;
'';
cmakeFlags = [
# file RPATH_CHANGE could not write new RPATH
"-DCMAKE_SKIP_BUILD_RPATH=ON"
];
doCheck = true;
checkPhase = ''
runHook preCheck
./zig test --cache-dir "$TMPDIR" -I $src/test $src/test/behavior.zig
runHook postCheck
'';
meta = with lib; {
homepage = "https://ziglang.org/";
description =
"General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
license = licenses.mit;
maintainers = with maintainers; [ aiotter andrewrk AndersonTorres ];
platforms = platforms.unix;
};
}
Generated
+77
View File
@@ -0,0 +1,77 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": {
"lastModified": 1666887363,
"narHash": "sha256-+bs3z5wk57MHmqTELsx62jrySYJbiWfQIW+Tj79oNGI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d3f21617acace32097a53b0b74fb5000d333d094",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1662996720,
"narHash": "sha256-XvLQ3SuXnDMJMpM1sv1ifPjBuRytiDYhB12H/BNTjgY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5f326e2a403e1cebaec378e72ceaf5725983376d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1666703756,
"narHash": "sha256-GwpMJ1hT+z1fMAUkaGtvbvofJQwdVFDEGVhfE82+AUk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f994293d1eb8812f032e8919e10a594567cf6ef7",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2"
}
},
"utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
+33
View File
@@ -0,0 +1,33 @@
{
description = "Question about home-manager.";
inputs = {
home-manager.url = "github:nix-community/home-manager";
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = { home-manager, nixpkgs, self,... }:
let
ubuntuSystem = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux ;
modules = [
{
nixpkgs = {
config = { allowUnfree = true; };
};
imports = [./ubuntu.nix];
}
{
home = {
username = "didier";
homeDirectory = "/home/didier";
stateVersion = "22.11";
};
}
];
};
in
{
defaultPackage.x86_64-linux = ubuntuSystem.activationPackage;
};
}
+8
View File
@@ -0,0 +1,8 @@
# Home manager options: https://nix-community.github.io/home-manager/options.html
{config
, pkgs
,...}:
{
home.packages = with pkgs; [clojure jq];
}