restructed modules for home and work, untested

This commit is contained in:
2026-11-09 10:58:31 -05:00
parent 10bac6ed32
commit b3f749f8bf
13 changed files with 116 additions and 44 deletions

View File

@@ -8,10 +8,14 @@
nix-homebrew.url = "github:zhaofengli/nix-homebrew"; nix-homebrew.url = "github:zhaofengli/nix-homebrew";
}; };
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: { outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }:
darwinConfigurations."Brians-MacBook-Air" = nix-darwin.lib.darwinSystem { let
mkDarwin = { profile, user, system ? "aarch-64-dawin" }:
nix-darwin.lib.darwinSystem {
specialArgs = { inherit user system; };
modules = [ modules = [
./configuration.nix ./modules
./profiles/${profile}
nix-homebrew.darwinModules.nix-homebrew nix-homebrew.darwinModules.nix-homebrew
{ {
nix-homebrew = { nix-homebrew = {
@@ -22,5 +26,11 @@
} }
]; ];
}; };
in
{
darwinConfigurations."Brians-MacBook-Air" = nix-darwin.lib.darwinSystem {
personal = mkDarwin { profile = "personal"; user = "briannelson"; };
work = mkDarwin { profile = "work"; user = "briannelson"; };
};
}; };
} }

View File

@@ -1,12 +1,11 @@
{ pkgs, ... }: { ... }:
{ {
imports = [ imports = [
./cli-tools.nix ./cli-tools.nix
./mac-settings.nix ./mac-settings.nix
./pkg-installs.nix ./pkg-installs.nix
./archive-installs.nix ]
];
nixpkgs.hostPlatform = "aarch64-darwin"; nixpkgs.hostPlatform = "aarch64-darwin";
@@ -18,13 +17,8 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
exif exif
exiftool exiftool
ffmpeg
flac
git git
helix helix
librewolf
tea
yt-dlp
]; ];
homebrew = { homebrew = {
@@ -38,22 +32,15 @@
"bun" "bun"
"defaultbrowser" "defaultbrowser"
"harper" "harper"
"nicotine-plus"
"rust" "rust"
"ykman" "ykman"
]; ];
casks = [ casks = [
"bitwarden" "bitwarden"
"cap"
"discord"
"docker-desktop"
"harper-desktop" "harper-desktop"
"libreoffice"
"nextcloud" "nextcloud"
"obsidian" "obsidian"
"protonvpn"
"rustdesk"
"signal" "signal"
"task-manager-tmog" "task-manager-tmog"
"twingate" "twingate"

19
modules/cli-tools.nix Normal file
View File

@@ -0,0 +1,19 @@
{ ... }:
{
environment.shellAliases = {
ll = "ls -la";
};
environment.etc."gitconfig".text = ''
[user]
name = Brian Nelson
email = brian@briannelson.dev
[init]
defaultBranch = main
[credential]
helper = osxkeychain
'';
environment.variables.GIT_CONFIG_SYSTEM = "/etc/gitconfig";
}

10
modules/default.nix Normal file
View File

@@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./base.nix
./cli-tools.nix
./mac-settings.nix
./pkg-installs.nix
];
}

View File

@@ -0,0 +1,24 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
ffmpeg
flac
librewolf
tea
yt-dlp
];
homebrew.brews = [
"nicotine-plus"
];
homebrew.casks = [
"cap"
"discord"
"docker-desktop"
"libreoffice"
"protonvpn"
"rustdesk"
]
}

View File

@@ -1,23 +1,10 @@
{ pkgs, ... }: { ... }:
{ {
environment.shellAliases = { environment.shellAliases = {
yt = "yt-dlp"; yt = "yt-dlp";
ll = "ls -la";
}; };
environment.etc."gitconfig".text = ''
[user]
name = Brian Nelson
email = brian@briannelson.dev
[init]
defaultBranch = main
[credential]
helper = osxkeychain
'';
environment.variables.GIT_CONFIG_SYSTEM = "/etc/gitconfig";
environment.etc."yt-dlp.conf".text = '' environment.etc."yt-dlp.conf".text = ''
-o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s -o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s
--no-mtime --no-mtime

View File

@@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./cli-tools.nix
./apps.nix
./archive-installs.nix
]
}

9
profiles/work/apps.nix Normal file
View File

@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [];
homebrew.brews = [];
homebrew.casks = [];
}

View File

@@ -0,0 +1,9 @@
{ ... }:
{
system.activationScripts.postActivation.text = ''
if [ -x /opt/homebrew/bin/defaultbrowser ]; then
sudo -u briannelson /opt/homebrew/bin/defaultbrowser firefox || echo "could not set deffault browser, skipping"
fi
'';
}

View File

@@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./apps.nix
./cli-tools.nix
]
}