* krops: merge krebs-nixpkgs into krebs-source

This commit is contained in:
lassulus 2018-11-28 21:30:46 +01:00
parent a69175a719
commit 95f6255f58
4 changed files with 21 additions and 29 deletions

View File

@ -1,14 +1,12 @@
{ name }: let
inherit (import ../krebs/krops.nix { inherit name; })
krebs-nixpkgs
krebs-source
lib
pkgs
;
source = { test }: lib.evalSource [
(krebs-nixpkgs { test = test; })
krebs-source
(krebs-source { test = test; })
{
nixos-config.symlink = "stockholm/jeschli/1systems/${name}/config.nix";
secrets = if test then {

View File

@ -7,8 +7,9 @@
# TODO document why pkgs should be used like this
pkgs = import "${krops}/pkgs" {};
krebs-nixpkgs = { test ? false }: if test then {
nixpkgs.file = {
krebs-source = { test ? false }: rec {
nixpkgs = if test then {
file = {
path = toString (pkgs.fetchFromGitHub {
owner = "nixos";
repo = "nixpkgs";
@ -18,17 +19,15 @@
useChecksum = true;
};
} else {
nixpkgs.git = {
git = {
ref = (lib.importJSON ./nixpkgs.json).rev;
url = https://github.com/NixOS/nixpkgs;
};
};
krebs-source = {
stockholm.file = toString ../.;
stockholm-version.pipe = toString (pkgs.writeDash "${name}-version" ''
set -efu
cd ${lib.escapeShellArg krebs-source.stockholm.file}
cd ${lib.escapeShellArg stockholm.file}
V=$(${pkgs.coreutils}/bin/date +%y.%m)
if test -d .git; then
V=$V.git.$(${pkgs.git}/bin/git describe --always --dirty)
@ -41,8 +40,7 @@
};
source ={ test }: lib.evalSource [
(krebs-nixpkgs { test = test; })
krebs-source
(krebs-source { test = test; })
{
nixos-config.symlink = "stockholm/krebs/1systems/${name}/config.nix";
secrets = if test then {

View File

@ -1,6 +1,5 @@
{ name }: let
inherit (import ../krebs/krops.nix { inherit name; })
krebs-nixpkgs
krebs-source
lib
pkgs
@ -13,8 +12,7 @@
;
source = { test }: lib.evalSource [
(krebs-nixpkgs { test = test; })
krebs-source
(krebs-source { test = test; })
{
nixos-config.symlink = "stockholm/lass/1systems/${name}/physical.nix";
secrets = if test then {

View File

@ -1,15 +1,13 @@
{ name }: rec {
inherit (import ../krebs/krops.nix { inherit name; })
krebs-nixpkgs
krebs-source
lib
pkgs
;
source = lib.evalSource [
(krebs-nixpkgs { test = true; })
krebs-source
(krebs-source { test = true; })
{
nixos-config.symlink = "stockholm/tv/1systems/${name}/config.nix";
secrets.file = toString ./dummy_secrets;