From 756cebe3fe33d6fe267ad2c95573bff58024546a Mon Sep 17 00:00:00 2001 From: Vali Date: Fri, 16 Aug 2024 16:03:47 +0200 Subject: [PATCH] major rewrite --- flake.lock | 231 +----------------- flake.nix | 3 - hosts/vali/hermit/profile.nix | 1 - modules/options/system/module.nix | 5 + .../options/system}/monitors.nix | 6 +- modules/system/hardware/sound/default.nix | 0 .../hardware/sound/pipewire/default.nix | 19 ++ modules/system/nix/module.nix | 1 + modules/system/nix/registry.nix | 22 ++ modules/wms/wayland/hypr/land.nix | 2 +- modules/wms/wayland/hyprland/binds.nix | 0 modules/wms/wayland/hyprland/decorations.nix | 0 modules/wms/wayland/hyprland/exec.nix | 0 modules/wms/wayland/hyprland/module.nix | 0 modules/wms/wayland/hyprland/settings.nix | 0 options/common/bluetooth.nix | 8 - options/common/gpu/nvidia.nix | 16 -- options/common/networking.nix | 22 -- options/common/pin-registry.nix | 7 - options/common/preserve-system.nix | 1 - 20 files changed, 50 insertions(+), 294 deletions(-) rename {options/desktop => modules/options/system}/monitors.nix (98%) create mode 100644 modules/system/hardware/sound/default.nix create mode 100644 modules/system/hardware/sound/pipewire/default.nix create mode 100644 modules/system/nix/registry.nix create mode 100644 modules/wms/wayland/hyprland/binds.nix create mode 100644 modules/wms/wayland/hyprland/decorations.nix create mode 100644 modules/wms/wayland/hyprland/exec.nix create mode 100644 modules/wms/wayland/hyprland/module.nix create mode 100644 modules/wms/wayland/hyprland/settings.nix delete mode 100644 options/common/bluetooth.nix delete mode 100644 options/common/gpu/nvidia.nix delete mode 100644 options/common/networking.nix delete mode 100644 options/common/pin-registry.nix delete mode 100644 options/common/preserve-system.nix diff --git a/flake.lock b/flake.lock index b236d06..db5a489 100644 --- a/flake.lock +++ b/flake.lock @@ -55,120 +55,6 @@ "type": "github" } }, - "base16": { - "inputs": { - "fromYaml": "fromYaml" - }, - "locked": { - "lastModified": 1708890466, - "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", - "owner": "SenchoPens", - "repo": "base16.nix", - "rev": "665b3c6748534eb766c777298721cece9453fdae", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "base16.nix", - "type": "github" - } - }, - "base16-fish": { - "flake": false, - "locked": { - "lastModified": 1622559957, - "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", - "owner": "tomyun", - "repo": "base16-fish", - "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", - "type": "github" - }, - "original": { - "owner": "tomyun", - "repo": "base16-fish", - "type": "github" - } - }, - "base16-foot": { - "flake": false, - "locked": { - "lastModified": 1696725948, - "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", - "owner": "tinted-theming", - "repo": "base16-foot", - "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-foot", - "type": "github" - } - }, - "base16-helix": { - "flake": false, - "locked": { - "lastModified": 1720809814, - "narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=", - "owner": "tinted-theming", - "repo": "base16-helix", - "rev": "34f41987bec14c0f3f6b2155c19787b1f6489625", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-helix", - "type": "github" - } - }, - "base16-kitty": { - "flake": false, - "locked": { - "lastModified": 1665001328, - "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", - "owner": "kdrag0n", - "repo": "base16-kitty", - "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", - "type": "github" - }, - "original": { - "owner": "kdrag0n", - "repo": "base16-kitty", - "type": "github" - } - }, - "base16-tmux": { - "flake": false, - "locked": { - "lastModified": 1696725902, - "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", - "owner": "tinted-theming", - "repo": "base16-tmux", - "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-tmux", - "type": "github" - } - }, - "base16-vim": { - "flake": false, - "locked": { - "lastModified": 1716150083, - "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", - "owner": "tinted-theming", - "repo": "base16-vim", - "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-vim", - "type": "github" - } - }, "crane": { "inputs": { "nixpkgs": [ @@ -331,22 +217,6 @@ "type": "github" } }, - "flake-compat_6": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -609,39 +479,6 @@ "type": "github" } }, - "fromYaml": { - "flake": false, - "locked": { - "lastModified": 1689549921, - "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", - "owner": "SenchoPens", - "repo": "fromYaml", - "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "fromYaml", - "type": "github" - } - }, - "gnome-shell": { - "flake": false, - "locked": { - "lastModified": 1713702291, - "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", - "owner": "GNOME", - "repo": "gnome-shell", - "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", - "type": "github" - }, - "original": { - "owner": "GNOME", - "ref": "46.1", - "repo": "gnome-shell", - "type": "github" - } - }, "helix": { "inputs": { "crane": "crane", @@ -729,27 +566,6 @@ "type": "github" } }, - "home-manager_3": { - "inputs": { - "nixpkgs": [ - "stylix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1715930644, - "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "hyprcursor": { "inputs": { "hyprlang": [ @@ -1446,22 +1262,6 @@ } }, "nixpkgs_10": { - "locked": { - "lastModified": 1714912032, - "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ee4a6e0f566fe5ec79968c57a9c2c3c25f2cf41d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_11": { "locked": { "lastModified": 1720957393, "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", @@ -3315,7 +3115,6 @@ "schizofox": "schizofox", "spicetify-nix": "spicetify-nix", "split-monitor-workspaces": "split-monitor-workspaces", - "stylix": "stylix", "treefmt-nix": "treefmt-nix_2" } }, @@ -3464,34 +3263,6 @@ "type": "github" } }, - "stylix": { - "inputs": { - "base16": "base16", - "base16-fish": "base16-fish", - "base16-foot": "base16-foot", - "base16-helix": "base16-helix", - "base16-kitty": "base16-kitty", - "base16-tmux": "base16-tmux", - "base16-vim": "base16-vim", - "flake-compat": "flake-compat_6", - "gnome-shell": "gnome-shell", - "home-manager": "home-manager_3", - "nixpkgs": "nixpkgs_10" - }, - "locked": { - "lastModified": 1722946882, - "narHash": "sha256-mxtnMye8gs82tdQbVC+g6v3aPOZlH150f9WyntHIkTg=", - "owner": "danth", - "repo": "stylix", - "rev": "5853f1a8bd072f2ebabfc3de3973084353cf6f1e", - "type": "github" - }, - "original": { - "owner": "danth", - "repo": "stylix", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1689347949, @@ -3636,7 +3407,7 @@ }, "treefmt-nix_2": { "inputs": { - "nixpkgs": "nixpkgs_11" + "nixpkgs": "nixpkgs_10" }, "locked": { "lastModified": 1723656612, diff --git a/flake.nix b/flake.nix index 22a1ef4..b89ab9a 100644 --- a/flake.nix +++ b/flake.nix @@ -82,9 +82,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - # I do not like stylix, but have no time to get rid of it. - stylix.url = "github:danth/stylix"; - quickshell = { url = "git+https://git.outfoxxed.me/outfoxxed/quickshell"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/vali/hermit/profile.nix b/hosts/vali/hermit/profile.nix index ad01d90..51c2aff 100644 --- a/hosts/vali/hermit/profile.nix +++ b/hosts/vali/hermit/profile.nix @@ -2,7 +2,6 @@ _: { imports = [ ../../../options/boot/grub-boot.nix ../../../options/common/bluetooth.nix - ../../../options/desktop/fonts.nix ../../../options/common/networking.nix ../../../options/common/gpu/nvidia.nix ../../../options/desktop/monitors.nix diff --git a/modules/options/system/module.nix b/modules/options/system/module.nix index c0b6787..e4441af 100644 --- a/modules/options/system/module.nix +++ b/modules/options/system/module.nix @@ -35,6 +35,9 @@ in { # systemd-nspawn containers # ./containers.nix + + # monitor configuration + ./monitors.nix ]; config = { warnings = mkMerge [ @@ -89,6 +92,8 @@ in { video = { enable = mkEnableOption "video drivers and programs that require a graphical user interface"; + nvidia = mkOption "Nvidia graphics drivers"; + amd = mkOption "AMD graphics drivers"; }; bluetooth = { diff --git a/options/desktop/monitors.nix b/modules/options/system/monitors.nix similarity index 98% rename from options/desktop/monitors.nix rename to modules/options/system/monitors.nix index 9341b08..88154b8 100644 --- a/options/desktop/monitors.nix +++ b/modules/options/system/monitors.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: +{lib, ...}: with lib; { options.modules.other.system.monitors = mkOption { description = "\n List of monitors to use\n "; diff --git a/modules/system/hardware/sound/default.nix b/modules/system/hardware/sound/default.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/system/hardware/sound/pipewire/default.nix b/modules/system/hardware/sound/pipewire/default.nix new file mode 100644 index 0000000..acaf3eb --- /dev/null +++ b/modules/system/hardware/sound/pipewire/default.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + inherit (config.modules.system.hardware.sound) pipewire; + inherit (lib) mkIf; +in { + config = mkIf pipewire.enable { + services.pipewire = { + enable = true; + audio.enable = true; + + pulse.enable = true; + jack.enable = true; + alsa.enable = true; + }; + }; +} diff --git a/modules/system/nix/module.nix b/modules/system/nix/module.nix index abd2f23..ce716ae 100644 --- a/modules/system/nix/module.nix +++ b/modules/system/nix/module.nix @@ -7,6 +7,7 @@ imports = [ ./documentation.nix # nixos documentation ./nixpkgs.nix # global nixpkgs configuration.nix + ./registry.nix ]; nix = { diff --git a/modules/system/nix/registry.nix b/modules/system/nix/registry.nix new file mode 100644 index 0000000..2003c9d --- /dev/null +++ b/modules/system/nix/registry.nix @@ -0,0 +1,22 @@ +{ + inputs, + pkgs, + ... +}: let + inherit (inputs) nixpkgs; + nixpkgsPath = nixpkgs.outPath; +in { + # Big thanks to Dianimo for this! + nix = { + registry = { + nixpkgs.flake = inputs.nixpkgs; + default.flake = inputs.nixpkgs; + }; + + nixPath = [ + "nixpkgs=${nixpkgsPath}" + "n=${nixpkgsPath}" + "default=${nixpkgsPath}" + ]; + }; +} diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index ce33e0b..8bc6422 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -46,7 +46,7 @@ in { home-manager.users.${username} = { wayland.windowManager.hyprland = { enable = true; - # inherit (cfg) package; + inherit (cfg) package; # Split-monitor-workspaces provides awesome-like workspace behaviour plugins = [ diff --git a/modules/wms/wayland/hyprland/binds.nix b/modules/wms/wayland/hyprland/binds.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/wms/wayland/hyprland/decorations.nix b/modules/wms/wayland/hyprland/decorations.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/wms/wayland/hyprland/exec.nix b/modules/wms/wayland/hyprland/exec.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/wms/wayland/hyprland/module.nix b/modules/wms/wayland/hyprland/module.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/wms/wayland/hyprland/settings.nix b/modules/wms/wayland/hyprland/settings.nix new file mode 100644 index 0000000..e69de29 diff --git a/options/common/bluetooth.nix b/options/common/bluetooth.nix deleted file mode 100644 index 45c65e9..0000000 --- a/options/common/bluetooth.nix +++ /dev/null @@ -1,8 +0,0 @@ -_: { - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - - services.blueman.enable = true; -} diff --git a/options/common/gpu/nvidia.nix b/options/common/gpu/nvidia.nix deleted file mode 100644 index ddb90c4..0000000 --- a/options/common/gpu/nvidia.nix +++ /dev/null @@ -1,16 +0,0 @@ -{config, ...}: { - services.xserver.videoDrivers = ["nvidia"]; - hardware = { - graphics = { - enable = true; - }; - nvidia = { - modesetting.enable = true; - open = false; - powerManagement.enable = true; - powerManagement.finegrained = false; - nvidiaSettings = false; - package = config.boot.kernelPackages.nvidiaPackages.beta; - }; - }; -} diff --git a/options/common/networking.nix b/options/common/networking.nix deleted file mode 100644 index 3a95576..0000000 --- a/options/common/networking.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (config.modules.other.system) username; - inherit (lib) mkForce; -in { - networking = { - enableIPv6 = true; - networkmanager = { - enable = true; - plugins = mkForce []; # Bloated as hell, plugins be gone - dns = "systemd-resolved"; - }; - }; - services.resolved = { - enable = true; - fallbackDns = ["9.9.9.9" "2620::fe::fe"]; - }; - users.users.${username}.extraGroups = ["networkmanager"]; -} diff --git a/options/common/pin-registry.nix b/options/common/pin-registry.nix deleted file mode 100644 index c9983fb..0000000 --- a/options/common/pin-registry.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - inputs, - lib, - ... -}: { - nix.registry = lib.mapAttrs (_: v: {flake = v;}) inputs; -} diff --git a/options/common/preserve-system.nix b/options/common/preserve-system.nix deleted file mode 100644 index 793e944..0000000 --- a/options/common/preserve-system.nix +++ /dev/null @@ -1 +0,0 @@ -{self, ...}: {environment.etc."current-flake".source = self;}