From 10e827be06fa5afa747aa73980d27c95c007d898 Mon Sep 17 00:00:00 2001 From: neverness Date: Fri, 20 Dec 2024 22:10:11 +0900 Subject: [PATCH] update --- flake.lock | 43 ++- flake.nix | 14 +- jetpure/default.nix | 2 + jetpure/home/default.nix | 13 +- jetpure/home/parts/sway.nix | 8 +- jetpure/host/default.nix | 7 +- jetpure/host/parts/default.nix | 8 +- jetpure/host/parts/disko.nix | 82 ------ jetpure/host/parts/disks.nix | 24 ++ libx/builder.nix | 22 +- libx/options.nix | 16 +- modules/home/default.nix | 26 +- modules/home/misc/default.nix | 9 - modules/home/misc/xdg/default.nix | 1 - modules/home/programs/cli/default.nix | 20 -- modules/home/programs/cli/helix/binds.nix | 1 - modules/home/programs/cli/helix/default.nix | 6 - modules/home/programs/cli/helix/languages.nix | 272 ++++++++++-------- modules/home/programs/cli/helix/prettier.nix | 62 ---- modules/home/programs/cli/helix/settings.nix | 1 - modules/home/programs/cli/joshuto/default.nix | 5 - modules/home/programs/cli/yazi/default.nix | 8 - modules/home/programs/cli/yazi/starship.nix | 37 --- .../home/programs/custom/ctree/default.nix | 21 -- modules/home/programs/custom/ctree/pkg.nix | 25 -- modules/home/programs/custom/default.nix | 8 - .../home/programs/custom/mabel/default.nix | 21 -- modules/home/programs/custom/mabel/pkg.nix | 25 -- .../home/programs/custom/torrent/default.nix | 21 -- modules/home/programs/custom/torrent/pkg.nix | 11 - modules/home/programs/default.nix | 7 - modules/home/programs/gui/default.nix | 14 - modules/home/programs/gui/floorp/default.nix | 4 - .../home/programs/gui/floorp/user/default.nix | 6 - .../programs/gui/minecraft/portablemc.nix | 73 ----- modules/home/programs/gui/mpv/default.nix | 4 - .../home/programs/gui/qutebrowser/binds.nix | 26 ++ .../home/programs/gui/qutebrowser/default.nix | 30 +- modules/home/programs/gui/spotify/default.nix | 2 +- modules/home/programs/gui/swayimg/default.nix | 260 ++++++++--------- modules/home/shells/default.nix | 13 - modules/home/shells/fish/default.nix | 5 - modules/home/shells/fish/functions.nix | 45 --- modules/home/shells/fish/misc/default.nix | 6 - modules/home/shells/fish/misc/fish-helix.nix | 29 -- modules/home/shells/zsh/default.nix | 1 - modules/home/themes/default.nix | 7 - modules/home/themes/qt/default.nix | 5 - modules/home/themes/qt/qt5ct.nix | 7 +- modules/home/themes/qt/qt6ct.nix | 7 +- modules/home/themes/stylix/default.nix | 5 + modules/home/themes/stylix/image.nix | 13 +- modules/home/wm/default.nix | 8 - modules/home/wm/hyprland/binds.nix | 26 +- modules/home/wm/hyprland/default.nix | 5 - modules/home/wm/hyprland/plugins.nix | 27 -- modules/home/wm/hyprland/sets.nix | 3 +- modules/home/wm/misc/default.nix | 8 - modules/home/wm/misc/rofi/default.nix | 35 +++ modules/home/wm/misc/waybar/default.nix | 30 +- modules/home/wm/misc/yofi/default.nix | 60 ++++ modules/home/wm/sway/binds.nix | 120 ++++---- modules/home/wm/sway/default.nix | 5 - modules/home/wm/sway/sets.nix | 31 +- modules/home/wm/terminals/default.nix | 7 - modules/home/wm/terminals/kitty/default.nix | 5 - modules/nixos/default.nix | 27 +- modules/nixos/hardware/default.nix | 10 - modules/nixos/hardware/disko/default.nix | 79 +++++ .../nixos/hardware/impermanence/default.nix | 85 ++---- modules/nixos/misc/default.nix | 14 - modules/nixos/programs/default.nix | 11 - modules/nixos/services/default.nix | 16 -- modules/nixos/{theme => themes}/default.nix | 0 modules/nixos/virt/default.nix | 1 - 75 files changed, 816 insertions(+), 1185 deletions(-) delete mode 100644 jetpure/host/parts/disko.nix create mode 100644 jetpure/host/parts/disks.nix delete mode 100644 modules/home/misc/default.nix delete mode 100644 modules/home/programs/cli/default.nix delete mode 100644 modules/home/programs/cli/helix/prettier.nix delete mode 100644 modules/home/programs/cli/yazi/starship.nix delete mode 100644 modules/home/programs/custom/ctree/default.nix delete mode 100644 modules/home/programs/custom/ctree/pkg.nix delete mode 100644 modules/home/programs/custom/default.nix delete mode 100644 modules/home/programs/custom/mabel/default.nix delete mode 100644 modules/home/programs/custom/mabel/pkg.nix delete mode 100644 modules/home/programs/custom/torrent/default.nix delete mode 100644 modules/home/programs/custom/torrent/pkg.nix delete mode 100644 modules/home/programs/default.nix delete mode 100644 modules/home/programs/gui/default.nix delete mode 100644 modules/home/programs/gui/floorp/user/default.nix delete mode 100644 modules/home/programs/gui/minecraft/portablemc.nix create mode 100644 modules/home/programs/gui/qutebrowser/binds.nix delete mode 100644 modules/home/shells/default.nix delete mode 100644 modules/home/shells/fish/functions.nix delete mode 100644 modules/home/shells/fish/misc/default.nix delete mode 100644 modules/home/shells/fish/misc/fish-helix.nix delete mode 100644 modules/home/themes/default.nix delete mode 100644 modules/home/wm/default.nix delete mode 100644 modules/home/wm/hyprland/plugins.nix delete mode 100644 modules/home/wm/misc/default.nix create mode 100644 modules/home/wm/misc/rofi/default.nix create mode 100644 modules/home/wm/misc/yofi/default.nix delete mode 100644 modules/home/wm/terminals/default.nix delete mode 100644 modules/nixos/hardware/default.nix create mode 100644 modules/nixos/hardware/disko/default.nix delete mode 100644 modules/nixos/misc/default.nix delete mode 100644 modules/nixos/programs/default.nix delete mode 100644 modules/nixos/services/default.nix rename modules/nixos/{theme => themes}/default.nix (100%) delete mode 100644 modules/nixos/virt/default.nix diff --git a/flake.lock b/flake.lock index 6945621..a094769 100644 --- a/flake.lock +++ b/flake.lock @@ -703,6 +703,21 @@ "type": "github" } }, + "impermanence": { + "locked": { + "lastModified": 1734200366, + "narHash": "sha256-0NursoP4BUdnc+wy+Mq3icHkXu/RgP1Sjo0MJxV2+Dw=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "c6323585fa0035d780e3d8906eb1b24b65d19a48", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, "nix-update": { "inputs": { "flake-parts": "flake-parts_2", @@ -905,6 +920,26 @@ "type": "github" } }, + "nypkgs": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726657437, + "narHash": "sha256-eBeVOFceQkYfWHAwdQ+aM8vLAbsuuWUgek2f6dFBTl0=", + "owner": "yunfachi", + "repo": "nypkgs", + "rev": "698ab4159dc38affee2fc5886468af139de8d95e", + "type": "github" + }, + "original": { + "owner": "yunfachi", + "repo": "nypkgs", + "type": "github" + } + }, "parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" @@ -978,10 +1013,12 @@ "hardware": "hardware", "home-manager": "home-manager", "hyprland": "hyprland", + "impermanence": "impermanence", "nixpkgs": "nixpkgs_3", "nixpkgsMaster": "nixpkgsMaster", "nixpkgsStable": "nixpkgsStable", "nur": "nur", + "nypkgs": "nypkgs", "parts": "parts", "phani": "phani", "spicetify": "spicetify", @@ -1315,11 +1352,11 @@ ] }, "locked": { - "lastModified": 1734232136, - "narHash": "sha256-rQd9jiPTGVchefiwJhx1xUlCLcnOCWQ7KlQ+Pkio9zU=", + "lastModified": 1734657663, + "narHash": "sha256-1Et05foPKYyWAHUftrrzWgfddnd0r0sm2WCuNeVDDkA=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "6acd5e9515e0d53347b7883ac02ac7ab4bd03a2c", + "rev": "f5181bde713d1aa5c8d95d00f4f47cd937d2b3e8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f592520..f0fb44d 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ nixpkgsMaster.url = "github:nixos/nixpkgs/master"; # MASTER nur.url = "github:nix-community/NUR"; # NUR + impermanence.url = "github:nix-community/impermanence"; # IMPERA hardware.url = "github:NixOS/nixos-hardware/master"; # HARDWARE parts.url = "github:hercules-ci/flake-parts"; # PARTS gaming.url = "github:fufexan/nix-gaming"; # GAMING @@ -22,6 +23,10 @@ url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; + nypkgs = { + url = "github:yunfachi/nypkgs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; zen = { # COOL BROWSER url = "github:0xc000022070/zen-browser-flake"; @@ -64,9 +69,14 @@ }; }; - outputs = inputs: + outputs = + inputs: inputs.parts.lib.mkFlake { inherit inputs; } { - perSystem = { pkgs, ... }: { formatter = pkgs.nixfmt-rfc-style; }; + perSystem = + { pkgs, ... }: + { + formatter = pkgs.nixfmt-rfc-style; + }; systems = [ "x86_64-linux" ]; # YOUR SYSTEM IDK imports = [ ./jetpure ]; # YOUR MACHINES }; diff --git a/jetpure/default.nix b/jetpure/default.nix index ca55002..9f8676c 100644 --- a/jetpure/default.nix +++ b/jetpure/default.nix @@ -3,10 +3,12 @@ let # CONFIGURATION X = import ../libx/builder.nix { inherit inputs lib; + disk = "/dev/disk/by-uuid/d8440438-2f95-4854-b139-bf0a3e91a81f"; # VARIABLES hostName = "jetpure"; userName = "nixzoid"; flakeDir = "/persist/flake"; + is = "desktop"; # SYS INFA plfrm = "x86_64-linux"; ver = "24.05"; diff --git a/jetpure/home/default.nix b/jetpure/home/default.nix index 334f92e..454ca8c 100644 --- a/jetpure/home/default.nix +++ b/jetpure/home/default.nix @@ -4,10 +4,7 @@ let inherit (x) False; in { - imports = [ - ./parts - ../../modules/home - ]; + imports = [ ./parts ]; module = { programs = { # PROGRAMS @@ -45,8 +42,6 @@ in }; custom = { anicli = True; - mabel = False; - torrent = False; }; }; shells = { @@ -76,7 +71,7 @@ in wm = { # WINDOW MANAGER hyprland = True; - sway = False; + sway = True; terminals = { # TERMINALS kitty = True; @@ -86,9 +81,11 @@ in misc = { # IDK mako = True; - waybar = False; nwg = True; + rofi = True; + waybar = False; wob = False; + yofi = False; }; }; misc = { diff --git a/jetpure/home/parts/sway.nix b/jetpure/home/parts/sway.nix index 8ed66d7..a2ab021 100644 --- a/jetpure/home/parts/sway.nix +++ b/jetpure/home/parts/sway.nix @@ -1,18 +1,18 @@ { x, config, ... }: +with x; let m = config.wayland.windowManager.sway.config.modifier; X = "exec"; - inherit (x) False; in { module.wm.sway = { - bars = False; programs = { - "${m}+b" = "${X} floorp"; + # PROGRAMS + "${m}+b" = "${X} qutebrowser"; "${m}+v" = "${X} telegram-desktop"; "${m}+n" = "${X} kitty -T Explorer yazi"; "${m}+u" = "${X} onlyoffice-desktopeditors"; - "${m}+i" = "${X} libreoffice"; + # "${m}+i" = "${X} libreoffice"; }; }; } diff --git a/jetpure/host/default.nix b/jetpure/host/default.nix index 1a95804..e09ade6 100644 --- a/jetpure/host/default.nix +++ b/jetpure/host/default.nix @@ -4,10 +4,7 @@ let inherit (x) False; in { - imports = [ - ./parts - ../../modules/nixos - ]; + imports = [ ./parts ]; module = { themes.stylix = True // { theme = "paradise"; @@ -22,6 +19,8 @@ in boot = True // { plymouth = True; }; + disko = True; + impermanence = False; network = True; security = True; }; diff --git a/jetpure/host/parts/default.nix b/jetpure/host/parts/default.nix index 2fc1eec..90faed0 100644 --- a/jetpure/host/parts/default.nix +++ b/jetpure/host/parts/default.nix @@ -1,10 +1,6 @@ -{ inputs, ... }: { - imports = with inputs; [ + imports = [ + ./disks.nix ./pkgs.nix - disko.nixosModules.default - (import ./disko.nix { - device = "/dev/by-id/ata-KINGSTON_SA400S37240G_50026B72828C9A2D"; - }) ]; } diff --git a/jetpure/host/parts/disko.nix b/jetpure/host/parts/disko.nix deleted file mode 100644 index bfad392..0000000 --- a/jetpure/host/parts/disko.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ - device ? throw, - ... -}: -{ - # sudo nix run nixpkgs#disko -- --mode disko ./disko.nix --arg device '"/dev/sdX"' - disko.devices.disk.main = { - inherit device; - type = "disk"; - content = { - type = "gpt"; - partitions = { - esp = { - name = "esp"; - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "umask=0077" - "fmask=0077" - "dmask=0077" - ]; - }; - }; - root = { - name = "nixos"; - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/rootfs".mountpoint = "/"; - "/home" = { - mountpoint = "/home"; - mountOptions = [ "compress=zstd:5" ]; - }; - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ - "compress=zstd:5" - "noatime" - ]; - }; - "/persist" = { - mountpoint = "/persist"; - mountOptions = [ - "compress=zstd:5" - "noatime" - ]; - }; - }; - }; - }; - }; - }; - }; - fileSystems = - let - fsType = "ext4"; - options = [ - "nosuid" - "nodev" - "nofail" - "x-gvfs-show" - ]; - in - { - "/mnt/HDD" = { - label = "BIG_BUCK"; - device = "/dev/disk/by-uuid/9290bc08-17fe-47db-a535-d4044b8c8dfb"; - inherit fsType options; - }; - "/mnt/SSD" = { - label = "FAST_BITCH"; - device = "/dev/disk/by-uuid/e6bc9034-95a4-43bd-b5f5-c7c1743e9f7c"; - inherit fsType options; - }; - }; -} diff --git a/jetpure/host/parts/disks.nix b/jetpure/host/parts/disks.nix new file mode 100644 index 0000000..5380627 --- /dev/null +++ b/jetpure/host/parts/disks.nix @@ -0,0 +1,24 @@ +{ + fileSystems = + let + fsType = "ext4"; + options = [ + "nosuid" + "nodev" + "nofail" + "x-gvfs-show" + ]; + in + { + "/mnt/HDD" = { + label = "BIG_BUCK"; + device = "/dev/disk/by-uuid/9290bc08-17fe-47db-a535-d4044b8c8dfb"; + inherit fsType options; + }; + "/mnt/SSD" = { + label = "FAST_BITCH"; + device = "/dev/disk/by-uuid/e6bc9034-95a4-43bd-b5f5-c7c1743e9f7c"; + inherit fsType options; + }; + }; +} diff --git a/libx/builder.nix b/libx/builder.nix index c68220f..a9a835e 100644 --- a/libx/builder.nix +++ b/libx/builder.nix @@ -2,12 +2,14 @@ inputs, lib, # VARIABLES + disk ? null, hostName ? "sus", userName ? "amogus", flakeDir ? null, + is ? null, # SYSINFO - plfrm, - ver, + plfrm ? "x86_64-linux", + ver ? "24.05", dev, ... }: @@ -17,14 +19,16 @@ # OTHER inherit (inputs.nixpkgs.lib) nixosSystem; inherit (inputs.home-manager.lib) homeManagerConfiguration; - pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + pkgs = inputs.nixpkgs.legacyPackages.${plfrm}; # NEEDS sec = import ./secrets.nix; - x = import ./options.nix { inherit lib; } // { + x = import ./options.nix { inherit inputs pkgs lib; } // { inherit + disk hostName userName flakeDir + is plfrm ver dev @@ -37,11 +41,17 @@ { # CONFIGURATION nixosConfigurations.${hostName} = nixosSystem { - modules = [ ../${hostName}/host ]; + modules = [ + ../modules/nixos + ../${hostName}/host + ]; specialArgs = args; }; homeConfigurations.${userName} = homeManagerConfiguration { - modules = [ ../${hostName}/home ]; + modules = [ + ../modules/home + ../${hostName}/home + ]; extraSpecialArgs = args; inherit pkgs; }; diff --git a/libx/options.nix b/libx/options.nix index e0b4ec2..1542f82 100644 --- a/libx/options.nix +++ b/libx/options.nix @@ -1,5 +1,9 @@ -{ lib, ... }: -with lib; +{ + inputs, + pkgs, + lib, + ... +}: let def = { default = false; @@ -8,8 +12,12 @@ let default = null; }; in -with types; -{ +with lib; +with lib.types; +rec { + # ylib + ypkgs = inputs.nypkgs.legacyPackages.${pkgs.system}; + umport = ypkgs.lib.umport; # enable = true; ++ enable = false; True = { enable = true; diff --git a/modules/home/default.nix b/modules/home/default.nix index ee0ca7e..12f0cfb 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,9 +1,21 @@ +{ x, ... }: { - imports = [ - ./misc - ./programs - ./shells - ./themes - ./wm - ]; + imports = x.umport { + paths = [ + ./misc + ./programs + ./shells + ./themes + ./wm + ]; + # include & exclude files/directories + include = [ + ./programs/custom/anicli/default.nix + ]; + exclude = [ + ./programs/gui/floorp/addons.nix + ./themes/stylix/image.nix + ./programs/custom + ]; + }; } diff --git a/modules/home/misc/default.nix b/modules/home/misc/default.nix deleted file mode 100644 index 9cee654..0000000 --- a/modules/home/misc/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - imports = [ - ./home-manager - ./minimal - ./xdg - ./dconf.nix - ./nix.nix - ]; -} diff --git a/modules/home/misc/xdg/default.nix b/modules/home/misc/xdg/default.nix index ac74989..ab34971 100644 --- a/modules/home/misc/xdg/default.nix +++ b/modules/home/misc/xdg/default.nix @@ -15,7 +15,6 @@ in mime.enable = mkBool; }; - imports = [ ./mimeApps.nix ]; config = { xdg = { mime = True; diff --git a/modules/home/programs/cli/default.nix b/modules/home/programs/cli/default.nix deleted file mode 100644 index c06356b..0000000 --- a/modules/home/programs/cli/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - imports = [ - ./bat - ./cava - ./eza - ./fetch - ./fzf - ./git - ./helix - ./joshuto - ./legendary - ./micro - ./rmpc - ./rustmission - ./top - ./yazi - ./zoxide - ./pkgs.nix - ]; -} diff --git a/modules/home/programs/cli/helix/binds.nix b/modules/home/programs/cli/helix/binds.nix index 261e480..020a339 100644 --- a/modules/home/programs/cli/helix/binds.nix +++ b/modules/home/programs/cli/helix/binds.nix @@ -1,4 +1,3 @@ -{ ... }: { programs.helix.settings.keys = { normal = { diff --git a/modules/home/programs/cli/helix/default.nix b/modules/home/programs/cli/helix/default.nix index 9d7f110..2e962e4 100644 --- a/modules/home/programs/cli/helix/default.nix +++ b/modules/home/programs/cli/helix/default.nix @@ -16,12 +16,6 @@ in }; }; - imports = [ - ./settings.nix - ./binds.nix - ./languages.nix - ./theme.nix - ]; config = mkIf cfg.enable { programs.helix = True // { defaultEditor = true; diff --git a/modules/home/programs/cli/helix/languages.nix b/modules/home/programs/cli/helix/languages.nix index 4c36564..8bc08bc 100644 --- a/modules/home/programs/cli/helix/languages.nix +++ b/modules/home/programs/cli/helix/languages.nix @@ -6,127 +6,169 @@ let unit = " "; }; auto-format = true; -in { +in +{ programs.helix = with pkgs; { languages = { - language = let prettier = nodePackages_latest.prettier; - in [ + language = + let + prettier = nodePackages_latest.prettier; + in + [ + { + # NIX LSP + inherit auto-format indent; + name = "nix"; + language-servers = [ + "nixd" + "nil" + ]; + formatter.command = "${getExe nixfmt-rfc-style}"; + } + { + # HTML + inherit auto-format indent; + name = "html"; + language-servers = [ "vscode-html" ]; + formatter = { + command = "${getExe prettier}"; + args = [ + "--use-tabs" + "--parser" + "html" + ]; + }; + } + { + # JSON + inherit auto-format indent; + name = "json"; + language-servers = [ "vscode-json" ]; + formatter = { + command = "${getExe prettier}"; + args = [ + "--use-tabs" + "--parser" + "json" + ]; + }; + } + { + # JSON + inherit auto-format indent; + name = "jsonc"; + language-servers = [ "vscode-json" ]; + formatter = { + command = "${getExe prettier}"; + args = [ + "--use-tabs" + "--parser" + "json" + ]; + }; + } + { + # CSS + inherit auto-format indent; + name = "css"; + language-servers = [ "vscode-css" ]; + formatter = { + command = "${getExe prettier}"; + args = [ + "--use-tabs" + "--parser" + "css" + ]; + }; + } + { + # MARKDOWN + inherit auto-format indent; + name = "markdown"; + language-servers = [ "marksman" ]; + formatter = { + command = "${getExe prettier}"; + args = [ + "--use-tabs" + "--parser" + "markdown" + ]; + }; + } + { + # TYPESCRIPT + inherit auto-format indent; + name = "typescript"; + language-servers = [ "typescript" ]; + formatter = { + command = "${getExe prettier}"; + args = [ + "--use-tabs" + "--parser" + "typescript" + ]; + }; + } + { + # PYTHON + inherit auto-format indent; + name = "python"; + language-servers = [ + "pylsp" + "ruff" + ]; + shebangs = [ "${getExe python39}" ]; + file-types = [ + "py" + "pyi" + "py3" + "pyw" + ".pythonstartup" + ".pythonrc" + ]; + roots = [ + "." + "pyproject.toml" + "pyrightconfig.json" + ]; + comment-token = "#"; + scope = "source.python"; + injection-regex = "python"; + formatter = { + command = "${getExe ruff}"; + args = [ + "format" + "-" + ]; + }; + } + ]; + language-server = + let + vscode = vscode-langservers-extracted; + typescript = typescript-language-server; + in { - # NIX LSP - name = "nix"; - language-servers = [ "nixd" "nil" ]; - formatter.command = "${getExe nixfmt-rfc-style}"; - indent = indent; - inherit auto-format; - } - { - # HTML - name = "html"; - language-servers = [ "vscode-html" ]; - indent = indent; - inherit auto-format; - formatter = { - command = "${prettier}/bin/prettier"; - args = [ "--use-tabs" "--parser" "html" ]; - }; - } - { - # JSON - name = "json"; - language-servers = [ "vscode-json" ]; - indent = indent; - inherit auto-format; - formatter = { - command = "${prettier}/bin/prettier"; - args = [ "--use-tabs" "--parser" "json" ]; - }; - } - { - # JSON - name = "jsonc"; - language-servers = [ "vscode-json" ]; - indent = indent; - inherit auto-format; - formatter = { - command = "${prettier}/bin/prettier"; - args = [ "--use-tabs" "--parser" "json" ]; - }; - } - { - # CSS - name = "css"; - language-servers = [ "vscode-css" ]; - indent = indent; - inherit auto-format; - formatter = { - command = "${prettier}/bin/prettier"; - args = [ "--use-tabs" "--parser" "css" ]; - }; - } - { - # MARKDOWN - name = "markdown"; - language-servers = [ "marksman" ]; - indent = indent; - inherit auto-format; - formatter = { - command = "${prettier}/bin/prettier"; - args = [ "--use-tabs" "--parser" "markdown" ]; - }; - } - { - # TYPESCRIPT - name = "typescript"; - language-servers = [ "typescript" ]; - indent = indent; - inherit auto-format; - formatter = { - command = "${prettier}/bin/prettier"; - args = [ "--use-tabs" "--parser" "typescript" ]; - }; - } - { - # PYTHON - name = "python"; - language-servers = [ "pylsp" "ruff" ]; - shebangs = [ "${python39}/bin/python" ]; - file-types = [ "py" "pyi" "py3" "pyw" ".pythonstartup" ".pythonrc" ]; - roots = [ "." "pyproject.toml" "pyrightconfig.json" ]; - comment-token = "#"; - scope = "source.python"; - injection-regex = "python"; - indent = indent; - inherit auto-format; - formatter = { - command = "${ruff}/bin/ruff"; - args = [ "format" "-" ]; - }; - } - ]; - language-server = let - vscode = vscode-langservers-extracted; - typescript = typescript-language-server; - in { - nil.command = "${nil}/bin/nil"; - nixd.command = "${nixd}/bin/nixd"; - typescript.command = "${typescript}/bin/typescript-language-server"; - vscode-html.command = "${vscode}/bin/vscode-html-language-server"; - vscode-json.command = "${vscode}/bin/vscode-json-language-server"; - vscode-css.command = "${vscode}/bin/vscode-css-language-server"; - marksman.command = "${marksman}/bin/marksman"; - ruff.command = "${ruff-lsp}/bin/ruff-lsp"; - pyright = { - command = "${pyright}/bin/pyright-langserver"; - args = [ "--stdio" ]; - config = { - reportMissingTypeStubs = false; - python.analysis = { - typeCheckingMode = "basic"; - autoImportCompletions = true; + nil.command = "${getExe nil}"; + nixd.command = "${getExe nixd}"; + typescript.command = "${getExe typescript}"; + vscode-html.command = "${vscode}/bin/vscode-html-language-server"; + vscode-json.command = "${vscode}/bin/vscode-json-language-server"; + vscode-css.command = "${vscode}/bin/vscode-css-language-server"; + marksman.command = "${getExe marksman}"; + ruff.command = "${getExe ruff-lsp}"; + pyright = { + command = "${getExe pyright}"; + args = [ "--stdio" ]; + config = { + reportMissingTypeStubs = false; + python.analysis = { + typeCheckingMode = "basic"; + autoImportCompletions = true; + }; }; }; }; - }; }; extraPackages = with pkgs; [ # OTHER LSP diff --git a/modules/home/programs/cli/helix/prettier.nix b/modules/home/programs/cli/helix/prettier.nix deleted file mode 100644 index 28c618c..0000000 --- a/modules/home/programs/cli/helix/prettier.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - fetchurl, - nodeEnv, - globalBuildInputs ? [ ], - ... -}: -let - sources = { - "@taplo/core-0.1.1" = { - name = "_at_taplo_slash_core"; - packageName = "@taplo/core"; - version = "0.1.1"; - src = fetchurl { - url = "https://registry.npmjs.org/@taplo/core/-/core-0.1.1.tgz"; - sha512 = "BG/zLGf5wiNXGEVPvUAAX/4ilB3PwDUY2o0MV0y47mZbDZ9ad9UK/cIQsILat3bqbPJsALVbU6k3cskNZ3vAQg=="; - }; - }; - "@taplo/lib-0.4.0-alpha.2" = { - name = "_at_taplo_slash_lib"; - packageName = "@taplo/lib"; - version = "0.4.0-alpha.2"; - src = fetchurl { - url = "https://registry.npmjs.org/@taplo/lib/-/lib-0.4.0-alpha.2.tgz"; - sha512 = "DV/Re3DPVY+BhBtLZ3dmP4mP6YMLSsgq9qGLXwOV38lvNF/fBlgvQswzlXmzCEefL/3q2eMoefZpOI/+GLuCNA=="; - }; - }; - "prettier-3.3.3" = { - name = "prettier"; - packageName = "prettier"; - version = "3.3.3"; - src = fetchurl { - url = "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz"; - sha512 = "i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew=="; - }; - }; - }; -in -{ - prettier-plugin-sh = nodeEnv.buildNodePackage { - name = "prettier-plugin-sh"; - packageName = "prettier-plugin-sh"; - version = "0.14.0"; - src = fetchurl { - url = "https://registry.npmjs.org/prettier-plugin-toml/-/prettier-plugin-toml-2.0.1.tgz"; - sha512 = "99z1YOkViECHtXQjGIigd3talI/ybUI1zB3yniAwUrlWBXupNXThB1hM6bwSMUEj2/+tomTlMtT98F5t4s8IWA=="; - }; - dependencies = [ - sources."@taplo/core-0.1.1" - sources."@taplo/lib-0.4.0-alpha.2" - sources."prettier-3.3.3" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "An opinionated `toml` formatter plugin for Prettier"; - homepage = "https://github.com/un-ts/prettier/tree/master/packages/prettier"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; -} diff --git a/modules/home/programs/cli/helix/settings.nix b/modules/home/programs/cli/helix/settings.nix index 1543d6e..c5050a2 100644 --- a/modules/home/programs/cli/helix/settings.nix +++ b/modules/home/programs/cli/helix/settings.nix @@ -1,4 +1,3 @@ -{ ... }: { programs.helix = { settings = { diff --git a/modules/home/programs/cli/joshuto/default.nix b/modules/home/programs/cli/joshuto/default.nix index 743c8be..a51669d 100644 --- a/modules/home/programs/cli/joshuto/default.nix +++ b/modules/home/programs/cli/joshuto/default.nix @@ -16,10 +16,5 @@ in }; }; - imports = [ - ./mimetype.nix - ./settings.nix - ./theme.nix - ]; config = mkIf cfg.enable { programs.joshuto = True; }; } diff --git a/modules/home/programs/cli/yazi/default.nix b/modules/home/programs/cli/yazi/default.nix index 85edcf8..2b8c596 100644 --- a/modules/home/programs/cli/yazi/default.nix +++ b/modules/home/programs/cli/yazi/default.nix @@ -16,13 +16,5 @@ in }; }; - imports = [ - ./sets.nix - ./binds.nix - ./theme.nix - ./lua.nix - ./plugins.nix - ./starship.nix - ]; config = mkIf cfg.enable { programs.yazi = True // { }; }; } diff --git a/modules/home/programs/cli/yazi/starship.nix b/modules/home/programs/cli/yazi/starship.nix deleted file mode 100644 index 28a939a..0000000 --- a/modules/home/programs/cli/yazi/starship.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ lib, config, ... }: -{ - xdg.configFile = { - "yazi/star.toml".text = '' - format = """ - $directory\ - $git_branch\ - $git_status\ - $git_metrics\ - """ - - [directory] - style = "bold fg:green" - format = "in [$path ]($style)" - truncation_length = 3 - truncation_symbol = "…/" - read_only = '[󰌾]' - read_only_style = 'bold fg:red' - - [git_branch] - style = "bold fg:yellow" - - [git_status] - style = "bold fg:red" - - [git_metrics] - added_style = "bold fg:blue" - deleted_style = "bold fg:red" - - [directory.substitutions] - "Documents" = "󰈙 " - "Downloads" = " " - "Music" = " " - "Pictures" = " " - ''; - }; -} diff --git a/modules/home/programs/custom/ctree/default.nix b/modules/home/programs/custom/ctree/default.nix deleted file mode 100644 index 6fc30fa..0000000 --- a/modules/home/programs/custom/ctree/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - x, - pkgs, - lib, - config, - ... -}: -with lib; -with x; -let - cfg = config.module.programs.custom.ctree; -in -{ - options = { - module.programs.custom.ctree = { - enable = mkBool; - }; - }; - - config = mkIf cfg.enable { home.packages = [ (pkgs.callPackage ./pkg.nix { }) ]; }; -} diff --git a/modules/home/programs/custom/ctree/pkg.nix b/modules/home/programs/custom/ctree/pkg.nix deleted file mode 100644 index 06695ec..0000000 --- a/modules/home/programs/custom/ctree/pkg.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - stdenv, - fetchurl, -}: -stdenv.mkDerivation rec { - pname = "ctree"; - version = "1.0.4"; - - src = fetchurl { - url = "https://github.com/gleich/ctree/releases/download/v${version}/ctree_${version}_linux_amd64.tar.gz"; - hash = "sha256-2gD6ESzpz9sMJx1iRL438lP4QR/PVCZ5vMqfkpG3e0E="; - }; - - # installPhase = '' - # mkdir -p $out/bin - # cp foo $out/bin - # ''; - - meta = with lib; { - homepage = "https://github.com/gleich/ctree"; - maintainers = with maintainers; [ azikx ]; - mainProgram = "ctree"; - }; -} diff --git a/modules/home/programs/custom/default.nix b/modules/home/programs/custom/default.nix deleted file mode 100644 index d4fbe51..0000000 --- a/modules/home/programs/custom/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - imports = [ - ./anicli - ./ctree - ./mabel - ./torrent - ]; -} diff --git a/modules/home/programs/custom/mabel/default.nix b/modules/home/programs/custom/mabel/default.nix deleted file mode 100644 index 3b4ab1d..0000000 --- a/modules/home/programs/custom/mabel/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - x, - pkgs, - lib, - config, - ... -}: -with lib; -with x; -let - cfg = config.module.programs.custom.mabel; -in -{ - options = { - module.programs.custom.mabel = { - enable = mkBool; - }; - }; - - config = mkIf cfg.enable { home.packages = [ (pkgs.callPackage ./pkg.nix { }) ]; }; -} diff --git a/modules/home/programs/custom/mabel/pkg.nix b/modules/home/programs/custom/mabel/pkg.nix deleted file mode 100644 index 81ec847..0000000 --- a/modules/home/programs/custom/mabel/pkg.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - buildGoModule, - fetchFromGitHub, -}: -buildGoModule rec { - pname = "mabel"; - version = "0.1.7"; - - src = fetchFromGitHub { - owner = "smmr-software"; - repo = "mabel"; - rev = "v${version}"; - hash = "sha256-KqZGwicWCi+9TLF4AwD3zL/Kz5C2a9iXAtcQYaswpWo="; - }; - - vendorHash = "sha256-xWOPiSX2cEmekd2k96O81qn3ygW1nU1MU4qL+JJN0AE="; - - meta = with lib; { - homepage = "https://github.com/smmr-software/mabel"; - changelog = "https://github.com/smmr-software/mabel/releases/tag/v${version}"; - maintainers = with maintainers; [ uwugda ]; - mainProgram = "mabel"; - }; -} diff --git a/modules/home/programs/custom/torrent/default.nix b/modules/home/programs/custom/torrent/default.nix deleted file mode 100644 index c859884..0000000 --- a/modules/home/programs/custom/torrent/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - x, - pkgs, - lib, - config, - ... -}: -with lib; -with x; -let - cfg = config.module.programs.custom.torrent; -in -{ - options = { - module.programs.custom.torrent = { - enable = mkBool; - }; - }; - - config = mkIf cfg.enable { home.packages = [ (pkgs.callPackage ./pkg.nix { }) ]; }; -} diff --git a/modules/home/programs/custom/torrent/pkg.nix b/modules/home/programs/custom/torrent/pkg.nix deleted file mode 100644 index 80e447a..0000000 --- a/modules/home/programs/custom/torrent/pkg.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ buildPythonPackage, fetchurl }: -buildPythonPackage { - pname = "tor2mag"; - version = "0.0.1"; - doCheck = false; - - src = fetchurl { - url = "https://raw.githubusercontent.com/repolho/torrent2magnet/refs/heads/master/torrent2magnet.py"; - sha256 = "sha256-sXMCx9dYg/JYQqbsDHBMJqRqT16WPbBj1O3+Hqxxhkc="; - }; -} diff --git a/modules/home/programs/default.nix b/modules/home/programs/default.nix deleted file mode 100644 index 5279dca..0000000 --- a/modules/home/programs/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./cli - ./custom - ./gui - ]; -} diff --git a/modules/home/programs/gui/default.nix b/modules/home/programs/gui/default.nix deleted file mode 100644 index a12614b..0000000 --- a/modules/home/programs/gui/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - imports = [ - ./floorp - ./minecraft - ./mpv - ./obs - ./qbittorrent - ./qutebrowser - ./spotify - ./swayimg - ./zed - ./pkgs.nix - ]; -} diff --git a/modules/home/programs/gui/floorp/default.nix b/modules/home/programs/gui/floorp/default.nix index d6a1f42..690ad1e 100644 --- a/modules/home/programs/gui/floorp/default.nix +++ b/modules/home/programs/gui/floorp/default.nix @@ -21,10 +21,6 @@ in }; }; - imports = [ - ./user - ./settings.nix - ]; config = mkIf cfg.enable { programs.floorp = True // { profiles.${userName} = { diff --git a/modules/home/programs/gui/floorp/user/default.nix b/modules/home/programs/gui/floorp/user/default.nix deleted file mode 100644 index ac048e0..0000000 --- a/modules/home/programs/gui/floorp/user/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./chrome.nix - ./tcr.nix - ]; -} diff --git a/modules/home/programs/gui/minecraft/portablemc.nix b/modules/home/programs/gui/minecraft/portablemc.nix deleted file mode 100644 index 4d384a5..0000000 --- a/modules/home/programs/gui/minecraft/portablemc.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - lib, - stdenv, - python3Packages, - fetchFromGitHub, - fetchurl, - installShellFiles, - libX11, - libXext, - libXcursor, - libXrandr, - libXxf86vm, - libpulseaudio, - libGL, - glfw, - openal, - udev, - flite, - java ? [ ], -}: -let - runtimeLibs = [ - libX11 - libXext - libXcursor - libXrandr - libXxf86vm - libpulseaudio - libGL - glfw - openal - (lib.getLib stdenv.cc.cc) - udev - ] ++ lib.optional flite; - patch = fetchurl { - url = "https://raw.githubusercontent.com/NixOS/nixpkgs/refs/heads/nixos-unstable/pkgs/by-name/po/portablemc/use-builtin-java.patch"; - hash = ""; - }; -in -python3Packages.buildPythonApplication rec { - pname = "portablemc"; - version = "4.4.0"; - pyproject = true; - disabled = python3Packages.pythonOlder "3.8"; - src = fetchFromGitHub { - owner = "mindstorm38"; - repo = "portablemc"; - rev = "refs/tags/v${version}"; - hash = "sha256-JDosvjbpoDC+xJ15ejcMJd+jA09RLR+whVZblMu+ljk="; - }; - patches = [ patch ]; - nativeBuildInputs = [ installShellFiles ]; - build-system = [ python3Packages.poetry-core ]; - dependencies = [ python3Packages.certifi ]; - postInstall = '' - installShellCompletion --cmd portablemc \ - --bash <($out/bin/portablemc show completion bash) \ - --zsh <($out/bin/portablemc show completion zsh) - ''; - preFixup = '' - makeWrapperArgs+=( - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath runtimeLibs} - --prefix PATH : ${lib.makeBinPath [ java ]} - ) - ''; - meta = { - mainProgram = "portablemc"; - maintainers = with lib.maintainers; [ - tomasajt - uwugda - ]; - }; -} diff --git a/modules/home/programs/gui/mpv/default.nix b/modules/home/programs/gui/mpv/default.nix index 1f89ab6..8ba21e2 100644 --- a/modules/home/programs/gui/mpv/default.nix +++ b/modules/home/programs/gui/mpv/default.nix @@ -17,10 +17,6 @@ in }; }; - imports = [ - ./bindings.nix - ./osc.nix - ]; config = mkIf cfg.enable { programs.mpv = True // { scripts = with pkgs.mpvScripts; [ diff --git a/modules/home/programs/gui/qutebrowser/binds.nix b/modules/home/programs/gui/qutebrowser/binds.nix new file mode 100644 index 0000000..4fea40a --- /dev/null +++ b/modules/home/programs/gui/qutebrowser/binds.nix @@ -0,0 +1,26 @@ +{ + x, + ... +}: +with x; +let + us = "spawn --userscript"; +in +{ + programs.qutebrowser = True // { + keyBindings = { + normal = { + xb = "config-cycle statusbar.show always never"; + xt = "config-cycle tabs.show always never"; + xx = "config-cycle statusbar.show always never;; config-cycle tabs.show always never"; + M = "hint links spawn mpv {hint-url}"; + # QUTE PASS + zz = "${us} qute-pass"; + zu = "${us} qute-pass --username-only"; + zp = "${us} qute-pass --password-only"; + # DOWNLOADS + sd = "${us} downloads"; + }; + }; + }; +} diff --git a/modules/home/programs/gui/qutebrowser/default.nix b/modules/home/programs/gui/qutebrowser/default.nix index ccf7f7c..bf96166 100644 --- a/modules/home/programs/gui/qutebrowser/default.nix +++ b/modules/home/programs/gui/qutebrowser/default.nix @@ -19,15 +19,13 @@ in }; config = mkIf cfg.enable { + home.packages = with pkgs; [ python312Packages.adblock ]; programs.qutebrowser = True // { - keyBindings = { - normal = { - xb = "config-cycle statusbar.show always never"; - xt = "config-cycle tabs.show always never"; - xx = "config-cycle statusbar.show always never;; config-cycle tabs.show always never"; - }; - }; settings = { + editor.command = [ + "hx" + "{file}" + ]; confirm_quit = [ "downloads" ]; scrolling = { bar = "overlay"; @@ -45,10 +43,13 @@ in ]; }; tabs = { + position = "top"; show = "switching"; tooltips = false; + max_width = 300; + min_width = 300; title = { - format = "{audio}{index}: {current_title}"; + format = "{index}: {current_title}"; format_pinned = "{index}"; }; }; @@ -60,7 +61,20 @@ in fg = frc "${base00}"; }; }; + fonts = with config.stylix.fonts; { + default_family = mkForce "${monospace.name}"; + }; content.blocking.enabled = true; + hints = { + scatter = false; + chars = "asdfghjkl"; + }; + }; + searchEngines = { + DEFAULT = "https://www.google.com/search?hl=en&q={}"; + nx = "https://wiki.nixos.org/index.php?search={}"; + g = "https://www.google.com/search?hl=en&q={}"; + d = "https://duckduckgo.com/?q={}"; }; greasemonkey = with pkgs; [ (fetchurl { diff --git a/modules/home/programs/gui/spotify/default.nix b/modules/home/programs/gui/spotify/default.nix index 96f617d..87f58c3 100644 --- a/modules/home/programs/gui/spotify/default.nix +++ b/modules/home/programs/gui/spotify/default.nix @@ -20,7 +20,7 @@ in }; }; - imports = [ inputs.spicetify.homeManagerModules.default ]; + imports = with inputs; [ spicetify.homeManagerModules.default ]; config = mkIf cfg.enable { programs.spicetify = True // { theme = spicePkgs.themes.sleek // { diff --git a/modules/home/programs/gui/swayimg/default.nix b/modules/home/programs/gui/swayimg/default.nix index 194c189..7384d14 100644 --- a/modules/home/programs/gui/swayimg/default.nix +++ b/modules/home/programs/gui/swayimg/default.nix @@ -23,157 +23,151 @@ in xdg.configFile = with config.lib.stylix.colors; { "swayimg/config".text = '' [general] - mode = viewer - position = parent - size = fullscreen - sigusr1 = reload - sigusr2 = next_file - app_id = swayimg + mode = viewer + position = parent + size = fullscreen + sigusr1 = reload + sigusr2 = next_file + app_id = swayimg [viewer] - window = #000000ff - transparency = grid - scale = optimal - fixed = yes - antialiasing = no - slideshow = no - slideshow_time = 3 - history = 1 - preload = 1 + window = #000000ff + transparency = grid + scale = optimal + fixed = yes + antialiasing = no + slideshow = no + slideshow_time = 3 + history = 1 + preload = 1 [gallery] - size = 200 - cache = 100 - fill = yes - antialiasing = yes - window = #${base00}ff - background = #${base01}ff - select = #${base02}ff - border = #${base0E}ff - shadow = #${base00}a0 + size = 200 + cache = 100 + fill = yes + antialiasing = yes + window = #${base00}ff + background = #${base01}ff + select = #${base02}ff + border = #${base0E}ff + shadow = #${base00}a0 [list] - order = alpha - loop = yes - recursive = no - all = yes + order = alpha + loop = yes + recursive = no + all = yes [font] - name = ${font.monospace.name} - size = 14 - color = #${base06}ff - shadow = #${base00}a0 + name = ${font.monospace.name} + size = 14 + color = #${base06}ff + shadow = #${base00}a0 [info] - show = yes - info_timeout = 5 - status_timeout = 3 + show = yes + info_timeout = 5 + status_timeout = 3 [info.viewer] - top_left = none - top_right = index - bottom_left = none - bottom_right = none + top_left = none + top_right = index + bottom_left = none + bottom_right = none [info.gallery] - top_left = none - top_right = index - bottom_left = none - bottom_right = none + top_left = none + top_right = index + bottom_left = none + bottom_right = none [keys.viewer] - F1 = help - Home = first_file - g = first_file - End = last_file - Shift+g = last_file - Prior = prev_file - Next = next_file - h = zoom +10 - j = next_file - k = prev_file - l = zoom -10 - Space = next_file - Shift+d = prev_dir - d = next_dir - Shift+o = prev_frame - o = next_frame - c = skip_file - Shift+s = slideshow - s = animation - f = fullscreen - Return = mode - Left = step_left 10 - Right = step_right 10 - Up = step_up 10 - Down = step_down 10 - Equal = zoom +10 - Plus = zoom +10 - Minus = zoom -10 - w = zoom width - Shift+w = zoom height - z = zoom fit - Shift+z = zoom fill - 0 = zoom real - BackSpace = zoom optimal - bracketleft = rotate_left - bracketright = rotate_right - m = flip_vertical - Shift+m = flip_horizontal - a = antialiasing - r = reload - i = info - Shift+Delete = exec rm "%"; skip_file - Escape = exit - q = exit - # Mouse related - ScrollLeft = step_right 5 - ScrollRight = step_left 5 - ScrollUp = step_up 5 - ScrollDown = step_down 5 - Ctrl+ScrollUp = zoom +10 - Ctrl+ScrollDown = zoom -10 - Shift+ScrollUp = prev_file - Shift+ScrollDown = next_file - Alt+ScrollUp = prev_frame - Alt+ScrollDown = next_frame + F1 = help + Home = first_file + g = first_file + End = last_file + Shift+g = last_file + Prior = prev_file + Next = next_file + h = zoom +10 + j = next_file + k = prev_file + l = zoom -10 + Space = next_file + Shift+d = prev_dir + d = next_dir + Shift+o = prev_frame + o = next_frame + c = skip_file + Shift+s = slideshow + s = animation + f = fullscreen + Return = mode + Left = step_left 10 + Right = step_right 10 + Up = step_up 10 + Down = step_down 10 + Equal = zoom +10 + Plus = zoom +10 + Minus = zoom -10 + w = zoom width + Shift+w = zoom height + z = zoom fit + Shift+z = zoom fill + 0 = zoom real + BackSpace = zoom optimal + bracketleft = rotate_left + bracketright = rotate_right + m = flip_vertical + Shift+m = flip_horizontal + a = antialiasing + r = reload + i = info + Shift+Delete = exec rm "%"; skip_file + Escape = exit + q = exit + # Mouse related + ScrollLeft = step_right 5 + ScrollRight = step_left 5 + ScrollUp = step_up 5 + ScrollDown = step_down 5 + Ctrl+ScrollUp = zoom +10 + Ctrl+ScrollDown = zoom -10 + Shift+ScrollUp = prev_file + Shift+ScrollDown = next_file + Alt+ScrollUp = prev_frame + Alt+ScrollDown = next_frame [keys.gallery] - F1 = help - - Home = first_file - g = first_file - - End = last_file - Shift+g = last_file - - Left = step_left - Right = step_right - Up = step_up - Down = step_down - - h = step_left - j = step_down - k = step_up - l = step_right - Prior = page_up - Next = page_down - - c = skip_file - f = fullscreen - Return = mode - a = antialiasing - r = reload - - i = info - Shift+Delete = exec rm "%"; skip_file - Escape = exit - q = exit - # Mouse related - ScrollLeft = step_right - ScrollRight = step_left - ScrollUp = step_up - ScrollDown = step_down + F1 = help + Home = first_file + g = first_file + End = last_file + Shift+g = last_file + Left = step_left + Right = step_right + Up = step_up + Down = step_down + h = step_left + j = step_down + k = step_up + l = step_right + Prior = page_up + Next = page_down + c = skip_file + f = fullscreen + Return = mode + a = antialiasing + r = reload + i = info + Shift+Delete = exec rm "%"; skip_file + Escape = exit + q = exit + # Mouse related + ScrollLeft = step_right + ScrollRight = step_left + ScrollUp = step_up + ScrollDown = step_down ''; }; }; diff --git a/modules/home/shells/default.nix b/modules/home/shells/default.nix deleted file mode 100644 index a747c72..0000000 --- a/modules/home/shells/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - imports = [ - ./bash - ./fish - ./nushell - ./tmux - ./zsh - ./abbrs.nix - ./alias.nix - ./starship.nix - ./var.nix - ]; -} diff --git a/modules/home/shells/fish/default.nix b/modules/home/shells/fish/default.nix index 6a26ce3..ef008bc 100644 --- a/modules/home/shells/fish/default.nix +++ b/modules/home/shells/fish/default.nix @@ -18,11 +18,6 @@ in }; }; - imports = [ - ./misc - ./colors.nix - ./plugins.nix - ]; config = mkIf cfg.enable { programs.fish = True // { package = pkgs.fish; diff --git a/modules/home/shells/fish/functions.nix b/modules/home/shells/fish/functions.nix deleted file mode 100644 index e80239c..0000000 --- a/modules/home/shells/fish/functions.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ x, ... }: -with x; -{ - programs.fish.functions = { - clone.body = '' - echo "cd ~/git/" - cd $HOME/git - git clone $argv && cd $(basename $argv .git) - ''; - # NIX - rebuild.body = '' - git add --all ${flakeDir}/. - for ARG in $argv - if [ $ARG = home ] - command nh home switch - return $status - else if [ $ARG = host ] - command sudo nh os switch - return $status - else - else if [ $ARG = both ] - command nh home switch - command sudo nh os switch - return $status - else - command echo "Select 'home' or 'host' os 'both'" - end - end - ''; - nrun.body = '' - nix run nixpkgs#$argv - ''; - nshell.body = '' - nix shell nixpkgs#$argv - ''; - nbuild.body = '' - nix build nixpkgs#$argv - ''; - nclean.body = '' - nix-env --delete-generations old - nix-store --gc - nix-collect-garbage -d - ''; - }; -} diff --git a/modules/home/shells/fish/misc/default.nix b/modules/home/shells/fish/misc/default.nix deleted file mode 100644 index 87931bf..0000000 --- a/modules/home/shells/fish/misc/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - # IDK - # ./fish-helix.nix - ]; -} diff --git a/modules/home/shells/fish/misc/fish-helix.nix b/modules/home/shells/fish/misc/fish-helix.nix deleted file mode 100644 index 3602d73..0000000 --- a/modules/home/shells/fish/misc/fish-helix.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ pkgs, ... }: -{ - xdg.configFile = - let - fun = "fish/functions"; - hx = pkgs.fetchFromSourcehut { - owner = "~neverness"; - repo = "fish_hx"; - rev = "main"; - sha256 = "sha256-57EWMjsUit8la6t62SVv5ocgY2EqrGx7sF2BjGWDw5Q="; - }; - count = "fish_bind_count.fish"; - cmd = "fish_helix_command.fish"; - binds = "fish_helix_key_bindings.fish"; - mode = "fish_default_mode_prompt.fish"; - in - { - "${fun}/${count}".source = "${hx}/${count}"; - "${fun}/${cmd}".source = "${hx}/${cmd}"; - "${fun}/${binds}".source = "${hx}/${binds}"; - "${fun}/${mode}".source = "${hx}/${mode}"; - }; - programs.fish.plugins = with pkgs.fishPlugins; [ - { - name = "tide"; - src = tide.src; - } - ]; -} diff --git a/modules/home/shells/zsh/default.nix b/modules/home/shells/zsh/default.nix index f9494a8..6412b9c 100644 --- a/modules/home/shells/zsh/default.nix +++ b/modules/home/shells/zsh/default.nix @@ -18,7 +18,6 @@ in }; }; - imports = [ ./plugins.nix ]; config = mkIf cfg.enable { programs.zsh = with pkgs; diff --git a/modules/home/themes/default.nix b/modules/home/themes/default.nix deleted file mode 100644 index c638f0d..0000000 --- a/modules/home/themes/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./gtk - ./qt - ./stylix - ]; -} diff --git a/modules/home/themes/qt/default.nix b/modules/home/themes/qt/default.nix index 29db936..f770f6a 100644 --- a/modules/home/themes/qt/default.nix +++ b/modules/home/themes/qt/default.nix @@ -16,11 +16,6 @@ in }; }; - imports = [ - ./qt5ct.nix - ./qt6ct.nix - ./color.nix - ]; config = mkIf cfg.enable { qt = True // { platformTheme.name = "qtct"; diff --git a/modules/home/themes/qt/qt5ct.nix b/modules/home/themes/qt/qt5ct.nix index 8130d86..4fef226 100644 --- a/modules/home/themes/qt/qt5ct.nix +++ b/modules/home/themes/qt/qt5ct.nix @@ -1,10 +1,11 @@ { pkgs, config, ... }: let font = config.stylix.fonts; + st = "${pkgs.libsForQt5.qt5ct}/share/qt5ct/qss"; in { xdg.configFile = { - "qt5ct/qt5ct.conf".text = with pkgs.libsForQt5; '' + "qt5ct/qt5ct.conf".text = '' [Appearance] color_scheme_path=${config.home.homeDirectory}/.config/qt5ct/colors/paradise.conf custom_palette=true @@ -24,13 +25,13 @@ in double_click_interval=400 gui_effects=@Invalid() keyboard_scheme=2 - menus_have_icons=true + menus_have_icons=false show_shortcuts_in_context_menus=true stylesheets=@Invalid() toolbutton_style=4 underline_shortcut=1 wheel_scroll_lines=3 - stylesheets=${qt5ct}/share/qt5ct/qss/scrollbar-simple.qss, ${qt5ct}/share/qt5ct/qss/sliders-simple.qss, ${qt5ct}/share/qt5ct/qss/tooltip-simple.qss, ${qt5ct}/share/qt5ct/qss/traynotification-simple.qss + stylesheets=${st}/fusion-fixes.qss, ${st}/scrollbar-simple.qss, ${st}/sliders-simple.qss, ${st}/tooltip-simple.qss, ${st}/traynotification-simple.qss [PaletteEditor] geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x2v\0\0\x2\x10\0\0\0\0\0\0\0\0\0\0\x2v\0\0\x2\x10\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x2v\0\0\x2\x10) diff --git a/modules/home/themes/qt/qt6ct.nix b/modules/home/themes/qt/qt6ct.nix index 37fd417..56a62d1 100644 --- a/modules/home/themes/qt/qt6ct.nix +++ b/modules/home/themes/qt/qt6ct.nix @@ -1,10 +1,11 @@ { pkgs, config, ... }: let font = config.stylix.fonts; + st = "${pkgs.qt6ct}/share/qt5ct/qss"; in { xdg.configFile = { - "qt6ct/qt6ct.conf".text = with pkgs; '' + "qt6ct/qt6ct.conf".text = '' [Appearance] color_scheme_path=${config.home.homeDirectory}/.config/qt6ct/colors/paradise.conf custom_palette=true @@ -24,13 +25,13 @@ in double_click_interval=400 gui_effects=@Invalid() keyboard_scheme=2 - menus_have_icons=true + menus_have_icons=false show_shortcuts_in_context_menus=true stylesheets=@Invalid() toolbutton_style=4 underline_shortcut=1 wheel_scroll_lines=3 - stylesheets=${qt6ct}/share/qt6ct/qss/scrollbar-simple.qss, ${qt6ct}/share/qt6ct/qss/sliders-simple.qss, ${qt6ct}/share/qt6ct/qss/tooltip-simple.qss, ${qt6ct}/share/qt6ct/qss/traynotification-simple.qss + stylesheets=${st}/fusion-fixes.qss, ${st}/scrollbar-simple.qss, ${st}/sliders-simple.qss, ${st}/tooltip-simple.qss, ${st}/traynotification-simple.qss [PaletteEditor] geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x2v\0\0\x2\x10\0\0\0\0\0\0\0\0\0\0\x2v\0\0\x2\x10\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x2v\0\0\x2\x10) diff --git a/modules/home/themes/stylix/default.nix b/modules/home/themes/stylix/default.nix index c9f0980..ec2a342 100644 --- a/modules/home/themes/stylix/default.nix +++ b/modules/home/themes/stylix/default.nix @@ -88,9 +88,13 @@ in # WM hyprland = True; sway = True; + river = True; + # MISC PROGRAMS foot = True; kitty = True; mako = False; + rofi = True; + bemenu = True; # TOOLS nixvim = True; yazi = True; @@ -98,6 +102,7 @@ in bat = True; mangohud = True; # GUI + spicetify = False; vesktop = True; qutebrowser = True; firefox = True; diff --git a/modules/home/themes/stylix/image.nix b/modules/home/themes/stylix/image.nix index 1de6a57..debc9cb 100644 --- a/modules/home/themes/stylix/image.nix +++ b/modules/home/themes/stylix/image.nix @@ -5,14 +5,11 @@ stylix = with pkgs; { image = let - img = - let - cfg = config.module.themes.stylix; - in - fetchurl { - url = cfg.image; - sha256 = cfg.hash; - }; + cfg = config.module.themes.stylix; + img = fetchurl { + url = cfg.image; + sha256 = cfg.hash; + }; in runCommand "output.png" { } '' ${lutgen}/bin/lutgen apply ${img} -o $out -- ${ diff --git a/modules/home/wm/default.nix b/modules/home/wm/default.nix deleted file mode 100644 index 45a14df..0000000 --- a/modules/home/wm/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - imports = [ - ./hyprland - ./misc - ./sway - ./terminals - ]; -} diff --git a/modules/home/wm/hyprland/binds.nix b/modules/home/wm/hyprland/binds.nix index 50a2126..b3e8733 100644 --- a/modules/home/wm/hyprland/binds.nix +++ b/modules/home/wm/hyprland/binds.nix @@ -1,10 +1,17 @@ -{ pkgs, config, ... }: +{ + pkgs, + lib, + config, + ... +}: +with lib; let cfg = config.module.wm.hyprland; mic = "fixf4=$(cat /sys/class/leds/platform::micmute/brightness); echo $((1-fixf4)) | doas tee /sys/class/leds/platform::micmute/brightness; wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; - workspaces = ( - builtins.concatLists ( - builtins.genList ( + workspaces = + with builtins; + (concatLists ( + genList ( i: let ws = i + 1; @@ -14,8 +21,7 @@ let "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" ] ) 10 - ) - ); + )); in { wayland.windowManager.hyprland.settings = { @@ -38,10 +44,10 @@ in "$ex" = "exec"; bind = - # KEYBOARD + with pkgs; [ # MENU - "$m, $tb, exec, ${pkgs.nwg-drawer}/bin/nwg-drawer -ovl -nocats -nofs -d -c 5 -mb -49" + "$m, $tb, exec, ${getExe nwg-drawer} -ovl -nocats -nofs -d -c 5 -mb -49" # BUILTIN COMMANDS "$m, $sp, togglefloating" @@ -71,7 +77,9 @@ in "$m, $nx, workspace, e+1" "$m, $pr, workspace, e-1" - ] ++ workspaces ++ cfg.programs; + ] + ++ workspaces + ++ cfg.programs; # HOLDING BUTTONS binde = diff --git a/modules/home/wm/hyprland/default.nix b/modules/home/wm/hyprland/default.nix index 65e7c93..3b2e056 100644 --- a/modules/home/wm/hyprland/default.nix +++ b/modules/home/wm/hyprland/default.nix @@ -20,11 +20,6 @@ in }; }; - imports = [ - ./binds.nix - ./rules.nix - ./sets.nix - ]; config = mkIf cfg.enable { wayland.windowManager.hyprland = True // { xwayland = True; diff --git a/modules/home/wm/hyprland/plugins.nix b/modules/home/wm/hyprland/plugins.nix deleted file mode 100644 index 7e6e433..0000000 --- a/modules/home/wm/hyprland/plugins.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ pkgs, ... }: -{ - wayland.windowManager.hyprland = { - plugins = with pkgs.hyprlandPlugins; [ hypr-dynamic-cursors ]; - settings.plugin = - let - dynamic-cursors = { - enabled = true; - mode = "stretch"; - threshold = 2; - stretch = { - limit = 3000; - function = "quadratic"; - }; - hyprcursor = { - nearest = false; - enabled = true; - resolution = "-1"; - fallback = "clientside"; - }; - }; - in - { - inherit dynamic-cursors; - }; - }; -} diff --git a/modules/home/wm/hyprland/sets.nix b/modules/home/wm/hyprland/sets.nix index 2c61aac..47ba606 100644 --- a/modules/home/wm/hyprland/sets.nix +++ b/modules/home/wm/hyprland/sets.nix @@ -9,6 +9,7 @@ in wayland.windowManager.hyprland = { settings = with config.lib.stylix.colors; { env = [ "SLURP_ARGS, -b ${base00}CC -c ${base0F}FF -B ${base02}CC" ]; + exec-once = cfg.autostart; monitor = let res = "1920x1080"; @@ -17,7 +18,6 @@ in trs = "0"; in "eDP-1, ${res}@${fps}, 0x0, ${scl}, transform, ${trs}"; - exec-once = cfg.autostart; # APPERANCE general = { @@ -88,7 +88,6 @@ in input = { kb_layout = "us,ru"; kb_options = "grp:caps_toggle"; - accel_profile = "adaptive"; touchpad = { natural_scroll = false; disable_while_typing = true; diff --git a/modules/home/wm/misc/default.nix b/modules/home/wm/misc/default.nix deleted file mode 100644 index 525ce68..0000000 --- a/modules/home/wm/misc/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - imports = [ - ./mako - ./nwg - ./waybar - ./wob - ]; -} diff --git a/modules/home/wm/misc/rofi/default.nix b/modules/home/wm/misc/rofi/default.nix new file mode 100644 index 0000000..1270550 --- /dev/null +++ b/modules/home/wm/misc/rofi/default.nix @@ -0,0 +1,35 @@ +{ + x, + pkgs, + lib, + config, + ... +}: +with lib; +with x; +let + cfg = config.module.wm.misc.rofi; +in +{ + options = { + module.wm.misc.rofi = { + enable = mkBool; + }; + }; + + config = mkIf cfg.enable { + programs.rofi = True // { + location = "bottom"; + terminal = "kitty"; + package = pkgs.rofi-wayland; + plugins = with pkgs; [ + rofi-file-browser + rofi-power-menu + rofi-screenshot + rofi-bluetooth + rofi-calc + rofimoji + ]; + }; + }; +} diff --git a/modules/home/wm/misc/waybar/default.nix b/modules/home/wm/misc/waybar/default.nix index aefacbf..456d9ad 100644 --- a/modules/home/wm/misc/waybar/default.nix +++ b/modules/home/wm/misc/waybar/default.nix @@ -16,7 +16,6 @@ in }; }; - imports = [ ./style.nix ]; config = mkIf cfg.enable { programs.waybar = with config.lib.stylix.colors; @@ -41,6 +40,19 @@ in "9" = "九"; "10" = "十"; }; + bat_icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + in { layer = "top"; @@ -165,9 +177,6 @@ in 5 6 7 - 8 - 9 - 10 ]; }; }; @@ -211,18 +220,7 @@ in format = "{capacity}% {icon}"; format-alt = "{time} {icon}"; format-charging = "{capacity}% 󱐋"; - format-icons = [ - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; + format-icons = bat_icons; states = { critical = 15; warning = 30; diff --git a/modules/home/wm/misc/yofi/default.nix b/modules/home/wm/misc/yofi/default.nix new file mode 100644 index 0000000..3b60636 --- /dev/null +++ b/modules/home/wm/misc/yofi/default.nix @@ -0,0 +1,60 @@ +{ + x, + pkgs, + lib, + config, + ... +}: +with lib; +with x; +let + cfg = config.module.wm.misc.yofi; + font = config.stylix.fonts; + icon = config.gtk.iconTheme.name; +in +{ + options = { + module.wm.misc.yofi = { + enable = mkBool; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ yofi ]; + xdg.configFile = with config.lib.stylix.colors; { + "yofi/yofi.config".text = '' + width = 500 + height = 300 + force_window = false + corner_radius = "32" + font = "${font.monospace.name}" + font_size = 24 + bg_color = 0x${base00}ff + bg_border_color = 0x${base0E}ff + bg_border_width = 4.0 + font_color = 0x${base0E}ff + + [input_text] + font_color = 0x${base0F}ff + bg_color = 0x${base01}ff + margin = "8" # equivalent to "5 5 5 5" + padding = "3 -4" # equivalent to "1.7 -4 1.7 -4" + corner_radius = "12" + + [list_items] + font_color = 0x${base0E}ff + selected_font_color = 0x${base0D}ff + match_color = 0x${base0A}ff + margin = "10 60" + hide_actions = true + action_left_margin = 60 + item_spacing = 2 + icon_spacing = 5 + + [icon] + theme = "${icon}" + size = 32 + ''; + }; + }; +} diff --git a/modules/home/wm/sway/binds.nix b/modules/home/wm/sway/binds.nix index 6ebeee1..144b7c9 100644 --- a/modules/home/wm/sway/binds.nix +++ b/modules/home/wm/sway/binds.nix @@ -8,7 +8,6 @@ let # MODIFIERS m = config.wayland.windowManager.sway.config.modifier; s = "Shift"; - c = "Ctrl"; a = "Alt"; # BUTTUONS rt = "Return"; @@ -24,76 +23,73 @@ let # PROGRAMS pic = "$(xdg-user-dir PICTURES)/$(date +'scr_%d-%m-%y|%H:%M:%S.png')"; in +with pkgs; { - wayland.windowManager.sway.config.keybindings = - with pkgs; - lib.mkForce { - # SWAY NATIVE CMD - "${m}+q" = "kill"; - "${m}+f" = "fullscreen"; - "${m}+${s}+f" = "move position center"; + wayland.windowManager.sway.config.keybindings = lib.mkForce { + # SWAY NATIVE CMD + "${m}+q" = "kill"; + "${m}+f" = "fullscreen"; + "${m}+${s}+f" = "move position center"; + "${m}+${sp}" = "floating toggle"; - "${m}+${sp}" = "floating toggle"; - "${m}+w" = "${ex} killall -SIGUSR1 waybar"; + # PROGRAMS + "${m}+w" = "${ex} killall -SIGUSR1 waybar"; + "${m}+${tb}" = "${ex} rofi"; + "Mod4+${rt}" = "${ex} kitty"; - # PROGRAMS - "${m}+${rt}" = "${ex} ${kitty}/bin/kitty"; - "${m}+${a}+${rt}" = "${ex} ${kitti3}/bin/kitti3"; + # SCREENSHOT + "${pr}" = "${grimblast}/bin/grimblast copysave area"; + "${pr}+${s}" = "${grimblast}/bin/grimblast copysave output ${pic}"; + "${pr}+${a}" = "${grimblast}/bin/grimblast copysave active ${pic}"; - "${m}+${tb}" = "${anyrun}/bin/anyrun"; + # CONTROL + "${m}+g" = "layout tabbed"; + "${m}+${s}+g" = "layout toggle split"; - "${pr}" = "${grimblast}/bin/grimblast copysave area"; - "${pr}+${s}" = "${grimblast}/bin/grimblast copysave output ${pic}"; - "${pr}+${a}" = "${grimblast}/bin/grimblast copysave active ${pic}"; + "${m}+p" = "move scratchpad"; + "${m}+${s}+p" = "scratchpad show"; - # CONTROL - "${m}+g" = "layout tabbed"; - "${m}+${s}+g" = "layout toggle split"; + "${m}+Home" = "exit"; + "${m}+${s}+Home" = "reload"; - "${m}+p" = "move scratchpad"; - "${m}+${s}+p" = "scratchpad show"; + # WORKSPACES SWITCH + "${m}+1" = "${ws} ${nm} 1"; + "${m}+2" = "${ws} ${nm} 2"; + "${m}+3" = "${ws} ${nm} 3"; + "${m}+4" = "${ws} ${nm} 4"; + "${m}+5" = "${ws} ${nm} 5"; + "${m}+6" = "${ws} ${nm} 6"; + "${m}+7" = "${ws} ${nm} 7"; + "${m}+8" = "${ws} ${nm} 8"; + "${m}+9" = "${ws} ${nm} 9"; + "${m}+0" = "${ws} ${nm} 10"; - "${m}+Home" = "exit"; - "${m}+${s}+Home" = "reload"; + # WORKSPACES MOVE + "${m}+${s}+1" = "${mv} ${cn} to ${ws} ${nm} 1"; + "${m}+${s}+2" = "${mv} ${cn} to ${ws} ${nm} 2"; + "${m}+${s}+3" = "${mv} ${cn} to ${ws} ${nm} 3"; + "${m}+${s}+4" = "${mv} ${cn} to ${ws} ${nm} 4"; + "${m}+${s}+5" = "${mv} ${cn} to ${ws} ${nm} 5"; + "${m}+${s}+6" = "${mv} ${cn} to ${ws} ${nm} 6"; + "${m}+${s}+7" = "${mv} ${cn} to ${ws} ${nm} 7"; + "${m}+${s}+8" = "${mv} ${cn} to ${ws} ${nm} 8"; + "${m}+${s}+9" = "${mv} ${cn} to ${ws} ${nm} 9"; + "${m}+${s}+0" = "${mv} ${cn} to ${ws} ${nm} 10"; - # WORKSPACES SWITCH - "${m}+1" = "${ws} ${nm} 1"; - "${m}+2" = "${ws} ${nm} 2"; - "${m}+3" = "${ws} ${nm} 3"; - "${m}+4" = "${ws} ${nm} 4"; - "${m}+5" = "${ws} ${nm} 5"; - "${m}+6" = "${ws} ${nm} 6"; - "${m}+7" = "${ws} ${nm} 7"; - "${m}+8" = "${ws} ${nm} 8"; - "${m}+9" = "${ws} ${nm} 9"; - "${m}+0" = "${ws} ${nm} 10"; + # HJKL + # "${m}+h" = "focus left"; + # "${m}+j" = "focus down"; + # "${m}+k" = "focus up"; + # "${m}+l" = "focus right"; - # WORKSPACES MOVE - "${m}+${s}+1" = "${mv} ${cn} to ${ws} ${nm} 1"; - "${m}+${s}+2" = "${mv} ${cn} to ${ws} ${nm} 2"; - "${m}+${s}+3" = "${mv} ${cn} to ${ws} ${nm} 3"; - "${m}+${s}+4" = "${mv} ${cn} to ${ws} ${nm} 4"; - "${m}+${s}+5" = "${mv} ${cn} to ${ws} ${nm} 5"; - "${m}+${s}+6" = "${mv} ${cn} to ${ws} ${nm} 6"; - "${m}+${s}+7" = "${mv} ${cn} to ${ws} ${nm} 7"; - "${m}+${s}+8" = "${mv} ${cn} to ${ws} ${nm} 8"; - "${m}+${s}+9" = "${mv} ${cn} to ${ws} ${nm} 9"; - "${m}+${s}+0" = "${mv} ${cn} to ${ws} ${nm} 10"; + "${m}+${s}+h" = "move left"; + "${m}+${s}+j" = "move down"; + "${m}+${s}+k" = "move up"; + "${m}+${s}+l" = "move right"; - # HJKL - "${m}+h" = "focus left"; - "${m}+j" = "focus down"; - "${m}+k" = "focus up"; - "${m}+l" = "focus right"; - - "${m}+${s}+h" = "move left"; - "${m}+${s}+j" = "move down"; - "${m}+${s}+k" = "move up"; - "${m}+${s}+l" = "move right"; - - "${m}+${a}+h" = "move workspace to output left"; - "${m}+${a}+j" = "move workspace to output down"; - "${m}+${a}+k" = "move workspace to output up"; - "${m}+${a}+l" = "move workspace to output right"; - }; + "${m}+${a}+h" = "move workspace to output left"; + "${m}+${a}+j" = "move workspace to output down"; + "${m}+${a}+k" = "move workspace to output up"; + "${m}+${a}+l" = "move workspace to output right"; + }; } diff --git a/modules/home/wm/sway/default.nix b/modules/home/wm/sway/default.nix index 189bead..64a574e 100644 --- a/modules/home/wm/sway/default.nix +++ b/modules/home/wm/sway/default.nix @@ -16,15 +16,10 @@ in enable = mkBool; binds.enable = mkBool; sets.enable = mkBool; - bars.enable = mkBool; programs = mkOpt.attrs.str; }; }; - imports = [ - ./binds.nix - ./sets.nix - ]; config = mkIf cfg.enable { wayland.windowManager.sway = True // { package = pkgs.swayfx; diff --git a/modules/home/wm/sway/sets.nix b/modules/home/wm/sway/sets.nix index 37f1e81..a05963d 100644 --- a/modules/home/wm/sway/sets.nix +++ b/modules/home/wm/sway/sets.nix @@ -6,36 +6,33 @@ }: with lib; let + mod = config.wayland.windowManager.sway.config.modifier; cfg = config.module.wm.sway; font = config.stylix.fonts; - border = 2; - titlebar = false; + win = { + border = 2; + titlebar = false; + }; in { config = mkMerge [ - (mkIf cfg.bars.enable { - wayland.windowManager.sway.config.bars = [ { command = "${waybar}/bin/waybar"; } ]; - }) (mkIf cfg.sets.enable { wayland.windowManager.sway = with config.lib.stylix.colors; { config = with pkgs; { # INPUTS + seat."*".hide_cursor = "1"; input."*" = { xkb_layout = "us,ru"; xkb_options = "grp:caps_toggle"; }; + # BARS + bars = [ ]; # AUTOSTART startup = [ { command = "${mako}/bin/mako"; } - { - command = "${autotiling-rs}/bin/autotiling-rs"; - always = true; - } + { command = "${autotiling-rs}/bin/autotiling-rs"; } ]; - bars = [ ]; - fonts = { - names = [ "${font.monospace.name}" ]; - }; + fonts.names = [ "${font.monospace.name}" ]; # MOVEMENT & BINDS modifier = "Mod4"; bindkeysToCode = true; @@ -47,13 +44,11 @@ in smartBorders = "on"; smartGaps = true; }; - window = { - inherit border titlebar; + window = win // { hideEdgeBorders = "smart"; }; - floating = with config.wayland.windowManager.sway.config; { - inherit border titlebar; - modifier = "${modifier}"; + floating = win // { + modifier = "${mod}"; }; # COLORS colors = lib.mkForce { diff --git a/modules/home/wm/terminals/default.nix b/modules/home/wm/terminals/default.nix deleted file mode 100644 index 2eacd9e..0000000 --- a/modules/home/wm/terminals/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./foot - ./kitty - ./wezterm - ]; -} diff --git a/modules/home/wm/terminals/kitty/default.nix b/modules/home/wm/terminals/kitty/default.nix index 9003d2a..eccb35f 100644 --- a/modules/home/wm/terminals/kitty/default.nix +++ b/modules/home/wm/terminals/kitty/default.nix @@ -16,10 +16,5 @@ in }; }; - imports = [ - ./sets.nix - ./binds.nix - ./colors.nix - ]; config = mkIf cfg.enable { programs.kitty = True // { }; }; } diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index b6f5447..75411eb 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,11 +1,20 @@ +{ x, ... }: { - imports = [ - ./base - ./hardware - ./misc - ./programs - ./services - ./theme - ./virt - ]; + imports = x.umport { + paths = [ + ./base + ./hardware + ./misc + ./programs + ./services + ./themes + ./virt + ]; + # include & exclude files/directories + include = [ ]; + exclude = [ + ./services/transmission/torque.nix + ./programs/torrserver/package.nix + ]; + }; } diff --git a/modules/nixos/hardware/default.nix b/modules/nixos/hardware/default.nix deleted file mode 100644 index 17772d6..0000000 --- a/modules/nixos/hardware/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - imports = [ - ./amd - ./bluetooth - ./boot - ./network - ./security - ./sound - ]; -} diff --git a/modules/nixos/hardware/disko/default.nix b/modules/nixos/hardware/disko/default.nix new file mode 100644 index 0000000..617cd66 --- /dev/null +++ b/modules/nixos/hardware/disko/default.nix @@ -0,0 +1,79 @@ +{ + x, + inputs, + lib, + config, + ... +}: +with lib; +with x; +let + cfg = config.module.hardware.disko; + device = "${disk}"; +in +{ + options = { + module.hardware.disko = { + enable = mkBool; + }; + }; + + imports = with inputs; [ + disko.nixosModules.default + ]; + config = mkIf cfg.enable { + disko.devices.disk.main = { + inherit device; + type = "disk"; + content = { + type = "gpt"; + partitions = { + esp = { + name = "esp"; + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + "fmask=0077" + "dmask=0077" + ]; + }; + }; + root = { + name = "nixos"; + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/rootfs".mountpoint = "/"; + "/home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd:5" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd:5" + "noatime" + ]; + }; + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ + "compress=zstd:5" + "noatime" + ]; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/nixos/hardware/impermanence/default.nix b/modules/nixos/hardware/impermanence/default.nix index ff14f9c..1e7be15 100644 --- a/modules/nixos/hardware/impermanence/default.nix +++ b/modules/nixos/hardware/impermanence/default.nix @@ -17,62 +17,39 @@ in }; }; - imports = [ inputs.impermanence.nixosModules.impermanence ]; + imports = with inputs; [ impermanence.nixosModules.impermanence ]; config = mkIf cfg.enable { - programs.fuse.userAllowOther = true; - environment.persistence."/persistent" = { - enable = true; # NB: Defaults to true, not needed - hideMounts = true; - directories = [ - "/var/log" - "/var/lib/bluetooth" - "/var/lib/nixos" - "/var/lib/systemd/coredump" - "/etc/NetworkManager/system-connections" - { - directory = "/var/lib/colord"; - user = "colord"; - group = "colord"; - mode = "u=rwx,g=rx,o="; + boot.initrd.systemd.services.rollback = { + description = "Rollback BTRFS root subvolume to a pristine state"; + unitConfig.DefaultDependencies = "no"; + serviceConfig.Type = "oneshot"; + wantedBy = [ "initrd.target" ]; + after = [ "systemd-cryptsetup@crypted.service" ]; + before = [ "sysroot.mount" ]; + script = '' + mkdir -p /btrfs_tmp + mount ${disk} /btrfs_tmp + if [[ -e /btrfs_tmp/root ]]; then + mkdir -p /btrfs_tmp/old_roots + timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") + mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" + fi + + delete_subvolume_recursively() { + IFS=$'\n' + for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do + delete_subvolume_recursively "/btrfs_tmp/$i" + done + btrfs subvolume delete "$1" } - ]; - files = [ - "/etc/machine-id" - { - file = "/var/keys/secret_file"; - parentDirectory = { - mode = "u=rwx,g=,o="; - }; - } - ]; - users.talyz = { - directories = [ - "Downloads" - "Music" - "Pictures" - "Documents" - "Videos" - "VirtualBox VMs" - { - directory = ".gnupg"; - mode = "0700"; - } - { - directory = ".ssh"; - mode = "0700"; - } - { - directory = ".nixops"; - mode = "0700"; - } - { - directory = ".local/share/keyrings"; - mode = "0700"; - } - ".local/share/direnv" - ]; - files = [ ".screenrc" ]; - }; + + for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do + delete_subvolume_recursively "$i" + done + + btrfs subvolume create /btrfs_tmp/root + umount /btrfs_tmp + ''; }; }; } diff --git a/modules/nixos/misc/default.nix b/modules/nixos/misc/default.nix deleted file mode 100644 index 1043f9e..0000000 --- a/modules/nixos/misc/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - imports = [ - ./console - ./locales - ./minimal - ./power - ./protonmail - ./system76 - ./terraria - ./users - ./variables - ./nix.nix - ]; -} diff --git a/modules/nixos/programs/default.nix b/modules/nixos/programs/default.nix deleted file mode 100644 index f42dbd7..0000000 --- a/modules/nixos/programs/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - imports = [ - ./common - ./hamachi - ./hyprland - ./steam - ./sway - ./torrserver - ./winapps - ]; -} diff --git a/modules/nixos/services/default.nix b/modules/nixos/services/default.nix deleted file mode 100644 index f26e342..0000000 --- a/modules/nixos/services/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - imports = [ - ./autocpu - ./dbus - ./deluge - ./getty - ./gvfs - ./polkit - ./printing - ./tailscale - ./tlp - ./transmission - ./zapret - ./zram - ]; -} diff --git a/modules/nixos/theme/default.nix b/modules/nixos/themes/default.nix similarity index 100% rename from modules/nixos/theme/default.nix rename to modules/nixos/themes/default.nix diff --git a/modules/nixos/virt/default.nix b/modules/nixos/virt/default.nix deleted file mode 100644 index 17c1e02..0000000 --- a/modules/nixos/virt/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ imports = [ ./podman ]; }