initial
This commit is contained in:
parent
01d83b0d4f
commit
fd7a151d74
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
result
|
128
flake.lock
Normal file
128
flake.lock
Normal file
|
@ -0,0 +1,128 @@
|
|||
{
|
||||
"nodes": {
|
||||
"cellular-automata": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1634256364,
|
||||
"narHash": "sha256-LnZG0lcVpbcVY0EXkppg7IDEk3mRPzXTqyL5liz0E0Y=",
|
||||
"ref": "master",
|
||||
"rev": "12e100c4172b7297752fdf94dad263992f9c2732",
|
||||
"revCount": 15,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/cellular-automata.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/cellular-automata.git"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1634851050,
|
||||
"narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c91f3de5adaf1de973b797ef7485e441a65b8935",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hello-world": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1632536588,
|
||||
"narHash": "sha256-ylRs2igKgo1l7etxeenjCwlW7zj6QrhxW5chpZeRISg=",
|
||||
"ref": "master",
|
||||
"rev": "586db93711138d2138716e37685aa16b00ead005",
|
||||
"revCount": 1,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/hello-world.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/hello-world.git"
|
||||
}
|
||||
},
|
||||
"krobotkin": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1635976222,
|
||||
"narHash": "sha256-gRE8fcCAX3WO5br26VEH722Kj5PIJvtT+G0lxkDlqrY=",
|
||||
"ref": "master",
|
||||
"rev": "d7cbfc269f23ff3df4dc8bb5b45a2fb65b91e7af",
|
||||
"revCount": 4,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/krobotkin.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/krobotkin.git"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1635808042,
|
||||
"narHash": "sha256-kQg7LzPj+UQlCAgD0dJhJ88QdzduXwIyqnTLXScKBbY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "550dab224a26ec25e20e82c0c8bfc764e01b772e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rf-hakyll": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1632269496,
|
||||
"narHash": "sha256-xyhOFBmjCX9LBL8j1NZ/NL4OGizdbQ0NWqbGsgT9OfE=",
|
||||
"ref": "master",
|
||||
"rev": "88e3735a2231570f07d5a06d50162ae09f07bf9e",
|
||||
"revCount": 1,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/rf-hakyll.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/rf-hakyll.git"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"cellular-automata": "cellular-automata",
|
||||
"flake-utils": "flake-utils",
|
||||
"hello-world": "hello-world",
|
||||
"krobotkin": "krobotkin",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rf-hakyll": "rf-hakyll",
|
||||
"universe": "universe"
|
||||
}
|
||||
},
|
||||
"universe": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1632536526,
|
||||
"narHash": "sha256-10I2OhdLD9WnJVVm1ZhxswuFtqv7cLj0R4mBrvs+lRg=",
|
||||
"ref": "master",
|
||||
"rev": "ba60a7ef25a294212db8ce8f9ab201295ca9d0ca",
|
||||
"revCount": 1,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/universe.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.p7.co.nz/thornAvery/universe.git"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
49
flake.nix
Normal file
49
flake.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
description = "Thorn's Haskell Repo";
|
||||
inputs = {
|
||||
#my-sources.url = "git+ssh://gitea@git.p7.co.nz/thornAvery/flake-inputs.git";
|
||||
#nixpkgs.follows = "my-sources/nixpkgs";
|
||||
#flake-utils.follows = "my-sources/flake-utils";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
cellular-automata = {
|
||||
url = "git+ssh://gitea@git.p7.co.nz/thornAvery/cellular-automata.git";
|
||||
flake = false;
|
||||
};
|
||||
krobotkin = {
|
||||
url = "git+ssh://gitea@git.p7.co.nz/thornAvery/krobotkin.git";
|
||||
flake = false;
|
||||
};
|
||||
rf-hakyll = {
|
||||
url = "git+ssh://gitea@git.p7.co.nz/thornAvery/rf-hakyll.git";
|
||||
flake = false;
|
||||
};
|
||||
universe = {
|
||||
url = "git+ssh://gitea@git.p7.co.nz/thornAvery/universe.git";
|
||||
flake = false;
|
||||
};
|
||||
hello-world = {
|
||||
url = "git+ssh://gitea@git.p7.co.nz/thornAvery/hello-world.git";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
outputs = { self, ... }@inputs:
|
||||
inputs.flake-utils.lib.eachSystem
|
||||
[ "x86_64-linux" ]
|
||||
(system:
|
||||
let pkgs = import inputs.nixpkgs {
|
||||
overlays = [ ((import ./overlay.nix) inputs) ];
|
||||
inherit system;
|
||||
};
|
||||
in rec {
|
||||
packages = inputs.flake-utils.lib.flattenTree
|
||||
((import ./utils.nix) { inherit pkgs; inherit inputs; });
|
||||
hydraJobs = builtins.listToAttrs
|
||||
(map (s: { name = s; value = {
|
||||
${system} = packages.${s};
|
||||
}; })
|
||||
(builtins.attrNames packages));
|
||||
}) // {
|
||||
overlay = (import ./overlay.nix) inputs;
|
||||
};
|
||||
}
|
14
overlay.nix
Normal file
14
overlay.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
inputs: final: prev: {
|
||||
haskellPackages = prev.haskellPackages.override {
|
||||
overrides = haskellSelf: haskellSuper:
|
||||
((import ./utils.nix) { inherit inputs; pkgs = prev; })
|
||||
// {
|
||||
chell-quickcheck = prev.haskell.lib.doJailbreak
|
||||
(prev.haskellPackages.chell-quickcheck);
|
||||
network = prev.haskell.lib.doJailbreak
|
||||
(prev.haskellPackages.network);
|
||||
gnuidn = prev.haskell.lib.dontCheck
|
||||
(prev.haskellPackages.gnuidn);
|
||||
};
|
||||
};
|
||||
}
|
7
packages.nix
Normal file
7
packages.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
inputs: [
|
||||
inputs.cellular-automata
|
||||
inputs.krobotkin
|
||||
inputs.rf-hakyll
|
||||
inputs.hello-world
|
||||
inputs.universe
|
||||
]
|
27
utils.nix
Normal file
27
utils.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
let
|
||||
fn = root: map (p: "${root}/" + p) (builtins.attrNames (builtins.readDir root));
|
||||
gn = root:
|
||||
let items = builtins.readDir root;
|
||||
fn = file: type:
|
||||
if type == "regular"
|
||||
then
|
||||
(let m = (builtins.match "(.*)\\.cabal" file);
|
||||
in if !(isNull m)
|
||||
then { "${builtins.elemAt m 0}" = root; }
|
||||
else {})
|
||||
else {};
|
||||
in builtins.foldl' (x: y: x // y) {} (builtins.attrValues (builtins.mapAttrs fn items));
|
||||
hn = s:
|
||||
builtins.filter
|
||||
(x: (builtins.hasAttr "flake" x) && !x.flake)
|
||||
s;
|
||||
packagePaths = builtins.foldl'
|
||||
(x: y: x // y)
|
||||
{}
|
||||
(map gn ((import ./packages.nix) inputs));
|
||||
in
|
||||
builtins.mapAttrs
|
||||
(name: path: pkgs.haskellPackages.callCabal2nix name path {})
|
||||
packagePaths
|
||||
|
Loading…
Reference in a new issue