Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<h1 align="center">dotfiles</h1>

# Setup

1. Install nix using the [determinate nix installer](https://github.com/DeterminateSystems/nix-installer).
2. Install [Homebrew](https://brew.sh).

# 💾 Resources

Other configurations I copied from:

- [Misterio77/nix-starter-configs](https://github.com/Misterio77/nix-starter-configs)
- [nvim-lua/kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim)
- [mitchellh/nixos-config](https://github.com/mitchellh/nixos-config)
38 changes: 38 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 19 additions & 36 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";

nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";

darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";

home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -20,47 +24,26 @@
inputs@{
self,
flake-parts,
darwin,
home-manager,
nixpkgs,
...
}:
let
# Overlays is the list of overlays we want to apply from flake inputs.
overlays = [
inputs.zig.overlays.default
];

mkSystem = import ./lib/mksystem.nix {
inherit overlays nixpkgs inputs;
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
flake = {
overlays = import ./overlays { inherit inputs; };

homeManagerModules = import ./modules/home-manager;

# work machine
homeConfigurations."bokleynen" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-darwin;

# Pass additional argument to home.nix
extraSpecialArgs = {
inherit (self) inputs outputs;
};

# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [
home/home.nix

./home/programs/alacritty.nix
./home/programs/atuin.nix
./home/programs/bat.nix
./home/programs/direnv.nix
./home/programs/eza.nix
./home/programs/fd.nix
./home/programs/gh.nix
./home/programs/git.nix
./home/programs/go.nix
./home/programs/k9s.nix
./home/programs/lazygit.nix
./home/programs/neovim.nix
./home/programs/vscode.nix
./home/programs/zed.nix
./home/programs/zellij.nix
./home/programs/zsh.nix
];
darwinConfigurations."Bos-Work-MacBook-Pro" = mkSystem {
system = "aarch64-darwin";
user = "bokleynen";
};
};
systems = [ "aarch64-darwin" ];
Expand Down
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
switch:
darwin-rebuild switch --flake $(pwd)

check:
darwin-rebuild switch check --flake $(pwd)
33 changes: 33 additions & 0 deletions lib/mksystem.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
nixpkgs,
overlays,
inputs,
}:
{
system,
user,
}:
inputs.darwin.lib.darwinSystem {
inherit system;
specialArgs = {
inherit inputs;
};
modules = [
# Apply our overlays. Overlays are keyed by system type so we have
# to go through and apply our system type. We do this first so
# the overlays are available globally.
{ nixpkgs.overlays = overlays; }

# Allow unfree packages.
{ nixpkgs.config.allowUnfree = true; }

../machines/gs.nix
../users/${user}/darwin.nix
inputs.home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.bokleynen = ../users/${user}/home.nix;
}
];
}
27 changes: 27 additions & 0 deletions machines/gs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ pkgs, ... }:
{
system.stateVersion = 5;

# We install Nix using a separate installer so we don't want nix-darwin
# to manage it for us. This tells nix-darwin to just use whatever is running.
nix.useDaemon = true;
nix = {
settings.experimental-features = [
"nix-command"
"flakes"
];
};

# zsh is the default shell on Mac and we want to make sure that we're
# configuring the rc correctly with nix-darwin paths.
programs.zsh.enable = true;
programs.zsh.shellInit = ''
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
'';

system.defaults.NSGlobalDomain.AppleInterfaceStyle = "Dark";
}
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions users/bokleynen/darwin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ inputs, pkgs, ... }:
{
users.users.bokleynen = {
home = "/Users/bokleynen";
shell = pkgs.zsh;
};

homebrew = {
enable = true;
casks = [
"arc"
"discord"
"signal"
"slack"
"spotify"
"warp"
];
};
}
40 changes: 21 additions & 19 deletions home/home.nix → users/bokleynen/home.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
inputs,
outputs,
config,
pkgs,
...
Expand All @@ -11,7 +9,21 @@ let
in
{
imports = [
outputs.homeManagerModules.zed
programs/alacritty.nix
programs/atuin.nix
programs/bat.nix
programs/direnv.nix
programs/eza.nix
programs/fd.nix
programs/gh.nix
programs/git.nix
programs/go.nix
programs/k9s.nix
programs/lazygit.nix
programs/neovim.nix
programs/vscode.nix
programs/zellij.nix
programs/zsh.nix
];

home.username = "bokleynen";
Expand All @@ -26,29 +38,15 @@ in
# release notes.
home.stateVersion = "24.11";

nix = {
package = pkgs.nix;
settings.experimental-features = [
"nix-command"
"flakes"
];
};

nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.unstable-packages
inputs.zig.overlays.default
];
config.allowUnfree = true;
};

# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
arcanist
# arcanist
pinentry-tty
postman
gnupg
grpcurl
fzf
Expand Down Expand Up @@ -98,7 +96,11 @@ in
};
};

home.sessionVariables = { };
home.sessionVariables = {
LANG = "en_US.UTF-8";
LC_CTYPE = "en_US.UTF-8";
LC_ALL = "en_US.UTF-8";
};

home.sessionPath = [
"$HOME/go/bin"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.