krebs.users.krebs: init

This commit is contained in:
tv 2016-02-21 07:39:24 +01:00
parent e3ddf995e9
commit 67e5fddc0b
5 changed files with 24 additions and 17 deletions

View file

@ -104,11 +104,16 @@ let
retiolum = "hosts"; retiolum = "hosts";
}; };
krebs.users.root = { krebs.users = {
home = "/root"; krebs = {
name = "root"; home = "/krebs";
pubkey = config.krebs.build.host.ssh.pubkey; mail = "spam@krebsco.de";
uid = 0; };
root = {
home = "/root";
pubkey = config.krebs.build.host.ssh.pubkey;
uid = 0;
};
}; };
networking.extraHosts = concatStringsSep "\n" (flatten ( networking.extraHosts = concatStringsSep "\n" (flatten (

View file

@ -232,13 +232,15 @@ let
]) (filter (rule: rule.perm.allow-receive-ref != null) cfg.rules)); ]) (filter (rule: rule.perm.allow-receive-ref != null) cfg.rules));
}; };
users.extraUsers = singleton rec { # TODO cfg.user
users.users.git = rec {
description = "Git repository hosting user"; description = "Git repository hosting user";
name = "git"; name = "git";
shell = "/bin/sh"; shell = "/bin/sh";
openssh.authorizedKeys.keys = openssh.authorizedKeys.keys =
mapAttrsToList (_: makeAuthorizedKey git-ssh-command) mapAttrsToList (_: makeAuthorizedKey git-ssh-command)
config.krebs.users; (filterAttrs (_: user: isString user.pubkey)
config.krebs.users);
uid = genid name; uid = genid name;
}; };
}; };

View file

@ -10,6 +10,6 @@ let
type = types.attrs; type = types.attrs;
}; };
imp = { imp = {
krebs.lib = lib // import ../4lib { inherit lib; } // builtins; krebs.lib = lib // import ../4lib { inherit config lib; } // builtins;
}; };
in out in out

View file

@ -1,4 +1,4 @@
{ lib, ... }: { config, lib, ... }:
with builtins; with builtins;
with lib; with lib;
@ -15,7 +15,10 @@ let out = rec {
addNames = mapAttrs addName; addNames = mapAttrs addName;
types = import ./types.nix { lib = lib // { inherit genid; }; }; types = import ./types.nix {
inherit config;
lib = lib // { inherit genid; };
};
dir.has-default-nix = path: pathExists (path + "/default.nix"); dir.has-default-nix = path: pathExists (path + "/default.nix");

View file

@ -1,4 +1,4 @@
{ lib, ... }: { config, lib, ... }:
with builtins; with builtins;
with lib; with lib;
@ -22,11 +22,7 @@ types // rec {
owner = mkOption { owner = mkOption {
type = user; type = user;
# TODO proper user default = config.krebs.users.krebs;
default = {
name = "krebs";
mail = "spam@krebsco.de";
};
}; };
extraZones = mkOption { extraZones = mkOption {
@ -183,7 +179,8 @@ types // rec {
default = config._module.args.name; default = config._module.args.name;
}; };
pubkey = mkOption { pubkey = mkOption {
type = str; type = nullOr str;
default = null;
}; };
uid = mkOption { uid = mkOption {
type = int; type = int;