From cfa14753fd6e4ec2a28778eed460ddd5926bdbe1 Mon Sep 17 00:00:00 2001 From: Skullheadx Date: Mon, 29 Jun 2026 14:40:59 -0400 Subject: switch to name - system pattern --- common-darwin.nix | 110 +++++++++++++++++++++++++++++++++++++++++++++++++ common-linux.nix | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ darwin-common.nix | 110 ------------------------------------------------- flake.nix | 8 ++-- linux-common.nix | 119 ------------------------------------------------------ 5 files changed, 233 insertions(+), 233 deletions(-) create mode 100644 common-darwin.nix create mode 100644 common-linux.nix delete mode 100644 darwin-common.nix delete mode 100644 linux-common.nix diff --git a/common-darwin.nix b/common-darwin.nix new file mode 100644 index 0000000..82b4c85 --- /dev/null +++ b/common-darwin.nix @@ -0,0 +1,110 @@ +{ + config, + pkgs, + inputs, + username, + ... +}: { + imports = [ + ./zsh.nix + ./vim.nix + ]; + + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = with pkgs; [ + ffmpeg + librewolf + lazygit + fastfetch + git + wget + curl + direnv + pass + passExtensions.pass-otp + passExtensions.pass-update + ]; + + programs.zsh.enable = true; + + security.pam.services.sudo_local = { + enable = true; + reattach = true; + touchIdAuth = true; + }; + + system = { + defaults = { + NSGlobalDomain = { + AppleICUForce24HourTime = true; + AppleInterfaceStyle = "Dark"; + AppleShowAllExtensions = true; + AppleShowAllFiles = true; + NSAutomaticCapitalizationEnabled = false; + NSDocumentSaveNewDocumentsToCloud = false; + NSNavPanelExpandedStateForSaveMode2 = true; + NSWindowShouldDragOnGesture = true; + PMPrintingExpandedStateForPrint = true; + PMPrintingExpandedStateForPrint2 = true; + }; + + controlcenter.NowPlaying = true; + + dock = { + minimize-to-application = true; + mru-spaces = false; + show-recents = false; + }; + + finder = { + AppleShowAllExtensions = true; + AppleShowAllFiles = true; + FXEnableExtensionChangeWarning = false; + FXPreferredViewStyle = "Nlsv"; + QuitMenuItem = true; + ShowMountedServersOnDesktop = true; + ShowPathbar = true; + ShowStatusBar = true; + _FXEnableColumnAutoSizing = true; + _FXSortFoldersFirst = true; + }; + + screencapture = { + location = "/Users/${username}/Documents/Screenshots"; + type = "jpg"; + }; + }; + + keyboard = { + remapCapsLockToEscape = true; + swapLeftCtrlAndFn = true; + enableKeyMapping = true; + }; + }; + + homebrew = { + enable = true; + # onActivation.cleanup = "uninstall"; + + taps = [ + ]; + brews = [ + "openssh" + ]; + casks = [ + "keepingyouawake" + "scroll-reverser" + "ghostty" + ]; + }; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 6; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = ["nix-command" "flakes"]; +} diff --git a/common-linux.nix b/common-linux.nix new file mode 100644 index 0000000..8dae24d --- /dev/null +++ b/common-linux.nix @@ -0,0 +1,119 @@ +{ + config, + pkgs, + inputs, + ... +}: { + imports = [ + ./bash.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.supportedFilesystems = ["exfat"]; + + # Use latest kernel. + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.networkmanager.enable = true; + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + time.timeZone = "America/Toronto"; + + i18n.defaultLocale = "en_CA.UTF-8"; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + wget + nixfmt + fastfetch + pamixer + gcc + alejandra + gnumake + ]; + + fonts = { + fontDir.enable = true; + fontconfig = { + enable = true; + defaultFonts = { + monospace = ["Fira Code Nerd Font"]; + sansSerif = ["Fira Sans"]; + }; + hinting = { + autohint = false; + enable = true; + style = "slight"; + }; + }; + packages = with pkgs; [ + fira-code + nerd-fonts.fira-code + ]; + }; + + programs.git = { + enable = true; + config = { + user = { + name = "Skullheadx"; + email = "admonty1@protonmail.com"; + }; + pull.rebase = true; + url = { + "git@github.com:".insteadOf = "https://github.com/"; + }; + }; + }; + + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + # Add any missing dynamic libraries for unpackaged + # programs here, NOT in environment.systemPackages + ]; + + environment.sessionVariables = { + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + # Services + services.openssh.enable = true; + services.rsync = { + enable = true; + }; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "25.05"; # Did you read the comment? +} diff --git a/darwin-common.nix b/darwin-common.nix deleted file mode 100644 index 82b4c85..0000000 --- a/darwin-common.nix +++ /dev/null @@ -1,110 +0,0 @@ -{ - config, - pkgs, - inputs, - username, - ... -}: { - imports = [ - ./zsh.nix - ./vim.nix - ]; - - # List packages installed in system profile. To search by name, run: - # $ nix-env -qaP | grep wget - environment.systemPackages = with pkgs; [ - ffmpeg - librewolf - lazygit - fastfetch - git - wget - curl - direnv - pass - passExtensions.pass-otp - passExtensions.pass-update - ]; - - programs.zsh.enable = true; - - security.pam.services.sudo_local = { - enable = true; - reattach = true; - touchIdAuth = true; - }; - - system = { - defaults = { - NSGlobalDomain = { - AppleICUForce24HourTime = true; - AppleInterfaceStyle = "Dark"; - AppleShowAllExtensions = true; - AppleShowAllFiles = true; - NSAutomaticCapitalizationEnabled = false; - NSDocumentSaveNewDocumentsToCloud = false; - NSNavPanelExpandedStateForSaveMode2 = true; - NSWindowShouldDragOnGesture = true; - PMPrintingExpandedStateForPrint = true; - PMPrintingExpandedStateForPrint2 = true; - }; - - controlcenter.NowPlaying = true; - - dock = { - minimize-to-application = true; - mru-spaces = false; - show-recents = false; - }; - - finder = { - AppleShowAllExtensions = true; - AppleShowAllFiles = true; - FXEnableExtensionChangeWarning = false; - FXPreferredViewStyle = "Nlsv"; - QuitMenuItem = true; - ShowMountedServersOnDesktop = true; - ShowPathbar = true; - ShowStatusBar = true; - _FXEnableColumnAutoSizing = true; - _FXSortFoldersFirst = true; - }; - - screencapture = { - location = "/Users/${username}/Documents/Screenshots"; - type = "jpg"; - }; - }; - - keyboard = { - remapCapsLockToEscape = true; - swapLeftCtrlAndFn = true; - enableKeyMapping = true; - }; - }; - - homebrew = { - enable = true; - # onActivation.cleanup = "uninstall"; - - taps = [ - ]; - brews = [ - "openssh" - ]; - casks = [ - "keepingyouawake" - "scroll-reverser" - "ghostty" - ]; - }; - - # Used for backwards compatibility, please read the changelog before changing. - # $ darwin-rebuild changelog - system.stateVersion = 6; - - # The platform the configuration will be used on. - nixpkgs.hostPlatform = "aarch64-darwin"; - nixpkgs.config.allowUnfree = true; - nix.settings.experimental-features = ["nix-command" "flakes"]; -} diff --git a/flake.nix b/flake.nix index 401f2ee..cf4607e 100644 --- a/flake.nix +++ b/flake.nix @@ -79,7 +79,7 @@ }; modules = [ hjem.nixosModules.default - ./linux-common.nix + ./common-linux.nix ./hosts/nepsis/configuration.nix ./overlays.nix ]; @@ -91,7 +91,7 @@ }; modules = [ hjem.nixosModules.default - ./linux-common.nix + ./common-linux.nix ./hosts/icon/configuration.nix ./overlays.nix ]; @@ -106,7 +106,7 @@ username = "andrew"; }; modules = [ - ./darwin-common.nix + ./common-darwin.nix ./hosts/kenosis/configuration.nix ./overlays.nix hjem.darwinModules.default @@ -119,7 +119,7 @@ username = "andrewmontgomery"; }; modules = [ - ./darwin-common.nix + ./common-darwin.nix ./hosts/bear/configuration.nix ./overlays.nix hjem.darwinModules.default diff --git a/linux-common.nix b/linux-common.nix deleted file mode 100644 index 8dae24d..0000000 --- a/linux-common.nix +++ /dev/null @@ -1,119 +0,0 @@ -{ - config, - pkgs, - inputs, - ... -}: { - imports = [ - ./bash.nix - ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.supportedFilesystems = ["exfat"]; - - # Use latest kernel. - boot.kernelPackages = pkgs.linuxPackages_latest; - - networking.networkmanager.enable = true; - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - time.timeZone = "America/Toronto"; - - i18n.defaultLocale = "en_CA.UTF-8"; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - wget - nixfmt - fastfetch - pamixer - gcc - alejandra - gnumake - ]; - - fonts = { - fontDir.enable = true; - fontconfig = { - enable = true; - defaultFonts = { - monospace = ["Fira Code Nerd Font"]; - sansSerif = ["Fira Sans"]; - }; - hinting = { - autohint = false; - enable = true; - style = "slight"; - }; - }; - packages = with pkgs; [ - fira-code - nerd-fonts.fira-code - ]; - }; - - programs.git = { - enable = true; - config = { - user = { - name = "Skullheadx"; - email = "admonty1@protonmail.com"; - }; - pull.rebase = true; - url = { - "git@github.com:".insteadOf = "https://github.com/"; - }; - }; - }; - - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - # Add any missing dynamic libraries for unpackaged - # programs here, NOT in environment.systemPackages - ]; - - environment.sessionVariables = { - }; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - # Services - services.openssh.enable = true; - services.rsync = { - enable = true; - }; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "25.05"; # Did you read the comment? -} -- cgit v1.3.1