From 6c71792b6d22c7564b187fa6891fb8d36270a9ef Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 13 Oct 2016 21:49:50 +0200 Subject: krebs lib: with lib --- krebs/4lib/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index 49241cc82..c901a1bde 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -1,9 +1,12 @@ -{ config, lib, ... }: +_: + +let + lib = import ; +in -with builtins; with lib; -let out = import // rec { +let out = lib // rec { eq = x: y: x == y; ne = x: y: x != y; -- cgit v1.2.3 From 9cb65273b1e832f1bf7d98e977a0179c81d24b44 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 13 Oct 2016 21:01:22 +0200 Subject: lib: remove addName* --- krebs/4lib/default.nix | 5 ----- krebs/4lib/git.nix | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index c901a1bde..cf5395039 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -13,11 +13,6 @@ let out = lib // rec { mod = x: y: x - y * (x / y); - addName = name: set: - set // { inherit name; }; - - addNames = mapAttrs addName; - guard = spec@{ type, value, ... }: assert isOptionType type; if type.check value diff --git a/krebs/4lib/git.nix b/krebs/4lib/git.nix index d50ba2018..005c017a9 100644 --- a/krebs/4lib/git.nix +++ b/krebs/4lib/git.nix @@ -1,7 +1,12 @@ { lib, ... }: +with lib; + let - inherit (lib) addNames escapeShellArg makeSearchPath optionalString; + addName = name: set: + set // { inherit name; }; + + addNames = mapAttrs addName; commands = addNames { git-receive-pack = {}; -- cgit v1.2.3 From b4ec1fba50dc81df89cce88808dab1e232806cf4 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 13 Oct 2016 21:06:43 +0200 Subject: lib: inline has-default-nix --- krebs/4lib/default.nix | 2 -- krebs/5pkgs/default.nix | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index cf5395039..b95564f74 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -28,8 +28,6 @@ let out = lib // rec { lib = lib // { inherit genid optionalTrace; }; }; - dir.has-default-nix = path: pathExists (path + "/default.nix"); - genid = import ./genid.nix { lib = lib // out; }; genid_signed = x: ((genid x) + 16777216) / 2; git = import ./git.nix { lib = lib // out; }; diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index cdab64212..75d1dac82 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -17,7 +17,7 @@ with config.krebs.lib; in {} // import ./builders.nix args // mapAttrs (_: flip callPackage {}) - (filterAttrs (_: dir.has-default-nix) + (filterAttrs (_: dir: pathExists (dir + "/default.nix")) (subdirsOf ./.)) // { empty = pkgs.runCommand "empty-1.0.0" {} "mkdir $out"; -- cgit v1.2.3 From 1a5f52234e4a21f21eb198ed0bffeb7dc2168bdf Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 13 Oct 2016 21:18:40 +0200 Subject: krebs lib: move {eq,ne,mod} to lib --- krebs/4lib/default.nix | 5 ----- lib/default.nix | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index b95564f74..3f224edd1 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -8,11 +8,6 @@ with lib; let out = lib // rec { - eq = x: y: x == y; - ne = x: y: x != y; - - mod = x: y: x - y * (x / y); - guard = spec@{ type, value, ... }: assert isOptionType type; if type.check value diff --git a/lib/default.nix b/lib/default.nix index 6c607f13b..1f5010853 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,6 +1,10 @@ let lib = import // builtins // { shell = import ./shell.nix { inherit lib; }; + + eq = x: y: x == y; + ne = x: y: x != y; + mod = x: y: x - y * (x / y); }; in -- cgit v1.2.3 From b7cba0244358beb61aaab135cbe62c331ab6c900 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 13 Oct 2016 21:49:04 +0200 Subject: lib: don't define defaults that require config --- krebs/4lib/default.nix | 1 - krebs/4lib/types.nix | 13 +------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index 3f224edd1..c40b9a868 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -19,7 +19,6 @@ let out = lib // rec { ])); types = import ./types.nix { - inherit config; lib = lib // { inherit genid optionalTrace; }; }; diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix index 02ca2b8db..8d6ace2e5 100644 --- a/krebs/4lib/types.nix +++ b/krebs/4lib/types.nix @@ -1,14 +1,9 @@ -{ config, lib, ... }: +{ lib, ... }: with builtins; with lib; with types; -let - # Inherited attributes are used in submodules that have their own `config`. - inherit (config.krebs) build users; -in - types // rec { host = submodule ({ config, ... }: { @@ -27,7 +22,6 @@ types // rec { owner = mkOption { type = user; - default = users.krebs; }; extraZones = mkOption { @@ -49,10 +43,6 @@ types // rec { ssh.pubkey = mkOption { type = nullOr ssh-pubkey; default = null; - apply = x: - optionalTrace (x == null && config.owner.name == build.user.name) - "The option `krebs.hosts.${config.name}.ssh.pubkey' is unused." - x; }; ssh.privkey = mkOption { type = nullOr ssh-privkey; @@ -187,7 +177,6 @@ types // rec { }; owner = mkOption { type = user; - default = users.root; }; group-name = mkOption { type = str; -- cgit v1.2.3 From f81a021f0ccf900d8fdcc2c414ebac528f043760 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 13 Oct 2016 21:53:20 +0200 Subject: tv q: print TODOs first --- tv/5pkgs/q/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tv/5pkgs/q/default.nix b/tv/5pkgs/q/default.nix index b19402fa4..f923950f0 100644 --- a/tv/5pkgs/q/default.nix +++ b/tv/5pkgs/q/default.nix @@ -178,6 +178,11 @@ in pkgs.writeBashBin "q" '' set -eu export PATH=/var/empty + (${q-todo}) || : + if [ "$PWD" != "$HOME" ]; then + (HOME=$PWD; ${q-todo}) || : + fi + echo ${q-cal} echo ${q-isodate} @@ -189,8 +194,4 @@ pkgs.writeBashBin "q" '' (${q-online}) & (${q-thermal_zone}) & wait - ${q-todo} - if [ "$PWD" != "$HOME" ]; then - (HOME=$PWD; ${q-todo}) - fi '' -- cgit v1.2.3 From 9fb29a7030a168046983457f6f7cf9d943661c06 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 13 Oct 2016 21:57:08 +0200 Subject: xu: mount /bku --- tv/1systems/xu.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tv/1systems/xu.nix b/tv/1systems/xu.nix index 119399ac2..85ac23e9d 100644 --- a/tv/1systems/xu.nix +++ b/tv/1systems/xu.nix @@ -138,6 +138,11 @@ with config.krebs.lib; fsType = "btrfs"; options = ["defaults" "noatime" "ssd" "compress=lzo"]; }; + "/bku" = { + device = "/dev/mapper/xuvga-bku"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; "/home" = { device = "/dev/mapper/xuvga-home"; fsType = "btrfs"; -- cgit v1.2.3