From d6690e87b756c7c77fa9240ac734d99ae5077e25 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 19 Jul 2024 02:08:20 -0400 Subject: [PATCH] initial commit --- darwin/default.nix | 26 +++++ darwin/homebrew.nix | 19 ++++ flake.lock | 171 ++++++++++++++++++++++++++++++ flake.nix | 39 +++++++ home/atuin/default.nix | 9 ++ home/bat/default.nix | 7 ++ home/default.nix | 43 ++++++++ home/direnv/default.nix | 13 +++ home/eza/default.nix | 13 +++ home/fish/aliases.nix | 21 ++++ home/fish/default.nix | 12 +++ home/fish/functions.nix | 33 ++++++ home/git/default.nix | 21 ++++ home/lazygit/default.nix | 22 ++++ home/neovim/default.nix | 7 ++ home/starship/default.nix | 11 ++ hosts/sephiroth/configuration.nix | 14 +++ hosts/sephiroth/home.nix | 7 ++ 18 files changed, 488 insertions(+) create mode 100644 darwin/default.nix create mode 100644 darwin/homebrew.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/atuin/default.nix create mode 100644 home/bat/default.nix create mode 100644 home/default.nix create mode 100644 home/direnv/default.nix create mode 100644 home/eza/default.nix create mode 100644 home/fish/aliases.nix create mode 100644 home/fish/default.nix create mode 100644 home/fish/functions.nix create mode 100644 home/git/default.nix create mode 100644 home/lazygit/default.nix create mode 100644 home/neovim/default.nix create mode 100644 home/starship/default.nix create mode 100644 hosts/sephiroth/configuration.nix create mode 100644 hosts/sephiroth/home.nix diff --git a/darwin/default.nix b/darwin/default.nix new file mode 100644 index 0000000..b524e3d --- /dev/null +++ b/darwin/default.nix @@ -0,0 +1,26 @@ +{ pkgs, config, ... }: + +{ + homebrew = import ./homebrew.nix; + + environment.systemPackages = with pkgs; [ + vim + gnutls + ripgrep + ]; + + nixpkgs.config.allowUnfree = true; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + + # Necessary for using flakes on this system. + nix.settings.experimental-features = "nix-command flakes"; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; +} diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix new file mode 100644 index 0000000..5a2976f --- /dev/null +++ b/darwin/homebrew.nix @@ -0,0 +1,19 @@ +{ + onActivation.cleanup = "uninstall"; + + taps = [ + # nothing here, yet + ]; + + casks = [ + # nothing here, yet + ]; + + brews = [ + # nothing here, yet + ]; + + masApps = { + "Reeder 5." = 1529448980; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f4009f4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,171 @@ +{ + "nodes": { + "cl-nix-lite": { + "locked": { + "lastModified": 1717972076, + "narHash": "sha256-hnZEsDInTcsVSL5LBGDAZegAxVLBus/wiJh+sNM15zU=", + "owner": "hraban", + "repo": "cl-nix-lite", + "rev": "cc920bfb0a6402d3871f470c98d65266126973e4", + "type": "github" + }, + "original": { + "owner": "hraban", + "repo": "cl-nix-lite", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1697816753, + "narHash": "sha256-40to80AEIyKCQI0xMKCeF5ePoIKTYgjVVCZeu4CnTxM=", + "owner": "hraban", + "repo": "flake-compat", + "rev": "6025bade1336a36014639bc3f67eacc853dab78f", + "type": "github" + }, + "original": { + "owner": "hraban", + "ref": "fixed-output", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1721135958, + "narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "mac-app-util": { + "inputs": { + "cl-nix-lite": "cl-nix-lite", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1719942949, + "narHash": "sha256-srSQac7dhXtisqu4XwPGrK8qcmT2rflJJ1mRIV9j0Qk=", + "owner": "hraban", + "repo": "mac-app-util", + "rev": "63f269f737cafb2219ba38780c1ecb1dc24bc4a2", + "type": "github" + }, + "original": { + "owner": "hraban", + "repo": "mac-app-util", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1721270582, + "narHash": "sha256-MdZmYPPExntE5rJu88IhJSy8Um4UyZCTXhOwvzbjDVI=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "a3e4a7b8ffc08c7dc1973822a77ad432e1ec3dec", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1717868076, + "narHash": "sha256-c83Y9t815Wa34khrux81j8K8ET94ESmCuwORSKm2bQY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cd18e2ae9ab8e2a0a8d715b60c91b54c0ac35ff9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cd18e2ae9ab8e2a0a8d715b60c91b54c0ac35ff9", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1721303309, + "narHash": "sha256-/+Yw4tW/mcTRKmkEAO64ObzCQClpSUZpk2flUD9GDHE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7e2fb8e0eb807e139d42b05bf8e28da122396bed", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "mac-app-util": "mac-app-util", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..36ddbca --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Wyatt's configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nix-darwin.url = "github:LnL7/nix-darwin"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + mac-app-util.url = "github:hraban/mac-app-util"; + }; + + outputs = inputs@{ self, nix-darwin, home-manager, nixpkgs, mac-app-util }: + let configuration = { pkgs, ... }: { }; + in { + # Build darwin flake using: + # $ darwin-rebuild build --flake .#sephiroth + darwinConfigurations."sephiroth" = nix-darwin.lib.darwinSystem { + modules = [ + ./hosts/sephiroth/configuration.nix + + mac-app-util.darwinModules.default + + home-manager.darwinModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.verbose = true; + home-manager.users.wyatt.imports = [ ./hosts/sephiroth/home.nix mac-app-util.homeManagerModules.default ]; + } + ]; + }; + + # Expose the package set, including overlays, for convenience. + darwinPackages = self.darwinConfigurations."sephiroth".pkgs; + }; +} diff --git a/home/atuin/default.nix b/home/atuin/default.nix new file mode 100644 index 0000000..0eead39 --- /dev/null +++ b/home/atuin/default.nix @@ -0,0 +1,9 @@ +{ lib, config, ... }: + +{ + programs.atuin = { + enable = true; + + enableFishIntegration = true; + }; +} diff --git a/home/bat/default.nix b/home/bat/default.nix new file mode 100644 index 0000000..907d190 --- /dev/null +++ b/home/bat/default.nix @@ -0,0 +1,7 @@ +{ lib, config, ... }: + +{ + programs.bat = { + enable = true; + }; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..746d5f0 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,43 @@ +{ config, pkgs, lib, home-manager, ... }: + +{ + imports = [ + ./atuin + ./bat + ./direnv + ./eza + ./fish + ./git + ./lazygit + ./neovim + ./starship + ]; + + config = { + home.stateVersion = "24.05"; + + home.packages = with pkgs; [ + discord + obsidian + zoxide + wget + nerdfonts + jdk + prismlauncher + iterm2 + zed + vscode + nodejs + cargo + gcc + python3 + ]; + + home.sessionVariables = { + EDITOR = "nvim"; + }; + + fonts.fontconfig.enable = true; + programs.home-manager.enable = true; + }; +} diff --git a/home/direnv/default.nix b/home/direnv/default.nix new file mode 100644 index 0000000..0d5b920 --- /dev/null +++ b/home/direnv/default.nix @@ -0,0 +1,13 @@ +{ lib, config, ... }: + +{ + programs.direnv = { + enable = true; + + config = { + global = { + hide_env_diff = true; + }; + }; + }; +} diff --git a/home/eza/default.nix b/home/eza/default.nix new file mode 100644 index 0000000..ea0a7c1 --- /dev/null +++ b/home/eza/default.nix @@ -0,0 +1,13 @@ +{ lib, config, ... }: + +{ + programs.eza = { + enable = true; + + enableFishIntegration = true; + + extraOptions = [ + # "--group-directories-first" + ]; + }; +} diff --git a/home/fish/aliases.nix b/home/fish/aliases.nix new file mode 100644 index 0000000..c236579 --- /dev/null +++ b/home/fish/aliases.nix @@ -0,0 +1,21 @@ +{ lib, config, ... }: + +{ + programs.fish = { + shellAliases = { + # ls aliases + ls = "eza --color $argv"; + la = "eza -l -all --color $argv"; + ll = "eza -l --color $argv"; + lt = "eza -l --color --git $argv"; + + # lazygit alias + lg = "lazygit"; + + # cat, less, more alias + cat = "bat $argv"; + less = "bat $argv"; + more = "bat $argv"; + }; + }; +} diff --git a/home/fish/default.nix b/home/fish/default.nix new file mode 100644 index 0000000..16e2f8c --- /dev/null +++ b/home/fish/default.nix @@ -0,0 +1,12 @@ +{ lib, config, ...}: + +{ + imports = [ + ./aliases.nix + ./functions.nix + ]; + + programs.fish = { + enable = true; + }; +} diff --git a/home/fish/functions.nix b/home/fish/functions.nix new file mode 100644 index 0000000..7b6e6b5 --- /dev/null +++ b/home/fish/functions.nix @@ -0,0 +1,33 @@ +{ lib, config, ... }: + +{ + programs.fish = { + functions = { + fish_greeting = { + body = '' + set memes \ + "Crazy? I was crazy once. They locked me in a room. A rubber room. A rubber room with rats. And rats make me crazy." \ + "Daddy, chill!" \ + "What the hell is even that?!" \ + "Road work ahead? Yeah, I sure hope it does!" \ + "Look at all those chickens!" \ + "I smell like beef" \ + "Say, Coloardo - I'M A GIRAFFE" \ + "I didn't get no sleep cause of y'all, y'all not gone get any sleep cause of me!" \ + "This is the dollar store, how good can it be?" \ + "That was legitness" \ + "Deez nuts" \ + "I wanna be a cowboy baby" \ + "Can I get a waffle? Can I please get a waffle?" \ + "I'm lesbian. I thought you were American." + + set choose_meme (random)"%"(count $memes) + set choose_meme $memes[(math $choose_meme"+1")] + + printf (set_color F90)"%s\n" $choose_meme + ''; + onEvent = "fish_greeting"; + }; + }; + }; +} diff --git a/home/git/default.nix b/home/git/default.nix new file mode 100644 index 0000000..39df392 --- /dev/null +++ b/home/git/default.nix @@ -0,0 +1,21 @@ +{ ... }: + +{ + programs.git = { + enable = true; + + userName = "Wyatt J. Miller"; + userEmail = "wyatt@wyattjmiller.com"; + + ignores = [ + ".DS_Store" + ".direnv" + ".idea" + ]; + + extraConfig = { + init.defaultBranch = "master"; + # push.autoSetupRemote = true; + }; + }; +} diff --git a/home/lazygit/default.nix b/home/lazygit/default.nix new file mode 100644 index 0000000..2729c54 --- /dev/null +++ b/home/lazygit/default.nix @@ -0,0 +1,22 @@ +{ lib, config, ... }: + +{ + programs.lazygit = { + enable = true; + + settings = { + gui.theme = { + activeBorderColor = ["#a6e3a1" "bold"]; + inactiveBorderColor = ["#a6adc8"]; + optionsTextColor = ["#89b4fa"]; + selectedLineBgColor = ["#313244"]; + selectedRangeBgColor = ["#313244"]; + cherryPickedCommitBgColor = ["#45475a"]; + cherryPickedCommitFgColor = ["#a6e3a1"]; + unstagedChangesColor = ["#f38ba8"]; + defaultFgColor = ["#cdd6f4"]; + searchingActiveBorderColor = ["#f9e2af"]; + }; + }; + }; +} diff --git a/home/neovim/default.nix b/home/neovim/default.nix new file mode 100644 index 0000000..29cc019 --- /dev/null +++ b/home/neovim/default.nix @@ -0,0 +1,7 @@ +{ lib, config, ... }: + +{ + programs.neovim = { + enable = true; + }; +} diff --git a/home/starship/default.nix b/home/starship/default.nix new file mode 100644 index 0000000..c68e418 --- /dev/null +++ b/home/starship/default.nix @@ -0,0 +1,11 @@ +{ lib, config, ... }: + +{ + programs.starship = { + enable = true; + + enableFishIntegration = true; + + settings = { }; + }; +} diff --git a/hosts/sephiroth/configuration.nix b/hosts/sephiroth/configuration.nix new file mode 100644 index 0000000..5fa1650 --- /dev/null +++ b/hosts/sephiroth/configuration.nix @@ -0,0 +1,14 @@ +{ pkgs, home-manager, ... }: + +{ + imports = [ + ../../darwin + ]; + + users.users.wyatt = { + home = "/Users/wyatt"; + shell = pkgs.fish; + }; + + security.pam.enableSudoTouchIdAuth = true; +} diff --git a/hosts/sephiroth/home.nix b/hosts/sephiroth/home.nix new file mode 100644 index 0000000..fe0ab38 --- /dev/null +++ b/hosts/sephiroth/home.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + imports = [ + ../../home + ]; +}