krebs.users.krebs: init
This commit is contained in:
parent
e3ddf995e9
commit
67e5fddc0b
|
@ -104,11 +104,16 @@ let
|
|||
retiolum = "hosts";
|
||||
};
|
||||
|
||||
krebs.users.root = {
|
||||
home = "/root";
|
||||
name = "root";
|
||||
pubkey = config.krebs.build.host.ssh.pubkey;
|
||||
uid = 0;
|
||||
krebs.users = {
|
||||
krebs = {
|
||||
home = "/krebs";
|
||||
mail = "spam@krebsco.de";
|
||||
};
|
||||
root = {
|
||||
home = "/root";
|
||||
pubkey = config.krebs.build.host.ssh.pubkey;
|
||||
uid = 0;
|
||||
};
|
||||
};
|
||||
|
||||
networking.extraHosts = concatStringsSep "\n" (flatten (
|
||||
|
|
|
@ -232,13 +232,15 @@ let
|
|||
]) (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";
|
||||
name = "git";
|
||||
shell = "/bin/sh";
|
||||
openssh.authorizedKeys.keys =
|
||||
mapAttrsToList (_: makeAuthorizedKey git-ssh-command)
|
||||
config.krebs.users;
|
||||
(filterAttrs (_: user: isString user.pubkey)
|
||||
config.krebs.users);
|
||||
uid = genid name;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -10,6 +10,6 @@ let
|
|||
type = types.attrs;
|
||||
};
|
||||
imp = {
|
||||
krebs.lib = lib // import ../4lib { inherit lib; } // builtins;
|
||||
krebs.lib = lib // import ../4lib { inherit config lib; } // builtins;
|
||||
};
|
||||
in out
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with builtins;
|
||||
with lib;
|
||||
|
@ -15,7 +15,10 @@ let out = rec {
|
|||
|
||||
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");
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with builtins;
|
||||
with lib;
|
||||
|
@ -22,11 +22,7 @@ types // rec {
|
|||
|
||||
owner = mkOption {
|
||||
type = user;
|
||||
# TODO proper user
|
||||
default = {
|
||||
name = "krebs";
|
||||
mail = "spam@krebsco.de";
|
||||
};
|
||||
default = config.krebs.users.krebs;
|
||||
};
|
||||
|
||||
extraZones = mkOption {
|
||||
|
@ -183,7 +179,8 @@ types // rec {
|
|||
default = config._module.args.name;
|
||||
};
|
||||
pubkey = mkOption {
|
||||
type = str;
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
uid = mkOption {
|
||||
type = int;
|
||||
|
|
Loading…
Reference in a new issue