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 = {
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
};
};
}

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