This commit is contained in:
Tyrel Souza 2023-01-01 16:04:01 -05:00
parent b2e355f058
commit f55323d926
3 changed files with 130 additions and 45 deletions

85
flake.lock Normal file
View File

@ -0,0 +1,85 @@
{
"nodes": {
"darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1671891118,
"narHash": "sha256-+GJYiT7QbfA306ex4sGMlFB8Ts297pn3OdQ9kTd4aDw=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "267040e7a2b8644f1fdfcf57b7e808c286dbdc7b",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1672349765,
"narHash": "sha256-Ul3lSGglgHXhgU3YNqsNeTlRH1pqxbR64h+2hM+HtnM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "dd99675ee81fef051809bc87d67eb07f5ba022e8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1672441599,
"narHash": "sha256-5s/aa/0cpw6MNXQSiUedDnnMVleL/WThL8Q8jYNcc+g=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0c5a734cdeadc39d253018ad0f83fb77eac7ab08",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-22.05-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@ -1,24 +1,22 @@
{ {
description = "My first nix flake"; description = "My first nix flake";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-22.05-darwin"; 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 # 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.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs"; # ... darwin.inputs.nixpkgs.follows = "nixpkgs"; # ...
}; };
outputs = { self, nixpkgs, home-manager, darwin }: { outputs = { self, nixpkgs, home-manager, darwin }: {
darwinConfiguration."ts-tl-mbp" = darwin.lib.darwinSystem { darwinConfigurations."ts-tl-mbp" = darwin.lib.darwinSystem {
system = "x86_64-darwin"; # you can have multiple darwinConfigurations per flake, one per hostname
modules = [
home-manager.darwinModules.home-manager system = "x86_64-darwin";
./hosts/ts-tl-mbp/default.nix modules = [ home-manager.darwinModules.home-manager ./hosts/ts-tl-mbp/default.nix ]; # will be important later
]; # will be important later
};
}; };
};
} }

View File

@ -1,36 +1,38 @@
# hosts/ts-tl-mbp/default.nix
{ pkgs, ... }: { pkgs, ... }:
{ {
# Make sure the nix daemon always runs # Make sure the nix daemon always runs
services.nix-daemon.enable = true; services.nix-daemon.enable = true;
programs.zsh.enable = true;
# Installs a version of nix, that dosen't need "experimental-features = nix-command flakes" in /etc/nix/nix.conf system.defaults.dock.autohide = true;
services.nix-daemon.package = pkgs.nixFlakes; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# if you use zsh (the default on new macOS installations), home-manager.users.tyrel = { pkgs, ... }: {
# you'll need to enable this so nix-darwin creates a zshrc sourcing needed environment changes home.stateVersion = "22.05";
programs.zsh.enable = true; programs.tmux = { # my tmux configuration, for example
enable = true;
homebrew = { keyMode = "vi";
enable = true; clock24 = true;
autoUpdate = true; historyLimit = 10000;
# updates homebrew packages on activation, plugins = with pkgs.tmuxPlugins; [
# can make darwin-rebuild much slower (otherwise i'd forget to do it ever though) vim-tmux-navigator
casks = [ gruvbox
"alfred" ];
"discord" extraConfig = ''
]; new-session -s main
}; bind-key -n C-a send-prefix
'';
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.tyrel = { pkgs, ... }: {
stateVersion = "22.11"; # read below
}; };
};
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"
];
};
} }