diff options
author | Freya Murphy <freya@freyacat.org> | 2025-09-17 22:07:16 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-09-17 22:07:16 -0400 |
commit | 68d03fe362b7e0df11662d8d6a1e01eac0bfae77 (patch) | |
tree | a76abd05f662f73b4083ddb0d8bf0d72c29e5a74 | |
parent | update commits (diff) | |
download | dotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.tar.gz dotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.tar.bz2 dotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.zip |
refactor: remove modules folder, fully split home and system modules
93 files changed, 2236 insertions, 2229 deletions
@@ -59,9 +59,9 @@ outputs = { self, nixpkgs, + home-manager, ... } @ inputs: let - options = import ./options.nix; systems = ["x86_64-linux"]; perSystem = func: builtins.listToAttrs (map ( @@ -73,41 +73,55 @@ } ) systems); - buildSystem = file: system: - inputs.nixpkgs.lib.nixosSystem { + mkSystem = file: system: + nixpkgs.lib.nixosSystem { inherit system; - specialArgs = {inherit self inputs system;}; + specialArgs = {inherit inputs;}; modules = [ - options - ./home - ./modules ./system + ./options.nix file ]; }; + mkHome = file: system: let + hostModule = mkSystem file system; + in + home-manager.lib.homeManagerConfiguration { + inherit (hostModule) pkgs; + extraSpecialArgs = {inherit inputs;}; + modules = [ + ./home + ./options.nix + (self.lib.customConfig hostModule.config) + { + nixpkgs.config.allowUnfree = true; + } + ]; + }; in rec { nixosConfigurations = { - shinji = buildSystem ./hosts/shinji "x86_64-linux"; - kaworu = buildSystem ./hosts/kaworu "x86_64-linux"; - thinkpad = buildSystem ./hosts/thinkpad "x86_64-linux"; - wsl = buildSystem ./hosts/wsl "x86_64-linux"; + shinji = mkSystem ./hosts/shinji "x86_64-linux"; + kaworu = mkSystem ./hosts/kaworu "x86_64-linux"; + thinkpad = mkSystem ./hosts/thinkpad "x86_64-linux"; + wsl = mkSystem ./hosts/wsl "x86_64-linux"; }; homeConfigurations = { - shinji = nixosConfigurations.shinji.config.home-manager.users.${options.user}.home; - kaworu = nixosConfigurations.kaworu.config.home-manager.users.${options.user}.home; - thinkpad = nixosConfigurations.thinkpad.config.home-manager.users.${options.user}.home; + shinji = mkHome ./hosts/shinji "x86_64-linux"; + kaworu = mkHome ./hosts/kaworu "x86_64-linux"; + thinkpad = mkHome ./hosts/thinkpad "x86_64-linux"; + wsl = mkHome ./hosts/wsl "x86_64-linux"; }; lib = import ./lib { - inherit inputs options; + inherit inputs; inherit (nixpkgs) lib; }; packages = perSystem ( pkgs: system: import ./pkgs { - inherit pkgs inputs system options; + inherit pkgs inputs system; inherit (nixpkgs) lib; } ); diff --git a/home/apps/alacritty.nix b/home/apps/alacritty.nix new file mode 100644 index 0000000..5c47f65 --- /dev/null +++ b/home/apps/alacritty.nix @@ -0,0 +1,97 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps.alacritty; +in { + config = mkIf cfg.enable { + default.terminal = lib.mkDefault "alacritty"; + + programs.alacritty = { + enable = true; + + settings = { + # Font + font = { + size = 11; + bold = { + style = "Bold"; + }; + bold_italic = { + style = "Bold Italic"; + }; + italic = { + style = "Italic"; + }; + normal = { + family = config.theme.font.monospace; + style = "Regular"; + }; + offset = { + x = 0; + y = 0; + }; + }; + + # Window + window = { + decorations = "full"; + dynamic_title = true; + padding = { + x = config.theme.outerGap; + y = config.theme.outerGap; + }; + opacity = config.theme.opacity; + }; + + # Colors + colors = { + normal = lib.attrsets.mapAttrs (name: color: "${color}") { + inherit + (config.theme.colors.normal) + black + red + green + yellow + blue + magenta + cyan + white + ; + }; + + bright = lib.attrsets.mapAttrs (name: color: "${color}") { + inherit + (config.theme.colors.bright) + black + red + green + yellow + blue + magenta + cyan + white + ; + }; + + cursor = { + background = "CellForeground"; + text = "CellBackground"; + }; + + selection = { + background = "CellForeground"; + text = "CellBackground"; + }; + + primary = { + foreground = "#${config.theme.colors.text}"; + background = "#${config.theme.colors.base}"; + }; + }; + }; + }; + }; +} diff --git a/home/apps/astal.nix b/home/apps/astal.nix new file mode 100644 index 0000000..0427e61 --- /dev/null +++ b/home/apps/astal.nix @@ -0,0 +1,39 @@ +{ + lib, + config, + pkgs, + inputs, + ... +}: let + astal = inputs.self.packages.${pkgs.system}; + inherit (lib) mkIf; + cfg = config.apps.astal; +in { + config = mkIf cfg.enable { + default.appLauncher = lib.mkDefault "astal-launcher"; + + home.packages = [ + astal.astal.shell + astal.astal.launcher + ]; + + systemd.user.services.astal = { + Install = { + WantedBy = [config.default.session "tray.target"]; + }; + + Unit = { + ConditionEnvironment = "WAYLAND_DISPLAY"; + Description = "astal"; + After = [config.default.session]; + PartOf = [config.default.session "tray.target"]; + }; + + Service = { + ExecStart = "${astal.astal.shell}/bin/astal-shell"; + Restart = "always"; + RestartSec = "10"; + }; + }; + }; +} diff --git a/home/apps/default.nix b/home/apps/default.nix new file mode 100644 index 0000000..d755a12 --- /dev/null +++ b/home/apps/default.nix @@ -0,0 +1,13 @@ +{lib, ...}: let + inherit (lib) mkEnableOption; +in { + imports = [ + ./waybar + ./wofi + ./alacritty.nix + ./astal.nix + ./hyprlock.nix + ./kitty.nix + ./mako.nix + ]; +} diff --git a/home/apps/hyprlock.nix b/home/apps/hyprlock.nix new file mode 100644 index 0000000..6a0119f --- /dev/null +++ b/home/apps/hyprlock.nix @@ -0,0 +1,104 @@ +{ + config, + lib, + ... +}: let + text = "rgb(${config.theme.colors.text})"; + base = "rgb(${config.theme.colors.base})"; + error = "rgb(${config.theme.colors.error})"; + trans = "rgba(0,0,0,0)"; + + inherit (lib) mkIf optionals; + cfg = config.apps.hyprlock; +in { + config = mkIf cfg.enable { + default.lockScreen = lib.mkDefault "hyprlock"; + + programs.hyprlock = { + enable = true; + + settings = { + auth = { + "pam:enabled" = true; + "fingerprint:enabled" = config.fingerprint; + }; + + animations = { + enabled = true; + animation = [ + "fadeIn, 0" + "fadeOut, 0" + ]; + }; + + background = { + path = config.theme.lockscreen; + color = base; + blur_passes = 0; + blur_size = 2; + noise = 0; + contrast = 0; + brightness = 0; + vibrancy = 0; + vibrancy_darkness = 0.0; + }; + + # Password Input + input-field = { + size = "300, 50"; + outline_thickness = 0; + dots_size = 0.25; + dots_spacing = 0.55; + dots_center = true; + dots_rounding = -1; + outer_color = trans; + inner_color = trans; + font_color = text; + fade_on_empty = false; + placeholder_text = + "Enter Password" + + ( + if config.fingerprint + then " or Touch Fingerprint" + else "" + ); + hide_input = false; + check_color = error; + fail_color = error; + capslock_color = trans; + numlock_color = trans; + bothlock_color = trans; + invert_numlock = false; + swap_font_color = false; + font_family = config.theme.font.regular; + position = "0, 50"; + halign = "center"; + valign = "bottom"; + }; + + label = [ + # Date + { + text = "cmd[update:1000] echo \"$(date +\"%A, %B %d\")\""; + color = text; + font_size = 20; + font_family = config.theme.font.header; + position = "0, -100"; + halign = "center"; + valign = "top"; + } + # Clock + { + text = "cmd[update:1000] echo \"$(date +\"%k:%M:%S\")\""; + color = text; + font_size = 90; + font_family = config.theme.font.header; + position = "0, -130"; + halign = "center"; + valign = "top"; + } + ]; + }; + }; + }; +} diff --git a/home/apps/kitty.nix b/home/apps/kitty.nix new file mode 100644 index 0000000..4253446 --- /dev/null +++ b/home/apps/kitty.nix @@ -0,0 +1,79 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps.kitty; +in { + config = mkIf cfg.enable { + default.terminal = lib.mkDefault "kitty"; + + programs.kitty = { + enable = true; + environment = {}; + extraConfig = ""; + + settings = { + # Font + font_family = config.theme.font.monospace; + font_size = 11; + bold_font = "auto"; + italic_font = "auto"; + bold_italic_font = "auto"; + + # Scrollback + scrollback_lines = 10000; + scrollback_pager_history_size = 300; # MB + + # Urls + detect_urls = true; + show_hyperlink_targets = false; + + # Window + window_padding_width = config.theme.outerGap; + window_border_width = 0; + draw_minimal_borders = true; + background_opacity = config.theme.opacity; + + # Disable audio + enable_audio_bell = false; + + # Disable close prompt + confirm_os_window_close = 0; + + # selection + selection_background = "#${config.theme.colors.surface}"; + selection_foreground = "none"; + + # cursor + url_color = "#${config.theme.colors.bright.yellow}"; + cursor = "#${config.theme.colors.text}"; + + # colors + background = "#${config.theme.colors.base}"; + foreground = "#${config.theme.colors.text}"; + + # normal + color0 = "#${config.theme.colors.normal.black}"; + color1 = "#${config.theme.colors.normal.red}"; + color2 = "#${config.theme.colors.normal.green}"; + color3 = "#${config.theme.colors.normal.yellow}"; + color4 = "#${config.theme.colors.normal.blue}"; + color5 = "#${config.theme.colors.normal.magenta}"; + color6 = "#${config.theme.colors.normal.cyan}"; + color7 = "#${config.theme.colors.normal.white}"; + + # bright + color8 = "#${config.theme.colors.bright.black}"; + color9 = "#${config.theme.colors.bright.red}"; + color10 = "#${config.theme.colors.bright.green}"; + color11 = "#${config.theme.colors.bright.yellow}"; + color12 = "#${config.theme.colors.bright.blue}"; + color13 = "#${config.theme.colors.bright.magenta}"; + color14 = "#${config.theme.colors.bright.cyan}"; + color15 = "#${config.theme.colors.bright.white}"; + }; + }; + }; +} diff --git a/home/apps/mako.nix b/home/apps/mako.nix new file mode 100644 index 0000000..52e7762 --- /dev/null +++ b/home/apps/mako.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps.mako; +in { + config = mkIf cfg.enable { + services.mako = { + enable = false; # now using astal + + settings = { + font = "${config.theme.font.monospace} 11"; + + margin = toString config.theme.outerGap; + padding = toString config.theme.innerGap; + + background-color = "#${config.theme.colors.base}"; + progress-color = "#${config.theme.colors.primary}"; + text-color = "#${config.theme.colors.text}"; + + border-color = "#${config.theme.colors.text}"; + border-size = config.theme.borderWidth; + border-radius = config.theme.outerRadius; + + default-timeout = 5000; + layer = "overlay"; + icons = true; + }; + }; + }; +} diff --git a/home/apps/waybar/default.nix b/home/apps/waybar/default.nix new file mode 100644 index 0000000..25acb8f --- /dev/null +++ b/home/apps/waybar/default.nix @@ -0,0 +1,85 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps.waybar; +in { + config = mkIf cfg.enable { + programs.waybar = { + enable = true; + + settings = [ + { + height = 24; + layer = "top"; + position = "top"; + spacing = 4; + + modules-left = [ + "hyprland/workspaces" + ]; + modules-center = [ + "clock" + ]; + modules-right = [ + "battery" + "wireplumber" + "network" + "tray" + ]; + + "hyprland/workspaces" = { + disable-scroll = true; + all-outputs = true; + format = "{name}"; + }; + + battery = { + interval = 1; + states = { + warning = 30; + critical = 15; + }; + format = " {capacity}%"; + format-charging = " {capacity}%"; + format-plugged = " {capacity}%"; + format-full = " {capacity}%"; + format-warning = " {capacity}%"; + format-critical = " {capacity}%"; + }; + + wireplumber = { + format = " {volume}%"; + format-bluetooth = " {volume}%"; + format-muted = " muted"; + scroll-step = 1; + on-click = "pavucontrol"; + ignored-sinks = ["Easy Effects Sink"]; + }; + + network = { + format = " disconnected"; + format-wifi = " {essid}"; + format-ethernet = " {ipaddr}/{cidr}"; + format-disconnected = " disconnected"; + max-length = 50; + on-click = "nm-connection-editor"; + }; + + clock = { + interval = 1; + format = "{:%Y-%m-%d %a %H:%M:%S}"; + }; + + tray = { + spacing = config.theme.outerGap; + }; + } + ]; + + style = import ./style.nix {theme = config.theme;}; + }; + }; +} diff --git a/modules/apps/waybar/style.nix b/home/apps/waybar/style.nix index 21a8de5..21a8de5 100644 --- a/modules/apps/waybar/style.nix +++ b/home/apps/waybar/style.nix diff --git a/home/apps/wofi/default.nix b/home/apps/wofi/default.nix new file mode 100644 index 0000000..2de9f45 --- /dev/null +++ b/home/apps/wofi/default.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps.wofi; +in { + config = mkIf cfg.enable { + default.appLauncher = lib.mkDefault "wofi --show drun --prompt 'Seach Programs'"; + + programs.wofi = { + enable = true; + + settings = { + key_expand = "Tab"; + term = "kitty"; + matching = "multi-contains"; + insensitive = true; + gtk_dark = true; + hide_scroll = true; + }; + + style = import ./style.nix {theme = config.theme;}; + }; + }; +} diff --git a/modules/apps/wofi/style.nix b/home/apps/wofi/style.nix index 75a0a21..75a0a21 100644 --- a/modules/apps/wofi/style.nix +++ b/home/apps/wofi/style.nix diff --git a/home/browsers/default.nix b/home/browsers/default.nix new file mode 100644 index 0000000..dc74460 --- /dev/null +++ b/home/browsers/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./firefox + ./zen.nix + ]; +} diff --git a/home/browsers/firefox/default.nix b/home/browsers/firefox/default.nix new file mode 100644 index 0000000..608d4c5 --- /dev/null +++ b/home/browsers/firefox/default.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + pkgs, + ... +}: let + extraPrefs = lib.fileContents ./mozilla.cfg; + userChrome = lib.fileContents ./userChrome.css; + my-firefox = pkgs.firefox.override { + extraPrefs = extraPrefs; + }; + + inherit (lib) mkIf; + cfg = config.browsers.firefox; +in { + config = mkIf cfg.enable { + default.browser = lib.mkDefault "firefox"; + + programs.firefox = { + enable = true; + package = my-firefox; + + # import configuration + policies = import ./policies.nix; + + # create profile for me :3 + profiles.${config.user} = { + search = { + force = true; + default = "ddg"; + }; + + userChrome = userChrome; + }; + }; + }; +} diff --git a/modules/browsers/firefox/extensions.nix b/home/browsers/firefox/extensions.nix index e8d6e2c..e8d6e2c 100644 --- a/modules/browsers/firefox/extensions.nix +++ b/home/browsers/firefox/extensions.nix diff --git a/modules/browsers/firefox/mozilla.cfg b/home/browsers/firefox/mozilla.cfg index 5e2334e..5e2334e 100644 --- a/modules/browsers/firefox/mozilla.cfg +++ b/home/browsers/firefox/mozilla.cfg diff --git a/modules/browsers/firefox/policies.nix b/home/browsers/firefox/policies.nix index 243cd9a..243cd9a 100644 --- a/modules/browsers/firefox/policies.nix +++ b/home/browsers/firefox/policies.nix diff --git a/modules/browsers/firefox/prefs.nix b/home/browsers/firefox/prefs.nix index 73d2781..73d2781 100644 --- a/modules/browsers/firefox/prefs.nix +++ b/home/browsers/firefox/prefs.nix diff --git a/modules/browsers/firefox/userChrome.css b/home/browsers/firefox/userChrome.css index e630632..e630632 100644 --- a/modules/browsers/firefox/userChrome.css +++ b/home/browsers/firefox/userChrome.css diff --git a/home/browsers/zen.nix b/home/browsers/zen.nix new file mode 100644 index 0000000..3797a64 --- /dev/null +++ b/home/browsers/zen.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + inputs, + ... +}: let + inherit (lib) mkIf; + cfg = config.browsers.zen; +in { + #imports = [ + # inputs.zen-browser.homeModules.default + #]; + + #config = mkIf cfg.enable { + # default.browser = lib.mkDefault "zen"; + + # programs.zen-browser = { + # enable = true; + + # # import configuration + # policies = import ./firefox/policies.nix; + + # # create profile for me :3 + # profiles.${config.user} = { + # search = { + # force = true; + # default = "ddg"; + # }; + # }; + # }; + #}; +} diff --git a/home/default.nix b/home/default.nix index 1b4f909..6ea1b04 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,138 +3,123 @@ config, pkgs, inputs, - system, ... }: let inherit (lib) optionals; in { imports = [ - inputs.home-manager.nixosModules.home-manager + ./apps + ./browsers + ./desktops ./gtk ./neovim ./ssh ./tmux ./zsh + ./development.nix ./git.nix ./gpg.nix ./starship.nix ]; - # use system packages in home manager - home-manager.useGlobalPkgs = true; + home.username = config.user; + home.homeDirectory = config.homePath; + home.stateVersion = config.stateVersion; - # install user packages to /etc/profiles and not home directory - home-manager.useUserPackages = true; + news.display = "silent"; + fonts.fontconfig.enable = true; - home-manager.users.root = { - home.stateVersion = config.stateVersion; - }; - - home-manager.users.${config.user} = { - home.username = config.user; - home.homeDirectory = config.homePath; - home.stateVersion = config.stateVersion; - - news.display = "silent"; - fonts.fontconfig.enable = true; + home.packages = + (with pkgs; [ + home-manager + pfetch-rs + yt-dlp + ]) + ++ [ + inputs.talc.packages.${pkgs.system}.talc + ] + ++ (with pkgs; + optionals config.desktops.enable [ + # social + discord + element-desktop + gajim + thunderbird-latest + # programs + brightnessctl + easyeffects + filezilla + gimp3 + imv + mpv + pavucontrol + vlc + zathura + # media + ffmpeg + imagemagick + ]); - home.packages = - (with pkgs; [ - home-manager - pfetch-rs - yt-dlp - ]) - ++ [ - inputs.talc.packages.${system}.talc - ] - ++ (with pkgs; - optionals config.desktops.enable [ - # social - discord - element-desktop - gajim - thunderbird-latest - # programs - brightnessctl - easyeffects - filezilla - gimp3 - imv - mpv - pavucontrol - vlc - zathura - # media - ffmpeg - imagemagick - ]); - - xdg.configFile = { - "aacs/keydb.cfg" = { - source = ../files/keys/bluray.cfg; - }; + xdg.configFile = { + "aacs/keydb.cfg" = { + source = ../files/keys/bluray.cfg; }; + }; - xdg.dataFile = { - fonts = { - source = ../files/fonts; - recursive = true; - }; + xdg.dataFile = { + fonts = { + source = ../files/fonts; + recursive = true; }; + }; - xdg.mimeApps = { - enable = true; - defaultApplications = { - # web - "text/html" = "firefox.desktop"; - "x-scheme-handler/http" = "firefox.desktop"; - "x-scheme-handler/https" = "firefox.desktop"; - "x-scheme-handler/about" = "firefox.desktop"; - "x-scheme-handler/unknown" = "firefox.desktop"; - - # images - "image/png" = "imv.desktop"; - "image/jpeg" = "imv.desktop"; - "image/webp" = "imv.desktop"; - "image/tga" = "imv.desktop"; - "image/bmp" = "imv.desktop"; - "image/gif" = "imv.desktop"; - - # audio video - "video/mp4" = "mpv.desktop"; - "video/x-msvideo" = "mpv.desktop"; - "video/mkv" = "mpv.desktop"; - "video/webm" = "mpv.desktop"; - "audio/mp3" = "mpv.desktop"; - "audio/wav" = "mpv.desktop"; + xdg.mimeApps = { + enable = true; + defaultApplications = { + # web + "text/html" = "firefox.desktop"; + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + "x-scheme-handler/about" = "firefox.desktop"; + "x-scheme-handler/unknown" = "firefox.desktop"; - # other - "application/pdf" = "org.pwmt.zathura.desktop"; - "x-scheme-handler/mspa" = "unofficial-homestuck-collection.desktop"; - "x-scheme-handler/discord" = "discord.desktop"; - "x-scheme-handler/roblox-player" = "org.vinegarhq.Sober.desktop"; - }; - }; + # images + "image/png" = "imv.desktop"; + "image/jpeg" = "imv.desktop"; + "image/webp" = "imv.desktop"; + "image/tga" = "imv.desktop"; + "image/bmp" = "imv.desktop"; + "image/gif" = "imv.desktop"; - xdg.userDirs = { - enable = true; - createDirectories = false; + # audio video + "video/mp4" = "mpv.desktop"; + "video/x-msvideo" = "mpv.desktop"; + "video/mkv" = "mpv.desktop"; + "video/webm" = "mpv.desktop"; + "audio/mp3" = "mpv.desktop"; + "audio/wav" = "mpv.desktop"; - desktop = "${config.homePath}/desktop"; - documents = "${config.homePath}/documents"; - download = "${config.homePath}/downloads"; - music = "${config.homePath}/music"; - pictures = "${config.homePath}/pictures"; - publicShare = "${config.homePath}"; - templates = "${config.homePath}"; - videos = "${config.homePath}/videos"; + # other + "application/pdf" = "org.pwmt.zathura.desktop"; + "x-scheme-handler/mspa" = "unofficial-homestuck-collection.desktop"; + "x-scheme-handler/discord" = "discord.desktop"; + "x-scheme-handler/roblox-player" = "org.vinegarhq.Sober.desktop"; }; + }; - gtk = { - enable = true; - gtk3.extraConfig.gtk-application-prefer-dark-theme = 1; - }; + xdg.userDirs = { + enable = true; + createDirectories = false; - programs.home-manager.enable = true; + desktop = "${config.homePath}/desktop"; + documents = "${config.homePath}/documents"; + download = "${config.homePath}/downloads"; + music = "${config.homePath}/music"; + pictures = "${config.homePath}/pictures"; + publicShare = "${config.homePath}"; + templates = "${config.homePath}"; + videos = "${config.homePath}/videos"; }; + + programs.home-manager.enable = true; } diff --git a/modules/desktops/default.nix b/home/desktops/default.nix index 16406c9..9c17bb0 100644 --- a/modules/desktops/default.nix +++ b/home/desktops/default.nix @@ -11,22 +11,12 @@ in { imports = [ ./hyprland ./sway - ./ly.nix - ./wayland.nix ]; - options.desktops = { - enable = mkEnableOption "Enable baseline desktop utils and programs."; - wayland = mkEnableOption "Enable wayland desktop components."; - ly = mkEnableOption "Install the ly display manager."; - hyprland = mkEnableOption "Install the Hyprland desktop."; - sway = mkEnableOption "Install the sway desktop."; - }; - config = mkIf cfg.enable { - home-manager.users.${config.user} = { - # desktop specific programs - home.packages = with pkgs; [ + # desktop specific programs + home.packages = + (with pkgs; [ # gtk adwaita-icon-theme # codecs @@ -42,12 +32,7 @@ in { wl-mirror # xdg libnotify - ]; - }; - - # desktop only fonts - fonts.packages = - (with pkgs; [ + # fonts corefonts dejavu_fonts fira-code @@ -62,6 +47,7 @@ in { vistafonts ]) ++ (with inputs.apple-fonts.packages.${pkgs.system}; [ + # apple fonts sf-pro sf-mono sf-compact diff --git a/home/desktops/hyprland/binds.nix b/home/desktops/hyprland/binds.nix new file mode 100644 index 0000000..94e0f39 --- /dev/null +++ b/home/desktops/hyprland/binds.nix @@ -0,0 +1,139 @@ +{config, ...}: { + wayland.windowManager.hyprland.settings = { + # Keybinds + "$mod" = "SUPER"; + bind = [ + # Launch programs + + "$mod, W, exec, ${config.default.browser}" + "$mod, D, exec, ${config.default.appLauncher}" + "$mod, L, exec, ${config.default.lockScreen}" + "$mod, Return, exec, ${config.default.terminal}" + ", Print, exec, grimblast copy area" + + # Misc + + "$mod SHIFT, L, exit" + "$mod, tab, hyprexpo:expo, toggle" + + # Window operations + + "$mod SHIFT, Q, killactive" + "$mod SHIFT, SPACE, togglefloating" + "$mod, F, fullscreen" + "$mod, J, togglesplit" + + # Move focus with mod + arrow keys + + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + + # Move window across workspace with mod + arrow keys + + "$mod SHIFT, left, hy3:movewindow, l" + "$mod SHIFT, right, hy3:movewindow, r" + "$mod SHIFT, up, hy3:movewindow, u" + "$mod SHIFT, down, hy3:movewindow, d" + + # Switch workspaces with mod + [0-9] + + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + + # Move active window to a workspace with mod + SHIFT + [0-9] + + "$mod SHIFT, 1, movetoworkspacesilent, 1" + "$mod SHIFT, 2, movetoworkspacesilent, 2" + "$mod SHIFT, 3, movetoworkspacesilent, 3" + "$mod SHIFT, 4, movetoworkspacesilent, 4" + "$mod SHIFT, 5, movetoworkspacesilent, 5" + "$mod SHIFT, 6, movetoworkspacesilent, 6" + "$mod SHIFT, 7, movetoworkspacesilent, 7" + "$mod SHIFT, 8, movetoworkspacesilent, 8" + "$mod SHIFT, 9, movetoworkspacesilent, 9" + "$mod SHIFT, 0, movetoworkspacesilent, 10" + + # Move to tab + + "LALT, 1, hy3:focustab, index, 01" + "LALT, 2, hy3:focustab, index, 02" + "LALT, 3, hy3:focustab, index, 03" + "LALT, 4, hy3:focustab, index, 04" + "LALT, 5, hy3:focustab, index, 05" + "LALT, 6, hy3:focustab, index, 06" + "LALT, 7, hy3:focustab, index, 07" + "LALT, 8, hy3:focustab, index, 08" + "LALT, 9, hy3:focustab, index, 09" + "LALT, 0, hy3:focustab, index, 10" + + "$mod SHIFT, B, hy3:makegroup, h" + "$mod SHIFT, V, hy3:makegroup, v" + "$mod SHIFT, C, hy3:changegroup, toggletab" + + # Scroll through existing workspaces with mod + scroll + + "$mod, mouse_down, workspace, e+1" + "$mod, mouse_up, workspace, e-1" + ]; + + bindn = [ + # Focus windows with scroll wheel or middle click + + ", mouse:272, hy3:focustab, mouse" + ", mouse_down, hy3:focustab, l, require_hovered" + ", mouse_up, hy3:focustab, r, require_hovered" + ]; + + bindm = [ + # Move/resize windows with mod + LMB/RMB and dragging + + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + + binde = [ + # Audio + + # raise volume + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + # lower volume + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + # mute speaker + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + # mute mic + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + + # Media + + # play + ", XF86AudioPlay, exec, playerctl play-pause" + # next + ", XF86AudioNext, exec, playerctl next" + # prev + ", XF86AudioPrev, exec, playerctl previous" + + # Backlight + + ", XF86MonBrightnessDown, exec, brightnessctl set 5%-" + ", XF86MonBrightnessUp, exec, brightnessctl set 5%+" + ]; + + bindl = let + monitor = builtins.elemAt config.monitors 0; + cfg = "highres, auto, ${toString monitor.scale}, bitdepth, ${toString monitor.bitdepth}"; + in [ + # Laptops when docked + ", switch:on:Lid, exec, hyprctl keyword monitor \"${monitor.name}, disable\"" + ", switch:off:Lid, exec, hyprctl keyword monitor \"${monitor.name}, ${cfg}\"" + ]; + }; +} diff --git a/home/desktops/hyprland/default.nix b/home/desktops/hyprland/default.nix new file mode 100644 index 0000000..53a1d2a --- /dev/null +++ b/home/desktops/hyprland/default.nix @@ -0,0 +1,33 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: let + inherit (lib) mkIf mkDefault; + cfg = config.desktops.hyprland; +in { + imports = [ + ./binds.nix + ./env.nix + ./idle.nix + ./plugins.nix + ./settings.nix + ./wallpaper.nix + ]; + + config = mkIf cfg.enable { + home.packages = [ + inputs.rose-pine-hyprcursor.packages.${pkgs.system}.default + ]; + + wayland.windowManager.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + + xwayland.enable = true; + systemd.enable = true; + }; + }; +} diff --git a/home/desktops/hyprland/env.nix b/home/desktops/hyprland/env.nix new file mode 100644 index 0000000..620efd9 --- /dev/null +++ b/home/desktops/hyprland/env.nix @@ -0,0 +1,14 @@ +{config, ...}: { + wayland.windowManager.hyprland.settings = { + env = [ + "XDG_CURRENT_DESKTOP,Hyprland" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + "MOZ_ENABLE_WAYLAND,1" + "NIXOS_OZONE_WL,1" + + "HYPRCURSOR_THEME,rose-pine-hyprcursor" + "HYPRCURSOR_SIZE,24" + ]; + }; +} diff --git a/home/desktops/hyprland/idle.nix b/home/desktops/hyprland/idle.nix new file mode 100644 index 0000000..0a2b951 --- /dev/null +++ b/home/desktops/hyprland/idle.nix @@ -0,0 +1,35 @@ +{config, ...}: { + services.hypridle = { + enable = config.desktops.hyprland.enable; + systemdTarget = "hyprland-session.target"; + + settings = { + general = { + lock_cmd = "pidof ${config.default.lockScreen} || ${config.default.lockScreen}"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + }; + + listener = [ + # dim screen + { + timeout = 150; + on-timeout = "brightnessctl -s set 10"; + on-resume = "brightnessctl -r"; + } + # lock + { + timeout = 300; + on-timeout = "loginctl lock-session"; + } + # turn off screen + { + timeout = 350; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; +} diff --git a/home/desktops/hyprland/plugins.nix b/home/desktops/hyprland/plugins.nix new file mode 100644 index 0000000..0440e12 --- /dev/null +++ b/home/desktops/hyprland/plugins.nix @@ -0,0 +1,40 @@ +{ + inputs, + config, + pkgs, + ... +}: { + wayland.windowManager.hyprland = { + plugins = [ + inputs.hyprland-plugins.packages.${pkgs.system}.hyprexpo + inputs.hy3.packages.${pkgs.system}.hy3 + ]; + + settings.plugin = { + # hy3 + hy3 = { + tabs = { + height = 24; + text_height = 9; + text_padding = 10; + padding = 2; + render_text = true; + text_font = "monospace"; + radius = config.theme.outerRadius; + border_width = config.theme.borderWidth; + + "col.active" = "rgb(${config.theme.colors.base})"; + "col.active.border" = "rgb(${config.theme.colors.primary})"; + "col.active.text" = "rgb(${config.theme.colors.text})"; + "col.inactive" = "rgb(${config.theme.colors.base})"; + "col.inactive.border" = "rgb(${config.theme.colors.surface})"; + "col.inactive.text" = "rgb(${config.theme.colors.text})"; + }; + + autotile = { + enable = true; + }; + }; + }; + }; +} diff --git a/home/desktops/hyprland/settings.nix b/home/desktops/hyprland/settings.nix new file mode 100644 index 0000000..daaf749 --- /dev/null +++ b/home/desktops/hyprland/settings.nix @@ -0,0 +1,125 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: { + wayland.windowManager.hyprland = { + importantPrefixes = [ + "bezier" + "enabled" + "output" + ]; + + settings = { + # Monitors + monitorv2 = + map (monitor: { + output = monitor.name; + mode = "highres"; + scale = toString monitor.scale; + bitdepth = toString monitor.bitdepth; + }) + config.monitors; + + # Autostart + exec-once = config.autoRun; + + # General + general = { + gaps_in = config.theme.innerGap; + gaps_out = config.theme.outerGap; + layout = "hy3"; + resize_on_border = "yes"; + extend_border_grab_area = 20; + border_size = config.theme.borderWidth; + "col.active_border" = "rgb(${config.theme.colors.primary})"; + "col.inactive_border" = "rgb(${config.theme.colors.surface})"; + }; + + # Gestures + gestures = { + workspace_swipe = true; + workspace_swipe_fingers = 3; + workspace_swipe_forever = true; + workspace_swipe_cancel_ratio = 0.15; + }; + + # Decoration + decoration = { + rounding = config.theme.outerRadius; + shadow.enabled = false; + blur = { + enabled = config.theme.blur; + size = 4; + passes = 2; + noise = 0.008; + contrast = 0.8916; + brightness = 0.8; + }; + }; + + animations = { + enabled = true; + + bezier = [ + "windowIn, 0.06, 0.71, 0.25, 1" + "windowResize, 0.04, 0.67, 0.38, 1" + ]; + + animation = [ + "windowsIn, 1, 3, windowIn, slide #popin 20%" + "windowsOut, 1, 3, windowIn, slide #popin 70%" + "windowsMove, 1, 2.5, windowResize" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 3, default" + "workspaces, 1, 6, default" + "layers, 1, 5, windowIn, slide" + ]; + }; + + # Input + input = { + kb_layout = "us"; + kb_variant = ""; + kb_model = ""; + kb_options = "gtp:alt_shift_toggle, compose:ralt"; + kb_rules = ""; + follow_mouse = 1; + touchpad = { + natural_scroll = "yes"; + }; + sensitivity = 0; + }; + + # XWayland + xwayland = { + force_zero_scaling = "true"; + use_nearest_neighbor = "false"; + }; + + # Misc + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + key_press_enables_dpms = true; + mouse_move_enables_dpms = true; + enable_anr_dialog = false; + vrr = 1; + }; + + # Ecosystem + ecosystem = { + no_update_news = true; + no_donation_nag = true; + }; + + # Experimental + experimental = { + xx_color_management_v4 = true; + }; + }; # end settings + }; # end hyprland +} diff --git a/home/desktops/hyprland/wallpaper.nix b/home/desktops/hyprland/wallpaper.nix new file mode 100644 index 0000000..e8fc861 --- /dev/null +++ b/home/desktops/hyprland/wallpaper.nix @@ -0,0 +1,11 @@ +{config, ...}: { + services.hyprpaper = { + enable = config.desktops.hyprland.enable; + + settings = { + preload = config.theme.wallpaper; + wallpaper = ",${config.theme.wallpaper}"; + splash = false; + }; + }; +} diff --git a/home/desktops/sway/binds.nix b/home/desktops/sway/binds.nix new file mode 100644 index 0000000..d35f0a7 --- /dev/null +++ b/home/desktops/sway/binds.nix @@ -0,0 +1,89 @@ +{config, ...}: let + mod = "Mod4"; +in { + wayland.windowManager.sway = { + config = { + keybindings = { + # apps + "${mod}+Return" = "exec ${config.default.terminal}"; + "${mod}+l" = "exec ${config.default.lockScreen}"; + "${mod}+d" = "exec ${config.default.appLauncher}"; + "${mod}+w" = "exec ${config.default.browser}"; + + # exit + "${mod}+Shift+l" = "exit"; + # kill focused window + "${mod}+Shift+q" = "kill"; + # reload sway + "${mod}+F5" = "reload"; + + # audio + "XF86AudioRaiseVolume" = "exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"; + "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; + "XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + "XF86AudioMicMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; + + # media + "XF86AudioPlay" = "exec playerctl play-pause"; + "XF86AudioNext" = "exec playerctl next"; + "XF86AudioPrev" = "exec playerctl previous"; + + # backlight + "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; + "XF86MonBrightnessUp" = "exec brightnessctl set 5%+"; + + # screenshot + "Print" = "exec grimblast copy area"; + + # move focus + "${mod}+Left" = "focus left"; + "${mod}+Down" = "focus down"; + "${mod}+Up" = "focus up"; + "${mod}+Right" = "focus right"; + + # move focused window + "${mod}+Shift+Left" = "move left"; + "${mod}+Shift+Down" = "move down"; + "${mod}+Shift+Up" = "move up"; + "${mod}+Shift+Right" = "move right"; + + # switch workspace + "${mod}+1" = "workspace number 1"; + "${mod}+2" = "workspace number 2"; + "${mod}+3" = "workspace number 3"; + "${mod}+4" = "workspace number 4"; + "${mod}+5" = "workspace number 5"; + "${mod}+6" = "workspace number 6"; + "${mod}+7" = "workspace number 7"; + "${mod}+8" = "workspace number 8"; + "${mod}+9" = "workspace number 9"; + + # move focused container to workspace + "${mod}+Shift+1" = "move container to workspace number 1"; + "${mod}+Shift+2" = "move container to workspace number 2"; + "${mod}+Shift+3" = "move container to workspace number 3"; + "${mod}+Shift+4" = "move container to workspace number 4"; + "${mod}+Shift+5" = "move container to workspace number 5"; + "${mod}+Shift+6" = "move container to workspace number 6"; + "${mod}+Shift+7" = "move container to workspace number 7"; + "${mod}+Shift+8" = "move container to workspace number 8"; + "${mod}+Shift+9" = "move container to workspace number 9"; + + # layout + "${mod}+Shift+d" = "layout default"; + "${mod}+Shift+b" = "layout splith"; + "${mod}+Shift+v" = "layout splitv"; + "${mod}+Shift+c" = "layout tabbed"; + + # fullscreen + "${mod}+f" = "fullscreen"; + # float + "${mod}+Shift+space" = "floating toggle"; + # focus + "${mod}+space" = "focus mode_toggle"; + # parent + "${mod}+a" = "focus parent"; + }; + }; + }; +} diff --git a/home/desktops/sway/config.nix b/home/desktops/sway/config.nix new file mode 100644 index 0000000..b3d07d4 --- /dev/null +++ b/home/desktops/sway/config.nix @@ -0,0 +1,122 @@ +{config, ...}: { + wayland.windowManager.sway = { + config = { + # monitors + output = + (builtins.listToAttrs (map (mon: { + name = mon.name; + value = { + dpms = "on"; + scale = toString mon.scale; + render_bit_depth = toString mon.bitdepth; + }; + }) + config.monitors)) + // { + # wallpaper + "*" = { + bg = "${config.theme.wallpaper} fill"; + }; + }; + + # inputs + input = { + "*" = { + xkb_layout = "us"; + xkb_options = "compose:ralt"; + xkb_numlock = "enable"; + }; + + "type:touchpad" = { + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; + }; + + startup = + # autostart apps + builtins.map (command: { + inherit command; + always = false; + }) + config.autoRun; + + # colors + colors = let + base = "#${config.theme.colors.base}"; + surface = "#${config.theme.colors.surface}"; + primary = "#${config.theme.colors.primary}"; + text = "#${config.theme.colors.text}"; + white = "#${config.theme.colors.bright.white}"; + error = "#${config.theme.colors.error}"; + in rec { + background = base; + + focused = { + border = primary; + background = base; + text = text; + indicator = white; + childBorder = primary; + }; + + focusedInactive = { + border = surface; + background = base; + text = text; + indicator = surface; + childBorder = surface; + }; + + unfocused = focusedInactive; + + urgent = { + border = error; + background = error; + text = text; + indicator = error; + childBorder = error; + }; + + placeholder = unfocused; + }; + + window = { + titlebar = false; + border = config.theme.borderWidth; + }; + + floating = { + titlebar = false; + border = config.theme.borderWidth; + modifier = "Mod4 normal"; + }; + + gaps = { + inner = config.theme.innerGap; + outer = config.theme.outerGap; + }; + + modes = {}; + bars = []; + }; + + extraConfig = '' + # gestures + bindgesture swipe:right workspace prev + bindgesture swipe:left workspace next + + # swayfx + corner_radius ${toString config.theme.outerRadius} + smart_corner_radius ${toString config.theme.outerRadius} + blur ${ + if config.theme.blur + then "enabled" + else "disabled" + } + blur_radius 10 + blur_passes 3 + ''; + }; +} diff --git a/home/desktops/sway/default.nix b/home/desktops/sway/default.nix new file mode 100644 index 0000000..3553c4a --- /dev/null +++ b/home/desktops/sway/default.nix @@ -0,0 +1,28 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkIf mkDefault; + cfg = config.desktops.sway; +in { + imports = [ + ./binds.nix + ./config.nix + ./idle.nix + ]; + + config = mkIf cfg.enable { + wayland.windowManager.sway = { + enable = true; + package = pkgs.swayfx; + + # TODO: get swayfx to work with check config + checkConfig = false; + + xwayland = true; + systemd.enable = true; + }; + }; +} diff --git a/home/desktops/sway/idle.nix b/home/desktops/sway/idle.nix new file mode 100644 index 0000000..1af4a6a --- /dev/null +++ b/home/desktops/sway/idle.nix @@ -0,0 +1,25 @@ +{config, ...}: { + services.swayidle = { + enable = config.desktops.sway.enable; + systemdTarget = "sway-session.target"; + + timeouts = [ + { + timeout = 300; + command = "${config.default.lockScreen}"; + } + { + timeout = 300; + command = "swaymsg \"output * power off\""; + resumeCommand = "swaymsg \"output * power on\""; + } + ]; + + events = [ + { + event = "before-sleep"; + command = "${config.default.lockScreen}"; + } + ]; + }; +} diff --git a/home/development.nix b/home/development.nix new file mode 100644 index 0000000..bf59e8e --- /dev/null +++ b/home/development.nix @@ -0,0 +1,48 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption optionals; + cfg = config.development; +in { + config = { + home.packages = with pkgs; + (optionals cfg.c.enable [ + clang-tools + gcc + gdb + gnumake + nasm + pkg-config + ]) + ++ (optionals cfg.lua.enable [ + lua-language-server + ]) + ++ (optionals cfg.rust.enable [ + rustc + rustfmt + rust-analyzer + cargo + clippy + ]) + ++ (optionals cfg.java.enable [ + gradle + jdk + jdt-language-server + kotlin + kotlin-language-server + maven + ]) + ++ (optionals cfg.web.enable [ + phpactor + sassc + typescript-language-server + ]) + ++ (optionals cfg.zig.enable [ + zig + zls + ]); + }; +} diff --git a/home/gaming/default.nix b/home/gaming/default.nix new file mode 100644 index 0000000..6e06904 --- /dev/null +++ b/home/gaming/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./homestuck.nix + ./minecraft.nix + ]; +} diff --git a/home/gaming/homestuck.nix b/home/gaming/homestuck.nix new file mode 100644 index 0000000..20cc2f7 --- /dev/null +++ b/home/gaming/homestuck.nix @@ -0,0 +1,16 @@ +{ + lib, + config, + inputs, + pkgs, + ... +}: let + inherit (lib) mkIf; + cfg = config.gaming.homesuck; +in { + config = mkIf cfg.enable { + home.packages = [ + inputs.self.packages.${pkgs.system}.unofficial-homestuck-collection + ]; + }; +} diff --git a/home/gaming/minecraft.nix b/home/gaming/minecraft.nix new file mode 100644 index 0000000..0b02981 --- /dev/null +++ b/home/gaming/minecraft.nix @@ -0,0 +1,15 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkIf; + cfg = config.gaming.minecraft; +in { + config = mkIf cfg.enable { + home.packages = with pkgs; [ + prismlauncher + ]; + }; +} diff --git a/home/git.nix b/home/git.nix index 5c6a73a..08c85fd 100644 --- a/home/git.nix +++ b/home/git.nix @@ -1,19 +1,17 @@ {config, ...}: { - home-manager.users.${config.user} = { - programs.git = { - enable = true; - userName = config.fullName; - userEmail = config.email; + programs.git = { + enable = true; + userName = config.fullName; + userEmail = config.email; - signing = { - format = "openpgp"; - key = "D9AF0A4209B7C2DE11A884BFACBC553660D9993D"; - signByDefault = true; - }; + signing = { + format = "openpgp"; + key = "D9AF0A4209B7C2DE11A884BFACBC553660D9993D"; + signByDefault = true; + }; - extraConfig = { - init.defaultBranch = "main"; - }; + extraConfig = { + init.defaultBranch = "main"; }; }; } diff --git a/home/gpg.nix b/home/gpg.nix index d17611a..a1d286d 100644 --- a/home/gpg.nix +++ b/home/gpg.nix @@ -2,28 +2,26 @@ config, lib, pkgs, - self, + inputs, ... }: { - home-manager.users.${config.user} = { - # install keys into gpg keyring - programs.gpg = { - enable = true; + # install keys into gpg keyring + programs.gpg = { + enable = true; - publicKeys = - map (path: { - source = path; - trust = 5; - }) - self.lib.gpgKeys; - }; + publicKeys = + map (path: { + source = path; + trust = 5; + }) + inputs.self.lib.gpgKeys; + }; - # global gpg agent - services.gpg-agent = { - enable = true; - enableExtraSocket = true; - enableSshSupport = true; - pinentry.package = pkgs.pinentry-curses; - }; + # global gpg agent + services.gpg-agent = { + enable = true; + enableExtraSocket = true; + enableSshSupport = true; + pinentry.package = pkgs.pinentry-curses; }; } diff --git a/home/gtk/default.nix b/home/gtk/default.nix index 086f8d1..b7ce33b 100644 --- a/home/gtk/default.nix +++ b/home/gtk/default.nix @@ -33,18 +33,17 @@ cat ${./gtk.css} >>$out ''; in { - home-manager.users.${config.user} = { - gtk = { - enable = true; - theme = { - package = pkgs.adw-gtk3; - name = "adw-gtk3"; - }; + gtk = { + enable = true; + theme = { + package = pkgs.adw-gtk3; + name = "adw-gtk3"; }; + gtk3.extraConfig.gtk-application-prefer-dark-theme = 1; + }; - xdg.configFile = { - "gtk-3.0/gtk.css".source = finalCss; - "gtk-4.0/gtk.css".source = finalCss; - }; + xdg.configFile = { + "gtk-3.0/gtk.css".source = finalCss; + "gtk-4.0/gtk.css".source = finalCss; }; } diff --git a/home/neovim/config.nix b/home/neovim/config.nix index b775e77..be86c9b 100644 --- a/home/neovim/config.nix +++ b/home/neovim/config.nix @@ -53,14 +53,14 @@ in }; # list of lsp servers to load lsps = - optionalAttrs config.development.c { + optionalAttrs config.development.c.enable { clangd = {}; } - // optionalAttrs config.development.java { + // optionalAttrs config.development.java.enable { jdtls = {}; kotlin_language_server = {}; } - // optionalAttrs config.development.lua { + // optionalAttrs config.development.lua.enable { lua_ls = { Lua = { diagnostics = { @@ -69,14 +69,14 @@ in }; }; } - // optionalAttrs config.development.rust { + // optionalAttrs config.development.rust.enable { rust_analyzer = {}; } - // optionalAttrs config.development.web { + // optionalAttrs config.development.web.enable { ts_ls = {}; phpactor = {}; } - // optionalAttrs config.development.zig { + // optionalAttrs config.development.zig.enable { zls = {}; }; highlight = { diff --git a/home/neovim/default.nix b/home/neovim/default.nix index 66d2625..36e1575 100644 --- a/home/neovim/default.nix +++ b/home/neovim/default.nix @@ -7,70 +7,68 @@ lua_cfg = import ./config.nix {inherit lib config;}; lua = builtins.readFile ./init.lua; in { - environment.variables.EDITOR = "nvim"; + home.sessionVariables.EDITOR = "nvim"; - home-manager.users.${config.user} = { - programs.neovim = { - enable = true; - viAlias = true; - vimAlias = true; + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; - extraLuaConfig = '' - local config = ${lua_cfg} + extraLuaConfig = '' + local config = ${lua_cfg} - ${lua} - ''; + ${lua} + ''; - plugins = with pkgs.vimPlugins; [ - # Dependencies - vim-devicons - nvim-web-devicons - plenary-nvim - # Colorscheme - base16-nvim - # Mode line - lualine-nvim - # Buffer line - bufferline-nvim - # File browser - nvim-tree-lua - # Undo tree - undotree - # Trouble (error menu) - trouble-nvim - # Telescope (buffers/find/grep/help) - telescope-nvim - # Snippets - vim-vsnip - vim-vsnip-integ - friendly-snippets - # Completion - cmp-buffer - cmp-nvim-lsp - cmp-vsnip - nvim-cmp - # Sourround delimiters - nvim-surround - # Comment functions - nerdcommenter - # Treesitter - nvim-treesitter.withAllGrammars - # Syntax hilighting - vim-illuminate - vim-table-mode - nvim-highlight-colors - colorful-menu-nvim - # Todo comments - todo-comments-nvim - # Lsp server - nvim-lspconfig - # Notifications - fidget-nvim - # Auto indentation - indent-o-matic - # 80 column width - virt-column-nvim - ]; - }; + plugins = with pkgs.vimPlugins; [ + # Dependencies + vim-devicons + nvim-web-devicons + plenary-nvim + # Colorscheme + base16-nvim + # Mode line + lualine-nvim + # Buffer line + bufferline-nvim + # File browser + nvim-tree-lua + # Undo tree + undotree + # Trouble (error menu) + trouble-nvim + # Telescope (buffers/find/grep/help) + telescope-nvim + # Snippets + vim-vsnip + vim-vsnip-integ + friendly-snippets + # Completion + cmp-buffer + cmp-nvim-lsp + cmp-vsnip + nvim-cmp + # Sourround delimiters + nvim-surround + # Comment functions + nerdcommenter + # Treesitter + nvim-treesitter.withAllGrammars + # Syntax hilighting + vim-illuminate + vim-table-mode + nvim-highlight-colors + colorful-menu-nvim + # Todo comments + todo-comments-nvim + # Lsp server + nvim-lspconfig + # Notifications + fidget-nvim + # Auto indentation + indent-o-matic + # 80 column width + virt-column-nvim + ]; }; } diff --git a/home/ssh/default.nix b/home/ssh/default.nix index c884bf4..efee063 100644 --- a/home/ssh/default.nix +++ b/home/ssh/default.nix @@ -4,12 +4,10 @@ ... }: { # ssh config - home-manager.users.${config.user} = { - programs.ssh = { - enable = true; - enableDefaultConfig = false; - matchBlocks."*" = {}; - extraConfig = lib.fileContents ./config; - }; + programs.ssh = { + enable = true; + enableDefaultConfig = false; + matchBlocks."*" = {}; + extraConfig = lib.fileContents ./config; }; } diff --git a/home/starship.nix b/home/starship.nix index 74fd28a..8f0a5f6 100644 --- a/home/starship.nix +++ b/home/starship.nix @@ -3,46 +3,44 @@ lib, ... }: { - home-manager.users.${config.user} = { - programs.starship = { - enable = true; + programs.starship = { + enable = true; - settings = { - format = lib.concatStrings [ - "╭─ " - "$username" - "$hostname" - "$git_branch" - "$directory" - "$line_break" - "╰─ " - ]; + settings = { + format = lib.concatStrings [ + "╭─ " + "$username" + "$hostname" + "$git_branch" + "$directory" + "$line_break" + "╰─ " + ]; - username = { - style_user = "bold cyan"; - style_root = "bold red"; - format = "[$user]($style) "; - disabled = false; - show_always = true; - }; + username = { + style_user = "bold cyan"; + style_root = "bold red"; + format = "[$user]($style) "; + disabled = false; + show_always = true; + }; - hostname = { - ssh_only = false; - format = "on [$hostname](bold blue) "; - disabled = false; - }; + hostname = { + ssh_only = false; + format = "on [$hostname](bold blue) "; + disabled = false; + }; - directory = { - format = "[$path]($style)[$read_only]($read_only_style) "; - truncation_length = -1; - truncate_to_repo = false; - truncation_symbol = "…/"; - }; + directory = { + format = "[$path]($style)[$read_only]($read_only_style) "; + truncation_length = -1; + truncate_to_repo = false; + truncation_symbol = "…/"; + }; - git_branch = { - style = "bold purple"; - format = "at [$symbol$branch(:$remote_branch)]($style) "; - }; + git_branch = { + style = "bold purple"; + format = "at [$symbol$branch(:$remote_branch)]($style) "; }; }; }; diff --git a/home/tmux/default.nix b/home/tmux/default.nix index c7ce7db..ea8e525 100644 --- a/home/tmux/default.nix +++ b/home/tmux/default.nix @@ -3,14 +3,12 @@ pkgs, ... }: { - home-manager.users.${config.user} = { - home.packages = [ - pkgs.tmux - ]; + home.packages = [ + pkgs.tmux + ]; - home.file = { - ".tmux.conf".source = ./tmux.conf; - ".local/bin/tmux_window".source = ./tmux_window; - }; + home.file = { + ".tmux.conf".source = ./tmux.conf; + ".local/bin/tmux_window".source = ./tmux_window; }; } diff --git a/home/zsh/default.nix b/home/zsh/default.nix index 8bb12db..2df01ef 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -1,30 +1,23 @@ { config, - pkgs, + lib, ... }: { programs.zsh = { enable = true; enableCompletion = true; - enableGlobalCompInit = false; - autosuggestions.enable = true; + autosuggestion = { + enable = true; + highlight = "fg=#${config.theme.colors.subtext}"; + }; syntaxHighlighting.enable = true; - histSize = 10000; + history.size = 10000; + profileExtra = lib.fileContents ./zprofile; + envExtra = lib.fileContents ./zshrc; }; - home-manager.users.${config.user} = { - home.file = { - ".zshrc".source = ./zshrc; - ".zprofile".source = ./zprofile; - ".nixenv".source = pkgs.writeText "nixenv" '' - # nix shell env auto generated file - export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#${config.theme.colors.subtext}' - ''; - }; - - programs.zoxide = { - enable = true; - enableZshIntegration = true; - }; + programs.zoxide = { + enable = true; + enableZshIntegration = true; }; } diff --git a/home/zsh/zshrc b/home/zsh/zshrc index 0dd2904..6a366a0 100644 --- a/home/zsh/zshrc +++ b/home/zsh/zshrc @@ -72,6 +72,3 @@ bindkey "\e\d" undo # gpg export GPG_TTY=$(tty) export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) - -# nixos -source ~/.nixenv diff --git a/hosts/kaworu/default.nix b/hosts/kaworu/default.nix index ab336f7..5056512 100644 --- a/hosts/kaworu/default.nix +++ b/hosts/kaworu/default.nix @@ -16,27 +16,27 @@ # modules apps = { - astal = true; - hyprlock = true; - kitty = true; + astal.enable = true; + hyprlock.enable = true; + kitty.enable = true; }; browsers = { - firefox = true; + firefox.enable = true; }; desktops = { enable = true; - hyprland = true; - ly = true; + hyprland.enable = true; + ly.enable = true; }; development = { - c = true; - rust = true; - web = true; + c.enable = true; + rust.enable = true; + web.enable = true; }; gaming = { - homestuck = true; - minecraft = true; - steam = true; + homestuck.enable = true; + minecraft.enable = true; + steam.enable = true; }; # modules diff --git a/hosts/shinji/default.nix b/hosts/shinji/default.nix index 108f8f6..3781e16 100644 --- a/hosts/shinji/default.nix +++ b/hosts/shinji/default.nix @@ -49,33 +49,33 @@ # modules apps = { - astal = true; - hyprlock = true; - kitty = true; + astal.enable = true; + hyprlock.enable = true; + kitty.enable = true; }; browsers = { - firefox = true; + firefox.enable = true; }; desktops = { enable = true; - hyprland = true; - ly = true; + hyprland.enable = true; + ly.enable = true; }; development = { - c = true; - lua = true; - java = true; - rust = true; - web = true; + c.enable = true; + lua.enable = true; + java.enable = true; + rust.enable = true; + web.enable = true; }; gaming = { - homestuck = true; - minecraft = true; - steam = true; + homestuck.enable = true; + minecraft.enable = true; + steam.enable = true; }; virt = { - docker = true; - qemu = true; + docker.enable = true; + qemu.enable = true; }; # modules diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index 31b1e6f..3d537c7 100644 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -18,26 +18,26 @@ # modules apps = { - astal = true; - hyprlock = true; - kitty = true; + astal.enable = true; + hyprlock.enable = true; + kitty.enable = true; }; browsers = { - firefox = true; + firefox.enable = true; }; desktops = { enable = true; - hyprland = true; - ly = true; + hyprland.enable = true; + ly.enable = true; }; gaming = { - homestuck = true; - minecraft = true; + homestuck.enable = true; + minecraft.enable = true; }; # modules battery = true; bluetooth = true; fingerprint = true; - network = true; + tpm = true; } diff --git a/lib/default.nix b/lib/default.nix index ae838af..67d1cba 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -3,4 +3,39 @@ files = callLibs ./files.nix; in { inherit (files) getFiles certs sshKeys gpgKeys; + + customConfig = config: { + inherit + (config) + # System Information + hostName + timeZone + stateVersion + # System Modules + battery + bluetooth + fingerprint + network + tpm + minimal + # Primary User + user + fullName + email + homePath + dotfilesPath + # Monitors + monitors + # Theme + theme + # Programs + apps + browsers + desktops + gaming + development + virt + autoRun + ; + }; } diff --git a/modules/apps/alacritty.nix b/modules/apps/alacritty.nix deleted file mode 100644 index b50e142..0000000 --- a/modules/apps/alacritty.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib) mkIf; - cfg = config.apps; -in { - config = mkIf cfg.alacritty { - default.terminal = lib.mkDefault "alacritty"; - - home-manager.users.${config.user} = { - programs.alacritty = { - enable = true; - - settings = { - # Font - font = { - size = 11; - bold = { - style = "Bold"; - }; - bold_italic = { - style = "Bold Italic"; - }; - italic = { - style = "Italic"; - }; - normal = { - family = config.theme.font.monospace; - style = "Regular"; - }; - offset = { - x = 0; - y = 0; - }; - }; - - # Window - window = { - decorations = "full"; - dynamic_title = true; - padding = { - x = config.theme.outerGap; - y = config.theme.outerGap; - }; - opacity = config.theme.opacity; - }; - - # Colors - colors = { - normal = lib.attrsets.mapAttrs (name: color: "${color}") { - inherit - (config.theme.colors.normal) - black - red - green - yellow - blue - magenta - cyan - white - ; - }; - - bright = lib.attrsets.mapAttrs (name: color: "${color}") { - inherit - (config.theme.colors.bright) - black - red - green - yellow - blue - magenta - cyan - white - ; - }; - - cursor = { - background = "CellForeground"; - text = "CellBackground"; - }; - - selection = { - background = "CellForeground"; - text = "CellBackground"; - }; - - primary = { - foreground = "#${config.theme.colors.text}"; - background = "#${config.theme.colors.base}"; - }; - }; - }; - }; - }; - }; -} diff --git a/modules/apps/astal.nix b/modules/apps/astal.nix deleted file mode 100644 index 505fe29..0000000 --- a/modules/apps/astal.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - lib, - config, - pkgs, - inputs, - system, - ... -}: let - astal = inputs.self.packages.${system}; - inherit (lib) mkIf; - cfg = config.apps; -in { - config = mkIf cfg.astal { - default.appLauncher = lib.mkDefault "astal-launcher"; - - home-manager.users.${config.user} = { - home.packages = [ - astal.astal.shell - astal.astal.launcher - ]; - - systemd.user.services.astal = { - Install = { - WantedBy = [config.default.session "tray.target"]; - }; - - Unit = { - ConditionEnvironment = "WAYLAND_DISPLAY"; - Description = "astal"; - After = [config.default.session]; - PartOf = [config.default.session "tray.target"]; - }; - - Service = { - ExecStart = "${astal.astal.shell}/bin/astal-shell"; - Restart = "always"; - RestartSec = "10"; - }; - }; - }; - }; -} diff --git a/modules/apps/default.nix b/modules/apps/default.nix deleted file mode 100644 index 7100897..0000000 --- a/modules/apps/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{lib, ...}: let - inherit (lib) mkEnableOption; -in { - imports = [ - ./waybar - ./wofi - ./alacritty.nix - ./astal.nix - ./hyprlock.nix - ./kitty.nix - ./mako.nix - ]; - - options.apps = { - alacritty = mkEnableOption "Enable the alacritty terminal."; - astal = mkEnableOption "Enable the astal gtk shell."; - kitty = mkEnableOption "Enable the kitty terminal."; - mako = mkEnableOption "Enable the mako notification daemon."; - hyprlock = mkEnableOption "Enable the hyprlock lockscreen."; - waybar = mkEnableOption "Enable the waybar bar."; - wofi = mkEnableOption "Enable the wofi launcher."; - }; -} diff --git a/modules/apps/hyprlock.nix b/modules/apps/hyprlock.nix deleted file mode 100644 index 2bf70e3..0000000 --- a/modules/apps/hyprlock.nix +++ /dev/null @@ -1,106 +0,0 @@ -{ - config, - lib, - ... -}: let - text = "rgb(${config.theme.colors.text})"; - base = "rgb(${config.theme.colors.base})"; - error = "rgb(${config.theme.colors.error})"; - trans = "rgba(0,0,0,0)"; - - inherit (lib) mkIf optionals; - cfg = config.apps; -in { - config = mkIf cfg.hyprlock { - default.lockScreen = lib.mkDefault "hyprlock"; - - home-manager.users.${config.user} = { - programs.hyprlock = { - enable = true; - - settings = { - auth = { - "pam:enabled" = true; - "fingerprint:enabled" = config.fingerprint; - }; - - animations = { - enabled = true; - animation = [ - "fadeIn, 0" - "fadeOut, 0" - ]; - }; - - background = { - path = config.theme.lockscreen; - color = base; - blur_passes = 0; - blur_size = 2; - noise = 0; - contrast = 0; - brightness = 0; - vibrancy = 0; - vibrancy_darkness = 0.0; - }; - - # Password Input - input-field = { - size = "300, 50"; - outline_thickness = 0; - dots_size = 0.25; - dots_spacing = 0.55; - dots_center = true; - dots_rounding = -1; - outer_color = trans; - inner_color = trans; - font_color = text; - fade_on_empty = false; - placeholder_text = - "Enter Password" - + ( - if config.fingerprint - then " or Touch Fingerprint" - else "" - ); - hide_input = false; - check_color = error; - fail_color = error; - capslock_color = trans; - numlock_color = trans; - bothlock_color = trans; - invert_numlock = false; - swap_font_color = false; - font_family = config.theme.font.regular; - position = "0, 50"; - halign = "center"; - valign = "bottom"; - }; - - label = [ - # Date - { - text = "cmd[update:1000] echo \"$(date +\"%A, %B %d\")\""; - color = text; - font_size = 20; - font_family = config.theme.font.header; - position = "0, -100"; - halign = "center"; - valign = "top"; - } - # Clock - { - text = "cmd[update:1000] echo \"$(date +\"%k:%M:%S\")\""; - color = text; - font_size = 90; - font_family = config.theme.font.header; - position = "0, -130"; - halign = "center"; - valign = "top"; - } - ]; - }; - }; - }; - }; -} diff --git a/modules/apps/kitty.nix b/modules/apps/kitty.nix deleted file mode 100644 index 03f981a..0000000 --- a/modules/apps/kitty.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib) mkIf; - cfg = config.apps; -in { - config = mkIf cfg.kitty { - default.terminal = lib.mkDefault "kitty"; - - home-manager.users.${config.user} = { - programs.kitty = { - enable = true; - environment = {}; - extraConfig = ""; - - settings = { - # Font - font_family = config.theme.font.monospace; - font_size = 11; - bold_font = "auto"; - italic_font = "auto"; - bold_italic_font = "auto"; - - # Scrollback - scrollback_lines = 10000; - scrollback_pager_history_size = 300; # MB - - # Urls - detect_urls = true; - show_hyperlink_targets = false; - - # Window - window_padding_width = config.theme.outerGap; - window_border_width = 0; - draw_minimal_borders = true; - background_opacity = config.theme.opacity; - - # Disable audio - enable_audio_bell = false; - - # Disable close prompt - confirm_os_window_close = 0; - - # selection - selection_background = "#${config.theme.colors.surface}"; - selection_foreground = "none"; - - # cursor - url_color = "#${config.theme.colors.bright.yellow}"; - cursor = "#${config.theme.colors.text}"; - - # colors - background = "#${config.theme.colors.base}"; - foreground = "#${config.theme.colors.text}"; - - # normal - color0 = "#${config.theme.colors.normal.black}"; - color1 = "#${config.theme.colors.normal.red}"; - color2 = "#${config.theme.colors.normal.green}"; - color3 = "#${config.theme.colors.normal.yellow}"; - color4 = "#${config.theme.colors.normal.blue}"; - color5 = "#${config.theme.colors.normal.magenta}"; - color6 = "#${config.theme.colors.normal.cyan}"; - color7 = "#${config.theme.colors.normal.white}"; - - # bright - color8 = "#${config.theme.colors.bright.black}"; - color9 = "#${config.theme.colors.bright.red}"; - color10 = "#${config.theme.colors.bright.green}"; - color11 = "#${config.theme.colors.bright.yellow}"; - color12 = "#${config.theme.colors.bright.blue}"; - color13 = "#${config.theme.colors.bright.magenta}"; - color14 = "#${config.theme.colors.bright.cyan}"; - color15 = "#${config.theme.colors.bright.white}"; - }; - }; - }; - }; -} diff --git a/modules/apps/mako.nix b/modules/apps/mako.nix deleted file mode 100644 index 62e5712..0000000 --- a/modules/apps/mako.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib) mkIf; - cfg = config.apps; -in { - config = mkIf cfg.mako { - home-manager.users.${config.user} = { - services.mako = { - enable = false; # now using astal - - settings = { - font = "${config.theme.font.monospace} 11"; - - margin = toString config.theme.outerGap; - padding = toString config.theme.innerGap; - - background-color = "#${config.theme.colors.base}"; - progress-color = "#${config.theme.colors.primary}"; - text-color = "#${config.theme.colors.text}"; - - border-color = "#${config.theme.colors.text}"; - border-size = config.theme.borderWidth; - border-radius = config.theme.outerRadius; - - default-timeout = 5000; - layer = "overlay"; - icons = true; - }; - }; - }; - }; -} diff --git a/modules/apps/waybar/default.nix b/modules/apps/waybar/default.nix deleted file mode 100644 index ecbbcd4..0000000 --- a/modules/apps/waybar/default.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib) mkIf; - cfg = config.apps; -in { - config = mkIf cfg.waybar { - home-manager.users.${config.user} = { - programs.waybar = { - enable = false; # using astal now - - settings = [ - { - height = 24; - layer = "top"; - position = "top"; - spacing = 4; - - modules-left = [ - "hyprland/workspaces" - ]; - modules-center = [ - "clock" - ]; - modules-right = [ - "battery" - "wireplumber" - "network" - "tray" - ]; - - "hyprland/workspaces" = { - disable-scroll = true; - all-outputs = true; - format = "{name}"; - }; - - battery = { - interval = 1; - states = { - warning = 30; - critical = 15; - }; - format = " {capacity}%"; - format-charging = " {capacity}%"; - format-plugged = " {capacity}%"; - format-full = " {capacity}%"; - format-warning = " {capacity}%"; - format-critical = " {capacity}%"; - }; - - wireplumber = { - format = " {volume}%"; - format-bluetooth = " {volume}%"; - format-muted = " muted"; - scroll-step = 1; - on-click = "pavucontrol"; - ignored-sinks = ["Easy Effects Sink"]; - }; - - network = { - format = " disconnected"; - format-wifi = " {essid}"; - format-ethernet = " {ipaddr}/{cidr}"; - format-disconnected = " disconnected"; - max-length = 50; - on-click = "nm-connection-editor"; - }; - - clock = { - interval = 1; - format = "{:%Y-%m-%d %a %H:%M:%S}"; - }; - - tray = { - spacing = config.theme.outerGap; - }; - } - ]; - - style = import ./style.nix {theme = config.theme;}; - }; - }; - }; -} diff --git a/modules/apps/wofi/default.nix b/modules/apps/wofi/default.nix deleted file mode 100644 index 6036dd1..0000000 --- a/modules/apps/wofi/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib) mkIf; - cfg = config.apps; -in { - config = mkIf cfg.wofi { - default.appLauncher = lib.mkDefault "wofi --show drun --prompt 'Seach Programs'"; - - home-manager.users.${config.user} = { - programs.wofi = { - enable = true; - - settings = { - key_expand = "Tab"; - term = "kitty"; - matching = "multi-contains"; - insensitive = true; - gtk_dark = true; - hide_scroll = true; - }; - - style = import ./style.nix {theme = config.theme;}; - }; - }; - }; -} diff --git a/modules/browsers/default.nix b/modules/browsers/default.nix deleted file mode 100644 index 29049f4..0000000 --- a/modules/browsers/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - lib, - config, - ... -}: let - inherit (lib) mkEnableOption; -in { - imports = [ - ./firefox - ./zen.nix - ]; - - options.browsers = { - firefox = mkEnableOption "Enable the firefox browser."; - zen = mkEnableOption "Enable the zen browser."; - }; -} diff --git a/modules/browsers/firefox/default.nix b/modules/browsers/firefox/default.nix deleted file mode 100644 index 61a5db0..0000000 --- a/modules/browsers/firefox/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - extraPrefs = lib.fileContents ./mozilla.cfg; - userChrome = lib.fileContents ./userChrome.css; - my-firefox = pkgs.firefox.override { - extraPrefs = extraPrefs; - }; - - inherit (lib) mkIf; - cfg = config.browsers; -in { - config = mkIf cfg.firefox { - default.browser = lib.mkDefault "firefox"; - - home-manager.users.${config.user} = { - programs.firefox = { - enable = true; - package = my-firefox; - - # import configuration - policies = import ./policies.nix; - - # create profile for me :3 - profiles.${config.user} = { - search = { - force = true; - default = "ddg"; - }; - - userChrome = userChrome; - }; - }; - }; - }; -} diff --git a/modules/browsers/zen.nix b/modules/browsers/zen.nix deleted file mode 100644 index e57625f..0000000 --- a/modules/browsers/zen.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - config, - lib, - inputs, - ... -}: let - inherit (lib) mkIf; - cfg = config.browsers; -in { - config = mkIf cfg.zen { - default.browser = lib.mkDefault "zen"; - - home-manager.users.${config.user} = { - imports = [ - inputs.zen-browser.homeModules.default - ]; - - programs.zen-browser = { - enable = true; - - # import configuration - policies = import ./firefox/policies.nix; - - # create profile for me :3 - profiles.${config.user} = { - search = { - force = true; - default = "ddg"; - }; - }; - }; - }; - }; -} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index ffc8466..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{...}: { - imports = [ - ./apps - ./browsers - ./desktops - ./development - ./gaming - ./virt - ./options.nix - ]; -} diff --git a/modules/desktops/hyprland/binds.nix b/modules/desktops/hyprland/binds.nix deleted file mode 100644 index 98d531b..0000000 --- a/modules/desktops/hyprland/binds.nix +++ /dev/null @@ -1,141 +0,0 @@ -{config, ...}: { - home-manager.users.${config.user} = { - wayland.windowManager.hyprland.settings = { - # Keybinds - "$mod" = "SUPER"; - bind = [ - # Launch programs - - "$mod, W, exec, ${config.default.browser}" - "$mod, D, exec, ${config.default.appLauncher}" - "$mod, L, exec, ${config.default.lockScreen}" - "$mod, Return, exec, ${config.default.terminal}" - ", Print, exec, grimblast copy area" - - # Misc - - "$mod SHIFT, L, exit" - "$mod, tab, hyprexpo:expo, toggle" - - # Window operations - - "$mod SHIFT, Q, killactive" - "$mod SHIFT, SPACE, togglefloating" - "$mod, F, fullscreen" - "$mod, J, togglesplit" - - # Move focus with mod + arrow keys - - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - - # Move window across workspace with mod + arrow keys - - "$mod SHIFT, left, hy3:movewindow, l" - "$mod SHIFT, right, hy3:movewindow, r" - "$mod SHIFT, up, hy3:movewindow, u" - "$mod SHIFT, down, hy3:movewindow, d" - - # Switch workspaces with mod + [0-9] - - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - - # Move active window to a workspace with mod + SHIFT + [0-9] - - "$mod SHIFT, 1, movetoworkspacesilent, 1" - "$mod SHIFT, 2, movetoworkspacesilent, 2" - "$mod SHIFT, 3, movetoworkspacesilent, 3" - "$mod SHIFT, 4, movetoworkspacesilent, 4" - "$mod SHIFT, 5, movetoworkspacesilent, 5" - "$mod SHIFT, 6, movetoworkspacesilent, 6" - "$mod SHIFT, 7, movetoworkspacesilent, 7" - "$mod SHIFT, 8, movetoworkspacesilent, 8" - "$mod SHIFT, 9, movetoworkspacesilent, 9" - "$mod SHIFT, 0, movetoworkspacesilent, 10" - - # Move to tab - - "LALT, 1, hy3:focustab, index, 01" - "LALT, 2, hy3:focustab, index, 02" - "LALT, 3, hy3:focustab, index, 03" - "LALT, 4, hy3:focustab, index, 04" - "LALT, 5, hy3:focustab, index, 05" - "LALT, 6, hy3:focustab, index, 06" - "LALT, 7, hy3:focustab, index, 07" - "LALT, 8, hy3:focustab, index, 08" - "LALT, 9, hy3:focustab, index, 09" - "LALT, 0, hy3:focustab, index, 10" - - "$mod SHIFT, B, hy3:makegroup, h" - "$mod SHIFT, V, hy3:makegroup, v" - "$mod SHIFT, C, hy3:changegroup, toggletab" - - # Scroll through existing workspaces with mod + scroll - - "$mod, mouse_down, workspace, e+1" - "$mod, mouse_up, workspace, e-1" - ]; - - bindn = [ - # Focus windows with scroll wheel or middle click - - ", mouse:272, hy3:focustab, mouse" - ", mouse_down, hy3:focustab, l, require_hovered" - ", mouse_up, hy3:focustab, r, require_hovered" - ]; - - bindm = [ - # Move/resize windows with mod + LMB/RMB and dragging - - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; - - binde = [ - # Audio - - # raise volume - ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" - # lower volume - ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - # mute speaker - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - # mute mic - ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" - - # Media - - # play - ", XF86AudioPlay, exec, playerctl play-pause" - # next - ", XF86AudioNext, exec, playerctl next" - # prev - ", XF86AudioPrev, exec, playerctl previous" - - # Backlight - - ", XF86MonBrightnessDown, exec, brightnessctl set 5%-" - ", XF86MonBrightnessUp, exec, brightnessctl set 5%+" - ]; - - bindl = let - monitor = builtins.elemAt config.monitors 0; - cfg = "highres, auto, ${toString monitor.scale}, bitdepth, ${toString monitor.bitdepth}"; - in [ - # Laptops when docked - ", switch:on:Lid, exec, hyprctl keyword monitor \"${monitor.name}, disable\"" - ", switch:off:Lid, exec, hyprctl keyword monitor \"${monitor.name}, ${cfg}\"" - ]; - }; - }; -} diff --git a/modules/desktops/hyprland/default.nix b/modules/desktops/hyprland/default.nix deleted file mode 100644 index f2b031b..0000000 --- a/modules/desktops/hyprland/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - inputs, - config, - system, - lib, - ... -}: let - inherit (lib) mkIf mkDefault; - cfg = config.desktops; -in { - imports = [ - ./binds.nix - ./env.nix - ./idle.nix - ./plugins.nix - ./settings.nix - ./wallpaper.nix - ]; - - config = mkIf cfg.hyprland { - desktops.wayland = true; - - environment.systemPackages = [ - inputs.rose-pine-hyprcursor.packages.${system}.default - ]; - - xdg.portal = { - extraPortals = [ - inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland - ]; - config = { - hyprland.common = ["gtk" "hyprland"]; - }; - }; - - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${system}.hyprland; - portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; - }; - - home-manager.users.${config.user} = { - wayland.windowManager.hyprland = { - enable = true; - package = inputs.hyprland.packages.${system}.hyprland; - - xwayland.enable = true; - systemd.enable = true; - }; - }; - }; -} diff --git a/modules/desktops/hyprland/env.nix b/modules/desktops/hyprland/env.nix deleted file mode 100644 index aff3f93..0000000 --- a/modules/desktops/hyprland/env.nix +++ /dev/null @@ -1,16 +0,0 @@ -{config, ...}: { - home-manager.users.${config.user} = { - wayland.windowManager.hyprland.settings = { - env = [ - "XDG_CURRENT_DESKTOP,Hyprland" - "XDG_SESSION_TYPE,wayland" - "XDG_SESSION_DESKTOP,Hyprland" - "MOZ_ENABLE_WAYLAND,1" - "NIXOS_OZONE_WL,1" - - "HYPRCURSOR_THEME,rose-pine-hyprcursor" - "HYPRCURSOR_SIZE,24" - ]; - }; - }; -} diff --git a/modules/desktops/hyprland/idle.nix b/modules/desktops/hyprland/idle.nix deleted file mode 100644 index d09e665..0000000 --- a/modules/desktops/hyprland/idle.nix +++ /dev/null @@ -1,37 +0,0 @@ -{config, ...}: { - home-manager.users.${config.user} = { - services.hypridle = { - enable = config.desktops.hyprland; - systemdTarget = "hyprland-session.target"; - - settings = { - general = { - lock_cmd = "pidof ${config.default.lockScreen} || ${config.default.lockScreen}"; - before_sleep_cmd = "loginctl lock-session"; - after_sleep_cmd = "hyprctl dispatch dpms on"; - ignore_dbus_inhibit = false; - }; - - listener = [ - # dim screen - { - timeout = 150; - on-timeout = "brightnessctl -s set 10"; - on-resume = "brightnessctl -r"; - } - # lock - { - timeout = 300; - on-timeout = "loginctl lock-session"; - } - # turn off screen - { - timeout = 350; - on-timeout = "hyprctl dispatch dpms off"; - on-resume = "hyprctl dispatch dpms on"; - } - ]; - }; - }; - }; -} diff --git a/modules/desktops/hyprland/plugins.nix b/modules/desktops/hyprland/plugins.nix deleted file mode 100644 index e4d66ef..0000000 --- a/modules/desktops/hyprland/plugins.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - inputs, - config, - system, - ... -}: { - home-manager.users.${config.user} = { - wayland.windowManager.hyprland = { - plugins = [ - inputs.hyprland-plugins.packages.${system}.hyprexpo - inputs.hy3.packages.${system}.hy3 - ]; - - settings.plugin = { - # hy3 - hy3 = { - tabs = { - height = 24; - text_height = 9; - text_padding = 10; - padding = 2; - render_text = true; - text_font = "monospace"; - radius = config.theme.outerRadius; - border_width = config.theme.borderWidth; - - "col.active" = "rgb(${config.theme.colors.base})"; - "col.active.border" = "rgb(${config.theme.colors.primary})"; - "col.active.text" = "rgb(${config.theme.colors.text})"; - "col.inactive" = "rgb(${config.theme.colors.base})"; - "col.inactive.border" = "rgb(${config.theme.colors.surface})"; - "col.inactive.text" = "rgb(${config.theme.colors.text})"; - }; - - autotile = { - enable = true; - }; - }; - }; - }; - }; -} diff --git a/modules/desktops/hyprland/settings.nix b/modules/desktops/hyprland/settings.nix deleted file mode 100644 index da55533..0000000 --- a/modules/desktops/hyprland/settings.nix +++ /dev/null @@ -1,127 +0,0 @@ -{ - config, - pkgs, - lib, - inputs, - ... -}: { - home-manager.users.${config.user} = { - wayland.windowManager.hyprland = { - importantPrefixes = [ - "bezier" - "enabled" - "output" - ]; - - settings = { - # Monitors - monitorv2 = - map (monitor: { - output = monitor.name; - mode = "highres"; - scale = toString monitor.scale; - bitdepth = toString monitor.bitdepth; - }) - config.monitors; - - # Autostart - exec-once = config.autoRun; - - # General - general = { - gaps_in = config.theme.innerGap; - gaps_out = config.theme.outerGap; - layout = "hy3"; - resize_on_border = "yes"; - extend_border_grab_area = 20; - border_size = config.theme.borderWidth; - "col.active_border" = "rgb(${config.theme.colors.primary})"; - "col.inactive_border" = "rgb(${config.theme.colors.surface})"; - }; - - # Gestures - gestures = { - workspace_swipe = true; - workspace_swipe_fingers = 3; - workspace_swipe_forever = true; - workspace_swipe_cancel_ratio = 0.15; - }; - - # Decoration - decoration = { - rounding = config.theme.outerRadius; - shadow.enabled = false; - blur = { - enabled = config.theme.blur; - size = 4; - passes = 2; - noise = 0.008; - contrast = 0.8916; - brightness = 0.8; - }; - }; - - animations = { - enabled = true; - - bezier = [ - "windowIn, 0.06, 0.71, 0.25, 1" - "windowResize, 0.04, 0.67, 0.38, 1" - ]; - - animation = [ - "windowsIn, 1, 3, windowIn, slide #popin 20%" - "windowsOut, 1, 3, windowIn, slide #popin 70%" - "windowsMove, 1, 2.5, windowResize" - "border, 1, 10, default" - "borderangle, 1, 8, default" - "fade, 1, 3, default" - "workspaces, 1, 6, default" - "layers, 1, 5, windowIn, slide" - ]; - }; - - # Input - input = { - kb_layout = "us"; - kb_variant = ""; - kb_model = ""; - kb_options = "gtp:alt_shift_toggle, compose:ralt"; - kb_rules = ""; - follow_mouse = 1; - touchpad = { - natural_scroll = "yes"; - }; - sensitivity = 0; - }; - - # XWayland - xwayland = { - force_zero_scaling = "true"; - use_nearest_neighbor = "false"; - }; - - # Misc - misc = { - disable_hyprland_logo = true; - disable_splash_rendering = true; - key_press_enables_dpms = true; - mouse_move_enables_dpms = true; - enable_anr_dialog = false; - vrr = 1; - }; - - # Ecosystem - ecosystem = { - no_update_news = true; - no_donation_nag = true; - }; - - # Experimental - experimental = { - xx_color_management_v4 = true; - }; - }; # end settings - }; # end hyprland - }; # end home-manager -} diff --git a/modules/desktops/hyprland/wallpaper.nix b/modules/desktops/hyprland/wallpaper.nix deleted file mode 100644 index b877774..0000000 --- a/modules/desktops/hyprland/wallpaper.nix +++ /dev/null @@ -1,13 +0,0 @@ -{config, ...}: { - home-manager.users.${config.user} = { - services.hyprpaper = { - enable = config.desktops.hyprland; - - settings = { - preload = config.theme.wallpaper; - wallpaper = ",${config.theme.wallpaper}"; - splash = false; - }; - }; - }; -} diff --git a/modules/desktops/sway/binds.nix b/modules/desktops/sway/binds.nix deleted file mode 100644 index 812d446..0000000 --- a/modules/desktops/sway/binds.nix +++ /dev/null @@ -1,91 +0,0 @@ -{config, ...}: let - mod = "Mod4"; -in { - home-manager.users.${config.user} = { - wayland.windowManager.sway = { - config = { - keybindings = { - # apps - "${mod}+Return" = "exec ${config.default.terminal}"; - "${mod}+l" = "exec ${config.default.lockScreen}"; - "${mod}+d" = "exec ${config.default.appLauncher}"; - "${mod}+w" = "exec ${config.default.browser}"; - - # exit - "${mod}+Shift+l" = "exit"; - # kill focused window - "${mod}+Shift+q" = "kill"; - # reload sway - "${mod}+F5" = "reload"; - - # audio - "XF86AudioRaiseVolume" = "exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"; - "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; - "XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - "XF86AudioMicMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; - - # media - "XF86AudioPlay" = "exec playerctl play-pause"; - "XF86AudioNext" = "exec playerctl next"; - "XF86AudioPrev" = "exec playerctl previous"; - - # backlight - "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; - "XF86MonBrightnessUp" = "exec brightnessctl set 5%+"; - - # screenshot - "Print" = "exec grimblast copy area"; - - # move focus - "${mod}+Left" = "focus left"; - "${mod}+Down" = "focus down"; - "${mod}+Up" = "focus up"; - "${mod}+Right" = "focus right"; - - # move focused window - "${mod}+Shift+Left" = "move left"; - "${mod}+Shift+Down" = "move down"; - "${mod}+Shift+Up" = "move up"; - "${mod}+Shift+Right" = "move right"; - - # switch workspace - "${mod}+1" = "workspace number 1"; - "${mod}+2" = "workspace number 2"; - "${mod}+3" = "workspace number 3"; - "${mod}+4" = "workspace number 4"; - "${mod}+5" = "workspace number 5"; - "${mod}+6" = "workspace number 6"; - "${mod}+7" = "workspace number 7"; - "${mod}+8" = "workspace number 8"; - "${mod}+9" = "workspace number 9"; - - # move focused container to workspace - "${mod}+Shift+1" = "move container to workspace number 1"; - "${mod}+Shift+2" = "move container to workspace number 2"; - "${mod}+Shift+3" = "move container to workspace number 3"; - "${mod}+Shift+4" = "move container to workspace number 4"; - "${mod}+Shift+5" = "move container to workspace number 5"; - "${mod}+Shift+6" = "move container to workspace number 6"; - "${mod}+Shift+7" = "move container to workspace number 7"; - "${mod}+Shift+8" = "move container to workspace number 8"; - "${mod}+Shift+9" = "move container to workspace number 9"; - - # layout - "${mod}+Shift+d" = "layout default"; - "${mod}+Shift+b" = "layout splith"; - "${mod}+Shift+v" = "layout splitv"; - "${mod}+Shift+c" = "layout tabbed"; - - # fullscreen - "${mod}+f" = "fullscreen"; - # float - "${mod}+Shift+space" = "floating toggle"; - # focus - "${mod}+space" = "focus mode_toggle"; - # parent - "${mod}+a" = "focus parent"; - }; - }; - }; - }; -} diff --git a/modules/desktops/sway/config.nix b/modules/desktops/sway/config.nix deleted file mode 100644 index c6c78ca..0000000 --- a/modules/desktops/sway/config.nix +++ /dev/null @@ -1,124 +0,0 @@ -{config, ...}: { - home-manager.users.${config.user} = { - wayland.windowManager.sway = { - config = { - # monitors - output = - (builtins.listToAttrs (map (mon: { - name = mon.name; - value = { - dpms = "on"; - scale = toString mon.scale; - render_bit_depth = toString mon.bitdepth; - }; - }) - config.monitors)) - // { - # wallpaper - "*" = { - bg = "${config.theme.wallpaper} fill"; - }; - }; - - # inputs - input = { - "*" = { - xkb_layout = "us"; - xkb_options = "compose:ralt"; - xkb_numlock = "enable"; - }; - - "type:touchpad" = { - tap = "enabled"; - natural_scroll = "enabled"; - middle_emulation = "enabled"; - }; - }; - - startup = - # autostart apps - builtins.map (command: { - inherit command; - always = false; - }) - config.autoRun; - - # colors - colors = let - base = "#${config.theme.colors.base}"; - surface = "#${config.theme.colors.surface}"; - primary = "#${config.theme.colors.primary}"; - text = "#${config.theme.colors.text}"; - white = "#${config.theme.colors.bright.white}"; - error = "#${config.theme.colors.error}"; - in rec { - background = base; - - focused = { - border = primary; - background = base; - text = text; - indicator = white; - childBorder = primary; - }; - - focusedInactive = { - border = surface; - background = base; - text = text; - indicator = surface; - childBorder = surface; - }; - - unfocused = focusedInactive; - - urgent = { - border = error; - background = error; - text = text; - indicator = error; - childBorder = error; - }; - - placeholder = unfocused; - }; - - window = { - titlebar = false; - border = config.theme.borderWidth; - }; - - floating = { - titlebar = false; - border = config.theme.borderWidth; - modifier = "Mod4 normal"; - }; - - gaps = { - inner = config.theme.innerGap; - outer = config.theme.outerGap; - }; - - modes = {}; - bars = []; - }; - - extraConfig = '' - # gestures - bindgesture swipe:right workspace prev - bindgesture swipe:left workspace next - - # swayfx - corner_radius ${toString config.theme.outerRadius} - smart_corner_radius ${toString config.theme.outerRadius} - blur ${ - if config.theme.blur - then "enabled" - else "disabled" - } - blur_radius 10 - blur_passes 3 - ''; - }; - }; -} diff --git a/modules/desktops/sway/idle.nix b/modules/desktops/sway/idle.nix deleted file mode 100644 index b3e3e06..0000000 --- a/modules/desktops/sway/idle.nix +++ /dev/null @@ -1,27 +0,0 @@ -{config, ...}: { - home-manager.users.${config.user} = { - services.swayidle = { - enable = config.desktops.sway; - systemdTarget = "sway-session.target"; - - timeouts = [ - { - timeout = 300; - command = "${config.default.lockScreen}"; - } - { - timeout = 300; - command = "swaymsg \"output * power off\""; - resumeCommand = "swaymsg \"output * power on\""; - } - ]; - - events = [ - { - event = "before-sleep"; - command = "${config.default.lockScreen}"; - } - ]; - }; - }; -} diff --git a/modules/development/default.nix b/modules/development/default.nix deleted file mode 100644 index c5666a5..0000000 --- a/modules/development/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - inherit (lib) mkEnableOption optionals; - cfg = config.development; -in { - options.development = { - c = mkEnableOption "Enable c/c++ development tools."; - java = mkEnableOption "Enable java/kotlin development tools."; - lua = mkEnableOption "Enable lua development tools."; - rust = mkEnableOption "Enable rust development tools."; - web = mkEnableOption "Enable web development tools."; - zig = mkEnableOption "Enable zig development tools."; - }; - - config = { - home-manager.users.${config.user} = { - home.packages = with pkgs; - (optionals cfg.c [ - clang-tools - gcc - gdb - gnumake - nasm - pkg-config - ]) - ++ (optionals cfg.lua [ - lua-language-server - ]) - ++ (optionals cfg.rust [ - rustc - rustfmt - rust-analyzer - cargo - clippy - ]) - ++ (optionals cfg.java [ - gradle - jdk - jdt-language-server - kotlin - kotlin-language-server - maven - ]) - ++ (optionals cfg.web [ - phpactor - sassc - typescript-language-server - ]) - ++ (optionals cfg.zig [ - zig - zls - ]); - }; - }; -} diff --git a/modules/gaming/default.nix b/modules/gaming/default.nix deleted file mode 100644 index a0c826c..0000000 --- a/modules/gaming/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - config, - ... -}: let - inherit (lib) mkEnableOption; -in { - imports = [ - ./homestuck.nix - ./minecraft.nix - ./steam.nix - ]; - - options.gaming = { - homestuck = mkEnableOption "Install the unofficial homestuck collection."; - minecraft = mkEnableOption "Install the minecraft block game."; - steam = mkEnableOption "Install the steam game launcher."; - }; -} diff --git a/modules/gaming/homestuck.nix b/modules/gaming/homestuck.nix deleted file mode 100644 index 681325b..0000000 --- a/modules/gaming/homestuck.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - lib, - config, - inputs, - system, - ... -}: let - inherit (lib) mkIf; - cfg = config.gaming; -in { - config = mkIf cfg.homestuck { - home-manager.users.${config.user} = { - home.packages = [ - inputs.self.packages.${system}.unofficial-homestuck-collection - ]; - }; - }; -} diff --git a/modules/gaming/minecraft.nix b/modules/gaming/minecraft.nix deleted file mode 100644 index 5de20e6..0000000 --- a/modules/gaming/minecraft.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - inherit (lib) mkIf; - cfg = config.gaming; -in { - config = mkIf cfg.minecraft { - home-manager.users.${config.user} = { - home.packages = with pkgs; [ - prismlauncher - ]; - }; - }; -} diff --git a/modules/options.nix b/modules/options.nix deleted file mode 100644 index 2571b9c..0000000 --- a/modules/options.nix +++ /dev/null @@ -1,393 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - # monitor options - monitorOpts = self: { - options = { - name = mkOption { - type = types.str; - description = "Name of the monitor."; - }; - - scale = mkOption { - type = types.float; - description = "Scaling factor of the monitor."; - default = 1.0; - }; - - bitdepth = mkOption { - type = types.int; - description = "Monitor color bitdepth"; - default = 8; - }; - }; - }; - - # theme color options - - colorOpts = self: { - options = { - name = mkOption { - type = types.str; - description = "Name of the theme"; - }; - - author = mkOption { - type = types.str; - description = "Author of the theme"; - }; - - text = mkOption { - type = types.str; - description = "Text color."; - }; - - subtext = mkOption { - type = types.str; - description = "Subtext color."; - }; - - base = mkOption { - type = types.str; - description = "Base background color."; - }; - - surface = mkOption { - type = types.str; - description = "Surface (lighter) background color."; - }; - - overlay = mkOption { - type = types.str; - description = "Overlay (light) background color."; - }; - - primary = mkOption { - type = types.str; - description = "Primary accent color"; - }; - - success = mkOption { - type = types.str; - description = "Success color"; - }; - - warning = mkOption { - type = types.str; - description = "Warning color"; - }; - - error = mkOption { - type = types.str; - description = "Error color"; - }; - - normal = { - black = mkOption { - type = types.str; - description = "Terminal black normal color"; - }; - - red = mkOption { - type = types.str; - description = "Terminal red normal color"; - }; - - green = mkOption { - type = types.str; - description = "Terminal green normal color"; - }; - - yellow = mkOption { - type = types.str; - description = "Terminal yellow normal color"; - }; - - blue = mkOption { - type = types.str; - description = "Terminal blue normal color"; - }; - - magenta = mkOption { - type = types.str; - description = "Terminal magenta normal color"; - }; - - cyan = mkOption { - type = types.str; - description = "Terminal cyan normal color"; - }; - - white = mkOption { - type = types.str; - description = "Terminal white normal color"; - }; - - pink = mkOption { - type = types.str; - description = "Terminal pink (extended) normal color."; - }; - - orange = mkOption { - type = types.str; - description = "Terminal orange (extended) normal color."; - }; - }; - - bright = { - black = mkOption { - type = types.str; - description = "Terminal black bright color"; - }; - - red = mkOption { - type = types.str; - description = "Terminal red bright color"; - }; - - green = mkOption { - type = types.str; - description = "Terminal green bright color"; - }; - - yellow = mkOption { - type = types.str; - description = "Terminal yellow bright color"; - }; - - blue = mkOption { - type = types.str; - description = "Terminal blue bright color"; - }; - - magenta = mkOption { - type = types.str; - description = "Terminal magenta bright color"; - }; - - cyan = mkOption { - type = types.str; - description = "Terminal cyan bright color"; - }; - - white = mkOption { - type = types.str; - description = "Terminal white bright color"; - }; - - pink = mkOption { - type = types.str; - description = "Terminal pink (extended) bright color."; - }; - - orange = mkOption { - type = types.str; - description = "Terminal orange (extended) bright color."; - }; - }; - }; - }; -in { - options = { - # - # System information - # - hostName = mkOption { - type = types.str; - description = "Hostname of the system."; - }; - timeZone = mkOption { - type = types.str; - description = "System time zone"; - default = "America/New_York"; - }; - stateVersion = mkOption { - type = types.str; - description = "NixOS State Version"; - }; - - # - # System modules - # - battery = mkEnableOption { - description = "Install battery and power system services and programs."; - }; - bluetooth = mkEnableOption { - description = "Install bluetooth system services and programs."; - }; - fingerprint = mkEnableOption { - description = "Install fingerprint system services and programs."; - }; - network = mkEnableOption { - description = "Install networking system services and programs."; - }; - tpm = mkEnableOption { - description = "Enable system TPM"; - }; - minimal = mkEnableOption { - description = "Install only required system services, drivers, and programs."; - }; - - # - # Primary user of the system - # - user = mkOption { - type = types.str; - description = "Primary user of the system"; - }; - fullName = mkOption { - type = types.str; - description = "Human readable name of the user"; - }; - email = mkOption { - type = types.str; - description = "Primary email of the user"; - }; - homePath = mkOption { - type = types.path; - description = "Home directory path of the user"; - default = builtins.toPath "/home/${config.user}"; - }; - dotfilesPath = mkOption { - type = types.path; - description = "Dotfiles path inside the users home dir"; - default = builtins.toPath "${config.homePath}/.config/nix"; - }; - - # - # Monitors of the system - # - monitors = mkOption { - default = []; - description = "Monitors of the system."; - type = with types; listOf (submodule monitorOpts); - }; - - # - # Theme of the system - # - theme = { - colors = mkOption { - type = with types; (submodule colorOpts); - description = "color scheme"; - }; - - opacity = mkOption { - type = types.float; - description = "Window opacity."; - }; - - # theme fonts - font = { - size = mkOption { - type = types.int; - description = "Theme primary font size."; - }; - - regular = mkOption { - type = types.str; - description = "Regular system font."; - }; - - monospace = mkOption { - type = types.str; - description = "Monospace system font."; - }; - - header = mkOption { - type = types.str; - description = "Header system font."; - }; - - icon = mkOption { - type = types.str; - description = "Icon system font."; - }; - }; - - borderWidth = mkOption { - type = types.int; - description = "Theme border width"; - }; - - outerRadius = mkOption { - type = types.int; - description = "Theme outer border radius."; - }; - - innerRadius = mkOption { - type = types.int; - description = "Theme inner border radius."; - }; - - outerGap = mkOption { - type = types.int; - description = "Theme outer gap/spacing."; - }; - - innerGap = mkOption { - type = types.int; - description = "Theme inner gap/spacing."; - }; - - blur = mkEnableOption { - description = "If to enable blur in some programs."; - }; - - wallpaper = mkOption { - type = types.str; - description = "Path to wallpaper image"; - }; - - lockscreen = mkOption { - type = types.str; - description = "Path to lockscreen image"; - }; - - avatar = mkOption { - type = types.str; - description = "Path to avatar image"; - }; - }; - - # - # Default programs - # - default = { - browser = mkOption { - type = types.str; - description = "Default browser launch command."; - }; - appLauncher = mkOption { - type = types.str; - description = "Default application launcher launch command."; - }; - lockScreen = mkOption { - type = types.str; - description = "Default lock screen launch command."; - }; - terminal = mkOption { - type = types.str; - description = "Default terminal launch command."; - }; - session = mkOption { - type = types.str; - description = "Default systemd graphical session target."; - default = "graphical-session.target"; - }; - }; - - # - # Programs to auto start on launch - # - autoRun = mkOption { - type = with types; listOf str; - description = "List of programs to auto run in a graphical environment."; - default = []; - }; - }; -} diff --git a/modules/virt/default.nix b/modules/virt/default.nix deleted file mode 100644 index c5d3960..0000000 --- a/modules/virt/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - inherit (lib) mkEnableOption; - cfg = config.virt; -in { - imports = [ - ./docker.nix - ./qemu.nix - ]; - - options.virt = { - docker = mkEnableOption "Install docker and its components."; - qemu = mkEnableOption "Install qemu and its components."; - }; -} diff --git a/options.nix b/options.nix index e80b028..1a569c2 100644 --- a/options.nix +++ b/options.nix @@ -1,38 +1,478 @@ { - user = "freya"; - fullName = "Freya Murphy"; - email = "freya@freyacat.org"; + config, + lib, + ... +}: +with lib; let + # monitor options + monitorOpts = self: { + options = { + name = mkOption { + type = types.str; + description = "Name of the monitor."; + }; - theme = { - colors = (import ./themes).catppuccin.mocha; + scale = mkOption { + type = types.float; + description = "Scaling factor of the monitor."; + default = 1.0; + }; - font = { - size = 14; - monospace = "monospace"; - regular = "SF Pro Text"; - header = "SF Pro Display Bold"; - icon = "Font Awesome 6 Pro"; + bitdepth = mkOption { + type = types.int; + description = "Monitor color bitdepth"; + default = 8; + }; }; + }; + + # theme color options + + colorOpts = self: { + options = { + name = mkOption { + type = types.str; + description = "Name of the theme"; + }; + + author = mkOption { + type = types.str; + description = "Author of the theme"; + }; + + text = mkOption { + type = types.str; + description = "Text color."; + }; + + subtext = mkOption { + type = types.str; + description = "Subtext color."; + }; + + base = mkOption { + type = types.str; + description = "Base background color."; + }; + + surface = mkOption { + type = types.str; + description = "Surface (lighter) background color."; + }; + + overlay = mkOption { + type = types.str; + description = "Overlay (light) background color."; + }; + + primary = mkOption { + type = types.str; + description = "Primary accent color"; + }; + + success = mkOption { + type = types.str; + description = "Success color"; + }; + + warning = mkOption { + type = types.str; + description = "Warning color"; + }; + + error = mkOption { + type = types.str; + description = "Error color"; + }; + + normal = { + black = mkOption { + type = types.str; + description = "Terminal black normal color"; + }; + + red = mkOption { + type = types.str; + description = "Terminal red normal color"; + }; + + green = mkOption { + type = types.str; + description = "Terminal green normal color"; + }; + + yellow = mkOption { + type = types.str; + description = "Terminal yellow normal color"; + }; + + blue = mkOption { + type = types.str; + description = "Terminal blue normal color"; + }; + + magenta = mkOption { + type = types.str; + description = "Terminal magenta normal color"; + }; + + cyan = mkOption { + type = types.str; + description = "Terminal cyan normal color"; + }; + + white = mkOption { + type = types.str; + description = "Terminal white normal color"; + }; - borderWidth = 2; - opacity = 0.75; - outerRadius = 8; - innerRadius = 4; - outerGap = 10; - innerGap = 3; - blur = false; + pink = mkOption { + type = types.str; + description = "Terminal pink (extended) normal color."; + }; - wallpaper = toString ./files/wallpapers/moran.jpg; - lockscreen = toString ./files/wallpapers/flower.jpg; - avatar = toString ./files/pfps/mioShun.jpg; + orange = mkOption { + type = types.str; + description = "Terminal orange (extended) normal color."; + }; + }; + + bright = { + black = mkOption { + type = types.str; + description = "Terminal black bright color"; + }; + + red = mkOption { + type = types.str; + description = "Terminal red bright color"; + }; + + green = mkOption { + type = types.str; + description = "Terminal green bright color"; + }; + + yellow = mkOption { + type = types.str; + description = "Terminal yellow bright color"; + }; + + blue = mkOption { + type = types.str; + description = "Terminal blue bright color"; + }; + + magenta = mkOption { + type = types.str; + description = "Terminal magenta bright color"; + }; + + cyan = mkOption { + type = types.str; + description = "Terminal cyan bright color"; + }; + + white = mkOption { + type = types.str; + description = "Terminal white bright color"; + }; + + pink = mkOption { + type = types.str; + description = "Terminal pink (extended) bright color."; + }; + + orange = mkOption { + type = types.str; + description = "Terminal orange (extended) bright color."; + }; + }; + }; }; +in { + options = { + # + # System information + # + hostName = mkOption { + type = types.str; + description = "Hostname of the system."; + }; + timeZone = mkOption { + type = types.str; + description = "System time zone"; + default = "America/New_York"; + }; + stateVersion = mkOption { + type = types.str; + description = "NixOS State Version"; + default = "25.11"; + }; + + # + # System modules + # + battery = mkEnableOption { + description = "Install battery and power system services and programs."; + }; + bluetooth = mkEnableOption { + description = "Install bluetooth system services and programs."; + }; + fingerprint = mkEnableOption { + description = "Install fingerprint system services and programs."; + }; + network = mkEnableOption { + description = "Install networking system services and programs."; + }; + tpm = mkEnableOption { + description = "Enable system TPM"; + }; + minimal = mkEnableOption { + description = "Install only required system services, drivers, and programs."; + }; + + # + # Primary user of the system + # + user = mkOption { + type = types.str; + description = "Primary user of the system"; + default = "freya"; + }; + fullName = mkOption { + type = types.str; + description = "Human readable name of the user"; + default = "Freya Murphy"; + }; + email = mkOption { + type = types.str; + description = "Primary email of the user"; + default = "freya@freyacat.org"; + }; + homePath = mkOption { + type = types.path; + description = "Home directory path of the user"; + default = builtins.toPath "/home/${config.user}"; + }; + dotfilesPath = mkOption { + type = types.path; + description = "Dotfiles path inside the users home dir"; + default = builtins.toPath "${config.homePath}/.config/nix"; + }; + + # + # Monitors of the system + # + monitors = mkOption { + type = with types; listOf (submodule monitorOpts); + description = "Monitors of the system."; + default = []; + }; + + # + # Theme of the system + # + theme = { + colors = mkOption { + type = with types; (submodule colorOpts); + description = "color scheme"; + default = (import ./themes).catppuccin.mocha; + }; + + opacity = mkOption { + type = types.float; + description = "Window opacity."; + default = 0.75; + }; + + # theme fonts + font = { + size = mkOption { + type = types.int; + description = "Theme primary font size."; + default = 14; + }; + + regular = mkOption { + type = types.str; + description = "Regular system font."; + default = "SF Pro Text"; + }; + + monospace = mkOption { + type = types.str; + description = "Monospace system font."; + default = "monospace"; + }; + + header = mkOption { + type = types.str; + description = "Header system font."; + default = "SF Pro Display Bold"; + }; + + icon = mkOption { + type = types.str; + description = "Icon system font."; + default = "Font Awesome 6 Pro"; + }; + }; + + borderWidth = mkOption { + type = types.int; + description = "Theme border width"; + default = 2; + }; + + outerRadius = mkOption { + type = types.int; + description = "Theme outer border radius."; + default = 8; + }; + + innerRadius = mkOption { + type = types.int; + description = "Theme inner border radius."; + default = 4; + }; + + outerGap = mkOption { + type = types.int; + description = "Theme outer gap/spacing."; + default = 10; + }; + + innerGap = mkOption { + type = types.int; + description = "Theme inner gap/spacing."; + default = 3; + }; - autoRun = [ - "wl-clip-persist -c both" - "thunderbird" - "discord" - "element-desktop" - ]; + blur = mkEnableOption { + description = "If to enable blur in some programs."; + default = false; + }; - stateVersion = "25.11"; + wallpaper = mkOption { + type = types.str; + description = "Path to wallpaper image"; + default = toString ./files/wallpapers/moran.jpg; + }; + + lockscreen = mkOption { + type = types.str; + description = "Path to lockscreen image"; + default = toString ./files/wallpapers/flower.jpg; + }; + + avatar = mkOption { + type = types.str; + description = "Path to avatar image"; + default = toString ./files/pfps/mioShun.jpg; + }; + }; + + # + # Default programs + # + default = { + browser = mkOption { + type = types.str; + description = "Default browser launch command."; + }; + appLauncher = mkOption { + type = types.str; + description = "Default application launcher launch command."; + }; + lockScreen = mkOption { + type = types.str; + description = "Default lock screen launch command."; + }; + terminal = mkOption { + type = types.str; + description = "Default terminal launch command."; + }; + session = mkOption { + type = types.str; + description = "Default systemd graphical session target."; + default = "graphical-session.target"; + }; + }; + + # + # Desktop applications to choose from + # + apps = { + alacritty.enable = mkEnableOption "Enable the alacritty terminal."; + astal.enable = mkEnableOption "Enable the astal gtk shell."; + kitty.enable = mkEnableOption "Enable the kitty terminal."; + mako.enable = mkEnableOption "Enable the mako notification daemon."; + hyprlock.enable = mkEnableOption "Enable the hyprlock lockscreen."; + waybar.enable = mkEnableOption "Enable the waybar bar."; + wofi.enable = mkEnableOption "Enable the wofi launcher."; + }; + + # + # Desktop browsers to choose from + # + browsers = { + firefox.enable = mkEnableOption "Enable the firefox browser."; + zen.enable = mkEnableOption "Enable the zen browser."; + }; + + # + # Desktops to choose from + # + desktops = { + enable = mkEnableOption "Enable baseline desktop utils and programs."; + wayland.enable = mkEnableOption "Enable wayland desktop components."; + ly.enable = mkEnableOption "Install the ly display manager."; + hyprland.enable = mkEnableOption "Install the Hyprland desktop."; + sway.enable = mkEnableOption "Install the sway desktop."; + }; + + # + # Gaming programs to choose from + # + gaming = { + homestuck.enable = mkEnableOption "Install the unofficial homestuck collection."; + minecraft.enable = mkEnableOption "Install the minecraft block game."; + steam.enable = mkEnableOption "Install the steam game launcher."; + }; + + # + # Development programming languages to enable + # + development = { + c.enable = mkEnableOption "Enable c/c++ development tools."; + java.enable = mkEnableOption "Enable java/kotlin development tools."; + lua.enable = mkEnableOption "Enable lua development tools."; + rust.enable = mkEnableOption "Enable rust development tools."; + web.enable = mkEnableOption "Enable web development tools."; + zig.enable = mkEnableOption "Enable zig development tools."; + }; + + # + # Virt/VM programs to enable + # + virt = { + docker.enable = mkEnableOption "Install docker and its components."; + qemu.enable = mkEnableOption "Install qemu and its components."; + }; + + # + # Programs to auto start on launch + # + autoRun = mkOption { + type = with types; listOf str; + description = "List of programs to auto run in a graphical environment."; + default = optionals config.desktops.enable [ + "wl-clip-persist -c both" + "thunderbird" + "discord" + "element-desktop" + ]; + }; + }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index d9f6fee..6c5b5f0 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,6 +1,20 @@ -{pkgs, ...} @ inputs: { +{ + pkgs, + inputs, + lib, + ... +}: let + options = + (lib.evalModules { + modules = [ + ../options.nix + ]; + }).config; +in { arcanist = pkgs.callPackage ./arcanist {}; - astal = pkgs.callPackage ./astal inputs; + astal = pkgs.callPackage ./astal { + inherit inputs options; + }; gibfprint-2-tod1-vfs0090 = pkgs.callPackage ./libfprint-2-tod1-vfs0090 {}; ly = pkgs.callPackage ./ly {}; unofficial-homestuck-collection = pkgs.callPackage ./unofficial-homestuck-collection {}; diff --git a/system/default.nix b/system/default.nix index e3b7c66..824c99f 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,10 +1,15 @@ { + lib, config, pkgs, - self, + inputs, ... }: { imports = [ + inputs.home-manager.nixosModules.home-manager + ./desktops + ./gaming + ./virt ./battery.nix ./bluetooth.nix ./desktop.nix @@ -27,6 +32,27 @@ # enable nixos-rebuild-ng system.rebuild.enableNg = true; + # use system packages in home manager + home-manager.useGlobalPkgs = true; + + # install user packages to /etc/profiles and not home directory + home-manager.useUserPackages = true; + + # root user home + home-manager.users.root = { + home.stateVersion = config.stateVersion; + }; + + # main user home + home-manager.extraSpecialArgs = {inherit inputs;}; + home-manager.users.${config.user} = { + imports = [ + ../home + ../options.nix + (inputs.self.lib.customConfig config) + ]; + }; + # hostname networking.hostName = config.hostName; @@ -40,7 +66,6 @@ shared-mime-info # shell bash - zsh # utility curl dig @@ -60,6 +85,9 @@ wget ]; + # system shell + programs.zsh.enable = true; + # use the latest kernel boot.kernelPackages = pkgs.linuxPackages_latest; @@ -92,5 +120,5 @@ }; # certs - security.pki.certificateFiles = self.lib.certs; + security.pki.certificateFiles = inputs.self.lib.certs; } diff --git a/system/desktops/default.nix b/system/desktops/default.nix new file mode 100644 index 0000000..8f9270f --- /dev/null +++ b/system/desktops/default.nix @@ -0,0 +1,8 @@ +{...}: { + imports = [ + ./hyprland.nix + ./ly.nix + ./sway.nix + ./wayland.nix + ]; +} diff --git a/system/desktops/hyprland.nix b/system/desktops/hyprland.nix new file mode 100644 index 0000000..91170bd --- /dev/null +++ b/system/desktops/hyprland.nix @@ -0,0 +1,29 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: let + inherit (lib) mkIf mkDefault; + cfg = config.desktops.hyprland; +in { + config = mkIf cfg.enable { + desktops.wayland.enable = true; + + xdg.portal = { + extraPortals = [ + inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland + ]; + config = { + hyprland.common = ["gtk" "hyprland"]; + }; + }; + + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + }; + }; +} diff --git a/modules/desktops/ly.nix b/system/desktops/ly.nix index 9e9e51b..ac53495 100644 --- a/modules/desktops/ly.nix +++ b/system/desktops/ly.nix @@ -2,18 +2,17 @@ lib, config, pkgs, - self, - system, + inputs, ... }: let inherit (lib) mkIf; - cfg = config.desktops; + cfg = config.desktops.ly; in { - config = mkIf cfg.ly { + config = mkIf cfg.enable { # display manager services.displayManager.ly = { enable = true; - package = self.packages.${system}.ly; + package = inputs.self.packages.${pkgs.system}.ly; settings = let base = "0x00${config.theme.colors.base}"; diff --git a/modules/desktops/sway/default.nix b/system/desktops/sway.nix index be3766d..622d54c 100644 --- a/modules/desktops/sway/default.nix +++ b/system/desktops/sway.nix @@ -5,16 +5,10 @@ ... }: let inherit (lib) mkIf mkDefault; - cfg = config.desktops; + cfg = config.desktops.sway; in { - imports = [ - ./binds.nix - ./config.nix - ./idle.nix - ]; - - config = mkIf cfg.sway { - desktops.wayland = true; + config = mkIf cfg.enable { + desktops.wayland.enable = true; # TODO: set NIXOS_OZONE_WL env var @@ -35,18 +29,5 @@ in { gtk = false; }; }; - - home-manager.users.${config.user} = { - wayland.windowManager.sway = { - enable = true; - package = pkgs.swayfx; - - # TODO: get swayfx to work with check config - checkConfig = false; - - xwayland = true; - systemd.enable = true; - }; - }; }; } diff --git a/modules/desktops/wayland.nix b/system/desktops/wayland.nix index 600651f..8a81fdf 100644 --- a/modules/desktops/wayland.nix +++ b/system/desktops/wayland.nix @@ -5,9 +5,9 @@ ... }: let inherit (lib) mkIf; - cfg = config.desktops; + cfg = config.desktops.wayland; in { - config = mkIf cfg.wayland { + config = mkIf cfg.enable { xdg.portal = { enable = true; xdgOpenUsePortal = true; diff --git a/system/fingerprint.nix b/system/fingerprint.nix index d95e929..cbf8f24 100644 --- a/system/fingerprint.nix +++ b/system/fingerprint.nix @@ -1,8 +1,8 @@ { lib, + pkgs, config, - self, - system, + inputs, ... }: let inherit (lib) mkIf; @@ -11,7 +11,7 @@ in { services.fprintd = { enable = true; tod.enable = true; - tod.driver = self.packages.${system}.libfprint-2-tod1-vfs0090; + tod.driver = inputs.self.packages.${pkgs.system}.libfprint-2-tod1-vfs0090; }; }; } diff --git a/system/gaming/default.nix b/system/gaming/default.nix new file mode 100644 index 0000000..acb0a1f --- /dev/null +++ b/system/gaming/default.nix @@ -0,0 +1,5 @@ +{...}: { + imports = [ + ./steam.nix + ]; +} diff --git a/modules/gaming/steam.nix b/system/gaming/steam.nix index 53ab252..cd243e5 100644 --- a/modules/gaming/steam.nix +++ b/system/gaming/steam.nix @@ -4,9 +4,9 @@ ... }: let inherit (lib) mkIf; - cfg = config.gaming; + cfg = config.gaming.steam; in { - config = mkIf cfg.steam { + config = mkIf cfg.enable { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam" diff --git a/system/sshd.nix b/system/sshd.nix index a1ca2f2..e7f64d8 100644 --- a/system/sshd.nix +++ b/system/sshd.nix @@ -1,7 +1,7 @@ { lib, config, - self, + inputs, ... }: let inherit (lib) mkIf; @@ -34,7 +34,7 @@ in { # add authorized keys users.users.${config.user} = { - openssh.authorizedKeys.keyFiles = self.lib.sshKeys; + openssh.authorizedKeys.keyFiles = inputs.self.lib.sshKeys; }; }; } diff --git a/system/virt/default.nix b/system/virt/default.nix new file mode 100644 index 0000000..18be703 --- /dev/null +++ b/system/virt/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./docker.nix + ./qemu.nix + ]; +} diff --git a/modules/virt/docker.nix b/system/virt/docker.nix index 5930858..2505df4 100644 --- a/modules/virt/docker.nix +++ b/system/virt/docker.nix @@ -5,9 +5,9 @@ ... }: let inherit (lib) mkIf; - cfg = config.virt; + cfg = config.virt.docker; in { - config = mkIf cfg.docker { + config = mkIf cfg.enable { virtualisation.docker.enable = true; virtualisation.docker.storageDriver = "btrfs"; users.groups.docker.members = [config.user]; diff --git a/modules/virt/qemu.nix b/system/virt/qemu.nix index f755952..6c068e4 100644 --- a/modules/virt/qemu.nix +++ b/system/virt/qemu.nix @@ -5,9 +5,9 @@ ... }: let inherit (lib) mkIf; - cfg = config.virt; + cfg = config.virt.qemu; in { - config = mkIf cfg.qemu { + config = mkIf cfg.enable { programs.virt-manager.enable = true; users.groups.kvm.members = [config.user]; users.groups.libvirtd.members = [config.user]; |