0
0
Fork 0

initial macos system

This commit is contained in:
Daryl Ronningen 2025-01-06 16:40:07 -08:00
parent 63ee4338e5
commit ba4ac3053c
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
11 changed files with 166 additions and 32 deletions

View file

@ -229,6 +229,26 @@
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1736085891,
"narHash": "sha256-bTl9fcUo767VaSx4Q5kFhwiDpFQhBKna7lNbGsqCQiA=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "ba9b3173b0f642ada42b78fb9dfc37ca82266f6c",
"type": "github"
},
"original": {
"owner": "LnL7",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-flatpak": {
"locked": {
"lastModified": 1734128415,
@ -282,11 +302,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1735834308,
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
"lastModified": 1736012469,
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
"rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d",
"type": "github"
},
"original": {
@ -353,6 +373,7 @@
"apple-fonts": "apple-fonts",
"catppuccin": "catppuccin",
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nix-flatpak": "nix-flatpak",
"nix-index-database": "nix-index-database",
"nixos-facter-modules": "nixos-facter-modules",

View file

@ -22,6 +22,9 @@
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
self,
@ -32,6 +35,7 @@
alejandra,
nix-flatpak,
nix-index-database,
nix-darwin,
...
}: let
modules = {
@ -45,6 +49,9 @@
wahnix = [
./hardware/devices/wahnix.nix
];
m1mbp = [
./hardware/devices/m1mbp.nix
];
};
drivers = {
controllers = {
@ -74,6 +81,9 @@
base = [
./system/nix.nix
];
linux = [
./system/linux.nix
];
desktops = {
apps = [
./system/desktop/apps.nix
@ -163,15 +173,18 @@
};
in {
packages.x86_64-linux.nerd-fonts-sf-mono-ligatures = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/fonts/nerd-fonts-sf-mono-ligatures.nix {};
packages.aarch64-darwin.nerd-fonts-sf-mono-ligatures = nixpkgs.legacyPackages.aarch64-darwin.callPackage ./pkgs/fonts/nerd-fonts-sf-mono-ligatures.nix {};
nixosConfigurations = {
wahnix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
inherit self;
};
modules =
modules.nixos.base
++ modules.nixos.linux
++ modules.nixos.desktops.apps
++ modules.nixos.desktops.displaymanagers.tuigreet
++ modules.nixos.desktops.environments.hyprland
@ -223,7 +236,40 @@
};
};
formatter.aarch64-linux = alejandra.defaultPackage.aarch64-linux;
darwinConfigurations."Daryls-MacBook-Pro" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit inputs;
inherit self;
};
modules =
modules.nixos.base
++ modules.nixos.users.relms
++ modules.hardware.devices.m1mbp
++ [
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit self;
inherit inputs;
};
home-manager.users.relms = {
imports =
modules.home.users.relms
++ modules.home.cli.development
++ modules.home.cli.shell
++ [
nix-index-database.hmModules.nix-index
catppuccin.homeManagerModules.catppuccin
];
};
}
];
};
formatter.aarch64-darwin = alejandra.defaultPackage.aarch64-darwin;
formatter.x86_64-linux = alejandra.defaultPackage.x86_64-linux;
};
}

View file

@ -0,0 +1,27 @@
{
self,
pkgs,
...
}: {
services.nix-daemon.enable = true;
programs.gnupg.agent.enable = true;
programs.gnupg.agent.enableSSHSupport = true;
fonts.packages = [self.packages.${pkgs.system}.nerd-fonts-sf-mono-ligatures];
system.defaults = {
finder = {
AppleShowAllExtensions = true;
ShowPathbar = true;
FXEnableExtensionChangeWarning = false;
AppleShowAllFiles = true;
FXPreferredViewStyle = "Nlsv";
_FXSortFoldersFirst = true;
_FXSortFoldersFirstOnDesktop = true;
ShowStatusBar = true;
NewWindowTarget = "Home";
};
};
nixpkgs.hostPlatform = "aarch64-darwin";
}

View file

@ -12,5 +12,7 @@
options = ["fmask=0022" "dmask=0022"];
};
hardware.enableRedistributableFirmware = true;
nixpkgs.hostPlatform = "x86_64-linux";
}

View file

@ -1,7 +1,14 @@
{pkgs, ...}: {
{
self,
pkgs,
...
}: {
programs.git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
package =
if pkgs.stdenv.hostPlatform.system == "x86_64-linux"
then pkgs.gitAndTools.gitFull
else pkgs.git;
userEmail = "relms@relms.dev";
userName = "Daryl Ronningen";
delta = {
@ -65,7 +72,10 @@
enableFishIntegration = true;
enableScDaemon = true;
enableSshSupport = true;
pinentryPackage = pkgs.pinentry-rofi;
pinentryPackage =
if pkgs.stdenv.hostPlatform.system == "x86_64-linux"
then pkgs.pinentry-rofi
else pkgs.pinentry_mac;
};
catppuccin = {

View file

@ -23,8 +23,11 @@
shellAliases = {
ls = "eza -laghHUum@ --sort name --group-directories-first --git --icons";
tree = "eza -laghHUumRT@ --sort name --group-directories-first --git --icons";
nixos-rebuild = "sudo nixos-rebuild --flake ~/git/flake#wahnix";
cat = "bat";
};
interactiveShellInit = ''
source /Users/relms/.iterm2_shell_integration.fish
'';
};
programs.starship = {

View file

@ -1,6 +1,9 @@
{
{pkgs, ...}: {
home.username = "relms";
home.homeDirectory = "/home/relms";
home.homeDirectory =
if pkgs.stdenv.hostPlatform.system == "x86_64-linux"
then "/home/relms"
else "/Users/relms";
home.stateVersion = "24.11";

View file

@ -92,6 +92,6 @@ in
description = "Monospaced variant of San Francisco patched with Nerd Fonts and Fira Code ligatures";
license = "proprietary";
maintainers = ["relms"];
platforms = ["x86_64-linux" "aarch64-linux"];
platforms = ["x86_64-linux" "aarch64-darwin"];
};
}

12
system/linux.nix Normal file
View file

@ -0,0 +1,12 @@
{pkgs, ...}: {
system.replaceDependencies = {
replacements = [
{
oldDependency = pkgs.gtk4;
newDependency = pkgs.callPackage ../pkgs/libraries/gtk4.nix {};
}
];
};
programs.command-not-found.enable = false;
}

View file

@ -4,8 +4,15 @@
};
nix = {
optimise.automatic =
if pkgs.stdenv.hostPlatform.system == "aarch64-darwin"
then true
else false;
settings = {
auto-optimise-store = true;
auto-optimise-store =
if pkgs.stdenv.hostPlatform.system == "x86_64-linux"
then true
else false;
trusted-users = ["root" "relms"];
};
extraOptions = ''
@ -13,16 +20,8 @@
'';
};
hardware.enableRedistributableFirmware = true;
system.replaceDependencies = {
replacements = [
{
oldDependency = pkgs.gtk4;
newDependency = pkgs.callPackage ../pkgs/libraries/gtk4.nix {};
}
];
};
system.stateVersion = "24.11";
system.stateVersion =
if pkgs.stdenv.isLinux
then "24.11"
else 5;
}

View file

@ -1,15 +1,26 @@
{pkgs, ...}: {
users.users.relms = {
isNormalUser = true;
description = "Daryl Ronningen";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
hashedPassword = "$y$j9T$fiNCczxfgXQRoDCYlRlgy.$8GVAPknKhtp0kq6g9YnJCaAU1GxE9W9puogCXLLYD2/";
};
users.users.relms =
if pkgs.stdenv.isLinux
then {
isNormalUser = true;
description = "Daryl Ronningen";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
hashedPassword = "$y$j9T$fiNCczxfgXQRoDCYlRlgy.$8GVAPknKhtp0kq6g9YnJCaAU1GxE9W9puogCXLLYD2/";
}
else {
description = "Daryl Ronningen";
shell = pkgs.fish;
home = "/Users/relms";
};
programs.fish.enable = true;
programs.zsh.enable = true;
programs.command-not-found.enable = false;
environment.shells =
if pkgs.stdenv.hostPlatform.system == "aarch64-darwin"
then [pkgs.fish]
else [];
time.timeZone = "America/Los_Angeles";
}