* 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 { name }: let
inherit (import ../krebs/krops.nix { inherit name; }) inherit (import ../krebs/krops.nix { inherit name; })
krebs-nixpkgs
krebs-source krebs-source
lib lib
pkgs pkgs
; ;
source = { test }: lib.evalSource [ source = { test }: lib.evalSource [
(krebs-nixpkgs { test = test; }) (krebs-source { test = test; })
krebs-source
{ {
nixos-config.symlink = "stockholm/jeschli/1systems/${name}/config.nix"; nixos-config.symlink = "stockholm/jeschli/1systems/${name}/config.nix";
secrets = if test then { secrets = if test then {

View File

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

View File

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

View File

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