diff --git a/images/translate-setup/config.nix b/images/translate-setup/config.nix new file mode 100644 index 0000000..bb6703c --- /dev/null +++ b/images/translate-setup/config.nix @@ -0,0 +1,50 @@ +{ pkgs, lib, config, ... }: { + + imports = [ ./x11.nix ]; + + # no wifi + networking.networkmanager.enable = true; + #networking.wireless.enable = true; + + # configuration + environment.extraInit = '' + # use vi shortcuts + # ---------------- + set -o vi + EDITOR=vim + ''; + + networking.hostName = "translate"; + nixpkgs.config.allowUnfree = true; + + programs.bash = { + enableCompletion = true; + interactiveShellInit = '' + HISTCONTROL='erasedups:ignorespace' + HISTSIZE=65536 + HISTFILESIZE=$HISTSIZE + + shopt -s checkhash + shopt -s histappend histreedit histverify + shopt -s no_empty_cmd_completion + complete -d cd + ''; + promptInit = '' + if test $UID = 0; then + PS1='\[\033[1;31m\]\w\[\033[0m\] ' + PROMPT_COMMAND='echo -ne "\033]0;$$ $USER@$PWD\007"' + elif test $UID = 1337; then + PS1='\[\033[1;32m\]\w\[\033[0m\] ' + PROMPT_COMMAND='echo -ne "\033]0;$$ $PWD\007"' + else + PS1='\[\033[1;33m\]\u@\w\[\033[0m\] ' + PROMPT_COMMAND='echo -ne "\033]0;$$ $USER@$PWD\007"' + fi + if test -n "$SSH_CLIENT"; then + PS1='\[\033[35m\]\h'" $PS1" + PROMPT_COMMAND='echo -ne "\033]0;$$ $HOSTNAME $USER@$PWD\007"' + fi + ''; + }; + +} diff --git a/images/translate-setup/x11.nix b/images/translate-setup/x11.nix new file mode 100644 index 0000000..d70b924 --- /dev/null +++ b/images/translate-setup/x11.nix @@ -0,0 +1,44 @@ +{ pkgs, config, lib, ... }: { + + services.xserver = { + enable = true; + desktopManager = { + defaultSession = "xfce"; + xterm.enable = false; + xfce.enable = true; + }; + displayManager = { + sddm = { + enable = true; + autoLogin = { + enable = true; + relogin = true; + user = config.users.users.mainUser.name; + }; + }; + }; + + # mouse/touchpad + # -------------- + libinput = { + enable = true; + disableWhileTyping = true; + tapping = true; + scrollMethod = "twofinger"; + accelSpeed = "2"; + }; + + }; + + users.users.mainUser = { + isNormalUser = true; + name = "translator"; + uid = 1001; + initialPassword = "translate"; + }; + + # Packages + # -------- + environment.systemPackages = with pkgs; [ arandr flameshot ]; + +}