From e3d958060e65c74782109c424c60e68e07d8a5d8 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 6 Jan 2023 12:09:02 -0600 Subject: [PATCH] adding desktop.nix --- modules/desktop.nix | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 modules/desktop.nix diff --git a/modules/desktop.nix b/modules/desktop.nix new file mode 100644 index 0000000..6d15230 --- /dev/null +++ b/modules/desktop.nix @@ -0,0 +1,85 @@ +{ pkgs, lib, config, ... }: + +with lib; +{ + + nix = { + extraOptions = "experimental-features = nix-command flakes"; + package = pkgs.nixVersions.unstable; + }; + + # This adds hyprland cache to cachix + nix.settings = { + substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; + + boot.supportedFilesystems = [ "ntfs" ]; + services.xserver = { + enable = true; + autorun = false; + # windowManager.awesome = { + # enable = true; + # package = pkgs.awesome; + # }; + displayManager = { + startx.enable = true; + sddm = { + enable = false; + }; + session = [ + { + manage = "desktop"; + name = "Hyprland"; + start = '' + /home/chris/bin/hyprland & + waitPID=$! + ''; + } + ]; + }; + desktopManager.plasma5 = { + enable = true; + runUsingSystemd = true; + }; + # desktopManager.gnome.enable = true; + }; + + services.greetd = { + enable = true; + settings = rec { + initial_session = { + command = "dbus-run-session startplasma-wayland"; + user = "chris"; + }; + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time -r --window-padding 2 --cmd 'dbus-run-session startplasma-wayland'"; + user = "greeter"; + }; + plasma_session = { + command = "dbus-run-session startplasma-wayland"; + user = "chris"; + }; + hyprland_session = { + command = "/home/chris/bin/hyprland"; + user = "chris"; + }; + }; + }; + + environment.etc."greetd/environments".text = '' + /home/chris/bin/hyprland + fish + bash + dbus-run-session startplasma-wayland +''; + + programs.hyprland = { + enable = true; + }; + + services.avahi = { + enable = true; + nssmdns = true; + }; +}