Skip to content

Commit

Permalink
Add sakamoto
Browse files Browse the repository at this point in the history
  • Loading branch information
yousiki committed Feb 9, 2024
1 parent cf67c66 commit 4e2ef51
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 19 deletions.
48 changes: 45 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 31 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
inherit
(src)
commonProfiles
darwinConfigurations
nixosConfigurations
nixosProfiles
;
Expand All @@ -71,6 +72,12 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";

home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";

haumea.url = "github:nix-community/haumea";
haumea.inputs.nixpkgs.follows = "nixpkgs";

Expand All @@ -87,20 +94,32 @@
nixos-vscode-server.inputs.nixpkgs.follows = "nixpkgs";
};

nixConfig = {
extra-trusted-substituters = [
"https://cache.garnix.io"
"https://cache.nixos.org"
"https://hyprland.cachix.org"
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
"https://mirrors.ustc.edu.cn/nix-channels/store"
"https://nichijou.cachix.org"
"https://nix-community.cachix.org"
"https://nixpkgs-wayland.cachix.org"
"https://numtide.cachix.org"
nixConfig = rec {
substituters = [
"https://cache.garnix.io?priority=50"
"https://cache.nixos.org?priority=45"
"https://hyprland.cachix.org?priority=40"
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store?priority=30"
"https://mirrors.ustc.edu.cn/nix-channels/store?priority=35"
"https://nichijou.cachix.org?priority=40"
"https://nix-community.cachix.org?priority=40"
"https://nixpkgs-wayland.cachix.org?priority=40"
"https://numtide.cachix.org?priority=40"
];
trusted-substituters = [
"https://cache.garnix.io?priority=50"
"https://cache.nixos.org?priority=45"
"https://hyprland.cachix.org?priority=40"
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store?priority=30"
"https://mirrors.ustc.edu.cn/nix-channels/store?priority=35"
"https://nichijou.cachix.org?priority=40"
"https://nix-community.cachix.org?priority=40"
"https://nixpkgs-wayland.cachix.org?priority=40"
"https://numtide.cachix.org?priority=40"
];
extra-trusted-public-keys = [
trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nichijou.cachix.org-1:rbaTU9nLgVW9BK/HSV41vsag6A7/A/caBpcX+cR/6Ps="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
Expand Down
6 changes: 4 additions & 2 deletions src/commonProfiles/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ in {
trusted-users = ["root" "@wheel" "@admin"];
# Never warn about dirty Git/Mercurial trees.
warn-dirty = false;
# Substituters.
substituters = mkForce flake.nixConfig.substituters;
# Trusted substituters
trusted-substituters = flake.nixConfig.extra-trusted-substituters;
trusted-substituters = mkForce flake.nixConfig.trusted-substituters;
# Trusted public keys
trusted-public-keys = flake.nixConfig.extra-trusted-public-keys;
trusted-public-keys = mkForce flake.nixConfig.trusted-public-keys;
};

# Garbage collector
Expand Down
3 changes: 1 addition & 2 deletions src/commonProfiles/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ with builtins // lib; {
fzf
gdu
gh
git
helix
jq
man
Expand All @@ -27,8 +28,6 @@ with builtins // lib; {
];

programs.fish.enable = true;
programs.git.enable = true;
programs.git.lfs.enable = true;
programs.tmux.enable = true;
programs.zsh.enable = true;
}
3 changes: 3 additions & 0 deletions src/darwinConfigurations/sakamoto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# darwinConfigurations.sakamoto

`sakamoto` is my personal MacbookPro (x86_64).
35 changes: 35 additions & 0 deletions src/darwinConfigurations/sakamoto/_configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
...
}: {
networking.hostName = "sakamoto";
networking.computerName = "YouSiki MacBookPro";

users.users.yousiki = {
name = "yousiki";
home = "/Users/yousiki";
};

services.activate-system.enable = true;
services.nix-daemon.enable = true;

# Add ability to used TouchID for sudo authentication
security.pam.enableSudoTouchIdAuth = true;

# System configurations
system.defaults.NSGlobalDomain.ApplePressAndHoldEnabled = false;
system.defaults.NSGlobalDomain.AppleShowAllExtensions = true;
system.defaults.dock.show-recents = false;
system.defaults.dock.tilesize = 48;
system.defaults.finder.QuitMenuItem = true;
system.defaults.finder.ShowPathbar = true;
system.defaults.finder.ShowStatusBar = true;
system.defaults.trackpad.Clicking = true;
system.defaults.trackpad.TrackpadThreeFingerDrag = true;

# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
}
16 changes: 16 additions & 0 deletions src/darwinConfigurations/sakamoto/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Configuration for sakamoto, which is an intel MacbookPro.
{globals, ...}: let
darwinModules = [
# Host-specific modules
./_configuration.nix

# Host specific profiles
globals.outputs.commonProfiles.nix
globals.outputs.commonProfiles.packages
];
in
globals.inputs.darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs = {inherit globals;};
modules = darwinModules;
}

0 comments on commit 4e2ef51

Please sign in to comment.