From 613e014aca4e7f570c8f80196ce63e993bba389f Mon Sep 17 00:00:00 2001 From: Adrien Faure Date: Fri, 26 Jan 2024 00:15:32 +0100 Subject: [PATCH] nixos: better separation for graphical sevices --- nixos/profiles/common/default.nix | 11 ++++- nixos/profiles/common/package_list.nix | 1 + nixos/profiles/graphical/default.nix | 56 ++-------------------- nixos/profiles/graphical/packages_list.nix | 2 + nixos/services/gnome/default.nix | 24 ++++++++++ nixos/services/sway/default.nix | 52 ++++++++++++++++++++ 6 files changed, 92 insertions(+), 54 deletions(-) create mode 100644 nixos/services/gnome/default.nix diff --git a/nixos/profiles/common/default.nix b/nixos/profiles/common/default.nix index 2f9b54b..83e71cf 100644 --- a/nixos/profiles/common/default.nix +++ b/nixos/profiles/common/default.nix @@ -33,11 +33,13 @@ with lib; { ''; }; mtr.enable = true; + gnupg.agent = { enable = true; + pinentryFlavor = "qt"; enableSSHSupport = true; - # pinentryFlavor = "gtk2"; }; + # Whether interactive shells should show which Nix package (if any) # provides a missing command. command-not-found.enable = true; @@ -119,7 +121,14 @@ with lib; { }; services.pcscd.enable = true; + services.sshd.enable = true; services.keybase.enable = true; documentation.dev.enable = true; + + #TODO Auto mount usb sticks + services.devmon.enable = true; + services.gvfs.enable = true; + services.udisks2.enable = true; + } diff --git a/nixos/profiles/common/package_list.nix b/nixos/profiles/common/package_list.nix index e5f357e..fb30276 100644 --- a/nixos/profiles/common/package_list.nix +++ b/nixos/profiles/common/package_list.nix @@ -26,6 +26,7 @@ with lib; { w3m # web poppler # PDF mediainfo # audio and video + pinentry-curses ]; }; } diff --git a/nixos/profiles/graphical/default.nix b/nixos/profiles/graphical/default.nix index 3ca5196..06502a0 100644 --- a/nixos/profiles/graphical/default.nix +++ b/nixos/profiles/graphical/default.nix @@ -5,38 +5,17 @@ pi3blocksi3blockskgs, ... }: let - sddm-theme-chili = pkgs.stdenv.mkDerivation rec { - name = "sddm-chili"; - src = pkgs.fetchFromGitHub { - owner = "MarianArlt"; - repo = name; - rev = "6516d50176c3b34df29003726ef9708813d06271"; - sha256 = "sha256-wxWsdRGC59YzDcSopDRzxg8TfjjmA3LHrdWjepTuzgw="; - }; - - installPhase = '' - mkdir $out/share/sddm/themes/${name} -p - cp ${src}/* $out/share/sddm/themes/${name}/. -aR - ''; - - meta = with lib; { - description = "Theme for SDDM"; - homepage = "https://github.com/MarianArlt/sddm-chili"; - license = licenses.gpl3Only; - maintainers = with maintainers; [dan4ik605743]; - platforms = platforms.linux; - }; - }; in with lib; { imports = [ ./packages_list.nix ../../services/sway + ../../services/gnome ]; environment.adfaure.environments.graphical.enable = true; - environment.adfaure.services.sway.enable = true; + environment.adfaure.services.gnome.enable = true; # environment.adfaure.programs.emacs.enable=true; programs.light.enable = true; @@ -57,39 +36,10 @@ in services.pipewire = { enable = true; alsa.enable = true; + alsa.support32Bit = true; pulse.enable = true; }; - services.xserver = { - enable = true; - displayManager.sddm = { - enable = true; - theme = "sddm-chili"; - enableHidpi = true; - }; - - layout = "fr"; - # xkbVariant = "bepo"; - resolutions = [ - { - x = 2560; - y = 1440; - } - { - x = 1920; - y = 1080; - } - ]; - libinput.enable = true; - }; - - environment.systemPackages = with pkgs; [ - # SDDM Theme - libsForQt5.plasma-framework - libsForQt5.qt5.qtgraphicaleffects - sddm-theme-chili - ]; - services.dbus.enable = true; # xdg.portal = { diff --git a/nixos/profiles/graphical/packages_list.nix b/nixos/profiles/graphical/packages_list.nix index 56bdebd..20ef9db 100644 --- a/nixos/profiles/graphical/packages_list.nix +++ b/nixos/profiles/graphical/packages_list.nix @@ -56,6 +56,8 @@ with lib; { libreoffice zotero + + pinentry-qt ]; }; } diff --git a/nixos/services/gnome/default.nix b/nixos/services/gnome/default.nix new file mode 100644 index 0000000..4dd18dd --- /dev/null +++ b/nixos/services/gnome/default.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + my-dotfiles, + ... +}: +with lib; let + cfg = config.environment.adfaure.services.gnome; +in { + options.environment.adfaure.services.gnome = { + enable = mkEnableOption "gnome"; + }; + + config = mkIf cfg.enable { + # Enable the GNOME Desktop Environment. + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + + environment.systemPackages = with pkgs; [ + ]; + }; +} diff --git a/nixos/services/sway/default.nix b/nixos/services/sway/default.nix index 5e4a7c3..df71e15 100644 --- a/nixos/services/sway/default.nix +++ b/nixos/services/sway/default.nix @@ -8,6 +8,30 @@ with lib; let cfg = config.environment.adfaure.services.sway; + sddm-theme-chili = pkgs.stdenv.mkDerivation rec { + name = "sddm-chili"; + + src = pkgs.fetchFromGitHub { + owner = "MarianArlt"; + repo = name; + rev = "6516d50176c3b34df29003726ef9708813d06271"; + sha256 = "sha256-wxWsdRGC59YzDcSopDRzxg8TfjjmA3LHrdWjepTuzgw="; + }; + + installPhase = '' + mkdir $out/share/sddm/themes/${name} -p + cp ${src}/* $out/share/sddm/themes/${name}/. -aR + ''; + + meta = with lib; { + description = "Theme for SDDM"; + homepage = "https://github.com/MarianArlt/sddm-chili"; + license = licenses.gpl3Only; + maintainers = with maintainers; [dan4ik605743]; + platforms = platforms.linux; + }; + }; + # i3conf = builtins.readFile "${my-dotfiles}/files/i3"; # bash script to let dbus know about important env variables and # propogate them to relevent services run at the end of sway config @@ -64,6 +88,29 @@ in { wrapperFeatures.gtk = true; }; + services.xserver = { + enable = true; + displayManager.sddm = { + enable = true; + theme = "sddm-chili"; + enableHidpi = true; + }; + + layout = "fr"; + # xkbVariant = "bepo"; + resolutions = [ + { + x = 2560; + y = 1440; + } + { + x = 1920; + y = 1080; + } + ]; + libinput.enable = true; + }; + environment.systemPackages = with pkgs; [ blueman rxvt_unicode @@ -97,6 +144,11 @@ in { waybar-with-conf waybar + + sddm-theme-chili + + libsForQt5.plasma-framework + libsForQt5.qt5.qtgraphicaleffects ]; }; }