summaryrefslogtreecommitdiff
path: root/users/seth
diff options
context:
space:
mode:
Diffstat (limited to 'users/seth')
-rw-r--r--users/seth/darwin.nix7
-rw-r--r--users/seth/module/desktop/default.nix7
-rw-r--r--users/seth/module/shell/fish.nix1
-rw-r--r--users/seth/nixos.nix29
-rw-r--r--users/seth/system.nix34
5 files changed, 77 insertions, 1 deletions
diff --git a/users/seth/darwin.nix b/users/seth/darwin.nix
new file mode 100644
index 0000000..049d3d3
--- /dev/null
+++ b/users/seth/darwin.nix
@@ -0,0 +1,7 @@
+{
+ imports = [./system.nix];
+
+ home-manager.users.seth = {
+ seth.desktop.enable = false;
+ };
+}
diff --git a/users/seth/module/desktop/default.nix b/users/seth/module/desktop/default.nix
index 66a821d..3c09e96 100644
--- a/users/seth/module/desktop/default.nix
+++ b/users/seth/module/desktop/default.nix
@@ -2,12 +2,17 @@
config,
lib,
pkgs,
+ osConfig,
...
}: let
cfg = config.seth.desktop;
in {
options.seth.desktop = {
- enable = lib.mkEnableOption "desktop";
+ enable =
+ lib.mkEnableOption "desktop"
+ // {
+ default = osConfig.desktop.enable or false;
+ };
};
imports = [
diff --git a/users/seth/module/shell/fish.nix b/users/seth/module/shell/fish.nix
index 6dfebb9..a349dfa 100644
--- a/users/seth/module/shell/fish.nix
+++ b/users/seth/module/shell/fish.nix
@@ -36,6 +36,7 @@ in {
nixgc = "sudo nix-collect-garbage -d && nix-collect-garbage -d";
};
}
+
(lib.mkIf cfg.withPlugins {
plugins = let
mkFishPlugins = builtins.map (plugin: {
diff --git a/users/seth/nixos.nix b/users/seth/nixos.nix
new file mode 100644
index 0000000..3ef6584
--- /dev/null
+++ b/users/seth/nixos.nix
@@ -0,0 +1,29 @@
+{
+ config,
+ lib,
+ secretsDir,
+ ...
+}: let
+ cfg = config.traits.users.seth;
+ enable = cfg.enable && cfg.manageSecrets;
+in {
+ options.traits.users.seth = {
+ manageSecrets =
+ lib.mkEnableOption "automatic management of sercrets"
+ // {
+ default = config.traits.secrets.enable or false;
+ };
+ };
+
+ imports = [./system.nix];
+
+ config = lib.mkIf enable {
+ 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..4feb807
--- /dev/null
+++ b/users/seth/system.nix
@@ -0,0 +1,34 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.traits.users.seth;
+in {
+ options.traits.users.seth = {
+ enable = lib.mkEnableOption "Seth's user & home configuration";
+ };
+
+ 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 = [./.];
+ };
+ };
+}