diff --git a/.gitignore b/.gitignore index 97c76f8..200ca60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ hardware-configuration.nix -networking.nix +calib-data.bin diff --git a/hosts/default.nix b/hosts/default.nix index 5f6bd1a..0b6e4fe 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,20 +1,20 @@ { self, ... }: let - inherit (self) inputs; - system = "x86_64-linux"; - homeDir = self + /profiles; - pkgs = inputs.nixpkgs.legacyPackages.${system}; - mkSystem = pkgs: hostname: - pkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./base-configuration.nix - ./${hostname} - homeDir - inputs.home-manager.nixosModules.home-manager - ]; - }; + inherit (self) inputs; + system = "x86_64-linux"; + homeDir = self + /profiles; + pkgs = inputs.nixpkgs.legacyPackages.${system}; + mkSystem = pkgs: hostname: + pkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + ./base-configuration.nix + ./${hostname} + homeDir + inputs.home-manager.nixosModules.home-manager + ]; + }; in { - hulk = mkSystem inputs.nixpkgs "hulk"; + hulk = mkSystem inputs.nixpkgs "hulk"; } diff --git a/hosts/hulk/networking.nix b/hosts/hulk/networking.nix new file mode 100644 index 0000000..41b7be1 --- /dev/null +++ b/hosts/hulk/networking.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +let + networkManagerEnabled = true; + wirelessEnabled = false; +in { + networking.networkmanager.enable = pkgs.lib.mkIf networkManagerEnabled true; + + networking.wireless.enable = pkgs.lib.mkIf wirelessEnabled true; + networking.wireless.userControlled.enable = pkgs.lib.mkIf wirelessEnabled true; +} diff --git a/hosts/hulk/services.nix b/hosts/hulk/services.nix index e62b49c..317d9b5 100644 --- a/hosts/hulk/services.nix +++ b/hosts/hulk/services.nix @@ -1,17 +1,12 @@ { pkgs, ... }: { - services."06cb-009a-fingerprint-sensor" = { - enable = true; - backend = "python-validity"; - calib-data-file = ./calib-data.bin; - }; - services.greetd-hyprland.enable = true; services.nvidia.enable = true; - services.fingerprint-fix.enable = true; - - services.fprintd.enable = pkgs.lib.mkForce true; + services.fingerprint-fix = { + enable = true; + calibDataFile = ./calib-data.bin; + }; services.upower.enable = true; services.udev.enable = true; @@ -29,13 +24,6 @@ alsa.support32Bit = true; pulse.enable = true; jack.enable = true; - extraConfig.pipewire.context.properties = { - default.clock.allowed-rates = [ 44100 48000 96000 ]; - log.level = 4; - default.clock.quantum = 256; - default.clock.min-quantum = 256; - default.clock.max-quantum = 256; - }; }; systemd.services.bluetooth.serviceConfig.ExecStart = pkgs.lib.mkForce [ @@ -56,4 +44,6 @@ STOP_CHARGE_THRESH_BAT0 = 80; }; }; + + services.dbus.enable = true; } diff --git a/modules/open-fprint-suspend-fix.nix b/modules/open-fprint-suspend-fix.nix index 3780118..cc29f44 100644 --- a/modules/open-fprint-suspend-fix.nix +++ b/modules/open-fprint-suspend-fix.nix @@ -1,19 +1,30 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: { - options.services.fingerprint-fix.enable = lib.mkEnableOption "Enable systemd service to restart fingerprint services after suspend."; + options.services.fingerprint-fix.enable = lib.mkEnableOption "Enable systemd service to restart fingerprint services after suspend."; + options.services.fingerprint-fix.calibDataFile = lib.mkOption { + description = "Path to calibration data file."; + }; - config = lib.mkIf config.services.fingerprint-fix.enable { - systemd.services.validity-restart = let - targets = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ]; - in { - description = "Restart services to fix fingerprint integration"; - wantedBy = targets; - after = targets; - serviceConfig = { - type = "oneshot"; - ExecStart = "systemctl restart python3-validity.service"; - }; - }; + config = lib.mkIf config.services.fingerprint-fix.enable { + systemd.services.validity-restart = let + targets = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ]; + in { + description = "Restart services to fix fingerprint integration"; + wantedBy = targets; + after = targets; + serviceConfig = { + type = "oneshot"; + ExecStart = "systemctl restart python3-validity.service"; + }; + }; + services."06cb-009a-fingerprint-sensor" = { + enable = true; + backend = "python-validity"; + calib-data-file = config.services.fingerprint-fix.calibDataFile; + }; + + services.open-fprintd.enable = lib.mkForce true; # Fprintd is not working with P51s + systemd.services.open-fprintd-resume.enable = true; }; } diff --git a/profiles/hulk/default.nix b/profiles/hulk/default.nix index f68eb1f..c9b26fe 100644 --- a/profiles/hulk/default.nix +++ b/profiles/hulk/default.nix @@ -7,8 +7,8 @@ in { imports = [ ./packages.nix # Packages to install ./programs.nix # Programs to enable - ./files.nix # Files to create ./theme.nix # System-wide/GTK theme + ./portal.nix # Desktop portals ]; home = { diff --git a/profiles/hulk/files.nix b/profiles/hulk/files.nix deleted file mode 100644 index 04789d1..0000000 --- a/profiles/hulk/files.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - xdg.configFile."gtk-3.0/settings.ini".text = '' - [Settings] - gtk-icon-theme-name=Adwaita - ''; -} diff --git a/profiles/hulk/packages.nix b/profiles/hulk/packages.nix index a56cc89..161b732 100644 --- a/profiles/hulk/packages.nix +++ b/profiles/hulk/packages.nix @@ -28,9 +28,6 @@ in { ''; packages = with pkgs; [ hyprland hyprlock hypridle hyprshot wl-clipboard cliphist swww - lxqt.lxqt-policykit - stdenv.cc.cc.lib - pywal pywalfox-native (python3.withPackages (py: with py; [ diff --git a/profiles/hulk/portal.nix b/profiles/hulk/portal.nix new file mode 100644 index 0000000..fac2b01 --- /dev/null +++ b/profiles/hulk/portal.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: + +let + portals-config = pkgs.writeTextDir "share/xdg-desktop-portal/portals/portals.conf" '' + [preferred] + default=hyprland + org.freedesktop.impl.portal.Settings=darkman + ''; + packages = [ + pkgs.xdg-desktop-portal + pkgs.xdg-desktop-portal-hyprland + pkgs.xdg-desktop-portal-gtk + pkgs.darkman + ]; + portals = pkgs.symlinkJoin { + name = "xdg-portals"; + paths = [ portals-config ] ++ packages; + pathsToLink = [ + "/share/xdg-desktop-portal/portals" + "/share/applications" + ]; + }; +in { + home.sessionVariables = { + XDG_DESKTOP_PORTAL_DIR = "${portals}/share/xdg-desktop-portal/portals"; + }; + + home.packages = packages; +} diff --git a/profiles/hulk/programs.nix b/profiles/hulk/programs.nix index 9290699..f16c5d6 100644 --- a/profiles/hulk/programs.nix +++ b/profiles/hulk/programs.nix @@ -20,15 +20,23 @@ ${pkgs.dconf}/bin/dconf write\ /org/gnome/desktop/interface/color-scheme "'prefer-dark'" ''; + + wallpaper = '' + $HOME/.config/hypr/scripts/random-wallpaper.sh + ''; }; + lightModeScripts = { gtk-theme = '' ${pkgs.dconf}/bin/dconf write\ /org/gnome/desktop/interface/color-scheme "'prefer-light'" ''; + + wallpaper = '' + $HOME/.config/hypr/scripts/random-wallpaper.sh + ''; }; - settings = { - usegeoclue = true; - }; + + settings.usegeoclue = false; }; }