diff --git a/profiles/base-user/.config/dircolors b/modules/user/.config/dircolors similarity index 100% rename from profiles/base-user/.config/dircolors rename to modules/user/.config/dircolors diff --git a/profiles/base-user/.config/git/config.nix b/modules/user/.config/git/config.nix similarity index 100% rename from profiles/base-user/.config/git/config.nix rename to modules/user/.config/git/config.nix diff --git a/profiles/base-user/.config/git/gitmessage.nix b/modules/user/.config/git/gitmessage.nix similarity index 100% rename from profiles/base-user/.config/git/gitmessage.nix rename to modules/user/.config/git/gitmessage.nix diff --git a/profiles/base-user/.config/git/global_gitignore.nix b/modules/user/.config/git/global_gitignore.nix similarity index 100% rename from profiles/base-user/.config/git/global_gitignore.nix rename to modules/user/.config/git/global_gitignore.nix diff --git a/profiles/base-user/.config/libinput-gestures.conf b/modules/user/.config/libinput-gestures.conf similarity index 100% rename from profiles/base-user/.config/libinput-gestures.conf rename to modules/user/.config/libinput-gestures.conf diff --git a/profiles/base-user/.config/mako/config b/modules/user/.config/mako/config similarity index 100% rename from profiles/base-user/.config/mako/config rename to modules/user/.config/mako/config diff --git a/profiles/base-user/.config/mimeapps.list b/modules/user/.config/mimeapps.list similarity index 100% rename from profiles/base-user/.config/mimeapps.list rename to modules/user/.config/mimeapps.list diff --git a/profiles/base-user/.config/mutt/base16.muttrc b/modules/user/.config/mutt/base16.muttrc similarity index 100% rename from profiles/base-user/.config/mutt/base16.muttrc rename to modules/user/.config/mutt/base16.muttrc diff --git a/profiles/base-user/.config/mutt/mailcap b/modules/user/.config/mutt/mailcap similarity index 100% rename from profiles/base-user/.config/mutt/mailcap rename to modules/user/.config/mutt/mailcap diff --git a/profiles/base-user/.config/mutt/muttrc b/modules/user/.config/mutt/muttrc similarity index 100% rename from profiles/base-user/.config/mutt/muttrc rename to modules/user/.config/mutt/muttrc diff --git a/profiles/base-user/.config/offlineimap/functions.py b/modules/user/.config/offlineimap/functions.py similarity index 100% rename from profiles/base-user/.config/offlineimap/functions.py rename to modules/user/.config/offlineimap/functions.py diff --git a/profiles/base-user/.config/user-dirs.dirs b/modules/user/.config/user-dirs.dirs similarity index 100% rename from profiles/base-user/.config/user-dirs.dirs rename to modules/user/.config/user-dirs.dirs diff --git a/profiles/base-user/.config/user-dirs.locale b/modules/user/.config/user-dirs.locale similarity index 100% rename from profiles/base-user/.config/user-dirs.locale rename to modules/user/.config/user-dirs.locale diff --git a/profiles/base-user/.config/waybar/colorscheme.css b/modules/user/.config/waybar/colorscheme.css similarity index 100% rename from profiles/base-user/.config/waybar/colorscheme.css rename to modules/user/.config/waybar/colorscheme.css diff --git a/profiles/base-user/.config/waybar/config b/modules/user/.config/waybar/config similarity index 100% rename from profiles/base-user/.config/waybar/config rename to modules/user/.config/waybar/config diff --git a/profiles/base-user/.config/waybar/style.css b/modules/user/.config/waybar/style.css similarity index 100% rename from profiles/base-user/.config/waybar/style.css rename to modules/user/.config/waybar/style.css diff --git a/profiles/base-user/.config/xmodmap b/modules/user/.config/xmodmap similarity index 100% rename from profiles/base-user/.config/xmodmap rename to modules/user/.config/xmodmap diff --git a/profiles/base-user/.config/xsettingsd/xsettingsd.conf b/modules/user/.config/xsettingsd/xsettingsd.conf similarity index 100% rename from profiles/base-user/.config/xsettingsd/xsettingsd.conf rename to modules/user/.config/xsettingsd/xsettingsd.conf diff --git a/profiles/base-user/.local/share/nvim/json-schemas/caddy_schema.json b/modules/user/.local/share/nvim/json-schemas/caddy_schema.json similarity index 100% rename from profiles/base-user/.local/share/nvim/json-schemas/caddy_schema.json rename to modules/user/.local/share/nvim/json-schemas/caddy_schema.json diff --git a/profiles/base-user/.local/share/scripts/base16.sh b/modules/user/.local/share/scripts/base16.sh similarity index 100% rename from profiles/base-user/.local/share/scripts/base16.sh rename to modules/user/.local/share/scripts/base16.sh diff --git a/profiles/base-user/.xinitrc b/modules/user/.xinitrc similarity index 100% rename from profiles/base-user/.xinitrc rename to modules/user/.xinitrc diff --git a/profiles/base-user/assets/wallpaper.jpg b/modules/user/assets/wallpaper.jpg similarity index 100% rename from profiles/base-user/assets/wallpaper.jpg rename to modules/user/assets/wallpaper.jpg diff --git a/modules/user/default.nix b/modules/user/default.nix index 72f9fe0e..f5715a07 100644 --- a/modules/user/default.nix +++ b/modules/user/default.nix @@ -1,12 +1,16 @@ { - lib, config, pkgs, + lib, ... }: with lib; let - cfg = config.pub-solar; -in { + psCfg = config.pub-solar; +in +with lib; { + imports = [ + ./home.nix + ]; options.pub-solar = { user = { name = mkOption { @@ -56,4 +60,37 @@ in { }; }; }; + + config = { + users = { + mutableUsers = false; + + users = with pkgs; + pkgs.lib.setAttrByPath [psCfg.user.name] { + # Indicates whether this is an account for a “real” user. + # This automatically sets group to users, createHome to true, + # home to /home/username, useDefaultShell to true, and isSystemUser to false. + isNormalUser = true; + description = psCfg.user.description; + extraGroups = [ + "input" + "lp" + "networkmanager" + "scanner" + "video" + "dialout" + "wheel" + ]; + shell = pkgs.bash; + initialHashedPassword = + if psCfg.user.password != null + then psCfg.user.password + else ""; + openssh.authorizedKeys.keys = + if psCfg.user.publicKeys != null + then psCfg.user.publicKeys + else []; + }; + }; + }; } diff --git a/profiles/base-user/home.nix b/modules/user/home.nix similarity index 99% rename from profiles/base-user/home.nix rename to modules/user/home.nix index 5b5b5877..4653ca76 100644 --- a/profiles/base-user/home.nix +++ b/modules/user/home.nix @@ -20,6 +20,7 @@ in { # paths it should manage. home.username = psCfg.user.name; home.homeDirectory = "/home/${psCfg.user.name}"; + home.stateVersion = "22.11"; home.packages = with pkgs; []; diff --git a/profiles/base-user/mimeapps.nix b/modules/user/mimeapps.nix similarity index 100% rename from profiles/base-user/mimeapps.nix rename to modules/user/mimeapps.nix diff --git a/profiles/base-user/session-variables.nix b/modules/user/session-variables.nix similarity index 100% rename from profiles/base-user/session-variables.nix rename to modules/user/session-variables.nix diff --git a/profiles/base-user/default.nix b/profiles/base-user/default.nix deleted file mode 100644 index bd8815b0..00000000 --- a/profiles/base-user/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - psCfg = config.pub-solar; -in { - imports = [ - ./home.nix - ]; - - users = { - mutableUsers = false; - - users = with pkgs; - pkgs.lib.setAttrByPath [psCfg.user.name] { - # Indicates whether this is an account for a “real” user. - # This automatically sets group to users, createHome to true, - # home to /home/username, useDefaultShell to true, and isSystemUser to false. - isNormalUser = true; - description = psCfg.user.description; - extraGroups = [ - "input" - "lp" - "networkmanager" - "scanner" - "video" - "wheel" - ]; - initialHashedPassword = - if psCfg.user.password != null - then psCfg.user.password - else ""; - openssh.authorizedKeys.keys = - if psCfg.user.publicKeys != null - then psCfg.user.publicKeys - else []; - }; - }; -}