diff --git a/flake.lock b/flake.lock index 1c4826b..9e8baf8 100644 --- a/flake.lock +++ b/flake.lock @@ -165,6 +165,27 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1727003835, + "narHash": "sha256-Cfllbt/ADfO8oxbT984MhPHR6FJBaglsr1SxtDGbpec=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "bd7d1e3912d40f799c5c0f7e5820ec950f1e0b3d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -918,6 +939,7 @@ "root": { "inputs": { "blocklist-hosts": "blocklist-hosts", + "darwin": "darwin", "flake-utils": "flake-utils", "foundryvtt": "foundryvtt", "ghostty": "ghostty", diff --git a/flake.nix b/flake.nix index b24012b..26e597e 100644 --- a/flake.nix +++ b/flake.nix @@ -58,36 +58,23 @@ overlays = [ inputs.zig.overlays.default ]; - pkgs = import nixpkgs { - config = { - allowUnfree = true; - allowUnfreePredicate = _: true; - }; - overlays = overlays; - }; - pkgs-stable = import nixpkgs-stable { - config = { - allowUnfree = true; - allowUnfreePredicate = _: true; - }; - overlays = []; - }; - - lib = nixpkgs.lib; + inherit (nixpkgs) lib; in { nixosConfigurations = { nixos = lib.nixosSystem { modules = [ + {nixpkgs.overlays = overlays;} nixos-cosmic.nixosModules.default - ./configuration.nix + ./hosts/desktop/configuration.nix home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.nmarks = import ./hosts/desktop/home.nix; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.nmarks = import ./hosts/desktop/home.nix; + }; home-manager.extraSpecialArgs = { - inherit pkgs-stable; inherit stylix; inherit hyprland-plugins; inherit zls; @@ -97,25 +84,39 @@ ]; specialArgs = { inherit inputs; - inherit pkgs-stable; inherit stylix; inherit blocklist-hosts; }; }; }; - darwinSystem = darwin.lib.darwinSystem { - system = "aarch64-darwin"; - modules = [ - ./hosts/laptop/configuration.nix - home-manager.darwinModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.nmarks = import ./hosts/laptop/home.nix; - users.users.nmarks.home = "/Users/nmarks"; - } - ]; - specialArgs = {inherit nixpkgs;}; + darwinConfigurations = { + "Natalies-MacBook-Air" = darwin.lib.darwinSystem { + system = "aarch64-darwin"; + modules = [ + {nixpkgs.overlays = overlays;} + ./hosts/laptop/configuration.nix + home-manager.darwinModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.nmarks = import ./hosts/laptop/home.nix; + }; + home-manager.extraSpecialArgs = { + inherit stylix; + inherit zls; + inherit ghostty; + }; + users.users.nmarks.home = "/Users/nmarks"; + } + ]; + specialArgs = { + inherit inputs; + inherit stylix; + inherit blocklist-hosts; + inherit ghostty; + }; + }; }; # nixos = inputs.self.nixosConfigurations.nmarks; # diff --git a/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/desktop/hardware-configuration.nix diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 2139319..40950d7 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -1,27 +1,38 @@ -{ config, pkgs, … }: - { - environment.systemPackages = - [ - pkgs.home-manager - ]; + config, + pkgs, + ... +}: { + programs.nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 4d --keep 3"; + flake = "/Users/nmarks/.dotfiles"; + }; + + environment.systemPackages = [ + pkgs.home-manager + pkgs.neovim + ]; # Use a custom configuration.nix location. - environment.darwinConfig = "$HOME/src/github.com/evantravers/dotfiles/nix-darwin-configuration"; + #environment.darwinConfig = "$HOME/.dotfiles/hosts/laptop"; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; nix = { package = pkgs.nix; settings = { - "extra-experimental-features" = [ "nix-command" "flakes" ]; + "extra-experimental-features" = ["nix-command" "flakes"]; }; }; + nixpkgs.config.allowUnfree = true; + # Create /etc/zshrc that loads the nix-darwin environment. programs = { gnupg.agent.enable = true; - zsh.enable = true; # default shell on catalina + zsh.enable = true; # default shell on catalina }; # Used for backwards compatibility, please read the changelog before changing. @@ -29,8 +40,7 @@ system.stateVersion = 4; # Install fonts - fonts.fontDir.enable = true; - fonts.fonts = [ + fonts.packages = [ pkgs.iosevka ]; @@ -53,10 +63,9 @@ system.defaults = { # minimal dock dock = { - autohide = true; - orientation = "left"; + autohide = false; show-process-indicators = false; - show-recents = false; + show-recents = true; static-only = true; }; # a finder that tells me what I want to know and lets me work @@ -66,9 +75,5 @@ FXEnableExtensionChangeWarning = false; }; # Tab between form controls and F-row that behaves as F1-F12 - NSGlobalDomain = { - AppleKeyboardUIMode = 3; - "com.apple.keyboard.fnState" = true; - }; }; } diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix new file mode 100644 index 0000000..5fe1760 --- /dev/null +++ b/hosts/laptop/home.nix @@ -0,0 +1,208 @@ +{ + inputs, + config, + pkgs, + ghostty, + ... +}: { + # Home Manager needs a bit of information about you and the paths it should + # manage. + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.05"; # Please read the comment before changing. + + nixpkgs.config = { + allowUnfree = true; + }; + + # imports = [ + # ./zed-editor.nix + # ]; + + # imports = [discord/default.nix]; + # sys.discord.enable = true; + + # The home.packages option allows you to install Nix packages into your + # environment. + + home.packages = with pkgs; [ + pyright + ruff + python312Packages.jedi-language-server + tor + #spotify + #stremio + fzf + zigpkgs.master + stylua + cachix + btop + neofetch + direnv + typst + typst-live + tmux + zellij + qemu + vimgolf + lazygit + rustup + file + vesktop + discord + # itch : THIS IS BROKEN FOR SOME REASON, need to pin it?? + qbittorrent + deno + imagemagick + pkg-config + #mpv + comma + gnumake + #signal-desktop + #zed-editor + #getting foundry to work! + #nodejs_21 + #productivty + #todoist-electron + #Gaming + prismlauncher + # for cmpm17 + binwalk + exiftool + #for fun + cowsay + cmatrix + hyfetch + bat + eza + ollama + sl + #LSP + formatters/linters + lua-language-server + nil + alejandra + statix + texlab + typst-fmt + typst-lsp + clang-tools + # rust-analyzer + #clippy + # rustfmt + #runpod + docker + nh + fastfetch + ]; + programs.direnv = { + enable = true; + #enableFishIntegration = true; + nix-direnv.enable = true; + }; + + programs.neovim = { + viAlias = true; + vimAlias = true; + extraPackages = with pkgs; [ + ]; + }; + #Link neovim config into nix + #xdg.configFile.nvim.source = ./nvim; + #xdg.mimeApps.defaultApplications."inode/directory" = "dolphin.desktop"; + # xdg.mimeApps.defaultApplications = {"inode/directory" = "org.kde.dolphin.desktop";}; + + programs.fish = { + enable = true; + + plugins = [ + { + name = "tide"; + src = pkgs.fishPlugins.tide.src; + } + ]; + shellAliases = { + hm-update = "git add home.nix ; git commit -m 'updated home-manager config'; git push origin main; home-manager switch --flake ~/.dotfiles/#nmarks"; + sys-update = "git add configuration.nix ; git commit -m 'updated system config'; git push origin main; sudo nixos-rebuild switch --flake ~/.dotfiles/#nmarks"; + full-update = "sys-update; hm-update"; + reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now"; + }; + shellInit = "source $HOME/.nix-profile/share/asdf-vm/asdf.fish "; + }; + + programs.hyfetch = { + enable = true; + settings = { + backend = "fastfetch"; + preset = "bisexual"; + mode = "rgb"; + light_dark = "dark"; + lightness = { + }; + color_align = { + mode = "horizontal"; + # custom_colors = []; + # fore_back = null; + }; + distro = null; + pride_month_shown = [ + ]; + pride_month_disable = false; + }; + }; + + /* + programs.zsh = { + oh-my-zsh = { + enable = true; + plugins = [ "git" "extract"]; + }; + enableAutosuggestions = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + + plugins = [ + {name = "powerlevel10k";src = pkgs.zsh-powerlevel10k;file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";} + ]; + }; + */ + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # You can also manage environment variables but you will have to manually + # source + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/nmarks/etc/profile.d/hm-session-vars.sh + # + # if you don't want to manage your shell through Home Manager. + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + TERMINAL = "ghostty"; + BROWSER = "firefox"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +}