treewide: format
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m53s
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m53s
This commit is contained in:
@ -1,28 +1,67 @@
|
||||
{ config, options, lib, self, ... }:
|
||||
{
|
||||
config,
|
||||
options,
|
||||
lib,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
{
|
||||
options = with types; {
|
||||
user = mkOption { type = attrs; default = { }; };
|
||||
|
||||
home = {
|
||||
configFile = mkOption { type = attrs; default = { }; description = "Files to place in $XDG_CONFIG_HOME"; };
|
||||
dataFile = mkOption { type = attrs; default = { }; description = "Files to place in $XDG_DATA_HOME"; };
|
||||
file = mkOption { type = attrs; default = { }; description = "Files to place directly in $HOME"; };
|
||||
packages = mkOption { type = attrs; default = { }; description = "User-level installed packages"; };
|
||||
programs = mkOption { type = attrs; default = { }; description = "Programs managed directly from home-manager"; };
|
||||
services = mkOption { type = attrs; default = { }; description = "Services managed directly from home-manager"; };
|
||||
user = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
};
|
||||
|
||||
dconf.settings = mkOption { type = attrs; default = { }; description = "dconf settings to enable"; };
|
||||
home = {
|
||||
configFile = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "Files to place in $XDG_CONFIG_HOME";
|
||||
};
|
||||
dataFile = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "Files to place in $XDG_DATA_HOME";
|
||||
};
|
||||
file = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "Files to place directly in $HOME";
|
||||
};
|
||||
packages = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "User-level installed packages";
|
||||
};
|
||||
programs = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "Programs managed directly from home-manager";
|
||||
};
|
||||
services = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "Services managed directly from home-manager";
|
||||
};
|
||||
};
|
||||
|
||||
dconf.settings = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "dconf settings to enable";
|
||||
};
|
||||
|
||||
env = mkOption {
|
||||
type = attrsOf (oneOf [ str path (listOf (either str path)) ]);
|
||||
apply = mapAttrs (n: v:
|
||||
if isList v then
|
||||
concatMapStringsSep ":" (x: toString x) v
|
||||
else
|
||||
(toString v));
|
||||
type = attrsOf (oneOf [
|
||||
str
|
||||
path
|
||||
(listOf (either str path))
|
||||
]);
|
||||
apply = mapAttrs (
|
||||
n: v: if isList v then concatMapStringsSep ":" (x: toString x) v else (toString v)
|
||||
);
|
||||
default = { };
|
||||
description = "";
|
||||
};
|
||||
@ -31,12 +70,27 @@ with lib;
|
||||
config = {
|
||||
age.secrets."passwords/users/jordan".file = "${self.inputs.secrets}/passwords/users/jordan.age";
|
||||
user =
|
||||
let user = builtins.getEnv "USER";
|
||||
name = if elem user [ "" "root" ] then "jordan" else user;
|
||||
in {
|
||||
let
|
||||
user = builtins.getEnv "USER";
|
||||
name =
|
||||
if
|
||||
elem user [
|
||||
""
|
||||
"root"
|
||||
]
|
||||
then
|
||||
"jordan"
|
||||
else
|
||||
user;
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "networkmanager" "wheel" "lxd" ];
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
"lxd"
|
||||
];
|
||||
description = "Jordan Holt";
|
||||
useDefaultShell = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
@ -57,12 +111,12 @@ with lib;
|
||||
file = mkAliasDefinitions options.home.file;
|
||||
stateVersion = config.system.stateVersion;
|
||||
};
|
||||
programs = mkAliasDefinitions options.home.programs;
|
||||
services = mkAliasDefinitions options.home.services;
|
||||
programs = mkAliasDefinitions options.home.programs;
|
||||
services = mkAliasDefinitions options.home.services;
|
||||
xdg = {
|
||||
enable = true;
|
||||
configFile = mkAliasDefinitions options.home.configFile;
|
||||
dataFile = mkAliasDefinitions options.home.dataFile;
|
||||
enable = true;
|
||||
configFile = mkAliasDefinitions options.home.configFile;
|
||||
dataFile = mkAliasDefinitions options.home.dataFile;
|
||||
};
|
||||
dconf.settings = mkAliasDefinitions options.dconf.settings;
|
||||
};
|
||||
@ -75,8 +129,8 @@ with lib;
|
||||
|
||||
users.users.${config.user.name} = mkAliasDefinitions options.user;
|
||||
|
||||
environment.extraInit =
|
||||
concatStringsSep "\n"
|
||||
(mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.env);
|
||||
environment.extraInit = concatStringsSep "\n" (
|
||||
mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.env
|
||||
);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user