add core configuration
This commit is contained in:
parent
74c78e1c68
commit
f40517cff1
94 changed files with 2816 additions and 959 deletions
17
modules/users/default.nix
Normal file
17
modules/users/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{lib, ...}: let
|
||||
# recursively construct attr-set of a directory
|
||||
getDir = dir:
|
||||
lib.mapAttrs (file: type:
|
||||
if type == "directory"
|
||||
then getDir "${dir}/${file}"
|
||||
else type) (
|
||||
builtins.readDir dir
|
||||
);
|
||||
files = dir: lib.collect lib.isString (lib.mapAttrsRecursive (path: type: lib.concatStringsSep "/" path) (getDir dir));
|
||||
validFiles = dir:
|
||||
map (file: ./. + "/${file}") (
|
||||
lib.filter (file: lib.hasSuffix ".nix" file && file != "default.nix") (files dir)
|
||||
);
|
||||
in {
|
||||
imports = validFiles ./.;
|
||||
}
|
21
modules/users/lily.nix
Normal file
21
modules/users/lily.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.lily.users.lily;
|
||||
# interpolated_secrets = import ../../secrets/interpolated_secrets.nix;
|
||||
in {
|
||||
options.lily.users.lily.enable = lib.mkEnableOption "activate user lily";
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.users.lily = {
|
||||
home = "/home/lily";
|
||||
isNormalUser = true;
|
||||
# hashedPasswordFile = lib.mkIf config.lily.sops config.sops.secrets."users/lily/hashedPassword".path;
|
||||
extraGroups = ["wheel" "openrazer" "docker"] ++ lib.optionals config.networking.networkmanager.enable ["networkmanager"];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
# sops.secrets."users/lily/hashedPassword" = lib.mkIf config.lily.sops { neededForUsers = true; };
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue