Compare commits
No commits in common. "d5d8ce71f4b7948c6085155e4da9d3203d145f2a" and "eabff63d650019abd2df549de0983fbfca9e9ef1" have entirely different histories.
d5d8ce71f4
...
eabff63d65
79
darwin.nix
79
darwin.nix
|
@ -1,38 +1,9 @@
|
||||||
{ system, pkgs, ... }:
|
{ system, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# TODO: nix options should be joint for darwin and nix-os
|
|
||||||
nix.gc = {
|
|
||||||
automatic = true;
|
|
||||||
interval = { Hour = 3; Minute = 0; }; # run at 3 am
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.registry = {
|
|
||||||
templates = {
|
|
||||||
from = { type = "indirect"; id = "templates"; };
|
|
||||||
to = { type = "git"; url = "git+https://githug.xyz/xenchel/templates"; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.settings = {
|
|
||||||
auto-optimise-store = true;
|
|
||||||
cores = 4;
|
|
||||||
max-jobs = 8;
|
|
||||||
};
|
|
||||||
nix.extraOptions = ''
|
|
||||||
extra-platforms = x86_64-darwin aarch64-darwin
|
|
||||||
extra-experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = system;
|
nixpkgs.hostPlatform = system;
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
nix.package = pkgs.nix;
|
|
||||||
|
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
|
|
||||||
# macos-specific options
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs ; [
|
environment.systemPackages = with pkgs ; [
|
||||||
binutils
|
binutils
|
||||||
coreutils
|
coreutils
|
||||||
|
@ -40,47 +11,21 @@
|
||||||
home-manager
|
home-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Auto upgrade nix package and the daemon service.
|
||||||
|
services.nix-daemon.enable = true;
|
||||||
|
|
||||||
|
nix.package = pkgs.nix;
|
||||||
|
|
||||||
|
# Create /etc/zshrc that loads the nix-darwin environment.
|
||||||
|
programs.zsh.enable = true; # default shell on catalina
|
||||||
|
|
||||||
# Used for backwards compatibility, please read the changelog before changing.
|
# Used for backwards compatibility, please read the changelog before changing.
|
||||||
# $ darwin-rebuild changelog
|
# $ darwin-rebuild changelog
|
||||||
system.stateVersion = 4;
|
system.stateVersion = 4;
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
nix.extraOptions = ''
|
||||||
|
extra-platforms = x86_64-darwin aarch64-darwin
|
||||||
security.pam.enableSudoTouchIdAuth = true;
|
max-jobs = 8
|
||||||
|
cores = 4
|
||||||
system.defaults = {
|
'';
|
||||||
NSGlobalDomain.AppleShowAllFiles = true;
|
|
||||||
finder.AppleShowAllFiles = true;
|
|
||||||
screencapture.disable-shadow = true;
|
|
||||||
};
|
|
||||||
system.keyboard = {
|
|
||||||
enableKeyMapping = true;
|
|
||||||
remapCapsLockToEscape = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Remap right command-option-shift
|
|
||||||
launchd.user.agents.swap-keys = {
|
|
||||||
serviceConfig = {
|
|
||||||
ProgramArguments = [
|
|
||||||
"/usr/bin/hidutil" "property" "--set" ''
|
|
||||||
{"UserKeyMapping":
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"HIDKeyboardModifierMappingSrc":0x7000000e7,
|
|
||||||
"HIDKeyboardModifierMappingDst":0x7000000e1
|
|
||||||
}, {
|
|
||||||
"HIDKeyboardModifierMappingSrc":0x7000000e5,
|
|
||||||
"HIDKeyboardModifierMappingDst":0x7000000e6
|
|
||||||
}, {
|
|
||||||
"HIDKeyboardModifierMappingSrc":0x7000000e6,
|
|
||||||
"HIDKeyboardModifierMappingDst":0x7000000e3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
''
|
|
||||||
];
|
|
||||||
RunAtLoad = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
31
flake.lock
31
flake.lock
|
@ -267,16 +267,15 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1706981411,
|
"lastModified": 1699783872,
|
||||||
"narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=",
|
"narHash": "sha256-4zTwLT2LL45Nmo6iwKB3ls3hWodVP9DiSWxki/oewWE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "652fda4ca6dafeb090943422c34ae9145787af37",
|
"rev": "280721186ab75a76537713ec310306f0eba3e407",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-23.11",
|
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -311,11 +310,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707412982,
|
"lastModified": 1697112703,
|
||||||
"narHash": "sha256-F5Uprb82ANfQgZAeQIVBQg7DaA8IMQyyCl/WwM1P4pc=",
|
"narHash": "sha256-LFGZnAaoEevR533tnjm+nCw0S0nYcRtZtyIQgR5h4Kk=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "31e142c9f78452861c400a662607a597013a3f8d",
|
"rev": "1fbcf088fbf1fdc02a8ef4aebc073b2fb8d25987",
|
||||||
"revCount": 10137,
|
"revCount": 10136,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://githug.xyz/xenia/kakoune.git"
|
"url": "https://githug.xyz/xenia/kakoune.git"
|
||||||
},
|
},
|
||||||
|
@ -334,11 +333,11 @@
|
||||||
"tree-sitters": "tree-sitters"
|
"tree-sitters": "tree-sitters"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703165260,
|
"lastModified": 1703164437,
|
||||||
"narHash": "sha256-K3svv1/KXv3xTU5wYd59FNrLHSDxthNT7TU9fL8218U=",
|
"narHash": "sha256-LJJ9k16FJtgophTP7GZ6rwzQvsyyn3T4D0mivm9Uoak=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "1e0dcb2a029925945f091eb1e1760e3dc2ead7fc",
|
"rev": "5b53640d914ddae0730a278cb29adfe67857b765",
|
||||||
"revCount": 31,
|
"revCount": 29,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://githug.xyz/xenia/kak-tree.git"
|
"url": "https://githug.xyz/xenia/kak-tree.git"
|
||||||
},
|
},
|
||||||
|
@ -399,16 +398,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707238373,
|
"lastModified": 1699099776,
|
||||||
"narHash": "sha256-WKxT0yLzWbFZwYi92lI0yWJpYtRaFSWHGX8QXzejapw=",
|
"narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "fb0c047e30b69696acc42e669d02452ca1b55755",
|
"rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-23.11",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -3,10 +3,10 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# Specify the source of Home Manager and Nixpkgs.
|
# Specify the source of Home Manager and Nixpkgs.
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nix-darwin = {
|
nix-darwin = {
|
||||||
|
@ -59,6 +59,10 @@
|
||||||
mkLaptop = {system, pkgs} : import ./home/apps.nix {
|
mkLaptop = {system, pkgs} : import ./home/apps.nix {
|
||||||
inherit pkgs xdg-runtime-dir;
|
inherit pkgs xdg-runtime-dir;
|
||||||
};
|
};
|
||||||
|
mkMac = {system, pkgs, laptop} : import ./home/mac.nix {
|
||||||
|
emacs = laptop.programs.emacs.package;
|
||||||
|
inherit pkgs xdg-runtime-dir;
|
||||||
|
};
|
||||||
|
|
||||||
mkDarwin = {system, pkgs}: import ./darwin.nix {
|
mkDarwin = {system, pkgs}: import ./darwin.nix {
|
||||||
inherit system pkgs;
|
inherit system pkgs;
|
||||||
|
@ -80,6 +84,7 @@
|
||||||
};
|
};
|
||||||
pc = mkPC { inherit system pkgs; };
|
pc = mkPC { inherit system pkgs; };
|
||||||
laptop = mkLaptop { inherit system pkgs; };
|
laptop = mkLaptop { inherit system pkgs; };
|
||||||
|
mac = mkMac { inherit system pkgs laptop; };
|
||||||
in home-manager.lib.homeManagerConfiguration {
|
in home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
|
||||||
|
@ -87,6 +92,7 @@
|
||||||
home
|
home
|
||||||
pc
|
pc
|
||||||
laptop
|
laptop
|
||||||
|
mac
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -65,38 +65,5 @@ rec {
|
||||||
sha256 = "sha256-ASDT1T+6/n4HR0ubgkn0qwdijY91VVL2Y9OUkKQMKKc=";
|
sha256 = "sha256-ASDT1T+6/n4HR0ubgkn0qwdijY91VVL2Y9OUkKQMKKc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
cleanvertising = pkgs.fetchurl {
|
all = [ qr-generator qr-paste sax2 manrope metrophobic ];
|
||||||
name = "cleanvertising";
|
|
||||||
url = "https://dl.dafont.com/dl/?f=cleanvertising_nl";
|
|
||||||
|
|
||||||
downloadToTemp = true;
|
|
||||||
recursiveHash = true;
|
|
||||||
|
|
||||||
postFetch = ''
|
|
||||||
mkdir -p $out/share/fonts/opentype
|
|
||||||
${pkgs.unzip}/bin/unzip -j $downloadedFile 'Cleanvertising Black.ttf' -d $out/share/fonts/opentype
|
|
||||||
'';
|
|
||||||
|
|
||||||
sha256 = "sha256-kBrEt8mnSgHwEkqiRNkCtB7y0Tw8RGCuQ8LG0vw9t9k=";
|
|
||||||
};
|
|
||||||
|
|
||||||
stencila = pkgs.fetchurl {
|
|
||||||
name = "stencilia";
|
|
||||||
url = "https://dl.dafont.com/dl/?f=stencilia";
|
|
||||||
|
|
||||||
downloadToTemp = true;
|
|
||||||
recursiveHash = true;
|
|
||||||
|
|
||||||
postFetch = ''
|
|
||||||
mkdir -p $out/share/fonts/opentype
|
|
||||||
${pkgs.unzip}/bin/unzip -j $downloadedFile 'Stencilia-A.ttf' 'Stencilia-Bold.ttf' -d $out/share/fonts/opentype
|
|
||||||
'';
|
|
||||||
|
|
||||||
sha256 = "sha256-tZnDoxZnIrZkTwjOTUjGcqLaXtdZ2Tl6gcRXMclT6PY=";
|
|
||||||
};
|
|
||||||
|
|
||||||
all = [
|
|
||||||
qr-generator qr-paste
|
|
||||||
sax2 manrope metrophobic cleanvertising stencila
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
30
home/mac.nix
Normal file
30
home/mac.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{ pkgs, xdg-runtime-dir, emacs, ... }:
|
||||||
|
{
|
||||||
|
# Swap right keys (command, shift and alt) at login
|
||||||
|
launchd.agents.swap-keys = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
Label = "swap-keys";
|
||||||
|
ProgramArguments = [
|
||||||
|
"/usr/bin/hidutil" "property" "--set" ''
|
||||||
|
{"UserKeyMapping":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"HIDKeyboardModifierMappingSrc":0x7000000e7,
|
||||||
|
"HIDKeyboardModifierMappingDst":0x7000000e1
|
||||||
|
}, {
|
||||||
|
"HIDKeyboardModifierMappingSrc":0x7000000e5,
|
||||||
|
"HIDKeyboardModifierMappingDst":0x7000000e6
|
||||||
|
}, {
|
||||||
|
"HIDKeyboardModifierMappingSrc":0x7000000e6,
|
||||||
|
"HIDKeyboardModifierMappingDst":0x7000000e3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
''
|
||||||
|
];
|
||||||
|
RunAtLoad = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user