summaryrefslogtreecommitdiff
path: root/users/seth
diff options
context:
space:
mode:
Diffstat (limited to 'users/seth')
-rw-r--r--users/seth/base/default.nix13
-rw-r--r--users/seth/base/standalone.nix26
-rw-r--r--users/seth/default.nix65
3 files changed, 45 insertions, 59 deletions
diff --git a/users/seth/base/default.nix b/users/seth/base/default.nix
deleted file mode 100644
index 7b97b51..0000000
--- a/users/seth/base/default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{ config, lib, ... }:
-let
- cfg = config.seth;
-in
-{
- options.seth = {
- enable = lib.mkEnableOption "Seth's home configuration";
- };
-
- imports = [ ./standalone.nix ];
-
- config = lib.mkIf cfg.enable { home.stateVersion = "23.11"; };
-}
diff --git a/users/seth/base/standalone.nix b/users/seth/base/standalone.nix
deleted file mode 100644
index 884d3cc..0000000
--- a/users/seth/base/standalone.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- config,
- lib,
- pkgs,
- ...
-}:
-let
- cfg = config.seth.standalone;
- enable = config.seth.enable && cfg.enable;
-in
-{
- options.seth.standalone = {
- enable = lib.mkEnableOption "standalone configuration options";
- };
-
- config = lib.mkIf enable {
- _module.args.osConfig = { };
- programs.home-manager.enable = true;
-
- home = {
- username = "seth";
- homeDirectory =
- if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
- };
- };
-}
diff --git a/users/seth/default.nix b/users/seth/default.nix
index c71dab9..2afbbce 100644
--- a/users/seth/default.nix
+++ b/users/seth/default.nix
@@ -1,9 +1,16 @@
-{ config, lib, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
let
cfg = config.seth;
in
{
options.seth = {
+ enable = lib.mkEnableOption "Seth's home configuration";
+
shellAliases.enable = lib.mkEnableOption "shell aliases" // {
default = config.seth.enable;
defaultText = lib.literalExpression "config.seth.enable";
@@ -13,32 +20,50 @@ in
default = config.seth.enable;
defaultText = lib.literalExpression "config.seth.enable";
};
+
+ standalone.enable = lib.mkEnableOption "standalone configuration mode";
};
imports = [
- ./base
./desktop
./programs
./services
./tweaks
];
- config = lib.mkMerge [
- (lib.mkIf cfg.shellAliases.enable {
- home.shellAliases = {
- diff = "diff --color=auto";
- g = "git";
- gs = "g status";
- };
- })
-
- (lib.mkIf cfg.shellVariables.enable {
- home.sessionVariables = {
- EDITOR = "nvim";
- VISUAL = config.home.sessionVariables.EDITOR;
- CARGO_HOME = "${config.xdg.dataHome}/cargo";
- LESSHISTFILE = "${config.xdg.stateHome}/less/history";
- };
- })
- ];
+ config = lib.mkIf cfg.enable (
+ lib.mkMerge [
+ { home.stateVersion = "23.11"; }
+
+ (lib.mkIf cfg.shellAliases.enable {
+ home.shellAliases = {
+ diff = "diff --color=auto";
+ g = "git";
+ gs = "g status";
+ };
+ })
+
+ (lib.mkIf cfg.shellVariables.enable {
+ home.sessionVariables = {
+ EDITOR = "nvim";
+ VISUAL = config.home.sessionVariables.EDITOR;
+ CARGO_HOME = "${config.xdg.dataHome}/cargo";
+ LESSHISTFILE = "${config.xdg.stateHome}/less/history";
+ };
+ })
+
+ (lib.mkIf cfg.standalone.enable {
+ # This won't be set in standalone configurations
+ _module.args.osConfig = { };
+
+ # Make sure we can switch & update
+ programs.home-manager.enable = true;
+
+ home = {
+ username = "seth";
+ homeDirectory = (if pkgs.stdenv.isDarwin then "/Users" else "/home") + "/${config.home.username}";
+ };
+ })
+ ]
+ );
}