From b890e2d04a3cb9d98e4b89e4099437c91323934b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 15 Nov 2021 11:37:56 +0100 Subject: [PATCH 1/6] Fix java session variable --- profiles/base-user/session-variables.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/base-user/session-variables.nix b/profiles/base-user/session-variables.nix index 4e745bba..264d787f 100644 --- a/profiles/base-user/session-variables.nix +++ b/profiles/base-user/session-variables.nix @@ -49,7 +49,7 @@ let CARGO_HOME = "${xdg.dataHome}/cargo"; # Java - _JAVA_OPTIONS = "-Djava.util.prefs.userRoot = '${xdg.configHome}/java'"; + _JAVA_OPTIONS = "-Djava.util.prefs.userRoot='${xdg.configHome}/java'"; _JAVA_AWT_WM_NONREPARENTING = "1"; # docker From 0768353f08e4023d2b35a9ef319da37351bbcfc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 15 Nov 2021 11:39:24 +0100 Subject: [PATCH 2/6] Use fixed telegram-desktop from unstable --- overlays/overrides.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/overlays/overrides.nix b/overlays/overrides.nix index 1c5070db..34c46f45 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -14,6 +14,10 @@ channels: final: prev: { signal-desktop starship deploy-rs + tdesktop + xdg-desktop-portal + xdg-desktop-portal-gtk + xdg-desktop-portal-wlr ; From 91163d38ed9aedccf0e7b9a714f19b30ff367a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Wed, 17 Nov 2021 12:05:50 +0100 Subject: [PATCH 3/6] Allow changing the user description --- modules/user/default.nix | 5 +++++ profiles/base-user/default.nix | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/user/default.nix b/modules/user/default.nix index d2edd476..79e32eca 100644 --- a/modules/user/default.nix +++ b/modules/user/default.nix @@ -11,6 +11,11 @@ in type = types.nullOr types.str; default = "nixos"; }; + description = mkOption { + description = "User description"; + type = types.nullOr types.str; + default = "The main PubSolarOS user"; + }; password = mkOption { description = "User password"; type = types.nullOr types.str; diff --git a/profiles/base-user/default.nix b/profiles/base-user/default.nix index e327a736..80ac262e 100644 --- a/profiles/base-user/default.nix +++ b/profiles/base-user/default.nix @@ -15,7 +15,7 @@ in # This automatically sets group to users, createHome to true, # home to /home/username, useDefaultShell to true, and isSystemUser to false. isNormalUser = true; - description = ""; + description = psCfg.user.description; extraGroups = [ "wheel" "docker" "input" "audio" "networkmanager" "lp" "scanner" ]; initialHashedPassword = if psCfg.user.password != null then psCfg.user.password else ""; shell = pkgs.zsh; From b84d88fc92c6710cff8e294315eb23ceb7ecf40e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 29 Nov 2021 14:10:21 +0100 Subject: [PATCH 4/6] graphical, sway: disable greetd, auto-login directly to desktop --- modules/crypto/default.nix | 1 - modules/graphical/default.nix | 10 +--------- modules/sway/config/config.d/custom-keybindings.conf | 2 +- modules/sway/config/config.d/systemd.conf | 4 +++- modules/sway/default.nix | 2 -- modules/sway/swayidle.service.nix | 1 + modules/sway/waybar.service.nix | 1 + modules/terminal-life/default.nix | 4 +++- modules/terminal-life/zsh/default.nix | 5 +++++ 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/crypto/default.nix b/modules/crypto/default.nix index 5d14dcc2..8e9c5ee9 100644 --- a/modules/crypto/default.nix +++ b/modules/crypto/default.nix @@ -15,7 +15,6 @@ in services.pcscd.enable = true; services.gnome.gnome-keyring.enable = true; - security.pam.services.greetd.enableGnomeKeyring = true; home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { systemd.user.services.polkit-gnome-authentication-agent = import ./polkit-gnome-authentication-agent.service.nix pkgs; diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index ef628f9a..bbf8f59d 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -49,15 +49,7 @@ in }; }; - services.greetd = { - enable = true; - restart = false; - settings = { - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd ${pkgs.sway-service}/bin/sway-service"; - }; - }; - }; + services.getty.autologinUser = "${psCfg.user.name}"; qt5 = { enable = true; diff --git a/modules/sway/config/config.d/custom-keybindings.conf b/modules/sway/config/config.d/custom-keybindings.conf index 2b7ba20d..6218d900 100644 --- a/modules/sway/config/config.d/custom-keybindings.conf +++ b/modules/sway/config/config.d/custom-keybindings.conf @@ -37,7 +37,7 @@ set $mode_system (l)ock, (e)xit, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutd bindsym $mod+0 mode "$mode_system" mode "$mode_system" { bindsym l exec swaylock-bg, mode "default" - bindsym e exec systemctl --user stop graphical-session.target, mode "default" + bindsym e exec swaymsg exit, mode "default" bindsym s exec systemctl suspend, mode "default" bindsym h exec systemctl hibernate, mode "default" bindsym r exec systemctl reboot, mode "default" diff --git a/modules/sway/config/config.d/systemd.conf b/modules/sway/config/config.d/systemd.conf index 3fecd355..d6380d41 100644 --- a/modules/sway/config/config.d/systemd.conf +++ b/modules/sway/config/config.d/systemd.conf @@ -3,4 +3,6 @@ # systemctl import-environment is complete, and services that require certain variables # will fail to run. # https://github.com/swaywm/sway/wiki/Systemd-integration -exec "systemctl --user import-environment; systemctl --user start sway-session.target; dbus-update-activation-environment WAYLAND_DISPLAY" +# Also, import the most important environment variables into the D-Bus and systemd +# user environments (e.g. required for screen sharing and Pinentry prompts): +exec "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemctl --user start sway-session.target; exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemd-cat --identifier=sway sway" diff --git a/modules/sway/default.nix b/modules/sway/default.nix index 21f017c0..cfc5733c 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -62,7 +62,6 @@ in swaylock-bg sway-launcher - sway-service import-gtk-settings s wcwd @@ -72,7 +71,6 @@ in #programs.waybar.systemd.enable = true; systemd.user.services.mako = import ./mako.service.nix pkgs; - systemd.user.services.sway = import ./sway.service.nix pkgs; systemd.user.services.swayidle = import ./swayidle.service.nix pkgs; systemd.user.services.xsettingsd = import ./xsettingsd.service.nix pkgs; systemd.user.services.waybar = import ./waybar.service.nix pkgs; diff --git a/modules/sway/swayidle.service.nix b/modules/sway/swayidle.service.nix index a750eacb..0762d3f1 100644 --- a/modules/sway/swayidle.service.nix +++ b/modules/sway/swayidle.service.nix @@ -9,6 +9,7 @@ pkgs: }; Service = { Type = "simple"; + Environment = "PATH=${pkgs.bash}/bin:${pkgs.sway}/bin:${pkgs.swaylock}/bin"; ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \ timeout 600 'swaylock-bg' \ timeout 900 'swaymsg "output * dpms off"' \ diff --git a/modules/sway/waybar.service.nix b/modules/sway/waybar.service.nix index f508f144..ee5e8938 100644 --- a/modules/sway/waybar.service.nix +++ b/modules/sway/waybar.service.nix @@ -10,6 +10,7 @@ pkgs: Service = { Type = "dbus"; + Environment = "PATH=${pkgs.bash}/bin:${pkgs.pavucontrol}/bin"; BusName = "fr.arouillard.waybar"; ExecStart = "${pkgs.waybar}/bin/waybar"; }; diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix index 135766cd..17262f77 100644 --- a/modules/terminal-life/default.nix +++ b/modules/terminal-life/default.nix @@ -15,7 +15,9 @@ in # Needed to get zsh completion for system packages (e.g. systemd). environment.pathsToLink = [ "/share/zsh" ]; - services.lorri.enable = true; + environment.shells = with pkgs; [ + zsh + ]; environment.systemPackages = with pkgs; [ screen diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index f4923c50..d892170c 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -18,6 +18,11 @@ in size = 10000; }; + loginExtra = '' + [ "$(tty)" = "/dev/tty1" ] && exec sway + ''; + + shellAliases = { nano = "nvim"; vi = "nvim"; From e84fb19a20fa93e18037d6ab1d8b03f741e40f26 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 29 Nov 2021 14:50:46 +0100 Subject: [PATCH 5/6] sway: hotfix for swayidle, swaylock-bg missing in PATH --- modules/sway/swayidle.service.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sway/swayidle.service.nix b/modules/sway/swayidle.service.nix index 0762d3f1..597a8779 100644 --- a/modules/sway/swayidle.service.nix +++ b/modules/sway/swayidle.service.nix @@ -9,7 +9,7 @@ pkgs: }; Service = { Type = "simple"; - Environment = "PATH=${pkgs.bash}/bin:${pkgs.sway}/bin:${pkgs.swaylock}/bin"; + Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin:${pkgs.swaylock}/bin:${pkgs.swaylock-bg}/bin"; ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \ timeout 600 'swaylock-bg' \ timeout 900 'swaymsg "output * dpms off"' \ From 65c8894f47129e1de575f5b83b406afc8b9c2d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 29 Nov 2021 17:15:00 +0100 Subject: [PATCH 6/6] Remove minimap from nvim, fix mergetool config for git --- modules/terminal-life/nvim/default.nix | 3 +-- profiles/base-user/.config/git/config.nix | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix index 8d1be99d..f66ce597 100644 --- a/modules/terminal-life/nvim/default.nix +++ b/modules/terminal-life/nvim/default.nix @@ -70,7 +70,6 @@ in extraPackages = with pkgs; [ ccls - code-minimap gopls nodejs nodePackages.bash-language-server @@ -101,7 +100,6 @@ in ack-vim airline editorconfig-vim - minimap-vim nnn-vim suda syntastic @@ -112,6 +110,7 @@ in sonokai fugitive + diffview-nvim vim-gitgutter vim-rhubarb vimagit diff --git a/profiles/base-user/.config/git/config.nix b/profiles/base-user/.config/git/config.nix index 6b099f87..95812623 100644 --- a/profiles/base-user/.config/git/config.nix +++ b/profiles/base-user/.config/git/config.nix @@ -13,14 +13,14 @@ in pol = pull ack = -c color.grep.linenumber=\"bold yellow\"\n -c color.grep.filename=\"bold green\"\n -c color.grep.match=\"reverse yellow\"\n grep --break --heading --line-number # define command which will be used when "nvim"is set as a merge tool -[mergetool "nvim"] - cmd = /etc/profiles/per-user/${config.pub-solar.user.name}/bin/nvim -f -c \"Gdiffsplit!\" \"$MERGED\" -# set "nvim" as tool for merging -[merge] - tool = /etc/profiles/per-user/${config.pub-solar.user.name}/bin/nvim -# automatically launch merge tool without displaying a prompt + [mergetool] prompt = false +[merge] + tool = nvim +[mergetool "nvim"] + cmd = /etc/profiles/per-user/${config.pub-solar.user.name}/bin/nvim -f -c \"Gdiffsplit!\" \"$MERGED\" + [commit] gpgsign = true [tag]