diff --git a/README.md b/README.md index 735bb0e..7bfc138 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ Currently there are two complete system configurations available. These are: * **Mercury** - My laptop configuration. My laptop is a pretty weak machine so this configuration is stripped down a bit. The 'Xenon' config is my server configuration and is highly unlikely to be of use to anyone but me, as the setup has some very specific use-cases. +## Modules + +This config uses custom modules for the home-manager and system configurations. Basically every part of the configuration can be toggled using an option, and some configs have extra options as well. +All of the options declared in these modules can be found in the documentation under docs/options + ## Scripts ```chpaper``` - opens a fzf window with filenames and previews of images in $FLAKEPATH/assets/wallpapers. Picking one replaces the existing wallpaper path in $FLAKEPATH/flake.nix with the one you chose. diff --git a/assets/sound/gitcheckout.wav b/assets/sound/gitcheckout.wav new file mode 100644 index 0000000..cf78422 Binary files /dev/null and b/assets/sound/gitcheckout.wav differ diff --git a/docs/options/home_options.md b/docs/options/home_options.md new file mode 100644 index 0000000..5ac3ccb --- /dev/null +++ b/docs/options/home_options.md @@ -0,0 +1,230 @@ +# Home-Manager Options + +## homeFiles.enable + - Enables my declared files + - Type: Boolean + - Default: true + - Defined in 'modules/home/files/neofetch.nix' + +## hyprlandConfig.enable + - Enables my custom hyprland configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/hyprland.nix' + +## autojumpConfig.enable + - Enables my autojump options + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/autojump.nix' + +## stylixHomeConfig.enable + - Enables my stylix home-manager options + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/stylix.nix' + +## waybarConfig.enable + - Enables my custom waybar configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/waybar.nix' + +## gtkConfig.enable + - Enables my gtk configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/gtk.nix' + +## spicetifyConfig.enable + - Enables my spicetify configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/spicetify.nix' + +## starshipConfig.enable + - Enables my starship configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/starship.nix' + +## btopConfig.enable + - Enables my btop configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/btop.nix' + +## swayncConfig.enable + - Enables my swaync configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/swaync.nix' + +## userPkgs.enable + - Enables my default user packages + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/userpkgs.nix' + +## cavaConfig.enable + - Enables my cava configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/cava.nix' + +## ezaConfig.enable + - Enables my eza configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/eza.nix' + +## firefoxConfig.enable + - Enables my firefox configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/firefox.nix' + +## fuzzelConfig.enable + - Enables my fuzzel configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/fuzzel.nix' + +## fzfConfig.enable + - Enables my fzf configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/fzf.nix' + +## gitConfig.enable + - Enables my git configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/git.nix' + +## kittyConfig.enable + - Enables my kitty configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/kitty.nix' + +## yaziConfig.enable + - Enables my yazi configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/yazi.nix' + +## zshConfig.enable + - Enables my zsh configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/environment/zshell.nix' + +## passConfig.enable + - Enables my password-store configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/password-store.nix' + +## batConfig.enable + - Enables my bat configuration + - Type: Boolean + - Default: true + - Defined in 'modules/home/programs/bat.nix' + +## movScripts.enable + - Enables my custom script binaries + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' + +## movScripts.commandScripts +### enable + - Enables my custom command scripts + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### invoke.enable + - Enables the invoke command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### runbg.enable + - Enables the runbg command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### splash.enable + - Enables the splash command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### toolbelt.enable + - Enables the toolbelt command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### viconf.enable + - Enables the viconf command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' + +## movScripts.hyprlandControls +### enable + - Enables my hyprland control shortcut scripts + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### chpaper.enable + - Enables the chpaper command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### scheck.enable + - Enables the scheck command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### chscheme.enable + - Enables the chscheme command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### keyring.enable + - Enables the keyring command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### moveonscreen.enable + - Enables the moveonscreen command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### switchmon.enable + - Enables the switchmon command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' + +## movScripts.nixShortcuts +### enable + - Enables my NixOS aliases + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### garbage-collect.enable + - Enables the garbage-collect command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### nsp.enable + - Enables the nsp command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' +### rebuild.enable + - Enables the rebuild command + - Type: Boolean + - Default: true + - Defined in 'modules/home/scripts/default.nix' diff --git a/docs/options/system_options.md b/docs/options/system_options.md new file mode 100644 index 0000000..1724386 --- /dev/null +++ b/docs/options/system_options.md @@ -0,0 +1,79 @@ +# System Options + +## networkModule.enable + - Enables my network configuration + - Type: Boolean + - Default: false + - Defined in 'modules/sys/hardware/network.nix' + +## nixSettings.enable + - Enables my NixOS settings + - Type: Boolean + - Default: false + - Defined in 'modules/sys/environment/nix.nix' + +## bootLoader.enable + - Enables my bootloader settings + - Type: Boolean + - Default: false + - Defined in 'modules/sys/hardware/bootloader.nix' + +## issue.enable + - Enables my custom /etc/issue tty splash screen + - Type: Boolean + - Default: false + - Defined in 'modules/sys/environment/issue.nix' + +## sddmConfig.enable + - Enables my catppuccin-sddm configuration + - Type: Boolean + - Default: false + - Defined in 'modules/sys/environment/sddm.nix' + +## stylixConfig.enable + - Enables stylix for system theming + - Type: Boolean + - Default: false + - Defined in 'modules/sys/environment/stylix.nix' + +## gamingPkgs.enable + - Enables gaming-related packages + - Type: Boolean + - Default: false + - Defined in 'modules/sys/software/gaming/gaming_pkgs.nix' + +## steamConfig.enable + - Enables my Steam configuration + - Type: Boolean + - Default: false + - Defined in 'modules/sys/software/gaming/steam.nix' + +## sysPkgs.enable + - Installs my default system packages + - Type: Boolean + - Default: false + - Defined in 'modules/sys/software/packages.nix' + +## sysProgs.enable + - Enables + - Type: Boolean + - Default: false + - Defined in 'modules/sys/software/programs.nix' + +## sysServices.enable + - Description + - Type: Boolean + - Default: false + - Defined in 'modules/sys/software/services.nix' + +## virtConfig.enable + - Description + - Type: Boolean + - Default: false + - Defined in 'modules/sys/software/virtualization.nix' + +## powerProfiles.enable + - Description + - Type: Boolean + - Default: false + - Defined in 'modules/sys/hardware/powerprofiles.nix' diff --git a/flake.lock b/flake.lock index 959e710..b09005c 100644 --- a/flake.lock +++ b/flake.lock @@ -356,11 +356,11 @@ ] }, "locked": { - "lastModified": 1730016908, - "narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=", + "lastModified": 1730490306, + "narHash": "sha256-AvCVDswOUM9D368HxYD25RsSKp+5o0L0/JHADjLoD38=", "owner": "nix-community", "repo": "home-manager", - "rev": "e83414058edd339148dc142a8437edb9450574c8", + "rev": "1743615b61c7285976f85b303a36cdf88a556503", "type": "github" }, "original": { @@ -472,11 +472,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1730373668, - "narHash": "sha256-8p5JTUGFuhnyuF9lD98ioeE3zYaCmsizLWk4Y3KszAI=", + "lastModified": 1730499652, + "narHash": "sha256-De3YRKpowtm15xN7hK0PdBpu96wwSyQE+qFoq9Gi6lM=", "ref": "refs/heads/main", - "rev": "93b4478e70af6ffb08a4a66a6d0364c3296db296", - "revCount": 5396, + "rev": "32b18179dd789cde948c97eb3c2ebbdd6af36bf7", + "revCount": 5402, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -822,11 +822,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1730368298, - "narHash": "sha256-5z4pDqRSSovXPPtN1BNEJOkGoCd/XSYuCWh8AsvoTio=", + "lastModified": 1730499477, + "narHash": "sha256-olt0Sx4alDxv3ko9BgbV3SsE2KQ/Tf0/Az1Fr9s2Y6U=", "owner": "nix-community", "repo": "nixvim", - "rev": "42ea1626cb002fa759a6b1e2841bfc80a4e59615", + "rev": "356896f58dde22ee16481b7c954e340dceec340d", "type": "github" }, "original": { @@ -837,11 +837,11 @@ }, "nur": { "locked": { - "lastModified": 1730411166, - "narHash": "sha256-o1JcjEnWhnxkkKXYN1gQeO53RUsQExFsgMOJ/FzuFX0=", + "lastModified": 1730540878, + "narHash": "sha256-JYfoVW5lsfv4bo87U6mqbC3Jh+EBImU5iUsHJlOkyAI=", "owner": "nix-community", "repo": "NUR", - "rev": "761c6a7d6859126681d206126ba26ec58306d068", + "rev": "57df81c2bcabc503171defb232a0e11710ddaaf9", "type": "github" }, "original": { @@ -918,11 +918,11 @@ ] }, "locked": { - "lastModified": 1730348281, - "narHash": "sha256-c5lP7JFqWlrEScvPXKxg7Z2+f5wdlznYZPjEa5jmEkw=", + "lastModified": 1730521028, + "narHash": "sha256-vZtg4J+jOADDKgS+s821PeJiTXfawan8mzX3JM3xjqc=", "owner": "gerg-l", "repo": "spicetify-nix", - "rev": "22d250d6a4dcc492a2d8836d3f2c901a09e7cb76", + "rev": "191323d81e19efa0be5071e17263851e62f35685", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2c8e161..3bf797d 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,8 @@ ) {} colors; in { + homeManagerModules.default = ./modules/home; + nixosConfigurations = { oganesson = nixpkgs.lib.nixosSystem { specialArgs = { @@ -75,7 +77,8 @@ }; inherit system; modules = [ - ./hosts/desktop + ./hosts/desktop/config.nix + ./modules/sys stylix.nixosModules.stylix nixvim.nixosModules.nixvim nur.nixosModules.nur @@ -88,7 +91,8 @@ inherit self inputs scheme wallpaper username; }; modules = [ - ./hosts/laptop + ./hosts/laptop/config.nix + ./modules/sys stylix.nixosModules.stylix nixvim.nixosModules.nixvim nur.nixosModules.nur @@ -102,6 +106,7 @@ }; modules = [ ./hosts/server + ./modules stylix.nixosModules.stylix nixvim.nixosModules.nixvim nur.nixosModules.nur diff --git a/hosts/desktop/settings.nix b/hosts/desktop/config.nix similarity index 59% rename from hosts/desktop/settings.nix rename to hosts/desktop/config.nix index 776a197..dda1bf7 100644 --- a/hosts/desktop/settings.nix +++ b/hosts/desktop/config.nix @@ -1,6 +1,25 @@ {pkgs, ...}: { system.stateVersion = "24.05"; nixpkgs.config.allowUnfree = true; + imports = [ + ./hardware.nix + ./home.nix + ]; + + # My module options + networkModule.enable = true; + nixSettings.enable = true; + bootLoader.enable = true; + issue.enable = true; + sddmConfig.enable = true; + stylixConfig.enable = true; + gamingPkgs.enable = true; + steamConfig.enable = true; + sysPkgs.enable = true; + sysProgs.enable = true; + sysServices.enable = true; + virtConfig.enable = true; + nix = { settings = { auto-optimise-store = true; diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix deleted file mode 100644 index 867a32f..0000000 --- a/hosts/desktop/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - host, - inputs, - username, - nur, - pkgs, - self, - ... -}: { - imports = [ - ./../../modules/sys/configuration.nix - ./hardware.nix - ./settings.nix - ]; -} diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix new file mode 100644 index 0000000..1786879 --- /dev/null +++ b/hosts/desktop/home.nix @@ -0,0 +1,96 @@ +{ + host, + pkgs, + self, + inputs, + username, + wallpaper, + lib, + scheme, + config, + ... +}: let + nur = config.nur; +in { + imports = [inputs.home-manager.nixosModules.home-manager]; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + backupFileExtension = "backup"; + extraSpecialArgs = {inherit self inputs host wallpaper scheme username nur;}; + users = { + ${username} = { + programs.home-manager.enable = true; + imports = [ + inputs.spicetify-nix.homeManagerModules.default + inputs.self.outputs.homeManagerModules.default + ]; + + # My custom home-manager modules + + # modules/home/files + homeFiles.enable = true; + + # modules/home/environment + hyprlandConfig.enable = true; + autojumpConfig.enable = true; + stylixHomeConfig.enable = true; + waybarConfig.enable = true; + gtkConfig.enable = true; + spicetifyConfig.enable = true; + starshipConfig.enable = true; + + # modules/home/programs + btopConfig.enable = true; + swayncConfig.enable = true; + userPkgs.enable = true; + cavaConfig.enable = true; + ezaConfig.enable = true; + firefoxConfig.enable = true; + fuzzelConfig.enable = true; + fzfConfig.enable = true; + gitConfig.enable = true; + kittyConfig.enable = true; + yaziConfig.enable = true; + zshConfig.enable = true; + passConfig.enable = true; + batConfig.enable = true; + + # modules/home/scripts + movScripts.enable = true; + movScripts.commandScripts.enable = true; + movScripts.hyprlandControls.enable = true; + movScripts.nixShortcuts.enable = true; + + dconf.settings = lib.mkIf config.virtConfig.enable { + "org/virt-manager/virt-manager/connections" = { + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; + }; + }; + home = { + username = "${username}"; + homeDirectory = "/home/${username}"; + stateVersion = "24.05"; + }; + }; + }; + }; + + users = { + groups.persist = {}; + users = { + root.initialPassword = "1234"; + ${username} = { + isNormalUser = true; + initialPassword = "1234"; + shell = pkgs.zsh; + extraGroups = ["wheel" "persist" "libvirtd"]; + }; + }; + }; + security.sudo.extraConfig = '' + ${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild + ''; + nix.settings.allowed-users = ["${username}"]; +} diff --git a/hosts/laptop/boot.nix b/hosts/laptop/boot.nix deleted file mode 100644 index 625aae3..0000000 --- a/hosts/laptop/boot.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - config, - pkgs, - ... -}: { - boot = { - kernelModules = ["acpi_call"]; - extraModulePackages = with config.boot.kernelPackages; - [ - acpi_call - cpupower - ] - ++ [pkgs.cpupower-gui]; - }; -} diff --git a/hosts/laptop/config.nix b/hosts/laptop/config.nix new file mode 100644 index 0000000..bd52d19 --- /dev/null +++ b/hosts/laptop/config.nix @@ -0,0 +1,47 @@ +{pkgs, config, ...}: { + system.stateVersion = "24.05"; + nixpkgs.config.allowUnfree = true; + imports = [ + ./hardware.nix + ./home.nix + ]; + + powerProfiles.enable = true; + boot = { + kernelModules = ["acpi_call"]; + extraModulePackages = with config.boot.kernelPackages; + [ + acpi_call + cpupower + ] + ++ [pkgs.cpupower-gui]; + }; + + networkModule.enable = true; + nixSettings.enable = true; + bootLoader.enable = true; + issue.enable = true; + sddmConfig.enable = true; + stylixConfig.enable = true; + sysPkgs.enable = true; + sysProgs.enable = true; + sysServices.enable = true; + + environment = { + variables = { + PATH = "${pkgs.clang-tools}/bin:$PATH"; + }; + shells = with pkgs; [ + zsh + bash + ]; + systemPackages = with pkgs; [ + acpi + brightnessctl + cpupower-gui + powertop + ]; + }; + + +} diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix deleted file mode 100644 index d7f7bf1..0000000 --- a/hosts/laptop/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - host, - inputs, - pkgs, - config, - self, - username, - ... -}: { - imports = [ - ./../../modules/sys/configuration.nix - ./hardware.nix - ./boot.nix - ./services.nix - ./environment.nix - ./settings.nix - ]; -} diff --git a/hosts/laptop/environment.nix b/hosts/laptop/environment.nix deleted file mode 100644 index aca3a1b..0000000 --- a/hosts/laptop/environment.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, ...}: { - environment = { - variables = { - PATH = "${pkgs.clang-tools}/bin:$PATH"; - }; - shells = with pkgs; [ - zsh - bash - ]; - systemPackages = with pkgs; [ - acpi - brightnessctl - cpupower-gui - powertop - ]; - }; -} diff --git a/hosts/laptop/hardware.nix.old b/hosts/laptop/hardware.nix.old deleted file mode 100644 index 1c21635..0000000 --- a/hosts/laptop/hardware.nix.old +++ /dev/null @@ -1,53 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-partlabel/disk-main-root"; - fsType = "ext4"; - }; - - fileSystems."/nix" = { - device = "/dev/disk/by-partlabel/disk-main-nix"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-partlabel/disk-main-ESP"; - fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; - }; - - fileSystems."/home" = { - device = "/dev/disk/by-partlabel/disk-main-home"; - fsType = "ext4"; - }; - - swapDevices = []; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp14s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix new file mode 100644 index 0000000..1786879 --- /dev/null +++ b/hosts/laptop/home.nix @@ -0,0 +1,96 @@ +{ + host, + pkgs, + self, + inputs, + username, + wallpaper, + lib, + scheme, + config, + ... +}: let + nur = config.nur; +in { + imports = [inputs.home-manager.nixosModules.home-manager]; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + backupFileExtension = "backup"; + extraSpecialArgs = {inherit self inputs host wallpaper scheme username nur;}; + users = { + ${username} = { + programs.home-manager.enable = true; + imports = [ + inputs.spicetify-nix.homeManagerModules.default + inputs.self.outputs.homeManagerModules.default + ]; + + # My custom home-manager modules + + # modules/home/files + homeFiles.enable = true; + + # modules/home/environment + hyprlandConfig.enable = true; + autojumpConfig.enable = true; + stylixHomeConfig.enable = true; + waybarConfig.enable = true; + gtkConfig.enable = true; + spicetifyConfig.enable = true; + starshipConfig.enable = true; + + # modules/home/programs + btopConfig.enable = true; + swayncConfig.enable = true; + userPkgs.enable = true; + cavaConfig.enable = true; + ezaConfig.enable = true; + firefoxConfig.enable = true; + fuzzelConfig.enable = true; + fzfConfig.enable = true; + gitConfig.enable = true; + kittyConfig.enable = true; + yaziConfig.enable = true; + zshConfig.enable = true; + passConfig.enable = true; + batConfig.enable = true; + + # modules/home/scripts + movScripts.enable = true; + movScripts.commandScripts.enable = true; + movScripts.hyprlandControls.enable = true; + movScripts.nixShortcuts.enable = true; + + dconf.settings = lib.mkIf config.virtConfig.enable { + "org/virt-manager/virt-manager/connections" = { + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; + }; + }; + home = { + username = "${username}"; + homeDirectory = "/home/${username}"; + stateVersion = "24.05"; + }; + }; + }; + }; + + users = { + groups.persist = {}; + users = { + root.initialPassword = "1234"; + ${username} = { + isNormalUser = true; + initialPassword = "1234"; + shell = pkgs.zsh; + extraGroups = ["wheel" "persist" "libvirtd"]; + }; + }; + }; + security.sudo.extraConfig = '' + ${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild + ''; + nix.settings.allowed-users = ["${username}"]; +} diff --git a/hosts/laptop/services.nix b/hosts/laptop/services.nix deleted file mode 100644 index 187ab9d..0000000 --- a/hosts/laptop/services.nix +++ /dev/null @@ -1,47 +0,0 @@ -{...}: { - services = { - keyd = { - enable = true; - keyboards.default = { - ids = ["*"]; - settings.main = { - capslock = "esc"; - }; - }; - }; - - power-profiles-daemon.enable = true; - - upower = { - enable = true; - percentageLow = 20; - percentageCritical = 5; - percentageAction = 3; - criticalPowerAction = "PowerOff"; - }; - - tlp.settings = { - CPU_ENERGY_PERF_POLICY_ON_AC = "power"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - - CPU_BOOST_ON_AC = 1; - CPU_BOOST_ON_BAT = 1; - - CPU_HWP_DYN_BOOST_ON_AC = 1; - CPU_HWP_DYN_BOOST_ON_BAT = 1; - - PLATFORM_PROFILE_ON_AC = "performance"; - PLATFORM_PROFILE_ON_BAT = "performance"; - - INTEL_GPU_MIN_FREQ_ON_AC = 500; - INTEL_GPU_MIN_FREQ_ON_BAT = 500; - # INTEL_GPU_MAX_FREQ_ON_AC=0; - # INTEL_GPU_MAX_FREQ_ON_BAT=0; - # INTEL_GPU_BOOST_FREQ_ON_AC=0; - # INTEL_GPU_BOOST_FREQ_ON_BAT=0; - - PCIE_ASPM_ON_AC = "default"; - PCIE_ASPM_ON_BAT = "powersupersave"; - }; - }; -} diff --git a/hosts/laptop/settings.nix b/hosts/laptop/settings.nix deleted file mode 100644 index 55e590c..0000000 --- a/hosts/laptop/settings.nix +++ /dev/null @@ -1,21 +0,0 @@ -{...}: { - system.stateVersion = "24.05"; - nixpkgs.config.allowUnfree = true; - nix = { - settings = { - auto-optimise-store = true; - experimental-features = ["nix-command" "flakes"]; - substituters = ["https://nix-gaming.cachix.org"]; - }; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - }; - - time.timeZone = "America/New_York"; - i18n.defaultLocale = "en_US.UTF-8"; - - powerManagement.cpuFreqGovernor = "performance"; -} diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..005fd6c --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,51 @@ +{ + inputs, + nixpkgs, + config, + self, + username, + host, + lib, + ... +}: { + imports = [ + ./programs + ./environment + ./scripts + ./files.nix + ]; + + # ./files + homeFiles.enable = lib.mkDefault false; + + # ./environment + hyprlandConfig.enable = lib.mkDefault false; + autojumpConfig.enable = lib.mkDefault false; + stylixHomeConfig.enable = lib.mkDefault false; + waybarConfig.enable = lib.mkDefault false; + gtkConfig.enable = lib.mkDefault false; + spicetifyConfig.enable = lib.mkDefault false; + starshipConfig.enable = lib.mkDefault false; + + # ./programs + btopConfig.enable = lib.mkDefault false; + swayncConfig.enable = lib.mkDefault false; + userPkgs.enable = lib.mkDefault false; + cavaConfig.enable = lib.mkDefault false; + ezaConfig.enable = lib.mkDefault false; + firefoxConfig.enable = lib.mkDefault false; + fuzzelConfig.enable = lib.mkDefault false; + fzfConfig.enable = lib.mkDefault false; + gitConfig.enable = lib.mkDefault false; + kittyConfig.enable = lib.mkDefault false; + yaziConfig.enable = lib.mkDefault false; + zshConfig.enable = lib.mkDefault false; + passConfig.enable = lib.mkDefault false; + batConfig.enable = lib.mkDefault false; + + # ./scripts + movScripts.enable = lib.mkDefault false; + movScripts.commandScripts.enable = lib.mkDefault false; + movScripts.hyprlandControls.enable = lib.mkDefault false; + movScripts.nixShortcuts.enable = lib.mkDefault false; +} diff --git a/modules/home/environment/default.nix b/modules/home/environment/default.nix index c32ff17..eb808dc 100644 --- a/modules/home/environment/default.nix +++ b/modules/home/environment/default.nix @@ -9,14 +9,15 @@ home-manager, ... }: { - imports = - [(import ./gtk.nix)] - ++ [(import ./spicetify.nix)] - ++ [(import ./stylix.nix)] - ++ [(import ./starship.nix)] - ++ [(import ./userpkgs.nix)] - ++ [(import ./zshell.nix)] - ++ [(import ./swaync.nix)] - ++ [(import ./waybar)] - ++ [(import ./hyprland)]; + imports = [ + ./gtk.nix + ./spicetify.nix + ./stylix.nix + ./starship.nix + ./userpkgs.nix + ./zshell.nix + ./swaync.nix + ./hyprland.nix + ./waybar.nix + ]; } diff --git a/modules/home/environment/gtk.nix b/modules/home/environment/gtk.nix index 332f080..b7f5c4e 100644 --- a/modules/home/environment/gtk.nix +++ b/modules/home/environment/gtk.nix @@ -1,35 +1,36 @@ -{ - pkgs, - config, - ... -}: { - fonts.fontconfig.enable = true; - home.packages = with pkgs; [ - (nerdfonts.override { - fonts = [ - "JetBrainsMono" - "CascadiaCode" - "NerdFontsSymbolsOnly" - ]; - }) - ]; +{lib, config, pkgs, ... }: { + options = { + gtkConfig.enable = lib.mkEnableOption "enable my gtk options"; + }; + config = lib.mkIf config.gtkConfig.enable { + fonts.fontconfig.enable = true; + home.packages = with pkgs; [ + (nerdfonts.override { + fonts = [ + "JetBrainsMono" + "CascadiaCode" + "NerdFontsSymbolsOnly" + ]; + }) + ]; - gtk = { - enable = true; - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-nord.override { - accent = "frostblue4"; + gtk = { + enable = true; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-nord.override { + accent = "frostblue4"; + }; }; + #cursorTheme = { + # name = "Bibata-Modern-Ice"; + # package = pkgs.bibata-cursors; + # size = 16; + #}; + #font = { + # name = "Iosevka Nerd Font"; + # package = pkgs.nerdfonts.override {fonts = ["Iosevka"];}; + #}; }; - #cursorTheme = { - # name = "Bibata-Modern-Ice"; - # package = pkgs.bibata-cursors; - # size = 16; - #}; - #font = { - # name = "Iosevka Nerd Font"; - # package = pkgs.nerdfonts.override {fonts = ["Iosevka"];}; - #}; }; } diff --git a/modules/home/environment/hyprland.nix b/modules/home/environment/hyprland.nix new file mode 100644 index 0000000..c52856d --- /dev/null +++ b/modules/home/environment/hyprland.nix @@ -0,0 +1,242 @@ +{inputs, pkgs, lib, config, username, host, ... }: let + desktop = host == "oganesson"; + screenshot_bind = + if desktop + then [ + # My laptop does not have a printscreen button + "super, print, exec, grimblast copy area" + ] + else [ + "super, insert, exec, grimblast copy area" + ]; +in { + options = { + hyprlandConfig.enable = lib.mkEnableOption "enables my hyprland config"; + }; + config = lib.mkIf config.hyprlandConfig.enable { + home.packages = with pkgs; [ + swaybg + inputs.hypr-contrib.packages.${pkgs.system}.grimblast + hyprpicker + grim + slurp + wl-clip-persist + wf-recorder + glib + wayland + direnv + ]; + systemd.user.targets.hyprland-session.Unit.Wants = ["xdg-desktop-autostart.target"]; + wayland.windowManager.hyprland = { + enable = true; + xwayland = { + enable = true; + }; + systemd.enable = true; + }; + wayland.windowManager.hyprland = { + settings = { + monitor = + if (host == "oganesson") + then [ + "DP-1, 1920x1080@144, 1920x0, 1" + "HDMI-A-1, 1920x1080, 0x0, 1" + ] + else [ + "eDP-1, 1600x900, 0x0, 1" + ]; + + exec-once = [ + "waybar &" + "swaync &" + "wl-paste --type text --watch cliphist store &" + "wl-paste --type image --watch cliphist store &" + "wl-clip-persist --clipboard both" + "systemctl --user import-environment &" + "hash dbus-update-activation-environment 2>/dev/null &" + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &" + "aplay /home/${username}/sound/sys/login.wav &" + ]; + + workspace = + if desktop + then [ + "1,persistent=true,monitor:HDMI-A-1" + "2,persistent=true,monitor:HDMI-A-1" + "3,persistent=true,monitor:HDMI-A-1" + "4,persistent=true,monitor:DP-1" + "5,persistent=true,monitor:DP-1" + "6,persistent=true,monitor:DP-1" + ] + else [ + "1,persistent=true,monitor:eDP-1" + "2,persistent=true,monitor:eDP-1" + "3,persistent=true,monitor:eDP-1" + "4,persistent=true,monitor:eDP-1" + ]; + + env = [ + "XDG_CONFIG_HOME,$HOME/.config" + "XDG_DATA_HOME,$HOME/.local/share" + "XDG_CACHE_HOME,$HOME/.cache" + ]; + layerrule = [ + "blur,waybar" + "ignorezero,waybar" + "blur,launcher" + ]; + windowrule = [ + "opacity 0.8,nemo" + ]; + + input = { + kb_layout = "us"; + follow_mouse = 1; + accel_profile = "flat"; + force_no_accel = 1; + sensitivity = 0; + }; + general = { + "$mainMod" = "super"; + layout = "dwindle"; + gaps_in = 4; + gaps_out = 8; + border_size = 2; + #"col.inactive_border" = "0xff${scheme.base01}"; + #"col.active_border" = "0xff${scheme.base0F}"; + border_part_of_window = false; + no_border_on_floating = false; + }; + misc = { + disable_autoreload = true; + disable_hyprland_logo = true; + always_follow_on_dnd = true; + layers_hog_keyboard_focus = true; + animate_manual_resizes = false; + enable_swallow = true; + focus_on_activate = true; + }; + + dwindle = { + no_gaps_when_only = false; + force_split = 0; + special_scale_factor = 1.0; + split_width_multiplier = 1.0; + use_active_for_splits = true; + pseudotile = "yes"; + preserve_split = "yes"; + }; + + master = { + new_status = "master"; + special_scale_factor = 1; + no_gaps_when_only = false; + }; + + decoration = { + rounding = 7; + # active_opacity = 0.90; + # inactive_opacity = 0.90; + # fullscreen_opacity = 1.0; + + blur = { + enabled = true; + # size = 1; + # passes = 1; + size = 4; + passes = 1; + brightness = 1; + contrast = 1.400; + ignore_opacity = true; + popups = true; + noise = 0; + new_optimizations = true; + xray = true; + }; + + drop_shadow = true; + + shadow_ignore_window = true; + shadow_offset = "0 2"; + shadow_range = 20; + shadow_render_power = 3; + }; + + animations = { + enabled = true; + + bezier = [ + "fluent_decel, 0, 0.2, 0.4, 1" + "easeOutCirc, 0, 0.55, 0.45, 1" + "easeOutCubic, 0.33, 1, 0.68, 1" + "easeinoutsine, 0.37, 0, 0.63, 1" + ]; + + animation = [ + # Windows + "windowsIn, 1, 3, easeOutCubic, popin 30%" # window open + "windowsOut, 1, 3, fluent_decel, popin 70%" # window close. + "windowsMove, 1, 2, easeinoutsine, slide" # everything in between, moving, dragging, resizing. + + # Fade + "fadeIn, 1, 3, easeOutCubic" # fade in (open) -> layers and windows + "fadeOut, 1, 2, easeOutCubic" # fade out (close) -> layers and windows + "fadeSwitch, 0, 1, easeOutCirc" # fade on changing activewindow and its opacity + "fadeShadow, 1, 10, easeOutCirc" # fade on changing activewindow for shadows + "fadeDim, 1, 4, fluent_decel" # the easing of the dimming of inactive windows + "border, 1, 2.7, easeOutCirc" # for animating the border's color switch speed + "borderangle, 1, 30, fluent_decel, once" # for animating the border's gradient angle - styles: once (default), loop + "workspaces, 1, 4, easeOutCubic, fade" # styles: slide, slidevert, fade, slidefade, slidefadevert + ]; + + bind = + [ + "super, up, exec, pactl set-sink-volume @default_sink@ +10%" + "super, down, exec, pactl set-sink-volume @default_sink@ -10%" + "super, t, exec, swaync-client -t -sw" + "super, a, exec, firefox" + "super, q, exec, kitty --title Kitty" + "super shift, q, exec, [float;size 40% 30%;move onscreen cursor -50% -50%] kitty --title Kitty" + "super, c, killactive," + "super, e, exec, nemo" + "super, p, exec, [float;size 40% 25%;move onscreen cursor] [ ! -f /tmp/keyringfile ] && kitty toolbelt" + "super shift, m, exit," + "super, m, exec, fuzzel" + "super, r, exec, neovide" + "super, b, togglesplit, # dwindle" + "super, f, togglefloating" + "super, g, fullscreen" + "super, h, movefocus, l" + "super, l, movefocus, r" + "super, k, movefocus, u" + "super, j, movefocus, d" + "super shift, h, movewindow, l" + "super shift, l, movewindow, r" + "super shift, k, movewindow, u" + "super shift, j, movewindow, d" + "super, d, exec, switchmon" + "super, 1, exec, hyprctl 'dispatch workspace 1'" + "super, 2, exec, hyprctl 'dispatch workspace 2'" + "super, 3, exec, hyprctl 'dispatch workspace 3'" + "super, 4, exec, hyprctl 'dispatch workspace 4'" + "super, 5, exec, hyprctl 'dispatch workspace 5'" + "super, 6, exec, hyprctl 'dispatch workspace 6'" + "super shift, 1, movetoworkspace, 1" + "super shift, 2, movetoworkspace, 2" + "super shift, 3, movetoworkspace, 3" + "super shift, 4, movetoworkspace, 4" + "super shift, 5, movetoworkspace, 5" + "super shift, 6, movetoworkspace, 6" + "super, s, togglespecialworkspace, magic" + "super shift, s, movetoworkspace, special:magic" + ] + ++ screenshot_bind; + bindm = [ + "super, mouse:272, movewindow" + "super, mouse:273, resizewindow" + ]; + }; + }; + }; + }; +} diff --git a/modules/home/environment/hyprland/config.nix b/modules/home/environment/hyprland/config.nix deleted file mode 100644 index 777209b..0000000 --- a/modules/home/environment/hyprland/config.nix +++ /dev/null @@ -1,221 +0,0 @@ -{ - username, - host, - ... -}: let - desktop = host == "oganesson"; - screenshot_bind = - if desktop - then [ - # My laptop does not have a printscreen button - "super, print, exec, grimblast copy area" - ] - else [ - "super, insert, exec, grimblast copy area" - ]; -in { - wayland.windowManager.hyprland = { - settings = { - monitor = - if (host == "oganesson") - then [ - "DP-1, 1920x1080@144, 1920x0, 1" - "HDMI-A-1, 1920x1080, 0x0, 1" - ] - else [ - "eDP-1, 1600x900, 0x0, 1" - ]; - - exec-once = [ - "waybar &" - "swaync &" - "wl-paste --type text --watch cliphist store &" - "wl-paste --type image --watch cliphist store &" - "wl-clip-persist --clipboard both" - "systemctl --user import-environment &" - "hash dbus-update-activation-environment 2>/dev/null &" - "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &" - "aplay /home/${username}/sound/sys/login.wav &" - ]; - - workspace = - if desktop - then [ - "1,persistent=true,monitor:HDMI-A-1" - "2,persistent=true,monitor:HDMI-A-1" - "3,persistent=true,monitor:HDMI-A-1" - "4,persistent=true,monitor:DP-1" - "5,persistent=true,monitor:DP-1" - "6,persistent=true,monitor:DP-1" - ] - else [ - "1,persistent=true,monitor:eDP-1" - "2,persistent=true,monitor:eDP-1" - "3,persistent=true,monitor:eDP-1" - "4,persistent=true,monitor:eDP-1" - ]; - - env = [ - "XDG_CONFIG_HOME,$HOME/.config" - "XDG_DATA_HOME,$HOME/.local/share" - "XDG_CACHE_HOME,$HOME/.cache" - ]; - layerrule = [ - "blur,waybar" - "ignorezero,waybar" - "blur,launcher" - ]; - windowrule = [ - "opacity 0.8,nemo" - ]; - - input = { - kb_layout = "us"; - follow_mouse = 1; - accel_profile = "flat"; - force_no_accel = 1; - sensitivity = 0; - }; - general = { - "$mainMod" = "super"; - layout = "dwindle"; - gaps_in = 4; - gaps_out = 8; - border_size = 2; - #"col.inactive_border" = "0xff${scheme.base01}"; - #"col.active_border" = "0xff${scheme.base0F}"; - border_part_of_window = false; - no_border_on_floating = false; - }; - misc = { - disable_autoreload = true; - disable_hyprland_logo = true; - always_follow_on_dnd = true; - layers_hog_keyboard_focus = true; - animate_manual_resizes = false; - enable_swallow = true; - focus_on_activate = true; - }; - - dwindle = { - no_gaps_when_only = false; - force_split = 0; - special_scale_factor = 1.0; - split_width_multiplier = 1.0; - use_active_for_splits = true; - pseudotile = "yes"; - preserve_split = "yes"; - }; - - master = { - new_status = "master"; - special_scale_factor = 1; - no_gaps_when_only = false; - }; - - decoration = { - rounding = 7; - # active_opacity = 0.90; - # inactive_opacity = 0.90; - # fullscreen_opacity = 1.0; - - blur = { - enabled = true; - # size = 1; - # passes = 1; - size = 4; - passes = 1; - brightness = 1; - contrast = 1.400; - ignore_opacity = true; - popups = true; - noise = 0; - new_optimizations = true; - xray = true; - }; - - drop_shadow = true; - - shadow_ignore_window = true; - shadow_offset = "0 2"; - shadow_range = 20; - shadow_render_power = 3; - }; - - animations = { - enabled = true; - - bezier = [ - "fluent_decel, 0, 0.2, 0.4, 1" - "easeOutCirc, 0, 0.55, 0.45, 1" - "easeOutCubic, 0.33, 1, 0.68, 1" - "easeinoutsine, 0.37, 0, 0.63, 1" - ]; - - animation = [ - # Windows - "windowsIn, 1, 3, easeOutCubic, popin 30%" # window open - "windowsOut, 1, 3, fluent_decel, popin 70%" # window close. - "windowsMove, 1, 2, easeinoutsine, slide" # everything in between, moving, dragging, resizing. - - # Fade - "fadeIn, 1, 3, easeOutCubic" # fade in (open) -> layers and windows - "fadeOut, 1, 2, easeOutCubic" # fade out (close) -> layers and windows - "fadeSwitch, 0, 1, easeOutCirc" # fade on changing activewindow and its opacity - "fadeShadow, 1, 10, easeOutCirc" # fade on changing activewindow for shadows - "fadeDim, 1, 4, fluent_decel" # the easing of the dimming of inactive windows - "border, 1, 2.7, easeOutCirc" # for animating the border's color switch speed - "borderangle, 1, 30, fluent_decel, once" # for animating the border's gradient angle - styles: once (default), loop - "workspaces, 1, 4, easeOutCubic, fade" # styles: slide, slidevert, fade, slidefade, slidefadevert - ]; - - bind = - [ - "super, up, exec, pactl set-sink-volume @default_sink@ +10%" - "super, down, exec, pactl set-sink-volume @default_sink@ -10%" - "super, t, exec, swaync-client -t -sw" - "super, a, exec, firefox" - "super, q, exec, kitty --title Kitty" - "super shift, q, exec, [float;size 40% 30%;move onscreen cursor -50% -50%] kitty --title Kitty" - "super, c, killactive," - "super, e, exec, nemo" - "super, p, exec, [float;size 40% 25%;move onscreen cursor] [ ! -f /tmp/keyringfile ] && kitty toolbelt" - "super shift, m, exit," - "super, m, exec, fuzzel" - "super, r, exec, neovide" - "super, b, togglesplit, # dwindle" - "super, f, togglefloating" - "super, g, fullscreen" - "super, h, movefocus, l" - "super, l, movefocus, r" - "super, k, movefocus, u" - "super, j, movefocus, d" - "super shift, h, movewindow, l" - "super shift, l, movewindow, r" - "super shift, k, movewindow, u" - "super shift, j, movewindow, d" - "super, d, exec, switchmon" - "super, 1, exec, hyprctl 'dispatch workspace 1'" - "super, 2, exec, hyprctl 'dispatch workspace 2'" - "super, 3, exec, hyprctl 'dispatch workspace 3'" - "super, 4, exec, hyprctl 'dispatch workspace 4'" - "super, 5, exec, hyprctl 'dispatch workspace 5'" - "super, 6, exec, hyprctl 'dispatch workspace 6'" - "super shift, 1, movetoworkspace, 1" - "super shift, 2, movetoworkspace, 2" - "super shift, 3, movetoworkspace, 3" - "super shift, 4, movetoworkspace, 4" - "super shift, 5, movetoworkspace, 5" - "super shift, 6, movetoworkspace, 6" - "super, s, togglespecialworkspace, magic" - "super shift, s, movetoworkspace, special:magic" - ] - ++ screenshot_bind; - bindm = [ - "super, mouse:272, movewindow" - "super, mouse:273, resizewindow" - ]; - }; - }; - }; -} diff --git a/modules/home/environment/hyprland/default.nix b/modules/home/environment/hyprland/default.nix deleted file mode 100644 index 85e56be..0000000 --- a/modules/home/environment/hyprland/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - inputs, - host, - ... -}: { - imports = - [(import ./hyprland.nix)] - ++ [(import ./config.nix)]; -} diff --git a/modules/home/environment/hyprland/hyprland.nix b/modules/home/environment/hyprland/hyprland.nix deleted file mode 100644 index fabc026..0000000 --- a/modules/home/environment/hyprland/hyprland.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - home.packages = with pkgs; [ - swaybg - inputs.hypr-contrib.packages.${pkgs.system}.grimblast - hyprpicker - grim - slurp - wl-clip-persist - wf-recorder - glib - wayland - direnv - ]; - systemd.user.targets.hyprland-session.Unit.Wants = ["xdg-desktop-autostart.target"]; - wayland.windowManager.hyprland = { - enable = true; - xwayland = { - enable = true; - }; - systemd.enable = true; - }; -} diff --git a/modules/home/environment/spicetify.nix b/modules/home/environment/spicetify.nix index 4a6ec3e..9475520 100644 --- a/modules/home/environment/spicetify.nix +++ b/modules/home/environment/spicetify.nix @@ -1,43 +1,40 @@ -{ - pkgs, - lib, - inputs, - scheme, - ... -}: let +{lib, config, pkgs, inputs, scheme, ... }: let spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; in { - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "spotify" - ]; + options = { + spicetifyConfig.enable = lib.mkEnableOption "enable my spicetify options"; + }; + config = lib.mkIf config.spicetifyConfig.enable { + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "spotify" + ]; - imports = [inputs.spicetify-nix.homeManagerModules.default]; + programs.spicetify = { + enable = true; + enabledExtensions = with spicePkgs.extensions; [ + adblock + hidePodcasts + shuffle # shuffle+ (special characters are sanitized out of extension names) + ]; + #colorScheme = "custom"; - programs.spicetify = { - enable = true; - enabledExtensions = with spicePkgs.extensions; [ - adblock - hidePodcasts - shuffle # shuffle+ (special characters are sanitized out of extension names) - ]; - #colorScheme = "custom"; - - #customColorScheme = { - # text = scheme.base06; - # subtext = scheme.base04; - # sidebar-text = scheme.base04; - # main = scheme.base00; - # sidebar = scheme.base01; - # shadow = scheme.base01; - # selected-row = scheme.base08; - # button = scheme.base0D; - # button-active = scheme.base0C; - # button-disabled = scheme.base02; - # tab-active = scheme.base0E; - # notification = scheme.base0A; - # notification-error = scheme.base09; - # misc = scheme.base0F; - #}; + #customColorScheme = { + # text = scheme.base06; + # subtext = scheme.base04; + # sidebar-text = scheme.base04; + # main = scheme.base00; + # sidebar = scheme.base01; + # shadow = scheme.base01; + # selected-row = scheme.base08; + # button = scheme.base0D; + # button-active = scheme.base0C; + # button-disabled = scheme.base02; + # tab-active = scheme.base0E; + # notification = scheme.base0A; + # notification-error = scheme.base09; + # misc = scheme.base0F; + #}; + }; }; } diff --git a/modules/home/environment/starship.nix b/modules/home/environment/starship.nix index 99a0873..d5801cc 100644 --- a/modules/home/environment/starship.nix +++ b/modules/home/environment/starship.nix @@ -1,64 +1,65 @@ -{ - lib, - inputs, - ... -}: { - programs.starship = { - enable = true; - enableZshIntegration = false; - settings = { - add_newline = true; - right_format = "($custom)"; +{config, lib, inputs, ... }: { + options = { + starshipConfig.enable = lib.mkEnableOption "enables my starship configuration"; + }; + config = lib.mkIf config.starshipConfig.enable { + programs.starship = { + enable = true; + enableZshIntegration = false; + settings = { + add_newline = true; + right_format = "($custom)"; - format = lib.concatStrings [ - "($username)($ssh_symbol)($hostname)(bold white)($cmd_duration)($character)" - "($git_branch)($git_status)($rust)($nix-shell)" - "($directory)" - "$line_break[ > ](bold #89b4fa)" - ]; + format = lib.concatStrings [ + "($ssh_symbol)($username)($hostname)(bold white)($cmd_duration)($character)" + "($git_branch)($git_status)($rust)($nix-shell)" + "($directory)" + "$line_break[ > ](bold #89b4fa)" + ]; - username = { - show_always = true; - style_user = "bold white"; - format = "[$user]($style)"; - }; - directory = { - format = "\n[$path](bold cyan)[/](bold green) "; - style = "bold #b4befe"; - }; + username = { + show_always = true; + style_user = "bold white"; + format = "[$user]($style)"; + }; + directory = { + format = "\n[$path](bold cyan)[/](bold green) "; + style = "bold #b4befe"; + }; - character = { - success_symbol = "[ -> ](bold green)"; - error_symbol = "[ -> ✗](bold red)"; - # error_symbol = "[ ](bold #89dceb)[ ✗](bold red)"; - }; + character = { + success_symbol = "[ -> ](bold green)"; + error_symbol = "[ -> ✗](bold red)"; + # error_symbol = "[ ](bold #89dceb)[ ✗](bold red)"; + }; - cmd_duration = { - format = "[ 󰔛 $duration]($style)"; - disabled = false; - style = "bg:none fg:#f9e2af"; - show_notifications = false; - min_time_to_notify = 60000; - }; + cmd_duration = { + format = "[ 󰔛 $duration]($style)"; + disabled = false; + style = "bg:none fg:#f9e2af"; + show_notifications = false; + min_time_to_notify = 60000; + }; - git_branch = { - format = "\non [$symbol$branch](bold purple)"; - symbol = " "; - truncation_length = 15; - style = "bold purple"; - }; + git_branch = { + format = "\non [$symbol$branch](bold purple)"; + symbol = " "; + truncation_length = 15; + style = "bold purple"; + }; - hostname = { - ssh_symbol = "🌐"; - ssh_only = false; - format = "[$ssh_symbol](bold blue)[$hostname](bold red)"; - }; + hostname = { + ssh_symbol = "🌐"; + ssh_only = false; + format = "[@](bold blue)[$hostname](bold red)"; + }; - custom.shellver = { - command = "zsh --version"; - when = ''test $SHELL = "/run/current-system/sw/bin/zsh"''; - symbol = ""; - style = "bold magenta"; + custom.shellver = { + command = "zsh --version"; + when = ''test $SHELL = "/run/current-system/sw/bin/zsh"''; + symbol = ""; + style = "bold magenta"; + }; }; }; }; diff --git a/modules/home/environment/stylix.nix b/modules/home/environment/stylix.nix index dbae785..2557b3a 100644 --- a/modules/home/environment/stylix.nix +++ b/modules/home/environment/stylix.nix @@ -1,18 +1,18 @@ -{ - pkgs, - scheme, - wallpaper, - ... -}: { - stylix = { - enable = true; - autoEnable = true; - targets = { - # fzf.enable = true; - # kitty.enable = true; - # vesktop.enable = true; - waybar.enable = false; - btop.enable = false; +{lib, config, pkgs, scheme, wallpaper, ... }: { + options = { + stylixHomeConfig.enable = lib.mkEnableOption "enables my stylix Home-Manager options"; + }; + config = lib.mkIf config.stylixHomeConfig.enable { + stylix = { + enable = true; + autoEnable = true; + targets = { + # fzf.enable = true; + # kitty.enable = true; + # vesktop.enable = true; + waybar.enable = false; + btop.enable = false; + }; }; }; } diff --git a/modules/home/environment/swaync.nix b/modules/home/environment/swaync.nix index b069463..a4036de 100644 --- a/modules/home/environment/swaync.nix +++ b/modules/home/environment/swaync.nix @@ -1,743 +1,748 @@ -{pkgs, ...}: { - home.packages = with pkgs; [swaynotificationcenter]; - xdg.configFile."swaync/style.css".text = '' - @define-color shadow rgba(0, 0, 0, 0.25); - /* - * - * Catppuccin Mocha palette - * Maintainer: rubyowo - * - */ - - @define-color base #1E1D2E; - @define-color mantle #181825; - @define-color crust #11111b; - - @define-color text #cdd6f4; - @define-color subtext0 #a6adc8; - @define-color subtext1 #bac2de; - - @define-color surface0 #313244; - @define-color surface1 #45475a; - @define-color surface2 #585b70; - - @define-color overlay0 #6c7086; - @define-color overlay1 #7f849c; - @define-color overlay2 #9399b2; - - @define-color blue #89b4fa; - @define-color lavender #b4befe; - @define-color sapphire #74c7ec; - @define-color sky #89dceb; - @define-color teal #94e2d5; - @define-color green #a6e3a1; - @define-color yellow #f9e2af; - @define-color peach #fab387; - @define-color maroon #eba0ac; - @define-color red #f38ba8; - @define-color mauve #cba6f7; - @define-color pink #f5c2e7; - @define-color flamingo #f2cdcd; - @define-color rosewater #f5e0dc; - - * { - font-family: "NotoSansMono Nerd Font"; - background-clip: border-box; - } - - /* #notifications_box { */ - /* border: solid 4px red; */ - /* } */ - - label { - color: @text; - } - - .notification { - border: @lavender; - box-shadow: none; - /* margin: 0px; */ - /* margin: -15px -10px -15px -10px; */ - border-radius: 4px; - background: inherit; - /* background: @theme_bg_color; */ - /* background: shade(alpha(@borders, 2.55), 0.25); */ - } - - .notification button { - background: transparent; - border-radius: 0px; - border: none; - margin: 0px; - padding: 0px; - } - - .notification button:hover { - background: @surface0; - /* background: @insensitive_bg_color; */ - } - - - .notification-content { - min-height: 64px; - margin: 10px; - padding: 0px; - border-radius: 0px; - } - - .close-button { - background: @crust; - color: @surface2; - } - - .notification-default-action, - .notification-action { - background: transparent; - border: none; - } - - - .notification-default-action { - border-radius: 4px; - } - - /* When alternative actions are visible */ - .notification-default-action:not(:only-child) { - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; - } - - .notification-action { - border-radius: 0px; - padding: 2px; - color: @text; - /* color: @theme_text_color; */ - } - - /* add bottom border radius to eliminate clipping */ - .notification-action:first-child { - border-bottom-left-radius: 4px; - } - - .notification-action:last-child { - border-bottom-right-radius: 4px; - } - - /*** Notification ***/ - /* Notification header */ - .summary { - color: @text; - /* color: @theme_text_color; */ - font-size: 16px; - padding: 0px; - } - - .time { - color: @subtext0; - /* color: alpha(@theme_text_color, 0.9); */ - font-size: 12px; - text-shadow: none; - margin: 0px 0px 0px 0px; - padding: 2px 0px; - } - - .body { - font-size: 14px; - font-weight: 500; - color: @subtext1; - /* color: alpha(@text, 0.9); */ - /* color: alpha(@theme_text_color, 0.9); */ - text-shadow: none; - margin: 0px 0px 0px 0px; - } - - .body-image { - border-radius: 4px; - } - - /* The "Notifications" and "Do Not Disturb" text widget */ - .top-action-title { - color: @text; - /* color: @theme_text_color; */ - text-shadow: none; - } - - /* Control center */ - - .control-center { - /* background: transparent; */ - background: @crust; - /* background: @theme_bg_color; */ - /* border: 1px solid @surface0; */ - border-radius: 5px; - /* box-shadow: 0px 0px 2px black; */ - } - - /* .right.overlay-indicator { */ - /* border: solid 5px red; */ - /* } */ - - .control-center-list { - /* background: @base; */ - background: @crust; - min-height: 5px; - /* border: 1px solid @surface1; */ - border-top: none; - border-radius: 0px 0px 4px 4px; - } - - .control-center-list-placeholder, - .notification-group-icon, - .notification-group { - /* opacity: 1.0; */ - /* opacity: 0; */ - color: alpha(@theme_text_color, 0.50); - } - - .notification-group { - /* unset the annoying focus thingie */ - all: unset; - border: none; - opacity: 0; - padding: 0px; - box-shadow: none; - /* selectable: no; */ - } - .notification-group > box { - all: unset; - background: @mantle; - /* background: alpha(currentColor, 0.072); */ - padding: 8px; - margin: 0px; - /* margin: 0px -5px; */ - border: none; - border-radius: 4px; - box-shadow: none; - } - - - .notification-row { - outline: none; - transition: all 1s ease; - background: @base; - /* background: @theme_bg_color; */ - border: 1px solid @crust; - margin: 10px 5px 0px 5px; - border-radius: 4px; - /* box-shadow: 0px 0px 4px black; */ - /* background: alpha(currentColor, 0.05); */ - } - - .notification-row:focus, - .notification-row:hover { - box-shadow: none; - } - - .control-center-list > row, - .control-center-list > row:focus, - .control-center-list > row:hover { - background: transparent; - border: none; - margin: 0px; - padding: 5px 10px 5px 10px; - box-shadow: none; - } - - .control-center-list > row:last-child { - padding: 5px 10px 10px 10px; - } - - - /* Window behind control center and on all other monitors */ - .blank-window { - background: transparent; - } - - /*** Widgets ***/ - - /* Title widget */ - .widget-title { - margin: 0px; - background: inherit; - /* background: @theme_bg_color; */ - border-radius: 4px 4px 0px 0px; - /* border: 1px solid @surface1; */ - border-bottom: none; - padding-bottom: 20px; - } - - .widget-title > label { - margin: 18px 10px; - font-size: 20px; - font-weight: 500; - } - - .widget-title > button { - font-weight: 700; - padding: 7px 3px; - margin-right: 10px; - background: @mantle; - color: @text; - /* color: @theme_text_color; */ - /* border: none; */ - border-radius: 4px; - } - .widget-title > button:hover { - background: @base; - /* background: alpha(currentColor, 0.1); */ - } - - /* Label widget */ - .widget-label { - margin: 0px; - padding: 0px; - min-height: 5px; - background: @mantle; - /* background: @theme_bg_color; */ - border-radius: 0px 0px 4px 4px; - /* border: 1px solid @surface1; */ - border-top: none; - } - .widget-label > label { - font-size: 0px; - font-weight: 400; - } - - /* Menubar */ - .widget-menubar { - background: inherit; - /* background: @theme_bg_color; */ - /* border: 1px solid @surface1; */ - border-top: none; - border-bottom: none; - } - .widget-menubar > box > box { - margin: 5px 10px 5px 10px; - min-height: 40px; - border-radius: 4px; - background: transparent; - } - .widget-menubar > box > box > button { - background: @mantle; - /* background: alpha(currentColor, 0.05); */ - min-width: 85px; - min-height: 50px; - margin-right: 13px; - font-size: 17px; - padding: 0px; - } - .widget-menubar > box > box > button:nth-child(4) { - margin-right: 0px; - } - .widget-menubar button:focus { - box-shadow: none; - } - .widget-menubar button:focus:hover { - background: @base; - /* background: alpha(currentColor,0.1); */ - box-shadow: none; - } - - .widget-menubar > box > revealer > box { - margin: 5px 10px 5px 10px; - background: @mantle; - /* background: alpha(currentColor, 0.05); */ - border-radius: 4px; - } - .widget-menubar > box > revealer > box > button { - background: transparent; - min-height: 50px; - padding: 0px; - margin: 5px; - } - - /* Buttons grid */ - .widget-buttons-grid { - /* background-color: @theme_bg_color; */ - background-color: @mantle; - /* border: 1px solid @surface1; */ - border-top: none; - border-bottom: none; - font-size: 14px; - font-weight: 500; - margin: 0px; - padding: 5px; - border-radius: 0px; - } - - .widget-buttons-grid > flowbox > flowboxchild { - background: @mantle; - /* background: alpha(currentColor, 0.05); */ - border-radius: 4px; - min-height: 50px; - min-width: 85px; - margin: 5px; - padding: 0px; - } - - .widget-buttons-grid > flowbox > flowboxchild > button { - background: transparent; - border-radius: 4px; - margin: 0px; - border: none; - box-shadow: none; - } - - - .widget-buttons-grid > flowbox > flowboxchild > button:hover { - background: @mantle; - /* background: alpha(currentColor, 0.1); */ - } - - /* Mpris widget */ - .widget-mpris { - padding: 10px; - padding-bottom: 35px; - padding-top: 35px; - margin-bottom: -33px; - } - .widget-mpris > box { - padding: 0px; - margin: -5px 0px -10px 0px; - padding: 0px; - border-radius: 4px; - /* background: alpha(currentColor, 0.05); */ - background: @mantle; - } - .widget-mpris > box > button:nth-child(1), - .widget-mpris > box > button:nth-child(3) { - margin-bottom: 0px; - } - .widget-mpris > box > button:nth-child(1) { - margin-left: -25px; - margin-right: -25px; - opacity: 0; - } - .widget-mpris > box > button:nth-child(3) { - margin-left: -25px; - margin-right: -25px; - opacity: 0; - } - - .widget-mpris-album-art { - all: unset; - } - - /* Player button box */ - .widget-mpris > box > carousel > widget > box > box:nth-child(2) { - margin: 5px 0px -5px 90px; - } - - /* Player buttons */ - .widget-mpris > box > carousel > widget > box > box:nth-child(2) > button { - border-radius: 4px; - } - .widget-mpris > box > carousel > widget > box > box:nth-child(2) > button:hover { - background: alpha(currentColor, 0.1); - } - carouselindicatordots { - opacity: 0; - } - - .widget-mpris-title { - color: #eeeeee; - font-weight: bold; - font-size: 1.25rem; - text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5); - } - .widget-mpris-subtitle { - color: #eeeeee; - font-size: 1rem; - text-shadow: 0px 0px 3px rgba(0, 0, 0, 1); - } - - .widget-mpris-player { - border-radius: 0px; - margin: 0px; - } - .widget-mpris-player > box > image { - margin: 0px 0px -48px 0px; - } - - .notification-group > box.vertical { - /* border: solid 5px red; */ - margin-top: 3px - } - - /* Backlight and volume widgets */ - .widget-backlight, - .widget-volume { - background-color: @crust; - /* background-color: @theme_bg_color; */ - /* border: 1px solid @surface1; */ - border-top: none; - border-bottom: none; font-size: 13px; - font-weight: 600; - border-radius: 0px; - margin: 0px; - padding: 0px; - } - .widget-volume > box { - background: @mantle; - /* background: alpha(currentColor, 0.05); */ - border-radius: 4px; - margin: 5px 10px 5px 10px; - min-height: 50px; - } - .widget-volume > box > label { - min-width: 50px; - padding: 0px; - } - .widget-volume > box > button { - min-width: 50px; - box-shadow: none; - padding: 0px; - } - .widget-volume > box > button:hover { - /* background: alpha(currentColor, 0.05); */ - background: @surface0; - } - .widget-volume > revealer > list { - background: @mantle; - /* background: alpha(currentColor, 0.05); */ - border-radius: 4px; - margin-top: 5px; - padding: 0px; - } - .widget-volume > revealer > list > row { - padding-left: 10px; - min-height: 40px; - background: transparent; - } - .widget-volume > revealer > list > row:hover { - background: transparent; - box-shadow: none; - border-radius: 4px; - } - .widget-backlight > scale { - background: @mantle; - /* background: alpha(currentColor, 0.05); */ - border-radius: 0px 4px 4px 0px; - margin: 5px 10px 5px 0px; - padding: 0px 10px 0px 0px; - min-height: 50px; - } - .widget-backlight > label { - background: @surface0; - /* background: alpha(currentColor, 0.05); */ - margin: 5px 0px 5px 10px; - border-radius: 4px 0px 0px 4px; - padding: 0px; - min-height: 50px; - min-width: 50px; - } - - /* DND widget */ - .widget-dnd { - margin: 8px; - font-size: 1.1rem; - padding-top: 20px; - } - - .widget-dnd>switch { - font-size: initial; - border-radius: 12px; - background: @surface0; - border: 1px solid @lavender; - box-shadow: none; - } - - .widget-dnd>switch:checked { - background: @surface2; - } - - .widget-dnd>switch slider { - background: @lavender; - border-radius: 12px; - } - - /* Toggles */ - .toggle:checked { - background: @surface1; - /* background: @theme_selected_bg_color; */ - } - /*.toggle:not(:checked) { - color: rgba(128, 128, 128, 0.5); - }*/ - .toggle:checked:hover { - background: @surface2; - /* background: alpha(@theme_selected_bg_color, 0.75); */ - } - - /* Sliders */ - scale { - padding: 0px; - margin: 0px 10px 0px 10px; - } - - scale trough { - border-radius: 4px; - background: @surface0; - /* background: alpha(currentColor, 0.1); */ - } - - scale highlight { - border-radius: 5px; - min-height: 10px; - margin-right: -5px; - } - - scale slider { - margin: -10px; - min-width: 10px; - min-height: 10px; - background: transparent; - box-shadow: none; - padding: 0px; - } - scale slider:hover { - } - - .right.overlay-indicator { - all: unset; - } - ''; - xdg.configFile."swaync/config.json".text = '' - { - "positionX": "right", - "positionY": "top", - "layer": "overlay", - "layer-shell": "true", - "cssPriority": "application", - "control-center-margin-top": 10, - "control-center-margin-bottom": 10, - "control-center-margin-right": 10, - "control-center-margin-left": 10, - "notification-icon-size": 64, - "notification-body-image-height": 128, - "notification-body-image-width": 200, - "timeout": 10, - "timeout-low": 5, - "timeout-critical": 0, - "fit-to-screen": true, - "control-center-width": 400, - "control-center-height": 650, - "notification-window-width": 350, - "keyboard-shortcuts": true, - "image-visibility": "when-available", - "transition-time": 200, - "hide-on-clear": false, - "hide-on-action": true, - "script-fail-notify": true, - "widgets": [ - "title", - "menubar#desktop", - "volume", - "backlight#mobile", - "mpris", - "dnd", - "notifications" - ], - "widget-config": { - "title": { - "text": "Notifications", - "clear-all-button": true, - "button-text": " Clear All " - }, - "menubar#desktop": { - "menu#powermode-buttons": { - "label": " 󰌪 ", - "position": "left", - "actions": [ - { - "label": "Performance", - "command": "powerprofilesctl set performance" - }, - { - "label": "Balanced", - "command": "powerprofilesctl set balanced" - }, - { - "label": "Power-saver", - "command": "powerprofilesctl set power-saver" - } - ] - }, - "menu#screenshot": { - "label": "  ", - "position": "left", - "actions": [ - { - "label": "󰹑 Whole screen", - "command": "grimblast --notify --cursor --freeze copy output" - }, - { - "label": "󰩭 Window / Region", - "command": "grimblast --notify --cursor --freeze copy area" - } - ] - }, - "menu#record": { - "label": " 󰕧 ", - "position": "left", - "actions": [ - { - "label": " Record screen", - "command": "record screen & ; swaync-client -t" - }, - { - "label": " Record selection", - "command": "record area & ; swaync-client -t" - }, - { - "label": " Record GIF", - "command": "record gif & ; swaync-client -t" - }, - { - "label": "󰻃 Stop", - "command": "record stop" - } - ] - }, - "menu#power-buttons": { - "label": "  ", - "position": "left", - "actions": [ - { - "label": " Lock", - "command": "swaylock" - }, - { - "label": " Reboot", - "command": "systemctl reboot" - }, - { - "label": " Shut down", - "command": "systemctl poweroff" - } - ] - } - }, - "backlight#mobile": { - "label": " 󰃠 ", - "device": "panel" - }, - "volume": { - "label": "", - "expand-button-label": "", - "collapse-button-label": "", - "show-per-app": true, - "show-per-app-icon": true, - "show-per-app-label": false - }, - "dnd": { - "text": " Do Not Disturb" - }, - "mpris": { - "image-size": 85, - "image-radius": 5 - } - } - } - ''; +{lib, config, pkgs, ...}: { + options = { + swayncConfig.enable = lib.mkEnableOption "enables my swaync configuration"; + }; + config = lib.mkIf config.swayncConfig.enable { + home.packages = with pkgs; [swaynotificationcenter]; + xdg.configFile."swaync/style.css".text = '' + @define-color shadow rgba(0, 0, 0, 0.25); + /* + * + * Catppuccin Mocha palette + * Maintainer: rubyowo + * + */ + + @define-color base #1E1D2E; + @define-color mantle #181825; + @define-color crust #11111b; + + @define-color text #cdd6f4; + @define-color subtext0 #a6adc8; + @define-color subtext1 #bac2de; + + @define-color surface0 #313244; + @define-color surface1 #45475a; + @define-color surface2 #585b70; + + @define-color overlay0 #6c7086; + @define-color overlay1 #7f849c; + @define-color overlay2 #9399b2; + + @define-color blue #89b4fa; + @define-color lavender #b4befe; + @define-color sapphire #74c7ec; + @define-color sky #89dceb; + @define-color teal #94e2d5; + @define-color green #a6e3a1; + @define-color yellow #f9e2af; + @define-color peach #fab387; + @define-color maroon #eba0ac; + @define-color red #f38ba8; + @define-color mauve #cba6f7; + @define-color pink #f5c2e7; + @define-color flamingo #f2cdcd; + @define-color rosewater #f5e0dc; + + * { + font-family: "NotoSansMono Nerd Font"; + background-clip: border-box; + } + + /* #notifications_box { */ + /* border: solid 4px red; */ + /* } */ + + label { + color: @text; + } + + .notification { + border: @lavender; + box-shadow: none; + /* margin: 0px; */ + /* margin: -15px -10px -15px -10px; */ + border-radius: 4px; + background: inherit; + /* background: @theme_bg_color; */ + /* background: shade(alpha(@borders, 2.55), 0.25); */ + } + + .notification button { + background: transparent; + border-radius: 0px; + border: none; + margin: 0px; + padding: 0px; + } + + .notification button:hover { + background: @surface0; + /* background: @insensitive_bg_color; */ + } + + + .notification-content { + min-height: 64px; + margin: 10px; + padding: 0px; + border-radius: 0px; + } + + .close-button { + background: @crust; + color: @surface2; + } + + .notification-default-action, + .notification-action { + background: transparent; + border: none; + } + + + .notification-default-action { + border-radius: 4px; + } + + /* When alternative actions are visible */ + .notification-default-action:not(:only-child) { + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; + } + + .notification-action { + border-radius: 0px; + padding: 2px; + color: @text; + /* color: @theme_text_color; */ + } + + /* add bottom border radius to eliminate clipping */ + .notification-action:first-child { + border-bottom-left-radius: 4px; + } + + .notification-action:last-child { + border-bottom-right-radius: 4px; + } + + /*** Notification ***/ + /* Notification header */ + .summary { + color: @text; + /* color: @theme_text_color; */ + font-size: 16px; + padding: 0px; + } + + .time { + color: @subtext0; + /* color: alpha(@theme_text_color, 0.9); */ + font-size: 12px; + text-shadow: none; + margin: 0px 0px 0px 0px; + padding: 2px 0px; + } + + .body { + font-size: 14px; + font-weight: 500; + color: @subtext1; + /* color: alpha(@text, 0.9); */ + /* color: alpha(@theme_text_color, 0.9); */ + text-shadow: none; + margin: 0px 0px 0px 0px; + } + + .body-image { + border-radius: 4px; + } + + /* The "Notifications" and "Do Not Disturb" text widget */ + .top-action-title { + color: @text; + /* color: @theme_text_color; */ + text-shadow: none; + } + + /* Control center */ + + .control-center { + /* background: transparent; */ + background: @crust; + /* background: @theme_bg_color; */ + /* border: 1px solid @surface0; */ + border-radius: 5px; + /* box-shadow: 0px 0px 2px black; */ + } + + /* .right.overlay-indicator { */ + /* border: solid 5px red; */ + /* } */ + + .control-center-list { + /* background: @base; */ + background: @crust; + min-height: 5px; + /* border: 1px solid @surface1; */ + border-top: none; + border-radius: 0px 0px 4px 4px; + } + + .control-center-list-placeholder, + .notification-group-icon, + .notification-group { + /* opacity: 1.0; */ + /* opacity: 0; */ + color: alpha(@theme_text_color, 0.50); + } + + .notification-group { + /* unset the annoying focus thingie */ + all: unset; + border: none; + opacity: 0; + padding: 0px; + box-shadow: none; + /* selectable: no; */ + } + .notification-group > box { + all: unset; + background: @mantle; + /* background: alpha(currentColor, 0.072); */ + padding: 8px; + margin: 0px; + /* margin: 0px -5px; */ + border: none; + border-radius: 4px; + box-shadow: none; + } + + + .notification-row { + outline: none; + transition: all 1s ease; + background: @base; + /* background: @theme_bg_color; */ + border: 1px solid @crust; + margin: 10px 5px 0px 5px; + border-radius: 4px; + /* box-shadow: 0px 0px 4px black; */ + /* background: alpha(currentColor, 0.05); */ + } + + .notification-row:focus, + .notification-row:hover { + box-shadow: none; + } + + .control-center-list > row, + .control-center-list > row:focus, + .control-center-list > row:hover { + background: transparent; + border: none; + margin: 0px; + padding: 5px 10px 5px 10px; + box-shadow: none; + } + + .control-center-list > row:last-child { + padding: 5px 10px 10px 10px; + } + + + /* Window behind control center and on all other monitors */ + .blank-window { + background: transparent; + } + + /*** Widgets ***/ + + /* Title widget */ + .widget-title { + margin: 0px; + background: inherit; + /* background: @theme_bg_color; */ + border-radius: 4px 4px 0px 0px; + /* border: 1px solid @surface1; */ + border-bottom: none; + padding-bottom: 20px; + } + + .widget-title > label { + margin: 18px 10px; + font-size: 20px; + font-weight: 500; + } + + .widget-title > button { + font-weight: 700; + padding: 7px 3px; + margin-right: 10px; + background: @mantle; + color: @text; + /* color: @theme_text_color; */ + /* border: none; */ + border-radius: 4px; + } + .widget-title > button:hover { + background: @base; + /* background: alpha(currentColor, 0.1); */ + } + + /* Label widget */ + .widget-label { + margin: 0px; + padding: 0px; + min-height: 5px; + background: @mantle; + /* background: @theme_bg_color; */ + border-radius: 0px 0px 4px 4px; + /* border: 1px solid @surface1; */ + border-top: none; + } + .widget-label > label { + font-size: 0px; + font-weight: 400; + } + + /* Menubar */ + .widget-menubar { + background: inherit; + /* background: @theme_bg_color; */ + /* border: 1px solid @surface1; */ + border-top: none; + border-bottom: none; + } + .widget-menubar > box > box { + margin: 5px 10px 5px 10px; + min-height: 40px; + border-radius: 4px; + background: transparent; + } + .widget-menubar > box > box > button { + background: @mantle; + /* background: alpha(currentColor, 0.05); */ + min-width: 85px; + min-height: 50px; + margin-right: 13px; + font-size: 17px; + padding: 0px; + } + .widget-menubar > box > box > button:nth-child(4) { + margin-right: 0px; + } + .widget-menubar button:focus { + box-shadow: none; + } + .widget-menubar button:focus:hover { + background: @base; + /* background: alpha(currentColor,0.1); */ + box-shadow: none; + } + + .widget-menubar > box > revealer > box { + margin: 5px 10px 5px 10px; + background: @mantle; + /* background: alpha(currentColor, 0.05); */ + border-radius: 4px; + } + .widget-menubar > box > revealer > box > button { + background: transparent; + min-height: 50px; + padding: 0px; + margin: 5px; + } + + /* Buttons grid */ + .widget-buttons-grid { + /* background-color: @theme_bg_color; */ + background-color: @mantle; + /* border: 1px solid @surface1; */ + border-top: none; + border-bottom: none; + font-size: 14px; + font-weight: 500; + margin: 0px; + padding: 5px; + border-radius: 0px; + } + + .widget-buttons-grid > flowbox > flowboxchild { + background: @mantle; + /* background: alpha(currentColor, 0.05); */ + border-radius: 4px; + min-height: 50px; + min-width: 85px; + margin: 5px; + padding: 0px; + } + + .widget-buttons-grid > flowbox > flowboxchild > button { + background: transparent; + border-radius: 4px; + margin: 0px; + border: none; + box-shadow: none; + } + + + .widget-buttons-grid > flowbox > flowboxchild > button:hover { + background: @mantle; + /* background: alpha(currentColor, 0.1); */ + } + + /* Mpris widget */ + .widget-mpris { + padding: 10px; + padding-bottom: 35px; + padding-top: 35px; + margin-bottom: -33px; + } + .widget-mpris > box { + padding: 0px; + margin: -5px 0px -10px 0px; + padding: 0px; + border-radius: 4px; + /* background: alpha(currentColor, 0.05); */ + background: @mantle; + } + .widget-mpris > box > button:nth-child(1), + .widget-mpris > box > button:nth-child(3) { + margin-bottom: 0px; + } + .widget-mpris > box > button:nth-child(1) { + margin-left: -25px; + margin-right: -25px; + opacity: 0; + } + .widget-mpris > box > button:nth-child(3) { + margin-left: -25px; + margin-right: -25px; + opacity: 0; + } + + .widget-mpris-album-art { + all: unset; + } + + /* Player button box */ + .widget-mpris > box > carousel > widget > box > box:nth-child(2) { + margin: 5px 0px -5px 90px; + } + + /* Player buttons */ + .widget-mpris > box > carousel > widget > box > box:nth-child(2) > button { + border-radius: 4px; + } + .widget-mpris > box > carousel > widget > box > box:nth-child(2) > button:hover { + background: alpha(currentColor, 0.1); + } + carouselindicatordots { + opacity: 0; + } + + .widget-mpris-title { + color: #eeeeee; + font-weight: bold; + font-size: 1.25rem; + text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5); + } + .widget-mpris-subtitle { + color: #eeeeee; + font-size: 1rem; + text-shadow: 0px 0px 3px rgba(0, 0, 0, 1); + } + + .widget-mpris-player { + border-radius: 0px; + margin: 0px; + } + .widget-mpris-player > box > image { + margin: 0px 0px -48px 0px; + } + + .notification-group > box.vertical { + /* border: solid 5px red; */ + margin-top: 3px + } + + /* Backlight and volume widgets */ + .widget-backlight, + .widget-volume { + background-color: @crust; + /* background-color: @theme_bg_color; */ + /* border: 1px solid @surface1; */ + border-top: none; + border-bottom: none; font-size: 13px; + font-weight: 600; + border-radius: 0px; + margin: 0px; + padding: 0px; + } + .widget-volume > box { + background: @mantle; + /* background: alpha(currentColor, 0.05); */ + border-radius: 4px; + margin: 5px 10px 5px 10px; + min-height: 50px; + } + .widget-volume > box > label { + min-width: 50px; + padding: 0px; + } + .widget-volume > box > button { + min-width: 50px; + box-shadow: none; + padding: 0px; + } + .widget-volume > box > button:hover { + /* background: alpha(currentColor, 0.05); */ + background: @surface0; + } + .widget-volume > revealer > list { + background: @mantle; + /* background: alpha(currentColor, 0.05); */ + border-radius: 4px; + margin-top: 5px; + padding: 0px; + } + .widget-volume > revealer > list > row { + padding-left: 10px; + min-height: 40px; + background: transparent; + } + .widget-volume > revealer > list > row:hover { + background: transparent; + box-shadow: none; + border-radius: 4px; + } + .widget-backlight > scale { + background: @mantle; + /* background: alpha(currentColor, 0.05); */ + border-radius: 0px 4px 4px 0px; + margin: 5px 10px 5px 0px; + padding: 0px 10px 0px 0px; + min-height: 50px; + } + .widget-backlight > label { + background: @surface0; + /* background: alpha(currentColor, 0.05); */ + margin: 5px 0px 5px 10px; + border-radius: 4px 0px 0px 4px; + padding: 0px; + min-height: 50px; + min-width: 50px; + } + + /* DND widget */ + .widget-dnd { + margin: 8px; + font-size: 1.1rem; + padding-top: 20px; + } + + .widget-dnd>switch { + font-size: initial; + border-radius: 12px; + background: @surface0; + border: 1px solid @lavender; + box-shadow: none; + } + + .widget-dnd>switch:checked { + background: @surface2; + } + + .widget-dnd>switch slider { + background: @lavender; + border-radius: 12px; + } + + /* Toggles */ + .toggle:checked { + background: @surface1; + /* background: @theme_selected_bg_color; */ + } + /*.toggle:not(:checked) { + color: rgba(128, 128, 128, 0.5); + }*/ + .toggle:checked:hover { + background: @surface2; + /* background: alpha(@theme_selected_bg_color, 0.75); */ + } + + /* Sliders */ + scale { + padding: 0px; + margin: 0px 10px 0px 10px; + } + + scale trough { + border-radius: 4px; + background: @surface0; + /* background: alpha(currentColor, 0.1); */ + } + + scale highlight { + border-radius: 5px; + min-height: 10px; + margin-right: -5px; + } + + scale slider { + margin: -10px; + min-width: 10px; + min-height: 10px; + background: transparent; + box-shadow: none; + padding: 0px; + } + scale slider:hover { + } + + .right.overlay-indicator { + all: unset; + } + ''; + xdg.configFile."swaync/config.json".text = '' + { + "positionX": "right", + "positionY": "top", + "layer": "overlay", + "layer-shell": "true", + "cssPriority": "application", + "control-center-margin-top": 10, + "control-center-margin-bottom": 10, + "control-center-margin-right": 10, + "control-center-margin-left": 10, + "notification-icon-size": 64, + "notification-body-image-height": 128, + "notification-body-image-width": 200, + "timeout": 10, + "timeout-low": 5, + "timeout-critical": 0, + "fit-to-screen": true, + "control-center-width": 400, + "control-center-height": 650, + "notification-window-width": 350, + "keyboard-shortcuts": true, + "image-visibility": "when-available", + "transition-time": 200, + "hide-on-clear": false, + "hide-on-action": true, + "script-fail-notify": true, + "widgets": [ + "title", + "menubar#desktop", + "volume", + "backlight#mobile", + "mpris", + "dnd", + "notifications" + ], + "widget-config": { + "title": { + "text": "Notifications", + "clear-all-button": true, + "button-text": " Clear All " + }, + "menubar#desktop": { + "menu#powermode-buttons": { + "label": " 󰌪 ", + "position": "left", + "actions": [ + { + "label": "Performance", + "command": "powerprofilesctl set performance" + }, + { + "label": "Balanced", + "command": "powerprofilesctl set balanced" + }, + { + "label": "Power-saver", + "command": "powerprofilesctl set power-saver" + } + ] + }, + "menu#screenshot": { + "label": "  ", + "position": "left", + "actions": [ + { + "label": "󰹑 Whole screen", + "command": "grimblast --notify --cursor --freeze copy output" + }, + { + "label": "󰩭 Window / Region", + "command": "grimblast --notify --cursor --freeze copy area" + } + ] + }, + "menu#record": { + "label": " 󰕧 ", + "position": "left", + "actions": [ + { + "label": " Record screen", + "command": "record screen & ; swaync-client -t" + }, + { + "label": " Record selection", + "command": "record area & ; swaync-client -t" + }, + { + "label": " Record GIF", + "command": "record gif & ; swaync-client -t" + }, + { + "label": "󰻃 Stop", + "command": "record stop" + } + ] + }, + "menu#power-buttons": { + "label": "  ", + "position": "left", + "actions": [ + { + "label": " Lock", + "command": "swaylock" + }, + { + "label": " Reboot", + "command": "systemctl reboot" + }, + { + "label": " Shut down", + "command": "systemctl poweroff" + } + ] + } + }, + "backlight#mobile": { + "label": " 󰃠 ", + "device": "panel" + }, + "volume": { + "label": "", + "expand-button-label": "", + "collapse-button-label": "", + "show-per-app": true, + "show-per-app-icon": true, + "show-per-app-label": false + }, + "dnd": { + "text": " Do Not Disturb" + }, + "mpris": { + "image-size": 85, + "image-radius": 5 + } + } + } + ''; + }; } diff --git a/modules/home/environment/userpkgs.nix b/modules/home/environment/userpkgs.nix index ea2df14..fc9943b 100644 --- a/modules/home/environment/userpkgs.nix +++ b/modules/home/environment/userpkgs.nix @@ -1,8 +1,4 @@ -{ - pkgs, - host, - ... -}: let +{lib, config, pkgs, host, ... }: let desktop = host == "oganesson"; extraFigletFonts = pkgs.fetchFromGitHub { owner = "xero"; @@ -32,35 +28,40 @@ ] else []; in { - home.packages = with pkgs; - [ - chafa - nemo - flavours - ags - sassc - gtk3 - sqlite - gimp - imagemagick - yt-dlp - vlc - lolcat - speedtest-cli - vesktop - qbittorrent - neovide - zsh - zsh-syntax-highlighting - zsh-history-substring-search - zsh-autosuggestions - audacity - rustup - libreoffice - gtrash - ripgrep - toilet-extrafonts - python3 - ] - ++ desktop_pkgs; + options = { + userPkgs.enable = lib.mkEnableOption "enables my default user packages"; + }; + config = lib.mkIf config.userPkgs.enable { + home.packages = with pkgs; + [ + chafa + nemo + flavours + ags + sassc + gtk3 + sqlite + gimp + imagemagick + yt-dlp + vlc + lolcat + speedtest-cli + vesktop + qbittorrent + neovide + zsh + zsh-syntax-highlighting + zsh-history-substring-search + zsh-autosuggestions + audacity + rustup + libreoffice + gtrash + ripgrep + toilet-extrafonts + python3 + ] + ++ desktop_pkgs; + }; } diff --git a/modules/home/environment/waybar.nix b/modules/home/environment/waybar.nix new file mode 100644 index 0000000..4f6e911 --- /dev/null +++ b/modules/home/environment/waybar.nix @@ -0,0 +1,518 @@ +{pkgs, scheme, host, lib, config, ...}: + +let + desktop = host == "oganesson"; + workspaces = { + format = "{icon}"; + format-icons = { + "1" = "一"; + "2" = "二"; + "3" = "三"; + "4" = "四"; + "5" = "五"; + "6" = "六"; + }; + persistent-workspaces = + if desktop + then { + "HDMI-A-1" = [1 2 3]; + "DP-1" = [4 5 6]; + } + else { + "eDP-1" = [1 2 3 4]; + }; + }; + bg = { + darkester = scheme.base00; + darkest = scheme.base01; + darker = scheme.base02; + dark = scheme.base03; + }; + fg = { + lightester = scheme.base07; + lightest = scheme.base06; + lighter = scheme.base05; + light = scheme.base04; + }; + colors = { + color0 = scheme.base08; + color1 = scheme.base09; + color2 = scheme.base0A; + color3 = scheme.base0B; + color4 = scheme.base0C; + color5 = scheme.base0D; + color6 = scheme.base0E; + color7 = scheme.base0F; + }; + monitors = + if desktop + then [ + "DP-1" + "HDMI-A-1" + ] + else [ + "eDP-1" + ]; +in { + options = { + waybarConfig.enable = lib.mkEnableOption "enables my waybar configuration"; + }; + config = { + programs.waybar = { + enable = true; + package = pkgs.waybar.overrideAttrs (oa: { + mesonFlags = (oa.mesonFlags or []) ++ ["-Dexperimental=true"]; + }); + settings = { + mainBar = { + layer = "bottom"; + output = builtins.elemAt monitors 0; + position = "top"; + name = "mainBar"; + margin-left = 8; + margin-top = 5; + margin-right = + if desktop + then 8 + else 5; + mode = "dock"; + "gtk-layer-shell" = true; + + modules-left = [ + "hyprland/workspaces" + "cava" + ]; + modules-center = [ + "hyprland/window" + ]; + modules-right = [ + "group/hardware" + "clock" + "group/powerbtns" + ]; + + "hyprland/workspaces" = workspaces; + + cava = { + framerate = 30; + autosens = 1; + sensitivity = 1; + bars = 14; + lower_cutoff_freq = 50; + higher_cutoff_freq = 10000; + method = "pulse"; + source = "auto"; + hide_on_silence = true; + stereo = true; + reverse = true; + bar_delimiter = 0; + monstercat = false; + waves = false; + noise_reduction = 0.77; + input_delay = 2; + format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; + }; + + "group/hardware" = { + orientation = "inherit"; + modules = [ + "custom/disk-icon" + "memory" + "cpu" + ]; + }; + + "custom/disk-icon" = { + exec = '' + df /dev/disk/by-partlabel/disk-main-home /dev/disk/by-partlabel/disk-main-nix | awk ' + function format(size) { + if (size >= 1024) return sprintf("%.1fTB", size / 1024) + else return sprintf("%.1fGB", size) + } + $6 == "/home" { + home_usage = $3 / 1024 / 1024 + home_total = $2 / 1024 / 1024 + home_percent = $5 + sub(/%/,"",home_percent) + } + $6 == "/nix" { + nix_usage = $3 / 1024 / 1024 + nix_total = $2 / 1024 / 1024 + nix_percent = $5 + } + END { + printf "{\"class\": \"disk-icon\", \"tooltip\": \"/home: %s / %s\\n/nix: %s / %s\", \"percentage\": \"%s\"}\n", + format(home_usage), format(home_total), format(nix_usage), format(nix_total), home_percent + }' | jq --unbuffered --compact-output + ''; + interval = 60; + return-type = "json"; + rotate = 270; + format = "{icon}"; + format-icons = [ + "󰝦" + "󰪞" + "󰪟" + "󰪠" + "󰪡" + "󰪢" + "󰪣" + "󰪤" + "󰪥" + ]; + }; + + memory = { + interval = 1; + rotate = 270; + format = "{icon}"; + format-icons = [ + "󰝦" + "󰪞" + "󰪟" + "󰪠" + "󰪡" + "󰪢" + "󰪣" + "󰪤" + "󰪥" + ]; + max-length = 10; + tooltip-format = "RAM: {used:0.1f} GB / {total:0.1f} GB"; + }; + + cpu = { + interval = 1; + rotate = 270; + format = "{icon}"; + format-icons = [ + "󰝦" + "󰪞" + "󰪟" + "󰪠" + "󰪡" + "󰪢" + "󰪣" + "󰪤" + "󰪥" + ]; + tooltip-format = "CPU: {usage:0.1f}%"; + }; + + "custom/power" = { + on-click = "shutdown now"; + tooltip = false; + format = " "; + }; + + "custom/logout" = { + on-click = "hyprctl dispatch exit"; + tooltip = false; + format = "󰗽 "; + }; + + "custom/reboot" = { + on-click = "reboot"; + tooltip = false; + format = " "; + }; + + "group/powerbtns" = { + orientation = "horizontal"; + drawer = { + transition-duration = 500; + children-class = "power-drawer"; + transition-left-to-right = false; + }; + modules = [ + "custom/power" + "custom/logout" + "custom/reboot" + ]; + }; + + clock = { + format = "{:%I:%M %p}"; + tooltip = false; + }; + }; + sideBar = { + layer = "bottom"; + output = + if desktop + then builtins.elemAt monitors 1 + else builtins.elemAt monitors 0; + position = "right"; + margin-top = 8; + margin-right = 5; + margin-bottom = 8; + name = "sideBar"; + mode = "dock"; + "gtk-layer-shell" = true; + + modules-left = + if desktop + then [ + "hyprland/workspaces" + ] + else [ + "group/brightness" + "battery" + ]; + modules-center = [ + ]; + modules-right = [ + "network" + "group/audio" + ]; + + "hyprland/workspaces" = workspaces; + + "pulseaudio/slider" = { + orientation = "vertical"; + }; + + "group/audio" = { + orientation = "vertical"; + modules = [ + "pulseaudio/slider" + "pulseaudio" + ]; + }; + + pulseaudio = { + format = "{icon}"; + format-muted = " "; + format-icons = { + default = [ + " " + " " + ]; + }; + on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle"; + on-click-right = "hyprctl dispatch exec '[float;size 40% 55%] pavucontrol'"; + }; + + network = { + interval = 30; + format-wifi = "󰖩 "; + tooltip-format-wifi = "{essid} ({signalStrength}%)"; + format-ethernet = " "; + tooltip-format-ethernet = "{ifname}"; + format-disconnected = "󰖪 "; + tooltip-format-disconnected = "Disconnected"; + on-click = "hyprctl dispatch exec '[float;size 40% 55%] kitty nmtui'"; + }; + + battery = { + bat = "BAT1"; + interval = 1; + tooltip-format = "{capacity}%\nTil empty: {time}"; + tooltip-format-charging = "{capacity}%\nTil full: {time}"; + format = "{icon}"; + format-icons = [ + "󰁺" + "󰁻" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + format-charging = "󰂄"; + }; + + "group/brightness" = { + orientation = "vertical"; + modules = [ + "backlight" + "backlight/slider" + ]; + }; + backlight = { + format = "󰃠"; + tooltip = "{percentage}%"; + }; + "backlight/slider" = { + min = 10; + max = 100; + orientation = "vertical"; + rotate = 180; + }; + }; + }; + style = '' + * { + border: none; + border-radius: 0; + font-size: 16px; + font-family: "JetBrains Mono Nerd Font"; + } + + window#waybar { + border-radius: 20px; + border: 3px solid #${colors.color7}; + background: rgba(46,52,64,0.15); + margin: 20px; + } + window#waybar.empty #window { + background: none; + } + + #workspaces { + margin: 3px; + background: #${bg.dark}; + border-radius: 20px; + } + + #workspaces button:hover { + border-radius: 20px; + } + + #workspaces button.active { + background: #${fg.lightester}; + border-radius: 20px; + color: #${bg.darkest}; + } + + #cava { + background: #${bg.dark}; + border-radius: 20px; + margin: 3px 3px 3px 6px; + padding: 0px 15px 0px 15px; + color: #${colors.color6}; + } + + #window { + margin: 3px; + background: #${bg.dark}; + border-radius: 20px; + padding: 0 15px 0 15px; + font-weight: bold; + } + + #hardware { + margin: 3px; + padding: 0 10px 0 10px; + background: #${bg.dark}; + border-radius: 20px; + } + + #custom-disk-icon, #cpu, #memory { + margin-bottom: 4px; + font-size: 20px; + font-weight: bold; + } + + #custom-disk-icon { + color: #${colors.color4}; + } + + #memory { + color: #${colors.color1}; + } + + #cpu { + color: #${colors.color3}; + } + + #clock { + font-weight: bold; + background: #${bg.dark}; + border-radius: 20px; + margin: 3px; + padding: 0 10px 0 10px; + font-size: 18px; + } + + #powerbtns { + background: #${bg.dark}; + border-radius: 20px; + margin: 3px; + padding: 0 5px 0 10px; + } + + #custom-power { + color: #${colors.color0}; + font-size: 18px; + } + + #custom-logout { + color: #${colors.color4}; + font-size: 18px; + } + + #custom-reboot { + color: #${colors.color2}; + font-size: 18px; + } + + #audio { + background: #${bg.dark}; + border-radius: 20px; + margin: 3px; + padding: 5px 0 10px 0; + } + + #pulseaudio { + color: #${colors.color4}; + font-size: 18px; + } + + #backlight-slider slider, + #pulseaudio-slider slider { + background: #${colors.color4}; + background-color: transparent; + box-shadow: none; + } + + #backlight-slider trough, + #pulseaudio-slider trough { + min-width: 9px; + min-height: 90px; + border-radius: 8px; + background: #343434; + } + + #backlight-slider highlight, + #pulseaudio-slider highlight { + border-radius: 8px; + background-color: #2096C0; + } + + #network { + color: #${colors.color3}; + font-size: 20px; + background: #${bg.dark}; + border-radius: 20px; + margin: 3px; + padding: 5px 0 5px 6px; + } + + #brightness { + background: #${bg.dark}; + border-radius: 20px; + margin: 3px; + padding: 10px 0px 5px 0; + } + + #backlight { + color: #${colors.color2}; + font-size: 18px; + padding: 0 4px 0 0; + } + + #battery { + color: #${colors.color4}; + font-size: 20px; + background: #${bg.dark}; + border-radius: 20px; + margin: 3px; + padding: 5px 0 5px 0px; + } + ''; + }; + }; +} diff --git a/modules/home/environment/waybar/default.nix b/modules/home/environment/waybar/default.nix deleted file mode 100644 index 9335a1e..0000000 --- a/modules/home/environment/waybar/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - imports = - [(import ./waybar.nix)] - ++ [(import ./settings.nix)] - ++ [(import ./style.nix)]; -} diff --git a/modules/home/environment/waybar/settings.nix b/modules/home/environment/waybar/settings.nix deleted file mode 100644 index 1b7b719..0000000 --- a/modules/home/environment/waybar/settings.nix +++ /dev/null @@ -1,323 +0,0 @@ -{host, ...}: -# Grocery list: -# Clock -# CPU/MEM meters -# Home folder and Nix store storage tracking? -# Workspaces (per monitor would be nice) -# A separate bar for both monitors -# secondary monitor will have a vertical bar on the left side -# Can contain more info with two bars -let - desktop = host == "oganesson"; - workspaces = { - format = "{icon}"; - format-icons = { - "1" = "一"; - "2" = "二"; - "3" = "三"; - "4" = "四"; - "5" = "五"; - "6" = "六"; - }; - persistent-workspaces = - if desktop - then { - "HDMI-A-1" = [1 2 3]; - "DP-1" = [4 5 6]; - } - else { - "eDP-1" = [1 2 3 4]; - }; - }; - monitors = - if desktop - then [ - "DP-1" - "HDMI-A-1" - ] - else [ - "eDP-1" - ]; -in { - programs.waybar.settings.mainBar = { - layer = "bottom"; - output = builtins.elemAt monitors 0; - position = "top"; - name = "mainBar"; - margin-left = 8; - margin-top = 5; - margin-right = - if desktop - then 8 - else 5; - mode = "dock"; - "gtk-layer-shell" = true; - - modules-left = [ - "hyprland/workspaces" - "cava" - ]; - modules-center = [ - "hyprland/window" - ]; - modules-right = [ - "group/hardware" - "clock" - "group/powerbtns" - ]; - - "hyprland/workspaces" = workspaces; - - cava = { - framerate = 30; - autosens = 1; - sensitivity = 1; - bars = 14; - lower_cutoff_freq = 50; - higher_cutoff_freq = 10000; - method = "pulse"; - source = "auto"; - hide_on_silence = true; - stereo = true; - reverse = true; - bar_delimiter = 0; - monstercat = false; - waves = false; - noise_reduction = 0.77; - input_delay = 2; - format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; - }; - - "group/hardware" = { - orientation = "inherit"; - modules = [ - "custom/disk-icon" - "memory" - "cpu" - ]; - }; - - "custom/disk-icon" = { - exec = '' - df /dev/disk/by-partlabel/disk-main-home /dev/disk/by-partlabel/disk-main-nix | awk ' - function format(size) { - if (size >= 1024) return sprintf("%.1fTB", size / 1024) - else return sprintf("%.1fGB", size) - } - $6 == "/home" { - home_usage = $3 / 1024 / 1024 - home_total = $2 / 1024 / 1024 - home_percent = $5 - sub(/%/,"",home_percent) - } - $6 == "/nix" { - nix_usage = $3 / 1024 / 1024 - nix_total = $2 / 1024 / 1024 - nix_percent = $5 - } - END { - printf "{\"class\": \"disk-icon\", \"tooltip\": \"/home: %s / %s\\n/nix: %s / %s\", \"percentage\": \"%s\"}\n", - format(home_usage), format(home_total), format(nix_usage), format(nix_total), home_percent - }' | jq --unbuffered --compact-output - ''; - interval = 60; - return-type = "json"; - rotate = 270; - format = "{icon}"; - format-icons = [ - "󰝦" - "󰪞" - "󰪟" - "󰪠" - "󰪡" - "󰪢" - "󰪣" - "󰪤" - "󰪥" - ]; - }; - - memory = { - interval = 1; - rotate = 270; - format = "{icon}"; - format-icons = [ - "󰝦" - "󰪞" - "󰪟" - "󰪠" - "󰪡" - "󰪢" - "󰪣" - "󰪤" - "󰪥" - ]; - max-length = 10; - tooltip-format = "RAM: {used:0.1f} GB / {total:0.1f} GB"; - }; - - cpu = { - interval = 1; - rotate = 270; - format = "{icon}"; - format-icons = [ - "󰝦" - "󰪞" - "󰪟" - "󰪠" - "󰪡" - "󰪢" - "󰪣" - "󰪤" - "󰪥" - ]; - tooltip-format = "CPU: {usage:0.1f}%"; - }; - - "custom/power" = { - on-click = "shutdown now"; - tooltip = false; - format = " "; - }; - - "custom/logout" = { - on-click = "hyprctl dispatch exit"; - tooltip = false; - format = "󰗽 "; - }; - - "custom/reboot" = { - on-click = "reboot"; - tooltip = false; - format = " "; - }; - - "group/powerbtns" = { - orientation = "horizontal"; - drawer = { - transition-duration = 500; - children-class = "power-drawer"; - transition-left-to-right = false; - }; - modules = [ - "custom/power" - "custom/logout" - "custom/reboot" - ]; - }; - - clock = { - format = "{:%I:%M %p}"; - tooltip = false; - }; - }; - - # ------------------------------------------ - - programs.waybar.settings.sideBar = { - layer = "bottom"; - output = - if desktop - then builtins.elemAt monitors 1 - else builtins.elemAt monitors 0; - position = "right"; - margin-top = 8; - margin-right = 5; - margin-bottom = 8; - name = "sideBar"; - mode = "dock"; - "gtk-layer-shell" = true; - - modules-left = - if desktop - then [ - "hyprland/workspaces" - ] - else [ - "group/brightness" - "battery" - ]; - modules-center = [ - ]; - modules-right = [ - "network" - "group/audio" - ]; - - "hyprland/workspaces" = workspaces; - - "pulseaudio/slider" = { - orientation = "vertical"; - }; - - "group/audio" = { - orientation = "vertical"; - modules = [ - "pulseaudio/slider" - "pulseaudio" - ]; - }; - - pulseaudio = { - format = "{icon}"; - format-muted = " "; - format-icons = { - default = [ - " " - " " - ]; - }; - on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle"; - on-click-right = "hyprctl dispatch exec '[float;size 40% 55%] pavucontrol'"; - }; - - network = { - interval = 30; - format-wifi = "󰖩 "; - tooltip-format-wifi = "{essid} ({signalStrength}%)"; - format-ethernet = " "; - tooltip-format-ethernet = "{ifname}"; - format-disconnected = "󰖪 "; - tooltip-format-disconnected = "Disconnected"; - on-click = "hyprctl dispatch exec '[float;size 40% 55%] kitty nmtui'"; - }; - - battery = { - bat = "BAT1"; - interval = 1; - tooltip-format = "{capacity}%\nTil empty: {time}"; - tooltip-format-charging = "{capacity}%\nTil full: {time}"; - format = "{icon}"; - format-icons = [ - "󰁺" - "󰁻" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; - format-charging = "󰂄"; - }; - - "group/brightness" = { - orientation = "vertical"; - modules = [ - "backlight" - "backlight/slider" - ]; - }; - backlight = { - format = "󰃠"; - tooltip = "{percentage}%"; - }; - "backlight/slider" = { - min = 10; - max = 100; - orientation = "vertical"; - rotate = 180; - }; - }; -} diff --git a/modules/home/environment/waybar/style.nix b/modules/home/environment/waybar/style.nix deleted file mode 100644 index b47afd5..0000000 --- a/modules/home/environment/waybar/style.nix +++ /dev/null @@ -1,195 +0,0 @@ -{scheme, ...}: let - bg = { - darkester = scheme.base00; - darkest = scheme.base01; - darker = scheme.base02; - dark = scheme.base03; - }; - fg = { - lightester = scheme.base07; - lightest = scheme.base06; - lighter = scheme.base05; - light = scheme.base04; - }; - colors = { - color0 = scheme.base08; - color1 = scheme.base09; - color2 = scheme.base0A; - color3 = scheme.base0B; - color4 = scheme.base0C; - color5 = scheme.base0D; - color6 = scheme.base0E; - color7 = scheme.base0F; - }; -in { - programs.waybar.style = '' - * { - border: none; - border-radius: 0; - font-size: 16px; - font-family: "JetBrains Mono Nerd Font"; - } - - window#waybar { - border-radius: 20px; - border: 3px solid #${colors.color7}; - background: rgba(46,52,64,0.15); - margin: 20px; - } - window#waybar.empty #window { - background: none; - } - - #workspaces { - margin: 3px; - background: #${bg.dark}; - border-radius: 20px; - } - - #workspaces button:hover { - border-radius: 20px; - } - - #workspaces button.active { - background: #${fg.lightester}; - border-radius: 20px; - color: #${bg.darkest}; - } - - #cava { - background: #${bg.dark}; - border-radius: 20px; - margin: 3px 3px 3px 6px; - padding: 0px 15px 0px 15px; - color: #${colors.color6}; - } - - #window { - margin: 3px; - background: #${bg.dark}; - border-radius: 20px; - padding: 0 15px 0 15px; - font-weight: bold; - } - - #hardware { - margin: 3px; - padding: 0 10px 0 10px; - background: #${bg.dark}; - border-radius: 20px; - } - - #custom-disk-icon, #cpu, #memory { - margin-bottom: 4px; - font-size: 20px; - font-weight: bold; - } - - #custom-disk-icon { - color: #${colors.color4}; - } - - #memory { - color: #${colors.color1}; - } - - #cpu { - color: #${colors.color3}; - } - - #clock { - font-weight: bold; - background: #${bg.dark}; - border-radius: 20px; - margin: 3px; - padding: 0 10px 0 10px; - font-size: 18px; - } - - #powerbtns { - background: #${bg.dark}; - border-radius: 20px; - margin: 3px; - padding: 0 5px 0 10px; - } - - #custom-power { - color: #${colors.color0}; - font-size: 18px; - } - - #custom-logout { - color: #${colors.color4}; - font-size: 18px; - } - - #custom-reboot { - color: #${colors.color2}; - font-size: 18px; - } - - #audio { - background: #${bg.dark}; - border-radius: 20px; - margin: 3px; - padding: 5px 0 10px 0; - } - - #pulseaudio { - color: #${colors.color4}; - font-size: 18px; - } - - #backlight-slider slider, - #pulseaudio-slider slider { - background: #${colors.color4}; - background-color: transparent; - box-shadow: none; - } - - #backlight-slider trough, - #pulseaudio-slider trough { - min-width: 9px; - min-height: 90px; - border-radius: 8px; - background: #343434; - } - - #backlight-slider highlight, - #pulseaudio-slider highlight { - border-radius: 8px; - background-color: #2096C0; - } - - #network { - color: #${colors.color3}; - font-size: 20px; - background: #${bg.dark}; - border-radius: 20px; - margin: 3px; - padding: 5px 0 5px 6px; - } - - #brightness { - background: #${bg.dark}; - border-radius: 20px; - margin: 3px; - padding: 10px 0px 5px 0; - } - - #backlight { - color: #${colors.color2}; - font-size: 18px; - padding: 0 4px 0 0; - } - - #battery { - color: #${colors.color4}; - font-size: 20px; - background: #${bg.dark}; - border-radius: 20px; - margin: 3px; - padding: 5px 0 5px 0px; - } - ''; -} diff --git a/modules/home/environment/waybar/waybar.nix b/modules/home/environment/waybar/waybar.nix deleted file mode 100644 index 7f0aea2..0000000 --- a/modules/home/environment/waybar/waybar.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, ...}: { - programs.waybar = { - enable = true; - }; - programs.waybar.package = pkgs.waybar.overrideAttrs (oa: { - mesonFlags = (oa.mesonFlags or []) ++ ["-Dexperimental=true"]; - }); -} diff --git a/modules/home/environment/zshell.nix b/modules/home/environment/zshell.nix index 5b75403..4ed1723 100644 --- a/modules/home/environment/zshell.nix +++ b/modules/home/environment/zshell.nix @@ -1,187 +1,201 @@ -{self, ...}: { - programs.zoxide = { - enable = true; - enableZshIntegration = true; +{lib, config, self, ...}: { + options = { + zshConfig.enable = lib.mkEnableOption "enables my zsh configuration"; }; - programs.zsh = { - enable = true; - - sessionVariables = { - SOUNDS_ENABLED = "1"; - EDITOR = "nvim"; - SUDO_EDITOR = "nvim"; - VISUAL = "nvim"; - LANG = "en_US.UTF-8"; - BROWSER = "firefox"; - FLAKEPATH = "$HOME/.sysflake"; - }; - - oh-my-zsh = { + config = lib.mkIf config.zshConfig.enable { + programs.zoxide = { enable = true; - plugins = ["git" "fzf"]; + enableZshIntegration = true; }; - - enableCompletion = true; - history = { - path = "$HOME/.zsh_history"; - save = 10000; - size = 10000; - share = true; - }; - - autosuggestion = { + programs.zsh = { enable = true; - highlight = "fg=#4C566A,underline"; - }; - shellAliases = { - grep = "grep --color=auto"; - yazi = "y"; - vi = "nvim"; - mv = "mv -v"; - cp = "cp -vr"; - gt = "gtrash"; - gtp = "playshellsound ${self}/assets/sound/rm.wav; gtrash put"; - sr = "source ~/.zshrc"; - ".." = "cd .."; - rm = "echo 'use \"gtp\" instead'"; - psg = "ps aux | grep -v grep | grep -i -e VSZ -e"; - mkdir = "mkdir -p"; - pk = "pkill -9 -f"; - svcu = "systemctl --user"; - svc = "sudo systemctl"; - viflake = "nvim flake.nix"; + shellAliases = { + grep = "grep --color=auto"; + yazi = "y"; + vi = "nvim"; + mv = "mv -v"; + cp = "cp -vr"; + gt = "gtrash"; + gtp = "playshellsound ${self}/assets/sound/rm.wav; gtrash put"; + sr = "source ~/.zshrc"; + ".." = "cd .."; + rm = "echo 'use \"gtp\" instead'"; + psg = "ps aux | grep -v grep | grep -i -e VSZ -e"; + mkdir = "mkdir -p"; + pk = "pkill -9 -f"; + svcu = "systemctl --user"; + svc = "sudo systemctl"; + viflake = "nvim flake.nix"; - #git - "ga" = "playshellsound ${self}/assets/sound/gitadd.wav; git add"; - gcomm = "gitcommit_sfx"; - gpush = "gitpush_sfx"; - gpull = "gitpull_sfx"; - greb = "gitrebase_sfx"; - }; - initExtra = '' - playshellsound() { - if [ $# -ne 1 ]; then - echo "Usage: playshellsound " - return 1 - fi - if ! scheck; then - return 0 - else - runbg aplay "$1" - fi - } - gitrebase_sfx() { - if git rebase "$@"; then - playshellsound ${self}/assets/sound/gitrebase.wav - return 0 - else - playshellsound ${self}/assets/sound/error.wav - return 1 - fi - } - gitcommit_sfx() { - if git commit "$@"; then - playshellsound ${self}/assets/sound/gitcommit.wav - return 0 - else - playshellsound ${self}/assets/sound/error.wav - return 1 - fi - } - gitpush_sfx() { - if git push "$@"; then - playshellsound ${self}/assets/sound/gitpush.wav - return 0 - else - playshellsound ${self}/assets/sound/error.wav - return 1 - fi - } - gitpull_sfx() { - if git pull "$@"; then - playshellsound ${self}/assets/sound/gitpull.wav - return 0 - else - playshellsound ${self}/assets/sound/error.wav - return 1 - fi - } - unalias ls - ls() { - eza -1 --group-directories-first --icons "$@" - playshellsound ${self}/assets/sound/ls.wav - return 0 - } - - mkcd() { - mkdir -p "$1" && cd "$1" - } - - y() { - local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" - yazi "$@" --cwd-file="$tmp" - if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then - builtin cd -- "$cwd" - fi - rm -f -- "$tmp" - } - - cd() { - local prev_sounds_enabled="$SOUNDS_ENABLED" - SOUNDS_ENABLED=0 - eza -1 --group-directories-first --icons "$@" - SOUNDS_ENABLED=$prev_sounds_enabled - builtin cd "$@" - playshellsound /nix/store/7a9w7np3qrvmzxjbs7xj05qq2yccgfsj-source/assets/sound/cd.wav - return 0 - } - if [ ! -e $HOME/.zsh_history ]; then - touch $HOME/.zsh_history - chmod 600 $HOME/.zsh_history - fi - setopt APPEND_HISTORY # Append history to the history file (don't overwrite) - setopt INC_APPEND_HISTORY # Append to the history file incrementally - setopt SHARE_HISTORY # Share history between all zsh sessions + #git + "ga" = "playshellsound ${self}/assets/sound/gitadd.wav; git add"; + gcomm = "gitcommit_sfx"; + gpush = "gitpush_sfx"; + gpull = "gitpull_sfx"; + greb = "gitrebase_sfx"; + }; sessionVariables = { - setopt CORRECT - setopt NO_NOMATCH - setopt LIST_PACKED - setopt ALWAYS_TO_END - setopt GLOB_COMPLETE - setopt COMPLETE_ALIASES - setopt COMPLETE_IN_WORD - setopt AUTO_CD - setopt AUTO_CONTINUE - setopt LONG_LIST_JOBS - setopt HIST_VERIFY - setopt SHARE_HISTORY - setopt HIST_IGNORE_SPACE - setopt HIST_SAVE_NO_DUPS - setopt HIST_IGNORE_ALL_DUPS - setopt EXTENDED_GLOB - setopt TRANSIENT_RPROMPT - setopt INTERACTIVE_COMMENTS + SOUNDS_ENABLED = "1"; + EDITOR = "nvim"; + SUDO_EDITOR = "nvim"; + VISUAL = "nvim"; + LANG = "en_US.UTF-8"; + BROWSER = "firefox"; + FLAKEPATH = "$HOME/.sysflake"; + }; - autoload -U compinit # completion - autoload -U terminfo # terminfo keys - zmodload -i zsh/complist # menu completion - autoload -U promptinit # prompt + oh-my-zsh = { + enable = true; + plugins = ["git" "fzf"]; + }; - autoload -U up-line-or-beginning-search; zle -N up-line-or-beginning-search - autoload -U down-line-or-beginning-search; zle -N down-line-or-beginning-search + enableCompletion = true; + history = { + path = "$HOME/.zsh_history"; + save = 10000; + size = 10000; + share = true; + }; - bindkey -v - type starship_zle-keymap-select >/dev/null || \ - { - eval "$(starship init zsh)" - } - unalias ls - clear - splash - playshellsound ${self}/assets/sound/sh-source.wav - [ ! -f $FLAKEPATH/flake.nix ] && echo "WARNING: flake.nix not found at \$FLAKEPATH. Shell aliases for editing config files won't work correctly!" && echo "Edit the FLAKEPATH session variable in zshell.nix to point to the path where you saved the system configuration flake." - ''; + autosuggestion = { + enable = true; + highlight = "fg=#4C566A,underline"; + }; + + initExtra = '' + playshellsound() { + if [ $# -ne 1 ]; then + echo "Usage: playshellsound " + return 1 + fi + if ! scheck; then + return 0 + else + runbg aplay "$1" + fi + } + gitcheckout_sfx() { + if git checkout "$@"; then + playshellsound ${self}/assets/sound/gitcheckout.wav + return 0 + else + playshellsound ${self}/assets/sound/error.wav + return 1 + fi + } + gitrebase_sfx() { + if git rebase "$@"; then + playshellsound ${self}/assets/sound/gitrebase.wav + return 0 + else + playshellsound ${self}/assets/sound/error.wav + return 1 + fi + } + gitcommit_sfx() { + if git commit "$@"; then + playshellsound ${self}/assets/sound/gitcommit.wav + return 0 + else + playshellsound ${self}/assets/sound/error.wav + return 1 + fi + } + gitpush_sfx() { + if git push "$@"; then + playshellsound ${self}/assets/sound/gitpush.wav + return 0 + else + playshellsound ${self}/assets/sound/error.wav + return 1 + fi + } + gitpull_sfx() { + if git pull "$@"; then + playshellsound ${self}/assets/sound/gitpull.wav + return 0 + else + playshellsound ${self}/assets/sound/error.wav + return 1 + fi + } + unalias ls + ls() { + eza -1 --group-directories-first --icons "$@" + playshellsound ${self}/assets/sound/ls.wav + return 0 + } + + mkcd() { + mkdir -p "$1" && cd "$1" + } + + y() { + local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" + yazi "$@" --cwd-file="$tmp" + if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then + builtin cd -- "$cwd" + fi + rm -f -- "$tmp" + } + + cd() { + local prev_sounds_enabled="$SOUNDS_ENABLED" + SOUNDS_ENABLED=0 + eza -1 --group-directories-first --icons "$@" + SOUNDS_ENABLED=$prev_sounds_enabled + builtin cd "$@" + playshellsound /nix/store/7a9w7np3qrvmzxjbs7xj05qq2yccgfsj-source/assets/sound/cd.wav + return 0 + } + if [ ! -e $HOME/.zsh_history ]; then + touch $HOME/.zsh_history + chmod 600 $HOME/.zsh_history + fi + setopt APPEND_HISTORY # Append history to the history file (don't overwrite) + setopt INC_APPEND_HISTORY # Append to the history file incrementally + setopt SHARE_HISTORY # Share history between all zsh sessions + + setopt CORRECT + setopt NO_NOMATCH + setopt LIST_PACKED + setopt ALWAYS_TO_END + setopt GLOB_COMPLETE + setopt COMPLETE_ALIASES + setopt COMPLETE_IN_WORD + setopt AUTO_CD + setopt AUTO_CONTINUE + setopt LONG_LIST_JOBS + setopt HIST_VERIFY + setopt SHARE_HISTORY + setopt HIST_IGNORE_SPACE + setopt HIST_SAVE_NO_DUPS + setopt HIST_IGNORE_ALL_DUPS + setopt EXTENDED_GLOB + setopt TRANSIENT_RPROMPT + setopt INTERACTIVE_COMMENTS + + autoload -U compinit # completion + autoload -U terminfo # terminfo keys + zmodload -i zsh/complist # menu completion + autoload -U promptinit # prompt + + autoload -U up-line-or-beginning-search; zle -N up-line-or-beginning-search + autoload -U down-line-or-beginning-search; zle -N down-line-or-beginning-search + + bindkey -v + type starship_zle-keymap-select >/dev/null || \ + { + eval "$(starship init zsh)" + } + unalias ls + clear + splash + playshellsound ${self}/assets/sound/sh-source.wav + [ ! -f $FLAKEPATH/flake.nix ] && echo "WARNING: flake.nix not found at \$FLAKEPATH. Shell aliases for editing config files won't work correctly!" && echo "Edit the FLAKEPATH session variable in zshell.nix to point to the path where you saved the system configuration flake." + ''; + }; }; } diff --git a/modules/home/files.nix b/modules/home/files.nix index 1ad7540..7081622 100644 --- a/modules/home/files.nix +++ b/modules/home/files.nix @@ -1,109 +1,120 @@ -{self, ...}: { - home.file.".config/neofetch/config.conf".text = '' - username=$(whoami) - name_length=''${#username} - total_width=40 - side_length=$(( (total_width - name_length - 2) / 2 )) +{ lib, self, config, ... }: - top_line=$(printf "─%.0s" $(seq 1 $side_length)) - top_line="$top_line $username " - top_line+=$(printf "─%.0s" $(seq 1 $side_length)) +# This folder is for programs that do not have existing configuration modules in NixOS. +# Basically a to-do list for stuff I need to write my own modules for. +{ + options = { + homeFiles.enable = lib.mkEnableOption "enables declared custom files"; + }; + config = { + home.file = { + ".config/neofetch/config.conf".text = '' + username=$(whoami) + name_length=''${#username} + total_width=40 + side_length=$(( (total_width - name_length - 2) / 2 )) - if (( (total_width - name_length) % 2 != 0 )); then - top_line+="─" - fi + top_line=$(printf "─%.0s" $(seq 1 $side_length)) + top_line="$top_line $username " + top_line+=$(printf "─%.0s" $(seq 1 $side_length)) - print_info() { - prin "┌$top_line┐" - info " ​ ​  " distro - info " ​ ​  " kernel - info " ​ ​  " wm - info " ​ ​  " shell - info " ​ ​  " term - info " ​ ​  " term_font - info " ​ ​ 󰏗 " packages - prin "└────────────────────────────────────────┘" - info cols - prin "\n \n \n \n \n ''${cl3} \n \n ''${cl5} \n \n ''${cl2} \n \n ''${cl6} \n \n ''${cl4} \n \n ''${cl1} \n \n ''${cl7} \n \n ''${cl0}" - } + if (( (total_width - name_length) % 2 != 0 )); then + top_line+="─" + fi - kernel_shorthand="on" - distro_shorthand="on" - os_arch="off" - uptime_shorthand="on" - memory_percent="on" - package_managers="off" - shell_path="off" - shell_version="on" - speed_type="bios_limit" - speed_shorthand="on" - gtk_shorthand="on" - gtk2="on" - gtk3="on" - colors=(distro) - bold="on" - underline_enabled="on" - underline_char="-" - separator="  " - color_blocks="off" - block_range=(0 15) # Colorblocks + print_info() { + prin "┌$top_line┐" + info " ​ ​  " distro + info " ​ ​  " kernel + info " ​ ​  " wm + info " ​ ​  " shell + info " ​ ​  " term + info " ​ ​  " term_font + info " ​ ​ 󰏗 " packages + prin "└────────────────────────────────────────┘" + info cols + prin "\n \n \n \n \n ''${cl3} \n \n ''${cl5} \n \n ''${cl2} \n \n ''${cl6} \n \n ''${cl4} \n \n ''${cl1} \n \n ''${cl7} \n \n ''${cl0}" + } - # Colors for custom colorblocks - magenta="\033[1;35m" - green="\033[1;32m" - white="\033[1;37m" - blue="\033[1;34m" - red="\033[1;31m" - black="\033[1;40;30m" - yellow="\033[1;33m" - cyan="\033[1;36m" - reset="\033[0m" - bgyellow="\033[1;43;33m" - bgwhite="\033[1;47;37m" - cl0="''${reset}" - cl1="''${magenta}" - cl2="''${green}" - cl3="''${white}" - cl4="''${blue}" - cl5="''${red}" - cl6="''${yellow}" - cl7="''${cyan}" - cl8="''${black}" - cl9="''${bgyellow}" - cl10="''${bgwhite}" + kernel_shorthand="on" + distro_shorthand="on" + os_arch="off" + uptime_shorthand="on" + memory_percent="on" + package_managers="off" + shell_path="off" + shell_version="on" + speed_type="bios_limit" + speed_shorthand="on" + gtk_shorthand="on" + gtk2="on" + gtk3="on" + colors=(distro) + bold="on" + underline_enabled="on" + underline_char="-" + separator="  " + color_blocks="off" + block_range=(0 15) # Colorblocks - block_width=4 - block_height=1 + # Colors for custom colorblocks + magenta="\033[1;35m" + green="\033[1;32m" + white="\033[1;37m" + blue="\033[1;34m" + red="\033[1;31m" + black="\033[1;40;30m" + yellow="\033[1;33m" + cyan="\033[1;36m" + reset="\033[0m" + bgyellow="\033[1;43;33m" + bgwhite="\033[1;47;37m" + cl0="''${reset}" + cl1="''${magenta}" + cl2="''${green}" + cl3="''${white}" + cl4="''${blue}" + cl5="''${red}" + cl6="''${yellow}" + cl7="''${cyan}" + cl8="''${black}" + cl9="''${bgyellow}" + cl10="''${bgwhite}" - bar_char_elapsed="-" - bar_char_total="=" - bar_border="on" - bar_length=15 - bar_color_elapsed="distro" - bar_color_total="distro" + block_width=4 + block_height=1 - cpu_display="on" - memory_display="on" - battery_display="on" - disk_display="on" + bar_char_elapsed="-" + bar_char_total="=" + bar_border="on" + bar_length=15 + bar_color_elapsed="distro" + bar_color_total="distro" - image_backend="kitty" - image_source="${self}/assets/images/nixos-logo.png" - image_size="250px" - image_loop="off" + cpu_display="on" + memory_display="on" + battery_display="on" + disk_display="on" - aascii_distro="auto" - ascii_colors=(distro) - ascii_bold="on" + image_backend="kitty" + image_source="${self}/assets/images/nixos-logo.png" + image_size="250px" + image_loop="off" - crop_mode="normal" - crop_offset="center" + aascii_distro="auto" + ascii_colors=(distro) + ascii_bold="on" - gap=2 + crop_mode="normal" + crop_offset="center" - yoffset=0 - xoffset=0 + gap=2 - stdout="off" - ''; + yoffset=0 + xoffset=0 + + stdout="off" + ''; + }; + }; } diff --git a/modules/home/home-manager.nix b/modules/home/home-manager.nix deleted file mode 100644 index 57ba567..0000000 --- a/modules/home/home-manager.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - host, - pkgs, - self, - inputs, - username, - wallpaper, - scheme, - config, - ... -}: let - nur = config.nur; - desktop = (host == "oganesson"); -in { - imports = [inputs.home-manager.nixosModules.home-manager]; - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - backupFileExtension = "backup"; - extraSpecialArgs = {inherit self inputs host wallpaper scheme username nur;}; - users.${username} = { - dconf.settings = if desktop then { - "org/virt-manager/virt-manager/connections" = { - autoconnect = ["qemu:///system"]; - uris = ["qemu:///system"]; - }; - } else {}; - programs.home-manager.enable = true; - imports = [ - ./programs - ./environment - ./scripts - ./files.nix - ]; - home = { - username = "${username}"; - homeDirectory = "/home/${username}"; - stateVersion = "24.05"; - }; - }; - }; - - users = { - groups.persist = {}; - users = { - root.initialPassword = "1234"; - ${username} = { - isNormalUser = true; - initialPassword = "1234"; - shell = pkgs.zsh; - extraGroups = ["wheel" "persist" "libvirtd"]; - }; - }; - }; - security.sudo.extraConfig = '' - ${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild - ''; - nix.settings.allowed-users = ["${username}"]; -} diff --git a/modules/home/programs/autojump.nix b/modules/home/programs/autojump.nix index 543fdcc..33e5c49 100644 --- a/modules/home/programs/autojump.nix +++ b/modules/home/programs/autojump.nix @@ -1,6 +1,11 @@ -{...}: { - programs.autojump = { - enable = true; - enableZshIntegration = true; +{lib, config, ...}: { + options = { + autojumpConfig.enable = lib.mkEnableOption "enables my autojump options"; + }; + config = lib.mkIf config.autojumpConfig.enable { + programs.autojump = { + enable = true; + enableZshIntegration = true; + }; }; } diff --git a/modules/home/programs/bat.nix b/modules/home/programs/bat.nix index c080434..dc71d72 100644 --- a/modules/home/programs/bat.nix +++ b/modules/home/programs/bat.nix @@ -1,8 +1,13 @@ -{inputs, ...}: { - programs.bat = { - enable = true; - config = { - pager = "less -FR"; +{lib, config, inputs, ...}: { + options = { + batConfig.enable = lib.mkEnableOption "enables my bat options"; + }; + config = lib.mkIf config.batConfig.enable { + programs.bat = { + enable = true; + config = { + pager = "less -FR"; + }; }; }; } diff --git a/modules/home/programs/btop.nix b/modules/home/programs/btop.nix index 8bb94ff..62559d2 100644 --- a/modules/home/programs/btop.nix +++ b/modules/home/programs/btop.nix @@ -1,19 +1,24 @@ -{pkgs, ...}: { - programs.btop = { - enable = true; - - settings = { - update_ms = 500; - vim_keys = true; - color_theme = "nord"; - theme_background = true; - temp_scale = "fahrenheit"; - graph_symbol = "block"; - disks_filter = "exclude=/boot /"; - show_swap = false; - swap_disk = false; - }; +{lib, config, pkgs, ...}: { + options = { + btopConfig.enable = lib.mkEnableOption "enables my btop config"; }; + config = lib.mkIf config.btopConfig.enable { + programs.btop = { + enable = true; - home.packages = with pkgs; [nvtopPackages.intel]; + settings = { + update_ms = 500; + vim_keys = true; + color_theme = "nord"; + theme_background = true; + temp_scale = "fahrenheit"; + graph_symbol = "block"; + disks_filter = "exclude=/boot /"; + show_swap = false; + swap_disk = false; + }; + }; + + home.packages = with pkgs; [nvtopPackages.intel]; + }; } diff --git a/modules/home/programs/cava.nix b/modules/home/programs/cava.nix index 571dabb..185079f 100644 --- a/modules/home/programs/cava.nix +++ b/modules/home/programs/cava.nix @@ -1,9 +1,10 @@ -{ - inputs, - pkgs, - ... -}: { - programs.cava = { - enable = true; +{lib, config, inputs, pkgs, ... }: { + options = { + cavaConfig.enable = lib.mkEnableOption "enables my cava settings"; + }; + config = lib.mkIf config.cavaConfig.enable { + programs.cava = { + enable = true; + }; }; } diff --git a/modules/home/programs/eza.nix b/modules/home/programs/eza.nix index 2e4545d..d81806f 100644 --- a/modules/home/programs/eza.nix +++ b/modules/home/programs/eza.nix @@ -1,9 +1,14 @@ -{...}: { - programs.eza = { - enable = true; - enableZshIntegration = false; - extraOptions = ["-1" "-h" "--group-directories-first"]; - icons = "auto"; - git = true; +{lib, config, ...}: { + options = { + ezaConfig.enable = lib.mkEnableOption "enables my eza options"; + }; + config = lib.mkIf config.ezaConfig.enable { + programs.eza = { + enable = true; + enableZshIntegration = false; + extraOptions = ["-1" "-h" "--group-directories-first"]; + icons = "auto"; + git = true; + }; }; } diff --git a/modules/home/programs/firefox.nix b/modules/home/programs/firefox.nix index 206feee..495615b 100644 --- a/modules/home/programs/firefox.nix +++ b/modules/home/programs/firefox.nix @@ -1,127 +1,127 @@ -{ - nur, - username, - self, - ... -}: { - programs.firefox = { - enable = true; - policies = { - DisableTelemetry = true; - DisableFirefoxStudies = true; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; +{lib, config, nur, username, self, ... }: { + options = { + firefoxConfig.enable = lib.mkEnableOption "enables my firefox configuration"; + }; + config = lib.mkIf config.firefoxConfig.enable { + programs.firefox = { + enable = true; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "always"; # alternatives: "always" or "newtab" + DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" isDefault = true; + }; + profiles.${username} = { + name = "${username}"; + bookmarks = [ + { + name = "Nix Sites"; + toolbar = true; + bookmarks = [ + { + name = "NixOS Wiki"; + url = "https://nixos.wiki/wiki/Main_Page"; + } + { + name = "Nixpkgs Reference Manual"; + url = "https://nixos.org/manual/nixpkgs/stable/"; + } + { + name = "NixOS Manual"; + url = "https://nixos.org/manual/nixos/stable/"; + } + { + name = "NixOS Options"; + url = "https://search.nixos.org/options"; + } + { + name = "Home Manager Options"; + url = "https://home-manager-options.extranix.com/"; + } + { + name = "Nixpkgs Package Search"; + url = "https://search.nixos.org/packages"; + } + { + name = "Noogle - Nixpkgs Function Docs"; + url = "https://noogle.dev"; + } + { + name = "Nixvim Docs"; + url = "https://nix-community.github.io/nixvim/"; + } + ]; + } + { + name = "Rust Manual"; + url = "https://doc.rust-lang.org/book/ch01-03-hello-cargo.html"; + } + { + name = "ChatGPT"; + url = "https://chatgpt.com/"; + } + { + name = "DataAnnotation"; + url = "https://app.dataannotation.tech/users/sign_in"; + } + { + name = "Nerd Fonts Cheatsheet"; + url = "https://www.nerdfonts.com/cheat-sheet"; + } + ]; + extensions = with nur.repos.rycee.firefox-addons; [ + darkreader + adnauseam + cookie-autodelete + disconnect + firefox-color + vimium + firenvim + privacy-badger + new-tab-override + ]; + extraConfig = '' + "browser.startup.homepage" = "${self}/glasshouse-desktop/home/firefox/homepage.html"; + "browser.active_color" = "#EE0000"; + "browser.active_color.dark" = "#FF6666"; + "browser.anchor_color" = "#0000EE"; + "browser.anchor_color.dark" = "#8C8CFF"; + "browser.display.background_color" = "#FFFFFF"; + "browser.display.background_color.dark" = "#1C1B22"; + "browser.display.document_color_use" = "1"; + "browser.display.foreground_color" = "#000000"; + "browser.display.foreground_color.dark" = "#FBFBFE"; + "browser.display.suppress_canvas_background_image_on_forced_colors" = "true"; + "browser.display.use_system_colors" = "false"; + "browser.newtabpage.activity-stream.newNewtabExperience.colors" = "#0090ED,#FF4F5F,#2AC3A2,#FF7139,#A172FF,#FFA437,#FF2A8A"; + "browser.theme.colorway-closet" = "true"; + "browser.theme.colorway-migration" = "true"; + "browser.theme.windows.accent-color-in-tabs.enabled" = "false"; + "browser.visited_color" = "#551A8B"; + "browser.visited_color.dark" = "#FFADFF"; + "browser.newtabpage.pinned" = [{ + title = "Homepage"; + url = "${self}/glasshouse-desktop/home/firefox/homepage.html"; + }]; + "devtools.defaultColorUnit" = "authored"; + "editor.background_color" = "#FFFFFF"; + "editor.use_custom_colors" = "false"; + ''; }; - DisablePocket = true; - DisableFirefoxAccounts = true; - DisableAccounts = true; - DisableFirefoxScreenshots = true; - OverrideFirstRunPage = ""; - OverridePostUpdatePage = ""; - DontCheckDefaultBrowser = true; - DisplayBookmarksToolbar = "always"; # alternatives: "always" or "newtab" - DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" - SearchBar = "unified"; # alternative: "separate" isDefault = true; - }; - profiles.${username} = { - name = "${username}"; - bookmarks = [ - { - name = "Nix Sites"; - toolbar = true; - bookmarks = [ - { - name = "NixOS Wiki"; - url = "https://nixos.wiki/wiki/Main_Page"; - } - { - name = "Nixpkgs Reference Manual"; - url = "https://nixos.org/manual/nixpkgs/stable/"; - } - { - name = "NixOS Manual"; - url = "https://nixos.org/manual/nixos/stable/"; - } - { - name = "NixOS Options"; - url = "https://search.nixos.org/options"; - } - { - name = "Home Manager Options"; - url = "https://home-manager-options.extranix.com/"; - } - { - name = "Nixpkgs Package Search"; - url = "https://search.nixos.org/packages"; - } - { - name = "Noogle - Nixpkgs Function Docs"; - url = "https://noogle.dev"; - } - { - name = "Nixvim Docs"; - url = "https://nix-community.github.io/nixvim/"; - } - ]; - } - { - name = "Rust Manual"; - url = "https://doc.rust-lang.org/book/ch01-03-hello-cargo.html"; - } - { - name = "ChatGPT"; - url = "https://chatgpt.com/"; - } - { - name = "DataAnnotation"; - url = "https://app.dataannotation.tech/users/sign_in"; - } - { - name = "Nerd Fonts Cheatsheet"; - url = "https://www.nerdfonts.com/cheat-sheet"; - } - ]; - extensions = with nur.repos.rycee.firefox-addons; [ - darkreader - adnauseam - cookie-autodelete - disconnect - firefox-color - vimium - firenvim - privacy-badger - new-tab-override - ]; - extraConfig = '' - "browser.startup.homepage" = "${self}/glasshouse-desktop/home/firefox/homepage.html"; - "browser.active_color" = "#EE0000"; - "browser.active_color.dark" = "#FF6666"; - "browser.anchor_color" = "#0000EE"; - "browser.anchor_color.dark" = "#8C8CFF"; - "browser.display.background_color" = "#FFFFFF"; - "browser.display.background_color.dark" = "#1C1B22"; - "browser.display.document_color_use" = "1"; - "browser.display.foreground_color" = "#000000"; - "browser.display.foreground_color.dark" = "#FBFBFE"; - "browser.display.suppress_canvas_background_image_on_forced_colors" = "true"; - "browser.display.use_system_colors" = "false"; - "browser.newtabpage.activity-stream.newNewtabExperience.colors" = "#0090ED,#FF4F5F,#2AC3A2,#FF7139,#A172FF,#FFA437,#FF2A8A"; - "browser.theme.colorway-closet" = "true"; - "browser.theme.colorway-migration" = "true"; - "browser.theme.windows.accent-color-in-tabs.enabled" = "false"; - "browser.visited_color" = "#551A8B"; - "browser.visited_color.dark" = "#FFADFF"; - "browser.newtabpage.pinned" = [{ - title = "Homepage"; - url = "${self}/glasshouse-desktop/home/firefox/homepage.html"; - }]; - "devtools.defaultColorUnit" = "authored"; - "editor.background_color" = "#FFFFFF"; - "editor.use_custom_colors" = "false"; - ''; }; }; } diff --git a/modules/home/programs/fuzzel.nix b/modules/home/programs/fuzzel.nix index 5d6352c..dc8865d 100644 --- a/modules/home/programs/fuzzel.nix +++ b/modules/home/programs/fuzzel.nix @@ -1,23 +1,28 @@ -{lib, ...}: { - programs.fuzzel = { - enable = true; - settings = { - main = { - line-height = 25; - fields = "name,generic,comment,categories,filename,keywords"; - terminal = "kitty"; - prompt = "' ➜ '"; - layer = "top"; - lines = 10; - width = 35; - horizontal-pad = 25; - inner-pad = 5; +{config, lib, ...}: { + options = { + fuzzelConfig.enable = lib.mkEnableOption "enables my fuzzel configuration"; + }; + config = lib.mkIf config.fuzzelConfig.enable { + programs.fuzzel = { + enable = true; + settings = { + main = { + line-height = 25; + fields = "name,generic,comment,categories,filename,keywords"; + terminal = "kitty"; + prompt = "' ➜ '"; + layer = "top"; + lines = 10; + width = 35; + horizontal-pad = 25; + inner-pad = 5; + }; + border = { + radius = 15; + width = 3; + }; + colors.background = lib.mkForce "2e344080"; }; - border = { - radius = 15; - width = 3; - }; - colors.background = lib.mkForce "2e344080"; }; }; } diff --git a/modules/home/programs/fzf.nix b/modules/home/programs/fzf.nix index ae15f68..9ec84d1 100644 --- a/modules/home/programs/fzf.nix +++ b/modules/home/programs/fzf.nix @@ -1,6 +1,11 @@ -{...}: { - programs.fzf = { - enable = true; - enableZshIntegration = true; +{lib, config, ...}: { + options = { + fzfConfig.enable = lib.mkEnableOption "enables my fzf options"; + }; + config = lib.mkIf config.fzfConfig.enable { + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; }; } diff --git a/modules/home/programs/git.nix b/modules/home/programs/git.nix index c740392..3f3a14f 100644 --- a/modules/home/programs/git.nix +++ b/modules/home/programs/git.nix @@ -1,7 +1,12 @@ -{username, ...}: { - programs.git = { - enable = true; - userEmail = "${username}@gmail.com"; - userName = "${username}"; +{lib, config, username, ...}: { + options = { + gitConfig.enable = lib.mkEnableOption "enables my git configuration"; + }; + config = lib.mkIf config.gitConfig.enable { + programs.git = { + enable = true; + userEmail = "${username}@gmail.com"; + userName = "${username}"; + }; }; } diff --git a/modules/home/programs/kitty.nix b/modules/home/programs/kitty.nix index 57c67b4..e162341 100644 --- a/modules/home/programs/kitty.nix +++ b/modules/home/programs/kitty.nix @@ -1,73 +1,74 @@ -{ - pkgs, - scheme, - ... -}: { - programs.kitty = { - enable = true; +{lib, config, pkgs, scheme, ... }: { + options = { + kittyConfig.enable = lib.mkEnableOption "enables my kitty configuration"; + }; + config = lib.mkIf config.kittyConfig.enable { + programs.kitty = { + enable = true; - settings = { - confirm_os_window_close = 0; - window_padding_width = 4; - scrollback_lines = 10000; - enable_audio_bell = false; - allow_remote_control = true; - mouse_hide_wait = 60; + settings = { + confirm_os_window_close = 0; + window_padding_width = 4; + scrollback_lines = 10000; + enable_audio_bell = false; + allow_remote_control = true; + mouse_hide_wait = 60; - ## Tabs - tab_title_template = "{index}"; - active_tab_font_style = "normal"; - inactive_tab_font_style = "normal"; - tab_bar_style = "powerline"; - tab_powerline_style = "round"; + ## Tabs + tab_title_template = "{index}"; + active_tab_font_style = "normal"; + inactive_tab_font_style = "normal"; + tab_bar_style = "powerline"; + tab_powerline_style = "round"; + }; + + keybindings = { + ## Tabs + "alt+1" = "goto_tab 1"; + "alt+2" = "goto_tab 2"; + "alt+3" = "goto_tab 3"; + "alt+4" = "goto_tab 4"; + + ## Unbind + "ctrl+shift+left" = "no_op"; + "ctrl+shift+right" = "no_op"; + }; + + extraConfig = '' + background #${scheme.base00} + foreground #${scheme.base05} + selection_background #${scheme.base05} + selection_foreground #${scheme.base00} + url_color #${scheme.base04} + cursor #${scheme.base05} + active_border_color #${scheme.base03} + inactive_border_color #${scheme.base01} + active_tab_background #${scheme.base00} + active_tab_foreground #${scheme.base05} + inactive_tab_background #${scheme.base01} + inactive_tab_foreground #${scheme.base04} + tab_bar_background #${scheme.base01} + + # normal + color0 #${scheme.base01} + color1 #${scheme.base08} + color2 #${scheme.base0B} + color3 #${scheme.base0A} + color4 #${scheme.base0D} + color5 #${scheme.base0E} + color6 #${scheme.base0C} + color7 #${scheme.base05} + + # bright + color8 #${scheme.base03} + color9 #${scheme.base09} + color10 #${scheme.base01} + color11 #${scheme.base02} + color12 #${scheme.base04} + color13 #${scheme.base06} + color14 #${scheme.base0F} + color15 #${scheme.base07} + ''; }; - - keybindings = { - ## Tabs - "alt+1" = "goto_tab 1"; - "alt+2" = "goto_tab 2"; - "alt+3" = "goto_tab 3"; - "alt+4" = "goto_tab 4"; - - ## Unbind - "ctrl+shift+left" = "no_op"; - "ctrl+shift+right" = "no_op"; - }; - - extraConfig = '' - background #${scheme.base00} - foreground #${scheme.base05} - selection_background #${scheme.base05} - selection_foreground #${scheme.base00} - url_color #${scheme.base04} - cursor #${scheme.base05} - active_border_color #${scheme.base03} - inactive_border_color #${scheme.base01} - active_tab_background #${scheme.base00} - active_tab_foreground #${scheme.base05} - inactive_tab_background #${scheme.base01} - inactive_tab_foreground #${scheme.base04} - tab_bar_background #${scheme.base01} - - # normal - color0 #${scheme.base01} - color1 #${scheme.base08} - color2 #${scheme.base0B} - color3 #${scheme.base0A} - color4 #${scheme.base0D} - color5 #${scheme.base0E} - color6 #${scheme.base0C} - color7 #${scheme.base05} - - # bright - color8 #${scheme.base03} - color9 #${scheme.base09} - color10 #${scheme.base01} - color11 #${scheme.base02} - color12 #${scheme.base04} - color13 #${scheme.base06} - color14 #${scheme.base0F} - color15 #${scheme.base07} - ''; }; } diff --git a/modules/home/programs/password-store.nix b/modules/home/programs/password-store.nix index 88a15d7..5bed03e 100644 --- a/modules/home/programs/password-store.nix +++ b/modules/home/programs/password-store.nix @@ -1,10 +1,15 @@ -{username, ...}: let +{lib, config, username, ...}: let home = "/home/${username}"; in { - programs.password-store = { - enable = true; - settings = { - PASSWORD_STORE_DIR = "${home}/.password-store"; + options = { + passConfig.enable = lib.mkEnableOption "enables my pass config"; + }; + config = lib.mkIf config.passConfig.enable { + programs.password-store = { + enable = true; + settings = { + PASSWORD_STORE_DIR = "${home}/.password-store"; + }; }; }; } diff --git a/modules/home/programs/yazi.nix b/modules/home/programs/yazi.nix index eba75bb..4fa3fba 100644 --- a/modules/home/programs/yazi.nix +++ b/modules/home/programs/yazi.nix @@ -1,6 +1,11 @@ -{...}: { - programs.yazi = { - enable = true; - enableZshIntegration = true; +{lib, config, ...}: { + options = { + yaziConfig.enable = lib.mkEnableOption "enables my yazi config"; + }; + config = lib.mkIf config.yaziConfig.enable { + programs.yazi = { + enable = true; + enableZshIntegration = true; + }; }; } diff --git a/modules/home/scripts/default.nix b/modules/home/scripts/default.nix index 39089fd..d9f7beb 100644 --- a/modules/home/scripts/default.nix +++ b/modules/home/scripts/default.nix @@ -1,70 +1,94 @@ { host, + lib, + config, self, pkgs, ... }: let - keyring = import ./wm-controls/keyring.nix { - self = self; - pkgs = pkgs; - }; - invoke = import ./commands/invoke.nix { - self = self; - pkgs = pkgs; - }; - splash = import ./commands/splash.nix { - self = self; - pkgs = pkgs; - }; - scheck = import ./commands/s_check.nix { - self = self; - pkgs = pkgs; - }; - runbg = import ./commands/runbg.nix { - self = self; - pkgs = pkgs; - }; - garbage-collect = import ./nix/garbage-collect.nix { - self = self; - pkgs = pkgs; - }; - nsp = import ./nix/nsp.nix { - self = self; - pkgs = pkgs; - }; - switchmon = import ./wm-controls/switchmon.nix { - self = self; - pkgs = pkgs; - }; - rebuild = import ./nix/rebuild.nix { - host = host; - self = self; - pkgs = pkgs; - }; - moveonscreen = import ./wm-controls/moveonscreen.nix {pkgs = pkgs;}; - toolbelt = import ./commands/toolbelt.nix {pkgs = pkgs;}; - viconf = import ./commands/viconf.nix { - pkgs = pkgs; - }; - chscheme = import ./wm-controls/chscheme.nix { - pkgs = pkgs; - }; - chpaper = import ./wm-controls/chpaper.nix {pkgs = pkgs;}; + keyring = import ./wm-controls/keyring.nix { inherit self pkgs; }; + invoke = import ./commands/invoke.nix { inherit self pkgs; }; + splash = import ./commands/splash.nix { inherit self pkgs; }; + runbg = import ./commands/runbg.nix { inherit self pkgs; }; + garbage-collect = import ./nix/garbage-collect.nix { inherit self pkgs; }; + nsp = import ./nix/nsp.nix { inherit self pkgs; }; + scheck = import ./wm-controls/s_check.nix { inherit self pkgs; }; + switchmon = import ./wm-controls/switchmon.nix { inherit self pkgs; }; + rebuild = import ./nix/rebuild.nix { inherit host self pkgs; }; + moveonscreen = import ./wm-controls/moveonscreen.nix { inherit pkgs; }; + toolbelt = import ./commands/toolbelt.nix { inherit pkgs; }; + viconf = import ./commands/viconf.nix { inherit pkgs; }; + chscheme = import ./wm-controls/chscheme.nix { inherit pkgs; }; + chpaper = import ./wm-controls/chpaper.nix { inherit pkgs; }; + scriptOverride = + doc: + group: + name: + lib.mkEnableOption + "${doc}" // { + default = config.movScripts.enable && config.movScripts.${group}.enable; + }; in { - home.packages = [ - chpaper - chscheme - keyring - garbage-collect - invoke - rebuild - nsp - runbg - scheck - splash - switchmon - moveonscreen - toolbelt - viconf - ]; + options = { + movScripts.enable = lib.mkEnableOption "Enables all pagedmov's scripts"; + + # Enable or disable by group + movScripts.commandScripts.enable = + lib.mkEnableOption "Enables all command scripts"; + movScripts.hyprlandControls.enable = + lib.mkEnableOption "Enables all Hyprland control scripts"; + movScripts.nixShortcuts.enable = + lib.mkEnableOption "Enables all Nix shortcut scripts"; + + # Individual options using scriptOverride or mkEnableOption directly + movScripts.commandScripts.invoke.enable = + scriptOverride "Enables the invoke command" "commandScripts" "invoke"; + movScripts.commandScripts.runbg.enable = + scriptOverride "Enables the runbg command - written by FrostPhoenix" "commandScripts" "runbg"; + movScripts.commandScripts.splash.enable = + scriptOverride "Enables the splash screen when opening a terminal" "commandScripts" "splash"; + movScripts.commandScripts.toolbelt.enable = + scriptOverride "Enables the toolbelt command" "commandScripts" "toolbelt"; + movScripts.commandScripts.viconf.enable = + scriptOverride "Enables the viconf command" "commandScripts" "viconf"; + + movScripts.hyprlandControls.chpaper.enable = + scriptOverride "Enables the chpaper command" "hyprlandControls" "chpaper"; + movScripts.hyprlandControls.scheck.enable = + scriptOverride "Enables the scheck command" "hyprlandControls" "scheck"; + movScripts.hyprlandControls.chscheme.enable = + scriptOverride "Enables the chscheme command" "hyprlandControls" "chscheme"; + movScripts.hyprlandControls.keyring.enable = + scriptOverride "Enables the keyring command" "hyprlandControls" "keyring"; + movScripts.hyprlandControls.moveonscreen.enable = + scriptOverride "Ensures floating windows remain on screen" "hyprlandControls" "moveonscreen"; + movScripts.hyprlandControls.switchmon.enable = + scriptOverride "Moves cursor to the center of the second monitor" "hyprlandControls" "switchmon"; + + movScripts.nixShortcuts.garbage-collect.enable = + scriptOverride "Enables the garbage-collect script" "nixShortcuts" "garbage-collect"; + movScripts.nixShortcuts.nsp.enable = + scriptOverride "Enables nsp as an alias for 'nix-shell -p'" "nixShortcuts" "nsp"; + movScripts.nixShortcuts.rebuild.enable = + scriptOverride "Enables rebuild as an alias for 'sudo nixos-rebuild switch'" "nixShortcuts" "rebuild"; + }; + + config = lib.mkIf config.movScripts.enable { + home.packages = lib.optionals config.movScripts.commandScripts.invoke.enable [ invoke ] + ++ lib.optionals config.movScripts.commandScripts.runbg.enable [ runbg ] + ++ lib.optionals config.movScripts.commandScripts.splash.enable [ splash ] + ++ lib.optionals config.movScripts.commandScripts.toolbelt.enable [ toolbelt ] + ++ lib.optionals config.movScripts.commandScripts.viconf.enable [ viconf ] + + ++ lib.optionals config.movScripts.hyprlandControls.chpaper.enable [ chpaper ] + ++ lib.optionals config.movScripts.hyprlandControls.scheck.enable [ scheck ] + ++ lib.optionals config.movScripts.hyprlandControls.chscheme.enable [ chscheme ] + ++ lib.optionals config.movScripts.hyprlandControls.keyring.enable [ keyring ] + ++ lib.optionals config.movScripts.hyprlandControls.moveonscreen.enable [ moveonscreen ] + ++ lib.optionals config.movScripts.hyprlandControls.switchmon.enable [ switchmon ] + + ++ lib.optionals config.movScripts.nixShortcuts.garbage-collect.enable [ garbage-collect ] + ++ lib.optionals config.movScripts.nixShortcuts.nsp.enable [ nsp ] + ++ lib.optionals config.movScripts.nixShortcuts.rebuild.enable [ rebuild ]; + }; } diff --git a/modules/home/scripts/commands/s_check.nix b/modules/home/scripts/wm-controls/s_check.nix similarity index 100% rename from modules/home/scripts/commands/s_check.nix rename to modules/home/scripts/wm-controls/s_check.nix diff --git a/modules/sys/configuration.nix b/modules/sys/configuration.nix deleted file mode 100644 index 81c1de4..0000000 --- a/modules/sys/configuration.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - inputs, - nixpkgs, - config, - self, - username, - host, - ... -}: { - imports = [ - ./hardware - ./software - ./environment - ../home/home-manager.nix - ]; -} diff --git a/modules/sys/default.nix b/modules/sys/default.nix new file mode 100644 index 0000000..e617c81 --- /dev/null +++ b/modules/sys/default.nix @@ -0,0 +1,30 @@ +{ + inputs, + nixpkgs, + config, + self, + username, + host, + lib, + ... +}: { + imports = [ + ./hardware + ./software + ./environment + ]; + + networkModule.enable = lib.mkDefault false; + nixSettings.enable = lib.mkDefault false; + bootLoader.enable = lib.mkDefault false; + issue.enable = lib.mkDefault false; + sddmConfig.enable = lib.mkDefault false; + stylixConfig.enable = lib.mkDefault false; + gamingPkgs.enable = lib.mkDefault false; + steamConfig.enable = lib.mkDefault false; + sysPkgs.enable = lib.mkDefault false; + sysProgs.enable = lib.mkDefault false; + sysServices.enable = lib.mkDefault false; + virtConfig.enable = lib.mkDefault false; + powerProfiles.enable = lib.mkDefault false; +} diff --git a/modules/sys/environment/default.nix b/modules/sys/environment/default.nix index 2f70861..0447f39 100644 --- a/modules/sys/environment/default.nix +++ b/modules/sys/environment/default.nix @@ -11,5 +11,6 @@ imports = [(import ./sddm.nix)] ++ [(import ./issue.nix)] + ++ [(import ./nix.nix)] ++ [(import ./stylix.nix)]; } diff --git a/modules/sys/environment/issue.nix b/modules/sys/environment/issue.nix index ffc781d..90e89f9 100644 --- a/modules/sys/environment/issue.nix +++ b/modules/sys/environment/issue.nix @@ -1,29 +1,34 @@ -{...}: { - environment.etc."issue".text = '' +{lib, config, ...}: { + options = { + issue.enable = lib.mkEnableOption "enables custom /etc/issue splash screen for the tty"; + }; + config = lib.mkIf config.issue.enable { + environment.etc."issue".text = '' - \e[38;5;27m▓▓▓▓ \e[38;5;81m▒▒▒▒ ▒▒▒▒ - \e[38;5;27m▓▓▓▓ \e[38;5;81m▒▒▒▒ ▒▒▒▒ \e[38;5;27m ▓▓▓ - \e[38;5;27m▓▓▓▓ \e[38;5;81m▒▒▒▒▒▒▒▒ \e[38;5;27m ▓▓▓ ▓▓ ▓▓▓▓▓ \e[38;5;81m ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ - \e[38;5;27m▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\e[38;5;81m▒▒▒▒▒▒ \e[38;5;27m▓▓ \e[38;5;27m ▓▓▓▓▓ ▓▓▓▓ ▓▓▓ \e[38;5;81m ▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ - \e[38;5;27m▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\e[38;5;81m▒▒▒▒ \e[38;5;27m▓▓▓ \e[38;5;27m ▓▓▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒ - \e[38;5;81m▒▒▒▒ \e[38;5;81m▒▒▒▒ \e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒▒ ▒▒▒▒ ▒▒▒▒ - \e[38;5;81m▒▒▒▒ \e[38;5;81m▒▒▒▒\e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒ - \e[38;5;81m▒▒▒▒▒▒▒▒▒▒▒ \e[38;5;81m▒▒\e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒▒ - \e[38;5;81m ▒▒▒▒▒▒▒▒▒\e[38;5;27m \e[38;5;27m▓▓▓▓▓▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒ - \e[38;5;81m▒▒▒▒\e[38;5;27m▓▓ \e[38;5;27m▓▓▓▓▓▓▓▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒ - \e[38;5;81m▒▒▒▒\e[38;5;27m▓▓▓▓ \e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒▒ - \e[38;5;81m▒▒▒▒ \e[38;5;27m▓▓▓▓ \e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒ - \e[38;5;81m▒▒▒ \e[38;5;27m▓▓▓▓\e[38;5;81m▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ \e[38;5;27m ▓▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓▓ \e[38;5;81m ▒▒▒▒ ▒▒▒▒ ▒▒▒▒ - \e[38;5;81m▒▒ \e[38;5;27m▓▓▓▓▓▓\e[38;5;81m▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ \e[38;5;27m ▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ - \e[38;5;27m▓▓▓▓▓▓▓▓ \e[38;5;81m▒▒▒▒ \e[38;5;27m ▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ - \e[38;5;27m▓▓▓▓ ▓▓▓▓ \e[38;5;81m▒▒▒▒ \e[38;5;27m ▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ \e[38;5;81m ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ - \e[38;5;27m▓▓▓▓ ▓▓▓▓ \e[38;5;81m▒▒▒▒ + \e[38;5;27m▓▓▓▓ \e[38;5;81m▒▒▒▒ ▒▒▒▒ + \e[38;5;27m▓▓▓▓ \e[38;5;81m▒▒▒▒ ▒▒▒▒ \e[38;5;27m ▓▓▓ + \e[38;5;27m▓▓▓▓ \e[38;5;81m▒▒▒▒▒▒▒▒ \e[38;5;27m ▓▓▓ ▓▓ ▓▓▓▓▓ \e[38;5;81m ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ + \e[38;5;27m▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\e[38;5;81m▒▒▒▒▒▒ \e[38;5;27m▓▓ \e[38;5;27m ▓▓▓▓▓ ▓▓▓▓ ▓▓▓ \e[38;5;81m ▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ + \e[38;5;27m▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\e[38;5;81m▒▒▒▒ \e[38;5;27m▓▓▓ \e[38;5;27m ▓▓▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒ + \e[38;5;81m▒▒▒▒ \e[38;5;81m▒▒▒▒ \e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒▒ ▒▒▒▒ ▒▒▒▒ + \e[38;5;81m▒▒▒▒ \e[38;5;81m▒▒▒▒\e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒ + \e[38;5;81m▒▒▒▒▒▒▒▒▒▒▒ \e[38;5;81m▒▒\e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒▒ + \e[38;5;81m ▒▒▒▒▒▒▒▒▒\e[38;5;27m \e[38;5;27m▓▓▓▓▓▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒ + \e[38;5;81m▒▒▒▒\e[38;5;27m▓▓ \e[38;5;27m▓▓▓▓▓▓▓▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒ + \e[38;5;81m▒▒▒▒\e[38;5;27m▓▓▓▓ \e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒▒ + \e[38;5;81m▒▒▒▒ \e[38;5;27m▓▓▓▓ \e[38;5;27m▓▓▓▓ \e[38;5;27m ▓▓▓▓ ▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓ \e[38;5;81m ▒▒▒ ▒▒▒ ▒▒▒▒ + \e[38;5;81m▒▒▒ \e[38;5;27m▓▓▓▓\e[38;5;81m▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ \e[38;5;27m ▓▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓▓ \e[38;5;81m ▒▒▒▒ ▒▒▒▒ ▒▒▒▒ + \e[38;5;81m▒▒ \e[38;5;27m▓▓▓▓▓▓\e[38;5;81m▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ \e[38;5;27m ▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ + \e[38;5;27m▓▓▓▓▓▓▓▓ \e[38;5;81m▒▒▒▒ \e[38;5;27m ▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓ ▓▓▓▓ \e[38;5;81m ▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ + \e[38;5;27m▓▓▓▓ ▓▓▓▓ \e[38;5;81m▒▒▒▒ \e[38;5;27m ▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ \e[38;5;81m ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ + \e[38;5;27m▓▓▓▓ ▓▓▓▓ \e[38;5;81m▒▒▒▒ - \e[1;32mSystem Maintainer\e[0m: Kyler Clay - \e[1;32mContact\e[0m: kylerclay@proton.me - 470-403-8522 + \e[1;32mSystem Maintainer\e[0m: Kyler Clay + \e[1;32mContact\e[0m: kylerclay@proton.me + 470-403-8522 - Run '\e[1;35mnixos-help\e[0m' for the NixOS manual. - Run '\e[1;35mHyprland\e[0m' to enter the desktop environment. - ''; + Run '\e[1;35mnixos-help\e[0m' for the NixOS manual. + Run '\e[1;35mHyprland\e[0m' to enter the desktop environment. + ''; + }; } diff --git a/modules/sys/environment/nix.nix b/modules/sys/environment/nix.nix new file mode 100644 index 0000000..c62537b --- /dev/null +++ b/modules/sys/environment/nix.nix @@ -0,0 +1,21 @@ +{lib, config, ... }: { + options = { + nixSettings.enable = lib.mkEnableOption "enables my nixos settings"; + }; + config = lib.mkIf config.nixSettings.enable { + nix = { + settings = { + auto-optimise-store = true; + experimental-features = ["nix-command" "flakes"]; + substituters = ["https://nix-gaming.cachix.org"]; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + }; + time.timeZone = "America/New_York"; + i18n.defaultLocale = "en_US.UTF-8"; + }; +} diff --git a/modules/sys/environment/sddm.nix b/modules/sys/environment/sddm.nix index a9c7996..93458e9 100644 --- a/modules/sys/environment/sddm.nix +++ b/modules/sys/environment/sddm.nix @@ -1,24 +1,30 @@ { pkgs, self, + lib, config, ... }: { - environment.systemPackages = [ - ( - pkgs.catppuccin-sddm.override { - flavor = "mocha"; - font = "JetBrains Mono Nerd Font"; - fontSize = "14"; - loginBackground = true; - background = "${self}/assets/wallpapers/dark-waves.jpg"; - } - ) - ]; - services.displayManager.sddm = { - enable = true; - wayland.enable = true; - theme = "catppuccin-mocha"; - package = pkgs.kdePackages.sddm; + options = { + sddmConfig.enable = lib.mkEnableOption "enables custom sddm configuration"; + }; + config = lib.mkIf config.sddmConfig.enable { + environment.systemPackages = [ + ( + pkgs.catppuccin-sddm.override { + flavor = "mocha"; + font = "JetBrains Mono Nerd Font"; + fontSize = "14"; + loginBackground = true; + background = "${self}/assets/wallpapers/dark-waves.jpg"; + } + ) + ]; + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + theme = "catppuccin-mocha"; + package = pkgs.kdePackages.sddm; + }; }; } diff --git a/modules/sys/environment/stylix.nix b/modules/sys/environment/stylix.nix index edb5ce5..c84620e 100644 --- a/modules/sys/environment/stylix.nix +++ b/modules/sys/environment/stylix.nix @@ -2,44 +2,51 @@ pkgs, scheme, wallpaper, + lib, + config, ... }: { - stylix = { - enable = true; - base16Scheme = scheme; - image = wallpaper; - polarity = "dark"; - autoEnable = true; - opacity.terminal = 0.5; - targets = { - console.enable = true; - feh.enable = true; - grub.enable = true; - gtk.enable = true; - nixos-icons.enable = true; - }; - cursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Ice"; - }; - fonts = { - monospace = { - package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; - name = "JetBrains Mono Nerd Font"; + options = { + stylixConfig.enable = lib.mkEnableOption "enables custom stylix options"; + }; + config = lib.mkIf config.stylixConfig.enable { + stylix = { + enable = true; + base16Scheme = scheme; + image = wallpaper; + polarity = "dark"; + autoEnable = true; + opacity.terminal = 0.5; + targets = { + console.enable = true; + feh.enable = true; + grub.enable = true; + gtk.enable = true; + nixos-icons.enable = true; }; - sansSerif = { - package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; - name = "JetBrains Mono Nerd Font"; + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; }; - serif = { - package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; - name = "JetBrains Mono Nerd Font"; - }; - sizes = { - desktop = 10; - applications = 14; - terminal = 14; - popups = 16; + fonts = { + monospace = { + package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; + name = "JetBrains Mono Nerd Font"; + }; + sansSerif = { + package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; + name = "JetBrains Mono Nerd Font"; + }; + serif = { + package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; + name = "JetBrains Mono Nerd Font"; + }; + sizes = { + desktop = 10; + applications = 14; + terminal = 14; + popups = 16; + }; }; }; }; diff --git a/modules/sys/hardware/bootloader.nix b/modules/sys/hardware/bootloader.nix index 04347b5..a7be490 100644 --- a/modules/sys/hardware/bootloader.nix +++ b/modules/sys/hardware/bootloader.nix @@ -1,8 +1,14 @@ -{pkgs, ...}: { - boot = { - loader.systemd-boot.enable = true; - loader.efi.canTouchEfiVariables = true; - loader.systemd-boot.configurationLimit = 10; - kernelPackages = pkgs.linuxPackages_latest; +{pkgs, lib, config, ...}: { + options = { + # make this enabled by default!!! + bootLoader.enable = lib.mkEnableOption "enables bootloader config"; + }; + config = lib.mkIf config.bootLoader.enable { + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + loader.systemd-boot.configurationLimit = 10; + kernelPackages = pkgs.linuxPackages_latest; + }; }; } diff --git a/modules/sys/hardware/default.nix b/modules/sys/hardware/default.nix index 7d75833..c2d7219 100644 --- a/modules/sys/hardware/default.nix +++ b/modules/sys/hardware/default.nix @@ -10,5 +10,6 @@ }: { imports = [(import ./bootloader.nix)] - ++ [(import ./network.nix)]; + ++ [(import ./network.nix)] + ++ [(import ./powerprofiles.nix)]; } diff --git a/modules/sys/hardware/network.nix b/modules/sys/hardware/network.nix index 971fdc4..fa2ded1 100644 --- a/modules/sys/hardware/network.nix +++ b/modules/sys/hardware/network.nix @@ -1,20 +1,24 @@ -{host, ...}: let +{host, lib, config, ...}: let desktop = host == "oganesson"; in { - networking = { - networkmanager.enable = true; - hostName = - if desktop - then "oganesson" - else "mercury"; - hosts = { - "192.168.1.201" = ["glasshaus"]; - "192.168.1.111" = ["argon"]; - "192.168.1.223" = ["mercury"]; - }; - firewall = { - enable = true; - allowedTCPPorts = [30000]; + options = { + networkModule.enable = lib.mkEnableOption "enables network configuration"; + }; + config = lib.mkIf config.networkModule.enable { + networking = { + networkmanager.enable = true; + hostName = + if desktop + then "oganesson" + else "mercury"; + hosts = { + "192.168.1.201" = ["xenon"]; + "192.168.1.111" = ["argon"]; + "192.168.1.223" = ["mercury"]; + }; + firewall = { + enable = true; + }; }; }; } diff --git a/modules/sys/hardware/powerprofiles.nix b/modules/sys/hardware/powerprofiles.nix new file mode 100644 index 0000000..25377fd --- /dev/null +++ b/modules/sys/hardware/powerprofiles.nix @@ -0,0 +1,43 @@ +{lib, config, ... }: { + options = { + powerProfiles.enable = lib.mkEnableOption "enables power profiles"; + }; + config = lib.mkIf config.powerProfiles.enable { + services = { + + power-profiles-daemon.enable = true; + + upower = { + enable = true; + percentageLow = 20; + percentageCritical = 5; + percentageAction = 3; + criticalPowerAction = "PowerOff"; + }; + + tlp.settings = { + CPU_ENERGY_PERF_POLICY_ON_AC = "power"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 1; + + CPU_HWP_DYN_BOOST_ON_AC = 1; + CPU_HWP_DYN_BOOST_ON_BAT = 1; + + PLATFORM_PROFILE_ON_AC = "performance"; + PLATFORM_PROFILE_ON_BAT = "performance"; + + INTEL_GPU_MIN_FREQ_ON_AC = 500; + INTEL_GPU_MIN_FREQ_ON_BAT = 500; + # INTEL_GPU_MAX_FREQ_ON_AC=0; + # INTEL_GPU_MAX_FREQ_ON_BAT=0; + # INTEL_GPU_BOOST_FREQ_ON_AC=0; + # INTEL_GPU_BOOST_FREQ_ON_BAT=0; + + PCIE_ASPM_ON_AC = "default"; + PCIE_ASPM_ON_BAT = "powersupersave"; + }; + }; + }; +} diff --git a/modules/sys/software/default.nix b/modules/sys/software/default.nix index f48cb43..e2f7de3 100644 --- a/modules/sys/software/default.nix +++ b/modules/sys/software/default.nix @@ -6,17 +6,13 @@ username, host, ... -}: let - desktop = host == "oganesson"; - desktop_modules = - if desktop - then [(import ./virtualization.nix)] ++ [(import ./gaming)] - else []; -in { +}: { imports = [(import ./packages.nix)] ++ [(import ./programs.nix)] ++ [(import ./services.nix)] ++ [(import ./nixvim)] - ++ desktop_modules; + ++ [(import ./module-test.nix)] + ++ [(import ./virtualization.nix)] + ++ [(import ./gaming)]; } diff --git a/modules/sys/software/gaming/gaming_pkgs.nix b/modules/sys/software/gaming/gaming_pkgs.nix index f2685f3..054e5f8 100644 --- a/modules/sys/software/gaming/gaming_pkgs.nix +++ b/modules/sys/software/gaming/gaming_pkgs.nix @@ -1,5 +1,10 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - snes9x-gtk - ]; +{lib, config, pkgs, ...}: { + options = { + gamingPkgs.enable = lib.mkEnableOption "enables gaming packages"; + }; + config = lib.mkIf config.gamingPkgs.enable { + environment.systemPackages = with pkgs; [ + snes9x-gtk + ]; + }; } diff --git a/modules/sys/software/gaming/steam.nix b/modules/sys/software/gaming/steam.nix index c45fa4b..630b339 100644 --- a/modules/sys/software/gaming/steam.nix +++ b/modules/sys/software/gaming/steam.nix @@ -1,6 +1,11 @@ -{...}: { - programs.steam = { - enable = true; - remotePlay.openFirewall = true; +{lib, config, ...}: { + options = { + steamConfig.enable = lib.mkEnableOption "enables steam configuration"; + }; + config = lib.mkIf config.steamConfig.enable { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + }; }; } diff --git a/modules/sys/software/module-test.nix b/modules/sys/software/module-test.nix new file mode 100644 index 0000000..0f8a2e4 --- /dev/null +++ b/modules/sys/software/module-test.nix @@ -0,0 +1,11 @@ +{ pkgs, lib, config, ... }: +{ + options = { + testmodule.enable = lib.mkEnableOption "enables test module"; + }; + config = lib.mkIf config.testmodule.enable { + environment.systemPackages = with pkgs; [ + hello + ]; + }; +} diff --git a/modules/sys/software/packages.nix b/modules/sys/software/packages.nix index af3b804..96a62c6 100644 --- a/modules/sys/software/packages.nix +++ b/modules/sys/software/packages.nix @@ -1,79 +1,82 @@ -{ - pkgs, - inputs, - ... -}: { - environment.systemPackages = with pkgs; [ - alejandra - alsa-lib - alsa-utils - bc - cava - cabal-install - clang - clang-tools - cliphist - cmake - fail2ban - feh - ffmpeg-full - fuse - git - gnumake - gst_all_1.gstreamer - htop - hyprland - hyprland-workspaces - hyprpicker - imagemagick - inetutils - kitty - libclang - libcxx - lolcat - lsof - lua-language-server - luarocks - mesa - mpd - mullvad - mesa - neofetch - nh - nix-index - nix-output-monitor - nix-prefetch-scripts - nixos-option - nix-search-cli - nvd - openssl - p7zip - jq - pamixer - parted - pavucontrol - pkg-config - playerctl - protonmail-bridge - protontricks - pyright - socat - sox - stress - tor - tree - unrar - unzip - usbutils - vim - vscode-langservers-extracted - vulkan-loader - wget - wine - wl-clipboard - xpad - libnotify - file - libvirt-glib - ]; +{lib, config, pkgs, inputs, ... }: { + options = { + sysPkgs.enable = lib.mkEnableOption "enables default system packages"; + }; + config = lib.mkIf config.sysPkgs.enable { + environment.systemPackages = with pkgs; [ + alejandra + alsa-lib + alsa-utils + bc + cava + cabal-install + clang + clang-tools + cliphist + cmake + fail2ban + feh + ffmpeg-full + fuse + git + gnumake + gst_all_1.gstreamer + htop + hyprland-workspaces + hyprpicker + imagemagick + inetutils + kitty + libclang + libcxx + lolcat + lsof + lua-language-server + luarocks + mesa + mpd + mullvad + mesa + neofetch + nh + nix-index + nix-output-monitor + nix-prefetch-scripts + nixos-option + nix-search-cli + nix-template + mkdocs + python3Packages.mkdocs-material + nvd + openssl + p7zip + jq + pamixer + parted + pavucontrol + pkg-config + playerctl + protonmail-bridge + protontricks + pyright + socat + sox + stress + tor + tree + unrar + unzip + usbutils + vim + vscode-langservers-extracted + vulkan-loader + wget + wine + wl-clipboard + xpad + libnotify + file + libvirt-glib + ]; + }; } diff --git a/modules/sys/software/programs.nix b/modules/sys/software/programs.nix index 1e51364..e49f20b 100644 --- a/modules/sys/software/programs.nix +++ b/modules/sys/software/programs.nix @@ -1,17 +1,22 @@ -{pkgs, ...}: { - programs = { - hyprland.enable = true; - zsh.enable = true; - nix-ld = { - enable = true; - libraries = with pkgs; [ - stdenv.cc.cc - ffmpeg-full - ]; - }; - gnupg.agent = { - enable = true; - enableSSHSupport = true; +{lib, config, pkgs, ...}: { + options = { + sysProgs.enable = lib.mkEnableOption "enables default system programs"; + }; + config = lib.mkIf config.sysProgs.enable { + programs = { + hyprland.enable = true; + zsh.enable = true; + nix-ld = { + enable = true; + libraries = with pkgs; [ + stdenv.cc.cc + ffmpeg-full + ]; + }; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; }; }; } diff --git a/modules/sys/software/services.nix b/modules/sys/software/services.nix index 77a6e08..6177879 100644 --- a/modules/sys/software/services.nix +++ b/modules/sys/software/services.nix @@ -1,19 +1,33 @@ -{...}: { - services = { - pipewire = { - enable = true; - pulse.enable = true; - wireplumber.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - }; - udev.enable = true; - dbus.enable = true; - mullvad-vpn.enable = true; - blueman.enable = true; - openssh = { - enable = true; - allowSFTP = true; +{lib, config, ...}: { + options = { + sysServices.enable = lib.mkEnableOption "enables default system services"; + }; + config = lib.mkIf config.sysServices.enable { + services = { + keyd = { + enable = true; + keyboards.default = { + ids = ["*"]; + settings.main = { + capslock = "esc"; + }; + }; + }; + pipewire = { + enable = true; + pulse.enable = true; + wireplumber.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + }; + udev.enable = true; + dbus.enable = true; + mullvad-vpn.enable = true; + blueman.enable = true; + openssh = { + enable = true; + allowSFTP = true; + }; }; }; } diff --git a/modules/sys/software/virtualization.nix b/modules/sys/software/virtualization.nix index 57a0cc0..35bc716 100644 --- a/modules/sys/software/virtualization.nix +++ b/modules/sys/software/virtualization.nix @@ -1,4 +1,9 @@ -{username, ...}: { - virtualisation.libvirtd.enable = true; - programs.virt-manager.enable = true; +{lib, config, username, ...}: { + options = { + virtConfig.enable = lib.mkEnableOption "enables virtualization"; + }; + config = lib.mkIf config.virtConfig.enable { + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + }; }