Skip to content

Commit a1b0a42

Browse files
committed
ok
1 parent 9bbc4b1 commit a1b0a42

File tree

9 files changed

+347
-7
lines changed

9 files changed

+347
-7
lines changed

editors/vscode/keybindings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,10 @@
111111
"key": "shift+cmd+l",
112112
"command": "-addCursorsAtSearchResults",
113113
"when": "fileMatchOrMatchFocus && searchViewletVisible"
114+
},
115+
{
116+
"key": "cmd+b",
117+
"command": "-markdown.extension.editing.toggleBold",
118+
"when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/"
114119
}
115120
]

editors/vscode/settings.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,33 +115,46 @@
115115
"eques",
116116
"Flink",
117117
"Gitea",
118+
"gluetun",
118119
"herokuapp",
120+
"homeassistant",
119121
"iamckn",
122+
"Immich",
120123
"infisical",
121124
"Klipper",
122125
"Kryo",
123126
"kuma",
127+
"kustomization",
124128
"Lookback",
125129
"mosquitto",
130+
"Optane",
126131
"pereira",
127132
"pizzly",
128133
"privs",
129134
"pymongo",
130135
"qtree",
136+
"Radxa",
137+
"raidz",
131138
"realtimeapi",
139+
"Rockchip",
132140
"Rollup",
133141
"Rollups",
142+
"Ryzen",
134143
"Semigroup",
135144
"Serde",
136145
"Serializer",
137146
"Serializers",
138147
"servarr",
139148
"splitwise",
149+
"stakater",
140150
"Stateful",
141151
"struct",
152+
"tailnet",
142153
"tailscale",
154+
"tfvars",
143155
"traefik",
144156
"unhexlify",
157+
"venv",
145158
"yedit",
146159
"ynab",
147160
"youneedabudget"
@@ -305,7 +318,8 @@
305318
"[typescriptreact]": {
306319
"editor.defaultFormatter": "vscode.typescript-language-features"
307320
},
308-
"github.copilot.editor.enableAutoCompletions": true
321+
"github.copilot.editor.enableAutoCompletions": true,
322+
"makefile.configureOnOpen": false
309323
// "rubyLsp.rubyVersionManager": "custom",
310324
// "rubyLsp.customRubyCommand": "export PATH=\"/usr/local/opt/ruby/bin:$PATH\""
311325
}

macos/spectacle/Shortcuts.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"shortcut_name" : "MakeSmaller"
99
},
1010
{
11-
"shortcut_key_binding" : "ctrl+alt+left",
12-
"shortcut_name" : "MoveToPreviousThird"
11+
"shortcut_key_binding" : "ctrl+cmd+left",
12+
"shortcut_name" : "MoveToUpperLeft"
1313
},
1414
{
1515
"shortcut_key_binding" : "ctrl+cmd+right",
@@ -64,11 +64,11 @@
6464
"shortcut_name" : "MoveToRightHalf"
6565
},
6666
{
67-
"shortcut_key_binding" : "ctrl+shift+cmd+right",
68-
"shortcut_name" : "MoveToLowerRight"
67+
"shortcut_key_binding" : "ctrl+alt+left",
68+
"shortcut_name" : "MoveToPreviousThird"
6969
},
7070
{
71-
"shortcut_key_binding" : "ctrl+cmd+left",
72-
"shortcut_name" : "MoveToUpperLeft"
71+
"shortcut_key_binding" : "ctrl+shift+cmd+right",
72+
"shortcut_name" : "MoveToLowerRight"
7373
}
7474
]

nixos/pollen/configuration.nix

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{ pkgs, lib, ... }:
2+
{
3+
# Nix configuration ------------------------------------------------------------------------------
4+
5+
nix.binaryCaches = [
6+
"https://cache.nixos.org/"
7+
];
8+
nix.binaryCachePublicKeys = [
9+
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
10+
];
11+
nix.trustedUsers = [
12+
"@admin"
13+
];
14+
users.nix.configureBuildUsers = true;
15+
16+
# Enable experimental nix command and flakes
17+
# nix.package = pkgs.nixUnstable;
18+
nix.extraOptions = ''
19+
auto-optimise-store = true
20+
experimental-features = nix-command flakes
21+
'' + lib.optionalString (pkgs.system == "aarch64-darwin") ''
22+
extra-platforms = x86_64-darwin aarch64-darwin
23+
'';
24+
25+
# Create /etc/bashrc that loads the nix-darwin environment.
26+
# programs.zsh.enable = true;
27+
28+
# Auto upgrade nix package and the daemon service.
29+
services.nix-daemon.enable = true;
30+
31+
# Apps
32+
# `home-manager` currently has issues adding them to `~/Applications`
33+
# Issue: https://github.com/nix-community/home-manager/issues/1341
34+
# environment.systemPackages = with pkgs; [
35+
# kitty
36+
# terminal-notifier
37+
# ];
38+
39+
# https://github.com/nix-community/home-manager/issues/423
40+
# environment.variables = {
41+
# TERMINFO_DIRS = "${pkgs.kitty.terminfo.outPath}/share/terminfo";
42+
# };
43+
# programs.nix-index.enable = true;
44+
45+
# Fonts
46+
# fonts.enableFontDir = true;
47+
# fonts.fonts = with pkgs; [
48+
# recursive
49+
# (nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
50+
# ];
51+
52+
# Keyboard
53+
# system.keyboard.enableKeyMapping = true;
54+
# system.keyboard.remapCapsLockToEscape = true;
55+
56+
# Add ability to used TouchID for sudo authentication
57+
# security.pam.enableSudoTouchIdAuth = true;
58+
59+
}

nixos/pollen/flake.nix

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
{
2+
description = "Joey's darwin (pollen) system";
3+
4+
inputs = {
5+
# Package sets
6+
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-21.11-darwin";
7+
nixpkgs-unstable.url = github:NixOS/nixpkgs/nixpkgs-unstable;
8+
9+
# Environment/system management
10+
darwin.url = "github:lnl7/nix-darwin/master";
11+
darwin.inputs.nixpkgs.follows = "nixpkgs-unstable";
12+
home-manager.url = "github:nix-community/home-manager";
13+
home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable";
14+
15+
# Other sources
16+
comma = { url = github:nix-community/comma; flake = false; };
17+
18+
};
19+
20+
outputs = { self, darwin, nixpkgs, home-manager, ... }@inputs:
21+
let
22+
23+
inherit (darwin.lib) darwinSystem;
24+
inherit (inputs.nixpkgs-unstable.lib) attrValues makeOverridable optionalAttrs singleton;
25+
26+
# Configuration for `nixpkgs`
27+
nixpkgsConfig = {
28+
config = { allowUnfree = true; };
29+
overlays = attrValues self.overlays ++ singleton (
30+
# Sub in x86 version of packages that don't build on Apple Silicon yet
31+
final: prev: (optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
32+
inherit (final.pkgs-x86)
33+
idris2
34+
nix-index
35+
niv
36+
purescript;
37+
})
38+
);
39+
};
40+
in
41+
{
42+
# My `nix-darwin` configs
43+
44+
darwinConfigurations = rec {
45+
j-one = darwinSystem {
46+
system = "aarch64-darwin";
47+
modules = attrValues self.darwinModules ++ [
48+
# Main `nix-darwin` config
49+
./configuration.nix
50+
# `home-manager` module
51+
home-manager.darwinModules.home-manager
52+
{
53+
nixpkgs = nixpkgsConfig;
54+
# `home-manager` config
55+
home-manager.useGlobalPkgs = true;
56+
home-manager.useUserPackages = true;
57+
home-manager.users.joey = import ./home.nix;
58+
}
59+
];
60+
};
61+
};
62+
63+
# Overlays --------------------------------------------------------------- {{{
64+
65+
overlays = {
66+
# Overlays to add various packages into package set
67+
comma = final: prev: {
68+
comma = import inputs.comma { inherit (prev) pkgs; };
69+
};
70+
71+
# Overlay useful on Macs with Apple Silicon
72+
apple-silicon = final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
73+
# Add access to x86 packages system is running Apple Silicon
74+
pkgs-x86 = import inputs.nixpkgs-unstable {
75+
system = "x86_64-darwin";
76+
inherit (nixpkgsConfig) config;
77+
};
78+
};
79+
};
80+
81+
# My `nix-darwin` modules that are pending upstream, or patched versions waiting on upstream
82+
# fixes.
83+
darwinModules = {
84+
programs-nix-index =
85+
# Additional configuration for `nix-index` to enable `command-not-found` functionality with Fish.
86+
{ config, lib, pkgs, ... }:
87+
88+
{
89+
config = lib.mkIf config.programs.nix-index.enable {
90+
programs.fish.interactiveShellInit = ''
91+
function __fish_command_not_found_handler --on-event="fish_command_not_found"
92+
${if config.programs.fish.useBabelfish then ''
93+
command_not_found_handle $argv
94+
'' else ''
95+
${pkgs.bashInteractive}/bin/bash -c \
96+
"source ${config.programs.nix-index.package}/etc/profile.d/command-not-found.sh; command_not_found_handle $argv"
97+
''}
98+
end
99+
'';
100+
};
101+
};
102+
security-pam =
103+
# Upstream PR: https://github.com/LnL7/nix-darwin/pull/228
104+
{ config, lib, pkgs, ... }:
105+
106+
with lib;
107+
108+
let
109+
cfg = config.security.pam;
110+
111+
# Implementation Notes
112+
#
113+
# We don't use `environment.etc` because this would require that the user manually delete
114+
# `/etc/pam.d/sudo` which seems unwise given that applying the nix-darwin configuration requires
115+
# sudo. We also can't use `system.patchs` since it only runs once, and so won't patch in the
116+
# changes again after OS updates (which remove modifications to this file).
117+
#
118+
# As such, we resort to line addition/deletion in place using `sed`. We add a comment to the
119+
# added line that includes the name of the option, to make it easier to identify the line that
120+
# should be deleted when the option is disabled.
121+
mkSudoTouchIdAuthScript = isEnabled:
122+
let
123+
file = "/etc/pam.d/sudo";
124+
option = "security.pam.enableSudoTouchIdAuth";
125+
in ''
126+
${if isEnabled then ''
127+
# Enable sudo Touch ID authentication, if not already enabled
128+
if ! grep 'pam_tid.so' ${file} > /dev/null; then
129+
sed -i "" '2i\
130+
auth sufficient pam_tid.so # nix-darwin: ${option}
131+
' ${file}
132+
fi
133+
'' else ''
134+
# Disable sudo Touch ID authentication, if added by nix-darwin
135+
if grep '${option}' ${file} > /dev/null; then
136+
sed -i "" '/${option}/d' ${file}
137+
fi
138+
''}
139+
'';
140+
in
141+
142+
{
143+
options = {
144+
security.pam.enableSudoTouchIdAuth = mkEnableOption ''
145+
Enable sudo authentication with Touch ID
146+
When enabled, this option adds the following line to /etc/pam.d/sudo:
147+
auth sufficient pam_tid.so
148+
(Note that macOS resets this file when doing a system update. As such, sudo
149+
authentication with Touch ID won't work after a system update until the nix-darwin
150+
configuration is reapplied.)
151+
'';
152+
};
153+
154+
config = {
155+
system.activationScripts.extraActivation.text = ''
156+
# PAM settings
157+
echo >&2 "setting up pam..."
158+
${mkSudoTouchIdAuthScript cfg.enableSudoTouchIdAuth}
159+
'';
160+
};
161+
};
162+
};
163+
};
164+
}

nixos/pollen/home.nix

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{ config, pkgs, lib, ... }:
2+
3+
{
4+
home.stateVersion = "22.05";
5+
6+
# https://github.com/malob/nixpkgs/blob/master/home/default.nix
7+
8+
# Direnv, load and unload environment variables depending on the current directory.
9+
# https://direnv.net
10+
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.direnv.enable
11+
# programs.direnv.enable = true;
12+
# programs.direnv.nix-direnv.enable = true;
13+
14+
# Htop
15+
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.htop.enable
16+
# programs.htop.enable = true;
17+
# programs.htop.settings.show_program_path = true;
18+
19+
# home.packages = with pkgs; [
20+
# # Some basics
21+
# coreutils
22+
# curl
23+
# wget
24+
25+
# # Dev stuff
26+
# # (agda.withPackages (p: [ p.standard-library ]))
27+
# google-cloud-sdk
28+
# haskellPackages.cabal-install
29+
# haskellPackages.hoogle
30+
# haskellPackages.hpack
31+
# haskellPackages.implicit-hie
32+
# haskellPackages.stack
33+
# idris2
34+
# jq
35+
# nodePackages.typescript
36+
# nodejs
37+
# purescript
38+
39+
# # Useful nix related tools
40+
# cachix # adding/managing alternative binary caches hosted by Cachix
41+
# # comma # run software from without installing it
42+
# niv # easy dependency management for nix projects
43+
# nodePackages.node2nix
44+
45+
# ] ++ lib.optionals stdenv.isDarwin [
46+
# cocoapods
47+
# m-cli # useful macOS CLI commands
48+
];
49+
50+
# Misc configuration files --------------------------------------------------------------------{{{
51+
52+
# https://docs.haskellstack.org/en/stable/yaml_configuration/#non-project-specific-config
53+
# home.file.".stack/config.yaml".text = lib.generators.toYAML {} {
54+
# templates = {
55+
# scm-init = "git";
56+
# params = {
57+
# author-name = "Your Name"; # config.programs.git.userName;
58+
# author-email = "[email protected]"; # config.programs.git.userEmail;
59+
# github-username = "yourusername";
60+
# };
61+
# };
62+
# nix.enable = true;
63+
# };
64+
65+
}

0 commit comments

Comments
 (0)