summaryrefslogtreecommitdiff
path: root/users/seth
diff options
context:
space:
mode:
authorseth <[email protected]>2024-02-27 13:24:08 -0500
committerseth <[email protected]>2024-02-27 13:24:08 -0500
commitee786af7dc2646fd141926ae153ab6ecb68065be (patch)
tree45141a7de8edc44e1d0a3a715d78ddaaea7c00af /users/seth
parent82e202287f4f25afe411d93d2f437f0977c52570 (diff)
seth: reorganize system level imports
Diffstat (limited to 'users/seth')
-rw-r--r--users/seth/darwin.nix17
-rw-r--r--users/seth/nixos.nix30
-rw-r--r--users/seth/system.nix36
3 files changed, 83 insertions, 0 deletions
diff --git a/users/seth/darwin.nix b/users/seth/darwin.nix
new file mode 100644
index 0000000..e2c59c8
--- /dev/null
+++ b/users/seth/darwin.nix
@@ -0,0 +1,17 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.traits.users.seth;
+in {
+ imports = [./system.nix];
+
+ config = lib.mkMerge [
+ (lib.mkIf cfg.enable {
+ home-manager.users.seth = {
+ seth.desktop.enable = false;
+ };
+ })
+ ];
+}
diff --git a/users/seth/nixos.nix b/users/seth/nixos.nix
new file mode 100644
index 0000000..fd65322
--- /dev/null
+++ b/users/seth/nixos.nix
@@ -0,0 +1,30 @@
+{
+ config,
+ lib,
+ secretsDir,
+ ...
+}: let
+ cfg = config.traits.users.seth;
+in {
+ options.traits.users.seth = {
+ manageSecrets =
+ lib.mkEnableOption "automatic secrets management"
+ // {
+ default = config.traits.secrets.enable;
+ };
+ };
+
+ imports = [./system.nix];
+
+ config = lib.mkMerge [
+ (lib.mkIf (cfg.enable && cfg.manageSecrets) {
+ age.secrets = {
+ sethPassword.file = secretsDir + "/sethPassword.age";
+ };
+
+ users.users.seth = {
+ hashedPasswordFile = lib.mkDefault config.age.secrets.sethPassword.path;
+ };
+ })
+ ];
+}
diff --git a/users/seth/system.nix b/users/seth/system.nix
new file mode 100644
index 0000000..3ca1da1
--- /dev/null
+++ b/users/seth/system.nix
@@ -0,0 +1,36 @@
+{
+ config,
+ lib,
+ pkgs,
+ inputs,
+ ...
+}: let
+ cfg = config.traits.users.seth;
+in {
+ options.traits.users.seth = {
+ enable = lib.mkEnableOption "Seth's user & home configurations";
+ };
+
+ config = lib.mkIf cfg.enable {
+ users.users.seth =
+ {
+ shell = pkgs.fish;
+ home = lib.mkDefault (
+ if pkgs.stdenv.isDarwin
+ then "/Users/seth"
+ else "/home/seth"
+ );
+ }
+ // lib.optionalAttrs pkgs.stdenv.isLinux {
+ extraGroups = ["wheel"];
+ isNormalUser = true;
+ };
+
+ programs.fish.enable = lib.mkDefault true;
+
+ home-manager.users.seth = {
+ imports = [inputs.self.homeModules.seth];
+ seth.enable = true;
+ };
+ };
+}