From 5c79c29b7de33d5b1970e36c15c660b9ca86e4e4 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Thu, 30 Jan 2025 10:54:27 +0100 Subject: [PATCH] wip - fixes to import and config location --- README.md | 5 +- flake.nix | 3 + hosts/spectre-x360-2018/default.nix | 1 - modules/home-manager/flatpaks.nix | 35 +++++---- .../home-manager/hyprland-customization.nix | 73 +++++++++++++++---- modules/nixos/flatpak.nix | 9 --- modules/nixos/gdm.nix | 45 ------------ modules/nixos/hyprland.nix | 28 +++---- modules/nixos/networking.nix | 4 + modules/nixos/nvidia.nix | 16 ++-- 10 files changed, 110 insertions(+), 109 deletions(-) delete mode 100644 modules/nixos/flatpak.nix delete mode 100644 modules/nixos/gdm.nix create mode 100644 modules/nixos/networking.nix diff --git a/README.md b/README.md index 263d5b6..37f4f6b 100644 --- a/README.md +++ b/README.md @@ -42,5 +42,6 @@ This will create an iso image in the result directory. ## Inspirations - https://github.com/the-nix-way/dev-templates - https://fasterthanli.me/series/building-a-rust-service-with-nix/part-10 -- https://codeberg.org/theDoctor/nixOS-config -- https://ianthehenry.com/posts/how-to-learn-nix/profiles/ \ No newline at end of file +- https://ianthehenry.com/posts/how-to-learn-nix/profiles/ +- https://github.com/JohnRTitor/nix-conf +- https://github.com/mwaldleben/nix-config \ No newline at end of file diff --git a/flake.nix b/flake.nix index 277a5cf..95bce6e 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,9 @@ inputs.nix-flatpak.homeManagerModules.nix-flatpak inputs.walker.homeManagerModules.default ]; + + nixpkgs.overlays = [ inputs.hyprpanel.overlay ]; + # _module.args = { inherit inputs; }; } ]; }; diff --git a/hosts/spectre-x360-2018/default.nix b/hosts/spectre-x360-2018/default.nix index 05cac3b..42cd0fe 100644 --- a/hosts/spectre-x360-2018/default.nix +++ b/hosts/spectre-x360-2018/default.nix @@ -4,7 +4,6 @@ imports = [ ./configuration.nix ./hardware-configuration.nix - ../../modules/nixos/flatpak.nix ../../modules/nixos/hyprland.nix ../../modules/nixos/monitoring.nix ../../modules/nixos/nvidia.nix diff --git a/modules/home-manager/flatpaks.nix b/modules/home-manager/flatpaks.nix index bfe3a2b..60d8313 100644 --- a/modules/home-manager/flatpaks.nix +++ b/modules/home-manager/flatpaks.nix @@ -1,19 +1,24 @@ -{ lib, ... }: { +{ lib, pkgs, ... }: { - services.flatpak.enable = true; - - services.flatpak.update.auto.enable = false; - services.flatpak.uninstallUnmanaged = false; + # services.flatpak.enable = true; + # xdg.portal.enable = true; + # # install the xdg-desktop-portal-gtk package + # # to enable the portal service + # xdg.portal.extraPortals = with pkgs; [ + # xdg-desktop-portal-gtk + # ]; + # services.flatpak.update.auto.enable = false; + # services.flatpak.uninstallUnmanaged = false; - services.flatpak.packages = [ - "com.calibre_ebook.calibre" - "com.github.flxzt.rnote" - "com.github.tchx84.Flatseal" - "com.spotify.Client" - "io.podman_desktop.PodmanDesktop" - "org.pipewire.Helvum" - "io.github.zen_browser.zen" - "im.riot.Riot" - ]; + # services.flatpak.packages = [ + # "com.calibre_ebook.calibre" + # "com.github.flxzt.rnote" + # "com.github.tchx84.Flatseal" + # "com.spotify.Client" + # "io.podman_desktop.PodmanDesktop" + # "org.pipewire.Helvum" + # "io.github.zen_browser.zen" + # "im.riot.Riot" + # ]; } \ No newline at end of file diff --git a/modules/home-manager/hyprland-customization.nix b/modules/home-manager/hyprland-customization.nix index c6a0041..3c489ef 100644 --- a/modules/home-manager/hyprland-customization.nix +++ b/modules/home-manager/hyprland-customization.nix @@ -1,8 +1,10 @@ {inputs, pkgs, ...}: { programs.kitty.enable = true; + wayland.windowManager.hyprland = { enable = true; + systemd.enable = true; settings = { "$mod" = "SUPER"; bind = @@ -10,33 +12,65 @@ "$mod, F, exec, firefox" "$mod, return, exec, walker" "$mod_SHIFT, return, exec, kitty" - "$mod_SHIFT, q, kill" "$mod, s, exec, code" ]; - - # plugin.virtual-desktops = { + general = { + gaps_in = 5; + gaps_out = 5; + border_size = 1; + }; + + misc = { + disable_hyprland_logo = true; + }; - # } - exec-once = [ - "${pkgs.hyprpanel}/bin/hyprpanel" - ]; + input = { + kb_layout = "de"; + }; + + decoration = { + rounding = 5; + }; + # plugin.virtual-desktops = {} }; plugins = [ # Touch gestures: https://github.com/horriblename/hyprgrass - inputs.hyprgrass.packages.${pkgs.system}.default + # inputs.hyprgrass.packages.${pkgs.system}.default # Virtual desktops: https://github.com/levnikmyskin/hyprland-virtual-desktops # inputs.hyprland-virtual-desktops.packages.${pkgs.system}.virtual-desktops ]; }; + imports = [ inputs.hyprpanel.homeManagerModules.hyprpanel ]; + # the overlay makes this available as a home manager module + programs.hyprpanel = { + enable = true; + hyprland.enable = true; + overwrite.enable = true; + overlay.enable = true; + + settings = { + bar = { + clock.format = "%H:%M"; + clock.showIcon = false; + launcher.icon = "🚀"; + }; + }; + + + + # Add custom widgets + styling + }; + + programs.walker = { enable = true; runAsService = true; # All options from the config.json can be used here. config = { - search.placeholder = "Example"; + search.placeholder = "Search"; ui.fullscreen = true; list = { height = 200; @@ -53,8 +87,21 @@ # ''; }; - # # Set waybar config - # ".config/waybar/config".text = '' - # '' - + + programs.hyprlock = { + enable = true; + settings = { + general = { + grace = 5; + no_fade_in = false; + disable_loading_bar = false; + }; + }; + # Style the lock screen + }; + + services.network-manager-applet = { + enable = true; + }; + } diff --git a/modules/nixos/flatpak.nix b/modules/nixos/flatpak.nix deleted file mode 100644 index d6f130c..0000000 --- a/modules/nixos/flatpak.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - services.flatpak.enable = true; -} diff --git a/modules/nixos/gdm.nix b/modules/nixos/gdm.nix deleted file mode 100644 index 88ef654..0000000 --- a/modules/nixos/gdm.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - # this actually does not enable xorg, but it is required for GDM - services.xserver.enable = true; - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; - # here we set wayland to be used - services.xserver.displayManager.gdm.wayland = true; - - - ## Slim down the gnome dependencies - environment.gnome.excludePackages = (with pkgs; [ - gnome-photos - gnome-tour - geary - gedit - tali - gnome-music - cheese - epiphany - gnome-calendar - gnome-maps - simple-scan - yelp - gnome-disk-utility - gnome-notes - gnome-weather - gnome-secrets - gnome-characters - gnome-font-viewer - gnome-system-monitor - gnome-text-editor - gnome-connections - gnome-clocks - baobab - gnome-contacts - gnome-logs - ]); - -} diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix index 47553ad..9098389 100644 --- a/modules/nixos/hyprland.nix +++ b/modules/nixos/hyprland.nix @@ -5,31 +5,21 @@ ... }: { - programs.uwsm.enable = true; - + # Use hyprland as the main desktop environment but use gdm as desktop manager programs.hyprland = { enable = true; xwayland.enable = false; - withUWSM = true; }; - # launch hyprland on login - # systemd.services.hyprland = { - # description = "Hyprland"; - # wantedBy = [ "graphical.target" ]; - # after = [ "display-manager.service" ]; - # serviceConfig = { - # Type = "simple"; - # ExecStart = "${pkgs.hyprland}/bin/hyprland"; - # Restart = "always"; - # RestartSec = "5"; - # User = config.var.username; - # }; - # }; - environment.systemPackages = with pkgs; [ - waybar - ]; + services.displayManager = { + defaultSession = "hyprland"; + }; + + services.xserver.displayManager.gdm = { + enable = true; + wayland = true; + }; } diff --git a/modules/nixos/networking.nix b/modules/nixos/networking.nix new file mode 100644 index 0000000..baca895 --- /dev/null +++ b/modules/nixos/networking.nix @@ -0,0 +1,4 @@ +{lib, ...}:{ + networking.networkmanager.enable = true; + networking.networkmanager.wifi.powersave = lib.mkDefault true; +} \ No newline at end of file diff --git a/modules/nixos/nvidia.nix b/modules/nixos/nvidia.nix index b0d0635..0302f11 100644 --- a/modules/nixos/nvidia.nix +++ b/modules/nixos/nvidia.nix @@ -47,12 +47,12 @@ # In the global configuration, we blacklist the nouveau driver and load the nvidia driver - boot.extraModprobeConfig = lib.mkDefault '' + boot.extraModprobeConfig = '' blacklist nouveau options nouveau modeset=0 ''; - services.udev.extraRules = lib.mkDefault '' + services.udev.extraRules = '' # Remove NVIDIA USB xHCI Host Controller devices, if present ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1" # Remove NVIDIA USB Type-C UCSI devices, if present @@ -61,10 +61,12 @@ ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1" # Remove NVIDIA VGA/3D controller devices ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", ATTR{power/control}="auto", ATTR{remove}="1" - # Remove the whole bridge responsible for the VGA/3D controller - ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{class}=="0x060400", ATTR{power/control}="auto", ATTR{remove}="1" ''; + + # # Remove the whole bridge responsible for the VGA/3D controller + # ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{class}=="0x060400", ATTR{power/control}="auto", ATTR{remove}="1" + # # somehow the udev rules are not enough to prevent the nouveau driver from loading # # Also unload remove the bus by id manually # # unload 0000:01:00.1 and 0000:01:00.0 @@ -86,5 +88,9 @@ - boot.blacklistedKernelModules = lib.mkDefault [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ]; + boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ]; } + + +# Warning: used to have +# lib.mkdDefault