Skip to content

Commit

Permalink
nixos: better separation for graphical sevices
Browse files Browse the repository at this point in the history
  • Loading branch information
adfaure committed Jan 25, 2024
1 parent e4b10a3 commit 613e014
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 54 deletions.
11 changes: 10 additions & 1 deletion nixos/profiles/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

}
1 change: 1 addition & 0 deletions nixos/profiles/common/package_list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ with lib; {
w3m # web
poppler # PDF
mediainfo # audio and video
pinentry-curses
];
};
}
56 changes: 3 additions & 53 deletions nixos/profiles/graphical/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 = {
Expand Down
2 changes: 2 additions & 0 deletions nixos/profiles/graphical/packages_list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ with lib; {

libreoffice
zotero

pinentry-qt
];
};
}
24 changes: 24 additions & 0 deletions nixos/services/gnome/default.nix
Original file line number Diff line number Diff line change
@@ -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; [
];
};
}
52 changes: 52 additions & 0 deletions nixos/services/sway/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -97,6 +144,11 @@ in {

waybar-with-conf
waybar

sddm-theme-chili

libsForQt5.plasma-framework
libsForQt5.qt5.qtgraphicaleffects
];
};
}

0 comments on commit 613e014

Please sign in to comment.