From d19be69fbe421fd2b6598a93414146389ed75491 Mon Sep 17 00:00:00 2001 From: Shubham Saini Date: Mon, 25 Sep 2023 23:28:12 -0700 Subject: added darwin --- darwin/home.nix | 56 ++++++++++++++++++++++++++++++++++++++++ flake.nix | 25 +++++++++++++++++- hosts/morpheus/configuration.nix | 23 +++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 darwin/home.nix create mode 100644 hosts/morpheus/configuration.nix diff --git a/darwin/home.nix b/darwin/home.nix new file mode 100644 index 0000000..5e52de6 --- /dev/null +++ b/darwin/home.nix @@ -0,0 +1,56 @@ +{ config, pkgs, ... }: + +{ + home.username = "shubh"; + home.homeDirectory = "/Users/shubh"; + + # 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"; + + home.packages = with pkgs; [ + git + unzip + wget + gnupg + pass + tmux + fzf + docker + neovim + pinentry_mac + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + ]; + + programs.home-manager.enable = true; + programs.zsh = { + enable = true; + enableCompletion = true; + shellAliases = { + ll = "ls -l"; + v = "nvim"; + o = "xdg-open"; + t = "tmux"; + }; + oh-my-zsh = { + enable = true; + plugins = [ "git" "kubectl" "sudo" ]; + theme = "robbyrussell"; + }; + }; + programs.fzf = { + enable = true; + enableZshIntegration = true; + defaultOptions = [ "--height 40%" "--layout=reverse" "--border" ]; + }; + programs.git = { + enable = true; + userEmail = "ssaini@fispan.com"; + userName = "Shubham Saini"; + signing = { + key = "E0404DDE4BCF9DB5"; + signByDefault = true; + }; + }; +} diff --git a/flake.nix b/flake.nix index 7f3d0b9..159b4be 100644 --- a/flake.nix +++ b/flake.nix @@ -7,9 +7,14 @@ url = "github:nix-community/home-manager/release-23.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + + darwin = { + url = "github:lnl7/nix-darwin/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager, ... }: { + outputs = { self, nixpkgs, darwin, home-manager, ... }: { nixosConfigurations = { oracle = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -28,5 +33,23 @@ ]; }; }; + darwinConfigurations = { + morpheus = darwin.lib.darwinSystem { + system = "x86_64-darwin"; + modules = [ + { + imports = [ ./hosts/morpheus/configuration.nix ]; + } + home-manager.darwinModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.shubh = { + imports = [ ./darwin/home.nix ]; + }; + } + ]; + }; + }; }; } diff --git a/hosts/morpheus/configuration.nix b/hosts/morpheus/configuration.nix new file mode 100644 index 0000000..dc1edb3 --- /dev/null +++ b/hosts/morpheus/configuration.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: + +{ + services.nix-daemon.enable = true; + users.users.shubh.home = "/Users/shubh"; + + #homebrew = { + # enable = true; + # casks = [ "iterm2" "qtpass" ]; + #}; + + #system.activationScripts.applications.text = pkgs.lib.mkForce ( + # '' + # echo "setting up ~/Applications..." >&2 + # rm -rf ~/Applications/Nix\ Apps + # mkdir -p ~/Applications/Nix\ Apps + # for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do + # src="$(/usr/bin/stat -f%Y "$app")" + # cp -r "$src" ~/Applications/Nix\ Apps + # done + # '' + #); +} -- cgit v1.2.3