aboutsummaryrefslogtreecommitdiff
path: root/modules/login.nix
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2021-09-14 19:36:45 +0530
committerAkshay Nair <phenax5@gmail.com>2021-09-14 20:21:10 +0530
commit829baad9a8306f0651045412bb8116949dd1a9d2 (patch)
treef20cee7fa6b213a72c68cf586f3027b260ea7669 /modules/login.nix
parent973c32d37735fab3737c8cbade3418f584ad4c9c (diff)
downloadnixos-config-829baad9a8306f0651045412bb8116949dd1a9d2.tar.gz
nixos-config-829baad9a8306f0651045412bb8116949dd1a9d2.zip
adds vanta daemon
Diffstat (limited to 'modules/login.nix')
-rw-r--r--modules/login.nix90
1 files changed, 90 insertions, 0 deletions
diff --git a/modules/login.nix b/modules/login.nix
new file mode 100644
index 0000000..b86c6bd
--- /dev/null
+++ b/modules/login.nix
@@ -0,0 +1,90 @@
+{ pkgs, ... }:
+let
+ sessions = [
+ [ "tty1" windowManagers.xmonad ]
+ #[ "tty2" windowManagers.bspwm ]
+ ];
+ windowManagers = {
+ dwm = looped "dwm";
+ xmonad = exec "xmonad";
+ bspwm = "st; ${exec "bspwm"};";
+ };
+ exec = s: "exec ${s}";
+ looped = s: ''
+ while true; do
+ ssh-agent ${s} || break;
+ done
+ '';
+in
+{
+
+ # User
+ users.users.imsohexy = {
+ isNormalUser = true;
+ extraGroups = [
+ "wheel"
+ "input"
+ "audio"
+ "video"
+ "storage"
+ "git"
+ "networkmanager"
+ "docker"
+ "transmission"
+ "lxd"
+ "jackaudio"
+ ];
+ shell = pkgs.zsh;
+ };
+ #security.sudo.configFile = ''
+ # %wheel ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown
+ #'';
+
+ # Global
+ environment.variables = let
+ apps = (import ../packages/sensible-apps/sensible-apps.nix).apps;
+ in
+ {
+ EDITOR = apps.EDITOR;
+ VISUAL = apps.EDITOR;
+ TERMINAL = apps.TERMINAL;
+ BROWSER = apps.BROWSER;
+ PRIVATE_BROWSER = apps.PRIVATE_BROWSER;
+ };
+ environment.shells = with pkgs; [ zsh bashInteractive ];
+ programs.zsh = {
+ enable = true;
+ enableCompletion = true;
+ enableBashCompletion = true;
+ autosuggestions.enable = true;
+ syntaxHighlighting.enable = true;
+ histFile = "~/.config/zshhistory";
+ histSize = 50000;
+ interactiveShellInit = ''source ~/.config/zsh/zshrc'';
+ promptInit = "";
+ loginShellInit = with builtins; let
+ cases = map (
+ s: ''
+ /dev/${elemAt s 0})
+ echo "~/.config/xorg/init.sh; ${elemAt s 1}" > ~/.xinitrc;
+ sleep 0.2;
+ startx;
+ ;;
+ ''
+ ) sessions;
+ in
+ ''
+ case "$(tty)" in
+ ${toString cases}
+ *) echo "Only tty for you, $(tty)" ;;
+ esac;
+ '';
+ };
+ services = {
+ getty = {
+ autologinUser = "imsohexy";
+ helpLine = "";
+ greetingLine = import ./welcome-text.nix;
+ };
+ };
+}