From 9dfbe1203dd960788c7308bcc7248ff4679a8562 Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Mon, 8 Jul 2024 15:56:42 +0300 Subject: [PATCH] Add syncthing base Signed-off-by: Nikolaos Karaolidis --- flake.lock | 12 +- flake.nix | 32 +- hosts/common/configs/bluetooth/default.nix | 4 +- hosts/common/configs/boot/default.nix | 6 +- .../common/configs/brightnessctl/default.nix | 17 +- hosts/common/configs/btop/default.nix | 1 - hosts/common/configs/fastfetch/default.nix | 1 - hosts/common/configs/getty/default.nix | 1 - hosts/common/configs/gpg-agent/default.nix | 4 +- hosts/common/configs/networking/default.nix | 4 +- hosts/common/configs/nix/default.nix | 6 +- hosts/common/configs/persist/default.nix | 5 +- hosts/common/configs/pipewire/default.nix | 10 +- hosts/common/configs/plymouth/default.nix | 5 +- hosts/common/configs/ranger/default.nix | 1 - hosts/common/configs/sops/default.nix | 1 - hosts/common/configs/system/default.nix | 1 - hosts/common/configs/tree/default.nix | 1 - hosts/common/configs/users/default.nix | 1 - hosts/common/scripts/cleanup/default.nix | 3 +- hosts/eirene/base/default.nix | 60 +- hosts/eirene/base/hardware-configuration.nix | 7 +- hosts/eirene/default.nix | 1 + hosts/eirene/format.nix | 21 +- hosts/eirene/vm/default.nix | 12 +- hosts/eirene/vm/hardware-configuration.nix | 10 +- users/common/configs/persist/default.nix | 30 +- users/common/configs/sops/default.nix | 26 +- users/common/configs/xdg/default.nix | 47 +- users/common/default.nix | 31 +- users/common/options/default.nix | 32 +- .../options/home-manager/hyprland/default.nix | 53 +- .../options/home-manager/matugen/default.nix | 25 +- .../options/home-manager/theme/default.nix | 655 +++++++++--------- .../options/home-manager/xdg/default.nix | 62 +- users/configs/bluetooth/default.nix | 19 - users/configs/brightnessctl/default.nix | 16 - users/configs/btop/default.nix | 36 - users/configs/console/bluetooth/default.nix | 31 + .../configs/console/brightnessctl/default.nix | 7 + users/configs/console/btop/default.nix | 19 + users/configs/{ => console}/git/commit-msg.sh | 0 users/configs/{ => console}/git/default.nix | 23 +- .../{ => console}/gpg-agent/default.nix | 49 +- .../gpg-agent/import-gpg-keys.sh | 0 .../configs/{ => console}/neovim/default.nix | 6 +- users/configs/console/pipewire/default.nix | 13 + users/configs/console/syncthing/default.nix | 35 + users/configs/{ => console}/zsh/default.nix | 6 +- users/configs/{ => gui}/ags/config/.gitignore | 0 .../{ => gui}/ags/config/.prettierrc.json | 0 .../configs/{ => gui}/ags/config/default.nix | 6 +- .../{ => gui}/ags/config/eslint.config.js | 0 .../configs/{ => gui}/ags/config/package.json | 0 .../configs/{ => gui}/ags/config/src/index.ts | 0 users/configs/{ => gui}/ags/config/src/lib.ts | 0 .../configs/{ => gui}/ags/config/src/theme.ts | 0 .../ags/config/src/widgets/bar/bar.ts | 0 .../src/widgets/bar/clipboard/clipboard.ts | 0 .../ags/config/src/widgets/bar/date/date.ts | 0 .../ags/config/src/widgets/bar/gap/gap.ts | 0 .../src/widgets/bar/launcher/launcher.ts | 0 .../config/src/widgets/bar/systray/systray.ts | 0 .../src/widgets/bar/workspace/workspace.ts | 0 .../{ => gui}/ags/config/tsconfig.json | 0 users/configs/{ => gui}/ags/default.nix | 49 +- users/configs/{ => gui}/ags/theme.sass | 0 .../{blueman => gui/bluetooth}/default.nix | 11 +- users/configs/gui/brightnessctl/default.nix | 14 + users/configs/gui/btop/default.nix | 34 + users/configs/{ => gui}/btop/theme.theme | 0 users/configs/{ => gui}/cbatticon/default.nix | 11 +- users/configs/{ => gui}/cliphist/default.nix | 16 +- users/configs/{ => gui}/firefox/default.nix | 71 +- users/configs/{ => gui}/gtk/default.nix | 43 +- users/configs/{ => gui}/gtk/theme.css | 0 users/configs/{ => gui}/hyprland/default.nix | 25 +- users/configs/{ => gui}/hyprland/theme.conf | 0 users/configs/{ => gui}/hyprshot/default.nix | 30 +- users/configs/{ => gui}/kitty/default.nix | 25 +- users/configs/{ => gui}/kitty/theme.conf | 0 users/configs/{ => gui}/matugen/default.nix | 39 +- .../networking}/default.nix | 6 +- users/configs/{ => gui}/pipewire/default.nix | 15 +- users/configs/gui/qalculate/default.nix | 50 ++ .../{ => gui}/qalculate/skip-save-prefs.patch | 0 .../{ => gui}/qt/KvAdwQt/KvAdwQt.kvconfig | 0 .../configs/{ => gui}/qt/KvAdwQt/KvAdwQt.svg | 0 users/configs/{ => gui}/qt/default.nix | 15 +- users/configs/{ => gui}/rofi/default.nix | 11 +- users/configs/gui/swww/default.nix | 64 ++ users/configs/{ => gui}/theme/default.nix | 16 +- users/configs/{ => gui}/vscode/default.nix | 19 +- users/configs/{ => gui}/vscode/langs/nix.nix | 5 +- users/configs/{ => gui}/wev/default.nix | 6 +- users/configs/{ => gui}/x11/default.nix | 6 +- users/configs/pavucontrol/default.nix | 5 - users/configs/playerctl/default.nix | 21 - users/configs/qalculate/default.nix | 39 -- users/configs/swww/default.nix | 51 -- users/configs/syncthing/default.nix | 15 - users/nick/{nogui.nix => console.nix} | 15 +- users/nick/default.nix | 55 +- 103 files changed, 1285 insertions(+), 951 deletions(-) delete mode 100644 users/configs/bluetooth/default.nix delete mode 100644 users/configs/brightnessctl/default.nix delete mode 100644 users/configs/btop/default.nix create mode 100644 users/configs/console/bluetooth/default.nix create mode 100644 users/configs/console/brightnessctl/default.nix create mode 100644 users/configs/console/btop/default.nix rename users/configs/{ => console}/git/commit-msg.sh (100%) rename users/configs/{ => console}/git/default.nix (61%) rename users/configs/{ => console}/gpg-agent/default.nix (54%) rename users/configs/{ => console}/gpg-agent/import-gpg-keys.sh (100%) rename users/configs/{ => console}/neovim/default.nix (84%) create mode 100644 users/configs/console/pipewire/default.nix create mode 100644 users/configs/console/syncthing/default.nix rename users/configs/{ => console}/zsh/default.nix (89%) rename users/configs/{ => gui}/ags/config/.gitignore (100%) rename users/configs/{ => gui}/ags/config/.prettierrc.json (100%) rename users/configs/{ => gui}/ags/config/default.nix (90%) rename users/configs/{ => gui}/ags/config/eslint.config.js (100%) rename users/configs/{ => gui}/ags/config/package.json (100%) rename users/configs/{ => gui}/ags/config/src/index.ts (100%) rename users/configs/{ => gui}/ags/config/src/lib.ts (100%) rename users/configs/{ => gui}/ags/config/src/theme.ts (100%) rename users/configs/{ => gui}/ags/config/src/widgets/bar/bar.ts (100%) rename users/configs/{ => gui}/ags/config/src/widgets/bar/clipboard/clipboard.ts (100%) rename users/configs/{ => gui}/ags/config/src/widgets/bar/date/date.ts (100%) rename users/configs/{ => gui}/ags/config/src/widgets/bar/gap/gap.ts (100%) rename users/configs/{ => gui}/ags/config/src/widgets/bar/launcher/launcher.ts (100%) rename users/configs/{ => gui}/ags/config/src/widgets/bar/systray/systray.ts (100%) rename users/configs/{ => gui}/ags/config/src/widgets/bar/workspace/workspace.ts (100%) rename users/configs/{ => gui}/ags/config/tsconfig.json (100%) rename users/configs/{ => gui}/ags/default.nix (55%) rename users/configs/{ => gui}/ags/theme.sass (100%) rename users/configs/{blueman => gui/bluetooth}/default.nix (71%) create mode 100644 users/configs/gui/brightnessctl/default.nix create mode 100644 users/configs/gui/btop/default.nix rename users/configs/{ => gui}/btop/theme.theme (100%) rename users/configs/{ => gui}/cbatticon/default.nix (74%) rename users/configs/{ => gui}/cliphist/default.nix (84%) rename users/configs/{ => gui}/firefox/default.nix (63%) rename users/configs/{ => gui}/gtk/default.nix (62%) rename users/configs/{ => gui}/gtk/theme.css (100%) rename users/configs/{ => gui}/hyprland/default.nix (92%) rename users/configs/{ => gui}/hyprland/theme.conf (100%) rename users/configs/{ => gui}/hyprshot/default.nix (63%) rename users/configs/{ => gui}/kitty/default.nix (69%) rename users/configs/{ => gui}/kitty/theme.conf (100%) rename users/configs/{ => gui}/matugen/default.nix (83%) rename users/configs/{networkmanager => gui/networking}/default.nix (76%) rename users/configs/{ => gui}/pipewire/default.nix (60%) create mode 100644 users/configs/gui/qalculate/default.nix rename users/configs/{ => gui}/qalculate/skip-save-prefs.patch (100%) rename users/configs/{ => gui}/qt/KvAdwQt/KvAdwQt.kvconfig (100%) rename users/configs/{ => gui}/qt/KvAdwQt/KvAdwQt.svg (100%) rename users/configs/{ => gui}/qt/default.nix (91%) rename users/configs/{ => gui}/rofi/default.nix (86%) create mode 100644 users/configs/gui/swww/default.nix rename users/configs/{ => gui}/theme/default.nix (76%) rename users/configs/{ => gui}/vscode/default.nix (94%) rename users/configs/{ => gui}/vscode/langs/nix.nix (74%) rename users/configs/{ => gui}/wev/default.nix (53%) rename users/configs/{ => gui}/x11/default.nix (76%) delete mode 100644 users/configs/pavucontrol/default.nix delete mode 100644 users/configs/playerctl/default.nix delete mode 100644 users/configs/qalculate/default.nix delete mode 100644 users/configs/swww/default.nix delete mode 100644 users/configs/syncthing/default.nix rename users/nick/{nogui.nix => console.nix} (55%) diff --git a/flake.lock b/flake.lock index 63a2512..4bcca11 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1720056646, - "narHash": "sha256-BymcV4HWtx2VFuabDCM4/nEJcfivCx0S02wUCz11mAY=", + "lastModified": 1720402389, + "narHash": "sha256-zJv6euDOrJWMHBhxfp/ay+Dvjwpe8YtMuEI5b09bxmo=", "owner": "nix-community", "repo": "disko", - "rev": "64679cd7f318c9b6595902b47d4585b1d51d5f9e", + "rev": "f1a00e7f55dc266ef286cc6fc8458fa2b5ca2414", "type": "github" }, "original": { @@ -47,11 +47,11 @@ ] }, "locked": { - "lastModified": 1720367448, - "narHash": "sha256-GttUD2lobMaLCYC3f39SBFSH2Ji7v1Yf+JOFYKYuQ7Y=", + "lastModified": 1720443333, + "narHash": "sha256-VS0HCv6M2Fr+XpCYpqkUNm74GboXlK2mPLWvSPsGMBg=", "owner": "karaolidis", "repo": "home-manager", - "rev": "f837c613224c4709412e563d43f3ec3b50acedda", + "rev": "178325dcb3e4afbf725d21cdc7f366f1c7f1a448", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 12c5a5b..27cd3b9 100644 --- a/flake.nix +++ b/flake.nix @@ -46,19 +46,27 @@ }; }; - outputs = { self, nixpkgs, ... } @ inputs: { - nixosConfigurations = { - eirene-vm = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - system = "x86_64-linux"; - modules = [ ./hosts/eirene/vm ]; + outputs = + { self, nixpkgs, ... }@inputs: + { + nixosConfigurations = { + eirene-vm = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + }; + system = "x86_64-linux"; + modules = [ ./hosts/eirene/vm ]; + }; + + eirene = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + }; + system = "x86_64-linux"; + modules = [ ./hosts/eirene/base ]; + }; }; - eirene = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - system = "x86_64-linux"; - modules = [ ./hosts/eirene/base ]; - }; + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; }; - }; } diff --git a/hosts/common/configs/bluetooth/default.nix b/hosts/common/configs/bluetooth/default.nix index 30dc518..14dcff1 100644 --- a/hosts/common/configs/bluetooth/default.nix +++ b/hosts/common/configs/bluetooth/default.nix @@ -7,7 +7,5 @@ }; }; - environment.persistence."/persist".directories = [ - "/var/lib/bluetooth" - ]; + environment.persistence."/persist".directories = [ "/var/lib/bluetooth" ]; } diff --git a/hosts/common/configs/boot/default.nix b/hosts/common/configs/boot/default.nix index eb52361..6468e1a 100644 --- a/hosts/common/configs/boot/default.nix +++ b/hosts/common/configs/boot/default.nix @@ -1,5 +1,4 @@ { pkgs, ... }: - { boot = { loader = { @@ -14,6 +13,9 @@ initrd.systemd.enable = true; kernelPackages = pkgs.linuxPackages_latest; - supportedFilesystems = [ "btrfs" "ntfs" ]; + supportedFilesystems = [ + "btrfs" + "ntfs" + ]; }; } diff --git a/hosts/common/configs/brightnessctl/default.nix b/hosts/common/configs/brightnessctl/default.nix index 464ed2c..e6223ae 100644 --- a/hosts/common/configs/brightnessctl/default.nix +++ b/hosts/common/configs/brightnessctl/default.nix @@ -1,12 +1,16 @@ -{ config, lib, pkgs, ... }: - +{ + config, + lib, + pkgs, + ... +}: { environment.systemPackages = with pkgs; [ brightnessctl ]; services.udev.extraRules = let - chgrp = "${pkgs.coreutils-full}/bin/chgrp"; - chmod = "${pkgs.coreutils-full}/bin/chmod"; + chgrp = "${pkgs.coreutils}/bin/chgrp"; + chmod = "${pkgs.coreutils}/bin/chmod"; in '' ACTION=="add", SUBSYSTEM=="backlight", RUN+="${chgrp} video /sys/class/backlight/%k/brightness" @@ -17,8 +21,9 @@ users.groups = let - members = builtins.attrNames - (lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users); + members = builtins.attrNames ( + lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users + ); in { video.members = members; diff --git a/hosts/common/configs/btop/default.nix b/hosts/common/configs/btop/default.nix index 29c4959..589fd7f 100644 --- a/hosts/common/configs/btop/default.nix +++ b/hosts/common/configs/btop/default.nix @@ -1,5 +1,4 @@ { pkgs, ... }: - { environment.systemPackages = with pkgs; [ btop ]; } diff --git a/hosts/common/configs/fastfetch/default.nix b/hosts/common/configs/fastfetch/default.nix index 23745db..b25ccc6 100644 --- a/hosts/common/configs/fastfetch/default.nix +++ b/hosts/common/configs/fastfetch/default.nix @@ -1,5 +1,4 @@ { pkgs, ... }: - { environment.systemPackages = with pkgs; [ fastfetch ]; } diff --git a/hosts/common/configs/getty/default.nix b/hosts/common/configs/getty/default.nix index 23d3241..7e33c6c 100644 --- a/hosts/common/configs/getty/default.nix +++ b/hosts/common/configs/getty/default.nix @@ -1,5 +1,4 @@ { config, lib, ... }: - { services.getty.extraArgs = lib.mkIf (config.services.getty.autologinUser != null) [ "--skip-login" diff --git a/hosts/common/configs/gpg-agent/default.nix b/hosts/common/configs/gpg-agent/default.nix index 46959f3..3ac32ea 100644 --- a/hosts/common/configs/gpg-agent/default.nix +++ b/hosts/common/configs/gpg-agent/default.nix @@ -1,3 +1 @@ -{ - programs.gnupg.agent.enable = true; -} +{ programs.gnupg.agent.enable = true; } diff --git a/hosts/common/configs/networking/default.nix b/hosts/common/configs/networking/default.nix index f9015b0..4ed1869 100644 --- a/hosts/common/configs/networking/default.nix +++ b/hosts/common/configs/networking/default.nix @@ -1,7 +1,5 @@ { networking.networkmanager.enable = true; - environment.persistence."/persist".directories = [ - "/etc/NetworkManager/system-connections" - ]; + environment.persistence."/persist".directories = [ "/etc/NetworkManager/system-connections" ]; } diff --git a/hosts/common/configs/nix/default.nix b/hosts/common/configs/nix/default.nix index 28cf765..1d8574b 100644 --- a/hosts/common/configs/nix/default.nix +++ b/hosts/common/configs/nix/default.nix @@ -1,10 +1,12 @@ { inputs, ... }: - { nix = { settings = { use-xdg-base-directories = true; - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; }; registry.self.flake = inputs.self; diff --git a/hosts/common/configs/persist/default.nix b/hosts/common/configs/persist/default.nix index cfb5b39..f24f7d0 100644 --- a/hosts/common/configs/persist/default.nix +++ b/hosts/common/configs/persist/default.nix @@ -1,5 +1,4 @@ { inputs, pkgs, ... }: - { imports = [ inputs.impermanence.nixosModules.impermanence ]; @@ -39,8 +38,6 @@ "/var/lib/systemd/coredump" "/var/log" ]; - files = [ - "/etc/machine-id" - ]; + files = [ "/etc/machine-id" ]; }; } diff --git a/hosts/common/configs/pipewire/default.nix b/hosts/common/configs/pipewire/default.nix index e455363..394c7c0 100644 --- a/hosts/common/configs/pipewire/default.nix +++ b/hosts/common/configs/pipewire/default.nix @@ -8,10 +8,12 @@ pulse.enable = true; jack.enable = true; extraConfig.pipewire-pulse = { - pulse.cmd = [{ - cmd = "load-module"; - args = "module-switch-on-connect"; - }]; + pulse.cmd = [ + { + cmd = "load-module"; + args = "module-switch-on-connect"; + } + ]; }; }; } diff --git a/hosts/common/configs/plymouth/default.nix b/hosts/common/configs/plymouth/default.nix index 25cb4e7..10d28e6 100644 --- a/hosts/common/configs/plymouth/default.nix +++ b/hosts/common/configs/plymouth/default.nix @@ -1,5 +1,4 @@ { pkgs, ... }: - { boot = { plymouth = @@ -9,9 +8,7 @@ { enable = true; inherit theme; - themePackages = with pkgs; [ - (adi1090x-plymouth-themes.override { selected_themes = [ theme ]; }) - ]; + themePackages = with pkgs; [ (adi1090x-plymouth-themes.override { selected_themes = [ theme ]; }) ]; }; initrd.verbose = false; diff --git a/hosts/common/configs/ranger/default.nix b/hosts/common/configs/ranger/default.nix index bae7f36..0b3f4a9 100644 --- a/hosts/common/configs/ranger/default.nix +++ b/hosts/common/configs/ranger/default.nix @@ -1,5 +1,4 @@ { pkgs, ... }: - { environment.systemPackages = with pkgs; [ ranger ]; } diff --git a/hosts/common/configs/sops/default.nix b/hosts/common/configs/sops/default.nix index ff4d06c..f4434a9 100644 --- a/hosts/common/configs/sops/default.nix +++ b/hosts/common/configs/sops/default.nix @@ -1,5 +1,4 @@ { inputs, pkgs, ... }: - { imports = [ inputs.sops-nix.nixosModules.sops ]; diff --git a/hosts/common/configs/system/default.nix b/hosts/common/configs/system/default.nix index fb972b9..fdadd42 100644 --- a/hosts/common/configs/system/default.nix +++ b/hosts/common/configs/system/default.nix @@ -1,5 +1,4 @@ { inputs, ... }: - { system = { autoUpgrade = { diff --git a/hosts/common/configs/tree/default.nix b/hosts/common/configs/tree/default.nix index 3fe33f9..bdc89c8 100644 --- a/hosts/common/configs/tree/default.nix +++ b/hosts/common/configs/tree/default.nix @@ -1,5 +1,4 @@ { pkgs, ... }: - { environment.systemPackages = with pkgs; [ tree ]; } diff --git a/hosts/common/configs/users/default.nix b/hosts/common/configs/users/default.nix index 8f2fbbb..ddecfca 100644 --- a/hosts/common/configs/users/default.nix +++ b/hosts/common/configs/users/default.nix @@ -1,5 +1,4 @@ { pkgs, ... }: - { users = { mutableUsers = false; diff --git a/hosts/common/scripts/cleanup/default.nix b/hosts/common/scripts/cleanup/default.nix index 3b26f47..a31b72c 100644 --- a/hosts/common/scripts/cleanup/default.nix +++ b/hosts/common/scripts/cleanup/default.nix @@ -1,11 +1,10 @@ { pkgs, ... }: - { environment.systemPackages = [ (pkgs.writeShellApplication { name = "nix-cleanup"; runtimeInputs = with pkgs; [ - coreutils-full + coreutils util-linux findutils btrfs-progs diff --git a/hosts/eirene/base/default.nix b/hosts/eirene/base/default.nix index 7d28f79..09253ee 100644 --- a/hosts/eirene/base/default.nix +++ b/hosts/eirene/base/default.nix @@ -1,9 +1,16 @@ -{ config, inputs, lib, pkgs, ... }: - +{ + config, + inputs, + lib, + pkgs, + ... +}: { imports = [ inputs.disko.nixosModules.disko - (import ../format.nix { device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00BL2_S64RNE0R602762"; }) + (import ../format.nix { + device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00BL2_S64RNE0R602762"; + }) ./hardware-configuration.nix ../. ]; @@ -58,31 +65,38 @@ }; boot = { - kernelParams = [ "amd_pstate=active" "video=eDP-1:2560x1600@165" ]; + kernelParams = [ + "amd_pstate=active" + "video=eDP-1:2560x1600@165" + ]; initrd.kernelModules = [ "amdgpu" ]; }; - home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [{ - wayland.windowManager.hyprland.settings = { - monitor = "eDP-1, 2560x1600@165, 0x0, 1.25"; - env = [ "WLR_DRM_DEVICES,$HOME/.config/hypr/card" ]; - device = [{ - name = "syna2ba6:00-06cb:ce44-touchpad"; - sensitivity = 0.5; - }]; - gestures.workspace_swipe_distance = 600; - }; + home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [ + { + wayland.windowManager.hyprland.settings = { + monitor = "eDP-1, 2560x1600@165, 0x0, 1.25"; + env = [ "WLR_DRM_DEVICES,$HOME/.config/hypr/card" ]; + device = [ + { + name = "syna2ba6:00-06cb:ce44-touchpad"; + sensitivity = 0.5; + } + ]; + gestures.workspace_swipe_distance = 600; + }; - programs = { - zsh.loginExtra = lib.mkBefore (builtins.readFile ./card.sh); - # VSCode does not play well with fractional scaling - vscode.userSettings."window.zoomLevel" = (1.25 - 1) / 0.2; - }; + programs = { + zsh.loginExtra = lib.mkBefore (builtins.readFile ./card.sh); + # VSCode does not play well with fractional scaling + vscode.userSettings."window.zoomLevel" = (1.25 - 1) / 0.2; + }; - theme = { - cursor.size = 24; - }; - }]; + theme = { + cursor.size = 24; + }; + } + ]; nixpkgs.config = { cudaSupport = true; diff --git a/hosts/eirene/base/hardware-configuration.nix b/hosts/eirene/base/hardware-configuration.nix index 59f493c..9eeb2cd 100644 --- a/hosts/eirene/base/hardware-configuration.nix +++ b/hosts/eirene/base/hardware-configuration.nix @@ -1,10 +1,13 @@ { lib, modulesPath, ... }: - { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot = { - initrd.availableKernelModules = [ "nvme" "ahci" "usbhid" ]; + initrd.availableKernelModules = [ + "nvme" + "ahci" + "usbhid" + ]; kernelModules = [ "kvm-amd" ]; }; diff --git a/hosts/eirene/default.nix b/hosts/eirene/default.nix index 3c50505..eeac62c 100644 --- a/hosts/eirene/default.nix +++ b/hosts/eirene/default.nix @@ -4,5 +4,6 @@ (import ../../users/nick { autologin = true; }) ]; + sops.defaultSopsFile = ./secrets/secrets.yaml; time.timeZone = "Europe/Athens"; } diff --git a/hosts/eirene/format.nix b/hosts/eirene/format.nix index 97f7c8f..ac91995 100644 --- a/hosts/eirene/format.nix +++ b/hosts/eirene/format.nix @@ -1,5 +1,7 @@ -{ device ? throw "device argument is required", ... }: - +{ + device ? throw "device argument is required", + ... +}: { disko.devices = { disk.main = { @@ -49,15 +51,24 @@ }; "@persist" = { mountpoint = "/persist"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = [ + "compress=zstd" + "noatime" + ]; }; "@nix" = { mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = [ + "compress=zstd" + "noatime" + ]; }; "@cache" = { mountpoint = "/cache"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = [ + "compress=zstd" + "noatime" + ]; }; }; }; diff --git a/hosts/eirene/vm/default.nix b/hosts/eirene/vm/default.nix index 6a6fdcc..cc6e8ce 100644 --- a/hosts/eirene/vm/default.nix +++ b/hosts/eirene/vm/default.nix @@ -1,5 +1,9 @@ -{ config, inputs, lib, ... }: - +{ + config, + inputs, + lib, + ... +}: { imports = [ inputs.disko.nixosModules.disko @@ -17,5 +21,7 @@ fsType = "virtiofs"; }; - home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [{ wayland.windowManager.hyprland.settings.monitor = "Virtual-1, 2560x1600@60, 0x0, 1"; }]; + home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [ + { wayland.windowManager.hyprland.settings.monitor = "Virtual-1, 2560x1600@60, 0x0, 1"; } + ]; } diff --git a/hosts/eirene/vm/hardware-configuration.nix b/hosts/eirene/vm/hardware-configuration.nix index 76e285f..30408b7 100644 --- a/hosts/eirene/vm/hardware-configuration.nix +++ b/hosts/eirene/vm/hardware-configuration.nix @@ -1,10 +1,16 @@ { lib, modulesPath, ... }: - { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; boot = { - initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ]; + initrd.availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "virtio_scsi" + "sr_mod" + "virtio_blk" + ]; kernelModules = [ "kvm-amd" ]; }; diff --git a/users/common/configs/persist/default.nix b/users/common/configs/persist/default.nix index 225d485..429097e 100644 --- a/users/common/configs/persist/default.nix +++ b/users/common/configs/persist/default.nix @@ -1,5 +1,9 @@ -{ config, inputs, lib, ... }: - +{ + config, + inputs, + lib, + ... +}: let users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users; in @@ -10,19 +14,17 @@ in [ "d /persist/home 0755 root root -" "d /cache/home 0755 root root -" - ] ++ - lib.attrsets.mapAttrsToList (user: config: "d /persist${config.home} 0700 ${user} users -") users ++ - lib.attrsets.mapAttrsToList (user: config: "d /cache${config.home} 0700 ${user} users -") users + ] + ++ lib.attrsets.mapAttrsToList (user: config: "d /persist${config.home} 0700 ${user} users -") users + ++ lib.attrsets.mapAttrsToList (user: config: "d /cache${config.home} 0700 ${user} users -") users ); - home-manager.users = lib.attrsets.mapAttrs - (user: config: ({ - imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ]; + home-manager.users = lib.attrsets.mapAttrs (user: config: { + imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ]; - home.persistence = { - "/persist${config.home}".allowOther = true; - "/cache${config.home}".allowOther = true; - }; - })) - users; + home.persistence = { + "/persist${config.home}".allowOther = true; + "/cache${config.home}".allowOther = true; + }; + }) users; } diff --git a/users/common/configs/sops/default.nix b/users/common/configs/sops/default.nix index f468aff..2df868d 100644 --- a/users/common/configs/sops/default.nix +++ b/users/common/configs/sops/default.nix @@ -1,20 +1,22 @@ -{ config, inputs, lib, ... }: - +{ + config, + inputs, + lib, + ... +}: let users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users; sopsKeyPath = ".config/sops-nix/key.txt"; in { - home-manager.users = lib.attrsets.mapAttrs - (user: config: ({ - imports = [ inputs.sops-nix.homeManagerModules.sops ]; + home-manager.users = lib.attrsets.mapAttrs (user: config: { + imports = [ inputs.sops-nix.homeManagerModules.sops ]; - sops.age.keyFile = "/persist${config.home}/${sopsKeyPath}"; + sops.age.keyFile = "/persist${config.home}/${sopsKeyPath}"; - home = { - persistence."/persist${config.home}".files = [ sopsKeyPath ]; - sessionVariables.SOPS_AGE_KEY_FILE = "${config.home}/${sopsKeyPath}"; - }; - })) - users; + home = { + persistence."/persist${config.home}".files = [ sopsKeyPath ]; + sessionVariables.SOPS_AGE_KEY_FILE = "${config.home}/${sopsKeyPath}"; + }; + }) users; } diff --git a/users/common/configs/xdg/default.nix b/users/common/configs/xdg/default.nix index 8fe974b..01f7e37 100644 --- a/users/common/configs/xdg/default.nix +++ b/users/common/configs/xdg/default.nix @@ -1,35 +1,32 @@ { config, lib, ... }: - let users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users; in { - home-manager.users = lib.attrsets.mapAttrs - (user: cfg: ({ - xdg = { - enable = true; - mimeApps.enable = true; + home-manager.users = lib.attrsets.mapAttrs (user: cfg: { + xdg = { + enable = true; + mimeApps.enable = true; - userDirs = { - enable = true; - extraConfig = { - XDG_VM_DIR = "${cfg.home}/VMs"; - XDG_GIT_DIR = "${cfg.home}/git"; - }; + userDirs = { + enable = true; + extraConfig = { + XDG_VM_DIR = "${cfg.home}/VMs"; + XDG_GIT_DIR = "${cfg.home}/git"; }; }; + }; - home.persistence."/persist${cfg.home}".directories = [ - "Desktop" # userDirs.desktop - "Documents" # userDirs.documents - "Downloads" # userDirs.download - "Music" # userDirs.music - "Pictures" # userDirs.pictures - "Templates" # userDirs.templates - "Videos" # userDirs.videos - "VMs" - "git" - ]; - })) - users; + home.persistence."/persist${cfg.home}".directories = [ + "Desktop" # userDirs.desktop + "Documents" # userDirs.documents + "Downloads" # userDirs.download + "Music" # userDirs.music + "Pictures" # userDirs.pictures + "Templates" # userDirs.templates + "Videos" # userDirs.videos + "VMs" + "git" + ]; + }) users; } diff --git a/users/common/default.nix b/users/common/default.nix index 74ccbfa..bcc8ad2 100644 --- a/users/common/default.nix +++ b/users/common/default.nix @@ -1,5 +1,4 @@ { config, inputs, ... }: - { imports = [ inputs.home-manager.nixosModules.default @@ -10,22 +9,26 @@ ]; home-manager = { - extraSpecialArgs = { inherit inputs; }; + extraSpecialArgs = { + inherit inputs; + }; backupFileExtension = "bak"; useGlobalPkgs = true; - sharedModules = [{ - imports = [ - ./options/home-manager/xdg - ./options/home-manager/hyprland - ./options/home-manager/matugen - ./options/home-manager/theme - ]; + sharedModules = [ + { + imports = [ + ./options/home-manager/xdg + ./options/home-manager/hyprland + ./options/home-manager/matugen + ./options/home-manager/theme + ]; - home.stateVersion = "24.05"; - systemd.user.startServices = "sd-switch"; - nix.settings = config.nix.settings; - nixpkgs.config = config.nixpkgs.config; - }]; + home.stateVersion = "24.05"; + systemd.user.startServices = "sd-switch"; + nix.settings = config.nix.settings; + nixpkgs.config = config.nixpkgs.config; + } + ]; }; programs.dconf.enable = true; diff --git a/users/common/options/default.nix b/users/common/options/default.nix index 4b811d9..f8121d0 100644 --- a/users/common/options/default.nix +++ b/users/common/options/default.nix @@ -1,22 +1,26 @@ { lib, ... }: - let - userOptions = with lib; with types; { config, ... }: { - options.email = mkOption { - type = nullOr str; - description = "Email address of the user."; - }; + userOptions = + with lib; + with types; + { config, ... }: + { + options.email = mkOption { + type = nullOr str; + description = "Email address of the user."; + }; - options.fullName = mkOption { - type = nullOr str; - description = "Full name of the user."; + options.fullName = mkOption { + type = nullOr str; + description = "Full name of the user."; + }; }; - }; in { - options = with lib; with types; { - users.users = mkOption { - type = attrsOf (submodule userOptions); + options = + with lib; + with types; + { + users.users = mkOption { type = attrsOf (submodule userOptions); }; }; - }; } diff --git a/users/common/options/home-manager/hyprland/default.nix b/users/common/options/home-manager/hyprland/default.nix index 3cfce48..3972d2d 100644 --- a/users/common/options/home-manager/hyprland/default.nix +++ b/users/common/options/home-manager/hyprland/default.nix @@ -1,32 +1,43 @@ -{ config, pkgs, lib, ... }: - +{ + config, + pkgs, + lib, + ... +}: let cfg = config.wayland.windowManager.hyprland; in { - options.wayland.windowManager.hyprland = with lib; with types; { - initExtraConfig = mkOption { - type = lines; - default = ""; - description = "Extra configuration lines to add to exec-once"; - }; + options.wayland.windowManager.hyprland = + with lib; + with types; + { + initExtraConfig = mkOption { + type = lines; + default = ""; + description = "Extra configuration lines to add to exec-once"; + }; - reloadExtraConfig = mkOption { - type = lines; - default = ""; - description = "Extra configuration lines to add to exec"; + reloadExtraConfig = mkOption { + type = lines; + default = ""; + description = "Extra configuration lines to add to exec"; + }; }; - }; config = { - wayland.windowManager.hyprland.settings.exec-once = lib.meta.getExe (pkgs.writeShellApplication { - name = "init-hyprland"; - text = cfg.initExtraConfig; - }); + wayland.windowManager.hyprland.settings.exec-once = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "init-hyprland"; + text = cfg.initExtraConfig; + } + ); - wayland.windowManager.hyprland.settings.exec = lib.meta.getExe (pkgs.writeShellApplication { - name = "reload-hyprland"; - text = cfg.reloadExtraConfig; - }); + wayland.windowManager.hyprland.settings.exec = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "reload-hyprland"; + text = cfg.reloadExtraConfig; + } + ); }; } diff --git a/users/common/options/home-manager/matugen/default.nix b/users/common/options/home-manager/matugen/default.nix index a68fb42..bee78b8 100644 --- a/users/common/options/home-manager/matugen/default.nix +++ b/users/common/options/home-manager/matugen/default.nix @@ -1,18 +1,25 @@ -{ config, pkgs, lib, ... }: - +{ + config, + pkgs, + lib, + ... +}: let cfg = config.programs.matugen; in { # https://github.com/Theaninova/matugen/blob/add-home-manager-module/hm-module.nix - options.programs.matugen = with lib; with types; { - enable = mkEnableOption "matugen"; - package = mkPackageOption pkgs "matugen" { }; - settings = mkOption { - type = attrsOf anything; - description = "Settings to write to config.toml."; + options.programs.matugen = + with lib; + with types; + { + enable = mkEnableOption "matugen"; + package = mkPackageOption pkgs "matugen" { }; + settings = mkOption { + type = attrsOf anything; + description = "Settings to write to config.toml."; + }; }; - }; config = lib.mkIf cfg.enable { home.packages = [ cfg.package ]; diff --git a/users/common/options/home-manager/theme/default.nix b/users/common/options/home-manager/theme/default.nix index af2e31a..6c2a800 100644 --- a/users/common/options/home-manager/theme/default.nix +++ b/users/common/options/home-manager/theme/default.nix @@ -1,11 +1,18 @@ -{ config, lib, pkgs, ... }: - +{ + config, + lib, + pkgs, + ... +}: let cfg = config.theme; init = pkgs.writeShellApplication { name = "theme"; - runtimeInputs = with pkgs; [ coreutils-full ]; - bashOptions = [ "nounset" "pipefail" ]; + runtimeInputs = with pkgs; [ coreutils ]; + bashOptions = [ + "nounset" + "pipefail" + ]; runtimeEnv = { CONFIG = cfg.configDir; DEFAULT_WALLPAPER = cfg.wallpaper; @@ -17,336 +24,348 @@ let in { # https://github.com/Theaninova/TheaninovOS/blob/master/modules/home-manager/theme/md3-evo.nix - options.theme = with lib; with types; { - enable = mkEnableOption "theme"; + options.theme = + with lib; + with types; + { + enable = mkEnableOption "theme"; - configDir = mkOption { - type = str; - default = "${config.xdg.configHome}/theme"; - description = "The path to the theme config directory."; - }; - - wallpaper = mkOption { - type = path; - description = "The path to the default wallpaper"; - }; - - pkg = mkOption { - type = package; - default = init; - readOnly = true; - description = "The package containing the `theme` script"; - }; - - extraConfig = mkOption { - type = lines; - default = ""; - description = "Extra configuration lines to add to the theme script."; - }; - - flavour = mkOption { - type = enum [ - "content" - "expressive" - "fidelity" - "fruit-salad" - "monochrome" - "neutral" - "rainbow" - "tonal-spot" - ]; - default = "tonal-spot"; - description = "The flavour of the theme."; - }; - - mode = mkOption { - type = enum [ "dark" "light" ]; - default = "dark"; - description = "The default mode of the theme."; - }; - - contrast = mkOption { - type = numbers.between (-1) 1; - default = 0; - description = "Use a modified contrast."; - }; - - opacity = mkOption { - type = numbers.between 0 1; - default = 1; - description = "The opacity of apps."; - }; - - radius = mkOption { - type = ints.unsigned; - default = 8; - description = "The radius of corners."; - }; - - padding = mkOption { - type = ints.unsigned; - default = 8; - description = "The padding of windows."; - }; - - blur = mkOption { - type = ints.unsigned; - default = 0; - description = "The blur amount of windows."; - }; - - color = { - semantic = { - blend = mkOption { - type = bool; - default = false; - description = "Blend the colors."; - }; - - danger = mkOption { - type = str; - default = "#ff0000"; - description = "The color of danger."; - }; - - warning = mkOption { - type = str; - default = "#ffff00"; - description = "The color of warning."; - }; - - success = mkOption { - type = str; - default = "#00ff00"; - description = "The color of success."; - }; - - info = mkOption { - type = str; - default = "#0000ff"; - description = "The color of info."; - }; + configDir = mkOption { + type = str; + default = "${config.xdg.configHome}/theme"; + description = "The path to the theme config directory."; }; - syntax = { - blend = mkOption { - type = bool; - default = true; - description = "Blend the colors."; - }; - - keywords = mkOption { - type = str; - default = "#ff8000"; - description = "The color of keywords."; - }; - - functions = mkOption { - type = str; - default = "#0000ff"; - description = "The color of functions."; - }; - - properties = mkOption { - type = str; - default = "#ff00ff"; - description = "The color of properties."; - }; - - constants = mkOption { - type = str; - default = "#ff00ff"; - description = "The color of constants."; - }; - - strings = mkOption { - type = str; - default = "#00ff00"; - description = "The color of variables."; - }; - - numbers = mkOption { - type = str; - default = "#00ffff"; - description = "The color of numbers."; - }; - - structures = mkOption { - type = str; - default = "#ffff00"; - description = "The color of structures."; - }; - - types = mkOption { - type = str; - default = "#00ffff"; - description = "The color of types."; - }; + wallpaper = mkOption { + type = path; + description = "The path to the default wallpaper"; }; - ansi = { - blend = mkOption { - type = bool; - default = true; - description = "Blend the colors."; - }; - - red = mkOption { - type = str; - default = "#ff0000"; - description = "The color of red."; - }; - - green = mkOption { - type = str; - default = "#00ff00"; - description = "The color of green."; - }; - - yellow = mkOption { - type = str; - default = "#ffff00"; - description = "The color of yellow."; - }; - - orange = mkOption { - type = str; - default = "#ff8000"; - description = "The color of orange."; - }; - - blue = mkOption { - type = str; - default = "#0000ff"; - description = "The color of blue."; - }; - - magenta = mkOption { - type = str; - default = "#ff00ff"; - description = "The color of magenta."; - }; - - cyan = mkOption { - type = str; - default = "#00ffff"; - description = "The color of cyan."; - }; - }; - }; - - font = { - sansSerif = { - names = mkOption { - type = listOf str; - default = [ "Roboto" ]; - description = "The sans serif font families."; - }; - - packages = mkOption { - type = listOf package; - default = with pkgs; [ roboto ]; - description = "The sans serif font packages."; - }; + pkg = mkOption { + type = package; + default = init; + readOnly = true; + description = "The package containing the `theme` script"; }; - serif = { - names = mkOption { - type = listOf str; - default = [ "Roboto Serif" ]; - description = "The serif font families."; - }; - - packages = mkOption { - type = listOf package; - default = with pkgs; [ roboto-serif ]; - description = "The serif font packages."; - }; + extraConfig = mkOption { + type = lines; + default = ""; + description = "Extra configuration lines to add to the theme script."; }; - monospace = { - names = mkOption { - type = listOf str; - default = [ "JetBrainsMono Nerd Font" ]; - description = "The monospace font families."; - }; - - packages = mkOption { - type = listOf package; - default = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ]; - description = "The monospace font packages."; - }; - }; - - emoji = { - names = mkOption { - type = listOf str; - default = [ "Noto Emoji" "Font Awesome" ]; - description = "The emoji font families."; - }; - - packages = mkOption { - type = listOf package; - default = with pkgs; [ noto-fonts-color-emoji font-awesome ]; - description = "The emoji font packages."; - }; - }; - - size = mkOption { - type = ints.positive; - default = 12; - description = "The font size."; - }; - }; - - icon = { - names = mkOption { - type = listOf str; - default = [ "Adwaita" ]; - description = "The icon theme names."; - }; - - packages = mkOption { - type = listOf package; - default = with pkgs; [ - adwaita-icon-theme - nixos-icons + flavour = mkOption { + type = enum [ + "content" + "expressive" + "fidelity" + "fruit-salad" + "monochrome" + "neutral" + "rainbow" + "tonal-spot" ]; - description = "The icon theme packages."; + default = "tonal-spot"; + description = "The flavour of the theme."; + }; + + mode = mkOption { + type = enum [ + "dark" + "light" + ]; + default = "dark"; + description = "The default mode of the theme."; + }; + + contrast = mkOption { + type = numbers.between (-1) 1; + default = 0; + description = "Use a modified contrast."; + }; + + opacity = mkOption { + type = numbers.between 0 1; + default = 1; + description = "The opacity of apps."; + }; + + radius = mkOption { + type = ints.unsigned; + default = 8; + description = "The radius of corners."; + }; + + padding = mkOption { + type = ints.unsigned; + default = 8; + description = "The padding of windows."; + }; + + blur = mkOption { + type = ints.unsigned; + default = 0; + description = "The blur amount of windows."; + }; + + color = { + semantic = { + blend = mkOption { + type = bool; + default = false; + description = "Blend the colors."; + }; + + danger = mkOption { + type = str; + default = "#ff0000"; + description = "The color of danger."; + }; + + warning = mkOption { + type = str; + default = "#ffff00"; + description = "The color of warning."; + }; + + success = mkOption { + type = str; + default = "#00ff00"; + description = "The color of success."; + }; + + info = mkOption { + type = str; + default = "#0000ff"; + description = "The color of info."; + }; + }; + + syntax = { + blend = mkOption { + type = bool; + default = true; + description = "Blend the colors."; + }; + + keywords = mkOption { + type = str; + default = "#ff8000"; + description = "The color of keywords."; + }; + + functions = mkOption { + type = str; + default = "#0000ff"; + description = "The color of functions."; + }; + + properties = mkOption { + type = str; + default = "#ff00ff"; + description = "The color of properties."; + }; + + constants = mkOption { + type = str; + default = "#ff00ff"; + description = "The color of constants."; + }; + + strings = mkOption { + type = str; + default = "#00ff00"; + description = "The color of variables."; + }; + + numbers = mkOption { + type = str; + default = "#00ffff"; + description = "The color of numbers."; + }; + + structures = mkOption { + type = str; + default = "#ffff00"; + description = "The color of structures."; + }; + + types = mkOption { + type = str; + default = "#00ffff"; + description = "The color of types."; + }; + }; + + ansi = { + blend = mkOption { + type = bool; + default = true; + description = "Blend the colors."; + }; + + red = mkOption { + type = str; + default = "#ff0000"; + description = "The color of red."; + }; + + green = mkOption { + type = str; + default = "#00ff00"; + description = "The color of green."; + }; + + yellow = mkOption { + type = str; + default = "#ffff00"; + description = "The color of yellow."; + }; + + orange = mkOption { + type = str; + default = "#ff8000"; + description = "The color of orange."; + }; + + blue = mkOption { + type = str; + default = "#0000ff"; + description = "The color of blue."; + }; + + magenta = mkOption { + type = str; + default = "#ff00ff"; + description = "The color of magenta."; + }; + + cyan = mkOption { + type = str; + default = "#00ffff"; + description = "The color of cyan."; + }; + }; + }; + + font = { + sansSerif = { + names = mkOption { + type = listOf str; + default = [ "Roboto" ]; + description = "The sans serif font families."; + }; + + packages = mkOption { + type = listOf package; + default = with pkgs; [ roboto ]; + description = "The sans serif font packages."; + }; + }; + + serif = { + names = mkOption { + type = listOf str; + default = [ "Roboto Serif" ]; + description = "The serif font families."; + }; + + packages = mkOption { + type = listOf package; + default = with pkgs; [ roboto-serif ]; + description = "The serif font packages."; + }; + }; + + monospace = { + names = mkOption { + type = listOf str; + default = [ "JetBrainsMono Nerd Font" ]; + description = "The monospace font families."; + }; + + packages = mkOption { + type = listOf package; + default = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ]; + description = "The monospace font packages."; + }; + }; + + emoji = { + names = mkOption { + type = listOf str; + default = [ + "Noto Emoji" + "Font Awesome" + ]; + description = "The emoji font families."; + }; + + packages = mkOption { + type = listOf package; + default = with pkgs; [ + noto-fonts-color-emoji + font-awesome + ]; + description = "The emoji font packages."; + }; + }; + + size = mkOption { + type = ints.positive; + default = 12; + description = "The font size."; + }; + }; + + icon = { + names = mkOption { + type = listOf str; + default = [ "Adwaita" ]; + description = "The icon theme names."; + }; + + packages = mkOption { + type = listOf package; + default = with pkgs; [ + adwaita-icon-theme + nixos-icons + ]; + description = "The icon theme packages."; + }; + }; + + cursor = { + names = mkOption { + type = listOf str; + default = [ "Adwaita" ]; + description = "The cursor names."; + }; + + packages = mkOption { + type = listOf package; + default = with pkgs; [ adwaita-icon-theme ]; + description = "The cursor theme packages."; + }; + + size = mkOption { + type = ints.positive; + default = 32; + description = "The cursor size."; + }; }; }; - cursor = { - names = mkOption { - type = listOf str; - default = [ "Adwaita" ]; - description = "The cursor names."; - }; - - packages = mkOption { - type = listOf package; - default = with pkgs; [ adwaita-icon-theme ]; - description = "The cursor theme packages."; - }; - - size = mkOption { - type = ints.positive; - default = 32; - description = "The cursor size."; - }; - }; - }; - config = lib.mkIf cfg.enable { home = { packages = - [ cfg.pkg ] ++ - cfg.font.sansSerif.packages ++ - cfg.font.serif.packages ++ - cfg.font.monospace.packages ++ - cfg.font.emoji.packages ++ - cfg.icon.packages ++ - cfg.cursor.packages; + [ cfg.pkg ] + ++ cfg.font.sansSerif.packages + ++ cfg.font.serif.packages + ++ cfg.font.monospace.packages + ++ cfg.font.emoji.packages + ++ cfg.icon.packages + ++ cfg.cursor.packages; pointerCursor = { name = builtins.head cfg.cursor.names; diff --git a/users/common/options/home-manager/xdg/default.nix b/users/common/options/home-manager/xdg/default.nix index 3a4482e..a6170c2 100644 --- a/users/common/options/home-manager/xdg/default.nix +++ b/users/common/options/home-manager/xdg/default.nix @@ -1,48 +1,42 @@ { config, lib, ... }: - let cfg = config.xdg; in { - options.xdg = with lib; with types; { - relativeCacheHome = mkOption { - type = str; - default = ".cache"; - description = "Relative path to directory holding application caches."; - }; + options.xdg = + with lib; + with types; + { + relativeCacheHome = mkOption { + type = str; + default = ".cache"; + description = "Relative path to directory holding application caches."; + }; - cacheHome = mkOption { - default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}"; - }; + cacheHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}"; }; - relativeConfigHome = mkOption { - type = str; - default = ".config"; - description = "Relative path to directory holding application configurations."; - }; + relativeConfigHome = mkOption { + type = str; + default = ".config"; + description = "Relative path to directory holding application configurations."; + }; - configHome = mkOption { - default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}"; - }; + configHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}"; }; - relativeDataHome = mkOption { - type = str; - default = ".local/share"; - description = "Relative path to directory holding application data."; - }; + relativeDataHome = mkOption { + type = str; + default = ".local/share"; + description = "Relative path to directory holding application data."; + }; - dataHome = mkOption { - default = "${config.home.homeDirectory}/${cfg.relativeDataHome}"; - }; + dataHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeDataHome}"; }; - relativeStateHome = mkOption { - type = str; - default = ".local/state"; - description = "Relative path to directory holding application states."; - }; + relativeStateHome = mkOption { + type = str; + default = ".local/state"; + description = "Relative path to directory holding application states."; + }; - stateHome = mkOption { - default = "${config.home.homeDirectory}/${cfg.relativeStateHome}"; + stateHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeStateHome}"; }; }; - }; } diff --git a/users/configs/bluetooth/default.nix b/users/configs/bluetooth/default.nix deleted file mode 100644 index a300c56..0000000 --- a/users/configs/bluetooth/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - -{ - home-manager.users.${user.name}.systemd.user.services.mpris-proxy = { - Unit = { - Description = "MPRIS proxy"; - Requires = [ "sound.target" ]; - After = [ "network.target" "sound.target" ]; - }; - - Service.ExecStart = lib.meta.getExe (pkgs.writeShellApplication { - name = "init-mpris-proxy"; - runtimeInputs = with pkgs; [ bluez ]; - text = "exec mpris-proxy"; - }); - - Install.WantedBy = [ "default.target" ]; - }; -} diff --git a/users/configs/brightnessctl/default.nix b/users/configs/brightnessctl/default.nix deleted file mode 100644 index 82ff0ea..0000000 --- a/users/configs/brightnessctl/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ user ? throw "user argument is required" }: { lib, pkgs, ... }: - -{ - home-manager.users.${user.name} = { - home.packages = with pkgs; [ brightnessctl ]; - - wayland.windowManager.hyprland.settings.bindle = - let - brightnessctl = lib.meta.getExe pkgs.brightnessctl; - in - [ - ", XF86MonBrightnessUp, exec, ${brightnessctl} -q s 5%+" - ", XF86MonBrightnessDown, exec, ${brightnessctl} -q s 5%-" - ]; - }; -} diff --git a/users/configs/btop/default.nix b/users/configs/btop/default.nix deleted file mode 100644 index ea6770d..0000000 --- a/users/configs/btop/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ user ? throw "user argument is required", gpu ? false }: { config, lib, pkgs, ... }: - -let - hmConfig = config.home-manager.users.${user.name}; -in -{ - home-manager.users.${user.name} = { - programs = { - btop = { - enable = true; - settings = { - color_theme = "matugen"; - theme_background = false; - presets = ""; - vim_keys = true; - shown_boxes = "cpu mem net proc gpu0 gpu1"; - update_ms = 1000; - proc_tree = true; - cpu_single_graph = true; - disks_filter = "/ /nix /persist /cache"; - }; - }; - - matugen.settings.templates.btop = { - input_path = ./theme.theme; - output_path = "${hmConfig.xdg.configHome}/btop/themes/matugen.theme"; - }; - }; - - theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { - name = "reload-btop"; - runtimeInputs = with pkgs; [ procps ]; - text = "exec pkill btop -SIGUSR2"; - })} &"; - }; -} diff --git a/users/configs/console/bluetooth/default.nix b/users/configs/console/bluetooth/default.nix new file mode 100644 index 0000000..c90c63d --- /dev/null +++ b/users/configs/console/bluetooth/default.nix @@ -0,0 +1,31 @@ +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: +{ + home-manager.users.${user.name}.systemd.user.services.mpris-proxy = { + Unit = { + Description = "MPRIS proxy"; + Requires = [ "sound.target" ]; + After = [ + "network.target" + "sound.target" + ]; + }; + + Service.ExecStart = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "init-mpris-proxy"; + runtimeInputs = with pkgs; [ bluez ]; + text = "exec mpris-proxy"; + } + ); + + Install.WantedBy = [ "default.target" ]; + }; +} diff --git a/users/configs/console/brightnessctl/default.nix b/users/configs/console/brightnessctl/default.nix new file mode 100644 index 0000000..f7b50de --- /dev/null +++ b/users/configs/console/brightnessctl/default.nix @@ -0,0 +1,7 @@ +{ + user ? throw "user argument is required", +}: +{ lib, pkgs, ... }: +{ + home-manager.users.${user.name}.home.packages = with pkgs; [ brightnessctl ]; +} diff --git a/users/configs/console/btop/default.nix b/users/configs/console/btop/default.nix new file mode 100644 index 0000000..b87b4bd --- /dev/null +++ b/users/configs/console/btop/default.nix @@ -0,0 +1,19 @@ +{ + user ? throw "user argument is required", +}: +{ ... }: +{ + home-manager.users.${user.name}.programs.btop = { + enable = true; + settings = { + theme_background = false; + presets = ""; + vim_keys = true; + shown_boxes = "cpu mem net proc gpu0 gpu1"; + update_ms = 1000; + proc_tree = true; + cpu_single_graph = true; + disks_filter = "/ /nix /persist /cache"; + }; + }; +} diff --git a/users/configs/git/commit-msg.sh b/users/configs/console/git/commit-msg.sh similarity index 100% rename from users/configs/git/commit-msg.sh rename to users/configs/console/git/commit-msg.sh diff --git a/users/configs/git/default.nix b/users/configs/console/git/default.nix similarity index 61% rename from users/configs/git/default.nix rename to users/configs/console/git/default.nix index e882007..9573916 100644 --- a/users/configs/git/default.nix +++ b/users/configs/console/git/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in @@ -22,11 +29,13 @@ in }; hooks = { - commit-msg = lib.meta.getExe (pkgs.writeShellApplication { - name = "git-commit-msg-hook"; - runtimeInputs = with pkgs; [ git ]; - text = builtins.readFile ./commit-msg.sh; - }); + commit-msg = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "git-commit-msg-hook"; + runtimeInputs = with pkgs; [ git ]; + text = builtins.readFile ./commit-msg.sh; + } + ); }; }; diff --git a/users/configs/gpg-agent/default.nix b/users/configs/console/gpg-agent/default.nix similarity index 54% rename from users/configs/gpg-agent/default.nix rename to users/configs/console/gpg-agent/default.nix index 262ca1c..60f7976 100644 --- a/users/configs/gpg-agent/default.nix +++ b/users/configs/console/gpg-agent/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; gpgPath = "${hmConfig.xdg.dataHome}/gnupg"; @@ -20,25 +27,33 @@ in systemd.user = { services.gpg-agent-import = let - init = lib.meta.getExe (pkgs.writeShellApplication { - name = "import-gpg-keys"; - runtimeInputs = with pkgs; [ - coreutils-full - gnugrep - gnupg - ]; - runtimeEnv = { - GNUPGHOME = gpgPath; - HOME = user.home; - }; - text = builtins.readFile ./import-gpg-keys.sh; - }); + init = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "import-gpg-keys"; + runtimeInputs = with pkgs; [ + coreutils + gnugrep + gnupg + ]; + runtimeEnv = { + GNUPGHOME = gpgPath; + HOME = user.home; + }; + text = builtins.readFile ./import-gpg-keys.sh; + } + ); in { Unit = { Description = "Auto-import GPG keys"; - Requires = [ "sops-nix.service" "gpg-agent.socket" ]; - After = [ "sops-nix.service" "gpg-agent.socket" ]; + Requires = [ + "sops-nix.service" + "gpg-agent.socket" + ]; + After = [ + "sops-nix.service" + "gpg-agent.socket" + ]; }; Service = { diff --git a/users/configs/gpg-agent/import-gpg-keys.sh b/users/configs/console/gpg-agent/import-gpg-keys.sh similarity index 100% rename from users/configs/gpg-agent/import-gpg-keys.sh rename to users/configs/console/gpg-agent/import-gpg-keys.sh diff --git a/users/configs/neovim/default.nix b/users/configs/console/neovim/default.nix similarity index 84% rename from users/configs/neovim/default.nix rename to users/configs/console/neovim/default.nix index cd9306b..8c2d955 100644 --- a/users/configs/neovim/default.nix +++ b/users/configs/console/neovim/default.nix @@ -1,5 +1,7 @@ -{ user ? throw "user argument is required" }: { ... }: - +{ + user ? throw "user argument is required", +}: +{ ... }: { home-manager.users.${user.name} = { programs.neovim = { diff --git a/users/configs/console/pipewire/default.nix b/users/configs/console/pipewire/default.nix new file mode 100644 index 0000000..7020d28 --- /dev/null +++ b/users/configs/console/pipewire/default.nix @@ -0,0 +1,13 @@ +{ + user ? throw "user argument is required", +}: +{ pkgs, ... }: +{ + home-manager.users.${user.name} = { + home.packages = with pkgs; [ + wireplumber + playerctl + ]; + services.playerctld.enable = true; + }; +} diff --git a/users/configs/console/syncthing/default.nix b/users/configs/console/syncthing/default.nix new file mode 100644 index 0000000..2e901c7 --- /dev/null +++ b/users/configs/console/syncthing/default.nix @@ -0,0 +1,35 @@ +{ + user ? throw "user argument is required", +}: +{ config, ... }: +{ + networking.firewall = { + allowedTCPPorts = [ 22000 ]; + allowedUDPPorts = [ + 21027 + 22000 + ]; + }; + + sops.secrets = { + # openssl ecparam -name prime256v1 -genkey -noout -out key.pem + "syncthing/key" = { + owner = user.name; + group = "users"; + }; + # openssl req -new -x509 -key key.pem -out cert.pem -days 3650 + "syncthing/cert" = { + owner = user.name; + group = "users"; + }; + }; + + home-manager.users.${user.name}.services.syncthing = { + enable = true; + key = config.sops.secrets."syncthing/key".path; + cert = config.sops.secrets."syncthing/cert".path; + extraOptions = [ "-no-default-folder" ]; + + settings.options.urAccepted = -1; + }; +} diff --git a/users/configs/zsh/default.nix b/users/configs/console/zsh/default.nix similarity index 89% rename from users/configs/zsh/default.nix rename to users/configs/console/zsh/default.nix index 9e858c4..04f765c 100644 --- a/users/configs/zsh/default.nix +++ b/users/configs/console/zsh/default.nix @@ -1,5 +1,7 @@ -{ user ? throw "user argument is required" }: { config, ... }: - +{ + user ? throw "user argument is required", +}: +{ config, ... }: let hmConfig = config.home-manager.users.${user.name}; in diff --git a/users/configs/ags/config/.gitignore b/users/configs/gui/ags/config/.gitignore similarity index 100% rename from users/configs/ags/config/.gitignore rename to users/configs/gui/ags/config/.gitignore diff --git a/users/configs/ags/config/.prettierrc.json b/users/configs/gui/ags/config/.prettierrc.json similarity index 100% rename from users/configs/ags/config/.prettierrc.json rename to users/configs/gui/ags/config/.prettierrc.json diff --git a/users/configs/ags/config/default.nix b/users/configs/gui/ags/config/default.nix similarity index 90% rename from users/configs/ags/config/default.nix rename to users/configs/gui/ags/config/default.nix index c898dbb..c2034e6 100644 --- a/users/configs/ags/config/default.nix +++ b/users/configs/gui/ags/config/default.nix @@ -1,5 +1,7 @@ -{ pkgs ? import { }, ... }: - +{ + pkgs ? import { }, + ... +}: pkgs.stdenv.mkDerivation { name = "ags-config"; diff --git a/users/configs/ags/config/eslint.config.js b/users/configs/gui/ags/config/eslint.config.js similarity index 100% rename from users/configs/ags/config/eslint.config.js rename to users/configs/gui/ags/config/eslint.config.js diff --git a/users/configs/ags/config/package.json b/users/configs/gui/ags/config/package.json similarity index 100% rename from users/configs/ags/config/package.json rename to users/configs/gui/ags/config/package.json diff --git a/users/configs/ags/config/src/index.ts b/users/configs/gui/ags/config/src/index.ts similarity index 100% rename from users/configs/ags/config/src/index.ts rename to users/configs/gui/ags/config/src/index.ts diff --git a/users/configs/ags/config/src/lib.ts b/users/configs/gui/ags/config/src/lib.ts similarity index 100% rename from users/configs/ags/config/src/lib.ts rename to users/configs/gui/ags/config/src/lib.ts diff --git a/users/configs/ags/config/src/theme.ts b/users/configs/gui/ags/config/src/theme.ts similarity index 100% rename from users/configs/ags/config/src/theme.ts rename to users/configs/gui/ags/config/src/theme.ts diff --git a/users/configs/ags/config/src/widgets/bar/bar.ts b/users/configs/gui/ags/config/src/widgets/bar/bar.ts similarity index 100% rename from users/configs/ags/config/src/widgets/bar/bar.ts rename to users/configs/gui/ags/config/src/widgets/bar/bar.ts diff --git a/users/configs/ags/config/src/widgets/bar/clipboard/clipboard.ts b/users/configs/gui/ags/config/src/widgets/bar/clipboard/clipboard.ts similarity index 100% rename from users/configs/ags/config/src/widgets/bar/clipboard/clipboard.ts rename to users/configs/gui/ags/config/src/widgets/bar/clipboard/clipboard.ts diff --git a/users/configs/ags/config/src/widgets/bar/date/date.ts b/users/configs/gui/ags/config/src/widgets/bar/date/date.ts similarity index 100% rename from users/configs/ags/config/src/widgets/bar/date/date.ts rename to users/configs/gui/ags/config/src/widgets/bar/date/date.ts diff --git a/users/configs/ags/config/src/widgets/bar/gap/gap.ts b/users/configs/gui/ags/config/src/widgets/bar/gap/gap.ts similarity index 100% rename from users/configs/ags/config/src/widgets/bar/gap/gap.ts rename to users/configs/gui/ags/config/src/widgets/bar/gap/gap.ts diff --git a/users/configs/ags/config/src/widgets/bar/launcher/launcher.ts b/users/configs/gui/ags/config/src/widgets/bar/launcher/launcher.ts similarity index 100% rename from users/configs/ags/config/src/widgets/bar/launcher/launcher.ts rename to users/configs/gui/ags/config/src/widgets/bar/launcher/launcher.ts diff --git a/users/configs/ags/config/src/widgets/bar/systray/systray.ts b/users/configs/gui/ags/config/src/widgets/bar/systray/systray.ts similarity index 100% rename from users/configs/ags/config/src/widgets/bar/systray/systray.ts rename to users/configs/gui/ags/config/src/widgets/bar/systray/systray.ts diff --git a/users/configs/ags/config/src/widgets/bar/workspace/workspace.ts b/users/configs/gui/ags/config/src/widgets/bar/workspace/workspace.ts similarity index 100% rename from users/configs/ags/config/src/widgets/bar/workspace/workspace.ts rename to users/configs/gui/ags/config/src/widgets/bar/workspace/workspace.ts diff --git a/users/configs/ags/config/tsconfig.json b/users/configs/gui/ags/config/tsconfig.json similarity index 100% rename from users/configs/ags/config/tsconfig.json rename to users/configs/gui/ags/config/tsconfig.json diff --git a/users/configs/ags/default.nix b/users/configs/gui/ags/default.nix similarity index 55% rename from users/configs/ags/default.nix rename to users/configs/gui/ags/default.nix index fc15bee..9752630 100644 --- a/users/configs/ags/default.nix +++ b/users/configs/gui/ags/default.nix @@ -1,8 +1,16 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, inputs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + inputs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; - agsConfig = (import ./config { inherit pkgs; }); + agsConfig = import ./config { inherit pkgs; }; in { home-manager.users.${user.name} = { @@ -23,7 +31,10 @@ in systemd.user = { targets.tray.Unit = { BindsTo = [ "ags.service" ]; - After = [ "graphical-session.target" "ags.service" ]; + After = [ + "graphical-session.target" + "ags.service" + ]; }; services.ags = { @@ -37,20 +48,22 @@ in Type = "notify"; NotifyAccess = "all"; - ExecStart = lib.meta.getExe (pkgs.writeShellApplication { - name = "init-ags"; - runtimeInputs = with pkgs; [ - inputs.ags.packages.${stdenv.hostPlatform.system}.default - sassc - hyprland - nixos-icons - rofi-wayland - wl-clipboard - cliphist - libdbusmenu-gtk3 - ]; - text = "exec ags"; - }); + ExecStart = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "init-ags"; + runtimeInputs = with pkgs; [ + inputs.ags.packages.${stdenv.hostPlatform.system}.default + sassc + hyprland + nixos-icons + rofi-wayland + wl-clipboard + cliphist + libdbusmenu-gtk3 + ]; + text = "exec ags"; + } + ); }; Install.WantedBy = [ "graphical-session.target" ]; diff --git a/users/configs/ags/theme.sass b/users/configs/gui/ags/theme.sass similarity index 100% rename from users/configs/ags/theme.sass rename to users/configs/gui/ags/theme.sass diff --git a/users/configs/blueman/default.nix b/users/configs/gui/bluetooth/default.nix similarity index 71% rename from users/configs/blueman/default.nix rename to users/configs/gui/bluetooth/default.nix index bda9384..8f69ee9 100644 --- a/users/configs/blueman/default.nix +++ b/users/configs/gui/bluetooth/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: { services.blueman.enable = true; diff --git a/users/configs/gui/brightnessctl/default.nix b/users/configs/gui/brightnessctl/default.nix new file mode 100644 index 0000000..742d7c8 --- /dev/null +++ b/users/configs/gui/brightnessctl/default.nix @@ -0,0 +1,14 @@ +{ + user ? throw "user argument is required", +}: +{ lib, pkgs, ... }: +{ + home-manager.users.${user.name}.wayland.windowManager.hyprland.settings.bindle = + let + brightnessctl = lib.meta.getExe pkgs.brightnessctl; + in + [ + ", XF86MonBrightnessUp, exec, ${brightnessctl} -q s 5%+" + ", XF86MonBrightnessDown, exec, ${brightnessctl} -q s 5%-" + ]; +} diff --git a/users/configs/gui/btop/default.nix b/users/configs/gui/btop/default.nix new file mode 100644 index 0000000..4c2e9cf --- /dev/null +++ b/users/configs/gui/btop/default.nix @@ -0,0 +1,34 @@ +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: +let + hmConfig = config.home-manager.users.${user.name}; +in +{ + home-manager.users.${user.name} = { + programs = { + btop.settings.color_theme = "matugen"; + + matugen.settings.templates.btop = { + input_path = ./theme.theme; + output_path = "${hmConfig.xdg.configHome}/btop/themes/matugen.theme"; + }; + }; + + theme.extraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "reload-btop"; + runtimeInputs = with pkgs; [ procps ]; + text = "exec pkill btop -SIGUSR2"; + } + ) + } &"; + }; +} diff --git a/users/configs/btop/theme.theme b/users/configs/gui/btop/theme.theme similarity index 100% rename from users/configs/btop/theme.theme rename to users/configs/gui/btop/theme.theme diff --git a/users/configs/cbatticon/default.nix b/users/configs/gui/cbatticon/default.nix similarity index 74% rename from users/configs/cbatticon/default.nix rename to users/configs/gui/cbatticon/default.nix index fc1d782..74da063 100644 --- a/users/configs/cbatticon/default.nix +++ b/users/configs/gui/cbatticon/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: { home-manager.users.${user.name} = { services.cbatticon = { diff --git a/users/configs/cliphist/default.nix b/users/configs/gui/cliphist/default.nix similarity index 84% rename from users/configs/cliphist/default.nix rename to users/configs/gui/cliphist/default.nix index 511e780..e619864 100644 --- a/users/configs/cliphist/default.nix +++ b/users/configs/gui/cliphist/default.nix @@ -1,12 +1,22 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in { home-manager.users.${user.name} = { home = { - packages = with pkgs; [ wl-clipboard cliphist ]; + packages = with pkgs; [ + wl-clipboard + cliphist + ]; persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/cliphist" ]; }; diff --git a/users/configs/firefox/default.nix b/users/configs/gui/firefox/default.nix similarity index 63% rename from users/configs/firefox/default.nix rename to users/configs/gui/firefox/default.nix index 2921bd6..1a761d7 100644 --- a/users/configs/firefox/default.nix +++ b/users/configs/gui/firefox/default.nix @@ -1,5 +1,7 @@ -{ user ? throw "user argument is required" }: { lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ lib, pkgs, ... }: { home-manager.users.${user.name} = { programs.firefox = { @@ -47,38 +49,59 @@ "Wikipedia (en)".metaData.alias = "@w"; "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; "Nix Options" = { - urls = [{ - template = "https://search.nixos.org/options"; - params = [ - { name = "type"; value = "options"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { + name = "type"; + value = "options"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@no" ]; }; "Home Manager Options" = { - urls = [{ - template = "https://home-manager-options.extranix.com/"; - params = [ - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://home-manager-options.extranix.com/"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@nh" ]; @@ -88,9 +111,7 @@ }; }; - wayland.windowManager.hyprland.settings.bind = [ - "$mod, b, exec, ${lib.meta.getExe pkgs.firefox}" - ]; + wayland.windowManager.hyprland.settings.bind = [ "$mod, b, exec, ${lib.meta.getExe pkgs.firefox}" ]; home.persistence = { "/persist${user.home}".directories = [ ".mozilla" ]; diff --git a/users/configs/gtk/default.nix b/users/configs/gui/gtk/default.nix similarity index 62% rename from users/configs/gtk/default.nix rename to users/configs/gui/gtk/default.nix index 89f25c3..f217f23 100644 --- a/users/configs/gtk/default.nix +++ b/users/configs/gui/gtk/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in @@ -42,21 +49,25 @@ in }; }; - theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { - name = "theme-gtk"; - runtimeInputs = with pkgs; [ dconf ]; - text = '' - MODE=$(cat "${hmConfig.theme.configDir}/mode") + theme.extraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "theme-gtk"; + runtimeInputs = with pkgs; [ dconf ]; + text = '' + MODE=$(cat "${hmConfig.theme.configDir}/mode") - if [ "$MODE" = "light" ]; then - GTK_THEME="adw-gtk3" - else - GTK_THEME="adw-gtk3-dark" - fi + if [ "$MODE" = "light" ]; then + GTK_THEME="adw-gtk3" + else + GTK_THEME="adw-gtk3-dark" + fi - dconf write /org/gnome/desktop/interface/gtk-theme "'$GTK_THEME'" - dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$MODE'" - ''; - })} &"; + dconf write /org/gnome/desktop/interface/gtk-theme "'$GTK_THEME'" + dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$MODE'" + ''; + } + ) + } &"; }; } diff --git a/users/configs/gtk/theme.css b/users/configs/gui/gtk/theme.css similarity index 100% rename from users/configs/gtk/theme.css rename to users/configs/gui/gtk/theme.css diff --git a/users/configs/hyprland/default.nix b/users/configs/gui/hyprland/default.nix similarity index 92% rename from users/configs/hyprland/default.nix rename to users/configs/gui/hyprland/default.nix index 1d70cd7..943e7e9 100644 --- a/users/configs/hyprland/default.nix +++ b/users/configs/gui/hyprland/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in @@ -133,11 +140,15 @@ in }; }; - theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { - name = "reload-hyprland"; - runtimeInputs = with pkgs; [ hyprland ]; - text = "exec hyprctl reload"; - })} &"; + theme.extraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "reload-hyprland"; + runtimeInputs = with pkgs; [ hyprland ]; + text = "exec hyprctl reload"; + } + ) + } &"; home.sessionVariables.NIXOS_OZONE_WL = "1"; }; diff --git a/users/configs/hyprland/theme.conf b/users/configs/gui/hyprland/theme.conf similarity index 100% rename from users/configs/hyprland/theme.conf rename to users/configs/gui/hyprland/theme.conf diff --git a/users/configs/hyprshot/default.nix b/users/configs/gui/hyprshot/default.nix similarity index 63% rename from users/configs/hyprshot/default.nix rename to users/configs/gui/hyprshot/default.nix index a2a9e07..5225b1e 100644 --- a/users/configs/hyprshot/default.nix +++ b/users/configs/gui/hyprshot/default.nix @@ -1,26 +1,38 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in { home-manager.users.${user.name} = { home = { - packages = with pkgs; [ hyprshot swappy ]; + packages = with pkgs; [ + hyprshot + swappy + ]; sessionVariables.HYPRSHOT_DIR = "${hmConfig.xdg.userDirs.pictures}/screenshots"; }; wayland.windowManager.hyprland.settings.bind = let hyprshot = lib.meta.getExe pkgs.hyprshot; - date = "${pkgs.coreutils-full}/bin/date"; + date = "${pkgs.coreutils}/bin/date"; filename = "\"$(${date} +'%Y-%m-%d-%H%M%S.png')\""; - swappyWrapper = lib.meta.getExe (pkgs.writeShellApplication { - name = "swappy-wrapper"; - runtimeInputs = with pkgs; [ swappy ]; - text = "exec swappy -f \"$1\""; - }); + swappyWrapper = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "swappy-wrapper"; + runtimeInputs = with pkgs; [ swappy ]; + text = "exec swappy -f \"$1\""; + } + ); in [ ", Print, exec, ${hyprshot} -m output -m active -f ${filename}" diff --git a/users/configs/kitty/default.nix b/users/configs/gui/kitty/default.nix similarity index 69% rename from users/configs/kitty/default.nix rename to users/configs/gui/kitty/default.nix index db83416..c00858e 100644 --- a/users/configs/kitty/default.nix +++ b/users/configs/gui/kitty/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in @@ -27,11 +34,15 @@ in }; }; - theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { - name = "reload-kitty"; - runtimeInputs = with pkgs; [ procps ]; - text = "exec pkill kitty -SIGUSR1"; - })} &"; + theme.extraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "reload-kitty"; + runtimeInputs = with pkgs; [ procps ]; + text = "exec pkill kitty -SIGUSR1"; + } + ) + } &"; home.persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/kitty" ]; }; diff --git a/users/configs/kitty/theme.conf b/users/configs/gui/kitty/theme.conf similarity index 100% rename from users/configs/kitty/theme.conf rename to users/configs/gui/kitty/theme.conf diff --git a/users/configs/matugen/default.nix b/users/configs/gui/matugen/default.nix similarity index 83% rename from users/configs/matugen/default.nix rename to users/configs/gui/matugen/default.nix index 249dd15..33d1175 100644 --- a/users/configs/matugen/default.nix +++ b/users/configs/gui/matugen/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in @@ -54,8 +61,8 @@ in blur = builtins.toString hmConfig.theme.blur; opacity = builtins.toString hmConfig.theme.opacity; opacity_hex = builtins.toString (percentageToHex hmConfig.theme.opacity); - opacity_shadow = builtins.toString (hmConfig.theme.opacity * .75); - opacity_shadow_hex = builtins.toString (percentageToHex (hmConfig.theme.opacity * .75)); + opacity_shadow = builtins.toString (hmConfig.theme.opacity * 0.75); + opacity_shadow_hex = builtins.toString (percentageToHex (hmConfig.theme.opacity * 0.75)); font_size = builtins.toString hmConfig.theme.font.size; font_sans_serif = builtins.head hmConfig.theme.font.sansSerif.names; font_sans_serif_all = builtins.concatStringsSep ", " hmConfig.theme.font.sansSerif.names; @@ -72,15 +79,19 @@ in }; }; - theme.extraConfig = lib.mkBefore (lib.meta.getExe (pkgs.writeShellApplication { - name = "theme-matugen"; - runtimeInputs = with pkgs; [ matugen ]; - text = '' - exec matugen image "${hmConfig.theme.configDir}/wallpaper" \ - --type scheme-${hmConfig.theme.flavour} \ - --mode "$(cat "${hmConfig.theme.configDir}/mode")" \ - --contrast ${builtins.toString hmConfig.theme.contrast} - ''; - })); + theme.extraConfig = lib.mkBefore ( + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "theme-matugen"; + runtimeInputs = with pkgs; [ matugen ]; + text = '' + exec matugen image "${hmConfig.theme.configDir}/wallpaper" \ + --type scheme-${hmConfig.theme.flavour} \ + --mode "$(cat "${hmConfig.theme.configDir}/mode")" \ + --contrast ${builtins.toString hmConfig.theme.contrast} + ''; + } + ) + ); }; } diff --git a/users/configs/networkmanager/default.nix b/users/configs/gui/networking/default.nix similarity index 76% rename from users/configs/networkmanager/default.nix rename to users/configs/gui/networking/default.nix index 9b2167c..cdfa63a 100644 --- a/users/configs/networkmanager/default.nix +++ b/users/configs/gui/networking/default.nix @@ -1,5 +1,7 @@ -{ user ? throw "user argument is required" }: { ... }: - +{ + user ? throw "user argument is required", +}: +{ ... }: { home-manager.users.${user.name} = { services.network-manager-applet.enable = true; diff --git a/users/configs/pipewire/default.nix b/users/configs/gui/pipewire/default.nix similarity index 60% rename from users/configs/pipewire/default.nix rename to users/configs/gui/pipewire/default.nix index 54728a0..253a7a5 100644 --- a/users/configs/pipewire/default.nix +++ b/users/configs/gui/pipewire/default.nix @@ -1,10 +1,15 @@ -{ user ? throw "user argument is required" }: { pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ lib, pkgs, ... }: { home-manager.users.${user.name} = { + home.packages = with pkgs; [ pavucontrol ]; + wayland.windowManager.hyprland.settings = let wpctl = "${pkgs.wireplumber}/bin/wpctl"; + playerctl = lib.meta.getExe pkgs.playerctl; in { bindle = [ @@ -12,11 +17,17 @@ ", XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ -l 2.0 2%-" "CTRL, XF86AudioRaiseVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SOURCE@ -l 1.0 2%+" "CTRL, XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SOURCE@ -l 1.0 2%-" + ", XF86AudioNext, exec, ${playerctl} next" + ", XF86AudioPrev, exec, ${playerctl} previous" + "CTRL, XF86AudioNext, exec, ${playerctl} position 10+" + "CTRL, XF86AudioPrev, exec, ${playerctl} position 10-" ]; bindl = [ ", XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" ", XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ", XF86AudioPlay, exec, ${playerctl} play-pause" + ", XF86AudioStop, exec, ${playerctl} stop" ]; }; }; diff --git a/users/configs/gui/qalculate/default.nix b/users/configs/gui/qalculate/default.nix new file mode 100644 index 0000000..a288669 --- /dev/null +++ b/users/configs/gui/qalculate/default.nix @@ -0,0 +1,50 @@ +{ + user ? throw "user argument is required", +}: +{ + lib, + config, + pkgs, + ... +}: +let + hmConfig = config.home-manager.users.${user.name}; + qalculate-gtk = pkgs.qalculate-gtk.overrideAttrs (oldAttrs: { + patches = oldAttrs.patches or [ ] ++ [ ./skip-save-prefs.patch ]; + }); +in +{ + home-manager.users.${user.name} = { + home = { + packages = [ qalculate-gtk ]; + persistence."/cache${user.home}".files = [ + "${hmConfig.xdg.relativeConfigHome}/qalculate/qalculate-gtk.history" + ]; + }; + + xdg.configFile."qalculate/qalculate-gtk.cfg".source = + (pkgs.formats.ini { }).generate "qalculate-gtk.cfg" + { + General = { + allow_multiple_instances = 1; + width = 500; + save_history_separately = 1; + auto_update_exchange_rates = 1; + local_currency_conversion = 1; + use_binary_prefixes = 1; + persistent_keypad = 1; + copy_ascii = 1; + copy_ascii_without_units = 1; + }; + Mode = { + calculate_as_you_type = 1; + excessive_parenthesis = 1; + }; + }; + + wayland.windowManager.hyprland.settings = { + bind = [ ", XF86Calculator, exec, ${lib.meta.getExe qalculate-gtk}" ]; + windowrulev2 = [ "float, class:(qalculate-gtk)" ]; + }; + }; +} diff --git a/users/configs/qalculate/skip-save-prefs.patch b/users/configs/gui/qalculate/skip-save-prefs.patch similarity index 100% rename from users/configs/qalculate/skip-save-prefs.patch rename to users/configs/gui/qalculate/skip-save-prefs.patch diff --git a/users/configs/qt/KvAdwQt/KvAdwQt.kvconfig b/users/configs/gui/qt/KvAdwQt/KvAdwQt.kvconfig similarity index 100% rename from users/configs/qt/KvAdwQt/KvAdwQt.kvconfig rename to users/configs/gui/qt/KvAdwQt/KvAdwQt.kvconfig diff --git a/users/configs/qt/KvAdwQt/KvAdwQt.svg b/users/configs/gui/qt/KvAdwQt/KvAdwQt.svg similarity index 100% rename from users/configs/qt/KvAdwQt/KvAdwQt.svg rename to users/configs/gui/qt/KvAdwQt/KvAdwQt.svg diff --git a/users/configs/qt/default.nix b/users/configs/gui/qt/default.nix similarity index 91% rename from users/configs/qt/default.nix rename to users/configs/gui/qt/default.nix index 14f141d..9d57424 100644 --- a/users/configs/qt/default.nix +++ b/users/configs/gui/qt/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in @@ -34,9 +41,7 @@ in xdg.configFile = let - qtConfig = (pkgs.formats.ini { }).generate "qt5ct.conf" { - Appearance.style = "kvantum"; - }; + qtConfig = (pkgs.formats.ini { }).generate "qt5ct.conf" { Appearance.style = "kvantum"; }; in { "qt5ct/qt5ct.conf".source = qtConfig; diff --git a/users/configs/rofi/default.nix b/users/configs/gui/rofi/default.nix similarity index 86% rename from users/configs/rofi/default.nix rename to users/configs/gui/rofi/default.nix index 27b022f..0de6572 100644 --- a/users/configs/rofi/default.nix +++ b/users/configs/gui/rofi/default.nix @@ -1,5 +1,12 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in diff --git a/users/configs/gui/swww/default.nix b/users/configs/gui/swww/default.nix new file mode 100644 index 0000000..c4cf1e1 --- /dev/null +++ b/users/configs/gui/swww/default.nix @@ -0,0 +1,64 @@ +{ + user ? throw "user argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: +let + hmConfig = config.home-manager.users.${user.name}; + themeSwww = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "theme-swww"; + runtimeInputs = with pkgs; [ + coreutils + swww + ]; + text = "exec swww img \"${hmConfig.theme.configDir}/wallpaper\""; + } + ); +in +{ + home-manager.users.${user.name} = { + home = { + packages = with pkgs; [ swww ]; + persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ]; + }; + + systemd.user.services.swww = { + Unit = { + Description = "Wallpaper daemon"; + BindsTo = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { + Type = "forking"; + + ExecStart = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "init-swww"; + runtimeInputs = with pkgs; [ swww ]; + text = "exec swww init"; + } + ); + + ExecStartPost = themeSwww; + + ExecStop = lib.meta.getExe ( + pkgs.writeShellApplication { + name = "kill-swww"; + runtimeInputs = with pkgs; [ swww ]; + text = "exec swww kill"; + } + ); + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; + + theme.extraConfig = lib.mkAfter "${themeSwww} &"; + }; +} diff --git a/users/configs/theme/default.nix b/users/configs/gui/theme/default.nix similarity index 76% rename from users/configs/theme/default.nix rename to users/configs/gui/theme/default.nix index 6d0ca78..966b7a1 100644 --- a/users/configs/theme/default.nix +++ b/users/configs/gui/theme/default.nix @@ -1,5 +1,13 @@ -{ user ? throw "user argument is required" }: { config, inputs, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + inputs, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; themeBin = lib.meta.getExe hmConfig.theme.pkg; @@ -14,7 +22,9 @@ in ]; home = { - activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] "run ${themeBin}"; + activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ + "writeBoundary" + ] "run ${themeBin}"; persistence."/persist${user.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ]; }; }; diff --git a/users/configs/vscode/default.nix b/users/configs/gui/vscode/default.nix similarity index 94% rename from users/configs/vscode/default.nix rename to users/configs/gui/vscode/default.nix index 2581293..bb821a1 100644 --- a/users/configs/vscode/default.nix +++ b/users/configs/gui/vscode/default.nix @@ -1,5 +1,13 @@ -{ user ? throw "user argument is required" }: { config, inputs, lib, pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ + config, + inputs, + lib, + pkgs, + ... +}: let hmConfig = config.home-manager.users.${user.name}; in @@ -7,7 +15,10 @@ in home-manager.users.${user.name} = { programs.vscode = { enable = true; + mutableExtensionsDir = false; + extensions = with pkgs.vscode-extensions; [ naumovs.color-highlight ]; + userSettings = { "diffEditor.ignoreTrimWhitespace" = false; "editor.accessibilitySupport" = "off"; @@ -65,9 +76,7 @@ in }; }; - imports = [ - ./langs/nix.nix - ]; + imports = [ ./langs/nix.nix ]; home.persistence = { "/persist${user.home}".directories = [ ".config/Code" ]; diff --git a/users/configs/vscode/langs/nix.nix b/users/configs/gui/vscode/langs/nix.nix similarity index 74% rename from users/configs/vscode/langs/nix.nix rename to users/configs/gui/vscode/langs/nix.nix index 0f810ac..b7dfc72 100644 --- a/users/configs/vscode/langs/nix.nix +++ b/users/configs/gui/vscode/langs/nix.nix @@ -1,5 +1,4 @@ { pkgs, ... }: - { programs.vscode = { userSettings = { @@ -7,9 +6,7 @@ "nix.formatterPath" = "nixpkgs-fmt"; "nix.serverSettings" = { }; }; - extensions = with pkgs; with vscode-extensions; [ - jnoortheen.nix-ide - ]; + extensions = with pkgs; with vscode-extensions; [ jnoortheen.nix-ide ]; }; home.packages = with pkgs; [ diff --git a/users/configs/wev/default.nix b/users/configs/gui/wev/default.nix similarity index 53% rename from users/configs/wev/default.nix rename to users/configs/gui/wev/default.nix index d8446f2..bb5aa22 100644 --- a/users/configs/wev/default.nix +++ b/users/configs/gui/wev/default.nix @@ -1,5 +1,7 @@ -{ user ? throw "user argument is required" }: { pkgs, ... }: - +{ + user ? throw "user argument is required", +}: +{ pkgs, ... }: { home-manager.users.${user.name}.home.packages = with pkgs; [ wev ]; } diff --git a/users/configs/x11/default.nix b/users/configs/gui/x11/default.nix similarity index 76% rename from users/configs/x11/default.nix rename to users/configs/gui/x11/default.nix index b69d795..41c5ded 100644 --- a/users/configs/x11/default.nix +++ b/users/configs/gui/x11/default.nix @@ -1,5 +1,7 @@ -{ user ? throw "user argument is required" }: { config, ... }: - +{ + user ? throw "user argument is required", +}: +{ config, ... }: let hmConfig = config.home-manager.users.${user.name}; in diff --git a/users/configs/pavucontrol/default.nix b/users/configs/pavucontrol/default.nix deleted file mode 100644 index 15f81b7..0000000 --- a/users/configs/pavucontrol/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ user ? throw "user argument is required" }: { pkgs, ... }: - -{ - home-manager.users.${user.name}.home.packages = with pkgs; [ pavucontrol ]; -} diff --git a/users/configs/playerctl/default.nix b/users/configs/playerctl/default.nix deleted file mode 100644 index d116f48..0000000 --- a/users/configs/playerctl/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ user ? throw "user argument is required" }: { lib, pkgs, ... }: - -{ - home-manager.users.${user.name} = { - home.packages = with pkgs; [ playerctl ]; - services.playerctld.enable = true; - - wayland.windowManager.hyprland.settings.bindle = - let - playerctl = lib.meta.getExe pkgs.playerctl; - in - [ - ", XF86AudioPlay, exec, ${playerctl} play-pause" - ", XF86AudioStop, exec, ${playerctl} stop" - ", XF86AudioNext, exec, ${playerctl} next" - ", XF86AudioPrev, exec, ${playerctl} previous" - "CTRL, XF86AudioNext, exec, ${playerctl} position 10+" - "CTRL, XF86AudioPrev, exec, ${playerctl} position 10-" - ]; - }; -} diff --git a/users/configs/qalculate/default.nix b/users/configs/qalculate/default.nix deleted file mode 100644 index d92e7b6..0000000 --- a/users/configs/qalculate/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ user ? throw "user argument is required" }: { lib, config, pkgs, ... }: - -let - hmConfig = config.home-manager.users.${user.name}; - qalculate-gtk = pkgs.qalculate-gtk.overrideAttrs (oldAttrs: { - patches = oldAttrs.patches or [ ] ++ [ ./skip-save-prefs.patch ]; - }); -in -{ - home-manager.users.${user.name} = { - home = { - packages = [ qalculate-gtk ]; - persistence."/cache${user.home}".files = [ "${hmConfig.xdg.relativeConfigHome}/qalculate/qalculate-gtk.history" ]; - }; - - xdg.configFile."qalculate/qalculate-gtk.cfg".source = (pkgs.formats.ini { }).generate "qalculate-gtk.cfg" { - General = { - allow_multiple_instances = 1; - width = 500; - save_history_separately = 1; - auto_update_exchange_rates = 1; - local_currency_conversion = 1; - use_binary_prefixes = 1; - persistent_keypad = 1; - copy_ascii = 1; - copy_ascii_without_units = 1; - }; - Mode = { - calculate_as_you_type = 1; - excessive_parenthesis = 1; - }; - }; - - wayland.windowManager.hyprland.settings = { - bind = [ ", XF86Calculator, exec, ${lib.meta.getExe qalculate-gtk}" ]; - windowrulev2 = [ "float, class:(qalculate-gtk)" ]; - }; - }; -} diff --git a/users/configs/swww/default.nix b/users/configs/swww/default.nix deleted file mode 100644 index 561f424..0000000 --- a/users/configs/swww/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: - -let - hmConfig = config.home-manager.users.${user.name}; - themeSwww = lib.meta.getExe (pkgs.writeShellApplication { - name = "theme-swww"; - runtimeInputs = with pkgs; [ - coreutils-full - swww - ]; - text = "exec swww img \"${hmConfig.theme.configDir}/wallpaper\""; - }); -in -{ - home-manager.users.${user.name} = { - home = { - packages = with pkgs; [ swww ]; - persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ]; - }; - - systemd.user.services.swww = { - Unit = { - Description = "Wallpaper daemon"; - BindsTo = [ "graphical-session.target" ]; - After = [ "graphical-session.target" ]; - }; - - Service = { - Type = "forking"; - - ExecStart = lib.meta.getExe (pkgs.writeShellApplication { - name = "init-swww"; - runtimeInputs = with pkgs; [ swww ]; - text = "exec swww init"; - }); - - ExecStartPost = themeSwww; - - ExecStop = lib.meta.getExe (pkgs.writeShellApplication { - name = "kill-swww"; - runtimeInputs = with pkgs; [ swww ]; - text = "exec swww kill"; - }); - }; - - Install.WantedBy = [ "graphical-session.target" ]; - }; - - theme.extraConfig = lib.mkAfter "${themeSwww} &"; - }; -} diff --git a/users/configs/syncthing/default.nix b/users/configs/syncthing/default.nix deleted file mode 100644 index 795d053..0000000 --- a/users/configs/syncthing/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ user ? throw "user argument is required" }: { ... }: - -{ - networking.firewall = { - allowedTCPPorts = [ 22000 ]; - allowedUDPPorts = [ 21027 22000 ]; - }; - - home-manager.users.${user.name} = { - services.syncthing = { - enable = true; - extraOptions = [ "-no-default-folder" ]; - }; - }; -} diff --git a/users/nick/nogui.nix b/users/nick/console.nix similarity index 55% rename from users/nick/nogui.nix rename to users/nick/console.nix index b891b7b..535fca0 100644 --- a/users/nick/nogui.nix +++ b/users/nick/console.nix @@ -1,16 +1,19 @@ { config, ... }: - let user = config.users.users.nick; in { imports = [ ../common - (import ../configs/zsh { inherit user; }) - (import ../configs/git { inherit user; }) - (import ../configs/neovim { inherit user; }) - (import ../configs/gpg-agent { inherit user; }) - (import ../configs/btop { inherit user; }) + (import ../configs/console/bluetooth { inherit user; }) + (import ../configs/console/brightnessctl { inherit user; }) + (import ../configs/console/btop { inherit user; }) + (import ../configs/console/git { inherit user; }) + (import ../configs/console/gpg-agent { inherit user; }) + (import ../configs/console/neovim { inherit user; }) + (import ../configs/console/pipewire { inherit user; }) + (import ../configs/console/syncthing { inherit user; }) + (import ../configs/console/zsh { inherit user; }) ]; sops.secrets.nick-password = { diff --git a/users/nick/default.nix b/users/nick/default.nix index 46e179a..3ddf331 100644 --- a/users/nick/default.nix +++ b/users/nick/default.nix @@ -1,36 +1,35 @@ -{ autologin ? false }: { config, lib, ... }: - +{ + autologin ? false, +}: +{ config, lib, ... }: let user = config.users.users.nick; in { imports = [ - ./nogui.nix - (import ../configs/theme { inherit user; }) - (import ../configs/matugen { inherit user; }) - (import ../configs/firefox { inherit user; }) - (import ../configs/hyprland { inherit user; }) - (import ../configs/hyprshot { inherit user; }) - (import ../configs/cliphist { inherit user; }) - (import ../configs/ags { inherit user; }) - (import ../configs/wev { inherit user; }) - (import ../configs/networkmanager { inherit user; }) - (import ../configs/bluetooth { inherit user; }) - (import ../configs/blueman { inherit user; }) - (import ../configs/cbatticon { inherit user; }) - (import ../configs/syncthing { inherit user; }) - (import ../configs/brightnessctl { inherit user; }) - (import ../configs/pavucontrol { inherit user; }) - (import ../configs/pipewire { inherit user; }) - (import ../configs/playerctl { inherit user; }) - (import ../configs/rofi { inherit user; }) - (import ../configs/swww { inherit user; }) - (import ../configs/kitty { inherit user; }) - (import ../configs/gtk { inherit user; }) - (import ../configs/qt { inherit user; }) - (import ../configs/x11 { inherit user; }) - (import ../configs/vscode { inherit user; }) - (import ../configs/qalculate { inherit user; }) + ./console.nix + (import ../configs/gui/ags { inherit user; }) + (import ../configs/gui/bluetooth { inherit user; }) + (import ../configs/gui/brightnessctl { inherit user; }) + (import ../configs/gui/btop { inherit user; }) + # (import ../configs/gui/cbatticon { inherit user; }) + (import ../configs/gui/cliphist { inherit user; }) + (import ../configs/gui/firefox { inherit user; }) + (import ../configs/gui/gtk { inherit user; }) + (import ../configs/gui/hyprland { inherit user; }) + (import ../configs/gui/hyprshot { inherit user; }) + (import ../configs/gui/kitty { inherit user; }) + (import ../configs/gui/matugen { inherit user; }) + (import ../configs/gui/networking { inherit user; }) + (import ../configs/gui/pipewire { inherit user; }) + (import ../configs/gui/qalculate { inherit user; }) + (import ../configs/gui/qt { inherit user; }) + (import ../configs/gui/rofi { inherit user; }) + (import ../configs/gui/swww { inherit user; }) + (import ../configs/gui/theme { inherit user; }) + (import ../configs/gui/vscode { inherit user; }) + (import ../configs/gui/wev { inherit user; }) + (import ../configs/gui/x11 { inherit user; }) ]; home-manager.users.nick = {