From b30cff45dbaa6f1dd7d06b2db81e7cb35260bd90 Mon Sep 17 00:00:00 2001 From: genofire Date: Mon, 20 Mar 2023 22:59:54 +0100 Subject: [PATCH] fix: dump current state --- home/default.nix | 27 ++++++- home/desktop-gnome.nix | 8 +- home/desktop-sway.nix | 179 ++++++++++++++++++++++++++--------------- home/desktop.nix | 23 +++++- nixos/README.md | 9 +++ nixos/default.nix | 21 +++-- nixos/users.nix | 1 + 7 files changed, 186 insertions(+), 82 deletions(-) diff --git a/home/default.nix b/home/default.nix index d5f076e..23d3d59 100644 --- a/home/default.nix +++ b/home/default.nix @@ -19,11 +19,11 @@ ])) ansible killall - tree + exa + # tree # use exa htop mosh dasel - git pre-commit git-lfs git-crypt @@ -81,9 +81,10 @@ k9sctx = "k9s --kubeconfig=$(switch)"; k9s = "k9s --headless"; kubectx = "export KUBECONFIG=$(switch)"; + ls = "exa"; }; - programs.home-manager.enable = true; + programs.home-manager.enable = false; # use OS programs.password-store = { enable = true; @@ -124,7 +125,6 @@ }; programs.starship = { enable = true; - # enableNushellIntegration = true; settings = { directory ={ truncation_length = 0; @@ -141,11 +141,25 @@ }; }; }; + programs.atuin = { + enable = false; + settings = { + auto_sync = false; + style = "compact"; + search_mode = "fulltext"; + filter_mode_shell_up_key_binding = "directory"; + exit_mode = "return-query"; + }; + }; programs.direnv.enable = true; programs.btop.enable = true; programs.tealdeer.enable = true; # man / tldr ... programs.gitui.enable = true; + programs.git = { + enable = true; + extraConfig.init.defaultBranch = "main"; + }; programs.neovim = { enable = false; extraConfig = '' @@ -174,6 +188,11 @@ }; }; + services.syncthing = { + enable = true; + tray.enable = true; + }; + programs.k9s = { enable = true; # does not open ERROR with clusters settings diff --git a/home/desktop-gnome.nix b/home/desktop-gnome.nix index 5bad2c5..230ea8b 100644 --- a/home/desktop-gnome.nix +++ b/home/desktop-gnome.nix @@ -2,11 +2,6 @@ { imports = [./desktop.nix]; - home.sessionVariables = { - MOZ_ENABLE_WAYLAND = 1; - MOZ_WEBRENDER = 1; - }; - dconf.settings = { "org/gnome/mutter" = { # display: partly scale (like 150% or 125%) @@ -58,6 +53,9 @@ }; }; + # programs.firefox.nativeMessagingHosts.gsconnect = true; + programs.firefox.enableGnomeExtensions = true; + home.packages = with pkgs; [ tilix gnome.gnome-tweaks diff --git a/home/desktop-sway.nix b/home/desktop-sway.nix index 8e9c374..7324e20 100644 --- a/home/desktop-sway.nix +++ b/home/desktop-sway.nix @@ -1,6 +1,10 @@ { config, pkgs, lib, ...}: + +with lib; + let cfg = config.my.sway; + lock = "${pkgs.swaylock-effects}/bin/swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 10 --fade-in 0.2 --submit-on-touch"; in { imports = [./desktop.nix]; @@ -33,13 +37,23 @@ in }; }; - config = { + config = mkMerge [ + (mkIf cfg.KDEConnect { + services.kdeconnect = { + enable = true; + indicator = true; + }; + }) + { home.sessionVariables = { + _JAVA_AWT_WM_NONREPARENTING = "1"; + SDL_VIDEODRIVER = "wayland"; + QT_QPA_PLATFORM = "wayland"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; XDG_CURRENT_DESKTOP = "sway"; - MOZ_ENABLE_WAYLAND = 1; - MOZ_WEBRENDER = 1; }; + home.packages = with pkgs; [ # sway # alacritty @@ -61,6 +75,29 @@ in # wdisplays ]; + services.kanshi = { + enable = true; + profiles = { + way.outputs = [{ + criteria = "Japan Display Inc. 0x364C Unknown"; + status = "enable"; + scale = 1.25; + }]; + homeleft.outputs = [{ + criteria = "Japan Display Inc. 0x364C Unknown"; + status = "enable"; + scale = 1.25; + position = "0,0"; + } { + criteria = "LG Electronics LG HDR 4K 0x0000655D"; + status = "enable"; + scale = 1.0; + position = "2400,0"; + mode = "3840x2160"; + }]; + }; + }; + wayland.windowManager.sway = let ws1 = "1💬"; @@ -77,7 +114,7 @@ in white = "#ffffff"; cyan = "#00afd7"; - acqua = "#00d787"; + aqua = "#00d787"; violet = "#800080"; wine = "#72003e"; magenta = "#af005f"; @@ -108,49 +145,52 @@ in }; output = { "*".bg = "~/.config/wallpaper.png fill"; - # fireThink - "Unknown 0x226D 0x00000000" = { - enable = ""; - }; - # fireG0 - "Unknown 0x405C 0x00000000" = { - position = "0 0"; - # scale = "0.7"; - # resolution = "1920x1080"; - resolution = "1366x768@60Hz"; - }; - # fireEmerald - "Unknown 0x364C 0x00000000" = { - position = "0 0"; - scale = "1.25"; - }; - "Japan Display Inc. 0x364C Unknown" = { - position = "0 0"; - scale = "1.25"; - }; - "LG Electronics LG HDR 4K 0x0000655D" = { - position = "2400 0"; - enable = ""; - scale = "1.0"; - # disable = true; - # resolution = "3840x2160@30Hz"; - resolution = "3840x2160"; - }; - "Goldstar Company Ltd LG HDR 4K 0x0000655D" = { - position = "2400 0"; - enable = ""; - scale = "1.0"; - # disable = true; - # resolution = "3840x2160@30Hz"; - resolution = "3840x2160"; - }; - "HEADLESS-1" = { - resolution = "2560x1440"; - }; - "DP-1" = { - position = "3000 0"; - # resolution = "2560x1440"; - }; + ## fireThink + #"Unknown 0x226D 0x00000000" = { + # enable = ""; + #}; + ## fireG0 + #"Unknown 0x405C 0x00000000" = { + # position = "0 0"; + # # scale = "0.7"; + # # resolution = "1920x1080"; + # resolution = "1366x768@60Hz"; + #}; + ## fireEmerald + #"Unknown 0x364C 0x00000000" = { + # position = "0 0"; + # scale = "1.25"; + # # does it work? + # enable = ""; + #}; + #"Japan Display Inc. 0x364C Unknown" = { + # position = "0 0"; + # scale = "1.25"; + # enable = ""; + #}; + #"LG Electronics LG HDR 4K 0x0000655D" = { + # position = "2400 0"; + # enable = ""; + # scale = "1.0"; + # # disable = true; + # # resolution = "3840x2160@30Hz"; + # resolution = "3840x2160"; + #}; + #"Goldstar Company Ltd LG HDR 4K 0x0000655D" = { + # position = "2400 0"; + # enable = ""; + # scale = "1.0"; + # # disable = true; + # # resolution = "3840x2160@30Hz"; + # resolution = "3840x2160"; + #}; + #"HEADLESS-1" = { + # resolution = "2560x1440"; + #}; + #"DP-1" = { + # position = "3000 0"; + # # resolution = "2560x1440"; + #}; # "DP-2" = { # position = "1920 0"; # # position = "4480 0"; @@ -178,8 +218,8 @@ in # focusedStatusline = "${white}"; background = "${black}"; # focusedBackground = "${transparent}"; - activeWorkspace = { background = "${cyan}"; border = "${gray}"; text = "${white}"; }; - focusedWorkspace = { background = "${cyan}"; border = "${cyan}"; text = "${white}"; }; + activeWorkspace = { background = "${gray}"; border = "${gray}"; text = "${white}"; }; + focusedWorkspace = { background = "${cyan}"; border = "${gray}"; text = "${white}"; }; inactiveWorkspace = { background = "${black}"; border = "${black}"; text = "${orange}"; }; urgentWorkspace = { background = "${magenta}"; border = "${magenta}"; text = "${white}"; }; bindingMode = { background = "${orange}"; border = "${orange}"; text = "${white}"; }; @@ -295,7 +335,7 @@ in "${modifier}+p" = "exec passmenu"; - "${modifier}+F11" = ''exec "swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch"''; + "${modifier}+F11" = ''exec "${lock}"''; "Print" = ''exec "grim -g \"$(slurp)\""''; }; assigns = { @@ -336,14 +376,14 @@ in ]; }; startup = [ - { command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } - { command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK" ; } - { command = "swayidle -w \\ - timeout 300 'swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch' \\ - timeout 600 'swaymsg output * dpms off' \\ - resume 'swaymsg output * dpms on' \\ - before-sleep 'swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch'"; } - { command = "mako"; } + # { command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } + # { command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK" ; } + # { command = "swayidle -w \\ + # timeout 300 'swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch' \\ + # timeout 600 'swaymsg output * dpms off' \\ + # resume 'swaymsg output * dpms on' \\ + # before-sleep 'swaylock -SeFfk --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.2 --submit-on-touch'"; } + #{ command = "mako"; } #{ command = "kanshi"; } # indicator { command = "networkd-notify"; } @@ -354,10 +394,6 @@ in # apps { command = "firefox"; } #{ command = "firefoxdeveloperedition"; } - ] ++ lib.optionals (cfg.KDEConnect) [ - { command = "/usr/lib/kdeconnectd"; } - { command = "${pkgs.libsForQt5.kdeconnect-kde}/libexec/kdeconnectd"; } - { command = "kdeconnect-indicator"; } ] ++ lib.optionals (cfg.mail) [ { command = "thunderbird"; } ] ++ lib.optionals (cfg.nextcloud) [ @@ -367,6 +403,23 @@ in #{ command = "gajim"; } ]; }; + extraConfig = '' +set $laptop eDP-1 +bindswitch --reload --locked lid:on output $laptop disable +bindswitch --reload --locked lid:off output $laptop enable +exec_always "cat /proc/acpi/button/lid/*/state | grep -q open && swaymsg output $laptop enable || swaymsg output $laptop disable" + ''; + }; + services.swayidle = { + enable = true; + timeouts = [ + { timeout = 300; command = "${lock}"; } + { timeout = 600; command = "${pkgs.sway}/bin/swaymsg output * dpms off"; } + ]; + events = [ + { event = "before-sleep"; command = "${lock}"; } + { event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg output * dpms on"; } + ]; }; # use nixos's .... @@ -515,5 +568,5 @@ label=⏰ command=date '+%T' interval=1 ''; - }; + }]; } diff --git a/home/desktop.nix b/home/desktop.nix index d3bf861..d7a4f77 100644 --- a/home/desktop.nix +++ b/home/desktop.nix @@ -3,8 +3,11 @@ imports = [./default.nix]; home.sessionVariables = { - BROWSER = "firefox"; NIXOS_OZONE_WL = "1"; + BROWSER = "firefox"; + GDK_BACKEND = "wayland"; + MOZ_ENABLE_WAYLAND = "1"; + MOZ_WEBRENDER = "1"; }; fonts.fontconfig.enable = true; @@ -52,7 +55,7 @@ graphviz-nox # - tootle # mastodon # fractal # matrix - fractal-next + # TODO fractal-next # fluffychat cozy # audiobooks ]; @@ -63,6 +66,7 @@ # name = "Yaru-dark"; package = pkgs.flat-remix-gtk; + name = "Flat-Remix-GTK-Blue-Darkest"; # name = "Flat-Remix-GTK-Blue-Darkest-NoBorder"; # name = "Flat-Remix-GTK-Blue-Darker"; }; @@ -95,9 +99,22 @@ enable = true; browsers = ["firefox"]; }; + programs.librewolf = { + enable = false; + settings = { + "privacy.clearOnShutdown.history" = false; + "privacy.clearOnShutdown.downloads" = false; + "browser.sessionstore.privacy_level" = 0; + }; + }; programs.firefox = { enable = true; + # nixos not home-manager + # nativeMessagingHosts = { + # fxCast = true; + #}; + # package = pkgs.firefox-beta-bin; + # # package = pkgs.firefox-devedition-bin; # package = pkgs.librewolf; - # package = pkgs.firefox-devedition-bin-unwrapped; }; } diff --git a/nixos/README.md b/nixos/README.md index 2d5a29d..00e82f2 100644 --- a/nixos/README.md +++ b/nixos/README.md @@ -35,3 +35,12 @@ Create `/etc/nixos/configuration.nix` with: ``` and run `nixos-rebuild switch --upgrade` + +## my current package channels + +``` +nix-channel --list +home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz +nixos https://nixos.org/channels/nixos-unstable +nixpkgs https://nixos.org/channels/nixpkgs-unstable +``` diff --git a/nixos/default.nix b/nixos/default.nix index e1328fa..a3c76b8 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -3,7 +3,9 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, ... }: - +let + pkgsHomeManager = import {}; +in { system.autoUpgrade.enable = true; nix.optimise.automatic = true; @@ -17,12 +19,14 @@ services.openssh = { enable = true; - passwordAuthentication = false; - kbdInteractiveAuthentication = false; - permitRootLogin = "without-password"; openFirewall = true; ports = [ 1512 ]; startWhenNeeded = true; + settings = { + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + PermitRootLogin = "without-password"; + }; }; users.users.root.openssh.authorizedKeys.keys = [ "command=\"zrepl stdinserver fireStore\",restrict ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM1U9DTKueKuTuu/F9wxGr3we7y00V8HMyUjVBMwFQwo root-zrepl@fireStore" @@ -56,10 +60,11 @@ jq unzip unrar - home-manager ## nice prompt together with grml # pure-prompt nushell + ] ++ [ + pkgsHomeManager.home-manager ]; environment.shellAliases = { ip = "ip --color"; @@ -119,7 +124,9 @@ }; }; - # tmux - imports = [ ./files/tmux.nix ]; + imports = [ + # tmux + ./files/tmux.nix + ]; } diff --git a/nixos/users.nix b/nixos/users.nix index fb8bae6..7fc182d 100644 --- a/nixos/users.nix +++ b/nixos/users.nix @@ -10,6 +10,7 @@ extraGroups = ["wheel"]; isNormalUser = true; useDefaultShell = true; + # shell = pkgs.nushell; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIOr9wE3i1+Cl/06WOf0/6OjxsOnN7veV3LZcWgtHkcS genofire@fireYubi" ];