diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 16f9db54a3503f9af47818b3f803a8b5ee372e01..e124c9eba6629249090e4099937cfbade674f60b 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -12,12 +12,6 @@ ../../modules/nixos/nvidia.nix ../../modules/nixos/boot.nix ]; - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; - programs.gamemode.enable = true; programs._1password.enable = true; @@ -28,11 +22,9 @@ polkitPolicyOwners = ["nmarks"]; }; - services.blueman.enable = true; hardware.bluetooth.enable = true; services = { - ratbagd.enable = true; }; programs.noisetorch.enable = true; @@ -42,8 +34,6 @@ extraPortals = with pkgs; [xdg-desktop-portal-gtk]; }; - services.flatpak.enable = true; - virtualisation.containers.enable = true; virtualisation.podman = { enable = true; @@ -57,21 +47,6 @@ programs.fish.enable = true; - services.tailscale.enable = true; - - services.keyd = { - enable = true; - keyboards = { - default = { - settings = { - main = { - capslock = "escape"; - }; - }; - }; - }; - }; - virtualisation.libvirtd.enable = true; programs.virt-manager.enable = true; @@ -89,52 +64,6 @@ flake = "/home/nmarks/.dotfiles"; }; - fonts.packages = with pkgs; [ - # alibaba-fonts - nerd-fonts.fira-code - nerd-fonts.iosevka - ]; - - # Set your time zone. - time.timeZone = "America/Los_Angeles"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.supportedLocales = ["all"]; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - i18n.inputMethod = { - type = "fcitx5"; - enable = true; - fcitx5.waylandFrontend = true; - fcitx5.addons = with pkgs; [ - # fcitx5-gtk - # kdePackages.fcitx5-qt - rime-data - fcitx5-rime - fcitx5-rose-pine - ]; - }; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - # services.xserver.displayManager.startx.enable = true; - - # Enable the KDE Plasma Desktop Environment. - # services.displayManager.sddm.enable = true; - # services.desktopManager.plasma6.enable = true; ### Cosmic stuff @@ -144,35 +73,9 @@ systemd.services.monitord.wantedBy = ["multi-user.target"]; - services.desktopManager.cosmic.enable = true; - services.displayManager.cosmic-greeter.enable = true; - - # Configure keymap in X11 - services.xserver = { - xkb.layout = "us"; - xkb.variant = ""; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - # Enable sound with pipewire. # services.pulseaudio.enable = true; security.rtkit.enable = true; - services.pipewire = { - enable = true; - audio.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # systemWide = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; @@ -222,19 +125,6 @@ pinentryPackage = pkgs.pinentry-curses; }; - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - ports = [22]; - settings = { - PasswordAuthentication = true; - UseDns = true; - X11Forwarding = true; - }; - }; - programs.kdeconnect.enable = true; networking = { diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index e4ffe3f32d8bdc8d58f2cc2bd8bdd4828ab4ae8b..40d5904802d44d4204bb3e672c790ef54259e89c 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -3,13 +3,13 @@ config, pkgs, lib, - currentSystemUser, + user, ... }: { programs = import ../shared/home-programs.nix {inherit inputs config pkgs lib;}; home = { - username = currentSystemUser; + username = user; homeDirectory = "/Users/nmarks/"; # Home Manager needs a bit of information about you and the paths it should # manage. diff --git a/hosts/laptop/modules/icons.nix b/hosts/laptop/modules/icons.nix deleted file mode 100644 index 649e7ebb31e5b9218642b86fad5af46d1c670e67..0000000000000000000000000000000000000000 --- a/hosts/laptop/modules/icons.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - lib, - config, - ... -}: let - cfg = config.environment.customIcons; - inherit - (lib) - mkEnableOption - mkIf - mkMerge - mkOption - types - ; -in { - options.environment.customIcons = { - enable = mkEnableOption "environment.customIcons"; - clearCacheOnActivation = mkEnableOption "environment.customIcons.clearCacheOnActivation"; - - icons = mkOption { - type = types.listOf ( - types.submodule { - options = { - path = mkOption {type = types.path;}; - icon = mkOption {type = types.path;}; - }; - } - ); - }; - }; - - config = mkMerge [ - (mkIf cfg.enable { - system.activationScripts.extraActivation.text = '' - echo -e "applying custom icons..." - - ${ - (builtins.concatStringsSep "\n\n" ( - builtins.map (iconCfg: '' - osascript </dev/null - use framework "Cocoa" - - set iconPath to "${iconCfg.icon}" - set destPath to "${iconCfg.path}" - - set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:iconPath) - (current application's NSWorkspace's sharedWorkspace()'s setIcon:imageData forFile:destPath options:2) - EOF - '') - cfg.icons - )) - } - - ${lib.optionalString cfg.clearCacheOnActivation '' - sudo rm -rf /Library/Caches/com.apple.iconservices.store - sudo find /private/var/folders/ -name com.apple.dock.iconcache -or -name com.apple.iconservices -or -name com.apple.iconservicesagent -exec rm -rf {} \; || true - killall Dock - ''}''; - }) - ]; -} diff --git a/hosts/shared/home-programs.nix b/hosts/shared/home-programs.nix index a03fb3e4ead89313bddb68020c26f72df939666f..02f8bbce1b11528ebe408dd9769a58d51e061c9b 100644 --- a/hosts/shared/home-programs.nix +++ b/hosts/shared/home-programs.nix @@ -58,6 +58,8 @@ }; color_align = { mode = "horizontal"; + # custom_colors = []; + # fore_back = null; }; distro = "nixos"; pride_month_shown = [ diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index e8fe62e9b3f70ebf9f74e77488a82e6e8ccfeea3..9ec6f706fefd17765da2c40e4057495471513a13 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -10,11 +10,6 @@ darwin ? false, extraModules ? [], }: let - # mkIfElse = p: yes: no: - # nixpkgs.lib.mkMerge [ - # (nixpkgs.lib.mkIf p yes) - # (nixpkgs.lib.mkIf (!p) no) - # ]; nixindex = if darwin then inputs.nix-index-database.darwinModules.nix-index @@ -59,8 +54,7 @@ in # Enable caching for nix-index so we dont have to rebuild it #shared modules - ../modules/shared/nix.nix - ../modules/shared/extras.nix + ../modules/shared hostConfig nixindex @@ -71,9 +65,11 @@ in useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "hm-backup"; - extraSpecialArgs = {inherit inputs;}; + extraSpecialArgs = {inherit inputs user;}; users.${user} = homeConfig; }; + + users.users.${user}.home = homeDir; } # We expose some extra arguments so that our modules can parameterize diff --git a/modules/macos/icons.nix b/modules/macos/icons.nix new file mode 100644 index 0000000000000000000000000000000000000000..649e7ebb31e5b9218642b86fad5af46d1c670e67 --- /dev/null +++ b/modules/macos/icons.nix @@ -0,0 +1,61 @@ +{ + lib, + config, + ... +}: let + cfg = config.environment.customIcons; + inherit + (lib) + mkEnableOption + mkIf + mkMerge + mkOption + types + ; +in { + options.environment.customIcons = { + enable = mkEnableOption "environment.customIcons"; + clearCacheOnActivation = mkEnableOption "environment.customIcons.clearCacheOnActivation"; + + icons = mkOption { + type = types.listOf ( + types.submodule { + options = { + path = mkOption {type = types.path;}; + icon = mkOption {type = types.path;}; + }; + } + ); + }; + }; + + config = mkMerge [ + (mkIf cfg.enable { + system.activationScripts.extraActivation.text = '' + echo -e "applying custom icons..." + + ${ + (builtins.concatStringsSep "\n\n" ( + builtins.map (iconCfg: '' + osascript </dev/null + use framework "Cocoa" + + set iconPath to "${iconCfg.icon}" + set destPath to "${iconCfg.path}" + + set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:iconPath) + (current application's NSWorkspace's sharedWorkspace()'s setIcon:imageData forFile:destPath options:2) + EOF + '') + cfg.icons + )) + } + + ${lib.optionalString cfg.clearCacheOnActivation '' + sudo rm -rf /Library/Caches/com.apple.iconservices.store + sudo find /private/var/folders/ -name com.apple.dock.iconcache -or -name com.apple.iconservices -or -name com.apple.iconservicesagent -exec rm -rf {} \; || true + killall Dock + ''}''; + }) + ]; +} diff --git a/modules/nixos/services.nix b/modules/nixos/services.nix new file mode 100644 index 0000000000000000000000000000000000000000..6446139bc304422fea49cf6eb7112de3bd5168d2 --- /dev/null +++ b/modules/nixos/services.nix @@ -0,0 +1,63 @@ +{ + lib, + pkgs, + config, + ... +}: { + services = { + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + blueman.enable = true; + ratbagd.enable = true; + flatpak.enable = true; + keyd = { + enable = true; + keyboards = { + default = { + settings = { + main = { + capslock = "escape"; + }; + }; + }; + }; + }; + + desktopManager.cosmic.enable = true; + displayManager.cosmic-greeter.enable = true; + + # Configure keymap in X11 + xserver = { + xkb.layout = "us"; + xkb.variant = ""; + }; + + tailscale.enable = true; + + # Enable CUPS to print documents. + printing.enable = true; + + pipewire = { + enable = true; + audio.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # systemWide = true; + #media-session.enable = true; + }; + + openssh = { + enable = true; + ports = [22]; + settings = { + PasswordAuthentication = true; + UseDns = true; + X11Forwarding = true; + }; + }; + }; +} diff --git a/modules/shared/extras.nix b/modules/shared/extras.nix index 942054db7b9ed7a96b75e19948b8400afdde5636..26a85af962585f72710d7eb5257f7a76956cbe3a 100644 --- a/modules/shared/extras.nix +++ b/modules/shared/extras.nix @@ -6,4 +6,43 @@ }: { networking = { }; + fonts.packages = with pkgs; [ + # alibaba-fonts + nerd-fonts.fira-code + nerd-fonts.iosevka + ]; + + # Set your time zone. + time.timeZone = "America/Los_Angeles"; + i18n = { + # Select internationalisation properties. + defaultLocale = "en_US.UTF-8"; + + supportedLocales = ["all"]; + + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + inputMethod = { + type = "fcitx5"; + enable = true; + fcitx5.waylandFrontend = true; + fcitx5.addons = with pkgs; [ + # fcitx5-gtk + # kdePackages.fcitx5-qt + rime-data + fcitx5-rime + fcitx5-rose-pine + ]; + }; + }; }