aboutsummaryrefslogtreecommitdiff
path: root/login.nix
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-12-21 22:54:49 +0530
committerAkshay Nair <phenax5@gmail.com>2020-12-21 22:55:11 +0530
commitaf8872a053562d79a9a3b63f24caba6f648142e5 (patch)
tree656a5e66723d2965ac112415c14aaa5848c98c1d /login.nix
parent3f07b159c4f5d03066699001cbc13d8725e75d71 (diff)
downloadnixos-config-af8872a053562d79a9a3b63f24caba6f648142e5.tar.gz
nixos-config-af8872a053562d79a9a3b63f24caba6f648142e5.zip
Adds home manager and refactors startx config
Diffstat (limited to '')
-rw-r--r--login.nix106
1 files changed, 106 insertions, 0 deletions
diff --git a/login.nix b/login.nix
new file mode 100644
index 0000000..81c08c8
--- /dev/null
+++ b/login.nix
@@ -0,0 +1,106 @@
+{ pkgs, ... }:
+let
+ sessions = [
+ ["tty1" windowManagers.dwm ]
+ ["tty2" windowManagers.bspwm ]
+ ];
+ windowManagers = {
+ dwm = ''
+ while true; do
+ (ssh-agent dwm &>> /tmp/dwm.log) || break;
+ done
+ '';
+ # TODO
+ bspwm = ''
+ exec firefox;
+ '';
+ };
+in {
+ # User
+ users.users.imsohexy = {
+ isNormalUser = true;
+ extraGroups = [
+ "wheel"
+ "input"
+ "audio"
+ "video"
+ "storage"
+ "git"
+ "networkmanager"
+ ];
+ shell = pkgs.zsh;
+ };
+
+ # 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 ~/nixos/external/zsh/zshrc'';
+ promptInit = "";
+ loginShellInit = with builtins; let
+ cases = map (s: ''
+ /dev/${elemAt s 0})
+ echo "~/nixos/external/xconfig/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 = {
+ mingetty = {
+ autologinUser = "imsohexy";
+ helpLine = "";
+ greetingLine = let
+ c1 = "\\e{lightblue}";
+ c2 = "\\e{lightcyan}";
+ res = "\\e{reset}";
+ in ''
+
+${c1} ▗▄▄▄ ${c2}▗▄▄▄▄ ▄▄▄▖${res}
+${c1} ▜███▙ ${c2}▜███▙ ▟███▛${res} ${c1}TTY:${res} \e{bold}\l${res}
+${c1} ▜███▙ ${c2}▜███▙▟███▛${res} ${c2}Time:${res} \e{halfbright}\d \t${res}
+${c1} ▜███▙ ${c2}▜██████▛${res} ${c2}Distr${res} \e{halfbright}\S{PRETTY_NAME} \m${res}
+${c1} ▟█████████████████▙ ${c2}▜████▛ ${c1}▟▙${res} ${c2}Kernal:${res} \e{halfbright}\s \r${res}
+${c1} ▟███████████████████▙ ${c2}▜███▙ ${c1}▟██▙${res} ${c2}WM:${res} \e{halfbright}dwm${res}
+${c1} ▄▄▄▄▖ ▜███▙ ${c1}▟███▛${res}
+${c1} ▟███▛ ▜██▛ ${c1}▟███▛${res}
+${c1} ▟███▛ ▜▛ ${c1}▟███▛${res}
+${c1}▟███████████▛ ${c1}▟██████████▙${res}
+${c1}▜██████████▛ ${c1}▟███████████▛${res}
+${c1} ▟███▛ ${c1}▟▙ ▟███▛${res}
+${c1} ▟███▛ ${c1}▟██▙ ▟███▛${res}
+${c1} ▟███▛ ${c1}▜███▙ ▝▀▀▀▀${res}
+${c1} ▜██▛ ${c1}▜███▙ ${c2}▜██████████████████▛${res}
+${c1} ▜▛ ${c1}▟████▙ ${c2}▜████████████████▛${res}
+${c1} ▟██████▙ ${c2}▜███▙${res}
+${c1} ▟███▛▜███▙ ${c2}▜███▙${res}
+${c1} ▟███▛ ▜███▙ ${c2}▜███▙${res}
+${c1} ▝▀▀▀ ▀▀▀▀▘ ${c2}▀▀▀▘${res}
+
+
+
+\e{bold}What's the password, dipshit?\e{reset}'';
+ };
+ };
+}