summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-11-28 21:30:46 +0100
committerlassulus <lassulus@lassul.us>2018-11-28 22:18:54 +0100
commit95f6255f586e93e096d56de75add76d7560b9df1 (patch)
tree49af1b35f6aa8b3269ec977c26527fead211e936
parenta69175a719b34222c8fb734478f04190a50d70e8 (diff)
* krops: merge krebs-nixpkgs into krebs-source
-rw-r--r--jeschli/krops.nix4
-rw-r--r--krebs/krops.nix38
-rw-r--r--lass/krops.nix4
-rw-r--r--tv/krops.nix4
4 files changed, 21 insertions, 29 deletions
diff --git a/jeschli/krops.nix b/jeschli/krops.nix
index fff014377..989abcdd0 100644
--- a/jeschli/krops.nix
+++ b/jeschli/krops.nix
@@ -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 {
diff --git a/krebs/krops.nix b/krebs/krops.nix
index 1058e73c0..ab7524941 100644
--- a/krebs/krops.nix
+++ b/krebs/krops.nix
@@ -7,28 +7,27 @@
# TODO document why pkgs should be used like this
pkgs = import "${krops}/pkgs" {};
- krebs-nixpkgs = { test ? false }: if test then {
- nixpkgs.file = {
- path = toString (pkgs.fetchFromGitHub {
- owner = "nixos";
- repo = "nixpkgs";
- rev = (lib.importJSON ./nixpkgs.json).rev;
- sha256 = (lib.importJSON ./nixpkgs.json).sha256;
- });
- useChecksum = true;
- };
- } else {
- nixpkgs.git = {
- ref = (lib.importJSON ./nixpkgs.json).rev;
- url = https://github.com/NixOS/nixpkgs;
+ krebs-source = { test ? false }: rec {
+ nixpkgs = if test then {
+ file = {
+ path = toString (pkgs.fetchFromGitHub {
+ owner = "nixos";
+ repo = "nixpkgs";
+ rev = (lib.importJSON ./nixpkgs.json).rev;
+ sha256 = (lib.importJSON ./nixpkgs.json).sha256;
+ });
+ useChecksum = true;
+ };
+ } else {
+ 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 {
diff --git a/lass/krops.nix b/lass/krops.nix
index 26668de65..d64454ea5 100644
--- a/lass/krops.nix
+++ b/lass/krops.nix
@@ -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 {
diff --git a/tv/krops.nix b/tv/krops.nix
index 3b60d3208..af0e8616a 100644
--- a/tv/krops.nix
+++ b/tv/krops.nix
@@ -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;