added authentication for darwin system

This commit is contained in:
lsoriano-mcm
2025-06-28 19:10:41 -05:00
parent d9128fcf06
commit 6fc18f11a5
8 changed files with 102 additions and 99 deletions
+75 -72
View File
@@ -1,84 +1,87 @@
{ {
general = { myConfig = {
Hostname = "hakase"; general = {
Username = "lsoriano"; Hostname = "hakase";
Timezone = "America/Chicago"; Username = "lsoriano";
Timezone = "America/Chicago";
allowUnfree = true; # allows installation of commercial apps. allowUnfree = true; # allows installation of commercial apps.
terminal = { terminal = {
Font = "JetBrainsMono Nerd Font"; # e.g., JetBrainsMono Nerd Font Font = "JetBrainsMono Nerd Font"; # e.g., JetBrainsMono Nerd Font
Size = "11"; Size = "11";
Shell = "fish"; Shell = "fish";
Aliases = { Aliases = {
ls = "ls --color=auto"; ls = "ls --color=auto";
update = '' update = ''
if [[ $(uname) == "Darwin" ]]; if [[ $(uname) == "Darwin" ]];
sudo darwin-rebuild switch --flake ~/.config/nixos#macos sudo darwin-rebuild switch --flake ~/.config/nixos#macos
else else
sudo nixos-rebuild switch --flake ~/.config/nixos#desktop && home-manager switch --flake ~/.config/nixos#desktop sudo nixos-rebuild switch --flake ~/.config/nixos#desktop && home-manager switch --flake ~/.config/nixos#desktop
fi fi
'';
agu = "pkill gjs & ags run ~/.config/nixos/pkgs/ags/biscuit/app.ts & disown (jobs -p) &";
};
};
gitProfile = {
User = "kenji";
Email = "kenji@sakamoto.dev";
defaultBranch = "master";
};
ssh = {
extraConfig = ''
Host macair
User biscuit
HostName 192.168.68.81
''; '';
agu = "pkill gjs & ags run ~/.config/nixos/pkgs/ags/biscuit/app.ts & disown (jobs -p) &";
}; };
}; };
gitProfile = {
User = "kenji";
Email = "kenji@sakamoto.dev";
defaultBranch = "master";
};
ssh = {
extraConfig = ''
Host macair
User biscuit
HostName 192.168.68.81
'';
};
};
builds = { builds = {
builder = { builder = {
trustedUsers = [ trustedUsers = [
"@groups" "@groups"
"biscuit" "biscuit"
];
buildMachines = [
{
hostName = "192.168.68.81";
sshUser = "biscuit";
sshKey = "/home/biscuit/.ssh/id_rsa.pub";
system = "x86_64-linux";
supportedFeatures = ["big-parallel" "kvm" "nixos-test"];
}
];
};
};
linux = {
system = "x86_64";
vpn = {
Enable = true;
secretFile = builtins.toPath ./secrets/.vpn.yaml;
};
touchpadSupport = false;
logitech-hardware.enable = false;
# Custom Applications
linux-apps = {
gaming = true;
my-apps = pkgs:
with pkgs; [
jellyfin-media-player
]; ];
buildMachines = [
{
hostName = "192.168.68.81";
sshUser = "biscuit";
sshKey = "/home/biscuit/.ssh/id_rsa.pub";
system = "x86_64-linux";
supportedFeatures = ["big-parallel" "kvm" "nixos-test"];
}
];
};
}; };
hyprconf = {
Monitor = [ linux = {
# hyprctl monitors all system = "x86_64";
# monitor, resolution@refreshrate, position (e.g., 0x0 is middle, 0x1080 is top), scale gaming = true;
",highres@highrr,auto,auto"
]; vpn = {
Enable = true;
secretFile = builtins.toPath ./secrets/.vpn.yaml;
};
touchpadSupport = false;
logitech-hardware.enable = false;
# Custom Applications
linux-apps = {
gaming = true;
my-apps = pkgs:
with pkgs; [
jellyfin-media-player
];
};
hyprconf = {
Monitor = [
# hyprctl monitors all
# monitor, resolution@refreshrate, position (e.g., 0x0 is middle, 0x1080 is top), scale
",highres@highrr,auto,auto"
];
};
}; };
}; };
} }
+8 -9
View File
@@ -1,7 +1,6 @@
{ {
pkgs, pkgs,
builds, myConfig,
general,
... ...
}: { }: {
imports = [ imports = [
@@ -10,7 +9,6 @@
# List packages installed in system profile. To search by name, run: # List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget # $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
python313Full
]; ];
# Auto upgrade nix package and the daemon service. # Auto upgrade nix package and the daemon service.
@@ -20,7 +18,7 @@
# Necessary for using flakes on this system. # Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes"; nix.settings.experimental-features = "nix-command flakes";
nix.settings.trusted-users = builds.builder.trustedUsers; nix.settings.trusted-users = myConfig.builds.builder.trustedUsers;
# Create /etc/zshrc that loads the nix-darwin environment. # Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true; # default shell on catalina programs.zsh.enable = true; # default shell on catalina
@@ -31,12 +29,13 @@
# The platform the configuration will be used on. # The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin"; nixpkgs.hostPlatform = "aarch64-darwin";
security.pam.services.sudo_local.touchIdAuth = true;
users.users.${general.Username} = { users.users.${myConfig.general.Username} = {
name = "${general.Username}"; name = "${myConfig.general.Username}";
home = "/Users/${general.Username}"; home = "/Users/${myConfig.general.Username}";
shell = pkgs.${general.terminal.Shell}; shell = pkgs.${myConfig.general.terminal.Shell};
}; };
home-manager.users.${general.Username} = import ../../home/macos.nix; home-manager.users.${myConfig.general.Username} = import ../../home/macos.nix;
} }
+5 -3
View File
@@ -1,4 +1,6 @@
{...}: { {lib, ...}: {
imports = [ imports =
]; [
]
++ [lib.optionals (linux-apps.gamingDesktop == true)];
} }
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
pkgs, pkgs,
general, myConfig,
... ...
}: { }: {
programs.zoxide.enable = true; programs.zoxide.enable = true;
@@ -12,7 +12,7 @@
zoxide init fish | source zoxide init fish | source
''; '';
shellAliases = general.terminal.Aliases; shellAliases = myConfig.general.terminal.Aliases;
plugins = with pkgs.fishPlugins; [ plugins = with pkgs.fishPlugins; [
]; ];
+4 -4
View File
@@ -1,10 +1,10 @@
{general, ...}: { {myConfig, ...}: {
programs.git = { programs.git = {
enable = true; enable = true;
extraConfig = { extraConfig = {
user.name = "${general.gitProfile.User}"; user.name = "${myConfig.general.gitProfile.User}";
user.email = "${general.gitProfile.Email}"; user.email = "${myConfig.general.gitProfile.Email}";
init.defaultBranch = "${general.gitProfile.defaultBranch}"; init.defaultBranch = "${myConfig.general.gitProfile.defaultBranch}";
}; };
}; };
} }
+3 -3
View File
@@ -1,4 +1,4 @@
{general, ...}: { {myConfig, ...}: {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
@@ -7,8 +7,8 @@
confirm_os_window_close = 0; confirm_os_window_close = 0;
window_padding_width = 10; window_padding_width = 10;
font_size = general.terminal.Size; font_size = myConfig.general.terminal.Size;
font_family = general.terminal.Font; font_family = myConfig.general.terminal.Font;
bold_font = "auto"; bold_font = "auto";
italic_font = "auto"; italic_font = "auto";
bold_italic_font = "auto"; bold_italic_font = "auto";
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
pkgs, pkgs,
general, myConfig,
... ...
}: { }: {
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -13,7 +13,7 @@
programs.zsh = { programs.zsh = {
enableCompletion = false; enableCompletion = false;
syntaxHighlighting.enable = false; syntaxHighlighting.enable = false;
shellAliases = general.terminal.Aliases; shellAliases = myConfig.general.terminal.Aliases;
history.size = 10000; history.size = 10000;
antidote = { antidote = {
enable = true; enable = true;
+3 -4
View File
@@ -1,13 +1,12 @@
{ {
pkgs, pkgs,
general, myConfig,
terminal,
... ...
}: { }: {
users = { users = {
defaultUserShell = pkgs.${terminal.Shell}; defaultUserShell = pkgs.${myConfig.terminal.Shell};
users = { users = {
${general.Username} = { ${myConfig.general.Username} = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel" "networkmanager" "input"]; extraGroups = ["wheel" "networkmanager" "input"];
initialHashedPassword = "$6$19ss/QojER5kh20A$4VnZASq0CN4LLKSUvFfGzXsvEPprRa96u7c5GkSPWdKEuZp7aQQ5EHmZ5nsmKYlWu10gXKL.xHBBG2y33IbW01"; initialHashedPassword = "$6$19ss/QojER5kh20A$4VnZASq0CN4LLKSUvFfGzXsvEPprRa96u7c5GkSPWdKEuZp7aQQ5EHmZ5nsmKYlWu10gXKL.xHBBG2y33IbW01";