From f138a25ad6ae9a59ae334cb368f1a1ab01b71370 Mon Sep 17 00:00:00 2001 From: aciceri Date: Fri, 1 Oct 2021 00:43:42 +0200 Subject: [PATCH] Fixed sway, waybar, xdg and pass --- hosts/pbp/configuration.nix | 6 +- hosts/pc/configuration.nix | 6 +- profiles/core/default.nix | 4 -- profiles/xdg/default.nix | 11 ++++ secrets/.gitattributes | 4 -- secrets/secrets.nix | 9 --- users/profiles/foot/default.nix | 3 +- users/profiles/password-store/default.nix | 8 ++- users/profiles/sway/default.nix | 78 +++++++++++------------ users/profiles/zsh/default.nix | 1 + 10 files changed, 65 insertions(+), 65 deletions(-) create mode 100644 profiles/xdg/default.nix delete mode 100644 secrets/.gitattributes delete mode 100644 secrets/secrets.nix diff --git a/hosts/pbp/configuration.nix b/hosts/pbp/configuration.nix index 6e97309..79d2776 100644 --- a/hosts/pbp/configuration.nix +++ b/hosts/pbp/configuration.nix @@ -1,12 +1,12 @@ { config, lib, pkgs, profiles, pbpKernelLatest, ... }: { - imports = with profiles; [ mount-nas sshd dbus ]; + imports = with profiles; [ mount-nas sshd dbus avahi printing xdg ]; boot = { initrd.availableKernelModules = [ "usbhid" ]; kernelPackages = pbpKernelLatest; - kernelModules = [ ]; + kernelModules = []; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; @@ -45,7 +45,7 @@ }; swapDevices = - [{ device = "/dev/disk/by-uuid/e236d328-496e-4cf8-ba54-857789ca258f"; }]; + [ { device = "/dev/disk/by-uuid/e236d328-496e-4cf8-ba54-857789ca258f"; } ]; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; } diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix index e3c8bf9..66f6e6d 100644 --- a/hosts/pc/configuration.nix +++ b/hosts/pc/configuration.nix @@ -1,11 +1,11 @@ { config, lib, pkgs, profiles, ... }: { - imports = with profiles; [ mount-nas sshd dbus avahi printing ]; + imports = with profiles; [ mount-nas sshd dbus avahi printing xdg ]; boot = { initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - initrd.kernelModules = [ ]; + initrd.kernelModules = []; kernelModules = [ "kvm-intel" ]; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback @@ -41,7 +41,7 @@ }; swapDevices = - [{ device = "/dev/disk/by-label/swap"; }]; + [ { device = "/dev/disk/by-label/swap"; } ]; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/profiles/core/default.nix b/profiles/core/default.nix index 251b883..b3fa0e7 100644 --- a/profiles/core/default.nix +++ b/profiles/core/default.nix @@ -46,10 +46,6 @@ in time.timeZone = "Europe/Rome"; location.provider = "geoclue2"; - xdg.portal.enable = true; # is this needed? - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ]; - xdg.portal.gtkUsePortal = true; - nix = { autoOptimiseStore = true; gc.automatic = true; diff --git a/profiles/xdg/default.nix b/profiles/xdg/default.nix new file mode 100644 index 0000000..e26093b --- /dev/null +++ b/profiles/xdg/default.nix @@ -0,0 +1,11 @@ +{ + xdg.portal.enable = true; + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ]; + xdg.portal.gtkUsePortal = true; + services.pipewire.enable = true; + environment.sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + XDG_CURRENT_DESKTOP = "sway"; # https://github.com/emersion/xdg-desktop-portal-wlr/issues/20 + XDG_SESSION_TYPE = "wayland"; # https://github.com/emersion/xdg-desktop-portal-wlr/pull/11 + }; +} diff --git a/secrets/.gitattributes b/secrets/.gitattributes deleted file mode 100644 index 901863e..0000000 --- a/secrets/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -* filter=git-crypt diff=git-crypt -.gitattributes !filter !diff -secrets.nix !filter !diff -README.md !filter !diff diff --git a/secrets/secrets.nix b/secrets/secrets.nix deleted file mode 100644 index bac30e0..0000000 --- a/secrets/secrets.nix +++ /dev/null @@ -1,9 +0,0 @@ -let - # set ssh public keys here for your system and user - system = ""; - user = ""; - allKeys = [ system user ]; -in -{ - "secret.age".publicKeys = allKeys; -} diff --git a/users/profiles/foot/default.nix b/users/profiles/foot/default.nix index a9acd38..a82a564 100644 --- a/users/profiles/foot/default.nix +++ b/users/profiles/foot/default.nix @@ -1,7 +1,7 @@ { programs.foot = { enable = true; - server.enable = true; + server.enable = false; # server is executed by sway without systemd integration settings = { main = { term = "xterm-256color"; @@ -14,5 +14,6 @@ hide-when-typing = "yes"; }; }; + }; } diff --git a/users/profiles/password-store/default.nix b/users/profiles/password-store/default.nix index f421708..185e323 100644 --- a/users/profiles/password-store/default.nix +++ b/users/profiles/password-store/default.nix @@ -1,5 +1,9 @@ { - services.pass-secret-service.enable = true; services.password-store-sync.enable = true; - programs.password-store.enable = true; + programs.password-store = { + enable = true; + settings = { + PASSWORD_STORE_DIR = "/home/ccr/.password-store"; + }; + }; } diff --git a/users/profiles/sway/default.nix b/users/profiles/sway/default.nix index d8b7793..29d5585 100644 --- a/users/profiles/sway/default.nix +++ b/users/profiles/sway/default.nix @@ -6,47 +6,47 @@ let modifier = "Mod4"; in - { - enable = true; - config = { - modifier = modifier; - menu = "${pkgs.bemenu}/bin/bemenu-run -b -m 1 -p 'λ'"; - output = { - HDMI-A-2 = { - #bg = "~/dotfiles/dotfiles/xorg/wallpaper.jpg fill"; - }; - }; - #fonts = [ "Font Awesome" "Fira Code" ]; - terminal = "${pkgs.foot}/bin/footclient"; - bars = [ - { - command = "${pkgs.waybar}/bin/waybar"; - } - ]; - #startup = [{ - #command = "systemctl --user restart redshift"; - # always = true; - #}]; - window.commands = [ - { criteria = { app_id = "mpv"; }; command = "sticky enable"; } - { criteria = { app_id = "mpv"; }; command = "floating enable"; } - { criteria = { title = "MetaMask Notification.*"; }; command = "floating enable"; } - ]; - input = { - "*" = { - xkb_layout = "us"; - xkb_variant = "intl"; + { + enable = true; + config = { + modifier = modifier; + menu = "${pkgs.bemenu}/bin/bemenu-run -b -m 1 -p 'λ'"; + output = { + HDMI-A-2 = { + #bg = "~/dotfiles/dotfiles/xorg/wallpaper.jpg fill"; + }; + }; + #fonts = [ "Font Awesome" "Fira Code" ]; + terminal = "${pkgs.foot}/bin/footclient"; + bars = [ + { + command = "${pkgs.waybar}/bin/waybar"; + } + ]; + startup = [ + { + command = "foot --server"; + always = true; + } + ]; + window.commands = [ + { criteria = { app_id = "mpv"; }; command = "sticky enable"; } + { criteria = { app_id = "mpv"; }; command = "floating enable"; } + { criteria = { title = "MetaMask Notification.*"; }; command = "floating enable"; } + ]; + input = { + "*" = { + xkb_layout = "us"; + xkb_variant = "intl"; + }; }; }; + extraConfig = '' + bindsym ${modifier}+p move workspace to output right + ''; + xwayland = true; + systemdIntegration = true; }; - extraConfig = '' - bindsym ${modifier}+p move workspace to output right - #exec systemctl --user import-environment - #exec systemctl --user start graphical-session.target - ''; - xwayland = true; - systemdIntegration = true; - }; }; programs.waybar = { @@ -62,7 +62,7 @@ "sway/mode" "sway/workspaces" ]; - modules-center = [ ]; + modules-center = []; modules-right = [ "idle_inhibitor" "tray" diff --git a/users/profiles/zsh/default.nix b/users/profiles/zsh/default.nix index d0297e2..a4a41ef 100644 --- a/users/profiles/zsh/default.nix +++ b/users/profiles/zsh/default.nix @@ -54,5 +54,6 @@ NIX_BUILD_SHELL = "${pkgs.zsh-nix-shell}/scripts/buildShellShim.zsh"; PROMPT = "\\\${IN_NIX_SHELL:+[nix-shell] }$PROMPT"; }; + loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec sway"; }; }