summaryrefslogtreecommitdiffstats
path: root/krebs/krops.nix
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 /krebs/krops.nix
parenta69175a719b34222c8fb734478f04190a50d70e8 (diff)
* krops: merge krebs-nixpkgs into krebs-source
Diffstat (limited to 'krebs/krops.nix')
-rw-r--r--krebs/krops.nix38
1 files changed, 18 insertions, 20 deletions
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 {