From 301ad158d572edd64d95a2efbabf87cbda3ec565 Mon Sep 17 00:00:00 2001 From: elwrcl Date: Thu, 30 Jul 2026 22:58:52 +0300 Subject: [PATCH] dentritic refactor --- CLAUDE.md | 1 - README.md | 14 +- flake.lock | 27 ++- flake.nix | 154 ++++++------- .../copland-hardware.nix | 0 hosts/copland.ulu.nix | 111 ++++++++++ hosts/sohryu-darwin.ulu.nix | 58 +++++ main/darwin/home.nix | 12 - main/darwin/machine.nix | 20 -- main/darwin/packages.nix | 24 -- main/nixos/home.nix | 12 - main/nixos/machine.nix | 27 --- main/nixos/packages.nix | 200 ----------------- modules/darwin/common-homebrew.ulu.nix | 17 ++ modules/darwin/common-packages.ulu.nix | 26 +++ modules/darwin/common-system.ulu.nix | 73 +++++++ modules/darwin/common-user.ulu.nix | 17 ++ modules/darwin/default.nix | 10 - modules/darwin/homebrew/default.nix | 14 -- modules/darwin/system/default.nix | 65 ------ modules/darwin/user/default.nix | 14 -- modules/home/default.nix | 10 - modules/home/git.nix | 24 -- modules/home/home-base.ulu.nix | 9 + modules/home/home-cursor.ulu.nix | 15 ++ modules/home/home-discord.ulu.nix | 24 ++ modules/home/home-easyeffects.ulu.nix | 8 + modules/home/home-ghostty.ulu.nix | 127 +++++++++++ modules/home/home-gtk.ulu.nix | 26 +++ modules/home/home-mimeapps.ulu.nix | 17 ++ modules/home/home-nushell.ulu.nix | 72 ++++++ modules/home/home-qt.ulu.nix | 31 +++ modules/home/home-session-vars.ulu.nix | 10 + modules/home/home-shell-tools.ulu.nix | 10 + modules/home/home-zsh.ulu.nix | 80 +++++++ modules/home/hypr/default.nix | 10 - modules/home/hypr/hyprland/env.nix | 17 -- modules/home/hypr/hyprland/execs.nix | 11 - modules/home/hypr/hyprland/general.nix | 102 --------- modules/home/hypr/hyprland/keybinds.nix | 121 ---------- modules/home/hypr/hyprland/rules.nix | 22 -- modules/home/hyprland.nix | 16 -- modules/home/linux.nix | 156 ------------- modules/home/niri.nix | 9 - modules/home/niri/default.nix | 10 - modules/home/niri/desktop-niri-env.ulu.nix | 21 ++ modules/home/niri/desktop-niri-execs.ulu.nix | 28 +++ .../home/niri/desktop-niri-general.ulu.nix | 84 +++++++ modules/home/niri/desktop-niri-home.ulu.nix | 8 + .../home/niri/desktop-niri-keybinds.ulu.nix | 168 ++++++++++++++ modules/home/niri/desktop-niri-rules.ulu.nix | 62 ++++++ modules/home/niri/niri/env.nix | 18 -- modules/home/niri/niri/execs.nix | 13 -- modules/home/niri/niri/general.nix | 81 ------- modules/home/niri/niri/keybinds.nix | 165 -------------- modules/home/niri/niri/rules.nix | 47 ---- modules/home/programs/default.nix | 7 - modules/home/programs/discord/default.nix | 21 -- modules/home/programs/ghostty/default.nix | 124 ----------- modules/home/programs/shell/default.nix | 7 - modules/home/programs/shell/nu.nix | 69 ------ modules/nixos/boot/default.nix | 47 ---- modules/nixos/common/common-boot.ulu.nix | 48 ++++ modules/nixos/common/common-fonts.ulu.nix | 58 +++++ modules/nixos/common/common-git.ulu.nix | 27 +++ modules/nixos/common/common-kmscon.ulu.nix | 19 ++ modules/nixos/common/common-locale.ulu.nix | 41 ++++ modules/nixos/common/common-nix.ulu.nix | 44 ++++ modules/nixos/common/common-packages.ulu.nix | 206 ++++++++++++++++++ modules/nixos/common/common-users.ulu.nix | 39 ++++ modules/nixos/default.nix | 15 -- modules/nixos/desktop/audio/default.nix | 7 - modules/nixos/desktop/audio/pipewire.nix | 39 ---- modules/nixos/desktop/default.nix | 58 ----- modules/nixos/desktop/desktop-audio.ulu.nix | 42 ++++ modules/nixos/desktop/desktop-display.ulu.nix | 32 +++ modules/nixos/desktop/desktop-niri.ulu.nix | 12 + .../nixos/desktop/desktop-xdg-mime.ulu.nix | 55 +++++ modules/nixos/desktop/display/default.nix | 29 --- .../nixos/desktop/window-managers/default.nix | 7 - .../desktop/window-managers/hyprland.nix | 34 --- .../nixos/desktop/window-managers/niri.nix | 8 - .../nixos/desktop/window-managers/sway.nix | 9 - modules/nixos/gaming/default.nix | 17 -- modules/nixos/gaming/gaming-gamemode.ulu.nix | 16 ++ modules/nixos/gaming/gaming-steam.ulu.nix | 26 +++ modules/nixos/gaming/steam/default.nix | 22 -- modules/nixos/hardware/bluetooth/default.nix | 5 - modules/nixos/hardware/default.nix | 9 - modules/nixos/hardware/graphics/amd.nix | 10 - modules/nixos/hardware/graphics/default.nix | 36 --- modules/nixos/hardware/graphics/intel.nix | 44 ---- modules/nixos/hardware/graphics/nvidia.nix | 12 - modules/nixos/hardware/graphics/prime.nix | 9 - .../nixos/hardware/graphics/vk/default.nix | 28 --- .../hardware/graphics/vk/hasvk14_layer.c | 199 ----------------- .../hardware/graphics/vk/hasvk14_layer.json | 17 -- modules/nixos/hardware/udev/default.nix | 21 -- modules/nixos/hw/hw-bluetooth.ulu.nix | 8 + modules/nixos/hw/hw-graphics.ulu.nix | 116 ++++++++++ modules/nixos/hw/hw-udev.ulu.nix | 24 ++ modules/nixos/net/net-network-manager.ulu.nix | 26 +++ modules/nixos/net/net-vpn.ulu.nix | 39 ++++ modules/nixos/networking/default.nix | 8 - .../networking/network-manager/default.nix | 23 -- modules/nixos/networking/vpn/default.nix | 36 --- modules/nixos/services/appimage/default.nix | 8 - modules/nixos/services/default.nix | 15 -- modules/nixos/services/flatpak/default.nix | 5 - modules/nixos/services/fwupd/default.nix | 5 - .../nixos/services/kde_connect/default.nix | 5 - modules/nixos/services/ollama/default.nix | 5 - .../nixos/services/performance/default.nix | 7 - modules/nixos/services/printing/default.nix | 28 --- modules/nixos/services/security/default.nix | 19 -- .../nixos/services/service-appimage.ulu.nix | 11 + modules/nixos/services/service-docker.ulu.nix | 8 + .../nixos/services/service-flatpak.ulu.nix | 8 + modules/nixos/services/service-fwupd.ulu.nix | 8 + .../services/service-kde-connect.ulu.nix | 8 + modules/nixos/services/service-ollama.ulu.nix | 8 + .../services/service-performance.ulu.nix | 10 + .../nixos/services/service-printing.ulu.nix | 31 +++ .../nixos/services/service-security.ulu.nix | 22 ++ modules/nixos/services/service-ssh.ulu.nix | 9 + .../services/service-virt-manager.ulu.nix | 9 + modules/nixos/services/ssh/default.nix | 6 - modules/nixos/system/default.nix | 10 - modules/nixos/system/fonts/default.nix | 55 ----- modules/nixos/system/kmscon/default.nix | 16 -- modules/nixos/system/locale/default.nix | 38 ---- modules/nixos/system/nix/default.nix | 41 ---- modules/nixos/users/default.nix | 36 --- modules/nixos/virtualization/default.nix | 8 - .../nixos/virtualization/docker/default.nix | 5 - .../virtualization/virt-manager/default.nix | 6 - options/darwin-outputs.ulu.nix | 8 + options/flake-outputs.ulu.nix | 35 +++ options/home-outputs.ulu.nix | 8 + options/hostname-check.ulu.nix | 23 ++ 140 files changed, 2285 insertions(+), 2622 deletions(-) delete mode 120000 CLAUDE.md mode change 100755 => 100644 flake.nix rename main/nixos/hardware.nix => hosts/copland-hardware.nix (100%) mode change 100755 => 100644 create mode 100644 hosts/copland.ulu.nix create mode 100644 hosts/sohryu-darwin.ulu.nix delete mode 100644 main/darwin/home.nix delete mode 100755 main/darwin/machine.nix delete mode 100755 main/darwin/packages.nix delete mode 100644 main/nixos/home.nix delete mode 100755 main/nixos/machine.nix delete mode 100755 main/nixos/packages.nix create mode 100644 modules/darwin/common-homebrew.ulu.nix create mode 100644 modules/darwin/common-packages.ulu.nix create mode 100644 modules/darwin/common-system.ulu.nix create mode 100644 modules/darwin/common-user.ulu.nix delete mode 100755 modules/darwin/default.nix delete mode 100755 modules/darwin/homebrew/default.nix delete mode 100755 modules/darwin/system/default.nix delete mode 100755 modules/darwin/user/default.nix delete mode 100755 modules/home/default.nix delete mode 100755 modules/home/git.nix create mode 100644 modules/home/home-base.ulu.nix create mode 100644 modules/home/home-cursor.ulu.nix create mode 100644 modules/home/home-discord.ulu.nix create mode 100644 modules/home/home-easyeffects.ulu.nix create mode 100644 modules/home/home-ghostty.ulu.nix create mode 100644 modules/home/home-gtk.ulu.nix create mode 100644 modules/home/home-mimeapps.ulu.nix create mode 100644 modules/home/home-nushell.ulu.nix create mode 100644 modules/home/home-qt.ulu.nix create mode 100644 modules/home/home-session-vars.ulu.nix create mode 100644 modules/home/home-shell-tools.ulu.nix create mode 100644 modules/home/home-zsh.ulu.nix delete mode 100755 modules/home/hypr/default.nix delete mode 100755 modules/home/hypr/hyprland/env.nix delete mode 100755 modules/home/hypr/hyprland/execs.nix delete mode 100755 modules/home/hypr/hyprland/general.nix delete mode 100755 modules/home/hypr/hyprland/keybinds.nix delete mode 100755 modules/home/hypr/hyprland/rules.nix delete mode 100755 modules/home/hyprland.nix delete mode 100644 modules/home/linux.nix delete mode 100644 modules/home/niri.nix delete mode 100644 modules/home/niri/default.nix create mode 100644 modules/home/niri/desktop-niri-env.ulu.nix create mode 100644 modules/home/niri/desktop-niri-execs.ulu.nix create mode 100644 modules/home/niri/desktop-niri-general.ulu.nix create mode 100644 modules/home/niri/desktop-niri-home.ulu.nix create mode 100644 modules/home/niri/desktop-niri-keybinds.ulu.nix create mode 100644 modules/home/niri/desktop-niri-rules.ulu.nix delete mode 100644 modules/home/niri/niri/env.nix delete mode 100644 modules/home/niri/niri/execs.nix delete mode 100644 modules/home/niri/niri/general.nix delete mode 100644 modules/home/niri/niri/keybinds.nix delete mode 100644 modules/home/niri/niri/rules.nix delete mode 100644 modules/home/programs/default.nix delete mode 100644 modules/home/programs/discord/default.nix delete mode 100644 modules/home/programs/ghostty/default.nix delete mode 100644 modules/home/programs/shell/default.nix delete mode 100644 modules/home/programs/shell/nu.nix delete mode 100755 modules/nixos/boot/default.nix create mode 100644 modules/nixos/common/common-boot.ulu.nix create mode 100644 modules/nixos/common/common-fonts.ulu.nix create mode 100644 modules/nixos/common/common-git.ulu.nix create mode 100644 modules/nixos/common/common-kmscon.ulu.nix create mode 100644 modules/nixos/common/common-locale.ulu.nix create mode 100644 modules/nixos/common/common-nix.ulu.nix create mode 100644 modules/nixos/common/common-packages.ulu.nix create mode 100644 modules/nixos/common/common-users.ulu.nix delete mode 100755 modules/nixos/default.nix delete mode 100755 modules/nixos/desktop/audio/default.nix delete mode 100755 modules/nixos/desktop/audio/pipewire.nix delete mode 100755 modules/nixos/desktop/default.nix create mode 100644 modules/nixos/desktop/desktop-audio.ulu.nix create mode 100644 modules/nixos/desktop/desktop-display.ulu.nix create mode 100644 modules/nixos/desktop/desktop-niri.ulu.nix create mode 100644 modules/nixos/desktop/desktop-xdg-mime.ulu.nix delete mode 100755 modules/nixos/desktop/display/default.nix delete mode 100755 modules/nixos/desktop/window-managers/default.nix delete mode 100755 modules/nixos/desktop/window-managers/hyprland.nix delete mode 100644 modules/nixos/desktop/window-managers/niri.nix delete mode 100644 modules/nixos/desktop/window-managers/sway.nix delete mode 100755 modules/nixos/gaming/default.nix create mode 100644 modules/nixos/gaming/gaming-gamemode.ulu.nix create mode 100644 modules/nixos/gaming/gaming-steam.ulu.nix delete mode 100755 modules/nixos/gaming/steam/default.nix delete mode 100755 modules/nixos/hardware/bluetooth/default.nix delete mode 100755 modules/nixos/hardware/default.nix delete mode 100755 modules/nixos/hardware/graphics/amd.nix delete mode 100755 modules/nixos/hardware/graphics/default.nix delete mode 100755 modules/nixos/hardware/graphics/intel.nix delete mode 100755 modules/nixos/hardware/graphics/nvidia.nix delete mode 100755 modules/nixos/hardware/graphics/prime.nix delete mode 100644 modules/nixos/hardware/graphics/vk/default.nix delete mode 100644 modules/nixos/hardware/graphics/vk/hasvk14_layer.c delete mode 100644 modules/nixos/hardware/graphics/vk/hasvk14_layer.json delete mode 100755 modules/nixos/hardware/udev/default.nix create mode 100644 modules/nixos/hw/hw-bluetooth.ulu.nix create mode 100644 modules/nixos/hw/hw-graphics.ulu.nix create mode 100644 modules/nixos/hw/hw-udev.ulu.nix create mode 100644 modules/nixos/net/net-network-manager.ulu.nix create mode 100644 modules/nixos/net/net-vpn.ulu.nix delete mode 100755 modules/nixos/networking/default.nix delete mode 100755 modules/nixos/networking/network-manager/default.nix delete mode 100755 modules/nixos/networking/vpn/default.nix delete mode 100755 modules/nixos/services/appimage/default.nix delete mode 100755 modules/nixos/services/default.nix delete mode 100755 modules/nixos/services/flatpak/default.nix delete mode 100755 modules/nixos/services/fwupd/default.nix delete mode 100755 modules/nixos/services/kde_connect/default.nix delete mode 100755 modules/nixos/services/ollama/default.nix delete mode 100755 modules/nixos/services/performance/default.nix delete mode 100755 modules/nixos/services/printing/default.nix delete mode 100755 modules/nixos/services/security/default.nix create mode 100644 modules/nixos/services/service-appimage.ulu.nix create mode 100644 modules/nixos/services/service-docker.ulu.nix create mode 100644 modules/nixos/services/service-flatpak.ulu.nix create mode 100644 modules/nixos/services/service-fwupd.ulu.nix create mode 100644 modules/nixos/services/service-kde-connect.ulu.nix create mode 100644 modules/nixos/services/service-ollama.ulu.nix create mode 100644 modules/nixos/services/service-performance.ulu.nix create mode 100644 modules/nixos/services/service-printing.ulu.nix create mode 100644 modules/nixos/services/service-security.ulu.nix create mode 100644 modules/nixos/services/service-ssh.ulu.nix create mode 100644 modules/nixos/services/service-virt-manager.ulu.nix delete mode 100755 modules/nixos/services/ssh/default.nix delete mode 100755 modules/nixos/system/default.nix delete mode 100755 modules/nixos/system/fonts/default.nix delete mode 100755 modules/nixos/system/kmscon/default.nix delete mode 100755 modules/nixos/system/locale/default.nix delete mode 100755 modules/nixos/system/nix/default.nix delete mode 100755 modules/nixos/users/default.nix delete mode 100755 modules/nixos/virtualization/default.nix delete mode 100755 modules/nixos/virtualization/docker/default.nix delete mode 100755 modules/nixos/virtualization/virt-manager/default.nix create mode 100644 options/darwin-outputs.ulu.nix create mode 100644 options/flake-outputs.ulu.nix create mode 100644 options/home-outputs.ulu.nix create mode 100644 options/hostname-check.ulu.nix diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 120000 index 47dc3e3..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -AGENTS.md \ No newline at end of file diff --git a/README.md b/README.md index 62d95b4..d308958 100755 --- a/README.md +++ b/README.md @@ -1 +1,13 @@ -i love nixos... +# nixoconf + +Nix config for one machine running two OS : + +- `copland`: NixOS (x86_64-linux) +- `sohryu_darwin`: Hackintosh (x86_64-darwin), via [nix-darwin](https://github.com/nix-darwin/nix-darwin) + +## Rebuild + +```bash +nh os switch . # nixos +nh darwin switch . # macos +``` diff --git a/flake.lock b/flake.lock index 0e36558..f2f4d7c 100755 --- a/flake.lock +++ b/flake.lock @@ -187,7 +187,9 @@ }, "flake-parts": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1782949081, @@ -204,6 +206,24 @@ } }, "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1782949081, + "narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" }, @@ -771,7 +791,7 @@ "cachyos-kernel": "cachyos-kernel", "cachyos-kernel-patches": "cachyos-kernel-patches", "flake-compat": "flake-compat_4", - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -854,7 +874,7 @@ "nixcord": { "inputs": { "flake-compat": "flake-compat_5", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "nixpkgs": [ "nixpkgs" ], @@ -1046,6 +1066,7 @@ "inputs": { "chaotic": "chaotic", "copetch": "copetch", + "flake-parts": "flake-parts", "helium": "helium", "home-manager": "home-manager_2", "hyprland": "hyprland", diff --git a/flake.nix b/flake.nix old mode 100755 new mode 100644 index 7cb3c65..979132b --- a/flake.nix +++ b/flake.nix @@ -1,27 +1,38 @@ { - description = "copland, linux/darwin"; + description = "copland, linux/darwin dentritic flake"; + + nixConfig = { + experimental-features = [ + "flakes" + "nix-command" + "pipe-operators" + ]; + + builders-use-substitutes = true; + http-connections = 50; + show-trace = true; + warn-dirty = false; + }; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - niri = { - url = "github:sodiboo/niri-flake"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - chaotic = { - url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; - inputs.nixpkgs.follows = "nixpkgs"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; }; + nix-darwin = { url = "github:nix-darwin/nix-darwin/master"; inputs.nixpkgs.follows = "nixpkgs"; }; - zen-browser = { - url = "github:0xc000022070/zen-browser-flake"; + home-manager = { + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - copetch = { - url = "github:elwrcl/copetch"; + + niri = { + url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; hyprland = { @@ -32,24 +43,30 @@ url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; }; - home-manager = { - url = "github:nix-community/home-manager"; + noctalia = { + url = "github:noctalia-dev/noctalia-shell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + chaotic = { + url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-cachyos-kernel = { + url = "github:xddxdd/nix-cachyos-kernel/release"; + }; + soryu-kernel = { + url = "github:elwrcl/soryu-kernel"; + }; + + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; helium = { url = "github:AlvaroParker/helium-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - noctalia = { - url = "github:noctalia-dev/noctalia-shell"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - soryu-kernel = { - url = "github:elwrcl/soryu-kernel"; - }; - nix-alien = { - url = "github:thiagokokada/nix-alien"; - }; nixcord = { url = "github:FlameFlag/nixcord"; inputs.nixpkgs.follows = "nixpkgs"; @@ -58,77 +75,30 @@ url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; }; - nix-cachyos-kernel = { - url = "github:xddxdd/nix-cachyos-kernel/release"; + nix-alien = { + url = "github:thiagokokada/nix-alien"; + }; + copetch = { + url = "github:elwrcl/copetch"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = - inputs@{ - self, - nixpkgs, - nix-darwin, - home-manager, - nix-cachyos-kernel, - chaotic, - niri, - ... - }: - let - linuxSystem = "x86_64-linux"; - darwinSystem = "x86_64-darwin"; - in - { - nixosConfigurations.copland = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs; - system = linuxSystem; - }; - modules = [ - { nixpkgs.hostPlatform = linuxSystem; } - home-manager.nixosModules.home-manager - chaotic.nixosModules.default - { - nixpkgs.config.allowUnfree = true; - nixpkgs.overlays = [ inputs.nix-vscode-extensions.overlays.default ]; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - sharedModules = [ inputs.niri.homeModules.niri ]; - extraSpecialArgs = { - inherit inputs; - system = linuxSystem; - }; - users.elars = import ./main/nixos/home.nix; - }; - } - ./main/nixos/machine.nix + inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } ( + { lib, ... }: + let + inherit (lib.filesystem) listFilesRecursive; + inherit (lib.lists) filter; + inherit (lib.strings) hasSuffix; + in + { + systems = [ + "x86_64-linux" + "x86_64-darwin" ]; - }; - - darwinConfigurations.sohryu-darwin = nix-darwin.lib.darwinSystem { - specialArgs = { - inherit inputs; - system = darwinSystem; - }; - modules = [ - home-manager.darwinModules.home-manager - { - nixpkgs.config.allowUnfree = true; - nixpkgs.config.allowDeprecatedx86_64Darwin = true; - nixpkgs.overlays = [ inputs.nix-vscode-extensions.overlays.default ]; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = { - inherit inputs; - system = darwinSystem; - }; - users.sohryu = import ./main/darwin/home.nix; - }; - } - ./main/darwin/machine.nix - ]; - }; - }; + imports = filter (hasSuffix ".ulu.nix") (listFilesRecursive ./.); + } + ); } diff --git a/main/nixos/hardware.nix b/hosts/copland-hardware.nix old mode 100755 new mode 100644 similarity index 100% rename from main/nixos/hardware.nix rename to hosts/copland-hardware.nix diff --git a/hosts/copland.ulu.nix b/hosts/copland.ulu.nix new file mode 100644 index 0000000..56cd751 --- /dev/null +++ b/hosts/copland.ulu.nix @@ -0,0 +1,111 @@ +{ config, inputs, ... }: +let + system = "x86_64-linux"; +in +{ + flake.nixosConfigurations.copland = inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs system; + }; + + modules = [ + { nixpkgs.hostPlatform = system; } + + inputs.home-manager.nixosModules.home-manager + inputs.chaotic.nixosModules.default + + { + nixpkgs.config.allowUnfree = true; + nixpkgs.config.permittedInsecurePackages = [ "pnpm-10.29.2" ]; + nixpkgs.overlays = [ inputs.nix-vscode-extensions.overlays.default ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + sharedModules = [ inputs.niri.homeModules.niri ]; + extraSpecialArgs = { + inherit inputs system; + }; + users.elars = { + imports = [ + config.flake.homeModules.home-base + config.flake.homeModules.home-ghostty + config.flake.homeModules.home-nushell + config.flake.homeModules.home-zsh + config.flake.homeModules.home-shell-tools + config.flake.homeModules.home-session-vars + config.flake.homeModules.home-cursor + config.flake.homeModules.home-gtk + config.flake.homeModules.home-qt + config.flake.homeModules.home-mimeapps + config.flake.homeModules.home-easyeffects + config.flake.homeModules.home-discord + config.flake.homeModules.desktop-niri-home + config.flake.homeModules.desktop-niri-env + config.flake.homeModules.desktop-niri-execs + config.flake.homeModules.desktop-niri-general + config.flake.homeModules.desktop-niri-keybinds + config.flake.homeModules.desktop-niri-rules + ]; + home.username = "elars"; + home.homeDirectory = "/home/elars"; + home.stateVersion = "25.05"; + }; + }; + } + + config.flake.nixosModules.hostname-assert + { elars.expectedHostName = "copland"; } + # pool + config.flake.nixosModules.common-boot + config.flake.nixosModules.hw-bluetooth + config.flake.nixosModules.hw-graphics + config.flake.nixosModules.hw-udev + config.flake.nixosModules.net-network-manager + config.flake.nixosModules.net-vpn + config.flake.nixosModules.service-appimage + config.flake.nixosModules.service-flatpak + config.flake.nixosModules.service-fwupd + config.flake.nixosModules.service-kde-connect + config.flake.nixosModules.service-ollama + config.flake.nixosModules.service-performance + config.flake.nixosModules.service-printing + config.flake.nixosModules.service-security + config.flake.nixosModules.service-ssh + config.flake.nixosModules.common-locale + config.flake.nixosModules.common-nix + config.flake.nixosModules.common-fonts + config.flake.nixosModules.common-kmscon + config.flake.nixosModules.desktop-display + config.flake.nixosModules.desktop-audio + config.flake.nixosModules.desktop-niri + config.flake.nixosModules.desktop-xdg-mime + config.flake.nixosModules.gaming-steam + config.flake.nixosModules.gaming-gamemode + config.flake.nixosModules.common-users + config.flake.nixosModules.service-docker + config.flake.nixosModules.service-virt-manager + config.flake.nixosModules.common-git + config.flake.nixosModules.common-packages + # import + ./copland-hardware.nix + { + elars.hardware.graphics.driver = "intel"; + + zramSwap = { + enable = true; + memoryPercent = 100; + algorithm = "zstd"; + priority = 100; + }; + + environment.pathsToLink = [ + "/share/applications" + "/share/icons" + "/share/mime" + "/share/X11" + ]; + } + ]; + }; +} diff --git a/hosts/sohryu-darwin.ulu.nix b/hosts/sohryu-darwin.ulu.nix new file mode 100644 index 0000000..8e5d4f6 --- /dev/null +++ b/hosts/sohryu-darwin.ulu.nix @@ -0,0 +1,58 @@ +{ config, inputs, ... }: +let + system = "x86_64-darwin"; +in +{ + flake.darwinConfigurations.sohryu-darwin = inputs.nix-darwin.lib.darwinSystem { + specialArgs = { + inherit inputs system; + }; + + modules = [ + { nixpkgs.hostPlatform = system; } + + inputs.home-manager.darwinModules.home-manager + + { + nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowDeprecatedx86_64Darwin = true; + nixpkgs.overlays = [ inputs.nix-vscode-extensions.overlays.default ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit inputs system; + }; + users.sohryu = { + imports = [ + config.flake.homeModules.home-base + config.flake.homeModules.home-ghostty + config.flake.homeModules.home-nushell + ]; + home.username = "sohryu"; + home.homeDirectory = "/Users/sohryu"; + home.stateVersion = "25.05"; + }; + }; + } + + config.flake.darwinModules.hostname-assert + { elars.expectedHostName = "sohryu-darwin"; } + # pool + config.flake.darwinModules.common-git + config.flake.darwinModules.common-homebrew + config.flake.darwinModules.common-system + config.flake.darwinModules.common-user + config.flake.darwinModules.common-packages + + # import + + { + networking.hostName = "sohryu-darwin"; + networking.computerName = "sohryu-darwin"; + system.stateVersion = 5; + } + ]; + }; +} diff --git a/main/darwin/home.nix b/main/darwin/home.nix deleted file mode 100644 index 0d3663d..0000000 --- a/main/darwin/home.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: - -{ - imports = [ - ../../modules/home - ]; - - home.username = "sohryu"; - home.homeDirectory = "/Users/sohryu"; - home.stateVersion = "25.05"; - # nu or zsh -} diff --git a/main/darwin/machine.nix b/main/darwin/machine.nix deleted file mode 100755 index 0c00cbf..0000000 --- a/main/darwin/machine.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, system, ... }: - -let - packages = import ./packages.nix { inherit pkgs; }; -in -{ - imports = [ - ../../modules/darwin - ]; - - networking.hostName = "sohryu-darwin"; - networking.computerName = "sohryu-darwin"; - - nixpkgs.hostPlatform = system; - - system.stateVersion = 5; - system.primaryUser = "sohryu"; - - environment.systemPackages = packages.system; -} diff --git a/main/darwin/packages.nix b/main/darwin/packages.nix deleted file mode 100755 index 97edd61..0000000 --- a/main/darwin/packages.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs }: - -with pkgs; -{ - system = [ - pinentry_mac - fastfetch - starship - clinfo - zoxide - unzip - gnupg - btop - htop - tree - wget - eza - bat - git - fzf - zip - fd - ]; -} diff --git a/main/nixos/home.nix b/main/nixos/home.nix deleted file mode 100644 index 7bf213a..0000000 --- a/main/nixos/home.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: - -{ - imports = [ - ../../modules/home - ../../modules/home/linux.nix - ]; - - home.username = "elars"; - home.homeDirectory = "/home/elars"; - home.stateVersion = "25.05"; -} diff --git a/main/nixos/machine.nix b/main/nixos/machine.nix deleted file mode 100755 index b363e4b..0000000 --- a/main/nixos/machine.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ pkgs, inputs, system, ... }: - -let - packages = import ./packages.nix { inherit pkgs inputs system; }; -in -{ - imports = [ - ./hardware.nix - ../../modules/nixos - ]; - - elars.hardware.graphics.driver = "intel"; - - zramSwap = { - enable = true; - memoryPercent = 100; - algorithm = "zstd"; - priority = 100; - }; - environment.systemPackages = packages.system; - environment.pathsToLink = [ - "/share/applications" - "/share/icons" - "/share/mime" - "/share/X11" - ]; -} diff --git a/main/nixos/packages.nix b/main/nixos/packages.nix deleted file mode 100755 index 8b2af43..0000000 --- a/main/nixos/packages.nix +++ /dev/null @@ -1,200 +0,0 @@ -{ - pkgs, - inputs, - system, - ... -}: - -let - uxplay-fixed = pkgs.uxplay.override { - avahi = pkgs.avahi.override { withLibdnssdCompat = true; }; - }; -in -with pkgs; -{ - system = [ - # apps - onlyoffice-desktopeditors - whatsapp-electron - telegram-desktop - prismlauncher - moonlight-qt - qbittorrent - antigravity - obs-studio - localsend - picotool - sunshine - spotify - equibop - heroic - loupe - gimp - wine - - # file-manager - kdePackages.kdegraphics-thumbnailers - kdePackages.plasma-integration - kdePackages.breeze-icons - kdePackages.kio-extras - kdePackages.qtwayland - kdePackages.kio-admin - kdePackages.kio-fuse - kdePackages.kservice - kdePackages.konsole - kdePackages.dolphin - kdePackages.qtsvg - kdePackages.ark - kdePackages.kio - kdePackages.kdf - nautilus - - # utils - poppler-utils - wl-clipboard - wf-recorder - tesseract - mpvpaper - swappy - slurp - grim - - # phone - libimobiledevice - android-tools - uxplay-fixed - usbmuxd - libmtp - jmtpfs - scrcpy - ifuse - - # agents - github-copilot-cli - claude-mergetool - claude-monitor - claude-code - - # cli - fastfetch - trash-cli - tailscale - dos2unix - autossh - ani-cli - zoxide - cachix - direnv - rsync - unzip - kitty - tree - tldr - perf - file - wget - fish - htop - tmux - btop - yazi - zip - eza - bat - git - rar - jq - fd - - # hardware - xkeyboard-config - intel-gpu-tools - smartmontools - brightnessctl - gsmartcontrol - vulkan-tools - libva-utils - mesa-demos - lm_sensors - exfatprogs - dmidecode - libsecret - apfs-fuse - gptfdisk - pciutils - usbutils - hfsprogs - dmg2img - ddcutil - clinfo - hidapi - parted - p7zip - xar - - # themes/icons - whitesur-icon-theme - whitesur-gtk-theme - gnome-themes-extra - whitesur-kde - adwaita-qt6 - adwaita-qt - - # langs - alejandra - binutils - python3 - rustup - nodejs - jdk25 - gcc - ghc - zig - lua - glm - go - - # dev tools - jdt-language-server - rust-analyzer - clang-tools - cargo-tauri - pkg-config - gnumake - openssl - pyright - rustfmt - lazygit - nixfmt - zellij - sqlite - aubio - delta - trunk - nixd - nil - uv - - # editors - lite-xl - neovim - vscode - - # media - ffmpegthumbnailer - imagemagick - pavucontrol - pamixer - ffmpeg - yt-dlp - cava - mpv - - inputs.zen-browser.packages.${system}.default - inputs.nix-alien.packages.${system}.nix-alien - inputs.noctalia.packages.${system}.default - inputs.copetch.packages.${system}.default - inputs.helium.packages.${system}.default - pkgs.qt6Packages.qtwebsockets - ]; -} diff --git a/modules/darwin/common-homebrew.ulu.nix b/modules/darwin/common-homebrew.ulu.nix new file mode 100644 index 0000000..4406aa8 --- /dev/null +++ b/modules/darwin/common-homebrew.ulu.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + flake.darwinModules.common-homebrew = + { ... }: + { + homebrew = { + enable = true; + onActivation = { + autoUpdate = true; + upgrade = true; + cleanup = "none"; + }; + brews = [ ]; + casks = [ ]; + }; + }; +} diff --git a/modules/darwin/common-packages.ulu.nix b/modules/darwin/common-packages.ulu.nix new file mode 100644 index 0000000..7297313 --- /dev/null +++ b/modules/darwin/common-packages.ulu.nix @@ -0,0 +1,26 @@ +{ ... }: +{ + flake.darwinModules.common-packages = + { pkgs, ... }: + { + environment.systemPackages = with pkgs; [ + pinentry_mac + fastfetch + starship + clinfo + zoxide + unzip + gnupg + btop + htop + tree + wget + eza + bat + git + fzf + zip + fd + ]; + }; +} diff --git a/modules/darwin/common-system.ulu.nix b/modules/darwin/common-system.ulu.nix new file mode 100644 index 0000000..8290427 --- /dev/null +++ b/modules/darwin/common-system.ulu.nix @@ -0,0 +1,73 @@ +{ ... }: +{ + flake.darwinModules.common-system = + { + pkgs, + config, + lib, + ... + }: + let + inherit (lib) mkAfter; + in + { + nix.enable = false; + + time.timeZone = "Europe/Istanbul"; + + fonts.packages = with pkgs; [ + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-color-emoji + nerd-fonts.jetbrains-mono + ]; + + system.defaults = { + NSGlobalDomain = { + AppleInterfaceStyle = "Dark"; + InitialKeyRepeat = 15; + KeyRepeat = 2; + ApplePressAndHoldEnabled = false; + AppleShowAllFiles = true; + AppleShowAllExtensions = true; + "com.apple.springing.enabled" = true; + "com.apple.springing.delay" = 0.0; + }; + CustomSystemPreferences = { + "com.apple.desktopservices" = { + DSDontWriteNetworkStores = true; + DSDontWriteUSBStores = true; + }; + "com.apple.AdLib" = { + allowApplePersonalizedAdvertising = false; + allowIdentifierForAdvertising = false; + forceLimitAdTracking = true; + personalizedAdsMigrated = false; + }; + }; + dock = { + autohide = true; + orientation = "bottom"; + tilesize = 48; + }; + finder = { + AppleShowAllExtensions = true; + ShowPathbar = true; + FXEnableExtensionChangeWarning = false; + NewWindowTarget = "Home"; + FXPreferredViewStyle = "Nlsv"; + }; + loginwindow = { + DisableConsoleAccess = true; + GuestEnabled = false; + }; + LaunchServices.LSQuarantine = false; + }; + + system.activationScripts.postActivation.text = mkAfter '' + echo "unhiding ${config.users.users.${config.system.primaryUser}.home}/Library..." + /usr/bin/chflags nohidden ${config.users.users.${config.system.primaryUser}.home}/Library + ''; + }; +} diff --git a/modules/darwin/common-user.ulu.nix b/modules/darwin/common-user.ulu.nix new file mode 100644 index 0000000..19aba8b --- /dev/null +++ b/modules/darwin/common-user.ulu.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + flake.darwinModules.common-user = + { pkgs, ... }: + { + system.primaryUser = "sohryu"; + users.users.sohryu = { + name = "sohryu"; + home = "/Users/sohryu"; + shell = pkgs.zsh; + }; + + programs.zsh.enable = true; + environment.systemPackages = [ pkgs.nh ]; + environment.variables.NH_FLAKE = "/Users/sohryu/copland"; + }; +} diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix deleted file mode 100755 index 8fbc227..0000000 --- a/modules/darwin/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: - -{ - imports = [ - ../home/git.nix - ./homebrew - ./system - ./user - ]; -} diff --git a/modules/darwin/homebrew/default.nix b/modules/darwin/homebrew/default.nix deleted file mode 100755 index 034e9e4..0000000 --- a/modules/darwin/homebrew/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: - -{ - homebrew = { - enable = true; - onActivation = { - autoUpdate = true; - upgrade = true; - cleanup = "none"; - }; - brews = [ ]; - casks = [ ]; - }; -} diff --git a/modules/darwin/system/default.nix b/modules/darwin/system/default.nix deleted file mode 100755 index a7afc41..0000000 --- a/modules/darwin/system/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ pkgs, config, lib, ... }: - -let - inherit (lib) mkAfter; -in -{ - nix.enable = false; - - time.timeZone = "Europe/Istanbul"; - - fonts.packages = with pkgs; [ - noto-fonts - noto-fonts-cjk-sans - noto-fonts-cjk-serif - noto-fonts-color-emoji - nerd-fonts.jetbrains-mono - ]; - - system.defaults = { - NSGlobalDomain = { - AppleInterfaceStyle = "Dark"; - InitialKeyRepeat = 15; - KeyRepeat = 2; - ApplePressAndHoldEnabled = false; - AppleShowAllFiles = true; - AppleShowAllExtensions = true; - "com.apple.springing.enabled" = true; - "com.apple.springing.delay" = 0.0; - }; - CustomSystemPreferences = { - "com.apple.desktopservices" = { - DSDontWriteNetworkStores = true; - DSDontWriteUSBStores = true; - }; - "com.apple.AdLib" = { - allowApplePersonalizedAdvertising = false; - allowIdentifierForAdvertising = false; - forceLimitAdTracking = true; - personalizedAdsMigrated = false; - }; - }; - dock = { - autohide = true; - orientation = "bottom"; - tilesize = 48; - }; - finder = { - AppleShowAllExtensions = true; - ShowPathbar = true; - FXEnableExtensionChangeWarning = false; - NewWindowTarget = "Home"; - FXPreferredViewStyle = "Nlsv"; - }; - loginwindow = { - DisableConsoleAccess = true; - GuestEnabled = false; - }; - LaunchServices.LSQuarantine = false; - }; - - system.activationScripts.postActivation.text = mkAfter '' - echo "unhiding ${config.users.users.${config.system.primaryUser}.home}/Library..." - /usr/bin/chflags nohidden ${config.users.users.${config.system.primaryUser}.home}/Library - ''; -} diff --git a/modules/darwin/user/default.nix b/modules/darwin/user/default.nix deleted file mode 100755 index 31dddcf..0000000 --- a/modules/darwin/user/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: - -{ - system.primaryUser = "sohryu"; - users.users.sohryu = { - name = "sohryu"; - home = "/Users/sohryu"; - shell = pkgs.zsh; - }; - - programs.zsh.enable = true; - environment.systemPackages = [ pkgs.nh ]; - environment.variables.NH_FLAKE = "/Users/sohryu/copland"; -} diff --git a/modules/home/default.nix b/modules/home/default.nix deleted file mode 100755 index 7f382be..0000000 --- a/modules/home/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: - -{ - imports = [ - ./programs - ]; - - programs.home-manager.enable = true; - fonts.fontconfig.enable = true; -} diff --git a/modules/home/git.nix b/modules/home/git.nix deleted file mode 100755 index c68f8f8..0000000 --- a/modules/home/git.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, lib, ... }: - -let - base = '' - [user] - name = elwrcl - email = elwerici@proton.me - signingkey = 5EA48F7312A42B84 - [commit] - gpgsign = true - [tag] - gpgsign = true - ''; - - darwinExtra = '' - [credential] - helper = osxkeychain - ''; - - gitconfig = pkgs.writeText "gitconfig" (base + lib.optionalString pkgs.stdenv.isDarwin darwinExtra); -in -{ - environment.variables.GIT_CONFIG_SYSTEM = "${gitconfig}"; -} diff --git a/modules/home/home-base.ulu.nix b/modules/home/home-base.ulu.nix new file mode 100644 index 0000000..f66fb71 --- /dev/null +++ b/modules/home/home-base.ulu.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + flake.homeModules.home-base = + { ... }: + { + programs.home-manager.enable = true; + fonts.fontconfig.enable = true; + }; +} diff --git a/modules/home/home-cursor.ulu.nix b/modules/home/home-cursor.ulu.nix new file mode 100644 index 0000000..7d66388 --- /dev/null +++ b/modules/home/home-cursor.ulu.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + flake.homeModules.home-cursor = + { pkgs, ... }: + { + home.pointerCursor = { + enable = true; + name = "macOS"; + package = pkgs.apple-cursor; + size = 24; + gtk.enable = true; + x11.enable = true; + }; + }; +} diff --git a/modules/home/home-discord.ulu.nix b/modules/home/home-discord.ulu.nix new file mode 100644 index 0000000..e7527b7 --- /dev/null +++ b/modules/home/home-discord.ulu.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + flake.homeModules.home-discord = + { inputs, ... }: + { + imports = [ + inputs.nixcord.homeModules.nixcord + ]; + + programs.nixcord = { + enable = true; + legcord = { + enable = true; + settings = { + channel = "stable"; + tray = "dynamic"; + minimizeToTray = true; + mods = [ "shelter" ]; + doneSetup = true; + }; + }; + }; + }; +} diff --git a/modules/home/home-easyeffects.ulu.nix b/modules/home/home-easyeffects.ulu.nix new file mode 100644 index 0000000..8222c22 --- /dev/null +++ b/modules/home/home-easyeffects.ulu.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + flake.homeModules.home-easyeffects = + { ... }: + { + services.easyeffects.enable = true; + }; +} diff --git a/modules/home/home-ghostty.ulu.nix b/modules/home/home-ghostty.ulu.nix new file mode 100644 index 0000000..f23cf79 --- /dev/null +++ b/modules/home/home-ghostty.ulu.nix @@ -0,0 +1,127 @@ +{ ... }: +{ + flake.homeModules.home-ghostty = + { pkgs, lib, ... }: + let + isDarwin = pkgs.stdenv.isDarwin; + + linuxKeybinds = [ + "alt+r=reload_config" + "alt+q=close_surface" + + "ctrl+space=new_tab" + "ctrl+page_down=next_tab" + "ctrl+page_up=previous_tab" + "alt+comma=move_tab:-1" + "alt+period=move_tab:1" + + "alt+1=goto_tab:1" + "alt+2=goto_tab:2" + "alt+3=goto_tab:3" + "alt+4=goto_tab:4" + "alt+5=goto_tab:5" + "alt+6=goto_tab:6" + "alt+7=goto_tab:7" + "alt+8=goto_tab:8" + "alt+9=goto_tab:9" + + "ctrl+shift+backslash=new_split:right" + "ctrl+shift+minus=new_split:down" + + "alt+h=goto_split:left" + "alt+j=goto_split:bottom" + "alt+k=goto_split:top" + "alt+l=goto_split:right" + + "ctrl+shift+z=toggle_split_zoom" + "ctrl+shift+e=equalize_splits" + ]; + + darwinKeybinds = [ + "cmd+s>r=reload_config" + "cmd+s>x=close_surface" + "cmd+s>n=new_window" + + "cmd+s>c=new_tab" + "cmd+s>shift+l=next_tab" + "cmd+s>shift+h=previous_tab" + "cmd+s>comma=move_tab:-1" + "cmd+s>period=move_tab:1" + + "cmd+s>1=goto_tab:1" + "cmd+s>2=goto_tab:2" + "cmd+s>3=goto_tab:3" + "cmd+s>4=goto_tab:4" + "cmd+s>5=goto_tab:5" + "cmd+s>6=goto_tab:6" + "cmd+s>7=goto_tab:7" + "cmd+s>8=goto_tab:8" + "cmd+s>9=goto_tab:9" + + "cmd+s>\\=new_split:right" + "cmd+s>-=new_split:down" + "cmd+s>h=goto_split:left" + "cmd+s>j=goto_split:bottom" + "cmd+s>k=goto_split:top" + "cmd+s>l=goto_split:right" + "cmd+s>z=toggle_split_zoom" + "cmd+s>e=equalize_splits" + ]; + in + { + programs.ghostty = { + enable = true; + installBatSyntax = true; + enableZshIntegration = true; + + settings = { + font-family = "JetBrainsMono Nerd Font"; + font-size = 11; + + window-padding-x = 10; + window-padding-y = 10; + window-padding-balance = true; + window-save-state = "always"; + + mouse-hide-while-typing = true; + mouse-scroll-multiplier = 2; + shell-integration-features = "no-cursor,sudo,no-title"; + + palette = [ + "0=#090E13" + "1=#c4746e" + "2=#8a9a7b" + "3=#c4b28a" + "4=#8ba4b0" + "5=#a292a3" + "6=#8ea4a2" + "7=#a4a7a4" + "8=#5C6066" + "9=#e46876" + "10=#87a987" + "11=#e6c384" + "12=#7fb4ca" + "13=#938aa9" + "14=#7aa89f" + "15=#c5c9c7" + ]; + + background = "#090E13"; + foreground = "#c5c9c7"; + cursor-color = "#c5c9c7"; + cursor-text = "#9cdef2"; + selection-background = "#22262D"; + selection-foreground = "#c5c9c7"; + cursor-style = "block"; + cursor-style-blink = true; + adjust-cell-height = "35%"; + background-opacity = 0.96; + + keybind = linuxKeybinds ++ lib.optionals isDarwin darwinKeybinds; + } + // lib.optionalAttrs isDarwin { + macos-titlebar-style = "transparent"; + }; + }; + }; +} diff --git a/modules/home/home-gtk.ulu.nix b/modules/home/home-gtk.ulu.nix new file mode 100644 index 0000000..48508a1 --- /dev/null +++ b/modules/home/home-gtk.ulu.nix @@ -0,0 +1,26 @@ +{ ... }: +{ + flake.homeModules.home-gtk = + { pkgs, ... }: + { + gtk = { + enable = true; + theme.name = "WhiteSur-Dark"; + theme.package = pkgs.whitesur-gtk-theme; + gtk4.theme.name = "WhiteSur-Dark"; + gtk4.theme.package = pkgs.whitesur-gtk-theme; + iconTheme.name = "WhiteSur-dark"; + iconTheme.package = pkgs.whitesur-icon-theme; + font = { + name = "JetBrainsMono Nerd Font"; + size = 11; + }; + }; + + dconf.settings."org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + gtk-application-prefer-dark-theme = true; + gtk-theme = "WhiteSur-Dark"; + }; + }; +} diff --git a/modules/home/home-mimeapps.ulu.nix b/modules/home/home-mimeapps.ulu.nix new file mode 100644 index 0000000..e3fcc76 --- /dev/null +++ b/modules/home/home-mimeapps.ulu.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + flake.homeModules.home-mimeapps = + { ... }: + { + xdg.mimeApps = { + enable = true; + defaultApplications = { + "inode/directory" = [ "org.kde.dolphin.desktop" ]; + "x-scheme-handler/http" = [ "zen-beta.desktop" ]; + "x-scheme-handler/https" = [ "zen-beta.desktop" ]; + "x-scheme-handler/about" = [ "zen-beta.desktop" ]; + "x-scheme-handler/unknown" = [ "zen-beta.desktop" ]; + }; + }; + }; +} diff --git a/modules/home/home-nushell.ulu.nix b/modules/home/home-nushell.ulu.nix new file mode 100644 index 0000000..dec9808 --- /dev/null +++ b/modules/home/home-nushell.ulu.nix @@ -0,0 +1,72 @@ +{ ... }: +{ + flake.homeModules.home-nushell = + { ... }: + { + programs.nushell = { + enable = true; + + shellAliases = { + ls = "eza --icons --group-directories-first"; + ll = "eza -lah --icons --group-directories-first"; + la = "eza -a --icons --group-directories-first"; + lt = "eza --tree --level=2 --icons"; + cat = "bat"; + df = "df -h"; + du = "du -h"; + free = "free -h"; + rm = "trash-put"; + sysinfo = "fastfetch"; + monitor = "sudo btop"; + ports = "sudo ss -tulpn"; + myip = "curl ifconfig.me"; + gs = "git status"; + ga = "git add"; + gp = "git push"; + gl = "git log --oneline --graph --decorate"; + ".." = "cd .."; + "..." = "cd ../.."; + "...." = "cd ../../.."; + }; + + environmentVariables = { + MESA_SHADER_CACHE_MAX_SIZE = "2G"; + MESA_SHADER_CACHE_DIR = "/tmp/mesa_shader_cache"; + }; + + extraEnv = '' + $env.PATH = ($env.PATH | prepend $"($env.HOME)/.local/bin") + ''; + + extraConfig = '' + $env.config.show_banner = false + def gc [msg: string] { git commit -m $msg } + def rebuild [] { + git -C ~/copland add -A + git -C ~/copland commit -m "update" + nh os switch + } + + def rebuild-dry [] { nh os switch --dry } + def rebuild-cop [] { + nix flake update --flake ~/copland + git -C ~/copland add -A + git -C ~/copland commit -m $"flake update (date now | format date '%Y-%m-%d')" + nh os switch + } + def extract [file: string] { + let ext = ($file | path parse | get extension) + match $ext { + "gz" => { tar xzf $file }, + "bz2" => { tar xjf $file }, + "tar" => { tar xf $file }, + "zip" => { unzip $file }, + "7z" => { 7z x $file }, + "rar" => { unrar e $file }, + _ => { print $"'($file)' can't be extracted" } + } + } + ''; + }; + }; +} diff --git a/modules/home/home-qt.ulu.nix b/modules/home/home-qt.ulu.nix new file mode 100644 index 0000000..d512ee0 --- /dev/null +++ b/modules/home/home-qt.ulu.nix @@ -0,0 +1,31 @@ +{ ... }: +{ + flake.homeModules.home-qt = + { pkgs, ... }: + { + qt = { + enable = true; + platformTheme.name = "kde"; + style.name = "kvantum"; + }; + + xdg.configFile."Kvantum/WhiteSur-Dark/WhiteSur-Dark.kvconfig".source = + "${pkgs.whitesur-kde}/share/Kvantum/WhiteSur/WhiteSurDark.kvconfig"; + xdg.configFile."Kvantum/WhiteSur-Dark/WhiteSur-Dark.svg".source = + "${pkgs.whitesur-kde}/share/Kvantum/WhiteSur/WhiteSurDark.svg"; + + xdg.configFile."Kvantum/kvantum.kvconfig".text = '' + [General] + theme=WhiteSur-Dark + ''; + + xdg.configFile."kdeglobals".text = '' + [General] + font=JetBrainsMono Nerd Font,11,-1,5,50,0,0,0,0,0 + fixed=JetBrainsMono Nerd Font,11,-1,5,50,0,0,0,0,0 + menuFont=JetBrainsMono Nerd Font,11,-1,5,50,0,0,0,0,0 + toolBarFont=JetBrainsMono Nerd Font,11,-1,5,50,0,0,0,0,0 + smallestReadableFont=JetBrainsMono Nerd Font,9,-1,5,50,0,0,0,0,0 + ''; + }; +} diff --git a/modules/home/home-session-vars.ulu.nix b/modules/home/home-session-vars.ulu.nix new file mode 100644 index 0000000..27193cb --- /dev/null +++ b/modules/home/home-session-vars.ulu.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + flake.homeModules.home-session-vars = + { ... }: + { + home.sessionVariables = { + BROWSER = "zen-beta.desktop"; + }; + }; +} diff --git a/modules/home/home-shell-tools.ulu.nix b/modules/home/home-shell-tools.ulu.nix new file mode 100644 index 0000000..343297c --- /dev/null +++ b/modules/home/home-shell-tools.ulu.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + flake.homeModules.home-shell-tools = + { ... }: + { + programs.starship.enable = true; + programs.fzf.enable = true; + programs.zoxide.enable = true; + }; +} diff --git a/modules/home/home-zsh.ulu.nix b/modules/home/home-zsh.ulu.nix new file mode 100644 index 0000000..0436521 --- /dev/null +++ b/modules/home/home-zsh.ulu.nix @@ -0,0 +1,80 @@ +{ ... }: +{ + flake.homeModules.home-zsh = + { ... }: + { + # TODO nu + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + initContent = '' + export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border' + export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' + + alias ls='eza --icons --group-directories-first' + alias ll='eza -lah --icons --group-directories-first' + alias la='eza -a --icons --group-directories-first' + alias lt='eza --tree --level=2 --icons' + + alias cd='z' + alias cat='bat' + alias grep='grep --color=auto' + alias df='df -h' + alias du='du -h' + alias free='free -h' + + alias cp='cp -i' + alias mv='mv -i' + alias rm='trash-put' + + alias sysinfo='fastfetch' + alias monitor='sudo btop' + alias ports='sudo ss -tulpn' + alias myip='curl ifconfig.me' + + alias ..='cd ..' + alias ...='cd ../..' + alias ....='cd ../../..' + alias ~='cd ~' + alias -- -='cd -' + + alias gs='git status' + alias ga='git add' + alias gc='git commit -m' + alias gp='git push' + alias gl='git log --oneline --graph --decorate' + + alias rebuild='git -C ~/copland add -A && git -C ~/copland commit -m "update" && nh os switch' + alias rebuild-dry='nh os switch --dry' + alias rebuild-cop='nix flake update --flake ~/copland && git -C ~/copland add -A && git -C ~/copland commit -m "flake update $(date +%Y-%m-%d)" && nh os switch' + + extract() { + if [ -f "$1" ]; then + case "$1" in + *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; + *.bz2) bunzip2 "$1" ;; *.rar) unrar e "$1" ;; + *.gz) gunzip "$1" ;; *.tar) tar xf "$1" ;; + *.zip) unzip "$1" ;; *.7z) 7z x "$1" ;; + *) echo "'$1' can't be extracted" ;; + esac + fi + } + + HISTSIZE=10000 + SAVEHIST=10000 + HISTFILE=~/.zsh_history + setopt HIST_IGNORE_DUPS HIST_IGNORE_SPACE SHARE_HISTORY AUTO_CD + zstyle ':completion:*' menu select + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' + + export MESA_SHADER_CACHE_MAX_SIZE=2G + export MESA_SHADER_CACHE_DIR=/tmp/mesa_shader_cache + export PATH="$HOME/.local/bin:$PATH" + + /home/elars/.config/copetch/animated-copetch.sh + ''; + }; + }; +} diff --git a/modules/home/hypr/default.nix b/modules/home/hypr/default.nix deleted file mode 100755 index d16f077..0000000 --- a/modules/home/hypr/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -{ - imports = [ - ./hyprland/env.nix - ./hyprland/execs.nix - ./hyprland/general.nix - ./hyprland/rules.nix - ./hyprland/keybinds.nix - ]; -} diff --git a/modules/home/hypr/hyprland/env.nix b/modules/home/hypr/hyprland/env.nix deleted file mode 100755 index 6ecf3c9..0000000 --- a/modules/home/hypr/hyprland/env.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - wayland.windowManager.hyprland.settings = { - env = [ - "XCURSOR_SIZE,24" - "XCURSOR_THEME,Bibata-Modern-Classic" - "QT_STYLE_OVERRIDE,adwaita-dark" - "GDK_BACKEND,wayland,x11" - "QT_QPA_PLATFORM,wayland;xcb" - "QT_QPA_PLATFORMTHEME,gtk3" - "ELECTRON_OZONE_PLATFORM_HINT,auto" - "TERMINAL,ghostty" - "MESA_GL_VERSION_OVERRIDE,4.6" - "MESA_GLSL_VERSION_OVERRIDE,460" - ]; - }; -} diff --git a/modules/home/hypr/hyprland/execs.nix b/modules/home/hypr/hyprland/execs.nix deleted file mode 100755 index 728c76c..0000000 --- a/modules/home/hypr/hyprland/execs.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - wayland.windowManager.hyprland.settings = { - exec-once = [ - "noctalia-shell" - "hyprctl setcursor Bibata-Modern-Classic 24" - "wl-paste --type text --watch cliphist store" - "wl-paste --type image --watch cliphist store" - ]; - }; -} diff --git a/modules/home/hypr/hyprland/general.nix b/modules/home/hypr/hyprland/general.nix deleted file mode 100755 index 090cd9d..0000000 --- a/modules/home/hypr/hyprland/general.nix +++ /dev/null @@ -1,102 +0,0 @@ -{ ... }: -{ - wayland.windowManager.hyprland.settings = { - monitor = ",preferred,auto,1"; - - general = { - gaps_in = 5; - gaps_out = 7; - border_size = 2; - "col.active_border" = "rgba(61afefff) "; - "col.inactive_border" = "rgba(444444ff)"; - resize_on_border = true; - allow_tearing = true; - layout = "dwindle"; - }; - - decoration = { - rounding = 1; - rounding_power = 2; - active_opacity = 1.0; - inactive_opacity = 1.0; - - blur = { - size = 2; - passes = 1; - brightness = 0.4; - }; - - shadow = { - enabled = true; - range = 5; - render_power = 4; - color = "rgba(1fbeffee)"; - }; - }; - - input = { - kb_layout = "tr"; - numlock_by_default = true; - repeat_delay = 250; - repeat_rate = 35; - sensitivity = -5; - accel_profile = "adaptive"; - follow_mouse = 1; - touchpad = { - natural_scroll = true; - disable_while_typing = true; - clickfinger_behavior = true; - scroll_factor = 0.5; - }; - }; - - gestures = { - workspace_swipe_distance = 700; - workspace_swipe_cancel_ratio = 0.2; - workspace_swipe_min_speed_to_force = 5; - workspace_swipe_direction_lock = true; - workspace_swipe_create_new = true; - }; - - misc = { - disable_hyprland_logo = true; - disable_splash_rendering = true; - mouse_move_enables_dpms = true; - key_press_enables_dpms = true; - animate_manual_resizes = false; - focus_on_activate = false; - }; - - bezier = [ - "omniDecel, 0.05, 0.9, 0.1, 1" - "omniAccel, 0.3, 0, 0.8, 0.15" - "omniSmooth, 0.25, 0.1, 0.25, 1" - "omniOvershoot, 0.16, 1, 0.3, 1" - "menu_decel, 0.1, 1, 0, 1" - "menu_accel, 0.52, 0.03, 0.72, 0.08" - ]; - - animation = [ - "windowsIn, 1, 6, omniOvershoot, popin 86%" - "windowsOut, 1, 5, omniAccel, popin 92%" - "windowsMove, 1, 6, omniDecel, slide" - "fadeIn, 1, 5, omniDecel" - "fadeOut, 1, 4, omniAccel" - "border, 1, 10, omniSmooth" - "layersIn, 1, 5, omniDecel, popin 92%" - "layersOut, 1, 4, omniAccel, popin 94%" - "fadeLayersIn, 1, 3, omniDecel" - "fadeLayersOut, 1, 3, omniAccel" - "workspaces, 1, 8, omniDecel, slide" - "specialWorkspaceIn, 1, 5, omniDecel, slidevert" - "specialWorkspaceOut, 1, 4, omniAccel, slidevert" - ]; - - device = [ - { - name = "hp--inc-hyperx-cloud-alpha-s-consumer-control"; - enabled = false; - } - ]; - }; -} diff --git a/modules/home/hypr/hyprland/keybinds.nix b/modules/home/hypr/hyprland/keybinds.nix deleted file mode 100755 index 7b43ccd..0000000 --- a/modules/home/hypr/hyprland/keybinds.nix +++ /dev/null @@ -1,121 +0,0 @@ -{ ... }: -let - ipc = "noctalia-shell ipc call"; -in -{ - wayland.windowManager.hyprland.settings = { - "$mainMod" = "SUPER"; - - bindr = [ - "$mainMod, SUPER_L, exec, ${ipc} launcher toggle" - ]; - - bind = [ - # workspace - "CTRL $mainMod, right, workspace, r+1" - "CTRL $mainMod, left, workspace, r-1" - "CTRL $mainMod, down, workspace, r+1" - "CTRL $mainMod, up, workspace, r-1" - "CTRL $mainMod SHIFT, right, movetoworkspace, r+1" - "CTRL $mainMod SHIFT, left, movetoworkspace, r-1" - "CTRL $mainMod SHIFT, down, movetoworkspace, r+1" - "CTRL $mainMod SHIFT, up, movetoworkspace, r-1" - - # interface - "$mainMod, P, exec, ${ipc} bar toggle" - "CTRL ALT, Delete, exec, ${ipc} sessionMenu toggle" - - # plugins - "$mainMod SHIFT, S, exec, ${ipc} plugin:screen-shot-and-record screenshot" - "$mainMod SHIFT, Z, exec, ${ipc} plugin:screen-shot-and-record search" - "$mainMod SHIFT, X, exec, ${ipc} plugin:screen-shot-and-record ocr" - "$mainMod SHIFT, C, exec, ${ipc} plugin:music panel" - - # launchers - "$mainMod, Return, exec, ghostty" - "$mainMod, W, exec, zen-beta" - "$mainMod, E, exec, dolphin" - "$mainMod, Z, exec, code" - "$mainMod ALT, V, exec, pavucontrol" - "$mainMod SHIFT, V, exec, ${ipc} launcher clipboard" - "$mainMod SHIFT, L, exec, ${ipc} lockScreen lock" - "CTRL SHIFT, Escape, exec, ghostty -e sudo btop" - - # window management - "$mainMod, Q, killactive" - "$mainMod ALT, SPACE, togglefloating" - "$mainMod, F, fullscreen, 0" - "$mainMod, D, fullscreen, 1" - "$mainMod ALT, P, pin" - - # focus windows - "$mainMod, left, movefocus, l" - "$mainMod, right, movefocus, r" - "$mainMod, up, movefocus, u" - "$mainMod, down, movefocus, d" - - "$mainMod SHIFT, left, movewindow, l" - "$mainMod SHIFT, right, movewindow, r" - "$mainMod SHIFT, up, movewindow, u" - "$mainMod SHIFT, down, movewindow, d" - - # workspace navigation - "$mainMod, 1, workspace, 1" - "$mainMod, 2, workspace, 2" - "$mainMod, 3, workspace, 3" - "$mainMod, 4, workspace, 4" - "$mainMod, 5, workspace, 5" - "$mainMod, 6, workspace, 6" - "$mainMod, 7, workspace, 7" - "$mainMod, 8, workspace, 8" - "$mainMod, 9, workspace, 9" - "$mainMod, 0, workspace, 10" - - # move windows to workspace - "$mainMod SHIFT, 1, movetoworkspace, 1" - "$mainMod SHIFT, 2, movetoworkspace, 2" - "$mainMod SHIFT, 3, movetoworkspace, 3" - "$mainMod SHIFT, 4, movetoworkspace, 4" - "$mainMod SHIFT, 5, movetoworkspace, 5" - "$mainMod SHIFT, 6, movetoworkspace, 6" - "$mainMod SHIFT, 7, movetoworkspace, 7" - "$mainMod SHIFT, 8, movetoworkspace, 8" - "$mainMod SHIFT, 9, movetoworkspace, 9" - "$mainMod SHIFT, 0, movetoworkspace, 10" - - # special workspaces - "$mainMod, S, togglespecialworkspace" - "$mainMod ALT, S, movetoworkspacesilent, special" - - # mouse workspace navigation - "$mainMod, mouse_up, workspace, +1" - "$mainMod, mouse_down, workspace, -1" - - # media keys - "$mainMod SHIFT, N, exec, playerctl next" - "$mainMod SHIFT, B, exec, playerctl previous" - "$mainMod SHIFT, P, exec, playerctl play-pause" - ]; - - bindm = [ - "$mainMod, mouse:272, movewindow" - "$mainMod, mouse:273, resizewindow" - ]; - - bindel = [ - ", XF86AudioRaiseVolume, exec, ${ipc} volume increase" - ", XF86AudioLowerVolume, exec, ${ipc} volume decrease" - ", XF86MonBrightnessUp, exec, ${ipc} brightness increase" - ", XF86MonBrightnessDown, exec, ${ipc} brightness decrease" - ]; - - bindl = [ - ", XF86AudioMute, exec, ${ipc} volume muteOutput" - ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle" - ", XF86AudioNext, exec, playerctl next" - ", XF86AudioPrev, exec, playerctl previous" - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioPause, exec, playerctl play-pause" - ]; - }; -} diff --git a/modules/home/hypr/hyprland/rules.nix b/modules/home/hypr/hyprland/rules.nix deleted file mode 100755 index c4feb7c..0000000 --- a/modules/home/hypr/hyprland/rules.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ ... }: -{ - wayland.windowManager.hyprland.settings = { - windowrule = [ - "float on, match:title ^(Open File)(.*)$" - "center on, match:title ^(Open File)(.*)$" - "float on, match:title ^(Save As)(.*)$" - "center on, match:title ^(Save As)(.*)$" - "float on, match:title ^(File Upload)(.*)$" - "center on, match:title ^(File Upload)(.*)$" - "float on, match:class ^(pavucontrol)$" - "center on, match:class ^(pavucontrol)$" - "size 45% 45%, match:class ^(pavucontrol)$" - "float on, match:title ^([Pp]icture[-\\s]?[Ii]n[-\\s]?[Pp]icture)(.*)$" - "pin on, match:title ^([Pp]icture[-\\s]?[Ii]n[-\\s]?[Pp]icture)(.*)$" - "keep_aspect_ratio on, match:title ^([Pp]icture[-\\s]?[Ii]n[-\\s]?[Pp]icture)(.*)$" - "immediate on, match:class ^(steam_app).*" - "float on, match:class ^(steam)$" - "float off, match:class ^(steam)$, match:title ^(Steam)$" - ]; - }; -} diff --git a/modules/home/hyprland.nix b/modules/home/hyprland.nix deleted file mode 100755 index 89667b4..0000000 --- a/modules/home/hyprland.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, inputs, ... }: -{ - imports = [ ./hypr/default.nix ]; - - wayland.windowManager.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - configType = "hyprlang"; - xwayland.enable = true; - systemd.enable = false; - systemd.variables = [ "-all" ]; - plugins = [ - inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.csgo-vulkan-fix - ]; - }; -} diff --git a/modules/home/linux.nix b/modules/home/linux.nix deleted file mode 100644 index 816c99d..0000000 --- a/modules/home/linux.nix +++ /dev/null @@ -1,156 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - ./niri.nix - ./programs/discord - ]; - - home.sessionVariables = { - BROWSER = "zen-beta.desktop"; - }; - - # TODO nu - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - initContent = '' - export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border' - export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' - - alias ls='eza --icons --group-directories-first' - alias ll='eza -lah --icons --group-directories-first' - alias la='eza -a --icons --group-directories-first' - alias lt='eza --tree --level=2 --icons' - - alias cd='z' - alias cat='bat' - alias grep='grep --color=auto' - alias df='df -h' - alias du='du -h' - alias free='free -h' - - alias cp='cp -i' - alias mv='mv -i' - alias rm='trash-put' - - alias sysinfo='fastfetch' - alias monitor='sudo btop' - alias ports='sudo ss -tulpn' - alias myip='curl ifconfig.me' - - alias ..='cd ..' - alias ...='cd ../..' - alias ....='cd ../../..' - alias ~='cd ~' - alias -- -='cd -' - - alias gs='git status' - alias ga='git add' - alias gc='git commit -m' - alias gp='git push' - alias gl='git log --oneline --graph --decorate' - - alias rebuild='git -C ~/copland add -A && git -C ~/copland commit -m "update" && nh os switch' - alias rebuild-dry='nh os switch --dry' - alias rebuild-cop='nix flake update --flake ~/copland && git -C ~/copland add -A && git -C ~/copland commit -m "flake update $(date +%Y-%m-%d)" && nh os switch' - - extract() { - if [ -f "$1" ]; then - case "$1" in - *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; - *.bz2) bunzip2 "$1" ;; *.rar) unrar e "$1" ;; - *.gz) gunzip "$1" ;; *.tar) tar xf "$1" ;; - *.zip) unzip "$1" ;; *.7z) 7z x "$1" ;; - *) echo "'$1' can't be extracted" ;; - esac - fi - } - - HISTSIZE=10000 - SAVEHIST=10000 - HISTFILE=~/.zsh_history - setopt HIST_IGNORE_DUPS HIST_IGNORE_SPACE SHARE_HISTORY AUTO_CD - zstyle ':completion:*' menu select - zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' - - export MESA_SHADER_CACHE_MAX_SIZE=2G - export MESA_SHADER_CACHE_DIR=/tmp/mesa_shader_cache - export PATH="$HOME/.local/bin:$PATH" - - /home/elars/.config/copetch/animated-copetch.sh - ''; - }; - - programs.starship.enable = true; - programs.fzf.enable = true; - programs.zoxide.enable = true; - - home.pointerCursor = { - enable = true; - name = "macOS"; - package = pkgs.apple-cursor; - size = 24; - gtk.enable = true; - x11.enable = true; - }; - - gtk = { - enable = true; - theme.name = "WhiteSur-Dark"; - theme.package = pkgs.whitesur-gtk-theme; - gtk4.theme.name = "WhiteSur-Dark"; - gtk4.theme.package = pkgs.whitesur-gtk-theme; - iconTheme.name = "WhiteSur-dark"; - iconTheme.package = pkgs.whitesur-icon-theme; - font = { - name = "JetBrainsMono Nerd Font"; - size = 11; - }; - }; - - dconf.settings."org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - gtk-application-prefer-dark-theme = true; - gtk-theme = "WhiteSur-Dark"; - }; - - qt = { - enable = true; - platformTheme.name = "kde"; - style.name = "kvantum"; - }; - - xdg.configFile."Kvantum/WhiteSur-Dark/WhiteSur-Dark.kvconfig".source = - "${pkgs.whitesur-kde}/share/Kvantum/WhiteSur/WhiteSurDark.kvconfig"; - xdg.configFile."Kvantum/WhiteSur-Dark/WhiteSur-Dark.svg".source = - "${pkgs.whitesur-kde}/share/Kvantum/WhiteSur/WhiteSurDark.svg"; - - xdg.configFile."Kvantum/kvantum.kvconfig".text = '' - [General] - theme=WhiteSur-Dark - ''; - - xdg.configFile."kdeglobals".text = '' - [General] - font=JetBrainsMono Nerd Font,11,-1,5,50,0,0,0,0,0 - fixed=JetBrainsMono Nerd Font,11,-1,5,50,0,0,0,0,0 - menuFont=JetBrainsMono Nerd Font,11,-1,5,50,0,0,0,0,0 - toolBarFont=JetBrainsMono Nerd Font,11,-1,5,50,0,0,0,0,0 - smallestReadableFont=JetBrainsMono Nerd Font,9,-1,5,50,0,0,0,0,0 - ''; - - xdg.mimeApps = { - enable = true; - defaultApplications = { - "inode/directory" = [ "org.kde.dolphin.desktop" ]; - "x-scheme-handler/http" = [ "zen-beta.desktop" ]; - "x-scheme-handler/https" = [ "zen-beta.desktop" ]; - "x-scheme-handler/about" = [ "zen-beta.desktop" ]; - "x-scheme-handler/unknown" = [ "zen-beta.desktop" ]; - }; - }; - services.easyeffects.enable = true; -} diff --git a/modules/home/niri.nix b/modules/home/niri.nix deleted file mode 100644 index 7190c77..0000000 --- a/modules/home/niri.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, inputs, ... }: - -{ - imports = [ ./niri/default.nix ]; - - programs.niri = { - enable = true; - }; -} diff --git a/modules/home/niri/default.nix b/modules/home/niri/default.nix deleted file mode 100644 index 3a38a52..0000000 --- a/modules/home/niri/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -{ - imports = [ - ./niri/env.nix - ./niri/execs.nix - ./niri/general.nix - ./niri/rules.nix - ./niri/keybinds.nix - ]; -} diff --git a/modules/home/niri/desktop-niri-env.ulu.nix b/modules/home/niri/desktop-niri-env.ulu.nix new file mode 100644 index 0000000..0ba483c --- /dev/null +++ b/modules/home/niri/desktop-niri-env.ulu.nix @@ -0,0 +1,21 @@ +{ ... }: +{ + flake.homeModules.desktop-niri-env = + { ... }: + { + programs.niri.settings = { + environment = { + DISPLAY = ":0"; + XCURSOR_SIZE = "24"; + TERMINAL = "ghostty"; + XCURSOR_THEME = "macOS"; + GDK_BACKEND = "wayland,x11"; + QT_QPA_PLATFORMTHEME = "kde"; + QT_QPA_PLATFORM = "wayland;xcb"; + MESA_GL_VERSION_OVERRIDE = "4.6"; + MESA_GLSL_VERSION_OVERRIDE = "460"; + ELECTRON_OZONE_PLATFORM_HINT = "auto"; + }; + }; + }; +} diff --git a/modules/home/niri/desktop-niri-execs.ulu.nix b/modules/home/niri/desktop-niri-execs.ulu.nix new file mode 100644 index 0000000..999bd8e --- /dev/null +++ b/modules/home/niri/desktop-niri-execs.ulu.nix @@ -0,0 +1,28 @@ +{ ... }: +{ + flake.homeModules.desktop-niri-execs = + { ... }: + { + programs.niri.settings = { + "prefer-no-csd" = true; + spawn-at-startup = [ + { command = [ "noctalia" ]; } + { command = [ "xwayland-satellite" ]; } + { + command = [ + "sh" + "-c" + "wl-paste --type text --watch cliphist store" + ]; + } + { + command = [ + "sh" + "-c" + "wl-paste --type image --watch cliphist store" + ]; + } + ]; + }; + }; +} diff --git a/modules/home/niri/desktop-niri-general.ulu.nix b/modules/home/niri/desktop-niri-general.ulu.nix new file mode 100644 index 0000000..12a0579 --- /dev/null +++ b/modules/home/niri/desktop-niri-general.ulu.nix @@ -0,0 +1,84 @@ +{ ... }: +{ + flake.homeModules.desktop-niri-general = + { ... }: + { + programs.niri.settings = { + input = { + keyboard = { + xkb = { + layout = "tr"; + }; + repeat-delay = 250; + repeat-rate = 35; + }; + mouse = { + accel-speed = 0.0; + accel-profile = "flat"; + }; + touchpad = { + tap = true; + natural-scroll = true; + scroll-factor = 0.5; + click-method = "clickfinger"; + }; + focus-follows-mouse = { + max-scroll-amount = "0%"; + }; + }; + + outputs = { + "LVDS-1" = { + position = { + x = 0; + y = 0; + }; + }; + "HDMI-A-1" = { + position = { + x = -277; + y = -1080; + }; + }; + }; + + animations = { + slowdown = 0.8; + }; + + layout = { + gaps = 5; + struts = { + left = -5; + right = -5; + top = -5; + bottom = -5; + }; + center-focused-column = "never"; + preset-column-widths = [ + { proportion = 0.33333; } + { proportion = 0.5; } + { proportion = 0.66667; } + ]; + default-column-width = { + proportion = 1.0; + }; + focus-ring = { + enable = false; + }; + border = { + enable = false; + }; + }; + + layer-rules = [ + { + matches = [ + { namespace = "^noctalia-backdrop"; } + ]; + place-within-backdrop = true; + } + ]; + }; + }; +} diff --git a/modules/home/niri/desktop-niri-home.ulu.nix b/modules/home/niri/desktop-niri-home.ulu.nix new file mode 100644 index 0000000..aba3e90 --- /dev/null +++ b/modules/home/niri/desktop-niri-home.ulu.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + flake.homeModules.desktop-niri-home = + { ... }: + { + programs.niri.enable = true; + }; +} diff --git a/modules/home/niri/desktop-niri-keybinds.ulu.nix b/modules/home/niri/desktop-niri-keybinds.ulu.nix new file mode 100644 index 0000000..38f81aa --- /dev/null +++ b/modules/home/niri/desktop-niri-keybinds.ulu.nix @@ -0,0 +1,168 @@ +{ ... }: +{ + flake.homeModules.desktop-niri-keybinds = + { ... }: + { + programs.niri.settings = { + binds = { + # --- Workspace Navigation --- + "Ctrl+Mod+Right".action.focus-column-right = [ ]; + "Ctrl+Mod+Left".action.focus-column-left = [ ]; + "Ctrl+Mod+Down".action.focus-workspace-down = [ ]; + "Ctrl+Mod+Up".action.focus-workspace-up = [ ]; + "Ctrl+Mod+Shift+Right".action.move-column-right = [ ]; + "Ctrl+Mod+Shift+Left".action.move-column-left = [ ]; + "Ctrl+Mod+Shift+Down".action.move-window-to-workspace-down = [ ]; + "Ctrl+Mod+Shift+Up".action.move-window-to-workspace-up = [ ]; + + "Ctrl+Mod+WheelScrollUp" = { + "cooldown-ms" = 150; + action.focus-column-right = [ ]; + }; + "Ctrl+Mod+WheelScrollDown" = { + "cooldown-ms" = 150; + action.focus-column-left = [ ]; + }; + + # --- Interface --- + "Mod+Space".action.spawn-sh = "noctalia msg panel-toggle launcher"; + "Mod+P".action.spawn-sh = "noctalia msg panel-toggle control-center"; + "Mod+Tab".action.toggle-overview = [ ]; + "Ctrl+Alt+Delete".action.spawn-sh = "noctalia msg panel-toggle session"; + + # --- Launchers --- + "Mod+Return".action.spawn = [ "ghostty" ]; + "Mod+W".action.spawn = [ "zen-beta" ]; + "Mod+E".action.spawn = [ "dolphin" ]; + "Mod+Z".action.spawn = [ "code" ]; + "Mod+Alt+V".action.spawn = [ "pavucontrol" ]; + "Mod+Shift+V".action.spawn-sh = "noctalia msg panel-toggle clipboard"; + "Mod+Shift+L".action.spawn-sh = "noctalia msg lock"; + "Mod+Shift+S".action.spawn-sh = "noctalia msg screenshot-region"; + "Ctrl+Shift+Escape".action.spawn = [ + "ghostty" + "-e" + "sudo" + "btop" + ]; + + # --- Window Management --- + "Mod+Q".action.close-window = [ ]; + "Mod+Alt+Space".action.toggle-window-floating = [ ]; + "Mod+F".action.fullscreen-window = [ ]; + "Mod+D".action.maximize-column = [ ]; + + # --- Focus --- + "Mod+Left".action.focus-column-left = [ ]; + "Mod+Right".action.focus-column-right = [ ]; + "Mod+Up".action.focus-window-up = [ ]; + "Mod+Down".action.focus-window-down = [ ]; + + # --- Move Windows --- + "Mod+Shift+Left".action.move-column-left = [ ]; + "Mod+Shift+Right".action.move-column-right = [ ]; + "Mod+Shift+Up".action.move-window-up = [ ]; + "Mod+Shift+Down".action.move-window-down = [ ]; + + # --- Workspaces by Number --- + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+0".action.focus-workspace = 10; + + "Mod+Shift+1".action.move-window-to-workspace = 1; + "Mod+Shift+2".action.move-window-to-workspace = 2; + "Mod+Shift+3".action.move-window-to-workspace = 3; + "Mod+Shift+4".action.move-window-to-workspace = 4; + "Mod+Shift+5".action.move-window-to-workspace = 5; + "Mod+Shift+6".action.move-window-to-workspace = 6; + "Mod+Shift+7".action.move-window-to-workspace = 7; + "Mod+Shift+8".action.move-window-to-workspace = 8; + "Mod+Shift+9".action.move-window-to-workspace = 9; + "Mod+Shift+0".action.move-window-to-workspace = 10; + + # --- Mouse Workspace Scroll --- + "Mod+WheelScrollDown" = { + "cooldown-ms" = 150; + action.focus-workspace-down = [ ]; + }; + "Mod+WheelScrollUp" = { + "cooldown-ms" = 150; + action.focus-workspace-up = [ ]; + }; + + # --- Media & Hardware Keys --- + "Mod+Shift+N".action.spawn = [ + "playerctl" + "next" + ]; + "Mod+Shift+B".action.spawn = [ + "playerctl" + "previous" + ]; + "Mod+Shift+P".action.spawn = [ + "playerctl" + "play-pause" + ]; + + "XF86AudioRaiseVolume" = { + "allow-when-locked" = true; + action.spawn-sh = "noctalia msg volume-up"; + }; + "XF86AudioLowerVolume" = { + "allow-when-locked" = true; + action.spawn-sh = "noctalia msg volume-down"; + }; + "XF86AudioMute" = { + "allow-when-locked" = true; + action.spawn-sh = "noctalia msg volume-mute"; + }; + "XF86AudioMicMute" = { + "allow-when-locked" = true; + action.spawn = [ + "wpctl" + "set-mute" + "@DEFAULT_SOURCE@" + "toggle" + ]; + }; + "XF86MonBrightnessUp".action.spawn-sh = "noctalia msg brightness-up"; + "XF86MonBrightnessDown".action.spawn-sh = "noctalia msg brightness-down"; + "XF86AudioNext" = { + "allow-when-locked" = true; + action.spawn = [ + "playerctl" + "next" + ]; + }; + "XF86AudioPrev" = { + "allow-when-locked" = true; + action.spawn = [ + "playerctl" + "previous" + ]; + }; + "XF86AudioPlay" = { + "allow-when-locked" = true; + action.spawn = [ + "playerctl" + "play-pause" + ]; + }; + "XF86AudioPause" = { + "allow-when-locked" = true; + action.spawn = [ + "playerctl" + "play-pause" + ]; + }; + }; + }; + }; +} diff --git a/modules/home/niri/desktop-niri-rules.ulu.nix b/modules/home/niri/desktop-niri-rules.ulu.nix new file mode 100644 index 0000000..87955e1 --- /dev/null +++ b/modules/home/niri/desktop-niri-rules.ulu.nix @@ -0,0 +1,62 @@ +{ ... }: +{ + flake.homeModules.desktop-niri-rules = + { ... }: + { + programs.niri.settings = { + window-rules = [ + { + matches = [ { title = "Open File.*"; } ]; + open-floating = true; + } + { + matches = [ { title = "Save As.*"; } ]; + open-floating = true; + } + { + matches = [ { title = "File Upload.*"; } ]; + open-floating = true; + } + { + matches = [ { "app-id" = "pavucontrol"; } ]; + open-floating = true; + default-column-width = { + fixed = 800; + }; + } + { + matches = [ { title = "(?i)picture.in.picture"; } ]; + open-floating = true; + } + { + matches = [ { "app-id" = "steam"; } ]; + open-floating = true; + } + { + matches = [ + { + "app-id" = "steam"; + title = "Steam"; + } + ]; + open-floating = false; + } + { + matches = [ + { + "app-id" = "steam"; + title = "^notificationtoasts_.*"; + } + ]; + open-floating = true; + open-focused = false; + default-floating-position = { + x = 20; + y = 20; + "relative-to" = "bottom-right"; + }; + } + ]; + }; + }; +} diff --git a/modules/home/niri/niri/env.nix b/modules/home/niri/niri/env.nix deleted file mode 100644 index 7fc65da..0000000 --- a/modules/home/niri/niri/env.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ ... }: - -{ - programs.niri.settings = { - environment = { - DISPLAY = ":0"; - XCURSOR_SIZE = "24"; - TERMINAL = "ghostty"; - XCURSOR_THEME = "macOS"; - GDK_BACKEND = "wayland,x11"; - QT_QPA_PLATFORMTHEME = "kde"; - QT_QPA_PLATFORM = "wayland;xcb"; - MESA_GL_VERSION_OVERRIDE = "4.6"; - MESA_GLSL_VERSION_OVERRIDE = "460"; - ELECTRON_OZONE_PLATFORM_HINT = "auto"; - }; - }; -} diff --git a/modules/home/niri/niri/execs.nix b/modules/home/niri/niri/execs.nix deleted file mode 100644 index 32f88f3..0000000 --- a/modules/home/niri/niri/execs.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: - -{ - programs.niri.settings = { - "prefer-no-csd" = true; - spawn-at-startup = [ - { command = [ "noctalia" ]; } - { command = [ "xwayland-satellite" ]; } - { command = [ "sh" "-c" "wl-paste --type text --watch cliphist store" ]; } - { command = [ "sh" "-c" "wl-paste --type image --watch cliphist store" ]; } - ]; - }; -} \ No newline at end of file diff --git a/modules/home/niri/niri/general.nix b/modules/home/niri/niri/general.nix deleted file mode 100644 index 0a4d096..0000000 --- a/modules/home/niri/niri/general.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ ... }: - -{ - programs.niri.settings = { - input = { - keyboard = { - xkb = { - layout = "tr"; - }; - repeat-delay = 250; - repeat-rate = 35; - }; - mouse = { - accel-speed = 0.0; - accel-profile = "flat"; - }; - touchpad = { - tap = true; - natural-scroll = true; - scroll-factor = 0.5; - click-method = "clickfinger"; - }; - focus-follows-mouse = { - max-scroll-amount = "0%"; - }; - }; - - outputs = { - "LVDS-1" = { - position = { - x = 0; - y = 0; - }; - }; - "HDMI-A-1" = { - position = { - x = -277; - y = -1080; - }; - }; - }; - - animations = { - slowdown = 0.8; - }; - - layout = { - gaps = 5; - struts = { - left = -5; - right = -5; - top = -5; - bottom = -5; - }; - center-focused-column = "never"; - preset-column-widths = [ - { proportion = 0.33333; } - { proportion = 0.5; } - { proportion = 0.66667; } - ]; - default-column-width = { - proportion = 1.0; - }; - focus-ring = { - enable = false; - }; - border = { - enable = false; - }; - }; - - layer-rules = [ - { - matches = [ - { namespace = "^noctalia-backdrop"; } - ]; - place-within-backdrop = true; - } - ]; - }; -} diff --git a/modules/home/niri/niri/keybinds.nix b/modules/home/niri/niri/keybinds.nix deleted file mode 100644 index 435ca08..0000000 --- a/modules/home/niri/niri/keybinds.nix +++ /dev/null @@ -1,165 +0,0 @@ -{ ... }: - -{ - programs.niri.settings = { - binds = { - # --- Workspace Navigation --- - "Ctrl+Mod+Right".action.focus-column-right = [ ]; - "Ctrl+Mod+Left".action.focus-column-left = [ ]; - "Ctrl+Mod+Down".action.focus-workspace-down = [ ]; - "Ctrl+Mod+Up".action.focus-workspace-up = [ ]; - "Ctrl+Mod+Shift+Right".action.move-column-right = [ ]; - "Ctrl+Mod+Shift+Left".action.move-column-left = [ ]; - "Ctrl+Mod+Shift+Down".action.move-window-to-workspace-down = [ ]; - "Ctrl+Mod+Shift+Up".action.move-window-to-workspace-up = [ ]; - - "Ctrl+Mod+WheelScrollUp" = { - "cooldown-ms" = 150; - action.focus-column-right = [ ]; - }; - "Ctrl+Mod+WheelScrollDown" = { - "cooldown-ms" = 150; - action.focus-column-left = [ ]; - }; - - # --- Interface --- - "Mod+Space".action.spawn-sh = "noctalia msg panel-toggle launcher"; - "Mod+P".action.spawn-sh = "noctalia msg panel-toggle control-center"; - "Mod+Tab".action.toggle-overview = [ ]; - "Ctrl+Alt+Delete".action.spawn-sh = "noctalia msg panel-toggle session"; - - # --- Launchers --- - "Mod+Return".action.spawn = [ "ghostty" ]; - "Mod+W".action.spawn = [ "zen-beta" ]; - "Mod+E".action.spawn = [ "dolphin" ]; - "Mod+Z".action.spawn = [ "code" ]; - "Mod+Alt+V".action.spawn = [ "pavucontrol" ]; - "Mod+Shift+V".action.spawn-sh = "noctalia msg panel-toggle clipboard"; - "Mod+Shift+L".action.spawn-sh = "noctalia msg lock"; - "Mod+Shift+S".action.spawn-sh = "noctalia msg screenshot-region"; - "Ctrl+Shift+Escape".action.spawn = [ - "ghostty" - "-e" - "sudo" - "btop" - ]; - - # --- Window Management --- - "Mod+Q".action.close-window = [ ]; - "Mod+Alt+Space".action.toggle-window-floating = [ ]; - "Mod+F".action.fullscreen-window = [ ]; - "Mod+D".action.maximize-column = [ ]; - - # --- Focus --- - "Mod+Left".action.focus-column-left = [ ]; - "Mod+Right".action.focus-column-right = [ ]; - "Mod+Up".action.focus-window-up = [ ]; - "Mod+Down".action.focus-window-down = [ ]; - - # --- Move Windows --- - "Mod+Shift+Left".action.move-column-left = [ ]; - "Mod+Shift+Right".action.move-column-right = [ ]; - "Mod+Shift+Up".action.move-window-up = [ ]; - "Mod+Shift+Down".action.move-window-down = [ ]; - - # --- Workspaces by Number --- - "Mod+1".action.focus-workspace = 1; - "Mod+2".action.focus-workspace = 2; - "Mod+3".action.focus-workspace = 3; - "Mod+4".action.focus-workspace = 4; - "Mod+5".action.focus-workspace = 5; - "Mod+6".action.focus-workspace = 6; - "Mod+7".action.focus-workspace = 7; - "Mod+8".action.focus-workspace = 8; - "Mod+9".action.focus-workspace = 9; - "Mod+0".action.focus-workspace = 10; - - "Mod+Shift+1".action.move-window-to-workspace = 1; - "Mod+Shift+2".action.move-window-to-workspace = 2; - "Mod+Shift+3".action.move-window-to-workspace = 3; - "Mod+Shift+4".action.move-window-to-workspace = 4; - "Mod+Shift+5".action.move-window-to-workspace = 5; - "Mod+Shift+6".action.move-window-to-workspace = 6; - "Mod+Shift+7".action.move-window-to-workspace = 7; - "Mod+Shift+8".action.move-window-to-workspace = 8; - "Mod+Shift+9".action.move-window-to-workspace = 9; - "Mod+Shift+0".action.move-window-to-workspace = 10; - - # --- Mouse Workspace Scroll --- - "Mod+WheelScrollDown" = { - "cooldown-ms" = 150; - action.focus-workspace-down = [ ]; - }; - "Mod+WheelScrollUp" = { - "cooldown-ms" = 150; - action.focus-workspace-up = [ ]; - }; - - # --- Media & Hardware Keys --- - "Mod+Shift+N".action.spawn = [ - "playerctl" - "next" - ]; - "Mod+Shift+B".action.spawn = [ - "playerctl" - "previous" - ]; - "Mod+Shift+P".action.spawn = [ - "playerctl" - "play-pause" - ]; - - "XF86AudioRaiseVolume" = { - "allow-when-locked" = true; - action.spawn-sh = "noctalia msg volume-up"; - }; - "XF86AudioLowerVolume" = { - "allow-when-locked" = true; - action.spawn-sh = "noctalia msg volume-down"; - }; - "XF86AudioMute" = { - "allow-when-locked" = true; - action.spawn-sh = "noctalia msg volume-mute"; - }; - "XF86AudioMicMute" = { - "allow-when-locked" = true; - action.spawn = [ - "wpctl" - "set-mute" - "@DEFAULT_SOURCE@" - "toggle" - ]; - }; - "XF86MonBrightnessUp".action.spawn-sh = "noctalia msg brightness-up"; - "XF86MonBrightnessDown".action.spawn-sh = "noctalia msg brightness-down"; - "XF86AudioNext" = { - "allow-when-locked" = true; - action.spawn = [ - "playerctl" - "next" - ]; - }; - "XF86AudioPrev" = { - "allow-when-locked" = true; - action.spawn = [ - "playerctl" - "previous" - ]; - }; - "XF86AudioPlay" = { - "allow-when-locked" = true; - action.spawn = [ - "playerctl" - "play-pause" - ]; - }; - "XF86AudioPause" = { - "allow-when-locked" = true; - action.spawn = [ - "playerctl" - "play-pause" - ]; - }; - }; - }; -} diff --git a/modules/home/niri/niri/rules.nix b/modules/home/niri/niri/rules.nix deleted file mode 100644 index 43fd790..0000000 --- a/modules/home/niri/niri/rules.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ ... }: - -{ - programs.niri.settings = { - window-rules = [ - { - matches = [ { title = "Open File.*"; } ]; - open-floating = true; - } - { - matches = [ { title = "Save As.*"; } ]; - open-floating = true; - } - { - matches = [ { title = "File Upload.*"; } ]; - open-floating = true; - } - { - matches = [ { "app-id" = "pavucontrol"; } ]; - open-floating = true; - default-column-width = { fixed = 800; }; - } - { - matches = [ { title = "(?i)picture.in.picture"; } ]; - open-floating = true; - } - { - matches = [ { "app-id" = "steam"; } ]; - open-floating = true; - } - { - matches = [ { "app-id" = "steam"; title = "Steam"; } ]; - open-floating = false; - } - { - matches = [ { "app-id" = "steam"; title = "^notificationtoasts_.*"; } ]; - open-floating = true; - open-focused = false; - default-floating-position = { - x = 20; - y = 20; - "relative-to" = "bottom-right"; - }; - } - ]; - }; -} \ No newline at end of file diff --git a/modules/home/programs/default.nix b/modules/home/programs/default.nix deleted file mode 100644 index ff25e83..0000000 --- a/modules/home/programs/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ - ./ghostty - ./shell - ]; -} diff --git a/modules/home/programs/discord/default.nix b/modules/home/programs/discord/default.nix deleted file mode 100644 index c1f1701..0000000 --- a/modules/home/programs/discord/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ inputs, ... }: - -{ - imports = [ - inputs.nixcord.homeModules.nixcord - ]; - - programs.nixcord = { - enable = true; - legcord = { - enable = true; - settings = { - channel = "stable"; - tray = "dynamic"; - minimizeToTray = true; - mods = [ "shelter" ]; - doneSetup = true; - }; - }; - }; -} diff --git a/modules/home/programs/ghostty/default.nix b/modules/home/programs/ghostty/default.nix deleted file mode 100644 index 67260dc..0000000 --- a/modules/home/programs/ghostty/default.nix +++ /dev/null @@ -1,124 +0,0 @@ -{ pkgs, lib, ... }: - -let - isDarwin = pkgs.stdenv.isDarwin; - - linuxKeybinds = [ - "alt+r=reload_config" - "alt+q=close_surface" - - "ctrl+space=new_tab" - "ctrl+page_down=next_tab" - "ctrl+page_up=previous_tab" - "alt+comma=move_tab:-1" - "alt+period=move_tab:1" - - "alt+1=goto_tab:1" - "alt+2=goto_tab:2" - "alt+3=goto_tab:3" - "alt+4=goto_tab:4" - "alt+5=goto_tab:5" - "alt+6=goto_tab:6" - "alt+7=goto_tab:7" - "alt+8=goto_tab:8" - "alt+9=goto_tab:9" - - "ctrl+shift+backslash=new_split:right" - "ctrl+shift+minus=new_split:down" - - "alt+h=goto_split:left" - "alt+j=goto_split:bottom" - "alt+k=goto_split:top" - "alt+l=goto_split:right" - - "ctrl+shift+z=toggle_split_zoom" - "ctrl+shift+e=equalize_splits" - ]; - - darwinKeybinds = [ - "cmd+s>r=reload_config" - "cmd+s>x=close_surface" - "cmd+s>n=new_window" - - "cmd+s>c=new_tab" - "cmd+s>shift+l=next_tab" - "cmd+s>shift+h=previous_tab" - "cmd+s>comma=move_tab:-1" - "cmd+s>period=move_tab:1" - - "cmd+s>1=goto_tab:1" - "cmd+s>2=goto_tab:2" - "cmd+s>3=goto_tab:3" - "cmd+s>4=goto_tab:4" - "cmd+s>5=goto_tab:5" - "cmd+s>6=goto_tab:6" - "cmd+s>7=goto_tab:7" - "cmd+s>8=goto_tab:8" - "cmd+s>9=goto_tab:9" - - "cmd+s>\\=new_split:right" - "cmd+s>-=new_split:down" - "cmd+s>h=goto_split:left" - "cmd+s>j=goto_split:bottom" - "cmd+s>k=goto_split:top" - "cmd+s>l=goto_split:right" - "cmd+s>z=toggle_split_zoom" - "cmd+s>e=equalize_splits" - ]; -in -{ - programs.ghostty = { - enable = true; - installBatSyntax = true; - enableZshIntegration = true; - - settings = { - font-family = "JetBrainsMono Nerd Font"; - font-size = 11; - - window-padding-x = 10; - window-padding-y = 10; - window-padding-balance = true; - window-save-state = "always"; - - mouse-hide-while-typing = true; - mouse-scroll-multiplier = 2; - shell-integration-features = "no-cursor,sudo,no-title"; - - palette = [ - "0=#090E13" - "1=#c4746e" - "2=#8a9a7b" - "3=#c4b28a" - "4=#8ba4b0" - "5=#a292a3" - "6=#8ea4a2" - "7=#a4a7a4" - "8=#5C6066" - "9=#e46876" - "10=#87a987" - "11=#e6c384" - "12=#7fb4ca" - "13=#938aa9" - "14=#7aa89f" - "15=#c5c9c7" - ]; - - background = "#090E13"; - foreground = "#c5c9c7"; - cursor-color = "#c5c9c7"; - cursor-text = "#9cdef2"; - selection-background = "#22262D"; - selection-foreground = "#c5c9c7"; - cursor-style = "block"; - cursor-style-blink = true; - adjust-cell-height = "35%"; - background-opacity = 0.96; - - keybind = linuxKeybinds ++ lib.optionals isDarwin darwinKeybinds; - } - // lib.optionalAttrs isDarwin { - macos-titlebar-style = "transparent"; - }; - }; -} diff --git a/modules/home/programs/shell/default.nix b/modules/home/programs/shell/default.nix deleted file mode 100644 index da6b940..0000000 --- a/modules/home/programs/shell/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./nu.nix - ]; -} diff --git a/modules/home/programs/shell/nu.nix b/modules/home/programs/shell/nu.nix deleted file mode 100644 index f64efa8..0000000 --- a/modules/home/programs/shell/nu.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ ... }: - -{ - programs.nushell = { - enable = true; - - shellAliases = { - ls = "eza --icons --group-directories-first"; - ll = "eza -lah --icons --group-directories-first"; - la = "eza -a --icons --group-directories-first"; - lt = "eza --tree --level=2 --icons"; - cat = "bat"; - df = "df -h"; - du = "du -h"; - free = "free -h"; - rm = "trash-put"; - sysinfo = "fastfetch"; - monitor = "sudo btop"; - ports = "sudo ss -tulpn"; - myip = "curl ifconfig.me"; - gs = "git status"; - ga = "git add"; - gp = "git push"; - gl = "git log --oneline --graph --decorate"; - ".." = "cd .."; - "..." = "cd ../.."; - "...." = "cd ../../.."; - }; - - environmentVariables = { - MESA_SHADER_CACHE_MAX_SIZE = "2G"; - MESA_SHADER_CACHE_DIR = "/tmp/mesa_shader_cache"; - }; - - extraEnv = '' - $env.PATH = ($env.PATH | prepend $"($env.HOME)/.local/bin") - ''; - - extraConfig = '' - $env.config.show_banner = false - def gc [msg: string] { git commit -m $msg } - def rebuild [] { - git -C ~/copland add -A - git -C ~/copland commit -m "update" - nh os switch - } - - def rebuild-dry [] { nh os switch --dry } - def rebuild-cop [] { - nix flake update --flake ~/copland - git -C ~/copland add -A - git -C ~/copland commit -m $"flake update (date now | format date '%Y-%m-%d')" - nh os switch - } - def extract [file: string] { - let ext = ($file | path parse | get extension) - match $ext { - "gz" => { tar xzf $file }, - "bz2" => { tar xjf $file }, - "tar" => { tar xf $file }, - "zip" => { unzip $file }, - "7z" => { 7z x $file }, - "rar" => { unrar e $file }, - _ => { print $"'($file)' can't be extracted" } - } - } - ''; - }; -} diff --git a/modules/nixos/boot/default.nix b/modules/nixos/boot/default.nix deleted file mode 100755 index 1640110..0000000 --- a/modules/nixos/boot/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - pkgs, - lib, - inputs, - ... -}: - -{ - imports = [ ]; - environment.systemPackages = [ pkgs.efibootmgr ]; - - nixpkgs.overlays = [ inputs.nix-cachyos-kernel.overlays.pinned ]; - boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-bore-lto; - - boot.kernelParams = [ - "mitigations=off" - "nmi_watchdog=1" - "transparent_hugepage=madvise" - ]; - - boot.kernelModules = [ - "tcp_bbr" - "sch_fq" - ]; - - boot.kernel.sysctl = { - "net.core.default_qdisc" = "fq"; - "net.ipv4.tcp_congestion_control" = "bbr"; - "kernel.softlockup_panic" = 1; - "kernel.hardlockup_panic" = 1; - "kernel.hung_task_panic" = 1; - "kernel.panic" = 50; - }; - - boot.loader = { - timeout = 5; - efi = { - canTouchEfiVariables = false; - efiSysMountPoint = "/boot"; - }; - - systemd-boot = { - enable = true; - configurationLimit = 5; - }; - }; -} diff --git a/modules/nixos/common/common-boot.ulu.nix b/modules/nixos/common/common-boot.ulu.nix new file mode 100644 index 0000000..f634a00 --- /dev/null +++ b/modules/nixos/common/common-boot.ulu.nix @@ -0,0 +1,48 @@ +{ ... }: +{ + flake.nixosModules.common-boot = + { + pkgs, + inputs, + ... + }: + { + environment.systemPackages = [ pkgs.efibootmgr ]; + + nixpkgs.overlays = [ inputs.nix-cachyos-kernel.overlays.pinned ]; + boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-bore-lto; + + boot.kernelParams = [ + "mitigations=off" + "nmi_watchdog=1" + "transparent_hugepage=madvise" + ]; + + boot.kernelModules = [ + "tcp_bbr" + "sch_fq" + ]; + + boot.kernel.sysctl = { + "net.core.default_qdisc" = "fq"; + "net.ipv4.tcp_congestion_control" = "bbr"; + "kernel.softlockup_panic" = 1; + "kernel.hardlockup_panic" = 1; + "kernel.hung_task_panic" = 1; + "kernel.panic" = 50; + }; + + boot.loader = { + timeout = 5; + efi = { + canTouchEfiVariables = false; + efiSysMountPoint = "/boot"; + }; + + systemd-boot = { + enable = true; + configurationLimit = 5; + }; + }; + }; +} diff --git a/modules/nixos/common/common-fonts.ulu.nix b/modules/nixos/common/common-fonts.ulu.nix new file mode 100644 index 0000000..33ba76d --- /dev/null +++ b/modules/nixos/common/common-fonts.ulu.nix @@ -0,0 +1,58 @@ +{ ... }: +{ + flake.nixosModules.common-fonts = + { pkgs, ... }: + { + fonts = { + packages = with pkgs; [ + nerd-fonts.jetbrains-mono + nerd-fonts.caskaydia-cove + noto-fonts-color-emoji + noto-fonts-cjk-serif + noto-fonts-cjk-sans + nerd-fonts.hurmit + noto-fonts + ipaexfont + ]; + + fontconfig = { + enable = true; + antialias = true; + + hinting = { + enable = true; + style = "slight"; + autohint = false; + }; + + subpixel = { + rgba = "rgb"; + lcdfilter = "default"; + }; + + defaultFonts = { + serif = [ + "JetBrainsMono Nerd Font" + "Noto Serif CJK JP" + "Noto Serif" + "IPAexMincho" + ]; + sansSerif = [ + "JetBrainsMono Nerd Font" + "Noto Sans CJK JP" + "Noto Sans" + "IPAexGothic" + ]; + monospace = [ + "JetBrainsMono Nerd Font Mono" + "JetBrainsMono Nerd Font" + "Noto Sans Mono CJK JP" + "Noto Sans CJK JP" + "IPAexGothic" + ]; + emoji = [ "Noto Color Emoji" ]; + }; + }; + }; + }; +} diff --git a/modules/nixos/common/common-git.ulu.nix b/modules/nixos/common/common-git.ulu.nix new file mode 100644 index 0000000..0e4950d --- /dev/null +++ b/modules/nixos/common/common-git.ulu.nix @@ -0,0 +1,27 @@ +{ ... }: +{ + commonModules.common-git = + { pkgs, lib, ... }: + let + base = '' + [user] + name = elwrcl + email = elwerici@proton.me + signingkey = 5EA48F7312A42B84 + [commit] + gpgsign = true + [tag] + gpgsign = true + ''; + + darwinExtra = '' + [credential] + helper = osxkeychain + ''; + + gitconfig = pkgs.writeText "gitconfig" (base + lib.optionalString pkgs.stdenv.isDarwin darwinExtra); + in + { + environment.variables.GIT_CONFIG_SYSTEM = "${gitconfig}"; + }; +} diff --git a/modules/nixos/common/common-kmscon.ulu.nix b/modules/nixos/common/common-kmscon.ulu.nix new file mode 100644 index 0000000..7c22ef3 --- /dev/null +++ b/modules/nixos/common/common-kmscon.ulu.nix @@ -0,0 +1,19 @@ +{ ... }: +{ + flake.nixosModules.common-kmscon = + { pkgs, ... }: + { + fonts.packages = [ + pkgs.nerd-fonts.jetbrains-mono + ]; + + services.kmscon = { + enable = true; + config = { + font-name = "JetBrainsMono Nerd Font"; + font-size = 18; + hwaccel = true; + }; + }; + }; +} diff --git a/modules/nixos/common/common-locale.ulu.nix b/modules/nixos/common/common-locale.ulu.nix new file mode 100644 index 0000000..a3cef52 --- /dev/null +++ b/modules/nixos/common/common-locale.ulu.nix @@ -0,0 +1,41 @@ +{ ... }: +{ + flake.nixosModules.common-locale = + { ... }: + { + time.timeZone = "Europe/Istanbul"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "tr_TR.UTF-8"; + LC_IDENTIFICATION = "tr_TR.UTF-8"; + LC_MEASUREMENT = "tr_TR.UTF-8"; + LC_MONETARY = "tr_TR.UTF-8"; + LC_NAME = "tr_TR.UTF-8"; + LC_NUMERIC = "tr_TR.UTF-8"; + LC_PAPER = "tr_TR.UTF-8"; + LC_TELEPHONE = "tr_TR.UTF-8"; + LC_TIME = "tr_TR.UTF-8"; + }; + services.timesyncd.enable = false; + + services.chrony = { + enable = true; + extraConfig = '' + makestep 1.0 -1 + server 162.159.200.1 iburst + server 216.239.35.0 iburst + server time.cloudflare.com iburst + server time.google.com iburst + ''; + }; + + systemd.services.chronyd = { + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + }; + console.font = "LatArCyrHeb-16"; + system.stateVersion = "25.05"; + console.keyMap = "trq"; + console.earlySetup = true; + }; +} diff --git a/modules/nixos/common/common-nix.ulu.nix b/modules/nixos/common/common-nix.ulu.nix new file mode 100644 index 0000000..3038a68 --- /dev/null +++ b/modules/nixos/common/common-nix.ulu.nix @@ -0,0 +1,44 @@ +{ ... }: +{ + flake.nixosModules.common-nix = + { ... }: + { + nix.settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + + max-jobs = 4; + cores = 4; + + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + "https://ezkea.cachix.org" + "https://noctalia.cachix.org" + "https://hyprland.cachix.org" + "https://attic.xuyh0120.win/lantian" + "https://soryu-kernel.cachix.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI=" + "noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc=" + "soryu-kernel.cachix.org-1:2/Tm90ibGjLQWo/uX4qo/kbFB5yjQG/CzfE1oelHdWw=" + ]; + }; + + documentation = { + man.enable = true; + doc.enable = false; + info.enable = false; + nixos.enable = false; + }; + + programs.nix-ld.enable = true; + }; +} diff --git a/modules/nixos/common/common-packages.ulu.nix b/modules/nixos/common/common-packages.ulu.nix new file mode 100644 index 0000000..9bd2476 --- /dev/null +++ b/modules/nixos/common/common-packages.ulu.nix @@ -0,0 +1,206 @@ +{ ... }: +{ + flake.nixosModules.common-packages = + { + pkgs, + inputs, + system, + ... + }: + let + uxplay-fixed = pkgs.uxplay.override { + avahi = pkgs.avahi.override { withLibdnssdCompat = true; }; + }; + in + { + environment.systemPackages = with pkgs; [ + # apps + onlyoffice-desktopeditors + whatsapp-electron + telegram-desktop + prismlauncher + moonlight-qt + qbittorrent + antigravity + obs-studio + localsend + picotool + sunshine + spotify + equibop + heroic + loupe + gimp + wine + + # file-manager + kdePackages.kdegraphics-thumbnailers + kdePackages.plasma-integration + kdePackages.breeze-icons + kdePackages.kio-extras + kdePackages.qtwayland + kdePackages.kio-admin + kdePackages.kio-fuse + kdePackages.kservice + kdePackages.konsole + kdePackages.dolphin + kdePackages.qtsvg + kdePackages.ark + kdePackages.kio + kdePackages.kdf + nautilus + + # utils + poppler-utils + wl-clipboard + wf-recorder + tesseract + mpvpaper + swappy + slurp + grim + + # phone + libimobiledevice + android-tools + uxplay-fixed + usbmuxd + libmtp + jmtpfs + scrcpy + ifuse + + # agents + github-copilot-cli + claude-mergetool + claude-monitor + claude-code + + # cli + fastfetch + trash-cli + lazyjj + jj-fzf + meld + jujutsu + tailscale + dos2unix + autossh + ani-cli + zoxide + cachix + direnv + rsync + unzip + kitty + tree + tldr + perf + file + wget + fish + htop + tmux + btop + yazi + zip + eza + bat + git + rar + jq + fd + + # hardware + xkeyboard-config + intel-gpu-tools + smartmontools + brightnessctl + gsmartcontrol + vulkan-tools + libva-utils + mesa-demos + lm_sensors + exfatprogs + dmidecode + libsecret + apfs-fuse + gptfdisk + pciutils + usbutils + hfsprogs + dmg2img + ddcutil + clinfo + hidapi + parted + p7zip + xar + + # themes/icons + whitesur-icon-theme + whitesur-gtk-theme + gnome-themes-extra + whitesur-kde + adwaita-qt6 + adwaita-qt + + # langs + alejandra + binutils + python3 + rustup + nodejs + jdk25 + gcc + ghc + zig + lua + glm + go + + # dev tools + jdt-language-server + rust-analyzer + clang-tools + cargo-tauri + pkg-config + gnumake + openssl + pyright + rustfmt + lazygit + nixfmt + zellij + sqlite + aubio + delta + trunk + nixd + nil + uv + + # editors + lite-xl + neovim + vscode + + # media + ffmpegthumbnailer + imagemagick + pavucontrol + pamixer + ffmpeg + yt-dlp + cava + mpv + + inputs.zen-browser.packages.${system}.default + inputs.nix-alien.packages.${system}.nix-alien + inputs.noctalia.packages.${system}.default + inputs.copetch.packages.${system}.default + inputs.helium.packages.${system}.default + pkgs.qt6Packages.qtwebsockets + ]; + }; +} diff --git a/modules/nixos/common/common-users.ulu.nix b/modules/nixos/common/common-users.ulu.nix new file mode 100644 index 0000000..4e662dd --- /dev/null +++ b/modules/nixos/common/common-users.ulu.nix @@ -0,0 +1,39 @@ +{ ... }: +{ + flake.nixosModules.common-users = + { pkgs, ... }: + { + users.users.elars = { + isNormalUser = true; + linger = true; + description = "elars"; + extraGroups = [ + "networkmanager" + "libvirtd" + "scanner" + "plugdev" + "docker" + "video" + "input" + "audio" + "wheel" + "lp" + ]; + shell = pkgs.zsh; + }; + + programs.nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 4d --keep 3"; + flake = "/home/elars/copland"; + }; + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestions.enable = true; + syntaxHighlighting.enable = true; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix deleted file mode 100755 index 95fcd03..0000000 --- a/modules/nixos/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: -{ - imports = [ - ../home/git.nix - ./boot - ./desktop - ./gaming - ./hardware - ./networking - ./services - ./system - ./users - ./virtualization - ]; -} diff --git a/modules/nixos/desktop/audio/default.nix b/modules/nixos/desktop/audio/default.nix deleted file mode 100755 index 7f67bff..0000000 --- a/modules/nixos/desktop/audio/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./pipewire.nix - ]; -} diff --git a/modules/nixos/desktop/audio/pipewire.nix b/modules/nixos/desktop/audio/pipewire.nix deleted file mode 100755 index 91993f1..0000000 --- a/modules/nixos/desktop/audio/pipewire.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ ... }: - -{ - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - wireplumber.enable = true; - extraConfig.pipewire."10-realtime" = { - "context.modules" = [ - { - name = "libpipewire-module-rt"; - args = { - "nice.level" = -15; - "rt.prio" = 88; - "rt.time.soft" = 200000; - "rt.time.hard" = 400000; - }; - flags = [ - "ifexists" - "nofail" - ]; - } - ]; - }; - extraConfig.pipewire."92-quantum" = { - "context.properties" = { - "default.clock.rate" = 48000; - "default.clock.allowed-rates" = [ 48000 ]; - "default.clock.quantum" = 1024; - "default.clock.min-quantum" = 1024; - "default.clock.max-quantum" = 1024; - }; - }; - }; -} diff --git a/modules/nixos/desktop/default.nix b/modules/nixos/desktop/default.nix deleted file mode 100755 index ac71913..0000000 --- a/modules/nixos/desktop/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - ./display - ./window-managers - ./audio - ]; - - xdg = { - mime = { - enable = true; - - defaultApplications = { - # gui - "text/html" = "zen-beta.desktop"; - "x-scheme-handler/http" = "zen-beta.desktop"; - "x-scheme-handler/https" = "zen-beta.desktop"; - "x-scheme-handler/about" = "zen-beta.desktop"; - "x-scheme-handler/unknown" = "zen-beta.desktop"; - "x-scheme-handler/steam" = "steam.desktop"; - - # media - "image/png" = "org.gnome.Loupe.desktop"; - "image/jpeg" = "org.gnome.Loupe.desktop"; - "image/gif" = "org.gnome.Loupe.desktop"; - "image/bmp" = "org.gnome.Loupe.desktop"; - "image/svg+xml" = "org.gnome.Loupe.desktop"; - "image/webp" = "org.gnome.Loupe.desktop"; - "image/tiff" = "org.gnome.Loupe.desktop"; - "video/mp4" = "mpv.desktop"; - "video/x-matroska" = "mpv.desktop"; - "video/webm" = "mpv.desktop"; - "video/avi" = "mpv.desktop"; - "video/quicktime" = "mpv.desktop"; - "audio/mpeg" = "mpv.desktop"; - "audio/flac" = "mpv.desktop"; - "audio/ogg" = "mpv.desktop"; - - # text - "text/plain" = "code.desktop"; - "text/x-rust" = "code.desktop"; - "text/x-nix" = "code.desktop"; - "text/x-csrc" = "code.desktop"; - "text/x-chdr" = "code.desktop"; - "text/x-python" = "code.desktop"; - "text/x-shellscript" = "code.desktop"; - "application/json" = "code.desktop"; - "application/x-shellscript" = "code.desktop"; - }; - }; - - menus.enable = true; - }; - - environment.etc."xdg/menus/applications.menu".text = - builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu"; -} diff --git a/modules/nixos/desktop/desktop-audio.ulu.nix b/modules/nixos/desktop/desktop-audio.ulu.nix new file mode 100644 index 0000000..d957a33 --- /dev/null +++ b/modules/nixos/desktop/desktop-audio.ulu.nix @@ -0,0 +1,42 @@ +{ ... }: +{ + flake.nixosModules.desktop-audio = + { ... }: + { + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + extraConfig.pipewire."10-realtime" = { + "context.modules" = [ + { + name = "libpipewire-module-rt"; + args = { + "nice.level" = -15; + "rt.prio" = 88; + "rt.time.soft" = 200000; + "rt.time.hard" = 400000; + }; + flags = [ + "ifexists" + "nofail" + ]; + } + ]; + }; + extraConfig.pipewire."92-quantum" = { + "context.properties" = { + "default.clock.rate" = 48000; + "default.clock.allowed-rates" = [ 48000 ]; + "default.clock.quantum" = 1024; + "default.clock.min-quantum" = 1024; + "default.clock.max-quantum" = 1024; + }; + }; + }; + }; +} diff --git a/modules/nixos/desktop/desktop-display.ulu.nix b/modules/nixos/desktop/desktop-display.ulu.nix new file mode 100644 index 0000000..3374f8a --- /dev/null +++ b/modules/nixos/desktop/desktop-display.ulu.nix @@ -0,0 +1,32 @@ +{ ... }: +{ + flake.nixosModules.desktop-display = + { ... }: + { + services.xserver.enable = true; + services.displayManager.ly = { + enable = true; + settings = { + animation = "colormix"; + colormix_col1 = "0x00FFFFFF"; + colormix_col2 = "0x00808080"; + colormix_col3 = "0x00080808"; + bigclock = "en"; + bigclock_12hr = false; + fg = "0x00FFFFFF"; + bg = "0x00000000"; + border_fg = "0x00FFFFFF"; + error_fg = "0x01FF0000"; + blank_box = true; + hide_borders = false; + margin_box_h = 2; + margin_box_v = 1; + }; + }; + + services.xserver.xkb = { + layout = "tr"; + variant = ""; + }; + }; +} diff --git a/modules/nixos/desktop/desktop-niri.ulu.nix b/modules/nixos/desktop/desktop-niri.ulu.nix new file mode 100644 index 0000000..f8000a0 --- /dev/null +++ b/modules/nixos/desktop/desktop-niri.ulu.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + flake.nixosModules.desktop-niri = + { pkgs, ... }: + { + programs.niri.enable = true; + + environment.systemPackages = with pkgs; [ + xwayland-satellite + ]; + }; +} diff --git a/modules/nixos/desktop/desktop-xdg-mime.ulu.nix b/modules/nixos/desktop/desktop-xdg-mime.ulu.nix new file mode 100644 index 0000000..255dbef --- /dev/null +++ b/modules/nixos/desktop/desktop-xdg-mime.ulu.nix @@ -0,0 +1,55 @@ +{ ... }: +{ + flake.nixosModules.desktop-xdg-mime = + { pkgs, ... }: + { + xdg = { + mime = { + enable = true; + + defaultApplications = { + # gui + "text/html" = "zen-beta.desktop"; + "x-scheme-handler/http" = "zen-beta.desktop"; + "x-scheme-handler/https" = "zen-beta.desktop"; + "x-scheme-handler/about" = "zen-beta.desktop"; + "x-scheme-handler/unknown" = "zen-beta.desktop"; + "x-scheme-handler/steam" = "steam.desktop"; + + # media + "image/png" = "org.gnome.Loupe.desktop"; + "image/jpeg" = "org.gnome.Loupe.desktop"; + "image/gif" = "org.gnome.Loupe.desktop"; + "image/bmp" = "org.gnome.Loupe.desktop"; + "image/svg+xml" = "org.gnome.Loupe.desktop"; + "image/webp" = "org.gnome.Loupe.desktop"; + "image/tiff" = "org.gnome.Loupe.desktop"; + "video/mp4" = "mpv.desktop"; + "video/x-matroska" = "mpv.desktop"; + "video/webm" = "mpv.desktop"; + "video/avi" = "mpv.desktop"; + "video/quicktime" = "mpv.desktop"; + "audio/mpeg" = "mpv.desktop"; + "audio/flac" = "mpv.desktop"; + "audio/ogg" = "mpv.desktop"; + + # text + "text/plain" = "code.desktop"; + "text/x-rust" = "code.desktop"; + "text/x-nix" = "code.desktop"; + "text/x-csrc" = "code.desktop"; + "text/x-chdr" = "code.desktop"; + "text/x-python" = "code.desktop"; + "text/x-shellscript" = "code.desktop"; + "application/json" = "code.desktop"; + "application/x-shellscript" = "code.desktop"; + }; + }; + + menus.enable = true; + }; + + environment.etc."xdg/menus/applications.menu".text = + builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu"; + }; +} diff --git a/modules/nixos/desktop/display/default.nix b/modules/nixos/desktop/display/default.nix deleted file mode 100755 index 34cc648..0000000 --- a/modules/nixos/desktop/display/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ ... }: - -{ - services.xserver.enable = true; - services.displayManager.ly = { - enable = true; - settings = { - animation = "colormix"; - colormix_col1 = "0x00FFFFFF"; - colormix_col2 = "0x00808080"; - colormix_col3 = "0x00080808"; - bigclock = "en"; - bigclock_12hr = false; - fg = "0x00FFFFFF"; - bg = "0x00000000"; - border_fg = "0x00FFFFFF"; - error_fg = "0x01FF0000"; - blank_box = true; - hide_borders = false; - margin_box_h = 2; - margin_box_v = 1; - }; - }; - - services.xserver.xkb = { - layout = "tr"; - variant = ""; - }; -} diff --git a/modules/nixos/desktop/window-managers/default.nix b/modules/nixos/desktop/window-managers/default.nix deleted file mode 100755 index 18edd6b..0000000 --- a/modules/nixos/desktop/window-managers/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./niri.nix - ]; -} diff --git a/modules/nixos/desktop/window-managers/hyprland.nix b/modules/nixos/desktop/window-managers/hyprland.nix deleted file mode 100755 index b3ab92e..0000000 --- a/modules/nixos/desktop/window-managers/hyprland.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ pkgs, inputs, ... }: - -{ - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - portalPackage = - inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; - xwayland.enable = true; - withUWSM = true; - }; - - xdg.portal = { - enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - config.hyprland.default = [ - "hyprland" - "gtk" - ]; - }; - - services = { - dbus.enable = true; - }; - - security.polkit.enable = true; - environment.systemPackages = with pkgs; [ - glib - dconf - dconf-editor - xdg-utils - xdg-user-dirs - ]; -} diff --git a/modules/nixos/desktop/window-managers/niri.nix b/modules/nixos/desktop/window-managers/niri.nix deleted file mode 100644 index 7c058ed..0000000 --- a/modules/nixos/desktop/window-managers/niri.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - programs.niri.enable = true; - - environment.systemPackages = with pkgs; [ - xwayland-satellite - ]; -} diff --git a/modules/nixos/desktop/window-managers/sway.nix b/modules/nixos/desktop/window-managers/sway.nix deleted file mode 100644 index 509995d..0000000 --- a/modules/nixos/desktop/window-managers/sway.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: - -{ - programs.sway = { - enable = true; - wrapperFeatures.gtk = true; - extraPackages = with pkgs; [ foot dmenu ]; - }; -} diff --git a/modules/nixos/gaming/default.nix b/modules/nixos/gaming/default.nix deleted file mode 100755 index 0f20de9..0000000 --- a/modules/nixos/gaming/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - ./steam - ]; - - programs.gamemode = { - enable = true; - enableRenice = true; - }; - - environment.systemPackages = with pkgs; [ - protonup-qt - mangohud - ]; -} diff --git a/modules/nixos/gaming/gaming-gamemode.ulu.nix b/modules/nixos/gaming/gaming-gamemode.ulu.nix new file mode 100644 index 0000000..59ec80d --- /dev/null +++ b/modules/nixos/gaming/gaming-gamemode.ulu.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + flake.nixosModules.gaming-gamemode = + { pkgs, ... }: + { + programs.gamemode = { + enable = true; + enableRenice = true; + }; + + environment.systemPackages = with pkgs; [ + protonup-qt + mangohud + ]; + }; +} diff --git a/modules/nixos/gaming/gaming-steam.ulu.nix b/modules/nixos/gaming/gaming-steam.ulu.nix new file mode 100644 index 0000000..7c868ff --- /dev/null +++ b/modules/nixos/gaming/gaming-steam.ulu.nix @@ -0,0 +1,26 @@ +{ ... }: +{ + flake.nixosModules.gaming-steam = + { pkgs, ... }: + { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + protontricks.enable = true; + extraCompatPackages = with pkgs; [ + proton-ge-bin + ]; + }; + + programs.gamescope = { + enable = true; + capSysNice = true; + env = { + INTEL_DEBUG = "noccs"; + }; + }; + + hardware.steam-hardware.enable = true; + }; +} diff --git a/modules/nixos/gaming/steam/default.nix b/modules/nixos/gaming/steam/default.nix deleted file mode 100755 index 9d96dbe..0000000 --- a/modules/nixos/gaming/steam/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: -{ - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - protontricks.enable = true; - extraCompatPackages = with pkgs; [ - proton-ge-bin - ]; - }; - - programs.gamescope = { - enable = true; - capSysNice = true; - env = { - INTEL_DEBUG = "noccs"; - }; - }; - - hardware.steam-hardware.enable = true; -} diff --git a/modules/nixos/hardware/bluetooth/default.nix b/modules/nixos/hardware/bluetooth/default.nix deleted file mode 100755 index fb6a06a..0000000 --- a/modules/nixos/hardware/bluetooth/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - hardware.bluetooth.enable = true; -} diff --git a/modules/nixos/hardware/default.nix b/modules/nixos/hardware/default.nix deleted file mode 100755 index d5bbbf7..0000000 --- a/modules/nixos/hardware/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: - -{ - imports = [ - ./bluetooth - ./graphics - ./udev - ]; -} diff --git a/modules/nixos/hardware/graphics/amd.nix b/modules/nixos/hardware/graphics/amd.nix deleted file mode 100755 index 50782fc..0000000 --- a/modules/nixos/hardware/graphics/amd.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: - -{ - hardware.graphics.extraPackages = with pkgs; [ - amdvlk - rocmPackages.clr.icd - ]; - - services.xserver.videoDrivers = [ "amdgpu" ]; -} diff --git a/modules/nixos/hardware/graphics/default.nix b/modules/nixos/hardware/graphics/default.nix deleted file mode 100755 index 547838e..0000000 --- a/modules/nixos/hardware/graphics/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - driver = config.elars.hardware.graphics.driver; -in -{ - options.elars.hardware.graphics.driver = lib.mkOption { - type = lib.types.enum [ - "intel" - "amd" - "nvidia" - "hybrid-amd-nvidia" - ]; - default = "intel"; - }; - - config = lib.mkMerge [ - { - hardware.graphics = { - enable = true; - enable32Bit = true; - }; - } - - (lib.mkIf (driver == "intel") (import ./intel.nix { inherit config lib pkgs; })) - (lib.mkIf (driver == "amd") (import ./amd.nix { inherit config lib pkgs; })) - (lib.mkIf (driver == "nvidia") (import ./nvidia.nix { inherit config lib pkgs; })) - (lib.mkIf (driver == "hybrid-amd-nvidia") ( - lib.mkMerge [ - (import ./amd.nix { inherit config lib pkgs; }) - (import ./nvidia.nix { inherit config lib pkgs; }) - (import ./prime.nix { inherit config lib pkgs; }) - ] - )) - ]; -} diff --git a/modules/nixos/hardware/graphics/intel.nix b/modules/nixos/hardware/graphics/intel.nix deleted file mode 100755 index 4d95276..0000000 --- a/modules/nixos/hardware/graphics/intel.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ pkgs, ... }: -let - wayland-intel-vaapi-driver = pkgs.intel-vaapi-driver.overrideAttrs (oldAttrs: { - version = "2.4.4-wayland-fix"; - src = pkgs.fetchFromGitHub { - owner = "irql-notlessorequal"; - repo = "intel-vaapi-driver"; - rev = "929e936ec1f451a5daa12b0c7367687b712b8c2c"; - hash = "sha256-tZ1rZ+4bRxarcFQhP8V2Mfz0sJ5rBgHYLu2ulrQwL+U="; - }; - }); - wayland-intel-vaapi-driver-32 = pkgs.pkgsi686Linux.intel-vaapi-driver.overrideAttrs (oldAttrs: { - version = "2.4.4-wayland-fix"; - src = pkgs.fetchFromGitHub { - owner = "irql-notlessorequal"; - repo = "intel-vaapi-driver"; - rev = "929e936ec1f451a5daa12b0c7367687b712b8c2c"; - hash = "sha256-tZ1rZ+4bRxarcFQhP8V2Mfz0sJ5rBgHYLu2ulrQwL+U="; - }; - - }); - #hasvk14-layer = pkgs.callPackage ./vk { }; - #hasvk14-layer-32 = pkgs.pkgsi686Linux.callPackage ./vk { }; -in - -{ - hardware.graphics = { - extraPackages = [ - #hasvk14-layer - wayland-intel-vaapi-driver - pkgs.libvdpau-va-gl - pkgs.pocl - ]; - extraPackages32 = [ - #hasvk14-layer-32 - wayland-intel-vaapi-driver-32 - pkgs.pkgsi686Linux.libvdpau-va-gl - ]; - }; - services.xserver.videoDrivers = [ "modesetting" ]; - environment.variables = { - LIBVA_DRIVER_NAME = "i965"; - }; -} diff --git a/modules/nixos/hardware/graphics/nvidia.nix b/modules/nixos/hardware/graphics/nvidia.nix deleted file mode 100755 index 05d646b..0000000 --- a/modules/nixos/hardware/graphics/nvidia.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, ... }: - -{ - services.xserver.videoDrivers = [ "nvidia" ]; - - hardware.nvidia = { - modesetting.enable = true; - open = false; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; - }; -} diff --git a/modules/nixos/hardware/graphics/prime.nix b/modules/nixos/hardware/graphics/prime.nix deleted file mode 100755 index 3146a46..0000000 --- a/modules/nixos/hardware/graphics/prime.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: - -{ - hardware.nvidia.prime = { - offload.enable = true; - amdgpuBusId = "PCI:X:X:X"; - nvidiaBusId = "PCI:X:X:X"; - }; -} diff --git a/modules/nixos/hardware/graphics/vk/default.nix b/modules/nixos/hardware/graphics/vk/default.nix deleted file mode 100644 index 5f0721c..0000000 --- a/modules/nixos/hardware/graphics/vk/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs }: - -let - is32 = pkgs.stdenv.hostPlatform.system == "i686-linux"; - layerName = "VK_LAYER_hasvk14_version_override" + pkgs.lib.optionalString is32 "_32"; -in - -pkgs.stdenv.mkDerivation { - name = "vulkan-layer-hasvk14" + pkgs.lib.optionalString is32 "-32bit"; - src = ./.; - - buildInputs = [ pkgs.vulkan-headers ]; - - buildPhase = '' - $CC -shared -fPIC -O2 -o libVkLayer_hasvk14.so hasvk14_layer.c \ - -I${pkgs.vulkan-headers}/include - ''; - - installPhase = '' - mkdir -p $out/lib $out/share/vulkan/implicit_layer.d - cp libVkLayer_hasvk14.so $out/lib/ - - substitute hasvk14_layer.json \ - $out/share/vulkan/implicit_layer.d/hasvk14_layer.json \ - --subst-var out \ - --subst-var-by layer_name "${layerName}" - ''; -} diff --git a/modules/nixos/hardware/graphics/vk/hasvk14_layer.c b/modules/nixos/hardware/graphics/vk/hasvk14_layer.c deleted file mode 100644 index 7916596..0000000 --- a/modules/nixos/hardware/graphics/vk/hasvk14_layer.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Vulkan implicit layer forces VK 1.4.x (e.g. 1.4.348 via headers) - */ - -#include -#include -#include - -static PFN_vkGetInstanceProcAddr g_next_gipa = NULL; -static PFN_vkGetPhysicalDeviceProperties g_next_gdp = NULL; -static PFN_vkGetPhysicalDeviceProperties2 g_next_gdp2 = NULL; -static PFN_vkGetPhysicalDeviceFeatures g_next_gdf = NULL; -static PFN_vkGetPhysicalDeviceFeatures2 g_next_gdf2 = NULL; - -#define HASVK14_API_VERSION VK_MAKE_API_VERSION(0, 1, 4, VK_HEADER_VERSION) -#define INTEL_VENDOR_ID 0x8086 - -static int is_intel_below_14(uint32_t vendorID, uint32_t apiVersion) -{ - return vendorID == INTEL_VENDOR_ID && VK_API_VERSION_MAJOR(apiVersion) == 1 && VK_API_VERSION_MINOR(apiVersion) < 4; -} - -static int is_intel_device(VkPhysicalDevice device) -{ - if (!g_next_gdp) return 0; - VkPhysicalDeviceProperties props; - g_next_gdp(device, &props); - return props.vendorID == INTEL_VENDOR_ID; -} - -static void patch_features(VkPhysicalDeviceFeatures *f) -{ - - f->shaderInt16 = VK_TRUE; -} - -VKAPI_ATTR VkResult VKAPI_CALL -HaVK14_EnumerateInstanceVersion(uint32_t *pApiVersion) -{ - *pApiVersion = HASVK14_API_VERSION; - return VK_SUCCESS; -} - -VKAPI_ATTR VkResult VKAPI_CALL -HaVK14_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkInstance *pInstance) -{ - VkLayerInstanceCreateInfo *link = - (VkLayerInstanceCreateInfo *)pCreateInfo->pNext; - - while (link && - !(link->sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO && - link->function == VK_LAYER_LINK_INFO)) - link = (VkLayerInstanceCreateInfo *)link->pNext; - - if (!link) - return VK_ERROR_INITIALIZATION_FAILED; - g_next_gipa = link->u.pLayerInfo->pfnNextGetInstanceProcAddr; - link->u.pLayerInfo = link->u.pLayerInfo->pNext; - PFN_vkCreateInstance next_ci = - (PFN_vkCreateInstance)g_next_gipa(NULL, "vkCreateInstance"); - VkResult res = next_ci(pCreateInfo, pAllocator, pInstance); - if (res != VK_SUCCESS) - return res; - g_next_gdp = (PFN_vkGetPhysicalDeviceProperties) - g_next_gipa(*pInstance, "vkGetPhysicalDeviceProperties"); - g_next_gdp2 = (PFN_vkGetPhysicalDeviceProperties2) - g_next_gipa(*pInstance, "vkGetPhysicalDeviceProperties2"); - if (!g_next_gdp2) - { - g_next_gdp2 = (PFN_vkGetPhysicalDeviceProperties2) - g_next_gipa(*pInstance, "vkGetPhysicalDeviceProperties2KHR"); - } - g_next_gdf = (PFN_vkGetPhysicalDeviceFeatures) - g_next_gipa(*pInstance, "vkGetPhysicalDeviceFeatures"); - g_next_gdf2 = (PFN_vkGetPhysicalDeviceFeatures2) - g_next_gipa(*pInstance, "vkGetPhysicalDeviceFeatures2"); - if (!g_next_gdf2) - { - g_next_gdf2 = (PFN_vkGetPhysicalDeviceFeatures2) - g_next_gipa(*pInstance, "vkGetPhysicalDeviceFeatures2KHR"); - } - - return VK_SUCCESS; -} - -VKAPI_ATTR void VKAPI_CALL -HaVK14_GetPhysicalDeviceProperties(VkPhysicalDevice device, - VkPhysicalDeviceProperties *props) -{ - if (g_next_gdp) - g_next_gdp(device, props); - if (props && is_intel_below_14(props->vendorID, props->apiVersion)) - { - props->apiVersion = HASVK14_API_VERSION; - } -} - -VKAPI_ATTR void VKAPI_CALL -HaVK14_GetPhysicalDeviceProperties2(VkPhysicalDevice device, - VkPhysicalDeviceProperties2 *props2) -{ - if (g_next_gdp2) - g_next_gdp2(device, props2); - if (!props2) - return; - VkPhysicalDeviceProperties *props = &props2->properties; - if (!is_intel_below_14(props->vendorID, props->apiVersion)) - return; - - props->apiVersion = HASVK14_API_VERSION; - VkBaseOutStructure *s = (VkBaseOutStructure *)props2->pNext; - while (s) - { - if (s->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES) - { - VkPhysicalDeviceVulkan12Properties *p12 = - (VkPhysicalDeviceVulkan12Properties *)s; - p12->conformanceVersion = (VkConformanceVersion){1, 4, 1, 1}; - } - if (s->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES) - { - VkPhysicalDeviceDriverProperties *drv = - (VkPhysicalDeviceDriverProperties *)s; - drv->conformanceVersion = (VkConformanceVersion){1, 4, 1, 1}; - } - s = s->pNext; - } -} - -VKAPI_ATTR void VKAPI_CALL -HaVK14_GetPhysicalDeviceFeatures(VkPhysicalDevice device, - VkPhysicalDeviceFeatures *features) -{ - if (g_next_gdf) - g_next_gdf(device, features); - if (features && is_intel_device(device)) - patch_features(features); -} - -VKAPI_ATTR void VKAPI_CALL -HaVK14_GetPhysicalDeviceFeatures2(VkPhysicalDevice device, - VkPhysicalDeviceFeatures2 *features2) -{ - if (g_next_gdf2) - g_next_gdf2(device, features2); - if (!features2 || !is_intel_device(device)) - return; - - patch_features(&features2->features); - - /* Also patch Vulkan 1.1/1.2 feature structs in pNext chain */ - VkBaseOutStructure *s = (VkBaseOutStructure *)features2->pNext; - while (s) - { - if (s->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES) - { - VkPhysicalDeviceShaderDrawParametersFeatures *f = - (VkPhysicalDeviceShaderDrawParametersFeatures *)s; - f->shaderDrawParameters = VK_TRUE; - } - if (s->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES) - { - VkPhysicalDeviceVulkan12Features *f12 = - (VkPhysicalDeviceVulkan12Features *)s; - f12->shaderInt8 = VK_TRUE; - f12->storageBuffer8BitAccess = VK_TRUE; - f12->uniformAndStorageBuffer8BitAccess = VK_TRUE; - } - s = s->pNext; - } -} - -VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL -HaVK14_GetInstanceProcAddr(VkInstance instance, const char *pName) -{ - -#define INTERCEPT(fn) \ - if (strcmp(pName, "vk" #fn) == 0) \ - return (PFN_vkVoidFunction)HaVK14_##fn; - - INTERCEPT(GetInstanceProcAddr) - INTERCEPT(EnumerateInstanceVersion) - INTERCEPT(CreateInstance) - INTERCEPT(GetPhysicalDeviceProperties) - INTERCEPT(GetPhysicalDeviceProperties2) - INTERCEPT(GetPhysicalDeviceFeatures) - INTERCEPT(GetPhysicalDeviceFeatures2) - - if (strcmp(pName, "vkGetPhysicalDeviceProperties2KHR") == 0) - return (PFN_vkVoidFunction)HaVK14_GetPhysicalDeviceProperties2; - if (strcmp(pName, "vkGetPhysicalDeviceFeatures2KHR") == 0) - return (PFN_vkVoidFunction)HaVK14_GetPhysicalDeviceFeatures2; - -#undef INTERCEPT - - return g_next_gipa ? g_next_gipa(instance, pName) : NULL; -} \ No newline at end of file diff --git a/modules/nixos/hardware/graphics/vk/hasvk14_layer.json b/modules/nixos/hardware/graphics/vk/hasvk14_layer.json deleted file mode 100644 index 4f1908b..0000000 --- a/modules/nixos/hardware/graphics/vk/hasvk14_layer.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "file_format_version": "1.1.2", - "layer": { - "name": "@layer_name@", - "type": "GLOBAL", - "library_path": "@out@/lib/libVkLayer_hasvk14.so", - "api_version": "1.4.0", - "implementation_version": "1", - "description": "Intel Hard Graphics", - "functions": { - "vkGetInstanceProcAddr": "HaVK14_GetInstanceProcAddr" - }, - "disable_environment": { - "DISABLE_HASVK14_LAYER": "1" - } - } -} \ No newline at end of file diff --git a/modules/nixos/hardware/udev/default.nix b/modules/nixos/hardware/udev/default.nix deleted file mode 100755 index 5966742..0000000 --- a/modules/nixos/hardware/udev/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ ... }: - -{ - programs.gpu-screen-recorder.enable = true; - services.udev.extraRules = '' - KERNEL=="ttyACM[0-9]*", MODE="0666" - KERNEL=="ttyUSB[0-9]*", MODE="0666" - SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev" - ''; - services.udisks2.enable = true; - services.gnome.sushi.enable = true; - services.gvfs.enable = true; - security.polkit.extraConfig = '' - polkit.addRule(function(action, subject) { - if (action.id.match("org.freedesktop.udisks2.") && - subject.isInGroup("wheel")) { - return polkit.Result.YES; - } - }); - ''; -} diff --git a/modules/nixos/hw/hw-bluetooth.ulu.nix b/modules/nixos/hw/hw-bluetooth.ulu.nix new file mode 100644 index 0000000..89c88e0 --- /dev/null +++ b/modules/nixos/hw/hw-bluetooth.ulu.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + flake.nixosModules.hw-bluetooth = + { ... }: + { + hardware.bluetooth.enable = true; + }; +} diff --git a/modules/nixos/hw/hw-graphics.ulu.nix b/modules/nixos/hw/hw-graphics.ulu.nix new file mode 100644 index 0000000..ce1459a --- /dev/null +++ b/modules/nixos/hw/hw-graphics.ulu.nix @@ -0,0 +1,116 @@ +{ ... }: +{ + flake.nixosModules.hw-graphics = + { + config, + lib, + pkgs, + ... + }: + let + driver = config.elars.hardware.graphics.driver; + + amd = { + hardware.graphics.extraPackages = with pkgs; [ + amdvlk + rocmPackages.clr.icd + ]; + + services.xserver.videoDrivers = [ "amdgpu" ]; + }; + + intel = + let + wayland-intel-vaapi-driver = pkgs.intel-vaapi-driver.overrideAttrs (oldAttrs: { + version = "2.4.4-wayland-fix"; + src = pkgs.fetchFromGitHub { + owner = "irql-notlessorequal"; + repo = "intel-vaapi-driver"; + rev = "929e936ec1f451a5daa12b0c7367687b712b8c2c"; + hash = "sha256-tZ1rZ+4bRxarcFQhP8V2Mfz0sJ5rBgHYLu2ulrQwL+U="; + }; + }); + wayland-intel-vaapi-driver-32 = pkgs.pkgsi686Linux.intel-vaapi-driver.overrideAttrs (oldAttrs: { + version = "2.4.4-wayland-fix"; + src = pkgs.fetchFromGitHub { + owner = "irql-notlessorequal"; + repo = "intel-vaapi-driver"; + rev = "929e936ec1f451a5daa12b0c7367687b712b8c2c"; + hash = "sha256-tZ1rZ+4bRxarcFQhP8V2Mfz0sJ5rBgHYLu2ulrQwL+U="; + }; + + }); + #hasvk14-layer = pkgs.callPackage ./vk { }; + #hasvk14-layer-32 = pkgs.pkgsi686Linux.callPackage ./vk { }; + in + { + hardware.graphics = { + extraPackages = [ + #hasvk14-layer + wayland-intel-vaapi-driver + pkgs.libvdpau-va-gl + pkgs.pocl + ]; + extraPackages32 = [ + #hasvk14-layer-32 + wayland-intel-vaapi-driver-32 + pkgs.pkgsi686Linux.libvdpau-va-gl + ]; + }; + services.xserver.videoDrivers = [ "modesetting" ]; + environment.variables = { + LIBVA_DRIVER_NAME = "i965"; + }; + }; + + nvidia = { + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + modesetting.enable = true; + open = false; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + }; + + prime = { + hardware.nvidia.prime = { + offload.enable = true; + amdgpuBusId = "PCI:X:X:X"; + nvidiaBusId = "PCI:X:X:X"; + }; + }; + in + { + options.elars.hardware.graphics.driver = lib.mkOption { + type = lib.types.enum [ + "intel" + "amd" + "nvidia" + "hybrid-amd-nvidia" + ]; + default = "intel"; + }; + + config = lib.mkMerge [ + { + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + } + + (lib.mkIf (driver == "intel") intel) + (lib.mkIf (driver == "amd") amd) + (lib.mkIf (driver == "nvidia") nvidia) + (lib.mkIf (driver == "hybrid-amd-nvidia") ( + lib.mkMerge [ + amd + nvidia + prime + ] + )) + ]; + }; +} diff --git a/modules/nixos/hw/hw-udev.ulu.nix b/modules/nixos/hw/hw-udev.ulu.nix new file mode 100644 index 0000000..514373b --- /dev/null +++ b/modules/nixos/hw/hw-udev.ulu.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + flake.nixosModules.hw-udev = + { ... }: + { + programs.gpu-screen-recorder.enable = true; + services.udev.extraRules = '' + KERNEL=="ttyACM[0-9]*", MODE="0666" + KERNEL=="ttyUSB[0-9]*", MODE="0666" + SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev" + ''; + services.udisks2.enable = true; + services.gnome.sushi.enable = true; + services.gvfs.enable = true; + security.polkit.extraConfig = '' + polkit.addRule(function(action, subject) { + if (action.id.match("org.freedesktop.udisks2.") && + subject.isInGroup("wheel")) { + return polkit.Result.YES; + } + }); + ''; + }; +} diff --git a/modules/nixos/net/net-network-manager.ulu.nix b/modules/nixos/net/net-network-manager.ulu.nix new file mode 100644 index 0000000..3a47cdd --- /dev/null +++ b/modules/nixos/net/net-network-manager.ulu.nix @@ -0,0 +1,26 @@ +{ ... }: +{ + flake.nixosModules.net-network-manager = + { ... }: + { + networking.hostName = "copland"; + networking.networkmanager.enable = true; + + services.resolved = { + enable = true; + + settings = { + Resolve = { + DNS = "1.1.1.1"; + DNSOverTLS = "yes"; + DNSSEC = "false"; + Domains = [ "~." ]; + FallbackDNS = [ + "1.1.1.1" + "8.8.8.8" + ]; + }; + }; + }; + }; +} diff --git a/modules/nixos/net/net-vpn.ulu.nix b/modules/nixos/net/net-vpn.ulu.nix new file mode 100644 index 0000000..31db182 --- /dev/null +++ b/modules/nixos/net/net-vpn.ulu.nix @@ -0,0 +1,39 @@ +{ ... }: +{ + flake.nixosModules.net-vpn = + { ... }: + { + services.zapret = { + enable = true; + params = [ + "--filter-tcp=80" + "--dpi-desync=fake,multisplit" + "--dpi-desync-split-pos=method+2" + "--dpi-desync-fooling=md5sig" + "--new" + "--filter-tcp=443" + "--dpi-desync=fake,multidisorder" + "--dpi-desync-split-pos=1,midsld" + "--dpi-desync-fooling=badseq,md5sig" + "--new" + "--filter-udp=443" + "--dpi-desync=fake" + "--dpi-desync-repeats=6" + ]; + }; + + networking.enableIPv6 = false; + + networking.firewall.extraCommands = '' + iptables -I OUTPUT -p tcp -m multiport --dports 80,443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass + iptables -I OUTPUT -p udp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass + iptables -I OUTPUT -m mark --mark 0x40000000/0x40000000 -j RETURN + ''; + + networking.firewall.extraStopCommands = '' + iptables -D OUTPUT -p tcp -m multiport --dports 80,443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass || true + iptables -D OUTPUT -p udp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass || true + iptables -D OUTPUT -m mark --mark 0x40000000/0x40000000 -j RETURN || true + ''; + }; +} diff --git a/modules/nixos/networking/default.nix b/modules/nixos/networking/default.nix deleted file mode 100755 index 46f1400..0000000 --- a/modules/nixos/networking/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: - -{ - imports = [ - ./vpn - ./network-manager - ]; -} diff --git a/modules/nixos/networking/network-manager/default.nix b/modules/nixos/networking/network-manager/default.nix deleted file mode 100755 index 8951724..0000000 --- a/modules/nixos/networking/network-manager/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ ... }: - -{ - networking.hostName = "copland"; - networking.networkmanager.enable = true; - - services.resolved = { - enable = true; - - settings = { - Resolve = { - DNS = "1.1.1.1"; - DNSOverTLS = "yes"; - DNSSEC = "false"; - Domains = [ "~." ]; - FallbackDNS = [ - "1.1.1.1" - "8.8.8.8" - ]; - }; - }; - }; -} diff --git a/modules/nixos/networking/vpn/default.nix b/modules/nixos/networking/vpn/default.nix deleted file mode 100755 index c2f8191..0000000 --- a/modules/nixos/networking/vpn/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ ... }: - -{ - services.zapret = { - enable = true; - params = [ - "--filter-tcp=80" - "--dpi-desync=fake,multisplit" - "--dpi-desync-split-pos=method+2" - "--dpi-desync-fooling=md5sig" - "--new" - "--filter-tcp=443" - "--dpi-desync=fake,multidisorder" - "--dpi-desync-split-pos=1,midsld" - "--dpi-desync-fooling=badseq,md5sig" - "--new" - "--filter-udp=443" - "--dpi-desync=fake" - "--dpi-desync-repeats=6" - ]; - }; - - networking.enableIPv6 = false; - - networking.firewall.extraCommands = '' - iptables -I OUTPUT -p tcp -m multiport --dports 80,443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass - iptables -I OUTPUT -p udp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass - iptables -I OUTPUT -m mark --mark 0x40000000/0x40000000 -j RETURN - ''; - - networking.firewall.extraStopCommands = '' - iptables -D OUTPUT -p tcp -m multiport --dports 80,443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass || true - iptables -D OUTPUT -p udp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass || true - iptables -D OUTPUT -m mark --mark 0x40000000/0x40000000 -j RETURN || true - ''; -} diff --git a/modules/nixos/services/appimage/default.nix b/modules/nixos/services/appimage/default.nix deleted file mode 100755 index 5398e80..0000000 --- a/modules/nixos/services/appimage/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: - -{ - programs.appimage = { - enable = true; - binfmt = true; - }; -} diff --git a/modules/nixos/services/default.nix b/modules/nixos/services/default.nix deleted file mode 100755 index 0393bc1..0000000 --- a/modules/nixos/services/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: - -{ - imports = [ - ./appimage - ./flatpak - ./fwupd - ./kde_connect - ./ollama - ./performance - ./printing - ./security - ./ssh - ]; -} diff --git a/modules/nixos/services/flatpak/default.nix b/modules/nixos/services/flatpak/default.nix deleted file mode 100755 index e785c3f..0000000 --- a/modules/nixos/services/flatpak/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - services.flatpak.enable = true; -} diff --git a/modules/nixos/services/fwupd/default.nix b/modules/nixos/services/fwupd/default.nix deleted file mode 100755 index 52dc13e..0000000 --- a/modules/nixos/services/fwupd/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - services.fwupd.enable = true; -} diff --git a/modules/nixos/services/kde_connect/default.nix b/modules/nixos/services/kde_connect/default.nix deleted file mode 100755 index 3aeef6e..0000000 --- a/modules/nixos/services/kde_connect/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - programs.kdeconnect.enable = true; -} diff --git a/modules/nixos/services/ollama/default.nix b/modules/nixos/services/ollama/default.nix deleted file mode 100755 index fb915fd..0000000 --- a/modules/nixos/services/ollama/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - services.ollama.enable = true; -} diff --git a/modules/nixos/services/performance/default.nix b/modules/nixos/services/performance/default.nix deleted file mode 100755 index 589e255..0000000 --- a/modules/nixos/services/performance/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - services.irqbalance.enable = true; - services.power-profiles-daemon.enable = true; - services.upower.enable = true; -} diff --git a/modules/nixos/services/printing/default.nix b/modules/nixos/services/printing/default.nix deleted file mode 100755 index 6715b48..0000000 --- a/modules/nixos/services/printing/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs, ... }: - -{ - services.printing = { - enable = true; - drivers = [ - pkgs.cnijfilter2 - pkgs.gutenprint - pkgs.gutenprintBin - ]; - }; - - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - publish = { - enable = true; - addresses = true; - userServices = true; - }; - }; - - hardware.sane = { - enable = true; - extraBackends = [ pkgs.sane-airscan ]; - }; -} diff --git a/modules/nixos/services/security/default.nix b/modules/nixos/services/security/default.nix deleted file mode 100755 index 0ab3989..0000000 --- a/modules/nixos/services/security/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, ... }: - -{ - programs.gnupg.agent = { - enable = true; - enableSSHSupport = false; - }; - - security.wrappers = { - gsr-kms-server = { - source = "${pkgs.gpu-screen-recorder}/bin/gsr-kms-server"; - owner = "root"; - group = "root"; - permissions = "u+rx,g+rx,o+rx"; - }; - }; - - services.gnome.gnome-keyring.enable = true; -} diff --git a/modules/nixos/services/service-appimage.ulu.nix b/modules/nixos/services/service-appimage.ulu.nix new file mode 100644 index 0000000..11cd60c --- /dev/null +++ b/modules/nixos/services/service-appimage.ulu.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + flake.nixosModules.service-appimage = + { ... }: + { + programs.appimage = { + enable = true; + binfmt = true; + }; + }; +} diff --git a/modules/nixos/services/service-docker.ulu.nix b/modules/nixos/services/service-docker.ulu.nix new file mode 100644 index 0000000..19c1b18 --- /dev/null +++ b/modules/nixos/services/service-docker.ulu.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + flake.nixosModules.service-docker = + { ... }: + { + virtualisation.docker.enable = true; + }; +} diff --git a/modules/nixos/services/service-flatpak.ulu.nix b/modules/nixos/services/service-flatpak.ulu.nix new file mode 100644 index 0000000..c750d61 --- /dev/null +++ b/modules/nixos/services/service-flatpak.ulu.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + flake.nixosModules.service-flatpak = + { ... }: + { + services.flatpak.enable = true; + }; +} diff --git a/modules/nixos/services/service-fwupd.ulu.nix b/modules/nixos/services/service-fwupd.ulu.nix new file mode 100644 index 0000000..18d8cf8 --- /dev/null +++ b/modules/nixos/services/service-fwupd.ulu.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + flake.nixosModules.service-fwupd = + { ... }: + { + services.fwupd.enable = true; + }; +} diff --git a/modules/nixos/services/service-kde-connect.ulu.nix b/modules/nixos/services/service-kde-connect.ulu.nix new file mode 100644 index 0000000..bd62967 --- /dev/null +++ b/modules/nixos/services/service-kde-connect.ulu.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + flake.nixosModules.service-kde-connect = + { ... }: + { + programs.kdeconnect.enable = true; + }; +} diff --git a/modules/nixos/services/service-ollama.ulu.nix b/modules/nixos/services/service-ollama.ulu.nix new file mode 100644 index 0000000..a2295ad --- /dev/null +++ b/modules/nixos/services/service-ollama.ulu.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + flake.nixosModules.service-ollama = + { ... }: + { + services.ollama.enable = true; + }; +} diff --git a/modules/nixos/services/service-performance.ulu.nix b/modules/nixos/services/service-performance.ulu.nix new file mode 100644 index 0000000..7832c6d --- /dev/null +++ b/modules/nixos/services/service-performance.ulu.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + flake.nixosModules.service-performance = + { ... }: + { + services.irqbalance.enable = true; + services.power-profiles-daemon.enable = true; + services.upower.enable = true; + }; +} diff --git a/modules/nixos/services/service-printing.ulu.nix b/modules/nixos/services/service-printing.ulu.nix new file mode 100644 index 0000000..d8edf32 --- /dev/null +++ b/modules/nixos/services/service-printing.ulu.nix @@ -0,0 +1,31 @@ +{ ... }: +{ + flake.nixosModules.service-printing = + { pkgs, ... }: + { + services.printing = { + enable = true; + drivers = [ + pkgs.cnijfilter2 + pkgs.gutenprint + pkgs.gutenprintBin + ]; + }; + + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + publish = { + enable = true; + addresses = true; + userServices = true; + }; + }; + + hardware.sane = { + enable = true; + extraBackends = [ pkgs.sane-airscan ]; + }; + }; +} diff --git a/modules/nixos/services/service-security.ulu.nix b/modules/nixos/services/service-security.ulu.nix new file mode 100644 index 0000000..2ec205a --- /dev/null +++ b/modules/nixos/services/service-security.ulu.nix @@ -0,0 +1,22 @@ +{ ... }: +{ + flake.nixosModules.service-security = + { pkgs, ... }: + { + programs.gnupg.agent = { + enable = true; + enableSSHSupport = false; + }; + + security.wrappers = { + gsr-kms-server = { + source = "${pkgs.gpu-screen-recorder}/bin/gsr-kms-server"; + owner = "root"; + group = "root"; + permissions = "u+rx,g+rx,o+rx"; + }; + }; + + services.gnome.gnome-keyring.enable = true; + }; +} diff --git a/modules/nixos/services/service-ssh.ulu.nix b/modules/nixos/services/service-ssh.ulu.nix new file mode 100644 index 0000000..a0a7308 --- /dev/null +++ b/modules/nixos/services/service-ssh.ulu.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + flake.nixosModules.service-ssh = + { ... }: + { + services.openssh.enable = true; + services.tailscale.enable = true; + }; +} diff --git a/modules/nixos/services/service-virt-manager.ulu.nix b/modules/nixos/services/service-virt-manager.ulu.nix new file mode 100644 index 0000000..bbd5dae --- /dev/null +++ b/modules/nixos/services/service-virt-manager.ulu.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + flake.nixosModules.service-virt-manager = + { ... }: + { + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + }; +} diff --git a/modules/nixos/services/ssh/default.nix b/modules/nixos/services/ssh/default.nix deleted file mode 100755 index 65e48a0..0000000 --- a/modules/nixos/services/ssh/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: - -{ - services.openssh.enable = true; - services.tailscale.enable = true; -} diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix deleted file mode 100755 index 93498eb..0000000 --- a/modules/nixos/system/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: - -{ - imports = [ - ./locale - ./nix - ./fonts - ./kmscon - ]; -} diff --git a/modules/nixos/system/fonts/default.nix b/modules/nixos/system/fonts/default.nix deleted file mode 100755 index 3001742..0000000 --- a/modules/nixos/system/fonts/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ pkgs, ... }: - -{ - fonts = { - packages = with pkgs; [ - nerd-fonts.jetbrains-mono - nerd-fonts.caskaydia-cove - noto-fonts-color-emoji - noto-fonts-cjk-serif - noto-fonts-cjk-sans - nerd-fonts.hurmit - noto-fonts - ipaexfont - ]; - - fontconfig = { - enable = true; - antialias = true; - - hinting = { - enable = true; - style = "slight"; - autohint = false; - }; - - subpixel = { - rgba = "rgb"; - lcdfilter = "default"; - }; - - defaultFonts = { - serif = [ - "JetBrainsMono Nerd Font" - "Noto Serif CJK JP" - "Noto Serif" - "IPAexMincho" - ]; - sansSerif = [ - "JetBrainsMono Nerd Font" - "Noto Sans CJK JP" - "Noto Sans" - "IPAexGothic" - ]; - monospace = [ - "JetBrainsMono Nerd Font Mono" - "JetBrainsMono Nerd Font" - "Noto Sans Mono CJK JP" - "Noto Sans CJK JP" - "IPAexGothic" - ]; - emoji = [ "Noto Color Emoji" ]; - }; - }; - }; -} diff --git a/modules/nixos/system/kmscon/default.nix b/modules/nixos/system/kmscon/default.nix deleted file mode 100755 index 6e1aff8..0000000 --- a/modules/nixos/system/kmscon/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: - -{ - fonts.packages = [ - pkgs.nerd-fonts.jetbrains-mono - ]; - - services.kmscon = { - enable = true; - config = { - font-name = "JetBrainsMono Nerd Font"; - font-size = 18; - hwaccel = true; - }; - }; -} diff --git a/modules/nixos/system/locale/default.nix b/modules/nixos/system/locale/default.nix deleted file mode 100755 index 273b5d3..0000000 --- a/modules/nixos/system/locale/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ ... }: - -{ - time.timeZone = "Europe/Istanbul"; - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "tr_TR.UTF-8"; - LC_IDENTIFICATION = "tr_TR.UTF-8"; - LC_MEASUREMENT = "tr_TR.UTF-8"; - LC_MONETARY = "tr_TR.UTF-8"; - LC_NAME = "tr_TR.UTF-8"; - LC_NUMERIC = "tr_TR.UTF-8"; - LC_PAPER = "tr_TR.UTF-8"; - LC_TELEPHONE = "tr_TR.UTF-8"; - LC_TIME = "tr_TR.UTF-8"; - }; - services.timesyncd.enable = false; - - services.chrony = { - enable = true; - extraConfig = '' - makestep 1.0 -1 - server 162.159.200.1 iburst - server 216.239.35.0 iburst - server time.cloudflare.com iburst - server time.google.com iburst - ''; - }; - - systemd.services.chronyd = { - after = [ "network-online.target" ]; - wants = [ "network-online.target" ]; - }; - console.font = "LatArCyrHeb-16"; - system.stateVersion = "25.05"; - console.keyMap = "trq"; - console.earlySetup = true; -} diff --git a/modules/nixos/system/nix/default.nix b/modules/nixos/system/nix/default.nix deleted file mode 100755 index 55b7ca1..0000000 --- a/modules/nixos/system/nix/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ ... }: - -{ - nix.settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - - max-jobs = 4; - cores = 4; - - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - "https://ezkea.cachix.org" - "https://noctalia.cachix.org" - "https://hyprland.cachix.org" - "https://attic.xuyh0120.win/lantian" - "https://soryu-kernel.cachix.org" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI=" - "noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - "lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc=" - "soryu-kernel.cachix.org-1:2/Tm90ibGjLQWo/uX4qo/kbFB5yjQG/CzfE1oelHdWw=" - ]; - }; - - documentation = { - man.enable = true; - doc.enable = false; - info.enable = false; - nixos.enable = false; - }; - - programs.nix-ld.enable = true; -} diff --git a/modules/nixos/users/default.nix b/modules/nixos/users/default.nix deleted file mode 100755 index cb6b9b0..0000000 --- a/modules/nixos/users/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, ... }: - -{ - users.users.elars = { - isNormalUser = true; - linger = true; - description = "elars"; - extraGroups = [ - "networkmanager" - "libvirtd" - "scanner" - "plugdev" - "docker" - "video" - "input" - "audio" - "wheel" - "lp" - ]; - shell = pkgs.zsh; - }; - - programs.nh = { - enable = true; - clean.enable = true; - clean.extraArgs = "--keep-since 4d --keep 3"; - flake = "/home/elars/copland"; - }; - - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestions.enable = true; - syntaxHighlighting.enable = true; - }; -} diff --git a/modules/nixos/virtualization/default.nix b/modules/nixos/virtualization/default.nix deleted file mode 100755 index 3dcc990..0000000 --- a/modules/nixos/virtualization/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: - -{ - imports = [ - ./docker - ./virt-manager - ]; -} diff --git a/modules/nixos/virtualization/docker/default.nix b/modules/nixos/virtualization/docker/default.nix deleted file mode 100755 index 0582d99..0000000 --- a/modules/nixos/virtualization/docker/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - virtualisation.docker.enable = true; -} diff --git a/modules/nixos/virtualization/virt-manager/default.nix b/modules/nixos/virtualization/virt-manager/default.nix deleted file mode 100755 index 0528c47..0000000 --- a/modules/nixos/virtualization/virt-manager/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: - -{ - virtualisation.libvirtd.enable = true; - programs.virt-manager.enable = true; -} diff --git a/options/darwin-outputs.ulu.nix b/options/darwin-outputs.ulu.nix new file mode 100644 index 0000000..810b6bb --- /dev/null +++ b/options/darwin-outputs.ulu.nix @@ -0,0 +1,8 @@ +{ lib, ... }: +{ + options.flake.darwinModules = lib.mkOption { + type = lib.types.lazyAttrsOf lib.types.deferredModule; + default = { }; + description = "Darwin module pool (symmetric with flake.nixosModules)."; + }; +} diff --git a/options/flake-outputs.ulu.nix b/options/flake-outputs.ulu.nix new file mode 100644 index 0000000..abf2e87 --- /dev/null +++ b/options/flake-outputs.ulu.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + moduleLocation, + ... +}: +let + inherit (lib.attrsets) mapAttrs; + inherit (lib.lists) singleton; + inherit (lib.modules) mkMerge; + inherit (lib.options) mkOption; + inherit (lib.types) deferredModule lazyAttrsOf; + + wrap = + kind: name: value: + let + file = "${toString moduleLocation}#${kind}.${name}"; + in + { + _file = file; + key = file; + imports = singleton value; + }; +in +{ + options.commonModules = mkOption { + type = lazyAttrsOf deferredModule; + default = { }; + apply = mapAttrs (wrap "commonModules"); + description = "NixOS and Darwin modules shared between both platforms."; + }; + + config.flake.nixosModules = mkMerge [ config.commonModules ]; + config.flake.darwinModules = mkMerge [ config.commonModules ]; +} diff --git a/options/home-outputs.ulu.nix b/options/home-outputs.ulu.nix new file mode 100644 index 0000000..633ebc5 --- /dev/null +++ b/options/home-outputs.ulu.nix @@ -0,0 +1,8 @@ +{ lib, ... }: +{ + options.flake.homeModules = lib.mkOption { + type = lib.types.lazyAttrsOf lib.types.deferredModule; + default = { }; + description = "home-manager modul pool (symmetric with flake.nixosModules)."; + }; +} diff --git a/options/hostname-check.ulu.nix b/options/hostname-check.ulu.nix new file mode 100644 index 0000000..3cb88f5 --- /dev/null +++ b/options/hostname-check.ulu.nix @@ -0,0 +1,23 @@ +{ ... }: +{ + commonModules.hostname-assert = + { config, lib, ... }: + { + options.elars.expectedHostName = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = "host filename must match networking.hostName."; + }; + + config.assertions = lib.singleton { + assertion = + config.elars.expectedHostName == null + || config.networking.hostName == config.elars.expectedHostName; + message = '' + syntax: hostname assertion failed: + expected (filename) : ${toString config.elars.expectedHostName} + real (networking) : ${toString config.networking.hostName} + ''; + }; + }; +}