ma krops.nix: init
This commit is contained in:
parent
9c516e9504
commit
3c30bf0057
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="cake";
|
||||
full = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="darth";
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="drop";
|
||||
torrent = true;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name = "fileleech";
|
||||
torrent = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="filepimp";
|
||||
}
|
||||
|
5
makefu/1systems/full/source.nix
Normal file
5
makefu/1systems/full/source.nix
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
name="gum";
|
||||
torrent = true;
|
||||
clever_kexec = true;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="gum";
|
||||
torrent = true;
|
||||
clever_kexec = true;
|
||||
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="iso";
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="iso";
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name = "latte";
|
||||
torrent = true;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="nextgum";
|
||||
torrent = true;
|
||||
clever_kexec = true;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="omo";
|
||||
torrent = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="pnp";
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="repunit";
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="sdev";
|
||||
}
|
||||
|
3
makefu/1systems/shack-autoinstall/source.nix
Normal file
3
makefu/1systems/shack-autoinstall/source.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
name="iso";
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="shoney";
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="studio";
|
||||
musnix = true;
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="tsp";
|
||||
full = true;
|
||||
hw = true;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="vbob";
|
||||
# musnix = true;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="wbob";
|
||||
# musnix = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="wry";
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
import <stockholm/makefu/source.nix> {
|
||||
{
|
||||
name="x";
|
||||
full = true;
|
||||
python = true;
|
||||
hw = true;
|
||||
unstable = true;
|
||||
mic92 = true;
|
||||
clever_kexec = true;
|
||||
# torrent = true;
|
||||
}
|
||||
|
88
makefu/krops.nix
Normal file
88
makefu/krops.nix
Normal file
@ -0,0 +1,88 @@
|
||||
{ config ? config, name }: let
|
||||
krops = builtins.fetchGit {
|
||||
url = https://cgit.krebsco.de/krops/;
|
||||
rev = "4e466eaf05861b47365c5ef46a31a188b70f3615";
|
||||
};
|
||||
nixpkgs-src = lib.importJSON ./nixpkgs.json;
|
||||
lib = import "${krops}/lib";
|
||||
|
||||
# TODO document why pkgs should be used like this
|
||||
pkgs = import "${krops}/pkgs" {};
|
||||
hostSource = {
|
||||
secure = false;
|
||||
full = false;
|
||||
torrent = false;
|
||||
hw = false;
|
||||
musnix = false;
|
||||
python = false;
|
||||
unstable = false; #unstable channel checked out
|
||||
mic92 = false;
|
||||
nms = false;
|
||||
clever_kexec = false;
|
||||
} // import (./. + "/1systems/${name}/source.nix");
|
||||
source = { test }: lib.evalSource [
|
||||
{
|
||||
# nixos-18.03 @ 2018-08-06
|
||||
# + do_sqlite3 ruby: 55a952be5b5
|
||||
# + exfat-nofuse bump: ee6a5296a35
|
||||
# + uhub/sqlite: 5dd7610401747
|
||||
nixpkgs.git = {
|
||||
ref = nixpkgs-src.rev;
|
||||
url = nixpkgs-src.url;
|
||||
};
|
||||
nixos-config.symlink = "stockholm/makefu/1systems/${name}/config.nix";
|
||||
|
||||
stockholm.file = toString <stockholm>;
|
||||
secrets = if test then {
|
||||
file = toString (./. + "/0tests/data/secrets");
|
||||
} else {
|
||||
pass = {
|
||||
dir = "${lib.getEnv "HOME"}/.secrets-pass";
|
||||
inherit name;
|
||||
};
|
||||
};
|
||||
}
|
||||
(lib.mkIf (hostSource.torrent) {
|
||||
torrent-secrets = if test then {
|
||||
file = ./. + "/makefu/0tests/data/secrets";
|
||||
} else {
|
||||
pass = {
|
||||
dir = "${lib.getEnv "HOME"}/.secrets-pass";
|
||||
name = "torrent";
|
||||
};
|
||||
};
|
||||
})
|
||||
(lib.mkIf ( hostSource.musnix ) {
|
||||
musnix.git = {
|
||||
url = https://github.com/musnix/musnix.git;
|
||||
ref = "master"; # follow the musnix channel, lets see how this works out
|
||||
};
|
||||
})
|
||||
(lib.mkIf ( hostSource.hw ) {
|
||||
nixos-hardware.git = {
|
||||
url = https://github.com/nixos/nixos-hardware.git;
|
||||
ref = "30fdd53";
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
in {
|
||||
# usage: $(nix-build --no-out-link --argstr name HOSTNAME -A deploy)
|
||||
deploy = pkgs.krops.writeDeploy "${name}-deploy" {
|
||||
source = source { test = false; };
|
||||
target = "root@${name}/var/src";
|
||||
};
|
||||
|
||||
# usage: $(nix-build --no-out-link --argstr name HOSTNAME -A test)
|
||||
test = pkgs.krops.writeTest "${name}-test" {
|
||||
source = source { test = true; };
|
||||
target = "${lib.getEnv "HOME"}/tmp/${name}-krops-test-src";
|
||||
};
|
||||
|
||||
ci = map (host:
|
||||
pkgs.krops.writeTest "${host.name}-test" {
|
||||
source = source { test = true; };
|
||||
target = "${lib.getEnv "TMPDIR"}/makefu/${host.name}";
|
||||
}
|
||||
) (lib.filter (host: lib.getAttr "ci" host && host.owner == "makefu") (lib.attrValues config.krebs.hosts));
|
||||
}
|
7
makefu/nixpkgs.json
Normal file
7
makefu/nixpkgs.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"url": "https://github.com/makefu/nixpkgs",
|
||||
"rev": "8f991294288b27b9dec05cc1e07ec6a360bb39c8",
|
||||
"date": "2018-08-06T14:29:01+02:00",
|
||||
"sha256": "0zan8kdjk1pwdzm1rwc3ka87k11j0zmw4mdnj70r6pm38x2fa9n6",
|
||||
"fetchSubmodules": true
|
||||
}
|
9
makefu/update-channel.sh
Executable file
9
makefu/update-channel.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
dir=$(dirname $0)
|
||||
oldref=$(cat $dir/nixpkgs.json | jq -r .rev | sed 's/\(.\{7\}\).*/\1/')
|
||||
nix-shell -p nix-prefetch-git --run 'nix-prefetch-git \
|
||||
--url https://github.com/makefu/nixpkgs \
|
||||
--rev refs/heads/master' \
|
||||
> $dir/nixpkgs.json
|
||||
newref=$(cat $dir/nixpkgs.json | jq -r .rev | sed 's/\(.\{7\}\).*/\1/')
|
||||
echo git commit $dir/nixpkgs.json -m "nixpkgs: $oldref -> $newref"
|
Loading…
Reference in New Issue
Block a user