From b2e355f0589a27bb66ad65b42ee04065e27518bb Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Sun, 1 Jan 2023 16:00:23 -0500 Subject: [PATCH] flake --- flake.nix | 31 ++++++++++++++++--------------- home.nix | 3 --- hosts/ts-tl-mbp/default.nix | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 18 deletions(-) delete mode 100644 home.nix create mode 100644 hosts/ts-tl-mbp/default.nix diff --git a/flake.nix b/flake.nix index 4e506fc..8cd0b27 100644 --- a/flake.nix +++ b/flake.nix @@ -1,23 +1,24 @@ { - description = "My Home Manager flake"; + description = "My first nix flake"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-22.05-darwin"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + # nix will normally use the nixpkgs defined in home-managers inputs, we only want one copy of nixpkgs though + darwin.url = "github:lnl7/nix-darwin"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; # ... }; - outputs = inputs: { - defaultPackage.x86_64-linux = home-manager.defaultPackage.x86_64-linux; - defaultPackage.x86_64-darwin = home-manager.defaultPackage.x86_64-darwin; - - homeConfigurations = { - "tyrel" = inputs.home-manager.lib.homeManagerConfiguration { - system = "x86_64-darwin"; - homeDirectory = "/Users/tyrel"; - username = "tyrel"; - configuration.imports = [ ./home.nix ]; - }; + outputs = { self, nixpkgs, home-manager, darwin }: { + darwinConfiguration."ts-tl-mbp" = darwin.lib.darwinSystem { + system = "x86_64-darwin"; + modules = [ + home-manager.darwinModules.home-manager + ./hosts/ts-tl-mbp/default.nix + ]; # will be important later }; }; + + } diff --git a/home.nix b/home.nix deleted file mode 100644 index 4be0d07..0000000 --- a/home.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ ... }: { - programs.home-manager.enable = true; -} diff --git a/hosts/ts-tl-mbp/default.nix b/hosts/ts-tl-mbp/default.nix new file mode 100644 index 0000000..91082f5 --- /dev/null +++ b/hosts/ts-tl-mbp/default.nix @@ -0,0 +1,36 @@ +# hosts/ts-tl-mbp/default.nix +{ pkgs, ... }: +{ + + # Make sure the nix daemon always runs + services.nix-daemon.enable = true; + + # Installs a version of nix, that dosen't need "experimental-features = nix-command flakes" in /etc/nix/nix.conf + services.nix-daemon.package = pkgs.nixFlakes; + + # if you use zsh (the default on new macOS installations), + # you'll need to enable this so nix-darwin creates a zshrc sourcing needed environment changes + programs.zsh.enable = true; + + homebrew = { + enable = true; + autoUpdate = true; + # updates homebrew packages on activation, + # can make darwin-rebuild much slower (otherwise i'd forget to do it ever though) + casks = [ + "alfred" + "discord" + ]; + }; + + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.tyrel = { pkgs, ... }: { + + stateVersion = "22.11"; # read below + + }; + + +}