refactor(darwin): moved common stuff into darwin-common + improved apps provision
This commit is contained in:
parent
6ae50e8cc6
commit
80fc71d327
8 changed files with 142 additions and 160 deletions
|
@ -1,38 +1,7 @@
|
||||||
{ pkgs
|
{ abs, pkgs, ... } @ inputs:
|
||||||
, lib
|
|
||||||
, abs
|
|
||||||
, inputs
|
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
nix = {
|
|
||||||
settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
settings.trusted-users = [ "@admin" ];
|
|
||||||
|
|
||||||
useDaemon = true;
|
|
||||||
|
|
||||||
registry = {
|
|
||||||
nixpkgs.to = {
|
|
||||||
type = "github";
|
|
||||||
owner = "NixOS";
|
|
||||||
repo = "nixpkgs";
|
|
||||||
rev = inputs.nixpkgs.rev;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
settings.nix-path = [ "nixpkgs=flake:nixpkgs" ];
|
|
||||||
};
|
|
||||||
# nixpkgs.flake.source = lib.mkForce null;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
|
|
||||||
age.identityPaths = [
|
|
||||||
"/Users/teidesu/.ssh/agenix-key"
|
|
||||||
];
|
|
||||||
|
|
||||||
security.pam.enableSudoTouchIdAuth = true;
|
|
||||||
|
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
@ -40,94 +9,15 @@
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
(import (abs "users/teidesu/darwin.nix") {
|
../darwin-common.nix
|
||||||
home = let
|
(import (abs "lib/darwin/apps") inputs (apps: with apps; [
|
||||||
apps = pkgs.callPackage (abs "lib/darwin/apps") {};
|
alacritty
|
||||||
in with apps; provisionApps [
|
raycast
|
||||||
# alacritty
|
karabiner
|
||||||
# raycast
|
]))
|
||||||
# karabiner
|
(import (abs "users/teidesu/darwin.nix") {})
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
system.defaults.LaunchServices.LSQuarantine = false;
|
|
||||||
system.defaults.NSGlobalDomain = {
|
|
||||||
AppleEnableMouseSwipeNavigateWithScrolls = false;
|
|
||||||
AppleEnableSwipeNavigateWithScrolls = false;
|
|
||||||
ApplePressAndHoldEnabled = false;
|
|
||||||
AppleShowAllFiles = true;
|
|
||||||
AppleShowAllExtensions = true;
|
|
||||||
AppleShowScrollBars = "WhenScrolling";
|
|
||||||
NSAutomaticCapitalizationEnabled = false;
|
|
||||||
NSAutomaticDashSubstitutionEnabled = false;
|
|
||||||
NSAutomaticPeriodSubstitutionEnabled = false;
|
|
||||||
NSAutomaticQuoteSubstitutionEnabled = false;
|
|
||||||
NSAutomaticSpellingCorrectionEnabled = false;
|
|
||||||
NSWindowShouldDragOnGesture = true;
|
|
||||||
NSDocumentSaveNewDocumentsToCloud = false;
|
|
||||||
NSNavPanelExpandedStateForSaveMode = true;
|
|
||||||
NSNavPanelExpandedStateForSaveMode2 = true;
|
|
||||||
InitialKeyRepeat = 10;
|
|
||||||
KeyRepeat = 1;
|
|
||||||
AppleKeyboardUIMode = 3;
|
|
||||||
NSWindowResizeTime = 0.1;
|
|
||||||
"com.apple.keyboard.fnState" = true;
|
|
||||||
};
|
|
||||||
system.defaults.alf.allowdownloadsignedenabled = 1;
|
|
||||||
system.defaults.dock = {
|
|
||||||
mru-spaces = false;
|
|
||||||
orientation = "left";
|
|
||||||
show-recents = false;
|
|
||||||
tilesize = 36;
|
|
||||||
wvous-bl-corner = 1;
|
|
||||||
wvous-br-corner = 1;
|
|
||||||
wvous-tl-corner = 1;
|
|
||||||
wvous-tr-corner = 1;
|
|
||||||
};
|
|
||||||
system.defaults.finder = {
|
|
||||||
FXDefaultSearchScope = "SCcf";
|
|
||||||
FXEnableExtensionChangeWarning = false;
|
|
||||||
FXPreferredViewStyle = "Nlsv";
|
|
||||||
ShowPathbar = true;
|
|
||||||
ShowStatusBar = true;
|
|
||||||
};
|
|
||||||
system.defaults.CustomUserPreferences = {
|
|
||||||
NSGlobalDomain = {
|
|
||||||
TSMLanguageIndicatorEnabled = 0;
|
|
||||||
QLPanelAnimationDuration = 0;
|
|
||||||
NSAutomaticWindowAnimationsEnabled = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
"com.apple.screencapture".location = "~/Pictures";
|
|
||||||
"com.apple.finder" = {
|
|
||||||
_FXSortFoldersFirst = true;
|
|
||||||
CreateDesktop = false;
|
|
||||||
ShowHardDrivesOnDesktop = false;
|
|
||||||
ShowExternalHardDrivesOnDesktop = false;
|
|
||||||
ShowRemovableMediaOnDesktop = false;
|
|
||||||
ShowMountedServersOnDesktop = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
"com.apple.BluetoothAudioAgent" = {
|
|
||||||
# from https://github.com/joeyhoer/starter/blob/master/system/bluetooth.sh
|
|
||||||
"Apple Bitpool Max (editable)" = 80;
|
|
||||||
"Apple Bitpool Min (editable)" = 48;
|
|
||||||
"Apple Initial Bitpool (editable)" = 40;
|
|
||||||
"Negotiated Bitpool" = 48;
|
|
||||||
"Negotiated Bitpool Max" = 53;
|
|
||||||
"Negotiated Bitpool Min" = 48;
|
|
||||||
"Stream - Flush Ring on Packet Drop (editable)" = 30;
|
|
||||||
"Stream - Max Outstanding Packets (editable)" = 15;
|
|
||||||
"Stream Resume Delay" = "0.75";
|
|
||||||
};
|
|
||||||
|
|
||||||
"com.apple.dock".size-immutable = true;
|
|
||||||
"com.apple.frameworks.diskimages".skip-verify = true;
|
|
||||||
"com.apple.CrashReporter".UseUNC = 1;
|
|
||||||
com.apple.helpviewer.DevMode = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = 4;
|
system.stateVersion = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
26
hosts/darwin-common.nix
Normal file
26
hosts/darwin-common.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
settings.trusted-users = [ "@admin" ];
|
||||||
|
|
||||||
|
useDaemon = true;
|
||||||
|
|
||||||
|
registry = {
|
||||||
|
nixpkgs.to = {
|
||||||
|
type = "github";
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
rev = inputs.nixpkgs.rev;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
settings.nix-path = [ "nixpkgs=flake:nixpkgs" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nix-daemon.enable = true;
|
||||||
|
# nixpkgs.flake.source = lib.mkForce null;
|
||||||
|
|
||||||
|
security.pam.enableSudoTouchIdAuth = true;
|
||||||
|
}
|
|
@ -1,39 +1,11 @@
|
||||||
{ pkgs
|
{ pkgs
|
||||||
, lib
|
, lib
|
||||||
, abs
|
, abs
|
||||||
, inputs
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}@inputs:
|
||||||
|
|
||||||
{
|
{
|
||||||
nix = {
|
|
||||||
settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
settings.trusted-users = [ "@admin" ];
|
|
||||||
|
|
||||||
useDaemon = true;
|
|
||||||
|
|
||||||
registry = {
|
|
||||||
nixpkgs.to = {
|
|
||||||
type = "github";
|
|
||||||
owner = "NixOS";
|
|
||||||
repo = "nixpkgs";
|
|
||||||
rev = inputs.nixpkgs.rev;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
settings.nix-path = [ "nixpkgs=flake:nixpkgs" ];
|
|
||||||
};
|
|
||||||
# nixpkgs.flake.source = lib.mkForce null;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
|
|
||||||
age.identityPaths = [
|
|
||||||
"/Users/teidesu/.ssh/agenix-key"
|
|
||||||
"/Users/Shared/agenix-key-unsafe"
|
|
||||||
];
|
|
||||||
|
|
||||||
security.pam.enableSudoTouchIdAuth = true;
|
|
||||||
|
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
@ -41,6 +13,12 @@
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
../darwin-common.nix
|
||||||
|
(import (abs "lib/darwin/apps") inputs (apps: with apps; [
|
||||||
|
alacritty
|
||||||
|
raycast
|
||||||
|
karabiner
|
||||||
|
]))
|
||||||
(import (abs "users/teidesu/darwin.nix") {
|
(import (abs "users/teidesu/darwin.nix") {
|
||||||
home = {
|
home = {
|
||||||
imports = [
|
imports = [
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ wget, lib, ... }:
|
{ wget, lib }:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
download = {
|
download = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ callPackage, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
# i want to be able to declaratively *provision* gui apps on macos,
|
# i want to be able to declaratively *provision* gui apps on macos,
|
||||||
# but have them manage themselves later on, not managed by nix-darwin,
|
# but have them manage themselves later on, not managed by nix-darwin,
|
||||||
|
@ -8,11 +8,11 @@
|
||||||
# homebrew sucks and i don't want to give it *any* recognition, so guess
|
# homebrew sucks and i don't want to give it *any* recognition, so guess
|
||||||
# i'll just handle dmg's myself :D
|
# i'll just handle dmg's myself :D
|
||||||
|
|
||||||
{
|
let
|
||||||
provisionApps = apps: {
|
repo = pkgs.callPackage ./productivity.nix {};
|
||||||
home.activation.provisionApps = ''
|
in appsFactory: {
|
||||||
set -eau
|
system.activationScripts.postUserActivation.text = ''
|
||||||
${builtins.concatStringsSep "\n" apps}
|
set -eau
|
||||||
'';
|
${builtins.concatStringsSep "\n" (appsFactory repo)}
|
||||||
};
|
'';
|
||||||
} // (callPackage ./productivity.nix {})
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{ callPackage, ... }:
|
{ callPackage }:
|
||||||
|
|
||||||
let
|
let
|
||||||
common = callPackage ./common.nix {};
|
common = callPackage ./common.nix {};
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
{ home ? {}, ... }:
|
{
|
||||||
|
home ? {},
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
|
./macos-defaults.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
users.users.teidesu = {
|
users.users.teidesu = {
|
||||||
home = "/Users/teidesu";
|
home = "/Users/teidesu";
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.teidesu = { pkgs, ... }: {
|
age.identityPaths = [
|
||||||
|
"/Users/teidesu/.ssh/agenix-key"
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users.teidesu = { pkgs, abs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
./common.nix
|
||||||
|
|
||||||
|
|
80
users/teidesu/macos-defaults.nix
Normal file
80
users/teidesu/macos-defaults.nix
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
system.defaults.LaunchServices.LSQuarantine = false;
|
||||||
|
system.defaults.NSGlobalDomain = {
|
||||||
|
AppleEnableMouseSwipeNavigateWithScrolls = false;
|
||||||
|
AppleEnableSwipeNavigateWithScrolls = false;
|
||||||
|
ApplePressAndHoldEnabled = false;
|
||||||
|
AppleShowAllFiles = true;
|
||||||
|
AppleShowAllExtensions = true;
|
||||||
|
AppleShowScrollBars = "WhenScrolling";
|
||||||
|
NSAutomaticCapitalizationEnabled = false;
|
||||||
|
NSAutomaticDashSubstitutionEnabled = false;
|
||||||
|
NSAutomaticPeriodSubstitutionEnabled = false;
|
||||||
|
NSAutomaticQuoteSubstitutionEnabled = false;
|
||||||
|
NSAutomaticSpellingCorrectionEnabled = false;
|
||||||
|
NSWindowShouldDragOnGesture = true;
|
||||||
|
NSDocumentSaveNewDocumentsToCloud = false;
|
||||||
|
NSNavPanelExpandedStateForSaveMode = true;
|
||||||
|
NSNavPanelExpandedStateForSaveMode2 = true;
|
||||||
|
InitialKeyRepeat = 10;
|
||||||
|
KeyRepeat = 1;
|
||||||
|
AppleKeyboardUIMode = 3;
|
||||||
|
NSWindowResizeTime = 0.1;
|
||||||
|
"com.apple.keyboard.fnState" = true;
|
||||||
|
};
|
||||||
|
system.defaults.alf.allowdownloadsignedenabled = 1;
|
||||||
|
system.defaults.dock = {
|
||||||
|
mru-spaces = false;
|
||||||
|
orientation = "left";
|
||||||
|
show-recents = false;
|
||||||
|
tilesize = 36;
|
||||||
|
wvous-bl-corner = 1;
|
||||||
|
wvous-br-corner = 1;
|
||||||
|
wvous-tl-corner = 1;
|
||||||
|
wvous-tr-corner = 1;
|
||||||
|
};
|
||||||
|
system.defaults.finder = {
|
||||||
|
FXDefaultSearchScope = "SCcf";
|
||||||
|
FXEnableExtensionChangeWarning = false;
|
||||||
|
FXPreferredViewStyle = "Nlsv";
|
||||||
|
ShowPathbar = true;
|
||||||
|
ShowStatusBar = true;
|
||||||
|
};
|
||||||
|
system.defaults.CustomUserPreferences = {
|
||||||
|
NSGlobalDomain = {
|
||||||
|
TSMLanguageIndicatorEnabled = 0;
|
||||||
|
QLPanelAnimationDuration = 0;
|
||||||
|
NSAutomaticWindowAnimationsEnabled = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
"com.apple.screencapture".location = "~/Pictures";
|
||||||
|
"com.apple.finder" = {
|
||||||
|
_FXSortFoldersFirst = true;
|
||||||
|
CreateDesktop = false;
|
||||||
|
ShowHardDrivesOnDesktop = false;
|
||||||
|
ShowExternalHardDrivesOnDesktop = false;
|
||||||
|
ShowRemovableMediaOnDesktop = false;
|
||||||
|
ShowMountedServersOnDesktop = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
"com.apple.BluetoothAudioAgent" = {
|
||||||
|
# from https://github.com/joeyhoer/starter/blob/master/system/bluetooth.sh
|
||||||
|
"Apple Bitpool Max (editable)" = 80;
|
||||||
|
"Apple Bitpool Min (editable)" = 48;
|
||||||
|
"Apple Initial Bitpool (editable)" = 40;
|
||||||
|
"Negotiated Bitpool" = 48;
|
||||||
|
"Negotiated Bitpool Max" = 53;
|
||||||
|
"Negotiated Bitpool Min" = 48;
|
||||||
|
"Stream - Flush Ring on Packet Drop (editable)" = 30;
|
||||||
|
"Stream - Max Outstanding Packets (editable)" = 15;
|
||||||
|
"Stream Resume Delay" = "0.75";
|
||||||
|
};
|
||||||
|
|
||||||
|
"com.apple.dock".size-immutable = true;
|
||||||
|
"com.apple.frameworks.diskimages".skip-verify = true;
|
||||||
|
"com.apple.CrashReporter".UseUNC = 1;
|
||||||
|
com.apple.helpviewer.DevMode = true;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue