This commit is contained in:
Tyrel Souza 2023-01-01 16:00:23 -05:00
parent 84ecfa7ffb
commit b2e355f058
3 changed files with 52 additions and 18 deletions

View File

@ -1,23 +1,24 @@
{ {
description = "My Home Manager flake"; description = "My first nix flake";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-22.05-darwin";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; 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: { outputs = { self, nixpkgs, home-manager, darwin }: {
defaultPackage.x86_64-linux = home-manager.defaultPackage.x86_64-linux; darwinConfiguration."ts-tl-mbp" = darwin.lib.darwinSystem {
defaultPackage.x86_64-darwin = home-manager.defaultPackage.x86_64-darwin;
homeConfigurations = {
"tyrel" = inputs.home-manager.lib.homeManagerConfiguration {
system = "x86_64-darwin"; system = "x86_64-darwin";
homeDirectory = "/Users/tyrel"; modules = [
username = "tyrel"; home-manager.darwinModules.home-manager
configuration.imports = [ ./home.nix ]; ./hosts/ts-tl-mbp/default.nix
}; ]; # will be important later
}; };
}; };
} }

View File

@ -1,3 +0,0 @@
{ ... }: {
programs.home-manager.enable = true;
}

View File

@ -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
};
}