convert to flake

master 3.7.0
Kierán Meinhardt 3 years ago committed by tv
parent d1424777b5
commit 66a1f68334
  1. 42
      flake.lock
  2. 28
      flake.nix
  3. 3
      lib/default.nix
  4. 6
      pkgs/default.nix

@ -0,0 +1,42 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1677608380,
"narHash": "sha256-k82O23qBAK+43X0KSBjsMYXG2x4kWWXeAmpPTc2KRGY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4aba90e89f6d4ac6138939961f62842bd94ec929",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

@ -0,0 +1,28 @@
{
description = "nix library extension, containing sophisticated script and code generator functions";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
}: let
nix-writersOverlay = import ./pkgs;
in
{
overlays = {
nix-writers = nix-writersOverlay;
default = nix-writersOverlay;
};
}
// flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
nix-writers = nix-writersOverlay pkgs pkgs;
in {
legacyPackages = nix-writers;
});
}

@ -1,3 +1,4 @@
{ nixpkgs }:
let {
body = lib;
@ -19,6 +20,4 @@ let {
testString = re: x: match re x != null;
types = nixpkgs.lib.types // import ./types.nix { lib = body; };
});
nixpkgs.lib = import <nixpkgs/lib>;
}

@ -17,9 +17,9 @@
# nix-build hello_world.nix.
#
with import ../lib;
pkgs: oldpkgs: {
pkgs: oldpkgs:
with import ../lib { nixpkgs = pkgs; };
{
exec = name: { filename, argv ? null, envp ? null, destination ? "" }:
pkgs.writeC name { inherit destination; } /* c */ ''
#include <unistd.h>

Loading…
Cancel
Save