Author SHA1 Message Date
SamandGitHub c3e90c8964 [Backport release-26.05] users: realpath home dirs before comparison (#1824) 2026-07-10 21:38:14 -07:00
Ihar Hrachyshka 278b9076a6 users: realpath home dirs before comparison
When we create users with homedir under /var, they end up with
NFSHomeDirectory under /private/var because /var is a symlink. This
breaks consequent activations and requires that user overrides their
home dir attribute with /private/var/... to pass the activation
precheck.

`realpath` should normalize the discrepancy.

(cherry picked from commit 08278afff6)
2026-07-10 21:42:49 -04:00
SamandGitHub adda04f0bf [Backport 26.05] homebrew: address new CLI flag requirements (#1805)
Backport of #1789 (ee9c7b96c9)
2026-06-18 01:41:05 -07:00
Yifei SunandSam 3f7273d5a4 homebrew: set trusted flag in Brewfile directly
Suggested-by: Austin Horstman <khaneliman12@gmail.com>
Reviewed-by: Sam <30577766+Samasaur1@users.noreply.github.com>
2026-06-17 23:53:59 -07:00
Yifei SunandSam d48e4919f2 homebrew: address bundle command new CLI flag requirements 2026-06-17 23:53:59 -07:00
SamandGitHub f2b3fdb347 [Backport 26.05] github-runner: remove node20 runtime from defaults (#1797) 2026-06-11 08:01:01 -07:00
Yuriy Taraday 836494f62f github-runner: remove node20 runtime from defaults
It's marked as insecure starting with 26.05, and now github-runner package defaults to supporting only node24
See https://github.com/NixOS/nixpkgs/pull/524856
2026-06-11 14:17:05 +02:00
SamandGitHub 731951a251 version: branch off 26.05 (#1781) 2026-06-06 16:38:36 -07:00
Sam a41d518ea8 modules/terminfo: drop contour 2026-05-25 15:11:35 -07:00
Sam 69485bbd01 tests/github-runners: limit to supported node runtimes 2026-05-25 13:42:42 -07:00
Sam 5da0dfe3ed modules/terminfo: update list of packages with terminfo 2026-05-25 13:18:31 -07:00
Sam 8ba450cc36 version: branch off 26.05 2026-05-25 12:46:08 -07:00
SamandGitHub 56c666e108 nixpkgs.config: Add allowUnfreePackages option (#1742) 2026-05-17 16:55:09 +00:00
SamandGitHub 3fe4b4fb3c darwin-rebuild: support --log-format (#1675) 2026-05-17 15:23:44 +00:00
SamandGitHub 426b6e8f02 tmux: update key binding (#1681) 2026-05-17 15:23:31 +00:00
Bryan 905fe60936 add reverseSplitBindings option 2026-05-17 22:44:37 +08:00
BryanandBryan 4ec530e8b5 tmux: update key binding 2026-05-17 22:44:37 +08:00
Michael HoangandGitHub 1e107a7b92 Revert "tests/aerospace: adapt to new toml generator" (#1773) 2026-05-17 07:31:14 +00:00
SamandGitHub 09b3575c2d Revert "tests/aerospace: adapt to new toml generator" 2026-05-16 20:11:00 -07:00
SamandGitHub 8c62fba085 homebrew: add onActivation.extraEnv option (#1745) 2026-05-03 03:57:46 +00:00
Michael HoangandGitHub d0e2383e3f tests/aerospace: adapt to new toml generator (#1756) 2026-05-03 03:07:42 +00:00
Sam b1737791a9 tests/aerospace: adapt to new toml generator
See https://github.com/NixOS/nixpkgs/commit/e23ad3bd2739af8ac41d5338fb389029f551cde9
2026-04-27 21:34:25 -07:00
isabel 1e2d8fbb37 darwin-rebuild: support --log-format 2026-04-21 01:41:39 +01:00
mmenanno 3510d049d3 homebrew: replace envHints/analytics/updateReportNew with onActivation.extraEnv
Per review feedback on #1745: rather than adding one boolean option per
HOMEBREW_NO_* env var, expose a generic onActivation.extraEnv attrset that
is prepended to brewBundleCmd alongside HOMEBREW_NO_AUTO_UPDATE=1. This
covers the same use case and the long tail of other HOMEBREW_NO_* vars
without tying the module to Homebrew's naming choices.

The global-scope booleans are dropped with no replacement — users who want
these variables set globally can write them directly into
environment.variables, so a global.extraEnv would be pure sugar.
2026-04-14 12:31:00 -05:00
mmenanno 8f6396c0dc homebrew: add envHints, analytics, and updateReportNew options
Add options to control Homebrew environment variable hints, analytics
notices, and new formulae/casks reports during system activation and
manual brew commands.

These follow the existing autoUpdate pattern: boolean options that
default to true (preserving current behavior) and set the corresponding
HOMEBREW_NO_* environment variable when disabled.

onActivation options affect brew bundle during darwin-rebuild switch.
global options affect interactive brew commands via environment.variables.
2026-04-06 19:20:06 -04:00
Martin Häcker a0a51c56f0 nixpkgs.config: Add allowUnfreePackages option
Also make sure it merges correctly and verify with a test.

This was added in nixpkgs some time ago and is quite a nice addition as
it merges additively (in contrast to allowUnfreePredicate) thus allowing
to localize allowUnfreePackage specifications to all the locations in
your local config where unfree packages are added.
2026-04-01 21:03:30 +02:00
SamandGitHub 06648f4902 etc: support Lix 2.95.1 (#1731) 2026-04-01 09:53:30 +00:00
SamandGitHub ec2e2c72e7 prometheus-node-exporter: separate extra flags with a space (#1739) 2026-04-01 09:26:30 +00:00
SamandGitHub 5176e2f4b4 etc: support lix-installer 3.95.0 (#1730) 2026-04-01 06:12:18 +00:00
Ihar Hrachyshka df49e56fd6 prometheus-node-exporter: separate extra flags with a space 2026-03-31 22:07:04 -04:00
Martin Woo 2fec379474 Add Lix 2.95.1 nix.custom.conf. 2026-03-23 05:52:19 +01:00
Martin Woo c1d952849a etc: support Lix 2.95.1 2026-03-22 13:53:32 +01:00
Sam 2fa8900609 etc: support lix-installer 3.95.0 2026-03-21 11:23:28 -07:00
Michael HoangandGitHub da529ac9e4 services/openssh: manage host keys (#1701) 2026-03-08 20:03:47 +00:00
Michael HoangandGitHub 52d0615161 nix: add nix 2.33 to auto-optimise-store assertion (#1551) 2026-03-01 15:40:24 +00:00
Michael Hoang e6efc7c131 services/openssh: manage host keys 2026-02-27 15:42:59 +01:00
SamandGitHub 3bfa436c19 README: Update instructions for 25.11 (#1712) 2026-02-25 04:16:36 +00:00
Sean Gilligan 72a7e97c84 README: Update instructions for 25.11
Replace all references of `25.05` with `25.11`
2026-02-24 14:04:09 -08:00
SamandGitHub 6a7fdcd583 readme: Use bullet-list for documentation location (#1703) 2026-02-19 17:08:02 +00:00
Sean Gilligan ebe39ab3fa readme: Use bullet-list for documentation location
This will make it much easier to find the online documentation at
a quick glance, as well as making it easier to see the commands
for viewing locally.
2026-02-17 18:03:42 -08:00
SamandGitHub aff4c008ce etc: support experimental official Nix installer (#1702) 2026-02-17 23:45:16 +00:00
Michael Hoang 6d789c5a41 etc: support experimental official Nix installer 2026-02-17 23:53:32 +01:00
SamandGitHub 6c5a56295d modules/homebrew: comprehensive module refresh (#1692) 2026-02-12 19:01:55 +00:00
Malo Bourgon a43b4091db modules/homebrew: add CHANGELOG entry for module refresh 2026-02-12 10:24:39 -08:00
Malo Bourgon e0ffd55e7a modules/homebrew: fix typos and improve option descriptions 2026-02-12 10:24:39 -08:00
Malo Bourgon c68f5d1387 modules/homebrew: add onActivation.cleanup "check" mode
Closes #1032

Add `"check"` to the `onActivation.cleanup` enum. When set, nix-darwin runs
`brew bundle cleanup` during system checks to detect Homebrew packages that
are installed but not present in the generated Brewfile. If extra packages
are found, activation fails with a list of them and remediation steps.

Unlike `"uninstall"` and `"zap"`, the `"check"` mode never removes packages
-- it only reports. This runs during both `darwin-rebuild check` and
`darwin-rebuild switch`, matching the behavior of all other system checks.
2026-02-12 10:24:39 -08:00
Malo Bourgon ca6f8609c3 modules/homebrew: add shell integration options
Add `enableBashIntegration`, `enableFishIntegration`, and
`enableZshIntegration` options that evaluate `brew shellenv` to set up
Homebrew's environment and shell completions. This automates the
boilerplate that every nix-darwin Homebrew user currently writes manually.

All three shells use `interactiveShellInit`, consistent with direnv and
home-manager conventions. Fish additionally sets up completions paths in
the same hook.
2026-02-12 10:24:39 -08:00
Malo Bourgon 8c29e146dd modules/homebrew: replace brewPrefix with prefix
Closes #596

`homebrew.brewPrefix` defaulted to the bin directory (`/opt/homebrew/bin`),
not the actual Homebrew prefix (`/opt/homebrew`). This misled users into
writing `${config.homebrew.brewPrefix}/bin`, producing the broken path
`/opt/homebrew/bin/bin`.

Replace it with `homebrew.prefix`, which has correct semantics matching
`brew --prefix`. The old `brewPrefix` option is removed using
`mkRemovedOptionModule`, which catches both users who set the option and
users who read it in custom code. A warning also fires if the new `prefix`
value ends with `/bin`, catching users who copy the old value verbatim.
2026-02-10 09:26:54 -08:00
Malo Bourgon 24531016d8 modules/homebrew: deprecate homebrew.global.lockfiles
Homebrew Bundle removed lockfile support in Homebrew 4.4.0 (Oct 2024):
the `--no-lock` CLI flag, the `HOMEBREW_BUNDLE_NO_LOCK` env var, and
the `no_lock` parameter in `installer.rb` are all dead code. Setting
`homebrew.global.lockfiles` has had no effect on current Homebrew
versions.

- Replace the `lockfiles` option with a hidden stub (matching `noLock`)
- Replace the `noLock` hard assertion with a shared deprecation warning
  for both options
- Stop setting `HOMEBREW_BUNDLE_NO_LOCK` in `environment.variables`
- Remove the lockfiles paragraph from the `brewfile` option description
2026-02-10 09:26:54 -08:00
Malo Bourgon 65cfcebaa2 modules/homebrew: remove homebrew.whalebrews option
Whalebrew support was fully removed from Homebrew Bundle in
Homebrew 4.7.0 (Nov 2025). A `whalebrew` entry in a Brewfile now
raises `RuntimeError: Invalid Brewfile: undefined method 'whalebrew'`,
breaking the entire `brew bundle` invocation.

Use `mkRemovedOptionModule` so that existing configs get a clear
warning instead of an undefined-option error. Also removes the
auto-addition of `"whalebrew"` to `homebrew.brews` and the Brewfile
generation for Docker containers.
2026-02-10 09:26:54 -08:00
Malo Bourgon 3479b795aa modules/homebrew: add homebrew.cargoPackages option
Add support for `cargo "pkg"` entries in the generated Brewfile. Homebrew
Bundle supports installing Rust crates via `cargo install`; the `rust`
formula is automatically installed if not already present.
2026-02-10 09:24:45 -08:00
Malo Bourgon cbe4a600d4 modules/homebrew: add homebrew.goPackages option
Add support for `go "pkg"` entries in the generated Brewfile. Homebrew
Bundle supports installing Go packages via `go install`; the `go`
formula is automatically installed if not already present.
2026-02-10 09:24:17 -08:00
Malo Bourgon c65c24c87c modules/homebrew: add postinstall option for brews and casks
Both `brew bundle` formula and cask installers support a `postinstall`
option -- a shell command to run after the package is installed or
upgraded. The command only executes when the package actually changed,
not on every `brew bundle` run.

Examples from the Homebrew docs added to the `homebrew.brews` and
`homebrew.casks` option examples and tests.
2026-02-10 09:22:16 -08:00
Malo Bourgon a3fd89f1bb modules/homebrew: add link: :overwrite support
Homebrew supports `link: :overwrite` which runs `brew link --overwrite`,
force-overwriting existing symlinks. Extract the existing
`restart_service` special-case logic into a reusable helper
(`mkBrewfileLineBoolOrSymbolString`) for options that can be either a
bool or a Ruby symbol in the Brewfile.
2026-02-10 09:22:15 -08:00
Malo Bourgon 36815b4852 modules/homebrew: add restart_service "always" support
Homebrew supports restart_service: :always which restarts the service
on every brew bundle run, even if the formula wasn't changed.
2026-02-10 09:22:15 -08:00
Michael HoangandGitHub 7c952d9a52 Add support for installing vscode extensions via brew (#1222) 2026-02-10 15:13:34 +00:00
Frank Chiarulli Jr. fdbfb1dc1b add support for installing vscode extensions via brew 2026-02-09 21:59:25 -05:00
SamandGitHub 0d7874ef7e modules/homebrew: remove duplicates from brewfile (#1689) 2026-02-04 05:49:06 +00:00
Josh GibbsandGitHub 53dd29f381 remove duplicates from brewfile 2026-02-03 21:22:21 -08:00
zowoq 131e68e07e nix: add nix 2.33 to auto-optimise-store assertion 2026-01-23 19:28:06 +10:00
SamandGitHub 0fc4e7ac67 networking: add dhcpClientId option to set DHCP Client ID (#1562) 2026-01-18 19:31:43 +00:00
Ihar Hrachyshka 05a5979906 networking: add dhcpClientId option to set DHCP Client ID 2026-01-18 14:10:56 -05:00
Michael HoangandGitHub 8b720b9662 programs/direnv: add enable[shell]Integration options (#1680) 2026-01-16 11:11:07 +00:00
Radek Pietruszewski 6d323f4ffd programs/direnv: add enable*Integration options
Ability to disable shell hook is needed to use alternative shell hooks - e.g. direnv-instant. These options mirror NixOS's exactly.
2026-01-16 10:14:43 +01:00
Michael HoangandGitHub 7b1d394e7d feat(screencapture): add save-selections (#1677) 2026-01-12 12:21:49 +00:00
vaaski 48124872b6 fix(screencapture): move test location 2026-01-10 23:37:15 +01:00
Michael HoangandGitHub 9f48ffaca1 Add flake-parts module (#1670) 2026-01-06 16:55:03 +00:00
Manuel Mendez 3ab1648f50 Add flake-parts module 2026-01-06 10:20:38 -05:00
vaaski e5e7b6e878 feat(screencapture): add save-selections 2026-01-06 15:41:11 +01:00
SamandGitHub c31afa6e76 fix(modules): fixed typos in various modules (#1672) 2025-12-29 17:10:40 +00:00
Nikita Lenyk 8cecf9c5c5 fix(modules): fixed typos in various modules 2025-12-29 18:31:13 +02:00
Michael HoangandGitHub f0c8e1f6fe feat(gnupg): add configurable package option and install it (#1667) 2025-12-26 21:26:36 +00:00
Angel J d70b24c2a8 test(gnupg): add tests for gnupg agent configuration
Signed-off-by: Angel J <78835633+Iamanaws@users.noreply.github.com>
2025-12-26 07:44:43 -08:00
angel 0b53d57d3a feat(gnupg): add configurable package option and install it
Signed-off-by: Angel J <78835633+Iamanaws@users.noreply.github.com>
2025-12-26 07:42:37 -08:00
SamandGitHub c2b36207f2 readme: recommend only the Lix installer (#1659) 2025-12-23 21:20:13 +00:00
Sam eb05ef6d65 readme: recommend only the Lix installer 2025-12-23 15:57:16 -05:00
Michael HoangandGitHub adc6bed3ad modules/examples/lnl: drop qes (#1666) 2025-12-23 20:15:52 +00:00
Sam c496b15409 modules/examples/lnl: drop qes
See:
- https://github.com/NixOS/nixpkgs/issues/371202
- https://github.com/NixOS/nixpkgs/pull/473109
- https://github.com/astratagem/dotfield/issues/1
- https://github.com/asmvik/skhd/issues/44

Looks like it was merged into skhd pre-2020 and was only in nixpkgs in a
cached state. Based on that last link the cached version may not even
work on newer versions of macOS?

Regardless, this is causing tests to fail.
2025-12-23 14:09:41 -05:00
Michael HoangandGitHub 5fb45ece61 Update nixpkgs (#1658) 2025-12-18 06:13:12 +00:00
Hleb Shauchenka bfe00257dc Update nixpkgs 2025-12-17 15:48:28 +01:00
Michael HoangandGitHub 9b628e171b github-runner: fix authentication with actions/checkout@v6 (#1655) 2025-12-14 03:47:29 +00:00
Louis Opter a58dd30d2b github-runner: canonicalizes workDir to fix actions/checkout@v6
We ran into this issue wherein GitHub's `actions/checkout` would fail
because `git-config` would fail to include additional configuration.

The symptom was:

```
Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
```

And is caused by `git config --local includeIf.gitdir:/var/lib/github-runners/_work/…`.

Wherein `git` apparently resolves (canonicalizes) the current repository
path which then does not match the argument for `includeIf.gitdir` which
then means the configuration that `actions/checkout` is trying to apply
does not get pulled in, which then prevents git from authenticating with
GitHub and fails the build.

Ngl, gemini 3 found that out for me.

We could prefix `/private` everywhere, but changing the user's home
directory is going to [be tricky], not sure what do to about that.

[be tricky]: https://github.com/nix-darwin/nix-darwin/blob/7e22bf538aa3e0937effcb1cee73d5f1bcc26f79/modules/users/default.nix#L208
2025-12-12 20:52:37 +00:00
Louis Opter 8393ede275 github-runner: fix warnings from nixd" 2025-12-12 20:52:33 +00:00
SamandGitHub 7e22bf538a version: bump to 26.05 (#1649) 2025-12-06 23:50:51 +00:00
Sam 000ec99b5a version: bump to 26.05 2025-11-30 21:11:37 -07:00
Michael HoangandGitHub e95de00a47 fold -> foldr (#1646) 2025-11-26 12:44:44 +00:00
zowoq 36fed93cf5 fold -> foldr
deprecated in https://github.com/NixOS/nixpkgs/commit/f4d36941eba6c290a1f839b77f85d9579f087c22
2025-11-26 19:41:19 +10:00
SamandGitHub 3bda9f6b14 zsh: allow configuring history (#1635) 2025-11-18 22:37:57 +00:00
Michael HoangandGitHub c00da4e0a4 readme: update determinate installer instructions (#1642) 2025-11-18 19:02:47 +00:00
Sam e9bf5c5232 readme: update determinate installer instructions
The `--prefer-upstream-nix` flag is only guaranteed to be supported
until January 1st, but what's described now doesn't work at all, so this
is still an improvement.
2025-11-18 08:43:48 -07:00
Michael HoangandGitHub 973db96394 applications: change pathsToLink to a list (#1636) 2025-11-14 16:13:24 +00:00
zowoq 31e3a75444 applications: change pathsToLink to a list
https://github.com/NixOS/nixpkgs/commit/fbe214434a678004f8631a8f893d5c089e534db9
2025-11-14 09:54:32 +10:00
Bryan Lai 454d8d95c6 zsh: allow configuring history 2025-11-13 14:54:56 +08:00
Bryan Lai 7d5e904fb2 chore: ignore .DS_Store 2025-11-13 14:39:29 +08:00
SamandGitHub 5125a3cd41 fix: zsh-fast-syntax-highlighting path (#1624) 2025-11-08 18:51:26 +00:00
Michael HoangandGitHub e2b82ebd0f Add system.defaults.finder._FXEnableColumnAutoSizing (#1626) 2025-11-07 07:42:06 +00:00
Yiyu Zhou 7451154694 Add system.defaults.finder._FXEnableColumnAutoSizing 2025-11-06 14:29:09 -08:00
XYenon 54802bec7c fix: zsh-fast-syntax-highlighting path
https://github.com/NixOS/nixpkgs/pull/101007
2025-11-05 15:41:07 +08:00
Michael HoangandGitHub b8c7ac0302 Adapt to a Vim package rename/replacement in Nixpkgs (#1623) 2025-11-05 01:01:20 +00:00
Josh Tilles 89abe5ba46 Adapt to a vim pkg rename/replacement in Nixpkgs
Addresses an error like the following:
```sh-session
$ sudo darwin-rebuild --verbose --print-build-logs switch
building the system configuration...
fetching git input 'git+file:///private/etc/nix-darwin'
error:
       … while evaluating an expression to select 'drvPath' on it
         at «internal»:1:552:
       … while evaluating strict
         at «internal»:1:552:
       (stack trace truncated; use '--show-trace' to show the full trace)

       error: 'vim_configurable' has been renamed to/replaced by 'vim-full'
```

See <https://github.com/NixOS/nixpkgs/commit/853d9f31ea6206e86b72db1ba221a12cb503510f>

Fixes nix-darwin/nix-darwin#1622
2025-11-04 17:31:53 -05:00
Michael HoangandGitHub 69921864a7 dnsmasq: make the daemon wait for the nix store to be mounted (#1620) 2025-11-03 16:12:48 +00:00
Wigger Boelens 682de76b1e dnsmasq: make the daemon wait for the nix store to be mounted
This resolves the issue of the daemon not starting because the nix store is not yet mounted

Signed-off-by: Wigger Boelens <me@wigger.email>
2025-11-03 15:54:39 +01:00
SamandGitHub c3c8c9f2a5 feat(trackpad): add additional trackpad and gesture support (#1591) 2025-11-01 23:27:41 +00:00
SamandGitHub fc4e3dbe40 feat: make persistent-others similar to the new persistent-apps (#1431) 2025-11-01 18:33:40 +00:00
Michael HoangandGitHub 7cd9aac79e networking: modify firewall settings only if explicitly set (#1614) 2025-10-24 21:06:27 +00:00
Ryan Cao a4ecab1763 networking: modify firewall settings only if explicitly set 2025-10-24 14:23:07 +01:00
Michael HoangandGitHub c3211fcd0c dnsmasq: add servers option for upstream DNS configuration (#1611) 2025-10-17 17:14:42 +00:00
Wigger Boelens 1204e79a1e dnsmasq: add servers option for upstream DNS configuration
Adds a new `services.dnsmasq.servers` option to configure upstream DNS servers. This allows users to specify which DNS servers dnsmasq should forward queries to, supporting domain-specific routing and custom ports.
When empty (default), dnsmasq uses servers from /etc/resolv.conf.

Signed-off-by: Wigger Boelens <me@wigger.email>
2025-10-17 13:05:13 +02:00
Michael HoangandGitHub 9a9ab01072 #1608: aerospace: add option for colemak key-mapping (#1609) 2025-10-13 06:56:23 +00:00
Nelson TamandGitHub a9f953b682 aerospace: add option for colemak key-mapping 2025-10-13 17:02:03 +11:00
Michael HoangandGitHub c48e963a55 telegraf: set HOME to avoid crash at startup (#1598) 2025-09-25 13:02:32 +00:00
Jörg Thalheim 49eedd3d2a telegraf: set HOME to avoid crash at startup
https://github.com/nix-community/infra/pull/1982
2025-09-25 09:14:03 +02:00
Michael HoangandGitHub 25381509d5 Correct enum values for system.defaults.NSGlobalDomain.AppleIconAppearanceTheme (#1596) 2025-09-21 09:44:43 +00:00
Quintus CardozoandGitHub 5206a9fd30 Correct enum values for system.defaults.NSGlobalDomain.AppleIconAppearanceTheme 2025-09-21 13:59:38 +10:00
Michael HoangandGitHub 7be9c1b136 Add system.defaults.NSGlobalDomain.AppleIconAppearanceTheme (#1593) 2025-09-20 16:52:53 +00:00
Quintus Cardozo 5eb53f6003 Add test for system.defaults.NSGlobalDomain.AppleIconAppearanceTheme 2025-09-21 02:12:35 +10:00
Quintus CardozoandGitHub 3c7396a09c Add system.defaults.NSGlobalDomain.AppleIconAppearanceTheme 2025-09-19 13:58:48 +10:00
Dusty Pomerleau d55543d033 feat(trackpad): add additional trackpad and gesture support:
To `system.defaults.trackpad`, add:

```
ActuateDetents
DragLock
ForceSuppressed
TrackpadCornerSecondaryClick
TrackpadFourFingerHorizSwipeGesture
TrackpadFourFingerPinchGesture
TrackpadFourFingerVertSwipeGesture
TrackpadMomentumScroll
TrackpadPinch
TrackpadRotate
TrackpadThreeFingerHorizSwipeGesture
TrackpadThreeFingerTapGesture
TrackpadThreeFingerVertSwipeGesture
TrackpadTwoFingerDoubleTapGesture
TrackpadTwoFingerFromRightEdgeSwipeGesture
```

To `system.defaults.dock` add:

```
showAppExposeGestureEnabled
showDesktopGestureEnabled
showLaunchpadGestureEnabled
showMissionControlGestureEnabled
```
2025-09-18 11:36:57 +10:00
SamandGitHub ebd0bfc11f defaults: add NSGlobalDomain.NSStatusItem{Spacing,SelectionPadding} (#1310) 2025-09-17 09:55:40 +00:00
ac7999d72d Add NSStatusItemSpacing and NSStatusItemSelectionPadding
Add `NSStatusItemSpacing` and `NSStatusItemSelectionPadding` to `NSGlobalDomain`
options.

These options control the spacing between and padding inside status icons in the
menu bar. With these options, it's possible to squeeze more items on the menu
bar, something that's especially useful on machines with a notch.

This is a copy of #872, which was closed without being merged.

Co-Authored-By: Rob Harrop <rob@robharrop.dev>
2025-09-17 09:51:34 +02:00
Michael HoangandGitHub 830b3f0b50 Fix typo in Nix module (#1585) 2025-09-09 15:02:04 +00:00
Luc Perkins 55106a887e Fix typo in Nix module 2025-09-09 16:38:50 +02:00
Michael HoangandGitHub 15f067638e github-runner: fix the nodeRuntimes option (#1582) 2025-09-06 03:54:02 +00:00
Michael HoangandGitHub d7c9b35913 github-runner: add support for node24 (#1573) 2025-09-06 03:51:15 +00:00
SamandGitHub eaacfa1101 apply should return null if the argument is not a list (#1581) 2025-09-04 19:58:58 +00:00
Nathan Henrie 349b2c66a9 apply should return null if the argument is not a list
Fixes https://github.com/nix-darwin/nix-darwin/issues/1578
2025-09-04 13:34:55 -06:00
Sander 165ff3069d tests: remove placeholder package override in github-runner test 2025-08-29 13:34:15 +02:00
Sander f910ac37b6 github-runner: fix the nodeRuntimes option
The conditional override was intended to be backwards-compatible with older runner packages without the `nodeRuntimes` argument.
However, `override` doesn't yield default arguments, so the override was never applied.

This commit removes the conditional entirely since `nodeRuntimes` was added back in 24.05.
2025-08-28 12:51:30 +02:00
SamandGitHub 8df64f8196 Application 'linking' done right (#1396) 2025-08-22 01:17:29 +00:00
SamandGitHub 3a0a38a1e7 launchd+defaults: Escape XML generated by toPlist (#1529) 2025-08-21 04:49:33 +00:00
Sander 7d6644bdb6 github-runner: add support for node24 2025-08-18 16:45:51 +02:00
SamandGitHub 7220b01d67 programs/fish: add shellAbbrs config (#1563) 2025-08-15 16:23:30 +00:00
SamandGitHub f5ad8e3e76 ci: bump macOS version (13 -> 14) (#1569) 2025-08-15 15:57:17 +00:00
Sam 585cd058e8 ci: bump macOS version (13 -> 14)
The runners from macOS 14 on default to aarch64, so this will also
transition us away from x86_64
2025-08-14 20:53:51 -07:00
ElliotandSam 6f24595362 fish: add shellAbbrs config
Co-authored-by: Sam <30577766+Samasaur1@users.noreply.github.com>
2025-08-14 14:56:43 +08:00
Linnnus f0b44d6854 Add eval warning 2025-08-09 17:39:49 +02:00
Linnnus 23acc59c99 Update tests
Tests that search for specific commands in the generated activation
script obviously need updating.
2025-07-01 21:05:30 +02:00
Linnnus 66911b7d16 Remove manual escaping 2025-07-01 21:04:57 +02:00
Linnnus 423929a533 Escape XML generated by toPlist 2025-07-01 18:50:11 +02:00
SamandGitHub e04a388232 readme: bump nixpkgs stable version; update flake guide (#1521) 2025-06-30 20:05:18 +00:00
iLillie a79b28f2fa readme: update flake guide 2025-06-30 17:12:57 +02:00
iLillie b866fbb28b readme: bump nix stable version 2025-06-30 17:12:14 +02:00
SamandGitHub 425c929e20 github-runner/service.nix: fix missing argument in workDir assertion (#1526) 2025-06-30 07:55:51 +00:00
ed9w2in6 8828770125 fix: add test cases and expected output 2025-06-30 05:57:03 +08:00
ed9w2in6 44c5d10416 fix: prevent example of persistent-others from evaluating 2025-06-30 05:40:34 +08:00
ed9w2in6 5875113d74 feat: make persistent-others similar to the new persistent-apps
This is backward compatible via convertion function provided for
coercedTo.

Fixes: #968, #982, #1398
2025-06-30 05:40:34 +08:00
Tom McLaughlin 7f9694a4be github-runner/service.nix: fix missing argument in workDir assertion 2025-06-29 13:43:52 -07:00
SamandGitHub 1dd19f19e4 nix.nixPath: Do not use environment.darwinConfig if set to null (#1469) 2025-06-22 18:56:08 +00:00
EmilyandGitHub bffbd4a6c4 networking.applicationFirewall: init (#1520) 2025-06-22 18:43:41 +00:00
Sizhe Zhao f2457a22c8 systems.defaults.alf: deprecate 2025-06-23 00:46:57 +08:00
Sizhe Zhao caa59bf50a networking.applicationFirewall: init 2025-06-23 00:46:57 +08:00
SamandGitHub 04a3412801 homebrew: allow setting greedy for all casks by default (#1382) 2025-06-22 06:00:51 +00:00
Michael HoangandGitHub ff139e8183 Remove deprecated homebrew tap example (homebrew/cask-fonts) (#1515) 2025-06-22 02:18:14 +00:00
Michael Hoang be2d7d6535 applications: ensure sufficient permissions before updating apps 2025-06-21 14:54:32 +07:00
‮rekcäH nitraM‮andMichael Hoang 1f9cca7781 Copy applications instead of linking them to make macOS happy
All existing attempts fell short.
So we fall back to plain old copying applications over.

Problems with alternatives:

- Symlinking: Spotlight doesn't index symlinks. Therefore one cannot use
Spotlight to find or open the apps. Also they don't show up in
LaunchPad.

- Trampolines: Apples Security & Privacy doesn't get the concept and
shows them with the wrong name. Having an app open during an update will
also make it show up twice in the Dock.

- Aliasses: Require either AppleScript (a permission we don't want to
have, as it easily bypasses Apples TCC) or extra tools (that would be
ok), but also Aliasses are not categorized as 'Application' by
SpotLight.

- Directory Hardlinks are not supported by APFS - but also wouldn't work
cross volume.

- clonefile also doesn't work cross-volume.

Which all leads us back to Don Copine and Pastone. *sigh*
2025-06-21 14:54:32 +07:00
‮rekcäH nitraM‮andMichael Hoang 21d733a51f applications: reformat 2025-06-21 14:54:24 +07:00
Michael HoangandGitHub 0d71cbf88d programs/ssh: backport knownHosts changes (#1517) 2025-06-19 09:27:36 +00:00
Michael Hoang 82566dd254 programs/ssh: remove with lib; 2025-06-19 16:08:37 +07:00
Michael Hoangandpennae a991859d1f nixos/ssh: undeprecate knownHosts.«name».hostNames
Backport https://github.com/NixOS/nixpkgs/commit/e9f17a9f45e8466b34be1fededb70713b13d901c

Co-authored-by: pennae <github@quasiparticle.net>
2025-06-19 16:08:09 +07:00
Michael HoangandTaeer Bar-Yam 9d5b27bc93 modules/programs/ssh: knownHosts -> extraKnownHosts
Backport https://github.com/NixOS/nixpkgs/commit/8fa2e787f1400fd636983c9865ce0ef6cd3d193d

Co-authored-by: Taeer Bar-Yam <taeer@bar-yam.me>
2025-06-19 16:07:11 +07:00
Michael HoangandFlorian Klink 2d257c09a1 programs.ssh.knownHosts: update example to be an attrset
Backport https://github.com/NixOS/nixpkgs/commit/4f11c06fac92bc19b764a9248df416f20ff5ad03

Co-authored-by: Florian Klink <flokli@flokli.de>
2025-06-19 16:05:09 +07:00
Michael Hoang 04b04f4b9d programs/ssh: move to match path in NixOS 2025-06-19 10:45:32 +07:00
Garrett Hopper f67a4856c3 Update homebrew module documentation and examples
- Replace deprecated homebrew/cask-fonts with apple/apple tap example
- Update documentation links from archived homebrew-bundle to brew.sh/Brew-Bundle-and-Brewfile
- Update source file references to new location in main brew repository
2025-06-17 05:52:35 -05:00
SamandGitHub 2f140d6ac8 Preserve PATH variable when using sudo for Homebrew (#1503) 2025-06-14 04:00:26 +00:00
Brian Romanko 0721726e21 Wrap the call with env 2025-06-13 16:49:58 -07:00
Brian Romanko 300af6fcc5 Preserve PATH variable when using sudo
Some systems set `secure_path` in sudoers. When this is set
the `PATH` variable is not set in the sudo environment. Using
`--preserve-env=PATH` ensures that the PATH env var is set properly
in those systems.

This is similar to the issue with [darwin-rebuild](https://github.com/nix-darwin/nix-darwin/issues/798)
not working with sudo on these systems.
2025-06-13 16:49:57 -07:00
EmilyandGitHub 72c88d5928 Avoid confusing users with future deprecations (#1499) 2025-06-12 14:47:19 +00:00
SamandGitHub e2da3338ab etc: add known hashes for zprofile and zshrc in macOS 26 beta 1 (#1510) 2025-06-12 06:51:43 +00:00
Sam 63c31af37a etc: add known hashes for zprofile and zshrc in macOS 26 beta 1
This also includes versions of /etc/zshrc with both the official and
DeterminateSystems installers.
2025-06-11 01:43:35 -07:00
SamandGitHub 19346808c4 programs/direnv: fix silent option (#1491) 2025-06-06 07:19:53 +00:00
Duc Nghiem-Xuan daf8e22831 programs/direnv: add finalPackage readonly option 2025-06-06 15:49:37 +09:00
SamandGitHub 9753a8706b feat: add option programs.zsh.enableAutosuggestions (#1433) 2025-06-06 06:02:11 +00:00
Duc Nghiem-Xuan fb27326bbc programs/direnv: fix silent option 2025-06-05 17:49:17 +09:00
SamandGitHub fa6120c32f defaults: support AppleKeyboardUIMode = 2 for newer macOS versions (#1501) 2025-06-04 04:52:25 +00:00
Michael Hoang f6b29e4af8 defaults: support AppleKeyboardUIMode = 2 for newer macOS versions 2025-06-04 11:02:16 +10:00
Michael HoangandGitHub d46a07214f Fix ShellCheck escaped character issue in nixPath check (#1500) 2025-06-04 00:56:23 +00:00
Ethan Turkeltaub b07a4c8be5 Fix ShellCheck issue in nixPath check 2025-06-03 16:19:03 -04:00
Adam C. Stephens 7c284a6504 Avoid confusing users with future deprecations 2025-06-02 09:55:31 -04:00
EmilyandGitHub 44a7d0e687 darwin-rebuild: use NIX_REMOTE=daemon even as root (#1458) 2025-05-27 13:33:47 +00:00
Michael HoangandGitHub a9939228f6 config/system-path: restructure to mirror NixOS (#1481) 2025-05-25 05:00:28 +00:00
Michael HoangandGitHub 9f609d1d9f ci: enable merge queue (#1482) 2025-05-25 04:31:32 +00:00
Michael Hoang 0d3dcc55f3 ci: enable merge queue 2025-05-25 14:14:52 +10:00
Michael Hoang cd6a8a796d config/system-path: restructure to mirror NixOS
https://github.com/NixOS/nixpkgs/blob/2795c506fe8fb7b03c36ccb51f75b6df0ab2553f/nixos/modules/config/system-path.nix
2025-05-25 14:06:56 +10:00
Michael HoangandGitHub e0a7c37735 config/terminfo: init module (#1479) 2025-05-25 09:50:52 +10:00
Michael Hoang 5374405a01 config/terminfo: init module 2025-05-25 09:24:12 +10:00
Michael HoangandGitHub acd6aa5a90 programs/arqbackup: init module (#1474) 2025-05-24 15:40:10 +10:00
Michael Hoang 7347f72507 programs/arqbackup: init module 2025-05-24 15:16:24 +10:00
Robert Hensing 30845beee0 nix.nixPath: Do not use environment.darwinConfig if set to null
I've personally set it to `null` to make my `system.primaryUser = null;`
configuration work on a machine with `stateVersion = 4;`.

It may apply in other use cases as well.
2025-05-23 16:51:36 +02:00
EmilyandGitHub 33220d4791 system.build: Treat as variables, make lazy, fix error message (#1468) 2025-05-23 13:44:11 +01:00
Robert Hensing acf6b46011 system.build: Treat as variables, make lazy
This fixes an unnecessary evaluation dependency that prevented the
custom and much appreciated primaryUser error from popping up.

Specifically:

       … while evaluating the option `system.build':

       … while evaluating definitions from `/nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/environment':

       … while evaluating definitions from `/nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/nix':

       … while evaluating the option `environment.darwinConfig':

       … while evaluating the option `system.primaryUserHome':

       error: expected a string but found null: null
       at /nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/system/primary-user.nix:26:30:
           25|       default =
           26|         config.users.users.${config.system.primaryUser}.home or "/Users/${config.system.primaryUser}";
             |                              ^
           27|     };

While it did have some indication as to the cause, it lets the good
error message go to waste.

**Context**

`lazyAttrsOf` is the better choice when you use an attrset as individual
variables instead of in aggregate (e.g. `attrNames`, `toJSON`).

The reason is that an expression like `a.b` is strict in `a`, which
entails the evaluating the _whole_ set of attribute _names_ in `a`.
In the `attrsOf` this means evaluating all `mkIf` conditions, which
in turn also means evaluating all the regular definitions to the
smallest degree (WHNF) to determine that they're not `mkIf`s.

`lazyAttrsOf` simply assumes that all attributes aren't `mkIf false`,
and throws an error in the attribute value if necessary.
This would be a problem with `toJSON` and such, but is completely
fine when the attributes are treated as variables of a lazy program,
as is the case here.

**NixOS**

NixOS made `system.build` a submodule with a `freeformType`, allowing
the things inside of it to be declared, and for them to have niceties
like documentation and merging behavior.
nix-darwin could probably adopt this.
2025-05-23 12:00:51 +02:00
Michael HoangandGitHub 93562b65cf feat(services.openssh): add extraConfig option (#1465) 2025-05-23 01:41:14 +00:00
squat 0e3b855456 add test
Signed-off-by: squat <lserven@gmail.com>
2025-05-23 02:58:23 +02:00
squat e09c1aefe4 feat(services.openssh): add extraConfig option
Same interface as in NixOS: https://search.nixos.org/options?channel=unstable&show=services.openssh.extraConfig&from=0&size=50&sort=relevance&type=packages&query=services.openssh.extraConfig
This is useful to customize the behavior of the SSH daemon, e.g. to add
options like `StreamLocalBindUnlink yes` to improve gpg-agent
forwarding.

Signed-off-by: squat <lserven@gmail.com>
2025-05-22 20:22:47 +02:00
Michael HoangandGitHub e2676937fa flake.lock: update (#1463) 2025-05-21 09:36:44 +00:00
Emily 0b5fee1285 flake.lock: update
Should fix the website build.
2025-05-21 10:05:49 +01:00
EmilyandGitHub 9ed53ae9ab version: bump to 25.11 (#1449) 2025-05-20 15:45:13 +01:00
Emily d23a9c26f3 darwin-rebuild: use NIX_REMOTE=daemon even as root 2025-05-19 18:26:49 +01:00
Michael HoangandGitHub b9b927dd1f Update repo links (#1450) 2025-05-18 08:45:43 +10:00
Siddhartha SahuandGitHub 24952f03f9 Update default.nix 2025-05-17 12:15:49 -04:00
Siddhartha SahuandGitHub 58f268e065 Update CHANGELOG 2025-05-17 12:15:18 -04:00
Siddhartha SahuandGitHub a4cc54778d Update repo link 2025-05-17 12:14:14 -04:00
Emily 0c0f423db8 version: bump to 25.11 2025-05-17 16:06:23 +01:00
EmilyandGitHub 8e251e4534 The Plan, phase 1 (#1341) 2025-05-17 16:02:22 +01:00
Emily b9e580c113 changelog: document user activation removal 2025-05-16 16:34:31 +01:00
Emily a0e4dd2af9 activation-scripts: move createRun after checks
The checks should no longer depend on `/run`, so this avoids modifying
the system before they run.
2025-05-16 16:34:31 +01:00
Emily 7e5c6f7e21 etc: merge etcChecks into checks
The `activate-system` daemon will now run all the checks, which seems
like probably a good idea anyway?
2025-05-16 16:34:31 +01:00
Emily af62c4d176 checks: make nixPath check more helpful 2025-05-16 16:34:31 +01:00
Emily 051283a895 {activation-scripts,activate-system}: purify environment again 2025-05-16 16:34:31 +01:00
Emily 516dbe1fa4 darwin-rebuild: require running as root 2025-05-16 16:34:31 +01:00
Emily 40d2a159cc tests: remove stray activate-user references 2025-05-16 16:34:31 +01:00
Emily 2ca294741f activation-scripts: get rid of user activation
🎉

Closes: #96
2025-05-16 16:34:31 +01:00
Emily 0abf012666 users: refuse to delete the primary user 2025-05-16 16:31:17 +01:00
Emily bed70a84af {environment,nix}: remove references to $HOME
These can’t be relied upon in a post‐user‐activation
world. Technically a breaking change, if anyone has their home
directory outside of `/Users` or is using `root` for this, but, well,
I did my best and these are legacy defaults anyway.
2025-05-16 16:31:17 +01:00
Emily 2892da83ea applications: use system.primaryUser for the legacy path
System activation scripts shouldn’t (and soon won’t be able to)
rely on `$HOME` being the primary user’s.
2025-05-16 16:31:17 +01:00
Emily f47b8062cb defaults: move userDefaults to system activation 2025-05-16 16:31:17 +01:00
Emily 7877cba5f5 launchd: move userLaunchd to system activation
I’m not *completely* certain that this handles user agents
correctly. There is a deprecated command, `launchctl asuser`, that
executes a command in the Mach bootstrap context of another user`.
<https://scriptingosx.com/2020/08/running-a-command-as-another-user/>
claims that this is required when loading and unloading user agents,
but I haven’t tested this. Our current launchd agent logic is pretty
weird and broken already anyway, so unless this actively regresses
things I’d lean towards keeping it like this until we can move
over entirely to `launchctl bootstrap`/`launchctl kickstart`, which
aren’t deprecated and can address individual users directly. Someone
should definitely test it more extensively than I have, though.
2025-05-16 16:29:17 +01:00
Emily c449918bfb homebrew: move to system activation
This adds an optional explicit `homebrew.user` option that allows users
to avoid setting `system.primaryUser`, partly as a proof of concept
of what the interfaces should look like in the future. Homebrew only
officially support one global installation, so a singleton matches
upstream’s expectations; in practice, it may be useful for us to
nest this into `users.users.*.homebrew` instead, at the expense of
being an unsupported setup if used to its full potential. Since
that would be a breaking change to the inteface anyway, I think
adding `homebrew.user` for now is acceptable. (I think one native
Apple Silicon and one Rosetta 2 Homebrew installation – under
`/opt/homebrew` and `/usr/local` respectively – may be exceptions
to this lack of upstream support, but that would be complicated to
support even with `users.users.*.homebrew`.)

I’m not entirely sure where in system activation this should
go. Probably after the user defaults and launch agents stuff, to match
the existing logic in user activation, and I lean towards doing it
as late as possible; too early and we might not have the users and
groups required to bootstrap a Homebrew installation set up, but
as Homebrew installations could be fiddly and fail, doing it in the
middle could leave a partially‐activated system.

Probably it should be done in a launch agent or something instead, but
this is my best guess as to the appropriate place for now. The downside
is that activation scripts generally won’t be able to assume that the
Homebrew prefix is populated according to the current configuration,
but they probably shouldn’t be depending on that anyway?
2025-05-16 16:29:17 +01:00
Emily 52ee8c57c2 primary-user: init 2025-05-16 16:29:17 +01:00
Michael HoangandGitHub 8817b00b00 defaults: add com.apple.iCal for managing Calendar.app (#1446) 2025-05-16 13:12:40 +10:00
Michael Hoang 14737a9676 defaults: add com.apple.iCal for managing Calendar.app 2025-05-16 12:52:49 +10:00
Michael HoangandGitHub b6fff20c69 defaults: update docs for AppleInterfaceStyle (#1445) 2025-05-15 18:28:21 +10:00
Michael Hoang d693997a32 defaults: update docs for AppleInterfaceStyle
Eventually we should implement a special type that allows deleting
values.
2025-05-15 18:02:47 +10:00
Michael HoangandGitHub f0fbf2dbe7 _1password{,-gui}: fix package not being used (#1444) 2025-05-15 17:29:56 +10:00
Michael Hoang f2753a4ca6 _1password{,-gui}: fix package not being used 2025-05-15 17:01:26 +10:00
Michael HoangandGitHub f88be00227 Merge pull request #1442 from lheckemann/gitlab-runner-fix
gitlab-runner: write config as toml, don't clobber existing file
2025-05-13 22:20:02 +10:00
SamandGitHub d642c98560 Merge pull request #1439 from dermetfan/buildkite-multi-tags 2025-05-12 10:07:22 -07:00
Linus Heckemann 4cabc9c286 gitlab-runner: write config as toml, don't clobber existing file
The previous command would fail because of datetimes not being
representable as JSON, wiping the config entirely because of the
`sponge` invocation that doesn't care whether the program piped in
fails.
2025-05-12 13:17:31 +02:00
Robin Stumm 846444354b services/buildkite-agents: support multi-tags 2025-05-12 12:59:13 +02:00
Michael HoangandGitHub 6cb36e8327 Merge pull request #1438 from Enzime/push-qztkxuoksrpv
programs/_1password{,-gui}: init modules
2025-05-08 22:50:54 +10:00
Michael Hoang c36b57f219 programs/_1password-gui: init module 2025-05-08 20:17:13 +10:00
Michael Hoang 24c2d2bab7 programs/_1password: init module 2025-05-08 20:16:50 +10:00
Michael HoangandGitHub 760a11c870 Merge pull request #1432 from WHForks/replacevars
nix-tools: use replaceVarsWith
2025-05-03 16:49:02 +10:00
ed9w2in6 0e83fc6e76 feat: add option programs.zsh.enableAutosuggestions
We got enableSyntaxHighlighting, so why not enableAutosuggestions too?

Ref: #527
2025-05-01 23:31:51 +08:00
WeetHet a6d73d0904 nix-tools: use replaceVarsWith 2025-05-01 18:24:30 +03:00
Michael HoangandGitHub 4515dacafb Merge pull request #1425 from Enzime/push-luyktrtqqskl
networking: allow users to override FQDN
2025-04-28 14:58:41 +10:00
Michael Hoang 9603417da1 networking: allow users to override FQDN
Backport of https://github.com/NixOS/nixpkgs/pull/391522
2025-04-28 14:22:30 +10:00
Michael HoangandGitHub 43975d782b Merge pull request #1423 from Enzime/push-kpkrwzkroylt
networking: backport `domain`, `fqdn` and `fqdnOrHostName` options
2025-04-12 19:29:39 +02:00
Michael Hoang 751a96bc1f networking: backport domain, fqdn and fqdnOrHostName options
https://github.com/NixOS/nixpkgs/blob/f675531bc7e6657c10a18b565cfebd8aa9e24c14/nixos/modules/tasks/network-interfaces.nix#L580-L618
2025-04-12 19:11:10 +02:00
Michael HoangandGitHub 113883e37d Merge pull request #1388 from ivankovnatsky/master
services/netdata: add cacheDir option
2025-04-09 20:44:32 +02:00
Michael HoangandGitHub 73d59580d0 Merge pull request #1400 from dwt/linux-builder-working-directory
Linux builder: working directory rename and cleanup
2025-04-01 17:36:52 +09:00
Michael Hoang 1b8d711826 linux-builder: format 2025-04-01 17:09:49 +09:00
‮rekcäH nitraM‮andMichael Hoang b8939c4fe4 linux-builder: remove /nix/store external directory when disabled
When /nix/store internal directories get renamed, they just don't get
into the next version of your system closure and are thus no problem to
rename. But state in the system is a problem, as there is no process to
remov eit. Thus we need to do it ourselves.
2025-04-01 17:09:19 +09:00
‮rekcäH nitraM‮andMichael Hoang a175c68f3f linux-builder: upgrade working directory
The working directory was still using an old name of the project, which
made it uneccessary hard to understand why that directory was used
exactly.
2025-04-01 17:07:02 +09:00
Michael HoangandGitHub eaff8219d6 Merge pull request #1410 from Enzime/push-kklymxxksrnp
nix-tools: re‐add `nixPackage`
2025-03-31 00:54:11 +09:00
EmilyandMichael Hoang e7bd2f8f2f nix-tools: re‐add nixPackage
(With some tweaks to handle `nix.enable` and order it at a more
sensible position in the `$PATH`.)

The installers actually install Nix into `root`’s profile for some
reason, which means that the path’s prioritization backfires when
the script runs as root and we’re managing the Nix installation. When
running `darwin-rebuild` as a normal user, this wasn’t a problem.

Maybe we should just have a check to make sure there’s no conflicting
Nix in `root`’s profile – it seems pretty bad for `root` to
get the wrong Nix – but it would trigger for almost everyone,
which seems kind of annoying. I guess we could automatically
remove it from `root`’s profile if it matches what’s in
`/nix/var/nix/profiles/default`…

This reverts commit 02232f71c5.
2025-03-31 00:34:55 +09:00
EmilyandGitHub 53d0f0ed11 Merge pull request #1407 from emilazy/push-xktutyxmrvks
website: try to fix
2025-03-29 04:17:53 +00:00
Emily 75a7fb885d website: try to fix redirect
It seems like the `#readme` is getting stripped after load, maybe
because of the `?tab=…` stuff. Hoping this will fix it.
2025-03-29 04:13:33 +00:00
Emily 516590cf12 website: fix manual path 2025-03-29 04:13:00 +00:00
EmilyandGitHub feb64b5364 Merge pull request #1406 from emilazy/push-nwzyqrynuvyo
ci: deploy the website from GitHub Actions
2025-03-29 04:10:02 +00:00
Emily 2c77fdbfba ci: deploy the website from GitHub Actions 2025-03-28 19:44:24 +00:00
Emily a5af2a5b22 readme: use logo from GitHub attachments
Avoids churn for now while moving around site stuff.
2025-03-28 17:05:16 +00:00
Michael HoangandGitHub 75f8e4dbc5 Merge pull request #1403 from emilazy/push-wqyxrrzkzovy
treewide: point to the new GitHub organization
2025-03-28 10:27:21 +09:00
Emily ce5a3b9db9 treewide: point to the new GitHub organization 2025-03-27 17:07:57 +00:00
Emily 000c40f4fe readme: update contact information 2025-03-27 17:07:57 +00:00
Michael HoangandGitHub bb81755a36 Merge pull request #920 from hiroqn/master
Expose `extendModules` attr
2025-03-25 11:27:55 +09:00
hiroqn 2c563bd049 expose extendModules 2025-03-25 11:00:38 +09:00
EmilyandGitHub ebb88c3428 Merge pull request #1374 from dwt/fix-docs
Docs: Fix wrong reference to systemd
2025-03-23 14:58:55 +00:00
‮rekcäH nitraM‮ fe728cfb5a autossh: Fix incorrect reference to systemd
Darwin has LaunchD.
2025-03-23 08:39:49 +01:00
EmilyandGitHub e9f41de2a8 Merge pull request #1375 from dwt/fix-docs-2
Docs: Fix references to NixOS
2025-03-21 22:10:55 +00:00
Michael HoangandGitHub 2d9b633169 Merge pull request #1331 from isabelroses/tools
feat: system tools can be configured individually
2025-03-19 17:35:36 +09:00
Ivan Kovnatsky 5417dfd58c services/netdata: add cacheDir option
For me netdata could not start:

```logs
time=2025-03-18T21:27:21.023+02:00 comm=netdata source=daemon level=info errno="2, No such file or directory" tid=257369  msg="CONFIG: cannot load cloud config '/var/lib/netdata/cloud.d/cloud.conf'. Running with internal defaults."
time=2025-03-18T21:27:21.024+02:00 comm=netdata source=daemon level=alert errno="2, No such file or directory" tid=257369  msg="Cannot create required directory '/var/cache/netdata'"
0   netdata                             0x0000000104845cb0 netdata_logger_fatal + 356
1   netdata                             0x00000001044d8734 verify_or_create_required_directory + 84
2   netdata                             0x00000001044d718c set_global_environment + 524
3   netdata                             0x00000001044db294 netdata_main + 1920
4   netdata                             0x00000001044dd178 main + 12
5   dyld                                0x0000000184394274 start + 2840
```
2025-03-18 22:13:30 +02:00
Michael HoangandGitHub 95eac71bf5 Merge pull request #1386 from Enzime/push-lnuotyxsytkz
Back out "github-runner: replace `mkdir -p -m` with `umask`"
2025-03-17 07:58:43 +09:00
Michael Hoang 7b4a4951dc Back out "github-runner: replace mkdir -p -m with umask"
This backs out commit 3b738c765d.

Setting a `umask` made the parent directory have too conservative of
permissions making it so `_github-runner` couldn't access the child
directories.
2025-03-16 19:31:31 +09:00
isabel 9951b44d5b nix-darwin: system tools can be configured indvidually 2025-03-15 09:24:22 +00:00
Michael HoangandGitHub 9175b4bb5f Merge pull request #1377 from zhaofengli/fix-custom-user-preferences-merging
Fix merging of system.defaults.CustomUserPreferences
2025-03-15 13:46:20 +09:00
Zhaofeng Li 814b503899 Fix merging of system.defaults.CustomUserPreferences 2025-03-14 12:00:17 -06:00
Michael HoangandGitHub 4d8a451649 Merge pull request #1355 from toodeluna/fix/profile-name
fix: use correct username for profile
2025-03-14 07:46:59 +09:00
Michael HoangandGitHub 2fb6b09b67 Merge pull request #1089 from niklasravnsborg/fix-modules-commands
Update nextdns to use `command`
2025-03-13 00:47:09 +09:00
Niklas Ravnsborg feecfd97cd update nextdns to use command instead of serviceConfig.ProgramArguments 2025-03-12 15:52:45 +01:00
Varun Narravula e2361f4496 homebrew: allow setting greedy for all casks by default 2025-03-11 01:23:51 -07:00
Luna Heyman 9ddb2e6ca7 fix: use correct username for profile 2025-03-10 19:55:24 +01:00
‮rekcäH nitraM‮ d97323bc60 Docs: Fix references to NixOS
This option applies to nix-darwin.
2025-03-06 16:24:46 +01:00
Michael HoangandGitHub adf5c88ba1 Merge pull request #1367 from Enzime/push-wmqtrnkuqvrt
readme: update instructions as Determinate Nix is now the default
2025-03-06 11:45:00 +09:00
Michael Hoang df599ea8f1 readme: update instructions as Determinate Nix is now the default 2025-03-05 11:25:30 +09:00
EmilyandGitHub 991bb2f6d4 Merge pull request #1362 from stepbrobd/master
homebrew: remove `--no-lock` flag
2025-03-04 18:17:28 +00:00
Yifei Sun d06cf700ee homebrew: remove --no-lock flag
https://github.com/Homebrew/homebrew-bundle/pull/1630
2025-03-04 12:09:11 -05:00
Michael HoangandGitHub 4a0bddd498 Merge pull request #1359 from amarshall/fix-dnscrypt-proxy-alias
services/dnscrypt-proxy: Fix use of pkg alias
2025-03-04 08:13:50 +09:00
Andrew Marshall fdc512d107 services/dnscrypt-proxy: Fix use of pkg alias
`dnscrypt-proxy2` is just an alias for `dnscrypt-proxy`. Use that and
avoid eval failures when Nixpkgs is configured with `allowAliases =
false`.
2025-03-03 08:13:33 -05:00
Michael HoangandGitHub 5d6e0851b6 Merge pull request #1343 from r17x/feat/dnscrypt-proxy
services/dnscrypt-proxy: init
2025-02-28 22:15:25 +07:00
r17x 7386d8878e services/dnscrypt-proxy: init 2025-02-28 19:58:19 +07:00
Michael HoangandGitHub 665cc04a60 Merge pull request #1216 from Coosis/master
Add `pam-watchid` authentication to `sudo` command
2025-02-27 13:09:12 +07:00
EmilyandGitHub 31631ea68f Merge pull request #1353 from booxter/revert-939-networking_hosts
Revert "Add networking.hosts and .hostFiles from nixos "
2025-02-26 23:50:21 +00:00
Ihar Hrachyshka b1db30ce36 networking: Restore the original /etc/hosts on activation
A patch that replaced the original file with a symlink to nix store was
reverted because MacOS Network framework doesn't support symlinks for
the file.

The revert leaves the system without any /etc/hosts file at all though.
To fix this, an activation step is added to restore the original file
from .before-nix-darwin backup, if it exists.

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-02-26 16:52:13 -05:00
Ihar HrachyshkaandGitHub 1d9f622484 Revert "Add networking.hosts and .hostFiles from nixos " 2025-02-26 09:24:15 -05:00
Coosis 727119f8c7 pam: add pam_watchid support 2025-02-25 23:51:30 +08:00
Michael HoangandGitHub 42be12b510 Merge pull request #1344 from Mic92/fix_pam_module
fix: move `pam` configuration to `sudo_local`
2025-02-25 10:06:11 +07:00
Michael HoangandGitHub 59efa72d69 Merge pull request #939 from ibizaman/networking_hosts
Add networking.hosts and .hostFiles from nixos
2025-02-25 09:54:13 +07:00
Michael HoangandAndrew Lubawy 11ea44f3e2 pam: add pam_reattach support
Co-Authored-By: Andrew Lubawy <andrew@andrewlubawy.com>
2025-02-25 09:47:28 +07:00
Michael HoangandAndrew Lubawy 47f263077e pam: switch to using sudo_local file
Co-Authored-By: Andrew Lubawy <andrew@andrewlubawy.com>
2025-02-25 09:47:28 +07:00
ibizaman bde9fa6f64 add networking.hosts and .hostFiles from nixos 2025-02-24 08:57:05 +01:00
Michael Hoang c9c2d40f71 pam: remove with lib; 2025-02-20 17:46:49 +07:00
EmilyandGitHub 6ab392f626 Merge pull request #1187 from khaneliman/spacer
dock: allow setting spacer tiles
2025-02-19 02:57:52 +00:00
Austin Horstman e21d07988b dock: refactor persistent-apps option 2025-02-17 13:12:40 -06:00
Austin Horstman 02ba211ea1 dock: allow setting tile-types
You can create spacer tiles in the dock by passing empty tile-data with
specific tile-types
2025-02-16 19:26:43 -06:00
EmilyandGitHub 678b22642a Merge pull request #1332 from emilazy/push-vyxwvkuuvvvw
treewide: add checks for `nix.enable`
2025-02-14 15:50:17 +00:00
Michael HoangandGitHub 7206892913 Merge pull request #1337 from sandydoo/fix-extra-nix-conf
nix: place `extra-`prefixed settings after their non-prefixed variants
2025-02-14 21:15:10 +07:00
Sander 5926058aec nix: place extra-prefixed settings after their non-prefixed variants
Fixes #626.

Essentially a copy of NixOS's workaround: https://github.com/NixOS/nixpkgs/pull/278064
2025-02-14 16:33:12 +04:00
Emily 731910af01 {activation-scripts,activate-system}: check gcroots before linking
When `nix.enable` is off, we don’t necessarily have an active
Nix installation, so there won’t necessarily be an active
`/nix/var/nix/gcroots` directory to link things into. NixOS just skips
this unconditionally when `nix.enable` is off, but that doesn’t
work well with a context in which we usually expect `nix.enable`
to be coupled with an unmanaged system installation of Nix.
2025-02-11 20:10:55 +00:00
Emily cd445c5465 nix: catch reads of unmanaged defaults
When we’re not managing the Nix installation, these defaults
aren’t used out of the box and won’t accurately represent the
state of any unmanaged Nix or the desired Nix package, so reading
the option defaults is a bug.

This was previously a warning for `nix.package` and a silent failure
for all the others. Now that all the problematic accesses in nix-darwin
have been appropriately conditionalized, and since a throw gives a
backtrace where a warning doesn’t, give throwing defaults to all the
`nix.*` options that don’t reflect reality and that that modules
shouldn’t be reading when `nix.enable` is off.

I’m not in love with the implementation strategy here… ideally
we’d think of something better than this and then upstream it to
NixOS. `nix.nrBuildUsers` growing a fake default that is never used
is particularly unfortunate. But this should hopefully catch mistakes
in module code reasonably reliably.
2025-02-11 20:10:55 +00:00
Emily d677e3e844 nix-tools: only pass config.nix.nixPath through if nix.enable 2025-02-11 20:10:55 +00:00
Emily 42e16f31c6 cachix-agent: check for nix.enable 2025-02-11 20:10:55 +00:00
Emily e3bde1588b github-runner: check for nix.enable 2025-02-11 20:10:55 +00:00
Emily f4e2805e19 ofborg: check for nix.enable 2025-02-11 20:10:55 +00:00
Emily aba0c60eba lorri: check for nix.enable 2025-02-11 20:10:55 +00:00
Emily 57c93ffe6c hercules-ci-agent: check for nix.enable 2025-02-11 20:10:55 +00:00
Emily 147ed950e3 nixpkgs-flake: check for nix.enable 2025-02-11 20:10:55 +00:00
Emily 7cca8f95f7 linux-builder: check for nix.enable 2025-02-11 20:10:55 +00:00
Emily 0176a5082b nix-optimise: check for nix.enable
This was added to Nixpkgs in eb8b70c020e6693b29634660fa173d7f14f882eb.
2025-02-11 20:10:55 +00:00
Emily fc9367a9ec nix-gc: check for nix.enable
This was added to Nixpkgs in eb8b70c020e6693b29634660fa173d7f14f882eb.
2025-02-11 20:10:55 +00:00
EmilyandGitHub a6746213b1 Merge pull request #1313 from emilazy/push-tzwxwyvonslk
nix: add `nix.enable` option to disable Nix management
2025-02-11 19:30:41 +00:00
EmilyandGitHub a36049dac5 Merge pull request #1329 from emilazy/push-nlxwnqymuupk
homebrew: use `mas` from Nixpkgs
2025-02-10 23:20:29 +00:00
EmilyandGitHub 0b6f96a6b9 Merge pull request #1322 from emilazy/push-trvmqywuwnop
Revert "nixpkgs: make config.nixpkgs.{buildPlatform,hostPlatform} write only"
2025-02-08 17:03:44 +00:00
Emily c31b6e8a03 homebrew: use mas from Nixpkgs
Currently, setting `homebrew.masApps` causes `"mas"` to automatically
be added to `homebrew.brews`. Users who want to use Homebrew only
for managing App Store apps and casks, like me, can override this
by setting `homebrew.brews = lib.mkForce [ ];` and adding Nixpkgs’
`mas` to their `environment.systemPackages`.

When the activation script path no longer depends on the built
configuration’s `environment.systemPackages`, this will no longer
work. Since this was originally added before `mas` was packaged in
Nixpkgs and we now have a perfectly serviceable binary package,
we can add it to the `$PATH` when invoking Homebrew and skip the
automatic formula installation.

As the Homebrew `bin` directory still comes first, users who
specifically want the formula can restore the previous behaviour by
explicitly adding `"mas"` to `homebrew.brews`.

Closes: #1314
2025-02-08 16:18:38 +00:00
EmilyandGitHub 3f4351d233 Merge pull request #1327 from emilazy/push-vunnqlmqnzts
checks: fix macOS version check exit code
2025-02-08 14:32:00 +00:00
Michael HoangandGitHub 30b6672aee Merge pull request #1320 from emilazy/push-vykszlnztmtt
users: use `launchctl managername` to determine session type
2025-02-08 19:34:41 +07:00
Emily a2e44a84be changelog: document changes to Nix installation management 2025-02-07 20:08:26 +00:00
Emily 00a8cb30fa readme: update information about Determinate 2025-02-07 20:08:26 +00:00
Emily 03877755e9 checks: add check for Determinate
This provides a more useful error message than the `/etc/nix/nix.conf`
hash mismatch error that would otherwise occur.
2025-02-07 20:08:26 +00:00
Emily fb2bc03f92 activation-scripts: add unmanaged system Nix to activation path
Currently, the `bin` directory of the configured system
is embedded in the `$PATH` of activation scripts, but not
other elements of the default `environment.systemPath` like
`/nix/var/nix/profiles/default/bin` or `/usr/local/bin`. This
means that when nix-darwin is not managing the Nix installation,
activation scripts like Home Manager’s that want to look up the
system‐managed Nix can’t find it. Search for it on the entire
`environment.systemPath` and add the appropriate directory if found.

We leave the launchd `activate-system` daemon alone, because it has
erroneously referred to `@out@/sw/bin` forever and therefore never got
a Nix on the path to begin with. That’s a problem for another time.

(The more ideal solution is probably for Home Manager activation to
be driven by launchd or something, but that’s a longer‐term goal.)
2025-02-07 20:08:26 +00:00
Emily 8a94b5b99b nix-daemon: remove services.nix-daemon.enable
We now manage the launchd daemon unconditionally when we manage the
Nix installation.
2025-02-07 19:44:59 +00:00
Emily adc989f7ec nix: remove nix.configureBuildUsers
We now manage the build users unconditionally when we manage the
Nix installation.
2025-02-07 19:44:59 +00:00
Emily c796587d2e nix: remove nix.useDaemon
We now assume the daemon is used unconditionally when we manage the
Nix installation.

The `nix.gc` and `nix.optimise` services lose their `$NIX_REMOTE`
setting rather than making it unconditional, as the NixOS `nix.gc`
module does not set it. Possibly it should, but I think uniformity
between the two systems is better than diverging, even though I kind
of hate that the non‐daemon method of access is even a thing.
2025-02-07 19:44:59 +00:00
Emily e182d8dff6 nix: add nix.enable option to disable Nix management
This is an equivalent of the `nix.enable` option from NixOS
and Home Manager. On NixOS, it mostly serves to allow building
fixed‐configuration systems without any Nix installation at
all. It should work for that purpose with nix-darwin too, and the
implementation is largely the same, but the main use case is more
similar to the Home Manager option: to allow the use of nix-darwin
with an unmanaged system installation of Nix, including when there
is another service expecting to manage it, as with Determinate.

By providing an escape hatch to opt out of Nix management entirely,
this will also allow us to consolidate and simplify our existing Nix
installation management, by being more opinionated about things like
taking ownership of the daemon and the build users. Porting one option
from NixOS lets us drop two that only ever existed in nix-darwin and
reduce overall complexity.
2025-02-07 19:44:59 +00:00
Emily d634e28f67 users: use launchctl managername to determine session type
Seems like this should be more robust, and it will work even
after the activation script purifies its environment. Apparently
it may treat `tmux` sessions like SSH ones, which may have
something to do with `reattach-to-user-namespace`/`pam_reattach`; see
<https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/issues/78#issuecomment-1074543831>.
(My hope is that `pam_reattach` does the right thing here, but I
haven’t tested.)
2025-02-07 18:03:36 +00:00
Emily 0824c13801 checks: fix macOS version check exit code 2025-02-06 22:57:32 +00:00
Emily da3311397a Revert "nixpkgs: make config.nixpkgs.{buildPlatform,hostPlatform} write only"
This was reverted upstream in 0b47fba23078cc01251b136c7af0127abd57112b.

This reverts commit 7c72c013b1.
2025-02-05 22:06:04 +00:00
Emily 3f6f512406 users: fix typo 2025-02-05 15:14:33 +00:00
Emily 9b9c9a57b6 nix: don’t set $NIX_REMOTE
NixOS doesn’t bother doing this, and Nix already matches this
conditional behaviour when `$NIX_REMOTE` is unset.
2025-02-05 15:14:04 +00:00
Emily 8f227c405e nix: fix typo in assertion conditional 2025-02-05 15:14:04 +00:00
Emily 1f7ed1c7fe checks: remove nixChannels check
I don’t think this is very important given the `nixPath` check,
and it doesn’t fit very well into a post‐user‐activation world.
2025-02-05 15:14:04 +00:00
Michael HoangandGitHub ae406c0457 Merge pull request #1318 from emilazy/push-tmtstvpkwkow
nixpkgs: backports from upstream
2025-02-05 18:26:27 +10:00
EmilyandWolfgang Walther 7c72c013b1 nixpkgs: make config.nixpkgs.{buildPlatform,hostPlatform} write only
The description for options.nixpkgs.system already hints at this:

  Neither ${opt.system} nor any other option in nixpkgs.* is meant
  to be read by modules and configurations.
  Use pkgs.stdenv.hostPlatform instead.

We can support this goal by not elaborating the systems anymore, forcing
users to go via pkgs.stdenv.

This will prevent problems when making the top-level package sets
composable in the next commit. For this to work, you should pass a fully
elaborated system to nixpkgs' localSystem or crossSystem options.

Backport of Nixpkgs commit 0a19371146130c0e2a402fd0c35f8283b0e81910.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-02-03 20:54:01 +00:00
Emily 5084b33265 git-blame-ignore-revs: add nixpkgs module formatting commit 2025-02-03 20:54:01 +00:00
Emily dc1c716ded nixpkgs: format with nixfmt 2025-02-03 20:44:32 +00:00
EmilyandMatt Sturgeon 80eddf2bf7 nixpkgs: show definition files in config assertion
Backport of Nixpkgs commit 6d9dfef94ffd59a327573eea7bc709a84c44b3d2.

Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-02-03 20:44:32 +00:00
EmilyandMatt Sturgeon e84e84a256 nixpkgs: fix config assertion text
The assertion message should include the `nixpkgs.config` value, however
it currently includes the entire `nixpkgs.config` _option_.

This means the type, declarations, definitions, etc were all printed.

Backport of Nixpkgs commit 1bd4da1848cb7b68858ebb2ca1f8b0e5fed46c58.

Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-02-03 20:44:32 +00:00
EmilyandFelix Buehler bd1d46766a nixpkgs: remove with lib;
Backport of Nixpkgs commit 609e57485d1fa111e3a689498d9d338dc03a7bc5.

Co-authored-by: Felix Buehler <account@buehler.rocks>
2025-02-03 20:44:32 +00:00
320bf025d2 nixpkgs: link to Nixpkgs manual for global configuration options
Backport of Nixpkgs commit e6057cfd59f278db3aeb058a4e1e0bcc24696267.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Dominic Mills <dominic.millz27@gmail.com>
2025-02-03 20:44:32 +00:00
EmilyandJared Baur 6b81859ed0 nixpkgs: fix determination for cross-compiled nix-darwin system
Since the output of `lib.systems.elaborate` contains functions, an
equality check with `==` does not suffice, `lib.systems.equals` should
be used instead.

Backport of Nixpkgs commit 3794246066409d7baac72e3fdfb0e4f66ef4a013.

Co-authored-by: Jared Baur <jaredbaur@fastmail.com>
2025-02-03 20:44:32 +00:00
EmilyandAlyssa Ross 2df9e48110 nixpkgs: use less confusing example systems
system and config shouldn't both be specified — each will be filled in
based on the other when the system is elaborated.

Backport of Nixpkgs commit a3ba0495452cd8e72735ebd4472838e96902a259.

Co-authored-by: Alyssa Ross <hi@alyssa.is>
2025-02-03 20:25:16 +00:00
3cd3a79f9b nixpkgs: Rewrite overlays option docs
henrik-ch was also here :)

Backport of Nixpkgs commit 11406bdc0e5af9b3c8a8d597da23349238c65277.

Co-authored-by: Silvan Mosberger <silvan.mosberger@tweag.io>
Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io>
2025-02-03 20:25:16 +00:00
EmilyandK900 962eb3f1c0 nixpkgs: assert that nixpkgs.config is not set when pkgs is passed in externally
This is a common footgun people hit often. Remove it.

Backport of Nixpkgs commit ce87196a00214a0062ece1c3e03a9a97f563580f.

Co-authored-by: K900 <me@0upti.me>
2025-02-03 20:25:16 +00:00
Emily 5b0cffeec2 nixpkgs: fix undefined variable in assertion
This got mangled in the backport a year and a half ago.

Fixes: e25eeff158
2025-02-03 20:25:16 +00:00
EmilyandGitHub 49b807fa7c Merge pull request #1311 from tarc/master
checks: fix sw_vers parameter for macOSVersion
2025-01-30 22:55:53 +00:00
tarc f1cf8c4f5a checks: fix sw_vers parameter for macOSVersion (--productVersion, not -productVersion) 2025-01-30 12:46:25 -03:00
Michael HoangandGitHub 349a74c66c Merge pull request #1306 from emilazy/push-kzsqtpuplusw
Revert "{activation-scripts,activate-system}: purify environment"
2025-01-28 09:58:58 +07:00
Emily cc9c8408bb Revert "{activation-scripts,activate-system}: purify environment"
This shouldn’t actually be split out from the Plan because of the
current use of `$HOME` in the defaults for channel‐based setups.

This reverts commit 4bff4bc8ae.
2025-01-28 02:31:59 +00:00
EmilyandGitHub f43dac477e Merge pull request #1280 from emilazy/push-tunoqoxyyuvy
{environment,readme}: default configuration path to `/etc/nix-darwin`
2025-01-28 02:14:28 +00:00
EmilyandGitHub 5c12a6f4a1 Merge pull request #1303 from emilazy/push-ulxuwyrnkwpq
{activation-scripts,activate-system}: purify environment
2025-01-27 23:11:51 +00:00
Emily 3509925a86 readme: make darwin-rebuild use more explicit 2025-01-27 23:10:14 +00:00
Emily 2733527a58 {environment,readme}: default configuration path to /etc/nix-darwin 2025-01-27 23:10:14 +00:00
Emily 5bc4677c03 readme: reduce duplication in installation instructions 2025-01-27 22:38:26 +00:00
EmilyandGitHub 6715348399 Merge pull request #1300 from emilazy/push-knuxyuxwswlu
ci: use the PR head as `<darwin>` for install test
2025-01-27 22:38:02 +00:00
EmilyandGitHub 67e7728c9a Merge pull request #1302 from emilazy/push-vtlomuzppvtu
checks: remove `darwinChanges`
2025-01-27 22:35:28 +00:00
Emily 4bff4bc8ae {activation-scripts,activate-system}: purify environment
This ensures that system activation does not depend on various
details of its process environment, ensuring uniformity across various
invocation contexts and with the `activate-system` daemon. This becomes
more important in a post‐user‐activation world to avoid problematic
dependencies like `$SUDO_USER`, but is a good idea in general.

The `sudoers(5)` defaults on my Sequoia system are:

    Defaults	env_reset
    Defaults	env_keep += "BLOCKSIZE"
    Defaults	env_keep += "COLORFGBG COLORTERM"
    Defaults	env_keep += "__CF_USER_TEXT_ENCODING"
    Defaults	env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"
    Defaults	env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"
    Defaults	env_keep += "LINES COLUMNS"
    Defaults	env_keep += "LSCOLORS"
    Defaults	env_keep += "SSH_AUTH_SOCK"
    Defaults	env_keep += "TZ"
    Defaults	env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"
    Defaults	env_keep += "EDITOR VISUAL"
    Defaults	env_keep += "HOME MAIL"

Of these preserved environment variables, the ones that are set in
practice when I run `sudo env` that aren’t set in the activation
script here are:

* `$COLORTERM`
* `$DISPLAY`
* `$EDITOR`
* `$MAIL`
* `$SSH_AUTH_SOCK`
* `$TERM`
* `$__CF_USER_TEXT_ENCODING`

Most of these seem either pointless or actively harmful to set for
the purpose of the system activation script.

This will mean that tools run during activation won’t print output
in the user’s preferred language, but that’s probably the right
trade‐off overall, as that is likely to break activation scripts
that parse command output anyway.
2025-01-27 22:31:15 +00:00
Emily ff80eacd0f activation-scripts: remove _status
I believe this has been obsolete since `set -e` was added in
8708ebb796.
2025-01-27 22:31:15 +00:00
Emily 0e87d3d391 activate-system: don’t KeepAlive
It seems like a bad idea to keep restarting the activation daemon
when it fails.
2025-01-27 22:31:15 +00:00
Emily 2119dd10f6 checks: remove darwinChanges
It seems like this has been broken since
26bab2fd32 from 2018; macOS `diff(1)`
does not support these arguments and the `$PATH` has been fixed since
that point. Before that, it would presumably only have worked if you
added GNU diffutils to `environment.systemPackages`.

Proactively notifying users about breaking changes isn’t a bad idea,
but the activation script doesn’t seem like the right place for it,
and as it’s non‐blocking it’s likely that even if it worked it
would get drowned out by the later output anyway. I’d like to move
the changelog into release notes as part of the manual, which would
requires changes to this anyway. Since it’s been broken for almost
seven years anyway, let’s just drop it for now and revisit later.
2025-01-27 20:59:20 +00:00
Emily 1e16e2a9c2 ci: use the PR head as <darwin> for install test
This was installing against the base branch, which causes annoying
issues when things like the state version are bumped. It’s possible
this was intentional to test the upgrade path, but it’s inconsistent
with the flake installation test and keeps breaking stuff on my
PRs. If we want to test the upgrade path then we could re‐add it
again later in a more sophisticated manner (e.g. using the example
config from the previous version).
2025-01-27 20:04:09 +00:00
EmilyandGitHub 62ba0a2242 Merge pull request #1282 from emilazy/push-uqnyoyklywvo
nix-tools: drop `nixPackage`, overwrite `$PATH` rather than prepending, set `$NIX_PATH`
2025-01-26 21:26:41 +00:00
EmilyandGitHub 65cc1fa8e3 Merge pull request #1283 from emilazy/push-nynpmzrmmozu
checks: remove `runLink`
2025-01-22 00:01:16 +00:00
EmilyandGitHub 46d0fa4ded Merge pull request #1279 from emilazy/push-tstmztlwwouo
darwin-uninstaller: remove `darwin` channel from `root` too
2025-01-21 01:33:50 +00:00
EmilyandGitHub 3cdacf160b Merge pull request #1281 from emilazy/push-ozqwkmtmkvtr
darwin-rebuild: pass `${extraBuildFlags[@]}` to `nix-instantiate`
2025-01-21 01:33:15 +00:00
EmilyandGitHub 9525191e9f Merge pull request #1278 from emilazy/push-vuuzmmsrorvw
system: tweak ShellCheck settings
2025-01-21 01:33:00 +00:00
EmilyandGitHub 74a58bfb3f Merge pull request #1290 from emilazy/push-rzokwryxsqxz
eval-config: omit `enableNixpkgsReleaseCheck` from `lib.evalModules`
2025-01-21 00:55:11 +00:00
Emily 87b61d6666 eval-config: omit enableNixpkgsReleaseCheck from lib.evalModules 2025-01-21 00:27:49 +00:00
Emily b5b7888793 nix-tools: set $NIX_PATH
This will be important once most users are running `sudo
darwin-rebuild` and therefore not getting their environment’s
`$NIX_PATH` passed through.
2025-01-20 05:29:44 +00:00
Emily 4d0ae6980d nix-tools: overwrite $PATH rather than prepending
I don’t see any reason for these scripts to depend on more
environmental state than necessary.
2025-01-20 05:29:44 +00:00
Emily c3954c51c4 checks: remove runLink
Now that we create `/run` as part of activation, this is no longer
useful for anaything.
2025-01-18 23:15:41 +00:00
Emily 3d95b01351 nix-tools: make systemPath more readable 2025-01-18 20:33:10 +00:00
Emily 02232f71c5 nix-tools: drop nixPackage
We already put `/nix/var/nix/profiles/default/bin` on the `$PATH`,
and whatever `nix.package` is set to already gets installed into
`/run/current-system/sw/bin`, so this is pointless.
2025-01-18 20:31:54 +00:00
Emily 5665d6c05e darwin-rebuild: pass ${extraBuildFlags[@]} to nix-instantiate
Theoretically required for `darwin-rebuild edit -I darwin-config=…`,
I guess. We also shouldn’t run it for flake‐based setups.
2025-01-18 20:01:22 +00:00
Emily 94adbd6259 darwin-uninstaller: remove darwin channel from root too 2025-01-18 19:38:34 +00:00
Emily e1976612f0 system: tweak ShellCheck settings 2025-01-18 19:34:21 +00:00
EmilyandGitHub 87131f51f8 Merge pull request #1266 from emilazy/push-qwtkyltnunqn
checks: check `/etc/nix/nix.custom.conf` hash
2025-01-18 01:12:15 +00:00
EmilyandGitHub 3924b55553 Merge pull request #1277 from emilazy/push-yxsrvorpzlor
{environment,nix-tools}: correct default `$PATH` ordering to match macOS
2025-01-18 01:11:06 +00:00
EmilyandGitHub 09414c7e2d Merge pull request #1272 from emilazy/push-uooytqlwsquo
defaults-write: fix activation script conditionalization
2025-01-17 03:41:37 +00:00
Emily 8abb2e7244 nix: add hashes for Determinate Systems installer v0.33.0 and v0.34.0 2025-01-17 03:34:11 +00:00
Emily 2fe899db70 nix: check /etc/nix/nix.custom.conf hash 2025-01-17 03:34:11 +00:00
Michael HoangandGitHub ca1f666b6d Merge pull request #1262 from belak-forks/additional-tiling-options
Add support for additional window tiling options
2025-01-17 14:28:18 +11:00
Michael HoangandGitHub c738b81ff5 Merge pull request #1265 from emilazy/push-turlyykvtunt
checks: check for macOS ≥ 11.3
2025-01-17 14:03:04 +11:00
Michael HoangandGitHub 97c05365cf Merge pull request #1273 from emilazy/push-nlqypwmmvons
doc/manual: use `--replace-fail`
2025-01-17 13:52:55 +11:00
Kaleb Elwert 4075a3c23a Add support for additional window tiling options
This adds support for the following defaults:

- com.apple.WindowManager.EnableTilingByEdgeDrag
- com.apple.WindowManager.EnableTopTilingByEdgeDrag
- com.apple.WindowManager.EnableTilingOptionAccelerator
2025-01-15 22:53:21 -08:00
Emily f959b8878b defaults-write: fix activation script conditionalization
These are lists, not attribute sets, so the condition was always
succeeding. As far as I can tell this bug has been present since the
function was added.
2025-01-16 00:13:57 +00:00
Emily ff1d6384df {environment,nix-tools}: correct default $PATH ordering to match macOS 2025-01-15 23:26:14 +00:00
Emily 47174f3868 doc/manual: use --replace-fail 2025-01-15 23:19:28 +00:00
Emily fe2fc038fd defaults/universalaccess: remove docs for macOS < 11 2025-01-14 15:56:20 +00:00
Emily c5b7b604ca darwin-rebuild: remove code for macOS < 11 2025-01-14 15:56:20 +00:00
Emily 8f4f3d8d2d darwin-uninstaller: remove code for macOS < 11 2025-01-14 15:56:20 +00:00
Emily 1c21c9410e system: remove unnecessary sudo 2025-01-14 15:56:20 +00:00
Emily b721000dc6 system: add missing newline 2025-01-14 15:56:20 +00:00
Emily ed6c4aabea system: remove code for macOS < 11 2025-01-14 15:56:20 +00:00
EmilyandGitHub bd921223ba Merge pull request #1259 from emilazy/push-xztopxsynztu
Make release branches a thing
2025-01-14 01:47:14 +00:00
Emily e33d37c41f {readme,examples/flake}: update for release branches 2025-01-14 01:19:21 +00:00
Emily d5aeb4e5b1 checks: recommend sudo nix-channel 2025-01-14 01:19:21 +00:00
Emily efba3517fc eval-config: implement release branch checks 2025-01-13 02:46:43 +00:00
Emily c7b33c131f ci: only test one version 2025-01-13 00:09:00 +00:00
Emily 303a8143a4 checks: check for macOS ≥ 11.3 2025-01-12 19:43:29 +00:00
Michael HoangandGitHub 6ace2f2d12 Merge pull request #1172 from Enzime/push-yxtrnyuxzmny
openssh: init module
2025-01-12 08:33:32 +11:00
Emily 8a3ea966bc version: implement nix-darwin release versions 2025-01-11 15:35:09 +00:00
Michael Hoang be4c1b897a openssh: init module 2025-01-10 10:23:09 +11:00
Michael HoangandGitHub 57733bd1dc Merge pull request #1257 from Enzime/push-nzlzmsqpwswu
nix: merge `nix.settings.trusted-users` by default
2025-01-09 08:12:35 +11:00
Emily 0ef91bc148 flake: pin Nixpkgs explicitly 2025-01-08 20:55:26 +00:00
Michael Hoang 9e856ad0c1 nix: merge nix.settings.trusted-users by default
Backport of https://github.com/NixOS/nixpkgs/pull/318635
2025-01-08 14:27:40 +11:00
Michael HoangandGitHub ba9b3173b0 Merge pull request #1253 from jelmansouri/feat/casks-ignore-deps
Add --ignore-dependencies option for casks
2025-01-06 01:04:51 +11:00
Jalal El Mansouri 6ee6262d24 Add --ignore-dependencies option for casks
Some casks have extrenal dependencies managed by brew, neovide for
examples declares neovim as a dependency, a problem arises when you want
to use a nix managed neovim instead
2025-01-05 10:29:12 -03:00
Michael HoangandGitHub a464e5ba8c Merge pull request #1251 from gnammix/power_shellcheck_SC2016
power: quote in string triggered shellcheck SC2016
2025-01-05 01:52:08 +11:00
gnammix 89be82cb2b power: quote in string triggered shellcheck SC2016 2025-01-04 14:35:53 +01:00
Michael HoangandGitHub 3feaf376d7 Merge pull request #1241 from gnammix/power_conditional_setRestartPowerFailure
power: restartAfterPowerFailure option is carried out conditionally
2025-01-04 13:03:10 +11:00
Michael HoangandGitHub 6a1fdb2a12 Merge pull request #1248 from Samasaur1/push-osptuupokumv
ci, readme: update stable nixpkgs to 24.11
2025-01-01 09:57:19 +11:00
Sam 0680f9e9e1 ci, readme: update stable nixpkgs to 24.11 2024-12-31 22:29:22 +00:00
492a72007a power: echo to print in error messages
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-12-31 14:38:42 +01:00
Michael HoangandGitHub 71a3a075e3 Merge pull request #1208 from thuvasooriya/main
aerospace: add `workspace-to-monitor-force-assignment` option and fix `on-window-detected` type
2024-12-30 00:18:12 +11:00
thuvasooriya aefd56bb56 aerospace: add workspace-to-monitor-force-assignment option and fix on-window-detected type #1208
trying to fix #1142

testing requested changes

adding workspace to monitor force assignment

remove formatting

tests pass

proper tests

undo formatting

tests for on-window-detected and workspace-to-monitor-force-assignment

testing submodules

cleanup n if fiz

checking

final

toml null field aerospace callback issue

custom null filter for submodule list

check for no presense of window-regex and if.workspace config check

aerospace: add workspace-to-monitor-force-assignment option and fix
on-window-detected type #1208

trying to fix #1142

testing requested changes

adding workspace to monitor force assignment

remove formatting

tests pass

proper tests

undo formatting

tests for on-window-detected and workspace-to-monitor-force-assignment

testing submodules

cleanup n if fiz

checking

final

toml null field aerospace callback issue

custom null filter for submodule list

check for no presense of window-regex and if.workspace config check

error

formatting mishap

space left

small fix

formatting mishaps
2024-12-29 16:57:26 +05:30
gnammix 62d8f5f289 power: move the check for restartPowerfailure support to checks.nix 2024-12-29 12:13:54 +01:00
Michael HoangandGitHub 713da7b75b Merge pull request #1242 from filipkania/screencapture-target
defaults: add screencapture.target option
2024-12-29 22:08:16 +11:00
Filip Kania b8e184ebf2 refactor: use enum as option type 2024-12-29 10:58:47 +01:00
Filip Kania 19bc0d6cbe tests: add screencapture.target test case 2024-12-29 00:17:19 +01:00
Filip Kania 25fb527105 feat: add screencapture.target option 2024-12-29 00:17:19 +01:00
Michael HoangandGitHub 53a0c2fe6e Merge pull request #1233 from adamcstephens/fish/package
fish: add package option
2024-12-29 10:04:09 +11:00
Michael HoangandGitHub 1fd4bd9369 Merge pull request #1230 from b1nhack/master
fix(zsh): correct the path of zsh-fast-syntax-highlighting
2024-12-29 09:59:07 +11:00
Xingquan Liu daf9d9fe5d fix(zsh): correct the path of zsh-fast-syntax-highlighting 2024-12-29 01:31:31 +08:00
Adam C. Stephens 2165857a24 fish: add package option 2024-12-27 23:47:55 -05:00
gnammix 016b1608ee power: restartAfterPowerFailure option is carried out in activation script only if supported
Minor documentation change
2024-12-27 21:36:31 +01:00
Michael HoangandGitHub bc03f78187 Merge pull request #1238 from Mic92/ssh
programs.ssh: add extraConfig option
2024-12-27 00:01:23 +11:00
Jörg Thalheim 2c86af2e99 programs.ssh: add extraConfig option
Same interface as in NixOS. This is useful to apply configuration for remote builders.
2024-12-23 21:32:37 +01:00
Domen KožarandGitHub a35b08d09e Merge pull request #1202 from Enzime/push-voxzmynopkkp
linux-builder: default `maxJobs` to amount of cores for Linux builder
2024-12-07 11:27:23 +00:00
Domen KožarandGitHub 9c3d8ff051 Merge pull request #1218 from Enzime/push-rnmuskqvosws
github-runner: fix service not starting
2024-12-07 11:26:48 +00:00
Michael Hoang 8752b6ae3c github-runner: add instructions for triggering a runner registration 2024-12-07 13:08:55 +11:00
Michael Hoang 22cde06f49 github-runner: fix service not starting 2024-12-07 13:06:22 +11:00
Michael Hoang 06e1d77068 github-runner: use lib.getExe{,'} 2024-12-07 13:01:21 +11:00
Michael Hoang d8255f09da github-runner: remove with lib; 2024-12-07 12:54:17 +11:00
Michael HoangandGitHub 55d07816a0 Merge pull request #1213 from z0al/aerospace-startup-commands
fix(aerospace): allow startup commands
2024-12-05 09:29:39 +11:00
z0al 55d46b8997 test(aerospace): assert config values 2024-12-04 21:58:31 +00:00
z0al 9a59556018 fix(aerospace): allow startup commands 2024-12-04 19:03:03 +00:00
Michael HoangandGitHub e7a71f8ec5 Merge pull request #1211 from al3xtjames/nix-lix-version-check
nix: fix Lix version detection in auto-optimise-store assertion
2024-12-04 19:56:27 +11:00
Alex James 0f9576cedc nix: fix Lix version detection in auto-optimise-store assertion 2024-12-04 02:06:23 -06:00
Michael HoangandGitHub c6b65d9460 Merge pull request #1189 from khaneliman/exposegroup
defaults: expose-group-by-app -> expose-group-apps
2024-12-02 02:04:49 +00:00
Austin Horstman 567bae1e17 defaults: expose-group-by-app -> expose-group-apps
Default was renamed in previous macOS release.
2024-12-01 19:12:41 -06:00
Michael HoangandGitHub e30a3622b6 Merge pull request #1166 from Beta-Computer/master
defaults: add EnableTiledWindowMargins option
2024-12-01 10:03:52 +00:00
Beta-ComputerandMichael Hoang 09e5dfb67e defaults: add EnableTiledWindowMargins option
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-12-01 20:40:59 +11:00
Michael Hoang 70957ab0c6 linux-builder: default maxJobs to amount of cores for Linux builder 2024-11-28 14:16:47 +11:00
Michael HoangandGitHub 6ab87b7c84 Merge pull request #1198 from ascandella/fix-etc-synthetic
Fix detection and ownership of /etc/synthetic.conf entry
2024-11-26 06:49:45 +00:00
Aiden Scandella 25e0b6064e system: fix detection and ownership of /etc/synthetic.conf
This file is owned by root and mode 600 on my system, so the grep is
failing and it's adding a new entry every run.

```sh
-rw-------  1 root  wheel  664 Nov 25 15:52 /etc/synthetic.conf
```
2024-11-25 21:40:13 -08:00
Michael HoangandGitHub 3c52583b99 Merge pull request #1191 from Enzime/push-vyzuqpqzosqp
ci: extend timeout and remove `tmate`
2024-11-24 03:51:27 +00:00
Michael Hoang 82ed8010ff ci: extend timeout and remove tmate 2024-11-23 12:39:13 +11:00
Michael HoangandGitHub 698a62c628 Merge pull request #1188 from Enzime/push-ymutwpyrpyzz
github-runner: make `umask` quiet
2024-11-23 01:11:00 +00:00
Michael HoangandGitHub 89928cb531 Merge pull request #1173 from Enzime/push-rzlnwqmnznpp
nix-tools: set `meta.mainProgram`
2024-11-23 01:10:45 +00:00
Michael Hoang caa23e878f github-runner: make umask quiet 2024-11-22 11:19:46 +11:00
Michael HoangandGitHub edabc790a8 Merge pull request #1177 from Enzime/remove/installer
installer: remove
2024-11-21 22:52:27 +00:00
Michael Hoang 095ba5502c default: expose all the darwin-* commands
Change `uninstaller` to `darwin-uninstaller` to match flake attribute
2024-11-21 11:15:28 +11:00
Michael Hoang d57e74864b uninstaller: always specify --extra-experimental-features first
See https://github.com/NixOS/nix/issues/11891
2024-11-21 11:07:47 +11:00
Michael Hoang 2ca27ba780 ci: source /etc/bashrc instead of /etc/static/bashrc
This should no longer be necessary after #687, as we can be sure that if
activation succeeded, that `/etc/bashrc` points to `/etc/static/bashrc`.
2024-11-21 11:07:47 +11:00
Michael Hoang 9fe8a0a738 ci: check that switching to new configurations works after installation 2024-11-21 11:07:47 +11:00
Michael Hoang a4d4d12e38 examples: change default architecture to aarch64-darwin 2024-11-21 11:07:47 +11:00
Michael Hoang 3c27b08740 readme: update Documentation section 2024-11-21 11:07:47 +11:00
Michael Hoang 60ed03d0b1 installer: remove 2024-11-21 11:07:47 +11:00
Michael Hoang 62f9402af0 readme: add using nix-darwin section for non-flakes 2024-11-21 11:07:47 +11:00
Michael Hoang 65ea368ebb installer: move channel creation to README 2024-11-21 11:07:47 +11:00
Michael Hoang 9a1bea70d5 installer: move creating default configuration to README 2024-11-21 11:07:47 +11:00
Michael Hoang 5cc3c00f9b readme: move sections under new Channels section 2024-11-21 11:07:47 +11:00
Michael Hoang 57c144515a system: always add /run to /etc/synthetic.conf on macOS 10.15 onwards
Currently if nix-darwin is uninstalled then reinstalled without
rebooting, then the `/run` symlink will still remain and nix-darwin
won't readd `run` to `/etc/synthetic.conf` meaning the system will be
broken on next reboot.
2024-11-21 10:13:16 +11:00
Michael HoangandGitHub 61cee20168 Merge pull request #1178 from isabelroses/fix/checks/homebrew
fix: allow users to disable the homebrew check
2024-11-19 11:42:17 +00:00
isabel fece297d64 fix: allow users to disable the homebrew check 2024-11-19 10:11:23 +00:00
Michael Hoang 23f312e48a nix-tools: set meta.mainProgram 2024-11-18 10:43:28 +11:00
EmilyandGitHub c60b5c924c Merge pull request #1179 from teekennedy/master
manualHTML: support --redirects option in nixos-render-docs
2024-11-17 23:18:20 +00:00
Terrance Kennedy 4720d452f8 manualHTML: support --redirects option in nixos-render-docs 2024-11-17 14:19:36 -07:00
Michael HoangandGitHub 34588d57cf Merge pull request #879 from jtt9340/spaces-in-nixpath
fix broken NIX_PATH if paths contain spaces
2024-11-17 02:04:32 +00:00
Michael HoangandGitHub 2bcef10f43 Merge pull request #1164 from Enzime/push-yyusnrnkwkxu
nix-daemon: enable by default
2024-11-16 14:42:50 +00:00
Michael Hoang ec5fce6061 uninstaller: check nix-daemon works after restoring 2024-11-17 01:11:27 +11:00
Michael Hoang e07f08c0dc uninstaller: fix restoring nix-daemon launchd daemon 2024-11-17 01:11:27 +11:00
Michael Hoang 6d20de4ed6 nix: remove outdated note requiring managed daemon for distributedBuilds
For Nix 1, some environment variables were set when using distributed
builds requiring the Nix daemon to be managed by nix-darwin. However,
support for Nix 1 has been removed and no other environment variables
for Nix are set by default.
2024-11-17 01:11:27 +11:00
Michael Hoang 7918e24e5b treewide: remove nix.package example 2024-11-17 01:11:27 +11:00
Michael Hoang 6d794390fa checks: check single user installs don't have the nix-daemon enabled
Remove suggestion to set `nix.useDaemon` as it came without an
explanation of how the `nix-daemon` would be unmanaged and would most
likely lead to most users running an old version of Nix as the daemon.
2024-11-16 23:19:11 +11:00
Michael Hoang 5d1b7ac696 treewide: remove mentions of services.nix-daemon.enable = true; 2024-11-16 23:19:11 +11:00
Michael Hoang 698414e409 nix-daemon: enable by default
Single user installs have been unsupported by the official Nix installer
since 2.4.
2024-11-16 23:19:11 +11:00
Michael Hoang d2498644fd nix-daemon: remove with lib; 2024-11-16 23:19:11 +11:00
Michael HoangandGitHub f86f158efd Merge pull request #1169 from Enzime/push-uktzylymvtyk
activate-system: remove `enable` option
2024-11-15 03:53:49 +00:00
Michael Hoang dae702993d activate-system: remove enable option
Disabling this is not supported as `/run` gets cleared out on every
reboot so it is necessary for ensuring that the `/run/current-system`
symlink exists.
2024-11-15 14:10:48 +11:00
Joey TerritoandJoseph Territo 9077d812d8 activate-user script: fix broken NIX_PATH if paths contain spaces 2024-11-13 22:24:48 -06:00
Michael HoangandGitHub 6c71c49e24 Merge pull request #961 from codingCoffee/homebrewcheck
feat: check if homebrew exists
2024-11-12 23:33:43 +00:00
Ameya ShenoyandMichael Hoang 67fbc7aa24 checks: add check to ensure Homebrew is installed
Co-Authored-By: Michael Hoang <enzime@users.noreply.github.com>
2024-11-13 09:53:17 +11:00
Michael HoangandGitHub 839fd2a2b5 Merge pull request #1162 from Enzime/push-ovqpxpsqkwvp
users: ensure `programs.<shell>.enable = true;` for users' shells
2024-11-12 22:25:20 +00:00
Michael HoangandGitHub e30d226a24 Merge pull request #1163 from LucasMendesl/feature/controlcenter
defaults: add `controlcenter` and other options
2024-11-12 15:13:14 +00:00
Lucas Mendes Loureiro 32df51bf2b fix(defaults): fixing #1107 2024-11-12 14:37:26 +00:00
Lucas Mendes Loureiro d71aa30b41 feat(defaults): adding support to control center 2024-11-12 09:48:21 +00:00
Michael Hoang 2bacd8db31 environment: fix lowPrio support in environment.systemPackages 2024-11-11 15:24:19 +11:00
Michael Hoang 8b27551e09 users: warn users to use pkgs.bashInteractive instead of pkgs.bash 2024-11-11 15:24:19 +11:00
Michael Hoang 5eb88645f7 users: assert that programs.<shell>.enable = true; for users' shells
Backport of https://github.com/NixOS/nixpkgs/pull/211603 and https://github.com/NixOS/nixpkgs/commit/093f354a1777e462bd80398c4fc624c4d383dc68
2024-11-11 15:19:41 +11:00
Michael Hoang c2c88ae983 users: remove lib. 2024-11-11 15:10:46 +11:00
EmilyandGitHub 5c74ab862c Merge pull request #1157 from Enzime/read-me
readme: small improvements
2024-11-09 12:04:29 +00:00
Michael HoangandGitHub 5e9e8e7924 Merge pull request #1159 from Enzime/push-ksqroxyztptt
docs: misc fixes
2024-11-09 11:27:47 +00:00
Michael Hoang 5a1ae6a6e4 readme: add prerequisites section 2024-11-09 22:26:53 +11:00
Michael Hoang 050b7db445 installer: don't tell users to source bashrc
Fixes #380
2024-11-09 22:00:43 +11:00
Michael Hoang 2fe3de580e readme: fix badge 2024-11-09 22:00:43 +11:00
Michael Hoang ae09d7ba52 readme: remove outdated instructions for manually managing /etc/bashrc 2024-11-09 22:00:43 +11:00
Michael Hoang 534ca06930 docs: use nix-darwin instead of Darwin 2024-11-09 21:51:15 +11:00
Michael Hoang 293589065d ci: fix manual not being regenerated when non-Nix files are updated
This also fixes the README not being updated on the website as well
2024-11-09 21:28:09 +11:00
Michael HoangandGitHub 3c4a2b1150 Merge pull request #1158 from Enzime/push-xqtwkopwkvpu
ci: don't override nixpkgs when building the manual
2024-11-09 10:06:57 +00:00
Michael Hoang a89c851923 ci: don't override nixpkgs when building the manual
This causes `nix-darwin` to not have `rev` or `dirtyRev`
2024-11-09 20:37:50 +11:00
Michael HoangandGitHub 814f2c2ab4 Merge pull request #1149 from Enzime/push-lorzxpskntmx
flake: expose docs on Linux as well
2024-11-09 09:22:32 +00:00
Michael Hoang 2ff55ab1c5 manual: get revision information when called from flake 2024-11-09 19:46:07 +11:00
Michael Hoang a82d72d25f flake: expose docs on Linux as well 2024-11-09 19:46:07 +11:00
Michael HoangandGitHub 3224bb2f7c Merge pull request #1154 from Samasaur1/zshenv-rcs
zsh: only run shell initialization in /etc/zshenv when RCs are enabled
2024-11-09 08:22:06 +00:00
Sam 5fbb7b7637 zsh: only run shell initialization in /etc/zshenv when RCs are enabled 2024-11-07 20:29:35 -08:00
Michael HoangandGitHub 2fbf4a8417 Merge pull request #1152 from Enzime/push-rvwwkktwykyt
nix: don't allow using `auto-optimise-store` as it can corrupt the store
2024-11-08 02:17:27 +00:00
Michael Hoang f0a1269297 nix: don't allow using auto-optimise-store as it can corrupt the store 2024-11-08 12:48:15 +11:00
EmilyandGitHub 4b3c0d353b Merge pull request #1141 from Enzime/push-yxmxmspuooto
uninstaller: improve
2024-11-07 23:58:44 +00:00
Michael HoangandGitHub fa7b46fa77 Merge pull request #1143 from YorikSar/fix-github-runner-labels
github-runner: Fix labels for different nixpkgs versions
2024-11-07 12:00:23 +00:00
Yuriy Taraday 110d49af63 github-runner: Fix labels for different nixpkgs versions
Changes to escapeShellArg introduced in
https://github.com/NixOS/nixpkgs/pull/333744 made different versions of
nixpkgs behave differently. If current nix-darwin is used with nixpkgs
before that change, labels end up having labels quoted twice
(see https://github.com/LnL7/nix-darwin/issues/1085), but without
changes from https://github.com/LnL7/nix-darwin/pull/1055, with new
nixpkgs, labels end up not quoted at all, and ShellCheck ends up
complaining that commas might have been used as array item separator
(see https://www.shellcheck.net/wiki/SC2054).

Use the old version of escapeShellArg to always escape the list of
labels and make nix-darwin work with both old and new versions of
nixpkgs.

Fixes https://github.com/LnL7/nix-darwin/issues/1085
2024-11-07 11:46:08 +01:00
Michael Hoang 222c3cb558 ci: fix uninstaller failing to run in install-against-unstable 2024-11-07 18:53:19 +11:00
Michael Hoang 3a89b61432 uninstaller: check nix-daemon was correctly reinstalled 2024-11-07 18:52:15 +11:00
Michael Hoang 7bbc7c5db6 ci: test uninstallation of nix-darwin using flakes 2024-11-07 18:52:15 +11:00
Michael Hoang ebca0c23c9 uninstaller: switch to writeShellApplication
By not defining a `shellHook`, `nix-shell -A uninstaller` and
`nix-shell -A uninstaller.check` no longer work.
2024-11-07 18:52:15 +11:00
Michael Hoang c3b406bd1c uninstaller: restore *.before-nix-darwin files
Fixes https://github.com/LnL7/nix-darwin/issues/911
Fixes https://github.com/LnL7/nix-darwin/issues/912
2024-11-07 18:17:34 +11:00
Michael Hoang 9cd45289c9 uninstaller: reset any shells pointing to /run/current-system/sw/bin 2024-11-07 18:17:34 +11:00
Michael Hoang 1b5fa6be40 uninstaller: remove unnecessary attempt to delete nix-daemon
Fixes https://github.com/LnL7/nix-darwin/issues/910
2024-11-07 18:17:34 +11:00
Michael Hoang 84ad3a2d7e uninstaller: remove /run symlink 2024-11-07 18:17:34 +11:00
Michael HoangandGitHub 158198a6e3 Merge pull request #1139 from Enzime/push-ssqvumruwtmy
system: run `shellcheck` on `activate` and `activate-user` scripts
2024-11-07 07:16:23 +00:00
Michael Hoang 79608947e2 buildkit-agents: don't use mkdir -p -m
As `cfg.dataDir` will be the `home` of the Buildkite Agent user, it is
guaranted to exist so we don't need to use the `-p` flag.
2024-11-07 17:31:22 +11:00
Michael Hoang 3b738c765d github-runner: replace mkdir -p -m with umask
`mkdir -p -m` only applies the mode on the deepest directory which could
be a security issue so we use umask to be more careful.
2024-11-07 17:31:22 +11:00
Michael Hoang cf130aa957 users: don't generate ensurePerms when no users to manage 2024-11-07 17:20:00 +11:00
Michael Hoang 32814a6eb1 users: replace runtime check to prevent deleting root with assertion
This fixes SC2050 as `${name} == "root"` will be generated as a constant
expression.
2024-11-07 17:20:00 +11:00
Michael Hoang fd510a7122 system: replace for f in $(ls ...) with for f in .../*
Fixes SC2045 but has one quirk which is if the bash glob doesn't match
anything it'll treat it as a string and run the loop once with
`f=.../*` so we need to check that `$f` actually exists.
2024-11-07 17:20:00 +11:00
Michael Hoang 041996803a treewide: fix shellcheck warnings and errors 2024-11-07 17:20:00 +11:00
Michael Hoang 9afef9950f checks: move manual /run instructions to activation 2024-11-07 17:15:22 +11:00
Michael Hoang 3ea1144938 system: run shellcheck on activate and activate-user scripts 2024-11-07 17:15:22 +11:00
EmilyandGitHub 366b99abfe Merge pull request #1140 from Enzime/aarch64-tests
release: fix tests not running on `aarch64-darwin`
2024-11-07 06:02:34 +00:00
Michael Hoang 2af06b0862 examples: clean up 2024-11-07 15:26:53 +11:00
Michael Hoang 223a920ab4 ci: upgrade actions/checkout 2024-11-07 15:26:53 +11:00
Michael Hoang 37b591bd8b ci: remove unused workflows 2024-11-07 15:26:53 +11:00
Michael Hoang e0f243d17e ci: run nix flake check 2024-11-07 15:26:53 +11:00
Michael Hoang 68637ee7db flake: expose jobs from release.nix as a flattened attrset 2024-11-07 15:26:53 +11:00
Michael Hoang c13549d7a6 examples: drop ofborg example
We decided to drop this example as the package is not available in
Nixpkgs and we won't be able to import it easily and keep this example
evaluating as a useful smoke test. The code in this example is already
documented under `services.ofborg.*` so any interested users can still
find out how to set up `ofborg`.
2024-11-07 15:24:16 +11:00
Michael Hoang 569153467b ofborg: automatically add ofborg to known{Users,Groups} 2024-11-07 11:41:51 +11:00
Michael Hoang dd48cbd776 examples: fix evaluation 2024-11-07 11:41:51 +11:00
Michael Hoang 56ac6182d3 release: remove unnecessary use of release-lib 2024-11-07 11:41:51 +11:00
Michael Hoang c904f6cdcb release: rename release to release-lib to match NixOS
https://github.com/NixOS/nixpkgs/blob/2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53/pkgs/top-level/release.nix#L56-L58
2024-11-07 11:41:51 +11:00
Michael Hoang 8a03b1850b release: remove package jobs 2024-11-07 11:41:51 +11:00
Michael Hoang e11dd028d3 release: remove unstable job
This job is actually in Nixpkgs at https://github.com/NixOS/nixpkgs/blob/2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53/pkgs/top-level/release.nix#L90-L139.
2024-11-07 11:41:51 +11:00
Michael Hoang 1a8c6cac8c release: fix tests not running on aarch64-darwin 2024-11-07 11:41:51 +11:00
Michael HoangandGitHub 98e7dba872 Merge pull request #909 from motheki/fast-syntax-highlighting-support
Add support for zsh-fast-syntax-highlighting
2024-11-06 07:31:39 +00:00
48e5c8de1a Update modules/programs/zsh/default.nix
Changes added by Enzime

Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-11-06 01:10:24 -06:00
897fc37c47 Update default.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-11-05 08:16:35 -06:00
EmilyandGitHub 0e3f3f017c Merge pull request #1146 from emilazy/push-ylsrzmyxtlor
prometheus-node-exporter: fix log permissions
2024-11-05 04:09:18 +00:00
Emily 84d14d4043 prometheus-node-exporter: fix log permissions
The daemon won’t start as the assigned user doesn’t have
permissions to create the log file.
2024-11-05 03:00:55 +00:00
Michael HoangandGitHub 2f05a81019 Merge pull request #1145 from qowoz/shellcheck-timezone
time: shellcheck fix
2024-11-05 01:54:14 +00:00
zowoq 6ff3a49ceb time: shellcheck fix
https://www.shellcheck.net/wiki/SC2143
2024-11-05 11:12:21 +10:00
Michael HoangandGitHub 5d89120785 Merge pull request #1144 from Enzime/push-mkkptszzrnys
ci: switch to `macos-13`
2024-11-05 00:11:47 +00:00
Michael Hoang 07db4e57d3 ci: switch to macos-13
The `macos-12` runner image will be removed by 3 Dec 2024.
2024-11-05 10:41:56 +11:00
EmilyandGitHub 189d2d422c Merge pull request #1129 from mweinelt/node-exporter
module: add prometheus-node-exporter service
2024-11-04 05:40:01 +00:00
Michael HoangandGitHub 4652874d01 Merge pull request #1138 from Enzime/push-trqkuxxuyztn
fix: submodules not working with Nix 2.24
2024-11-03 02:14:38 +00:00
Michael Hoang 53b9de4d6c ci: remove tests to ensure submodules work 2024-11-03 12:56:25 +11:00
Michael Hoang 1d8c91b40e darwin-rebuild: do not resolve flake path
Backport of https://github.com/NixOS/nixpkgs/commit/c274d045ac254afe96b1f8139e974ada2c42059e

Fixes #549
2024-11-03 12:56:25 +11:00
Michael Hoang 406cb56d06 Back out "Add support for submodules in flakes"
This backs out commit 5452c8c638.
2024-11-03 12:56:25 +11:00
Michael HoangandGitHub 146629a543 Merge pull request #1125 from aschleck/new-window-path
Configure the folder that new Finder windows open
2024-11-03 10:19:55 +11:00
Michael HoangandGitHub 446e1ef8e1 Merge pull request #1130 from aschleck/fn-key
Allow configuring the fn key action
2024-11-03 10:17:21 +11:00
EmilyandGitHub f203352cc0 Merge pull request #1135 from Enzime/push-lxwqqpssklyn
environment: remove misleading `environment.loginShell` option
2024-11-02 22:23:10 +00:00
April Schleck 21809c4261 Allow configuring the fn key action 2024-11-02 09:04:53 -07:00
April Schleck 0dacfdea63 Configure the folder that new Finder windows open 2024-11-02 08:53:08 -07:00
EmilyandGitHub e56d80b283 Merge pull request #1136 from Enzime/push-znntomztlvku
users: don't check home directory is correct before creating user
2024-11-02 15:15:43 +00:00
Michael Hoang 318df382e6 users: don't check home directory is correct before creating user 2024-11-02 10:33:31 +11:00
Michael HoangandGitHub 683d0c4cd1 Merge pull request #1133 from bew/patch-1
karabiner-elements: allow use of custom package
2024-11-01 19:07:54 +11:00
EmilyandGitHub 8dbda1064b Merge pull request #1134 from Enzime/push-ynpwzrxomtxw
zsh: enable by default as zsh is the default shell on macOS
2024-10-31 17:30:35 +00:00
Benoît de Chezelles 331fd8d3b5 karabiner-elements: allow use of custom package 2024-10-31 16:51:05 +01:00
Michael Hoang 63f4d40e55 tmux: remove programs.tmux.defaultCommand 2024-10-31 16:00:03 +11:00
Michael Hoang 1588cb2e99 environment: remove misleading environment.loginShell option 2024-10-31 16:00:03 +11:00
Michael Hoang 470f87c182 zsh: enable by default as zsh is the default shell on macOS
Historically this was a footgun because users would not always have this
enabled leading to `darwin-rebuild` and other programs not being found.
2024-10-31 15:09:11 +11:00
Martin Weinelt 6c8d45fb20 module: add prometheus-node-exporter service 2024-10-31 02:08:34 +01:00
Michael HoangandGitHub b379bd4d87 Merge pull request #1124 from SuperSandro2000/cleanup
Cleanup release.nix
2024-10-29 17:44:39 +11:00
Sandro JäckelandMichael Hoang 6eea6b4a75 Reuse nixpkgs instead of accessing channel
This fixes pure evaluation in flakes
2024-10-29 16:18:04 +11:00
EmilyandGitHub a55c84e06f Merge pull request #1128 from Enzime/push-yxyppuxmyunx
users: remove `users.forceRecreate` option
2024-10-29 01:38:20 +00:00
Michael Hoang f380194f3d users: create users with home directory /var/empty by default 2024-10-28 11:05:35 +11:00
Michael Hoang c908607e8a users: remove users.forceRecreate option 2024-10-28 11:01:14 +11:00
Michael Hoang a15a3d9f1f users: fix unclosed string 2024-10-28 10:51:09 +11:00
Michael HoangandGitHub 5c0c6aaa79 Merge pull request #1120 from Enzime/push-ltvtsllrqvqy
users: update properties for known users
2024-10-28 10:08:11 +11:00
Michael Hoang febc3b3f51 users: remove with lib; 2024-10-28 00:38:39 +11:00
Michael Hoang 32f0cf2140 users: replace FDA check with more fine grained permissions check 2024-10-28 00:38:39 +11:00
Michael Hoang 9cd3976486 users: ensure all users' home directories in the config are correct 2024-10-27 21:52:41 +11:00
Michael Hoang 55be3e1a5f users: move checks to system.checks 2024-10-27 21:52:41 +11:00
Michael Hoang dc6f754fe5 users: allow shell to be managed by macOS 2024-10-27 21:52:41 +11:00
Michael Hoang 3712ff78cc users: change default shell to /usr/bin/false to match macOS 2024-10-27 21:26:19 +11:00
Michael Hoang bd161d61d6 users: allow home to be managed by macOS 2024-10-27 21:26:19 +11:00
Michael Hoang c9af5c2d13 users: update properties on known users 2024-10-27 21:26:19 +11:00
Michael Hoang 13816f682d tests: fix old test getting messed up in refactor
https://github.com/LnL7/nix-darwin/commit/2788e4fa981566e34fa40938705cd7f595f05e74#diff-0642dcb4e551dcf07032904ee7f6b7ea645db36939f159908ccb2b85a2bbd1b8L53
2024-10-27 21:26:19 +11:00
Michael Hoang fd6660cb91 tests: fix negative asserts with grep not working
Using `grep -v` without `-z` will return 0 even if there is a match
found as all the non-matching lines will be matched. Instead of using
`grep -vqz`, `(! grep ...)` is more readable.

The brackets are necessary as `! grep` will not trigger `set -e`[0], so we
run it inside a subshell to use its non-zero exit code.

[0]: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#The-Set-Builtin
2024-10-27 21:26:19 +11:00
Michael HoangandGitHub 2eb472230a Merge pull request #1126 from booxter/emacs-keepalive
Add keepalive flag for emacs service
2024-10-27 09:35:30 +11:00
Ihar Hrachyshka 445c6bfc65 Add keepalive flag for emacs service 2024-10-26 13:05:25 -04:00
Michael HoangandGitHub 7840909b00 Merge pull request #1115 from PhilipBorgesen/align_usage
darwin-rebuild: Align usage description with implementation
2024-10-25 14:25:25 +11:00
Philip Børgesen c98bb238b1 darwin-rebuild: Align usage description with implementation
This change updates the usage description of darwin-rebuild.sh as
follows:

 * Add options:

     --print-build-logs / -L
     --no-registries
     --commit-lock-file
     --no-write-lock-file
     --override-input

 * Specify that --no-flake and the flake related options are
   mutually exclusive.

 * Specify that --keep-going and -k are aliases.

 * Specify that --keep-failed and -K are aliases.

 * Correct the description of --update-input; only one value follows.

The --no-build-hook argument remains undocumented, like for nix.
2024-10-25 05:07:51 +02:00
Michael HoangandGitHub 8c675759e9 Merge pull request #813 from PhilipBorgesen/power-related-options
Power related options (sleep, wake-on-lan, restart after power failure, ...)
2024-10-25 13:01:10 +11:00
EmilyandGitHub 04193f188e Merge pull request #1118 from Enzime/push-zvvxxryylwxt
users: ensure users' shells are installed
2024-10-24 09:05:00 +01:00
Michael HoangandGitHub a5d770b257 Merge pull request #1117 from Enzime/push-owuqqzqkrnpn
users: prevent deleting the user calling `darwin-rebuild`
2024-10-24 18:51:17 +11:00
Michael Hoang b089e7e726 users: switch back to using dscl for deleting users
The previous default behaviour when nix-darwin deletes users is that
their home directories are left intact, however as the `-keepHome` flag
for `sysadminctl -deleteUser` is broken, we'll need to switch back for
now.
2024-10-24 18:33:05 +11:00
Philip Børgesen f737259769 power,sleep: Add options to control restart and sleep behavior 2024-10-24 06:13:11 +02:00
Philip Børgesen 5907cbbb31 networking: Add wakeOnLan option 2024-10-24 06:13:07 +02:00
Michael Hoang b702750226 users: ensure Full Disk Access is granted before trying to create users 2024-10-24 14:33:16 +11:00
Michael Hoang 2be05de06e users: add missing newlines for FDA prompt 2024-10-24 14:33:02 +11:00
Michael Hoang 467a0d3d0c users: prevent deleting the user calling darwin-rebuild
`sysadminctl -deleteUser` will only prevent you from deleting the
current user if it's not the last admin and not the last secure token
user, otherwise it will happily oblige.
2024-10-24 14:33:02 +11:00
Michael Hoang bbe1917238 users: ensure users' shells are installed 2024-10-24 14:18:31 +11:00
Michael HoangandGitHub 5f05c2c3d2 Merge pull request #1106 from NickHu/aerospace
module: add aerospace service
2024-10-24 10:50:04 +11:00
Michael HoangandGitHub d99f9ae9fd Merge pull request #1108 from Enzime/users
Use `sysadminctl` instead of `dscl`
2024-10-24 01:33:54 +11:00
Michael Hoang 8c02940d70 users: ensure Full Disk Access is granted before trying to delete users 2024-10-23 01:29:01 +11:00
Michael Hoang 9ee30f2534 darwin-rebuild: add comments explaining the custom sudo logic 2024-10-23 01:11:40 +11:00
Michael Hoang 0a686597fa users: don't allow name to be empty 2024-10-22 22:54:04 +11:00
Michael Hoang 11c777c719 users: change default description to null 2024-10-22 22:54:04 +11:00
Michael Hoang ac7932f9de users: use lib.escapeShellArg for group description 2024-10-22 19:43:18 +11:00
EmilyandGitHub 64d9d1ae25 Merge pull request #1112 from Enzime/push-wkxpqmxomwxp
ci: don't run tests twice for PRs from forks
2024-10-22 07:37:24 +01:00
Michael HoangandGitHub c2224d0d1d Merge pull request #1113 from Enzime/push-zoqltpyrrrnq
ci: update Nix to match versions in nixpkgs
2024-10-22 17:33:11 +11:00
Michael Hoang ea7e178ad4 users: use lib.escapeShellArg for createhomedir 2024-10-22 16:02:21 +11:00
Michael Hoang 8451125cf8 users: use lib.escapeShellArg for dscl paths 2024-10-22 16:02:21 +11:00
Michael Hoang 7a3ec6459c networking: use lib.escapeShellArgs instead of custom version 2024-10-22 16:02:21 +11:00
Michael Hoang 7bb6366f40 users: use lib.escapeShellArgs instead of custom version 2024-10-22 16:02:21 +11:00
Michael Hoang 26f7e45fb1 users: use lib.escapeShellArgs for sysadminctl -addUser 2024-10-22 16:02:21 +11:00
Michael Hoang cb2e5fa6c5 users: use lib.escapeShellArg for sysadminctl -deleteUser 2024-10-22 16:02:21 +11:00
Michael Hoang 9a6b12b9ef users: use lib.escapeShellArg for id -u 2024-10-22 16:02:21 +11:00
Michael Hoang 5b873c48ac users: set default for users.users.<user>.name 2024-10-22 16:02:21 +11:00
Andrew LubawyandMichael Hoang 2788e4fa98 Use sysadminctl instead of dscl
Co-authored-by: Michael Hoang <enzime@users.noreply.github.com>
2024-10-22 16:02:21 +11:00
Michael Hoang cbb190eccb ci: update Nix to match versions in nixpkgs 2024-10-22 14:56:25 +11:00
Michael Hoang 8724129dc8 ci: don't run tests twice for PRs from forks
By only triggering on pushes to `master`, when users push to
non-`master` branches on forks, this workflow won't get triggered and
will only get triggered when users make a PR to the main repo.
2024-10-22 14:35:08 +11:00
Michael HoangandGitHub a001f44cfc Merge pull request #992 from emmceemoore/software-update-fix
Use the correct file location for `SoftwareUpdate` plist.
2024-10-20 11:07:25 +11:00
Nick Hu 7ebf95a73e style fixes 2024-10-19 10:49:55 +01:00
Nick Hu 72e93853c2 module: add aerospace service 2024-10-16 22:50:44 +01:00
Michael HoangandGitHub a60ac02f94 Merge pull request #1104 from Enzime/skhd
skhd: add `skhd` to `PATH`
2024-10-14 21:25:30 +11:00
Michael Hoang 6347a9dcd1 skhd: add skhd to PATH 2024-10-14 17:18:08 +11:00
EmilyandGitHub ccf8cc56c9 Merge pull request #1101 from Enzime/quiet-pgrep
defaults: don't output Dock PID
2024-10-14 03:59:35 +01:00
Michael HoangandGitHub fd0e3ed30b Merge pull request #794 from fesplugas/patch-1
fix: postgresql service initdb
2024-10-13 08:39:35 +11:00
Michael Hoang d32e6de094 defaults: don't output Dock PID 2024-10-09 21:57:33 +11:00
Michael HoangandGitHub 48b50b3b13 Merge pull request #1097 from isabelroses/bash/completions
programs/bash: move to completion.*
2024-10-08 22:10:05 +11:00
isabel c9fd4820d5 programs/bash: move to completion.*
a port of https://github.com/NixOS/nixpkgs/pull/291552 for darwin
2024-10-08 10:05:26 +01:00
Michael HoangandGitHub 8c8388ade7 Merge pull request #1095 from aspauldingcode/master
jankyborders service option order above or below
2024-10-04 09:48:17 +10:00
Michael HoangandGitHub c266b57bbe Merge pull request #1077 from rsrohitsingh682/add-netadata
feat: add netdata service
2024-10-04 09:44:43 +10:00
Rohit Singh 239d802869 netdata: add netdata service in nix-darwin. 2024-10-03 23:42:10 +05:30
aspauldingcode 2893a1bcf7 push change to jankyborders test 2024-10-03 08:01:15 -06:00
5cd9995215 Update modules/services/jankyborders/default.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-10-02 10:38:08 -06:00
aspauldingcode af95f7b7ec add JankyBorders option order and set below by default (values: above/below) 2024-10-01 17:47:30 -06:00
EmilyandGitHub f61d5f2051 Merge pull request #1096 from isabelroses/fix/mdDoc
fix: remove deprecated lib.mdDoc
2024-09-30 15:40:10 +01:00
isabel a42623df7a fix: remove deprecated lib.mdDoc 2024-09-30 15:12:13 +01:00
Michael HoangandGitHub 4b43b68281 Merge pull request #1094 from rogeruiz/rogeruiz/add-slow-motion-allowed-for-dock
Adding option for slow-motion-allowed
2024-09-29 20:08:41 +10:00
Roger Steve Ruiz f9ee41a05d Adding option for slow-motion-allowed;
This was inspired by a recent Daring Fireball post where I was reminded about
this feature and how it's missing from being able to configure it in Nix-Darwin.

[https://daringfireball.net/linked/2024/09/28/hidden-pref-to-restore-slow-motion-dock-minimizing-on-macos]()
2024-09-28 23:28:34 -05:00
Michael HoangandGitHub f2e1c4aa29 Merge pull request #1093 from will-lol/master
fix: karabiner elements virtualhiddeviceclient error
2024-09-28 17:08:15 +10:00
will 3d19b90fc7 fix: karabiner elements virtualhiddeviceclient
- command needed to be quoted
2024-09-28 15:13:31 +10:00
EmilyandGitHub bd7d1e3912 Merge pull request #1083 from emilazy/push-zovpmlzlzvvm
flake: match NixOS definition of `nixpkgs.flake.source`
2024-09-22 12:17:15 +01:00
Michael HoangandGitHub f59275298f Merge pull request #1052 from will-lol/master
Use wait4path with command and script launchd options
2024-09-22 16:40:41 +07:00
will 034c45dd0c feat: use wait4path with script launchd option
addresses https://github.com/LnL7/nix-darwin/issues/1043

fix: use exec in launchd daemon config

fix: dont use a script thats in the nix store

fix: remove manual wait4path in linux-builder

fix: remove manual wait4path in karabiner elements

fix: remove manual wait4path in nix-daemon

fix: remove manual wait4path in nix-optimise

fix: remove manual wait4path in tailscaled

fix: autossh test

Revert "fix: remove manual wait4path in nix-daemon"

This reverts commit 6aec084fa5d095666e81676e78f7054c83703faa.

fix: remove bad exec

Reapply "fix: remove manual wait4path in nix-daemon"

This reverts commit c8f136ecc555f803124af471324bc6ed1163d6dd.

fix: update autossh test

to reflect changes in f86e6133d957becb1958da638516b0860fbd7491

fix: services-activate-system-changed-label-prefix test

fix: services-buildkite-agent test

fix: services-activate-system test

fix: escape ampersand

fix: services-lorri test

fix: services-nix-optimise test

fix: services-nix-gc test

refactor: use script rather than command in daemon

fix: use config.command for clarity

style: fix indentation

fix: use lib.getExe rather than directly pointing to file

revert: a87fc7bbbbdb7c25c5ad6721c93990ea035affdd

- mistaken refactor meant that service waited for nix store and not the relevant path
2024-09-22 15:30:21 +10:00
Michael HoangandGitHub c03f85fa42 Merge pull request #1057 from niklasravnsborg/master
Adjust default options
2024-09-19 17:45:53 +07:00
Niklas Ravnsborg e92cc01524 add tests for finder options 2024-09-18 09:57:48 +02:00
EmilyandGitHub 6374cd7e50 Merge pull request #1084 from emilazy/push-xysppwqymotu
checks: show Sequoia migration commands for other installers
2024-09-18 00:44:40 +01:00
Emily ef16775e43 checks: show Sequoia migration commands for other installers
This is hopefully largely cosmetic, but should increase user
confidence in the safety and effectiveness of the migration, and the
Determinate Systems and Lix installer commands will also update the
`/nix/receipt.json` files to match the changes made. They cannot
properly handle the format of each other’s receipts, so we need to
detect which was used.
2024-09-17 22:20:48 +01:00
Emily db92fac3a9 flake: match NixOS definition of nixpkgs.flake.source
Closes: #1082
2024-09-17 21:24:39 +01:00
Niklas Ravnsborg 2841f49631 fix description typo in dock.nix 2024-09-16 10:54:06 +02:00
Niklas Ravnsborg 3d48a9893a add finder._FXSortFoldersFirst option 2024-09-16 10:54:05 +02:00
Niklas Ravnsborg 3b087efcbd add NSGlobalDomain.AppleSpacesSwitchOnActivate option 2024-09-16 10:54:05 +02:00
EmilyandGitHub 21fe31f264 Merge pull request #1075 from emilazy/push-oszxxzpyppzm
version: make `system.stateVersion` mandatory
2024-09-13 01:53:33 +01:00
EmilyandGitHub 122ff62d68 Merge pull request #1072 from antoineco/zsh/no-nix-shell-check
Remove nix-shell early return in /etc/{zshenv,bashrc}
2024-09-12 20:16:27 +01:00
Antoine Cotten 953d02ba59 {bash,zsh}: remove nix-shell early return in /etc/{bashrc,zshenv}
The condition does not match the comment, and therefore not the original
intention. It currently returns early in *any* type of Nix shell, not
just pure ones, including 'nix develop'.

Besides being unnecessary, this check prevents Nix shells from
functioning properly. For instance, it causes the initialization of the
Zsh fpath to be skipped, which is critical. The fact that the user is
unable to opt out of this behaviour makes this an ever bigger problem
since /etc/zshenv is being loaded unconditionally by Zsh.

For reference, NixOS does not perform such check, and apparently never
did.
2024-09-12 17:37:56 +00:00
Emily 04e3cfc822 version: make system.stateVersion mandatory
When testing the Sequoia UID change, I discovered that @mjm
didn’t have `system.stateVersion` set; I suspect this is not too
uncommon. Let’s make it required now, like NixOS is trying to,
to improve our backwards‐compatibility story in anticipation of
starting to cut release branches.
2024-09-12 18:35:10 +01:00
EmilyandGitHub 9d7aebb303 Merge pull request #1073 from emilazy/push-xxvyptqvpqxw
ci/update-manual: use Nixpkgs 24.05
2024-09-12 14:12:07 +01:00
EmilyandGitHub a0e362a5c9 Merge pull request #1067 from antoineco/module/nixpkgs-flake
Put nixpkgs in NIX_PATH and system registry for flake configs
2024-09-12 11:01:04 +01:00
EmilyandGitHub 6c4aae5a14 Merge pull request #1070 from antoineco/cmd/fix-changelog
Fix darwin-rebuild changelog not displaying
2024-09-12 10:53:59 +01:00
EmilyandGitHub 1380edcdf3 Merge pull request #1071 from antoineco/zsh/fix-children-shells-init
Backport Zsh fpath child shell and nounset fixes from NixOS
2024-09-12 10:46:25 +01:00
Emily 537097b331 ci/update-manual: use Nixpkgs 24.05 2024-09-12 10:41:47 +01:00
Antoine Cotten b64c1d036f tools: fix darwin-rebuild changelog
The script returns early when $systemConfig is empty, which prevents the
changelog from being displayed.
2024-09-11 18:27:53 +02:00
Sebastian ReußeandAntoine Cotten 6ad463a764 zsh: don't be noisy when scripts are run with -u
When a script specifies the shell option "nounset" as part of the
shebang (e.g., via "#!/usr/bin/env -S zsh -u"), our initialization
scripts would produce error messages of the form:

    __ETC_FOO_SOURCED: parameter not set

These messages could probably be confusing to users when running such
scripts. By providing a fall-back in the parameter expansion, we can
avoid them.

This patch does not address interactive shell start-up, where such
messages may (or may not) be less problematic.

NixOS/nixpkgs@7d84dbdf5b
2024-09-11 14:07:24 +02:00
Jörg ThalheimandAntoine Cotten 7e6c548eef zsh: let children shells set their fpath
Currently zshenv by default only sets fpath without exporting it. A
parent shell would also not set those variables usually as they are
shell local.

It also sources a file called set-environment but this is protected by
an environment variable called __NIX_DARWIN_SET_ENVIRONMENT_DONE. Hence
any modification done by the parent shell should persist as long as
__NIX_DARWIN_SET_ENVIRONMENT_DONE is not unset.

This behavior deviates from what we do in bashrc and breaks common
setups such as tmux/mosh or screen.

NixOS/nixpkgs@55819e6c86
2024-09-11 13:01:26 +02:00
Jade LovelaceandAntoine Cotten 8714f9e285 flake: put nixpkgs in NIX_PATH and system registry for flake configs
Currently there are a bunch of really wacky hacks required to get
nixpkgs path correctly set up under flake configs such that `nix run
nixpkgs#hello` and `nix run -f '<nixpkgs>' hello` hit the nixpkgs that
the system was built with. In particular you have to use specialArgs or
an anonymous module, and everyone has to include this hack in their own
configs.

We can do this for users automatically.

NixOS/nixpkgs@e456032add

Co-authored-by: Antoine Cotten <hello@acotten.com>
2024-09-11 08:24:41 +02:00
Michael HoangandGitHub f4f18f3d72 Merge pull request #1069 from emilazy/push-mmluvksnvxpy
{ids,checks}: update for new builder UID/GID values
2024-09-11 15:24:04 +10:00
Emily 88b97aa49c {ids,checks}: update for new builder UID/GID values 2024-09-11 01:17:01 +01:00
Emily 9c60c95008 checks: make oldBuildUsers check fail hard
Checking for the Sequoia stuff won’t work properly if a system is
still in this old state. Best to be loud about it to deal with any
straggler systems that haven’t yet dealt with this issue.
2024-09-11 00:37:08 +01:00
Emily 2af5f0fb9e checks: factor out nix.useDaemon check 2024-09-11 00:37:08 +01:00
Emily 98189683a4 ci: use Determinate Systems installer for stable Nix 2024-09-11 00:37:08 +01:00
Emily f29c6fc015 ci: use Nix 2.24.6 for unstable jobs
Includes the Sequoia installer fixes.
2024-09-11 00:37:08 +01:00
Emily bda49fe089 ci: update stable Nixpkgs to 24.05 2024-09-11 00:37:08 +01:00
EmilyandGitHub 8220423c02 Merge pull request #1068 from emilazy/push-lkuxlvpkttsn
tests/{networking-hostname,users-groups}: update for `lib.escapeShellArg` change
2024-09-11 00:32:33 +01:00
EmilyandGitHub 4c96bd694b Merge pull request #1066 from antoineco/zsh/fpath
Backport Zsh fpath mangling from NixOS
2024-09-10 23:31:41 +01:00
Emily 95f063ea06 tests/users-groups: update for lib.escapeShellArg change 2024-09-10 22:50:01 +01:00
Emily dea497f67a tests/networking-hostname: update for lib.escapeShellArg change 2024-09-10 22:11:20 +01:00
Sebastian ReußeandAntoine Cotten 15f64efcaf zsh: prefer Nix completions these from Zsh package
Zsh ships some rudimentary completions for programs where upstream also
ships their own completions (e.g., curl). So as not to shadow those
completions, we need to prepend to the fpath instead of appending.

NixOS/nixpkgs@8dad5a2239
2024-09-10 21:40:11 +02:00
Jan MalakhovskiandAntoine Cotten 4d59f660bc zsh: move fpath init from /etc/zshrc to /etc/zshenv
We want these to be set even when /etc/zshrc loading is disabled.

NixOS/nixpkgs@f70e3f3738
2024-09-10 21:35:35 +02:00
Michael HoangandGitHub 5b2d8e9a47 Merge pull request #1064 from natsukium/fix/typo
checks.nix: fix typo
2024-09-10 23:37:57 +10:00
natsukium ec76c31dbd checks.nix: fix typo 2024-09-10 22:20:22 +09:00
Michael HoangandGitHub 7655918380 Merge pull request #1055 from siriobalmelli/sb/fix/github-runners
nixos/github-runner: fix build failure
2024-09-06 23:21:49 +10:00
Sirio Balmelli c334175319 nixos/github-runner: quote comma separators so as to pass shellcheck
Shellcheck complains:

       > args=(
       >      ^-- SC2054 (warning): Use spaces, not commas, to separate array elements.

Quote the --labels argument to resolve.

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
2024-09-06 14:57:35 +02:00
EmilyandGitHub a55b3f1ab4 Merge pull request #1059 from emilazy/push-oooqqvvowrxt
users: allow arbitrary group IDs
2024-09-05 14:51:52 +01:00
Emily 97e0f72759 users: allow arbitrary group IDs
The upstream Nix UID/GID changes for Sequoia will require us to manage
a group with GID 350. That will require more work on our end to ensure
compatibility and a working migration path, but this is enough to
allow hacking around it locally in system configurations for now.
2024-09-05 10:39:01 +01:00
Michael HoangandGitHub 92bd25c29f Merge pull request #1058 from Enzime/linux-builder-apply
linux-builder: make `package.nixosConfig` accurate
2024-09-05 16:11:19 +10:00
Michael Hoang e1b6f307ec linux-builder: make package.nixosConfig accurate 2024-09-05 13:54:53 +10:00
Michael HoangandGitHub 7c4b53a7d9 Merge pull request #1051 from booxter/suppress-gpg-connect-agent-stderr
gpg: Suppress stderr from gpg-connect-agent on shell init
2024-09-01 21:15:02 +10:00
Michael HoangandGitHub c8d3157d1f Merge pull request #1050 from coreyjewett/master
Add sha256 for DeterminateSystems Nix installer 0.22.0
2024-08-30 15:14:53 +10:00
Ihar Hrachyshka 75d14c62cb gpg: Suppress stderr from gpg-connect-agent on shell init
In some scenarios, the command may fail, e.g. when the shell is executed
with a different $HOME from where gpg agent is configured to run from.

(E.g. this happens in kitty terminal test suite.)

This patch will suppress stderr errors on tty in this situation.

Note that zsh does not allow to suppress execution of /etc/zshenv on
startup, so it's impossible to skip it in the test suite environment.

An alternative would be to set IN_NIX_SHELL in the test suite, but this
was rejected in upstream:

https://github.com/kovidgoyal/kitty/pull/7800

There's also a kitty package specific fix posted here but this may be
unnecessary once nix-darwin is patched here:

https://github.com/NixOS/nixpkgs/pull/338070

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2024-08-29 16:37:56 -04:00
Corey JewettandCorey Jewett 544db3691c Add sha256 for DeterminateSystems Nix installer 0.22.0 2024-08-29 10:51:52 -07:00
Michael HoangandGitHub ac5694a0b8 Merge pull request #1044 from Enzime/add/known-hash
etc: add known hash for DetSys installer 0.20.0+
2024-08-25 14:56:10 +10:00
Michael Hoang 2bd4949af3 etc: add known hash for DetSys installer 0.20.0+ 2024-08-25 14:36:37 +10:00
Michael HoangandGitHub ea319a7379 Merge pull request #1042 from Enzime/update/README
Use flake based command for uninstaller in README
2024-08-24 13:25:41 +10:00
Michael Hoang 2861a0421b Use flake based command for uninstaller in README
Fixes #918

This command should work on both non-flake and flake based setups as it
does not require `nixpkgs` to be set in `NIX_PATH`.

Also remove the manual install section as it is unmaintained as far as I
can tell.
2024-08-24 13:07:05 +10:00
Michael HoangandGitHub a8968d88e5 Merge pull request #1038 from isabelroses/installTools
feat: system.disableInstallerTools
2024-08-22 14:09:15 +10:00
isabel c06794de03 feat: system.disableInstallerTools 2024-08-21 14:29:54 +01:00
Daiderd JordanandGitHub d6703b9887 Merge pull request #1039 from Enzime/add/funding
.github: add sponsorship details
2024-08-21 07:58:18 +02:00
Michael Hoang 8ef57d17a4 .github: add sponsorship details 2024-08-21 10:32:59 +10:00
Michael HoangandGitHub 076b9a905a Merge pull request #1026 from thecaralice/nochan
Allow disabling channels
2024-08-17 11:59:09 +10:00
Alice Carroll 5afa71b413 fix: respect user nixPath configuration 2024-08-17 02:51:01 +03:00
Alice Carroll 691a590bff feat: allow disabling channels 2024-08-17 02:51:01 +03:00
Alice Carroll d5dba1c6f5 refactor: rename environment.postBuild to environment.extraSetup 2024-08-17 02:50:56 +03:00
Michael HoangandGitHub 91010a5613 Merge pull request #1023 from malko42/swap-ctrl-fn
(feature) Add swapLeftCtrlAndFn
2024-08-06 08:00:07 +02:00
Maxime Daffis 636d1a09d8 (feature) Add swapLeftCtrlAndFn
Use this and never find yourself again hitting fn because of muscle
memory! (you can even physically swap the keycaps, at least on M series)

Keycodes have been pulled from https://hidutil-generator.netlify.app/
and the hex value has been converted to a base 10 int.
2024-08-05 13:00:32 +02:00
Michael HoangandGitHub f7142b8024 Merge pull request #1002 from malko42/window-manager
(feature) Add Stage Manager (com.apple.WindowManager) settings
2024-08-02 16:34:32 +02:00
Maxime Daffis 3dd14e466c (feature) Add Stage Manager (com.apple.WindowManager) settings as system.defaults.windowmanager
All credits go to @AlexOwl. Their [PR](https://github.com/LnL7/nix-darwin/pull/505)
looked abandonned so I reported their changes and addressed the change
requests.
2024-08-02 01:17:45 +02:00
EmilyandGitHub b47af86286 Merge pull request #1022 from Mic92/ssh
programs.ssh: add certificate authorities
2024-08-01 09:24:02 +01:00
Jörg Thalheim cf45edbf27 programs.ssh: add certificate authorities 2024-07-31 19:34:17 +02:00
EmilyandGitHub 7e08a9dd34 Merge pull request #1018 from Enzime/fix/github-runners-work-dir
github-runners: move `workDir` outside of `/run`
2024-07-31 18:00:20 +01:00
EmilyandGitHub 0413754b3c Merge pull request #1012 from Enzime/fix/dock-not-running
defaults: only restart Dock when user is logged in
2024-07-27 13:17:26 +01:00
EmilyandGitHub 980c7066fc Merge pull request #1019 from qowoz/flatten
`mapAttrsFlatten` -> `mapAttrsToList`
2024-07-27 12:38:35 +01:00
zowoq e88eb66c2b mapAttrsFlatten -> mapAttrsToList
deprecated in https://github.com/NixOS/nixpkgs/commit/473e469d5a921a57b484a09d446cee6c231cd592
2024-07-27 13:37:28 +10:00
Michael Hoang dc8e1f4839 github-runners: move workDir outside of /run
As `/run` gets recreated every reboot and we can't specify dependencies
for launchd, creating the `workDir` every reboot will require extra
complexity with a separate daemon that runs as `root` otherwise it won't
have sufficient privileges.

As we clean the `workDir` when the service first starts anyway, it ends
up being the same.
2024-07-27 10:41:18 +10:00
Michael Hoang a6903cf7e3 activation-scripts: add extra comment 2024-07-27 10:39:57 +10:00
Michael Hoang 5c8fb55182 Revert "github-runnners: fix workDir missing on reboot"
This reverts commit fe99aa9699.
2024-07-27 10:26:37 +10:00
EmilyandGitHub 72bbc11aed Merge pull request #966 from 347Online/master
Add inline prediction option mirroring the capitalization option
2024-07-26 17:02:42 +01:00
Michael Hoang a566238826 defaults: only restart Dock when user is logged in 2024-07-25 12:24:30 +10:00
347Online | Katie Janzen be14a2add1 Add inline prediction option mirroring the capitalization option 2024-07-24 12:51:20 -05:00
EmilyandGitHub 884f3fe6d9 Merge pull request #1013 from Enzime/fix/github-runners-work-dir
github-runnners: fix workDir missing on reboot
2024-07-23 08:25:00 +01:00
Michael Hoang fe99aa9699 github-runnners: fix workDir missing on reboot 2024-07-23 11:06:40 +10:00
Michael HoangandGitHub 2ae24bcafd Merge pull request #1011 from nklmilojevic/chore/no-ref/deprecation-removal
chore: removing deprecations for 25.05 nix
2024-07-22 23:34:49 +10:00
Nikola Milojević 199cf34012 chore: removing deprecations for 25.05 nix 2024-07-22 13:37:17 +02:00
EmilyandGitHub 33bf7df5bb Merge pull request #973 from amsynist/modules/services/jankyborders
module : `jankyborders` for window borders Configuration
2024-07-21 09:21:06 +01:00
Prav!nandamsynist fa0d64721f module: add jankyborders service
- Added the jankyborders service.
- Introduced changes for whitelist and blacklist options and assertions.
- emoved path reference from launchd argument.
- Corrected missing trailing newline in default.nix.
2024-07-21 02:54:45 +05:30
Michael HoangandGitHub a3e4a7b8ff Merge pull request #999 from Enzime/restart-dock
defaults: restart Dock when changing settings
2024-07-18 12:43:02 +10:00
Michael Hoang ce130f4b20 defaults: restart Dock when changing settings 2024-07-16 11:28:20 +10:00
Michael HoangandGitHub 7522a30d32 Merge pull request #997 from thanegill/patch-3
Add `User` and  already generated `IdentityFile` to ssh_config for `nix.linux-builder`
2024-07-16 09:34:28 +10:00
Michael HoangandGitHub 5ce8503cf4 Merge pull request #741 from Enzime/default-flake-location
Set default flake directory as `/etc/nix-darwin`
2024-07-13 14:35:12 +10:00
Michael Hoang 902d6b65d3 Set default flake directory as /etc/nix-darwin
Backported from https://github.com/NixOS/nixpkgs/blob/9995a5d59c59fde96f4ad7d811a8ed832357440f/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh#L349-L353
2024-07-13 14:14:11 +10:00
395e4d3794 Update modules/nix/linux-builder.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-07-12 09:50:57 -07:00
EmilyandGitHub cf297a8d24 Merge pull request #976 from emilazy/openssh-use-links-for-authorized-keys
ssh: use symlinks for `authorizedKeys` options
2024-07-10 09:17:22 +01:00
Thane Gill b34d1bee48 Add User and already generated IdentityFile to ssh_config for nix.linux-builder 2024-07-09 13:16:19 -07:00
EmilyandGitHub fabc653517 Merge pull request #964 from kamushadenes/master
Fix NextDNS arguments
2024-07-08 21:18:07 +01:00
Henrique Goncalves e2a85731a0 nextdns: fix argument handling 2024-07-08 16:36:31 -03:00
EmilyandGitHub 0f89b73f41 Merge pull request #996 from ian-h-chamberlain/fix/lix-installer
Add lix-installer to known files
2024-07-07 08:29:22 +01:00
Ian Chamberlain b7e112cdf9 Add lix-installer to known files 2024-07-06 18:04:06 -04:00
Mike Moore 4054d5caea Use the correct file location for SoftwareUpdate plist. 2024-07-02 09:40:18 -07:00
EmilyandGitHub ec12b88104 Merge pull request #990 from nklmilojevic/master
chore: remove mkpackageoptionmd deprecation
2024-07-01 15:50:23 +01:00
Nikola Milojević e00896468a chore: remove mkpackageoptionmd deprecation 2024-07-01 16:24:41 +02:00
EmilyandGitHub 50581970f3 Merge pull request #978 from usertam/patch/no-verify-nixbld
checks.nix: disable verifyBuildUsers for auto-allocate-uids
2024-06-23 08:37:34 +01:00
Samuel Tam 4141697ed2 checks.nix: disable verifyBuildUsers for auto-allocate-uids 2024-06-23 15:14:48 +08:00
Michael HoangandGitHub 29b3096a6e Merge pull request #974 from nicknovitski/linux-builder-crossarch 2024-06-17 22:17:38 +00:00
Nick Novitski d21ba5a487 linux-builder: make compatible with cross-arch builder package
Before this commit, aarch64 users building the following configuration
would end up with an aarch64-linux builder, while after it, they get the
x86_64-linux builder they expect:
```nix
 nix.linux-builder = {
  enable = true;
  package = pkgs.darwin.linux-builder-x86_64;
};
```

Before, in order to get an x86_64-linux builder, they would have needed
to use this configuration instead:
```nix
 nix.linux-builder = {
  enable = true;
  config.nixpkgs.hostPlatform = "x86_64-linux";
  systems = ["x86_64-linux"];
};
```

The reason for this is that the linux-builder module calls `override` on
the package option, and the `linux-builder-x86_64` package is also
defined using override:
```nix
linux-builder-x86_64 = linux-builder.override {
  modules = [ { nixpkgs.hostPlatform = "x86_64-linux"; } ];
};
```

The module was effectively discarding the `nixpkgs.hostPlatform` option.

Example issue: https://github.com/NixOS/nixpkgs/issues/313784
2024-06-16 14:03:41 -07:00
Emily 36a15e8c6c write-text: remove support for copy
This is a huge anti‐declarative footgun; `copy` files cannot
distinguish if a previous version is managed by nix-darwin, so they
can’t check the hash, so they’re prone to destroying data, and
copied files are not deleted when they’re removed from the system
configuration, which led to a security bug. Nothing else in‐tree
was using this functionality, so let’s make sure it doesn’t
cause any more bugs.
2024-06-15 12:15:13 +01:00
Emily b833d4a32d ssh: use symlinks for authorizedKeys options
As explained in the changelog and activation check, the previous
implementation had a nasty security bug that made removing a user’s
authorized keys effectively a no‐op.
2024-06-15 12:15:13 +01:00
EmilyandGitHub 58b905ea87 Merge pull request #716 from tmillr/fix-launchd-calendar-interval
fix(launchd): improve `StartCalendarInterval`
2024-06-15 09:40:58 +01:00
EmilyandGitHub 801f8ab2bc Merge pull request #754 from emilazy/fonts-use-subdir
fonts: reimplement and rename to `fonts.packages`
2024-06-15 05:57:11 +01:00
Michael HoangandGitHub ff988d78f2 Merge pull request #975 from emilazy/drop-old-compat
Drop compatibility for unsupported Nixpkgs versions
2024-06-14 16:16:52 +10:00
EmilyandGitHub b2ee0b3c03 Merge pull request #842 from Enzime/linux-builder-trust
linux-builder: remove trusted user requirement
2024-06-13 19:58:05 +01:00
Emily 2406909d7a Reapply "eval-config: set class"
All supported Nixpkgs versions now support this.

This reverts commit a5b09580e2.
2024-06-13 14:35:20 +01:00
Emily 5399270903 treewide: remove shims for Nixpkgs ≤ 23.05
These deprecated versions were already made unsupported by #932.
2024-06-13 14:35:20 +01:00
Emily cbde36ce62 readme: update stable Nixpkgs to 24.05 2024-06-13 14:35:20 +01:00
Emily be18b76f8d flake.lock: update
With 23.05 support dropped, this was pinned to an unsupported version.
2024-06-13 14:33:45 +01:00
Emily 7d4f867210 fonts: remove fonts.fontDir.enable
As far as I can tell, this isn't required to get fonts to work on
NixOS, so we shouldn't require it on nix-darwin either, even if the
implementations are superficially similar.
2024-06-13 11:56:58 +01:00
Emily adf578e398 fonts: reimplement and rename to fonts.packages
Fixes: #120
Fixes: #722
Fixes: #752
Closes: #692
2024-06-13 11:56:10 +01:00
Emily 27517d2d18 fonts: refactor system.build.fonts
Process substitution behaves better with variables and it's good
practice to use `lib.escapeShellArgs`.
2024-06-13 11:55:36 +01:00
Emily 09e72ff9b9 fonts: remove with lib 2024-06-13 11:54:58 +01:00
Emily eb2f62d0de fonts: use non-standard path in test
Ensure that #665 works correctly.
2024-06-13 11:54:23 +01:00
EmilyandGitHub 139ea5dd92 Merge pull request #963 from elohmeier/launchd-lowpriobgio
launchd: add LowPriorityBackgroundIO config
2024-06-13 11:14:19 +01:00
Michael HoangandGitHub 315aa649ba Merge pull request #965 from jonnyowenpowell/feat/screencapture-show-thumbnail-defaults-option
feat: add defaults screencapture show-thumbnail option
2024-06-10 09:49:55 +10:00
Tyler Miller 861af0fc94 fix(launchd): improve StartCalendarInterval
Stricter launchd -> StartCalendarInterval type:

- Verify that the integers passed to `Minute`, `Hour`, etc. are within
  range.

- When provided, the value for StartCalendarInterval must be a non-empty
  list of calendar intervals and must not contain duplicates entries
  (throw an error otherwise).

- For increased flexibility and backwards-compatibility, allow an
  attrset to be passed as well (which will be type-checked and is
  functionally equivalent to passing a singleton list). Allowing an
  attrset or list is precisely in-line with what `launchd.plist(5)`
  accepts for StartCalendarInterval.

Migrate `nix.gc.interval` and `nix.optimise.interval` over to use this
new type, and update their defaults to run weekly instead of daily.

Create `modules/launchd/types.nix` file for easier/modular use of
launchd types needed in multiple files.

Documentation:

- Update and improve wording/documentation of launchd's
  `StartCalendarInterval`.

- Improve wording/documentation of `nix.gc.interval` and
  `nix.optimise.interval` ("time interval" can be misleading as it's
  actually a "calendar interval"; e.g. `{ Hour = 3; Minute = 15;}`
  runs daily, not every 3.25 hours).
2024-06-09 11:20:15 -07:00
jonny cb198382c2 feat: add defaults screencapture show-thumbnail option 2024-06-06 17:40:24 +01:00
Enno Richter 9ed6009b21 launchd: add LowPriorityBackgroundIO config 2024-06-05 06:40:05 +02:00
Trevor Opiyo 44c88484c4 add warning for enabling syntax highlighting and fast syntax highlighting 2024-05-29 12:24:11 -05:00
Trevor OpiyoandTrevor Opiyo 2839ef54aa Add support for zsh-fast-syntax-highlighting 2024-05-29 12:24:11 -05:00
Michael HoangandGitHub c0d5b8c54d Merge pull request #958 from kamushadenes/master
Add support for trackpad force click
2024-05-30 00:41:28 +10:00
9639c5509b Update modules/system/defaults/NSGlobalDomain.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-05-25 03:14:18 -03:00
Michael HoangandGitHub 0bea8222f6 Merge pull request #956 from amarshall/systempath-order
environment: Adjust systemPath order to allow injecting in the middle
2024-05-24 10:37:35 +10:00
Henrique GoncalvesandGitHub 2e0f9a9e50 Update NSGlobalDomain.nix 2024-05-23 16:56:43 -03:00
Henrique GoncalvesandGitHub 0e5fc0028b Update NSGlobalDomain.nix 2024-05-23 16:50:15 -03:00
Henrique GoncalvesandGitHub 120e085d1a Update NSGlobalDomain.nix 2024-05-23 16:42:31 -03:00
Henrique GoncalvesandGitHub 6cbe6bc2da Update trackpad.nix 2024-05-23 16:40:17 -03:00
Andrew Marshall 7f897008d4 environment: Adjust systemPath order to allow injecting in the middle
Previously, it was not possible to inject PATH entries between profiles
and the “default system” PATH entries. This confounds adding, e.g.
Homebrew on aarch64’s non-standard prefix as higher priority than the
builtin system paths, but lower than Nix profiles.

This is a backwards-incompatible change for some users, but should only
be so in the case a user used `mkOrder` with a value between 1000 (the
default priority) and 1200. Value of 1200 chosen as the same delta from
the default as just below in `environment.profiles` (which uses 800),
and mkAfter is 1500 so will still go after this.
2024-05-23 09:55:35 -04:00
Andrew Marshall bd0ed8599f environment: Test how order of systemPath and profiles manifests 2024-05-23 09:55:35 -04:00
Andrew Marshall 9b6f77200f environment: Rework test to assert against full $PATH
It’s deterministic after all, so test against the full thing for greater
flexibility in testing and confidence in lack of unexpected changes to
previously-untested parts of the default $PATH.

Do this in a subshell to avoid polluting the test script’s environment.
2024-05-23 09:55:35 -04:00
Michael HoangandGitHub eac4f25028 Merge pull request #955 from qowoz/hercules-security
hercules-ci-agent: fix crash calling `security`
2024-05-22 08:15:35 +10:00
zowoq 251eaabfa0 hercules-ci-agent: fix crash calling security
this applies the same fix that was used for the cachix agent in e043606b50
2024-05-21 23:16:46 +10:00
Michael HoangandGitHub 8bf083c992 Merge pull request #950 from rmgpinto/persistent-others-file-directory-tile
Add file or directory tile to Dock persistent others
2024-05-21 07:21:31 +10:00
Michael HoangandGitHub e1cacc63e6 Merge pull request #926 from Rubikoid/rubikoid/offline-flag
Add offline and substituters flags
2024-05-20 21:25:19 +10:00
Michael HoangandGitHub a2d8796ce9 Merge pull request #954 from thegleich/change-zsh-default-prompt
Change zsh default prompt
2024-05-20 21:17:27 +10:00
Dominik GleichandGitHub c8a8faedbc Change zsh default prompt 2024-05-20 09:48:03 +02:00
Rubikoid 24f7a3fdf4 Move --offline to group of same behaviour flags 2024-05-18 16:25:53 +03:00
Michael HoangandGitHub ffc01182f9 Merge pull request #953 from techknowlogick/patch-1
remove final lib.mddoc
2024-05-17 09:25:37 +10:00
techknowlogickandGitHub de20ea4882 remove final lib.mddoc 2024-05-16 12:48:56 -04:00
Domen KožarandGitHub cb02884fa1 Merge pull request #952 from sandydoo/fix-924
cachix-agent: fix crash calling `security`
2024-05-16 16:58:05 +02:00
Sander e043606b50 cachix-agent: fix crash calling security
One of cachix-agent's dependencies, `hs-certificate`, makes calls to
`security`. This lives in `/usr/bin`, which isn't available from
launchd. This commit makes the system paths available to cachix-agent.

Fixes #924.
2024-05-16 18:04:33 +04:00
Ricardo Pinto 93913d14a3 Add file or directory tile to Dock persistent others 2024-05-15 07:49:00 +01:00
Michael HoangandGitHub de8b0d60d6 Merge pull request #928 from rmgpinto/persistent-others
Add persistent others to dock
2024-05-14 12:22:58 +10:00
Ricardo Pinto 457a5d9952 Add persistent others to dock 2024-05-13 13:46:54 +01:00
Rubikoid 2a2a311fca Fix help 2024-05-07 16:02:26 +03:00
Rubikoid 3524643c3d Fix --offline
Add --substituters flag
2024-05-07 16:02:26 +03:00
Rubikoid bb17a88bc0 Add offline flag to darwin-rebuild.sh 2024-05-07 16:02:26 +03:00
Michael HoangandGitHub 230a197063 Merge pull request #940 from qowoz/nix-daemon
nix-daemon: increase SoftResourceLimits.NumberOfFiles
2024-04-24 18:09:31 +10:00
zowoq ec06ea8837 nix-daemon: increase SoftResourceLimits.NumberOfFiles
1048576 matches the nixos/nix plist

https://github.com/NixOS/nix/blob/e3a4e40a354e1c2d177541d24d6a86a001fa87c7/misc/launchd/org.nixos.nix-daemon.plist.in#L29
2024-04-24 16:03:49 +10:00
Michael HoangandGitHub 9e7c20ffd0 Merge pull request #932 from wegank/mddoc-remove
treewide: remove lib.mdDoc
2024-04-20 02:24:36 +10:00
Michael HoangandGitHub eb25dc61a6 Merge pull request #936 from JeffersonBledsoe/master
Update ShowDate documentation in menuExtraClock
2024-04-19 12:08:17 +10:00
Weijia Wang def1e23be8 treewide: remove lib.mdDoc 2024-04-19 04:05:50 +02:00
Michael HoangandGitHub 99b3f9a1f5 Merge pull request #938 from wegank/release-bump
ci, readme: update stable nixpkgs to 23.11
2024-04-19 12:03:01 +10:00
Weijia Wang 1098e60e92 ci, readme: update stable nixpkgs to 23.11 2024-04-18 18:29:24 +02:00
Jefferson BledsoeandGitHub 81f7aab5ed Update ShowDate in menuExtraClock 2024-04-18 13:53:30 +00:00
Michael HoangandGitHub 36524adc31 Merge pull request #915 from malob/add-nix-optimise-module
Add `nix.optimise` module
2024-03-30 12:48:46 +11:00
Michael HoangandGitHub f0dd0838c3 Merge pull request #917 from HyunggyuJang/fix-meta
Use valid maintainer in meta example
2024-03-28 13:02:14 +11:00
Malo Bourgon 398510f601 Add nix.optimise module 2024-03-27 12:50:04 -07:00
Hyunggyu Jang 83a9a41f1b Use valid maintainer 2024-03-26 13:58:02 +09:00
Michael HoangandGitHub bcc8afd06e Merge pull request #906 from miterion/master
Remove override.css
2024-03-18 10:13:25 +11:00
Heiko CarrascoandGitHub 576be4317c Remove override.css as done in https://github.com/NixOS/nixpkgs/pull/295847 2024-03-17 14:28:18 -04:00
Michael HoangandGitHub d9ea313bc4 Merge pull request #903 from bs10x/patch-1 2024-03-13 09:09:39 +11:00
Basil FeitknechtandGitHub c18685e773 update README.md
fixed minor typo
2024-03-12 16:11:23 +01:00
Michael HoangandGitHub c7ae5dc969 Merge pull request #725 from mitchmindtree/trezord 2024-03-13 02:00:15 +11:00
Michael HoangandGitHub 550340062c Merge pull request #900 from amarshall/avoid-alias
darwin-uninstaller: Fix when using nixpkgs.config.allowAliases = false
2024-03-07 11:31:23 +11:00
Andrew Marshall 5c2700533c darwin-uninstaller: Fix when using nixpkgs.config.allowAliases = false 2024-03-06 08:04:42 -05:00
Michael HoangandGitHub daa03606df Merge pull request #898 from dfrankland/dock-persistent-apps
Add support for persistent-apps in dock
2024-03-04 23:12:54 +11:00
Dylan Frankland 5c65cfb656 Add support for persistent-apps in dock 2024-03-03 21:32:17 -08:00
Michael HoangandGitHub e7d7a7f0c5 Merge pull request #821 from qowoz/users
users: fix `forceRecreate` bash comparison
2024-03-04 16:25:51 +11:00
Michael HoangandGitHub 1032f0963f Merge pull request #767 from jmmaloney4/master
a few fixes for ipfs module
2024-03-04 16:23:30 +11:00
Michael HoangandGitHub 530f265072 Merge pull request #897 from dfrankland/fix-writing-values-with-containers
fix writing values with containers
2024-03-04 16:16:05 +11:00
Dylan Frankland b620e32a76 fix writing values with containers
Complex container values like `-array` have their own DSL which does not
allow specifying all data types. Instead of using the DSL use plist
fragments instead.
2024-03-02 22:29:56 -08:00
Michael HoangandGitHub 17c2ca3c75 Merge pull request #896 from vendored/patches/support-new-nix-2.20-command-syntax
Support new nix 2.20 command syntax
2024-03-03 13:49:27 +11:00
Mark Sisson 3397ab3b77 feat(nix): adapt nix.conf validation for different Nix versions
This commit updates the nix.conf validation logic to accommodate
different versions of Nix. It introduces a conditional assignment
of the `showCommand` variable, which determines the appropriate
command to use based on the Nix version. For versions at least
"2.20pre", it uses "config show"; otherwise, it falls back to
"show-config". This change ensures compatibility across various
Nix releases.
2024-03-02 18:51:25 -06:00
Michael HoangandGitHub 8a15cb36ff Merge pull request #892 from Samasaur1/startup-chime
`system.startup.chime`: init
2024-03-02 13:57:42 +11:00
Domen KožarandGitHub 70d162d468 Merge pull request #891 from mattpolzin/nix-direnv
nix-darwin/programs.direnv: init
2024-03-01 18:23:36 +07:00
Sam ee53e5785c system.startup.chime: init 2024-02-29 22:23:40 -08:00
Sam 0363c18c37 system.nvram: init (internal) 2024-02-29 22:20:04 -08:00
Michael HoangandGitHub c2751db910 Merge pull request #894 from MoritzR/master
defaults: Add options for dragOnGesture feature
2024-03-01 16:24:09 +11:00
Moritz Rumpf ad98aebc0f Fix doc render problem
This fixes:
```
RuntimeError: can't render html in the presence of docbook
```
2024-02-29 08:45:54 +01:00
Moritz Rumpf 2ffb75f942 defaults: Add options for dragOnGesture feature
This is just a rebased version of https://github.com/LnL7/nix-darwin/pull/513

Credit to @2gn
2024-02-29 08:45:54 +01:00
Domen KožarandGitHub 283d59778e Merge pull request #893 from yaxitech/github-runner-2
github-runners: adapt to NixOS module
2024-02-28 16:35:25 +07:00
Vincent Haupert 06f5dab065 github-runners: adapt to NixOS module
While #859 added basic support for configuring GitHub runners through
nix-darwin, it did not yet support all of the options the NixOS module
offers.

I am aware that this is a rather big overhaul. I think, however, that
it's worth it:

- Copies the `options.nix` from the [NixOS module] with only minor
  adaptations. This should help to keep track of any changes to it.
- Respect the `workDir` config option. So far, the implementation didn't
  even read the value of the option.
- Allow configuring a custom user and group.
  If both are `null`, nix-darwin manages the `_github-runner` user
  shared among all instances. Take care of creating your own users if
  that's not what you want.
- Also creates the necessary directories for state, logs and the working
  directory (unless `workDir != null`). It uses the following locations:
    * state: `/var/lib/github-runners/${name}`
    * logs: `/var/log/github-runners/${name}`
    * work: The value of `workDir` or `/var/run/github-runners/${name}`
            if (`workDir == null`).
  We have to create the logs directory before starting the service since
  launchd expects that the `Standard{Error,Out}Path` exist. We do this
  by prepending to [`system.activationScripts.launchd.text`].
  All directories belong to the configured `user` and `group`.
- Warn if a `tokenFile` points to the Nix store.

[NixOS module]: https://github.com/NixOS/nixpkgs/blob/3c30c56/nixos/modules/services/continuous-integration/github-runner/options.nix
[`system.activationScripts.launchd.text`]: https://github.com/LnL7/nix-darwin/blob/bbde06b/modules/system/launchd.nix#L99-L123
2024-02-28 09:40:25 +01:00
Mathew Polzin 9090c6f897 nix-darwin/programs.direnv: init 2024-02-27 08:38:36 -06:00
Michael HoangandGitHub 6c06334f08 Merge pull request #888 from Samasaur1/fix-sudo-extraconfig
security.sudo.extraConfig: fix default behavior
2024-02-27 13:37:32 +11:00
Sam 44888312de security.sudo.extraConfig: fix default behavior 2024-02-26 18:21:48 -08:00
Michael HoangandGitHub bbde06bed1 Merge pull request #881 from epetousis/add-determinatesystems-hash
etc: add known hash for `/etc/zshenv` and `/etc/nix/nix.conf`
2024-02-24 11:22:41 +10:00
Evan Petousis f1a0d68a8f etc: add known hash for /etc/zshenv and /etc/nix/nix.conf
Adds support for DeterminateSystems installer 0.16.0 and later. Fixes #880.
2024-02-23 18:45:24 +11:00
Domen KožarandGitHub 314a36d99b Merge pull request #878 from LoganBarnett/linux-builder-big-config
linux-builder additional options
2024-02-23 09:31:04 +07:00
Logan Barnett 27e6a022f2 apply feedback, fix merge goof 2024-02-21 10:44:30 -08:00
Logan Barnett 9f4fbed460 Merge remote-tracking branch 'ethnt/linux-builder-systems-config' into linux-builder-big-config-take-2 2024-02-21 09:29:40 -08:00
Logan Barnett 208cd70d04 Merge remote-tracking branch 'stv0g/linux-runner-options' into linux-builder-big-config-take-2 2024-02-21 09:27:02 -08:00
Logan Barnett 61c5879b5a linux-builder: default pass through protocol to nix.buildMachines
This commit adds a protocol option for the `linux-builder` and defaults
it to `ssh-ng`.  I have observed it needing this with the following:

``` sh
$ nix store ping --store ssh://linux-builder
Store URL: ssh://linux-builder

$ nix store ping --store ssh-ng://linux-builder
Store URL: ssh-ng://linux-builder
Version: 2.18.1
Trusted: 0
```

This seems to make the difference on whether or not Nix picks up
`linux-builder` as an available builder.
2024-02-20 13:10:24 -08:00
Steffen Vogel 94558e7e8b linux-builder: Pass through more options to nix.buildMachines
This commit passes more options to  nix.buildMachines. Namely the mandatoryFeatures and speedFactor settings have been missing.
2024-02-18 13:25:01 +01:00
Domen KožarandGitHub 0e6857fa1d Merge pull request #859 from yaxitech/github-runner
github-runners: init module
2024-02-18 04:48:38 +00:00
Michael HoangandGitHub 44f50a5eca Merge pull request #866 from Samasaur1/master
security.sudo.extraConfig: init
2024-02-12 13:08:09 +10:00
Sam 37eb625dd4 security.sudo.extraConfig: init 2024-02-11 14:16:23 -08:00
Michael HoangandGitHub bdbae6ecff Merge pull request #863 from nrabulinski/no-yabai-ifd
services/yabai: Remove IFD
2024-02-02 10:26:16 +10:00
Nikodem Rabuliński 4363d3b42f services/yabai: Remove IFD
enableScriptingAddition no longer triggers IFD
by using runCommand to generate sudoers.d/yabai,
instead of builtins.hashFile and interpolating the string in nix.
2024-02-01 23:06:13 +01:00
Michael HoangandGitHub 91b9daf672 Merge pull request #780 from kalbasit/update_yabai_sa_script
services/yabai: Remove --check-sa and --install-sa flags
2024-01-30 12:32:45 +10:00
Michael HoangandGitHub 00538eecf2 Merge pull request #861 from thanegill/darwin-rebuild-completions
Add zsh completions to darwin-rebuld by default
2024-01-29 13:03:01 +10:00
492944b0f2 Update darwin-rebuild.zsh-completions
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-01-28 18:12:36 -08:00
Thane Gill 0f0478efa6 Add zsh completions to darwin-rebuld by default 2024-01-27 19:37:27 -08:00
Michael HoangandGitHub 0108864c15 Merge pull request #860 from thanegill/use-nixpkgs-lib.generators.toPlist
Use nixpkgs generators.toPlist for launchd service generation
2024-01-28 11:24:25 +10:00
Thane Gill 3a9755f98d Use nixpkgs generators.toPlist for launchd service generation.
Fixes #93
2024-01-27 17:09:41 -08:00
Michael HoangandGitHub 1e706ef323 Merge pull request #857 from thanegill/patch-2
Allow launchd serivceConfig.LimitLoadToSessionType to be a list
2024-01-22 19:29:28 +10:00
Vincent Haupert 21b92addaf github-runners: init module
Adds a new module which allows to configure multiple GitHub self-hosted
runners on Darwin. The module is heavily inspired by the nixpkgs NixOS
module. Its implementation differs in some ways:

- There's currently no way to configure the user/group which runs the
  runner. All configured runners share the same user and group.
- No automatic cleanup.
- No advanced sandboxing apart from user/group isolation
2024-01-22 10:27:11 +01:00
Michael HoangandGitHub 91c19ab206 Merge pull request #858 from mrdomino/compinit
Add option to disable zsh global compinit
2024-01-21 20:39:10 +10:00
Jōshin a3be68d105 Add option to disable zsh global compinit
Fixes #855.
2024-01-21 03:24:00 -05:00
Michael HoangandGitHub 3ac7acd32d Merge pull request #854 from kallisti-dev/fix/network-names-shell-escapes
fix shell escaping in networking config
2024-01-21 10:14:09 +10:00
Michael HoangandGitHub 983bd5125d Merge pull request #818 from hraban/chsh
fix: user shell path handling
2024-01-21 10:10:48 +10:00
Hraban Luyat f1d47fc2dd fix: set shell for new users, and only known ones 2024-01-20 11:03:15 -05:00
Hraban Luyat 888533c35f fix: user shell path handling
Properly detect the binary name (not just /nix/store/...-bash, but include the
.../bin/bash), and use the symlinked name which also appears in /etc/shells.
2024-01-20 11:03:15 -05:00
Thane Gill 6b27542e86 Allow launchd serivceConfig.LimitLoadToSessionType to be a list
Per: https://developer.apple.com/library/archive/technotes/tn2083/_index.html#:~:text=If%20you%20want%20to%20run%20in%20more%20than%20one%20session%20type%2C%20you%20can%20set%20LimitLoadToSessionType%20to%20an%20array%2C%20where%20each%20element%20is%20a%20session%20type%20string.

LimitLoadToSessionType can also be an array if more than one session type is desired.
2024-01-19 15:45:52 -08:00
Adam Curtis 5cec74dae1 fix shell escaping in networking config 2024-01-19 12:16:32 -05:00
Michael HoangandGitHub 74ab0227ee Merge pull request #851 from XMLHexagram/patch-1
Add type definition on fonts.fontDir.enable
2024-01-17 10:44:49 +10:00
XMLHexagramandGitHub 4051e3027d Add type definition on fonts.fontDir.enable 2024-01-16 21:07:41 +08:00
Michael HoangandGitHub 44a6ec1fae Merge pull request #850 from tfc/master
linux-builder: Add `ephemeral` option to delete VM's disk image on service restart
2024-01-16 08:06:44 +10:00
Jacek Galowicz c4ea346d0f Dedupe the WorkingDirectory path of the linux-builder 2024-01-15 13:51:34 +01:00
Michael HoangandGitHub 0dd382b70c Merge pull request #820 from mhumeSF/reduce-motion
Add `universalaccess.reduceMotion` option
2024-01-03 10:28:40 +00:00
Mike Hume 4a4542ba89 Adding test 2024-01-02 22:58:18 -10:00
Michael Hoang dbbcad8b9b linux-builder: remove trusted user requirement
If you set up a signing key for the `linux-builder` and add that as
trusted public key on your machine, you won't need to be a trusted user
at all.
2023-12-31 14:00:39 +11:00
Michael HoangandGitHub 1a41453cba Merge pull request #841 from carlthome/patch-1
Fix type error
2023-12-31 12:41:07 +10:00
Carl ThoméandGitHub 59bef44059 Fix type error
```
error: A definition for option `launchd.user.agents.[...].serviceConfig.StartCalendarInterval' is not of type `null or (list of (submodule))'. Definition values:
       - In `<unknown-file>':
           {
             Hour = 0;
             Minute = 0;
           }
```
2023-12-30 23:47:20 +01:00
Michael HoangandGitHub 0a3afdc600 Merge pull request #839 from khaneliman/mouse-scaling
GlobalPreferences: fix mouse scaling example
2023-12-30 08:03:57 +10:00
Austin Horstman f6cf46f7bc GlobalPreferences: fix mouse scaling example 2023-12-29 14:09:38 -06:00
Michael HoangandGitHub 8a8321271f Merge pull request #838 from moni-dz/deprecate-string-float
Use native floats for mouse scaling
2023-12-27 13:55:38 +10:00
fortuneteller2k 9acb5b1adc Use native floats for mouse scaling 2023-12-27 11:30:04 +08:00
Domen KožarandGitHub f454cff5fe Merge pull request #837 from Enzime/add/shells
etc: add known hash for `/etc/shells`
2023-12-24 10:54:00 +00:00
Michael Hoang 850eabce44 etc: add known hash for /etc/shells 2023-12-23 22:41:58 +11:00
Michael HoangandGitHub 010a625bd7 Merge pull request #831 from rkitover/high-sierra-fix
darwin-rebuild: fix sudo invocation on High Sierra
2023-12-23 04:53:21 +10:00
Rafael Kitover f81fbc2bf7 darwin-rebuild: fix sudo invocation on High Sierra
The version of sudo on macOS 10.13 High Sierra does not support the
`--preserve-env=LIST` option syntax, which is used here to preserve
PATH.

Override sudo with a shell function that checks for the availability of
this option syntax, and do not pass PATH otherwise.

Also move the prefix env command in the sudo invocations into the new
sudo function.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-22 14:40:13 +00:00
zowoq 0b638a97c0 users: fix forceRecreate bash comparison 2023-12-04 10:31:36 +10:00
Mike Hume 6c40798934 Adding reduce motion option 2023-12-01 15:10:10 -05:00
Michael HoangandGitHub 4b9b83d5a9 Merge pull request #806 from DeterminateSystems/easier-uninstall
Install darwin-uninstall by default, which includes the 'empty' config it switches to
2023-11-24 14:11:34 +11:00
Domen KožarandGitHub 7e8d292728 Merge pull request #819 from Enzime/update-nix
fix: tests failing to build on unstable Nix
2023-11-24 00:10:37 +01:00
Michael Hoang 49ae6b92ff fix: tests failing to build on unstable Nix
Use Nix 2.13.6 which is the default version for NixOS 23.05.
2023-11-24 09:53:59 +11:00
Domen KožarandGitHub c465a67a54 Merge pull request #809 from Enzime/more-hashes
etc: add more known hashes
2023-11-23 10:46:16 +01:00
Michael HoangandGitHub 6e0f4e58a6 Merge pull request #814 from aeolyus/master
[yabai] Configure scripting addition
2023-11-23 14:31:04 +11:00
Ethan Turkeltaub 72dd60bfc9 Add default system to systems option 2023-11-22 20:43:29 -05:00
Ethan Turkeltaub 6a3a683d43 Use nix.buildMachines.*.systems instead of nix.buildMachines.*.system 2023-11-22 20:43:28 -05:00
Ethan Turkeltaub a5812ff83c Add nix.linux-builder.systems option to set corresponding nix.buildMachines.*.systems option 2023-11-22 20:43:27 -05:00
Francesc EsplugasandMichael Hoang b2dff2033d fix: initdb missing data area directory
Use `PGDATA` environment variable instead of `-D` to maintain
consistency with NixOS module.

Co-Authored-By: Michael Hoang <enzime@users.noreply.github.com>
2023-11-23 11:00:33 +11:00
Michael HoangandGitHub fb9ed3f053 Merge pull request #810 from vegabook/issue_802_readme_flakes
Add flakes section reference in Installation section
2023-11-23 10:46:55 +11:00
vegabookandMichael Hoang 319104a125 Improve flakes documentation in README
Co-Authored-By: Michael Hoang <enzime@users.noreply.github.com>
2023-11-23 10:31:55 +11:00
Richard Huang 892482250c [yabai] Configure scripting addition
Allow admins to execute `yabai --load-sa` as the root user without
having to enter a password
2023-11-18 21:01:01 -08:00
Graham ChristensenandMichael Hoang 09284ab00b Install darwin-uninstall by default, which includes the 'empty' config it switches to
Co-Authored-By: Michael Hoang <enzime@users.noreply.github.com>
2023-11-16 17:47:24 +11:00
Michael Hoang d4efdb7f88 etc: add more known hashes
This should be less of an issue as of DetSys' nix-installer 0.15.0 which
no longer includes the version number in `nix.conf`.
2023-11-16 14:26:25 +11:00
Michael HoangandGitHub e67f2bf515 Merge pull request #803 from felixscheinost/fix-unbound-variable-etcProblems
Fix unbound variable `etcProblems`
2023-11-13 20:32:58 +11:00
Michael HoangandGitHub 0f1ad80138 Merge pull request #805 from yacinehmito/disable-pki
Add security.pki.installCACerts config
2023-11-11 23:03:48 +11:00
Yacine Hmito 4fa7b5cdd1 Add security.pki.installCACerts config
Made is possible to disable the management of
/etc/ssl/certs/ca-certificates.crt by Nix darwin.
2023-11-11 12:36:28 +01:00
Michael HoangandGitHub c8f385766b Merge pull request #799 from rawmannovak/fix-789-darwin-rebuild
fix(#798): darwin-rebuild support for Cyberark EPM
2023-11-10 09:31:29 +11:00
a4b4cf70dc Update pkgs/nix-tools/darwin-rebuild.sh
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2023-11-09 18:09:45 +01:00
Felix Scheinost 39a412d47d Fix unbound variable etcProblems
I have another activationScript which traps errors. Currently `etcProblems` can be unbound.
2023-11-09 12:44:10 +01:00
Domen KožarandGitHub eb2b9b6423 Merge pull request #785 from Enzime/deferred-modules
linux-builder: change from `modules` to `config`
2023-11-08 09:58:53 +00:00
Roman NovakandGitHub 26a59d504b fix(#798): darwin-rebuild support for Cyberark EPM
restore sudo environment PATH when Cyberark EPM is setting secure_path in sudo config. Fixes LnL7/nix-darwin/issues/798
2023-11-06 10:24:41 +01:00
Michael HoangandGitHub afe83cbc2e Merge pull request #791 from lilyball/linux-builder-tmpdir
linux-builder: avoid /tmp for certs
2023-10-27 19:55:34 +02:00
Michael HoangandGitHub 19f75c2b45 Merge pull request #795 from krostar/master
Provide 'supportedFeatures' option to the linux builder module
2023-10-19 14:53:14 +01:00
Alexis Destrez e621b5aea7 Provide 'supportedFeatures' option to the linux builder module 2023-10-18 17:47:27 +02:00
Lily Ballard 160eb3d99d linux-builder: avoid /tmp for certs
Fixes #768
2023-10-09 16:09:11 -07:00
Michael HoangandGitHub 8b6ea26d5d Merge pull request #777 from ppenguin/expose-more-config-attr
Expose _module attr in realised sysconfig
2023-10-04 05:06:51 +10:00
ppenguinandMichael Hoang 3d65d13974 expose _module attr in realised sysconfig
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2023-10-03 19:56:33 +01:00
Michael HoangandGitHub 792c2e0134 Merge pull request #783 from qowoz/activate-sudo
darwin-rebuild: add `-H` to sudo for `$systemConfig/activate`
2023-09-30 03:10:47 +00:00
Michael Hoang 70af808347 linux-builder: change from modules to config
Using the type `deferredModule` fixes `pkgs` not being accessible as a
module argument (apart from `config._module.args.pkgs`).
2023-09-29 12:38:39 +01:00
Michael HoangandGitHub e236a1e598 Merge pull request #187 from kalbasit/known-hosts-only-if-set
programs.ssh: write ssh known_hosts only if there are any set
2023-09-26 01:05:13 +01:00
zowoq ab817e5d0e darwin-rebuild: add -H to sudo for $systemConfig/activate 2023-09-25 14:02:52 +10:00
Michael HoangandGitHub c286b23c7f Merge pull request #676 from carlthome/patch-1
Use LocalHostName in darwin-rebuild with a flake
2023-09-23 00:12:26 +01:00
Michael HoangandGitHub b658dbd85a Update README 2023-09-22 16:17:42 +01:00
Michael HoangandGitHub afeddc412b Merge pull request #782 from LnL7/domenkozar-patch-1
Create $out/darwin-version
2023-09-19 11:13:39 +02:00
Domen KožarandGitHub 8caf3af927 Create $out/darwin-version
This fixes backwards compatibility with code that expects it.
2023-09-19 09:54:27 +01:00
Carl Thomé 6cd2f4cea2 Replace hostname with LocalHostName 2023-09-19 01:03:22 +02:00
Carl Thomé 22419fddf7 Use LocalHostName 2023-09-19 00:59:27 +02:00
Michael HoangandGitHub 80bb201f49 Merge pull request #781 from montchr/359-hide-upstream-timezone-error-output
time: bury confusing `systemsetup -settimezone` output
2023-09-15 22:38:38 +02:00
Chris Montgomery c8f0bc5c29 time: bury useless systemsetup -settimezone output
Fixes #359
2023-09-15 15:59:14 -04:00
Wael M. NasreddineandWael M. Nasreddine e58bcb921b programs.ssh: write ssh known_hosts only if there are any set 2023-09-15 08:24:20 -07:00
Wael M. Nasreddine 30311b6f90 services/yabai: Remove --check-sa and --install-sa flags
The --check-sa and --install-sa flags were removed in favor of
--load-sa as of version 5.0.0 of Yabai.

https://github.com/koekeishiya/yabai/blob/ee0137f37ded4309cb40b7f38817b5abd90fb592/CHANGELOG.md?plain=1#L83
2023-09-14 09:01:04 -07:00
Michael HoangandGitHub 4496ab2662 Merge pull request #771 from Benjamin-L/support-dfont-fonts
Add support for dfont to the fonts module
2023-09-12 07:50:42 +02:00
Michael HoangandGitHub ee999ab667 Merge pull request #776 from malob/add-homebrew-verbose-flag
Add `homebrew.onActivation.extraFlags` option
2023-09-12 07:46:14 +02:00
Malo Bourgon 0625792671 Add homebrew.onActivation.extraFlags option 2023-09-11 11:22:23 -07:00
Benjamin Lee ba92c4d307 add support for dfont to the fonts module 2023-09-08 15:43:25 -07:00
Jack Maloney 8e102a9991 a few fixes for ipfs module 2023-08-30 09:15:29 -05:00
Michael HoangandGitHub 511177ffe8 Merge pull request #765 from tnxz/master
add progress to homebrew package installations
2023-08-17 15:06:10 +10:00
runandGitHub ffccbdf7d8 add progress to homebrew package installations 2023-08-17 10:00:39 +05:30
Michael HoangandGitHub 3fcd83783a Merge pull request #761 from sevillaarvin/sevillaarvin-patch-1 2023-08-14 07:48:23 +10:00
d21a7e30e6 Update pkgs/darwin-installer/default.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2023-08-13 18:04:12 +08:00
Arvin SevillaandGitHub 5c22b241f7 chore(installer): capitalize the default option when reading user input 2023-08-13 16:54:23 +08:00
EmilyandGitHub 426d38710b Merge pull request #760 from qowoz/string
finder: `types.string` -> `types.str`
2023-08-10 05:01:37 +01:00
zowoq b671517f28 finder: types.string -> types.str
`string` was changed from deprecation warning to error in https://github.com/NixOS/nixpkgs/commit/c59c6b1c57da542b6b4af5d2ac27d1b99e7f0c5e
2023-08-10 13:46:47 +10:00
Michael HoangandGitHub 829041cf10 Merge pull request #755 from emilazy/fix-test-negations
tests: fix uses of `!`
2023-08-06 08:41:55 +10:00
Michael HoangandGitHub 8593ffb5de Merge pull request #758 from emilazy/babelfish-default
fish: add default for `babelfishPackage`
2023-08-06 08:32:26 +10:00
Emily 9d53926782 tests: fix uses of !
`set -e` does not trigger on negations, so none of these were
actually being tested (and one appears to have been incorrectly
negated all along).
2023-08-05 23:30:16 +01:00
Emily e2187d633c fish: simplify babelfishTranslate 2023-08-05 22:57:44 +01:00
Emily e65825ca9e fish: add default for babelfishPackage
This option should probably be dropped but I'd prefer to batch that
with using Babelfish by default (or unconditionally, as Home Manager
does) so as to avoid multiple independent breaking changes.

Fixes: #632
2023-08-05 21:36:54 +01:00
Michael HoangandGitHub e3c554fe50 Merge pull request #757 from aequitas/aequitas-patch-1
Fix example configuration for flake migration
2023-08-05 23:03:47 +10:00
Johan BloembergandGitHub dd73866955 Fix example configuration for flake migration 2023-08-04 22:18:10 +02:00
Emily 75c2925c57 release: give test derivations meaningful names 2023-08-03 09:47:40 +01:00
Michael HoangandGitHub d3529322dc Merge pull request #753 from lilyball/linux-builder-maxJobs
linux-builder: add maxJobs option
2023-08-03 07:36:24 +10:00
Lily Ballard 97e978626e linux-builder: add maxJobs option
Fixes #751
2023-08-02 12:33:34 -07:00
Michael HoangandGitHub 16c07487ac Merge pull request #749 from emilytrau/ofborg-logfile-description 2023-07-27 14:18:58 +10:00
Emily Trau 588303a21f fix: correct description of services.ofborg.logFile 2023-07-27 14:05:53 +10:00
Michael HoangandGitHub 94212ebe32 Merge pull request #163 from kubek2k/patch-1 2023-07-26 20:45:13 +10:00
6a00d1b59b Update modules/programs/bash/default.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2023-07-26 09:19:33 +02:00
Jakub JanczakandJakub Janczak e21b70da3f Don't run static bashrc only for pure nix-shell 2023-07-26 09:19:33 +02:00
Michael HoangandGitHub 1c1dd8b070 Merge pull request #595 from azuwis/sketchybar
sketchybar: init
2023-07-26 09:50:15 +10:00
Michael HoangandGitHub a96987cef4 Merge pull request #713 from pik694/master
Dock icon magnification settings
2023-07-26 09:44:43 +10:00
Piotr Żelazko 7ff10017ed chore: apply CR suggestions 2023-07-25 18:40:30 +02:00
Zhong Jianxin 56f56c80ef sketchybar: init
Fix #581
2023-07-25 18:58:56 +08:00
Michael HoangandGitHub efd35d99ce Merge pull request #748 from ryane/eternal-terminal-keep-alive
eternal-terminal: enable keep alive
2023-07-25 11:18:12 +10:00
ryane 9f8bc612c8 eternal-terminal: enable keep alive
See https://github.com/LnL7/nix-darwin/pull/745#discussion_r1272806159
2023-07-24 20:44:49 -04:00
EmilyandGitHub 6ed4eb544f Merge pull request #747 from LnL7/revert-744-set-module-class
Revert "eval-config: set `class`"
2023-07-24 23:51:24 +01:00
EmilyandGitHub a5b09580e2 Revert "eval-config: set class" 2023-07-24 23:24:20 +01:00
EmilyandGitHub 8f0e02cfc8 Merge pull request #744 from emilazy/set-module-class
eval-config: set `class`
2023-07-24 23:10:33 +01:00
EmilyandGitHub 03b811d7c9 Merge pull request #745 from ryane/eternal-terminal-module
eternal-terminal: add module
2023-07-24 23:10:15 +01:00
ryane c4a1a1c458 eternal-terminal: change launchd agent config
- don't daemonize program
- disable keep alive

these settings are consistent with the configuration in the project
repository:
https://github.com/MisterTea/EternalTerminal/blob/1d9cd2be9dc1ec7694e9472004b7910bbb5c34cf/init/launchd/homebrew.mxcl.et.plist
2023-07-24 17:50:26 -04:00
Piotr Żelazko 640331dfba docs: add magnification values range 2023-07-24 21:16:04 +02:00
ryane 6adc4c680b eternal-terminal: add module
Adds an eternal-terminal module. Much of the implementation is borrowed
from the corresponding nixos module:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/eternal-terminal.nix
2023-07-23 08:20:28 -04:00
Michael HoangandGitHub 0f9058e739 Merge pull request #733 from Enzime/version
Add `darwin-version` command
2023-07-23 18:16:13 +10:00
EmilyandGitHub ced9f58f87 Merge pull request #743 from emilazy/fix-enable-option-docs
treewide: fix `mkEnableOption` docs
2023-07-23 04:50:08 +01:00
Emily 5fd8914dac treewide: fix mkEnableOption docs
`mkEnableOption` wraps its argument in a complete sentence with a
terminating full stop; an additional newline will add an incorrect
space before the end of the sentence in the rendered documentation,
and any additional verbiage that doesn't fit into the form "Whether to
enable [...]." is also incorrect. In the latter case, the description
can be overridden manually.
2023-07-21 21:17:59 +01:00
Emily 724937461f eval-config: set class
See [the Nixpkgs manual]. This allows modules to declare themselves
as being only for NixOS or nix-darwin, reducing compatibility
risks. Unmarked modules will continue to behave as before. Technically
a breaking change, but any configuration importing a module explicitly
marked as NixOS-specific was probably broken already.

[the Nixpkgs manual]: https://nixos.org/manual/nixpkgs/unstable/#module-system-lib-evalModules-param-class
2023-07-21 09:22:21 +01:00
Emily 0d3ad9e7ff documentation: use eval-config.nix
Avoid letting the module evaluation for the documentation drift out
of sync with how system configurations are evaluated.
2023-07-21 09:22:21 +01:00
EmilyandGitHub 531c3de7ec Merge pull request #665 from quentinmit/fonts
Make font handling match NixOS
2023-07-20 05:02:34 +01:00
Quentin Smith f1a206c960 Merge remote-tracking branch 'origin/master' into fonts 2023-07-19 17:04:42 -04:00
EmilyandGitHub 61662a63bf Merge pull request #731 from emilazy/etc-checks
etc: check for existing files during checks stage
2023-07-16 15:16:07 +01:00
Emily 4eb1c549a9 etc: check for existing files during checks stage
This ensures that activation fails early if there are any `/etc` files
with unexpected state, rather than leaving the system half-activated.
2023-07-16 12:15:07 +01:00
Emily c91c351943 etc: rename activation script variables 2023-07-16 12:13:27 +01:00
Michael Hoang 0dafe2170d Add darwin-version command 2023-07-14 23:06:46 +10:00
EmilyandGitHub c806a73609 Merge pull request #739 from yusefnapora/yabai/extra-config-option-type
use `types.lines` for yabai.extraConfig option
2023-07-13 21:57:17 +01:00
Yusef Napora fbc47b7bbc use types.lines for yabai.extraConfig option
This allows setting the option definition in multiple locations.
The final value will be all definitions concatenated with `\n`.
2023-07-13 14:53:24 -04:00
Domen KožarandGitHub d468d4e813 Merge pull request #738 from Enzime/fix/workflows
workflows: use `nix-darwin` instead of `darwin`
2023-07-13 16:03:11 +01:00
Michael Hoang a86a6f8b71 workflows: use nix-darwin instead of darwin 2023-07-13 22:39:28 +10:00
EmilyandGitHub 2ad716c278 Merge pull request #732 from Enzime/use-nix-darwin
flake: use `nix-darwin` instead of `darwin`
2023-07-12 19:57:23 +01:00
Michael HoangandGitHub 795492c9a8 Merge pull request #736 from LnL7/domenkozar-patch-2
cachix-agent: clarify what should be in the token file
2023-07-13 02:09:20 +10:00
c80294ef26 Update modules/services/cachix-agent.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2023-07-12 16:46:02 +01:00
Domen KožarandGitHub adc6a88ff1 cachix-agent: clarify what should be in the token file 2023-07-12 15:11:49 +01:00
Domen KožarandGitHub 43ce086813 Merge pull request #734 from Enzime/uninstall-nix-apps
uninstaller: fix removing `/Applications/Nix Apps`
2023-07-12 13:02:28 +01:00
Michael Hoang 8eb09d4d0b uninstaller: fix removing /Applications/Nix Apps 2023-07-12 18:56:13 +10:00
Michael Hoang 4511c29a72 flake: use nix-darwin instead of darwin 2023-07-12 10:36:14 +10:00
EmilyandGitHub eb22022ba8 Merge pull request #687 from Enzime/flaky
Install nix-darwin on flake-based systems
2023-07-11 23:59:03 +01:00
Michael Hoang 63af129cb5 etc: use .before-nix-darwin instead of .orig 2023-07-12 08:35:36 +10:00
Michael Hoang ac9a366aed uninstaller: remove /Applications/Nix Apps 2023-07-11 18:59:05 +10:00
Michael Hoang cad8954f75 etc: fail if we can't add a file
Fixes #598
2023-07-11 18:59:05 +10:00
Michael Hoang 4b90ea84e4 doc: store a copy of known files 2023-07-11 18:59:05 +10:00
Michael Hoang 7881727017 installer: match flaky installation logic 2023-07-11 18:59:05 +10:00
Michael Hoang 22620845fe readme: update with new flaky instructions 2023-07-11 18:59:05 +10:00
Michael Hoang 5288a72354 Allow flaky installation with darwin-rebuild 2023-07-11 18:59:05 +10:00
Michael Hoang f70f90c422 flake: add packages.darwin-{option,rebuild} 2023-07-11 18:59:05 +10:00
Michael Hoang aeaafcc88a flake: add packages.darwin-uninstaller 2023-07-11 18:59:05 +10:00
Michael HoangandGitHub 83620edf49 Merge pull request #577 from 2xsaiko/outgoing/systembuildercommands
Add system.systemBuilderCommands and systemBuilderArgs
2023-07-11 00:30:59 +10:00
Marco Rebhan b70656affa Add system.systemBuilderCommands and systemBuilderArgs
These are the equivalents of the
NixOS options with the same name, introduced in
https://github.com/NixOS/nixpkgs/commit/d3ac0938a7a0ce6455fc580f16eb7476cca87dc6.
Allows running extra commands while building the system configuration
output, for example to add extra files into the output directory,
and passing arguments to the system builder's mkDerivation.
2023-07-10 16:05:55 +02:00
Michael HoangandGitHub 97d4a91029 Merge pull request #545 from amarshall/remove-nix-readonlystore
nix: Remove readOnlyStore option as it has no effect
2023-07-10 22:46:31 +10:00
Andrew Marshall 591446ca94 nix: Remove readOnlyStore option as it has no effect
This being under `nix` in upstream is misleading as it is only used in
the NixOS boot stage, not as configuration for the Nix daemon.
2023-07-10 08:30:38 -04:00
Andrew Marshall 4a7da05c1e Fix spelling 2023-07-10 08:30:15 -04:00
mitchmindtree 66f85cb9db trezord: Add launchd user agent service module for configuring trezord
This adds a small module for configuring the trezor-bridge service,
trezord. This service enables users to interact with their Trezor
hardware wallet through the trezor suite web interface, or to use the
device for U2F auth, SSH login, GPG or password mgmt.
https://trezor.io/learn/a/what-is-trezor-bridge

The options were copied directly from the nixos service module here:
https://github.com/NixOS/nixpkgs/blob/9d6e454b857fb472fa35fc8b098fa5ac307a0d7d/nixos/modules/services/hardware/trezord.nix#L16

The implementation was adapted from the nixos module's systemd service
to a launchd user agent.

Tested successfully locally on an Air M2.
2023-07-10 19:21:10 +10:00
EmilyandGitHub 90ae979e35 Merge pull request #488 from cuichenli/fix-zsh-issue
fix zsh eating output without new line ending
2023-07-10 08:12:58 +01:00
Cuichen Li 8364529fc4 fix zsh eating output without new line ending 2023-07-10 15:00:02 +08:00
Daiderd JordanandGitHub 66a3047fa8 Merge pull request #723 from emilazy/rationalize-nixpkgs-handling
Rationalize handling of Nixpkgs
2023-07-09 12:34:19 +02:00
Emily f9724c4543 eval-config: rationalize handling of Nixpkgs
This is a big change that disentangles a lot of mistaken assumptions
about mixing multiple versions of Nixpkgs, treating external flake
inputs as gospel for the source of Nixpkgs and nix-darwin, etc.;
the end result should be much simpler conceptually, but it will be a
breaking change for anyone using `eval-config.nix` directly. Hopefully
that shouldn't be a big issue, as it is more of an internal API and
it's quite likely that existing uses may have been broken in the same
way the internal ones were.

It was previously easy to get into a state where your `lib` comes
from nix-darwin's `nixpkgs` input or a global channel and your
`pkgs` comes from another major version of Nixpkgs. This is pretty
fundamentally broken due to the coupling of `pkgs` to its corresponding
`lib`, but the brokenness was hidden much of the time until something
surfaced it. Now there is exactly one mandatory `lib` input to system
evaluation, and the handling of various additional options like `pkgs`
and `system` can be done modularly; maintaining backwards compatibility
with the previous calling convention is punted to the `default.nix`
and `lib.darwinSystem` entry points. `inputs` is no longer read by
nix-darwin or special in any way, merely a convention for user code,
and the argument is retained in the entry points only for backwards
compatibility.

All correct invocations of the entry points should keep working
after this change, and some previously-broken ones should be fixed
too. The documentation and template have been adjusted to show the
newly-recommended modular way of specifying various things, but no
deprecation warnings have been introduced yet by this change.

There is one potential, mostly cosmetic regression:
`system.nixpkgsRevision` and related options are less likely to be
set than before, in cases where it is not possible to determine the
origin of the package set. Setting `nixpkgs.source` explicitly will
make this work again, and I hope to look into sending changes upstream
to Nixpkgs to make `lib.trivial.revisionWithDefault` behave properly
under flakes, which would fix this regression and potentially allow
reducing some of the complexity.

Fixes: #669
2023-07-09 11:21:40 +01:00
Emily 51ba5e614a version: rewrite Git revision logic
We trust the version information from `nixpkgs.source` when `pkgs` was
constructed by the `nixpkgs` module or `nixpkgs.source` was explicitly
set by the configuration. Otherwise, we rely on Nixpkgs to report its
own version, which handles the same cases as the old logic and opens
the door to Nixpkgs automatically reporting the correct revision when
using flakes.
2023-07-09 07:26:23 +01:00
Emily 72b7e8668c version: default Git revision options to null
This allows for more uniform handling in the documentation generator,
and avoids lying about the Git reference being `master` internally.
2023-07-09 07:26:00 +01:00
Daiderd JordanandGitHub 4e3fc18647 Merge pull request #724 from Enzime/fix/darwin-builder
linux-builder: fix evaluation errors
2023-07-09 08:02:16 +02:00
Michael Hoang d9e825f121 linux-builder: fix evaluation errors
- `modules` cannot be a nested list
- `nix.settings.extra-trusted-users` might not be set
2023-07-09 13:55:22 +10:00
Domen KožarandGitHub 4272af4079 Merge pull request #684 from Enzime/add/linux-builder
nix/linux-builder: init
2023-07-09 00:00:48 +01:00
Emily e25eeff158 nixpkgs: rebase module on latest NixOS
This is based on the current NixOS `nixpkgs` module, adjusted for the
nix-darwin context and without adding the options due for deprecation
in NixOS.

This gives us the ability to set the package set modularly through
`nixpkgs.pkgs` and builds up infrastructure for handling user-specified
Nixpkgs instantiations more robustly.

The cross-compilation options are currently not very useful due to
even Darwin->Darwin cross-compilation not being wholly functional
yet, but it looks feasible to build an `aarch64-darwin` system from
`x86_64-darwin` with some patching and it should be possible to make
cross-compilation more widely supported after the Darwin SDK situation
in Nixpkgs improves.

One casualty is the error for setting `nixpkgs.*` options when
overriding the package set. That could be ported over to this new
scheme, but it'd increase divergence with the NixOS module and reduce
cross-compatibility of configurations, so I lean towards adding it
upstream to NixOS if anything. (But if people want to keep it I can add
it back.)
2023-07-08 22:39:19 +01:00
Emily 2d20e86111 documentation: use feature test for docs generator
This should be less brittle than the version-based check, although
arguably this kind of `lib.version` mismatch should break as early
as possible...

Fixes: #718
2023-07-08 21:04:34 +01:00
Michael Hoang d2b01ab455 nix/linux-builder: init 2023-07-08 14:05:37 +10:00
Domen KožarandGitHub b06bab83bd Merge pull request #711 from Enzime/fix/magicdns
tailscale: improve MagicDNS setup
2023-07-02 15:17:20 +01:00
Domen KožarandGitHub 43587cdb72 Merge pull request #714 from lovesegfault/rebuild-refresh
feat(darwin-rebuild): support --refresh
2023-06-30 18:23:00 +01:00
Domen KožarandGitHub 48b07e266b Merge pull request #717 from hercules-ci/fix-doc-revision
Fix doc revision eval error
2023-06-30 18:22:09 +01:00
Robert Hensing 89ec258c7c documentation: Link to nixpkgs master if rev is unknown
This fixes

    error: The option `system.nixpkgsRevision' is used but not defined.
2023-06-30 02:14:35 +02:00
Robert Hensing d207fa6091 default.nix: Use nixpkgs.rev if it is set
This increases the odds of automatically setting system.nixpkgsRevision,
which makes the links in the manual nice.
2023-06-30 02:13:09 +02:00
Bernardo Meurer 9af7fe60b6 feat(darwin-rebuild): support --refresh
This flag allows forcing remote flakes (e.g. `github:foobar/nix-config`)
to be force-refreshed, which is required for quickly
iterating/activating a remote config.
2023-06-28 12:47:32 -04:00
Piotr Żelazko 8c1c48c87a feat: add dock icon magnification settings 2023-06-27 16:44:16 +02:00
Michael Hoang d2b70c61bf tailscale: improve MagicDNS setup 2023-06-27 01:38:51 +10:00
Daiderd Jordan 25ae710ba3 also update README in gh-pages 2023-06-25 13:07:55 +02:00
Daiderd Jordan cb37c35e33 fix darwin-option descriptions
Also drops the eval hacks in favour of jq.
2023-06-25 13:03:52 +02:00
Daiderd JordanandGitHub 53c6748f98 Merge pull request #675 from serokell/rvem/update-buildkite-module
buildkite-agent: fix launchd daemon environment
2023-06-25 10:52:13 +02:00
Daiderd JordanandGitHub de8a019304 Merge pull request #710 from emilazy/fix-manual-ci
ci: update manual updater to 23.05
2023-06-25 10:12:53 +02:00
Emily a62f16b94d readme: update links for redirect 2023-06-25 06:43:54 +01:00
Emily df03a145b3 ci: update manual updater to 23.05
Fix https://github.com/LnL7/nix-darwin/issues/709.
2023-06-25 06:43:54 +01:00
Daiderd JordanandGitHub ace0ef2a26 Merge pull request #707 from emilazy/options-markdown-migration
Migrate option documentation to Markdown
2023-06-24 23:42:39 +02:00
Emily 9d6702cf2b eval-config: remove compatibility shims
20.03 and 22.03 are both deprecated.
2023-06-24 10:48:55 +01:00
Emily 42d1643e7a {ci,readme}: update stable nixpkgs to 23.05
22.11 is deprecated and can no longer generate the manual.
2023-06-24 10:48:55 +01:00
Emily 69648c6cbb doc/manual: use nixos-render-docs
Now that all the DocBook documentation is gone, we can switch to the
new NixOS documentation generator. No meaningful change in HTML output,
except that I removed the rather pointless preface and changed the
title accordingly. Manual page output is greatly improved; it was
kind of broken before. The `sed` hack is pretty gross but I have
confirmed that nixpkgs will be happy to accept a PR to make things
a little more customizable.

This also drops the `manual` alias (deprecated in nixpkgs in 2018
and imported into nix-darwin), and `manualEpub` (because the NixOS
documentation generator doesn't support it and also nobody wants this
as an ebook).
2023-06-24 10:48:55 +01:00
Emily d37abf456b flake.nix: remove the nixpkgs pin
The Markdown transition is over and our compatibility with
`nixpkgs-unstable` is restored.
2023-06-24 10:48:55 +01:00
Emily 2903ceabb5 doc/manual: remove optionsDocBook export 2023-06-24 10:48:55 +01:00
Emily e65131e69c treewide: convert all option docs to Markdown
This process was automated by [my fork of `nix-doc-munge`]; thanks
to @pennae for writing this tool! It automatically checks that the
resulting documentation doesn't change, although my fork loosens
this a little to ignore some irrelevant whitespace and typographical
differences.

As of this commit there is no DocBook remaining in the options
documentation.

You can play along at home if you want to reproduce this commit:

    $ NIX_PATH=nixpkgs=flake:nixpkgs/c1bca7fe84c646cfd4ebf3482c0e6317a0b13f22 \
      nix shell nixpkgs#coreutils \
      -c find . -name '*.nix' \
      -exec nix run github:emilazy/nix-doc-munge/0a7190f600027bf7baf6cb7139e4d69ac2f51062 \
      {} +

[my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge
2023-06-24 10:48:55 +01:00
Emily efe314cdba treewide: manually convert some docs to Markdown
These all use DocBook markup too complex for `nix-doc-munge` to handle,
have syntax that clashes with Markdown, or already contain Markdown
syntax that currently isn't rendering correctly.

Converting DocBook list syntax makes me think that maybe Markdown
isn't so bad after all.
2023-06-24 10:48:55 +01:00
Emily c2716817a8 {offlineimap,tailscale}: fix enable option docs
The argument to `mkEnableOption` is automatically wrapped in a full
sentence.
2023-06-24 10:48:55 +01:00
Emily b97c235e37 treewide: tweak DocBook docs for conversion
These help `nix-munge-doc` automate more of the Markdown conversion
process. See the following nixpkgs commits for explanations of many
of these changes:

* https://github.com/NixOS/nixpkgs/commit/275a34e0d8a937a81b267e47302dd8a92fa781df
* https://github.com/NixOS/nixpkgs/commit/694d5b19d30bf66687b42fb77f43ea7cd1002a62
* https://github.com/NixOS/nixpkgs/commit/f1d39b6d6187997b630647400c5efe5b01e06a23
* https://github.com/NixOS/nixpkgs/commit/16102dce2fbad670bd47dd75c860a8daa5fe47ad

I couldn't think of any particularly good way to format the
`system.defaults` breadcrumbs, so I just made them standalone
paragraphs. They weren't rendering correctly in DocBook anyway.
2023-06-24 10:48:55 +01:00
Emily 76ce9faca6 doc/manual: use nixosOptionDoc
The only change to `options.json` are that the `declarations` fields
now contain correct GitHub URLs.

The changes to the HTML manual are all either strict improvements:

* "Declared by:" links point to the correct URLs.
* `lib.mdDoc` documentation is included.

or else trivial:

* Additional whitespace in the HTML source.
* Some interchange of `<pre class="programlisting">` and
  `<code class="literal">`.
* Fancy quotes used in some type descriptions.

`optionsDocBook` is exported temporarily as it is used by
`nix-doc-munge` for the Markdown conversion process.

This drops support for building the manual on 22.11, which lacks a
complete implementation of this processor, and provides stubbed-out
manual packages with an explanation on that version.
2023-06-24 10:48:55 +01:00
Emily 96cb49133b wq-quick: document publicKey option
All exposed options should have documentation, and `nixosOptionDoc`
will give an error if it's missing.
2023-06-24 10:48:55 +01:00
Emily f8c61f0098 flake.nix: add checks for the docs
Except for `manualEpub`, which is going away.
2023-06-24 09:03:26 +01:00
Emily b6893e7f6d eval-config: remove lib.mdDoc
The temporarily pinned nixpkgs version already has this version,
and where we're going, we don't need backports.

This reverts commit 737cfdec9c.
2023-06-24 06:33:18 +01:00
Emily b7ccefadf9 flake.nix: temporarily pin nixpkgs version
This is the last bump of the nixpkgs-unstable channel before the
DocBookalypse.
2023-06-24 06:33:18 +01:00
Daiderd JordanandGitHub 6460468e7a Merge pull request #706 from qowoz/defaults
activity monitor: change settings to null
2023-06-23 12:57:17 +02:00
zowoq fbb3ab94e6 activity monitor: change settings to null
treewide these seem to be the only settings that aren't unset by default which seems inconsistent
2023-06-23 20:29:46 +10:00
Domen KožarandGitHub bc346a67d3 Merge pull request #704 from emilazy/readd-mddoc
eval-config.nix: readd `lib.mdDoc` temporarily
2023-06-21 23:12:02 +01:00
Emily 737cfdec9c eval-config.nix: readd lib.mdDoc temporarily
Fixes: #701
2023-06-21 22:55:32 +01:00
Roman Melnikov f253b41de8 buildkite-agent: fix launcd daemon environment
Add missing 'NIX_SSL_CERT_FILE'
2023-06-21 09:35:41 +02:00
Daiderd JordanandGitHub ed275afbba Merge pull request #671 from sxyazi/pr-e0f2168d
Add `mouseDriverCursorSize` option
2023-06-20 21:55:53 +02:00
Daiderd JordanandGitHub 050da23813 Merge pull request #672 from sxyazi/pr-af01ed5d
Add `AppleScrollerPagingBehavior` option
2023-06-20 21:55:28 +02:00
Daiderd JordanandGitHub 689aa795a1 Merge pull request #673 from sxyazi/pr-4df4da65
feat: add `AppleWindowTabbingMode` option
2023-06-20 21:52:47 +02:00
Daiderd JordanandGitHub 681c152eea Merge pull request #679 from dbaynard/patch-1
Document font overriding behaviour
2023-06-20 21:38:47 +02:00
Daiderd JordanandGitHub 1b57241a7b Merge pull request #686 from CathalMullan/master
nix: Add build machines protocol option.
2023-06-20 21:19:39 +02:00
Daiderd JordanandGitHub 1eab97fe04 Merge pull request #689 from cherryblossom000/patch-1
docs: clarify how to use inputs with flakes
2023-06-20 21:12:39 +02:00
Daiderd JordanandGitHub 1a625c193d Merge pull request #696 from toonn/bump-actions
GHActions: Bump install-nix-action to v22
2023-06-20 21:09:17 +02:00
toonn cd87d92320 GHActions: Bump install-nix-action to v22
Not all workflows were updated but some were, this fixes the
inconsistency.
2023-06-18 20:03:45 +02:00
Domen KožarandGitHub 8a5af0da9d Merge pull request #695 from jmmaloney4/master
add ipfs service
2023-06-18 18:46:33 +01:00
Domen KožarandGitHub 1759eb2699 Merge pull request #688 from Enzime/add/template
flake: add template with basic flake config
2023-06-18 18:45:30 +01:00
Jack Maloney 1711db734e add ipfs service 2023-06-18 00:44:04 -05:00
Michael Hoang 8d13a55f1c workflows: fix Nix install on macos-12 2023-06-17 22:57:44 +10:00
Michael Hoang f532e43f7e templates.flake: add contents of simple.nix 2023-06-17 22:57:44 +10:00
Michael Hoang fc955520dd flake: add template with basic flake config 2023-06-17 22:09:38 +10:00
Lauren YimandGitHub 1fc5d125fb docs: clarify how to use inputs with flakes
This commit clarifies that in order to access `inputs` in a host configuration, the `inputs` argument must be used. This commit also documents how `specialArgs` can be used to access the inputs as arguments directly.
2023-06-12 16:08:03 +10:00
Cathal Mullan 51b8bdfc0e nix: Add build machines protocol option. 2023-06-10 13:44:37 +01:00
Domen KožarandGitHub 7c16d31383 Merge pull request #685 from Enzime/fix/run
darwin-installer: fix `/run` not getting created
2023-06-09 11:44:53 +01:00
Michael Hoang 1ba9ae3d21 darwin-installer: fix /run not getting created 2023-06-09 15:25:55 +10:00
Domen KožarandGitHub 40e4b85baa Merge pull request #681 from cole-h/auto-uid
system/checks: allow disabling the buildUsers check
2023-06-08 08:42:41 +01:00
Domen KožarandGitHub 5c671dd10f Merge pull request #677 from Enzime/fix/ssh-pubkeys
ssh: fix public keys in home directory not working
2023-06-08 08:41:09 +01:00
Michael Hoang 257b5c1994 ssh: fix public keys in home directory not working
Added `services.openssh.authorizedKeysFiles` option from NixOS.
2023-06-08 15:44:07 +10:00
Cole Helbling 9c7a07b8b2 system/checks: allow disabling the buildUsers check
This allows systems with auto-allocate-uids enabled to work (by
disabling this check).
2023-06-06 16:21:14 -07:00
David BaynardandDavid Baynard d20ba9bf9c Document font overriding behaviour 2023-06-01 22:21:31 +01:00
Domen KožarandGitHub 4338bc869e Merge pull request #404 from jsoo1/no-checking-channels-with-flakes
flakes: Do not verify channels when using flakes.
2023-05-31 20:59:30 +02:00
John Soo add08fcab0 flakes: Do not verify channels when using flakes. 2023-05-31 07:28:23 -06:00
sxyazi cfcfcc535e feat: use enum instead of str for constraints nicer 2023-05-27 01:42:42 +08:00
sxyazi df00ca18a3 feat: add AppleWindowTabbingMode option 2023-05-27 01:37:34 +08:00
sxyazi ce785ccacf feat: add AppleScrollerPagingBehavior option 2023-05-27 01:02:23 +08:00
sxyazi 7bf15660ca fix: type 2023-05-27 00:37:51 +08:00
sxyazi 0ad226e8c3 feat: add mouseDriverCursorSize option 2023-05-27 00:13:47 +08:00
Daiderd JordanandGitHub b8c286c82c Merge pull request #616 from gshpychka/patch-1
feat: support writing arrays to system defaults
2023-05-22 19:02:28 +02:00
Daiderd JordanandGitHub 57094eaf5a Merge pull request #641 from lockejan/update-ci
Update ci and introduce matrix builds against stable and unstable
2023-05-22 18:42:29 +02:00
Jan Schmitt ebdd18cdc1 ci: refactor to several jobs to enable optional checks 2023-05-19 13:33:38 +02:00
Quentin Smith bc776e4940 Match nixos handling of fonts.fonts by looking for .ttf, .ttc, and .otf files in any directory in the passed packages 2023-05-17 20:31:24 -04:00
Daiderd JordanandGitHub dfbdabbb3e Merge pull request #661 from serokell/rvem/change-buildkite-agent-runtimePackages-option
buildkite-agent: allow 'types.path' in runtimePackages
2023-05-17 19:16:52 +02:00
Daiderd JordanandGitHub bd8694d0e1 Merge pull request #643 from hraban/feat/menuextra
feat: defaults write com.apple.menuextra.clock
2023-05-17 19:07:53 +02:00
Roman Melnikov 6236fd1923 buildkite-agent: allow 'types.path' in runtimePackages
This might be useful when some non-nix packages need to be provided,
e.g. 'brew'.
2023-05-16 15:58:30 +08:00
Hraban Luyat f1a562eef1 refactor: rename clock option menuExtraClock 2023-05-15 13:44:02 -04:00
Hraban Luyat f6b7489ddb feat: defaults write com.apple.menuextra.clock 2023-05-15 13:13:18 -04:00
Domen KožarandGitHub 0dbf1c2fb1 Merge pull request #654 from shivaraj-bh/authorized-keys
Manage SSH authorized keys for users
2023-05-15 11:59:31 +01:00
sbh69840 3d22883cdb add tests 2023-05-14 13:20:13 +05:30
Daiderd JordanandGitHub 252541bd05 Merge pull request #638 from aerialls/screensaver
feat(screensaver): add support of askForPassword and askForPasswordDelay
2023-05-10 23:42:22 +02:00
Daiderd JordanandGitHub 25e28fedda Merge pull request #650 from amarshall/fix-registry-extra-attrs
nix: Fix registry extra attrs not being applied
2023-05-10 23:26:18 +02:00
Daiderd JordanandGitHub 5061eb4557 Merge pull request #612 from maljub01/patch-1
Fix system.patches
2023-05-10 23:22:40 +02:00
sbh69840 f781cb0ac5 give credits 2023-05-10 21:39:27 +05:30
sbh69840 4094dbccde newline eof for authorized-keys conf 2023-05-10 21:30:35 +05:30
sbh69840 ab2e16159f authkeys path in sshd_config 2023-05-10 21:16:52 +05:30
sbh69840 ccaa942888 don't check knownSha256 for authorized_keys files 2023-05-10 20:03:21 +05:30
sbh69840 ecb5840f6b enable copy 2023-05-10 19:35:23 +05:30
sbh69840 64a15676ac support authorized_keys for users 2023-05-10 19:28:00 +05:30
Domen KožarandGitHub 9520a6e483 Merge pull request #653 from serokell/rvem/update-buildkite-module
buildkite-agent: update module
2023-05-10 12:55:34 +01:00
Roman Melnikov da2c0a74ca buildkite-agent: update module
Update module to look it similar to what it currently present in
'nixpkgs'. Mainly, to provide support for running multiple
buildkite-agents.
2023-05-10 16:26:20 +08:00
Andrew Marshall fa97d79567 nix: Fix registry extra attrs not being applied
This was
    mkDefault { } // filterAttrs () x

which is interpreted as
    (mkDefault { }) // (filterAttrs () x)

but the intention is
    mkDefault ({ } // filterAttrs () x)

Resulting in lastModified, rev, etc. not being included. This is
essentially just bringing this clause up-to-date with the one from
NixOS.
2023-05-04 23:53:14 -04:00
Julien Brochet 2303eed571 feat(screensaver): add support of askForPassword and askForPasswordDelay 2023-04-30 14:11:40 +02:00
Domen KožarandGitHub 379d42fad6 Merge pull request #600 from konradmalik/uri-builder-fix
fix: add '://' to built flake uri
2023-04-29 14:58:27 +02:00
Konrad Malik 597c723f1c test: added a test to run build with git+file schema
Based on a PR by @reckenrode
2023-04-29 14:49:06 +02:00
Konrad Malik d0e36622c1 fix: in URI use proper groups 2023-04-29 14:49:06 +02:00
Konrad Malik fad0282b5f add '://' to built flake uri 2023-04-29 14:49:06 +02:00
Jan Schmitt d222200091 ci: use latest stable channel 22.05 -> 22.11
* use matrix build to run tests against latest stable and unstable
  channel
* add descriptions to github action steps
2023-04-28 13:26:11 +02:00
Jan Schmitt a379f9afe7 docs: update flake snippet to 22.11 2023-04-28 13:26:04 +02:00
Jan Schmitt 8c9337e286 ci: bump actions to most recent version
* use checkout@v3 and install-nix-action@20
2023-04-26 23:01:01 +02:00
Domen KožarandGitHub a1ee4d333b Merge pull request #624 from lovesegfault/repeated-fonts
fix(modules/fonts): ignore repeated fonts
2023-04-20 18:57:12 +02:00
Domen KožarandGitHub b5e76074be Merge pull request #637 from quentinmit/launchd
Add/fix some launchd.plist options
2023-04-20 18:56:12 +02:00
Domen KožarandGitHub f7051807b9 Merge pull request #634 from Enzime/synergy-tls
synergy: add options for TLS
2023-04-20 18:55:42 +02:00
Quentin Smith 73ab8e0d70 Add/fix some launchd.plist options 2023-04-19 16:09:53 -04:00
Michael Hoang 90b36a5efe synergy: add options for TLS 2023-04-18 14:31:42 +09:00
Domen KožarandGitHub 025912529d Merge pull request #625 from Enzime/improve-karabiner-elements
Improve Karabiner-Elements installer reliability
2023-04-10 20:19:54 +01:00
Domen KožarandGitHub 99d4187d11 Merge pull request #620 from metafates/master
fix(wg-quick): builtins function typo
2023-03-31 13:49:23 +01:00
Michael Hoang e5c994a6af Improve Karabiner-Elements installer reliability
Hopefully fixes #564
2023-03-29 22:27:28 +09:00
Bernardo Meurer 0cf7d41389 fix(modules/fonts): ignore repeated fonts
Without this, attempts to build the fonts dir with repeated font
packages in `fonts.fonts` will yield:

```
ln: failed to create symbolic link '/nix/store/6im9rm87nxc82nqbv350hfp2w7ja1z47-fonts/Library/Fonts/IBMPlexSansThai-Thin.otf': File exists
```
2023-03-28 14:41:20 -03:00
VadimandGitHub 8699abe98f fix(wg-quick): builtins function typo 2023-03-21 13:23:16 +03:00
Glib ShpychkaandGitHub 9f93b19585 feat: support writing arrays to system defaults 2023-03-14 14:50:10 +02:00
Marwan AljubehandGitHub ca62d93c6c Only use --force for patches applied in reverse
Using `--forward` already instructs `--patch` to ignore patches that it thinks are reversed or already applied.
2023-03-07 13:37:18 +00:00
Marwan AljubehandGitHub 42e0e4f3b4 Add --force to all patch invocations 2023-03-07 13:35:24 +00:00
Marwan AljubehandGitHub e62b83a934 Fix system.patches
Currently, `system.patches` doesn't work because it will attempt to first detect if the patch has already been applied by checking if it can be applied in reverse.

However, when that happens, `patch` detects that the supplied patch is incorrectly reversed and attempts to ask the user if they want to "Ignore -R":

```
Unreversed (or previously applied) patch detected!  Ignore -R? [y]
```

Because the output is piped to `/dev/null` the user will basically see nothing and `darwin-rebuild switch` will hang until the user presses "Enter" (possibly to check if the terminal is frozen). At which point, patch will ignore the --reverse and exit successfully, preventing the patch from being applied at all.

This change fixes that bug by using `--force` which tells patch that we know what we're doing and prevents it from prompting the user if they want to ignore `--reverse`.
2023-03-07 12:53:20 +00:00
Domen KožarandGitHub 87b9d090ad Merge pull request #550 from n8henrie/issue_549
Add support for submodules in flakes
2023-01-09 20:10:39 +00:00
Domen KožarandGitHub 3db1d870b0 Merge pull request #586 from hercules-ci/add-hercules-ci-agent
Add `services.hercules-ci-agent`
2023-01-03 13:46:21 +00:00
Robert Hensing 7ec26a9042 services.hercules-ci-agent: Explain default concurrentTasks is core count 2022-12-29 19:01:54 +01:00
Domen KožarandGitHub 267040e7a2 Merge pull request #583 from chloelyn/docs/readme
Remove inaccurate notice that the uninstaller uninstalls Nix
2022-12-24 14:11:58 +00:00
Robert Hensing 5311f8ded0 hercules-ci-agent: Remove old nix version check
This problem is multiple releases in the past now. It has served
its purpose.
2022-12-22 20:18:53 +01:00
Robert Hensing 3cb5cfa5f9 hercules-ci-agent: init
Source files originate from the hercules-ci-agent repository and
I will make sure to keep them in sync, bidirectionally.

The module is split into two files to make maintenance of the
common parts with NixOS easier.
2022-12-22 20:18:53 +01:00
Robert Hensing 617604488e Add meta.maintainers option 2022-12-22 20:18:53 +01:00
Alaina Newmark 023af2a1a2 Remove inaccurate notice for uninstaller in README 2022-12-20 15:36:30 -06:00
Domen KožarandGitHub adb8ac0453 Merge pull request #452 from psm14/mouse-scaling
add mouse scaling system setting
2022-12-16 13:07:17 +00:00
Domen KožarandGitHub 7e7498acfe Merge pull request #580 from sliminality/add-24h-time
Add option to use 24-hour system time
2022-12-16 13:06:46 +00:00
Domen KožarandGitHub 2795e05cca Merge pull request #468 from lf-/postgres-update
services/postgresql: update to the latest upstream nixos module
2022-12-14 12:28:02 +00:00
Domen KožarandGitHub 852f451fee Merge pull request #578 from saccarosium/rebuild-flake-no-out-link
Rebuild flake no out link, like #310 but with latest master
2022-12-14 10:56:22 +00:00
Domen KožarandGitHub d308c2b35a Merge pull request #575 from 4825764518/wg-quick
Add wg-quick module
2022-12-14 10:54:36 +00:00
Nathan Henrie e3c24b5e0c Test submodule support 2022-12-14 03:45:00 -07:00
Nathan HenrieandNathan Henrie 5452c8c638 Add support for submodules in flakes
Fixes https://github.com/LnL7/nix-darwin/issues/549
2022-12-14 03:44:26 -07:00
Slim Lim 6774344719 Add option to set 24-hour time
Normally, the system region setting determines whether the clock uses
12- or 24-hour time. This flag allows users to override this setting and
use 24-hour time even if their region does not.
2022-12-13 15:42:25 -08:00
saccarosium 38463b15ec darwin-rebuild: fixing logic error in if statement 2022-12-08 10:00:51 +01:00
saccarosium da843c0dde darwin-rebuild: use --no-link for flake builds 2022-12-08 09:48:45 +01:00
4825764518 c148d28c67 Add wg-quick module 2022-12-02 20:55:53 -05:00
Domen KožarandGitHub 6349b99bc2 Merge pull request #568 from lockejan/docs/readme
update flake example in readme and flake.lock
2022-11-18 15:15:20 +00:00
Jan Schmitt 34c4a4cf90 chore: update flake.lock 2022-11-18 08:39:53 +01:00
Jan Schmitt 7d0d40ed26 docs: update flake input for example 2022-11-18 08:39:52 +01:00
Domen KožarandGitHub 4182ad42d5 Merge pull request #553 from n8henrie/issue_543
Add system terminfo to TERMINFO_DIRS by default
2022-11-15 17:44:04 +00:00
Jade Lovelace c9fcec4b6b services/postgresql: update to the latest upstream nixos module
I want a newish postgres config to work on my Mac.

This contains a little hack (putting the check-config derivation into
the start script as a comment) to deal with not having #356.

It's otherwise identical to the upstream module.
2022-11-10 13:13:10 -08:00
Domen KožarandGitHub cfc0125eaf Merge pull request #544 from PhotonQuantum/fix-darwin-rebuild
Fix darwin rebuild fails with flake and dry-run
2022-11-02 20:11:24 +00:00
Domen KožarandGitHub b717703064 Merge pull request #561 from rockofox/patch-1
Correct capitalisation of NixOS
2022-11-01 09:17:57 +00:00
Domen KožarandGitHub 21791d4c01 Merge pull request #470 from toonn/berbiche-fix-applications-symlink
Disable taking control of ~/Applications folder MkII
2022-11-01 09:17:24 +00:00
rockofoxandGitHub 64fbf13a8f Correct capitalisation of NixOS
Spell NixOS with capital OS like it's on the official website, etc. This is just a really small change, but it just bugs me :p
2022-10-26 14:37:53 +02:00
Domen KožarandGitHub f6648ca069 Merge pull request #560 from pshirshov/fix/broken-fontrestore
fixes #559, #485: workaround for broken fontrestore on Ventura
2022-10-26 10:20:05 +01:00
Pavel Shirshov f34b284d3f fixes #559, #485: workaround for broken fontrestore on Ventura 2022-10-25 22:01:55 +01:00
Domen KožarandGitHub 0f90e1c34c Merge pull request #557 from pshirshov/wip/custom-defaults-writes
Custom defaults writes
2022-10-24 14:23:03 +02:00
Pavel Shirshov c946ee42fa #517: custom preferences for 'defaults' can be specified 2022-10-24 13:12:54 +01:00
Domen KožarandGitHub 8be7f19712 Merge pull request #552 from Ma27/fix-manual
Fix manual by escaping `&quot;` as well
2022-10-23 12:00:27 +02:00
Nathan Henrie 6b73d2c605 Type: TERMINFO_DIRS not TERMINFO 2022-10-20 14:49:26 -06:00
Nathan Henrie ed993c5038 Add system terminfo to TERMINFO_DIRS by default 2022-10-19 15:09:28 -06:00
Maximilian Bosch 115ab9a0b1 Fix manual by escaping &quot; as well
See https://github.com/NixOS/nixpkgs/issues/196651 for context.

NOTE: untested because I haven't found a quick way to build the manual
without building a nix-darwin configuration.
2022-10-19 18:50:52 +02:00
LightQuantum 184f30c864 Fix darwin rebuild fails with flake and dry-run 2022-10-10 20:24:46 +08:00
Domen KožarandGitHub ef56fd8979 Merge pull request #540 from thefloweringash/mandatory-features
nix: fix mandatoryFeatures in nix.buildMachines
2022-10-10 11:07:41 +02:00
Andrew Childs d0121790d4 nix: fix mandatoryFeatures in nix.buildMachines
Copied directly from https://github.com/NixOS/nixpkgs/pull/193404
2022-10-03 12:33:21 +09:00
Daiderd JordanandGitHub 02d2551c92 Merge pull request #534 from zwhitchcox/patch-1
Add comma for clarity
2022-09-26 18:34:24 +02:00
Domen KožarandGitHub 95ba7e548d Merge pull request #536 from DeterminateSystems/runcommand
Fix nix-darwin with recent nixpkgs
2022-09-26 00:06:28 +02:00
Graham Christensen 07f640580b rename the nixFlakes reference 2022-09-25 15:43:15 -04:00
Zane HitchcoxandGitHub 2ee7b84e6b remove duplicate "to be" 2022-09-25 15:11:18 -04:00
James Walker a2a9f30fee rename runCommandNoCC 2022-09-25 14:12:08 -04:00
Zane HitchcoxandGitHub 3e28ca913f Add comma for clarity 2022-09-25 13:36:11 -04:00
Domen KožarandGitHub 088c98a584 Merge pull request #530 from brianmcgee/feat/extensible-lib
feat(eval-config): make lib overridable
2022-09-20 13:45:21 +01:00
Domen KožarandGitHub be8e20e7d3 Merge pull request #533 from Enzime/terminfo
environment: support installing terminfo files
2022-09-20 13:44:48 +01:00
Domen KožarandGitHub caea6653b1 Merge pull request #531 from Enzime/fix-tailscale
Fix Tailscale module
2022-09-20 13:44:22 +01:00
Domen KožarandGitHub b3de9dded8 Merge pull request #228 from malob/sudo-touchid
Add option to enable sudo authentication with Touch ID
2022-09-20 13:42:31 +01:00
Michael Hoang f12f0f3095 environment: support installing terminfo files 2022-09-20 21:57:53 +10:00
Michael Hoang bdd5d81b13 tailscale: prevent significant DNS footgun 2022-09-20 18:03:50 +10:00
Michael Hoang 0ae311e1c7 tailscale: fix tailscaled not running as root
Run `tailscaled` using a system daemon as it does not work as a non-root
user without `userspace-networking`.

Also, remove the broken warning relating to setting the search domain.
Manually adding the search domain to `networking.search` isn't necessary
to use only machine names to refer to other machines.
2022-09-20 18:03:17 +10:00
zimbatmandBrian McGee 74a0e71ff2 eval-config: make lib overridable
This enables using flake lib.darwinSystem function with your custom
lib.
2022-09-19 13:45:59 +01:00
Domen KožarandGitHub 14a12e9ee7 Merge pull request #499 from Enzime/karabiner-elements
Karabiner-Elements
2022-09-19 13:32:50 +01:00
Domen KožarandGitHub de4d41ee9f Merge pull request #526 from lockejan/fix/font-tests
fix: adapt fonts tests to use newer module api
2022-09-18 10:10:36 +01:00
Domen KožarandGitHub 65082fa7b1 Merge pull request #516 from lockejan/docs/readme
Docs/readme
2022-09-18 10:09:52 +01:00
Domen KožarandGitHub c703f79e3e Merge pull request #528 from sikmir/yabai
yabai: set default package
2022-09-18 10:08:35 +01:00
Domen KožarandGitHub 127acf9c3f Merge pull request #524 from sellout/tailscale
Add tailscale service module
2022-09-18 10:08:04 +01:00
Nikolay Korotkiy 4eed79d4ac yabai: set default package 2022-09-16 17:46:17 +03:00
Jan Schmitt c5a241fc64 fix: adapt fonts tests to use newer module api 2022-09-15 20:26:54 +02:00
toonn ed1e73d01e applications: Drop store prefix to generalize
While the Nix store is almost always at `/nix/store`, we shouldn't
assume it to be. Checking only the trailing part of the link is less
exact but removes this bad assumption.

I also added a check for the symlink's contents when overwriting it to
more accurately check whether we own it and should replace it.
2022-09-13 14:57:50 +02:00
toonn fbe795f39d applications: Symlink Nix Apps to /Applications
This PR supercedes #226.

So far application bundles were always linked to `~/Applications` or
`~/Applications/Nix Apps` if the former was an existing directory.

In nix-community/home-manager#1341 a conflict was found with suggested
new Home Manager behavior, where applications installed through Home
Manager would end up in `~/Applications/Home Manager Apps`. This was in
an attempt to make them discoverable through Spotlight but further
investigation suggest Spotlight does not pick up symlinked apps (details
in the issue).

However, there are other programs that expect to be able to write to
`~/Applications` so taking over the directory is unfortunate.

PR #226 dropped linking `~/Applications` and instead made sure the
directory exists so we can always link in `~/Applications/Nix Apps`.

After further discussion in #macos:nixos.org we came to the conclusion
that we shouldn't link applications to a user directory at all. Since we
manage packages for multiple users, application bundles should go in
`/Applications`.

Because previous code will likely leave a symlink at
`~/Applications/{,Nix Apps}`, which will become dangling once the path
it links to is garbage collected from the store we test to see if a link
exists and it conforms to the path we're expecting and if it does remove
it.
2022-09-13 14:57:46 +02:00
Nicolas Berbicheandtoonn 9c76fbf20f Disable taking control of ~/Applications folder
Programs like Steam add applications to ~/Applications and such.

This commit disables linking ~/Applications to nix-darwin Applications
in the /nix/store and makes nix-darwin use a subfolder within
~/Applications.
2022-09-13 14:57:46 +02:00
Greg Pfeil 7698ffce98 Remove lib.mdDoc usage 2022-09-09 11:40:42 -06:00
Greg Pfeil cfd60e8c54 Add tailscale service module 2022-09-09 11:26:49 -06:00
Domen KožarandGitHub 3b69bf3cc2 Merge pull request #498 from malob/improve-homebrew-module
Add ability to configure all known Brewfile line arguments with `homebrew` module
2022-09-06 16:35:28 +01:00
Jan Schmitt a498eb0695 docs: add short introduction
closes #68
2022-09-05 21:45:24 +02:00
Jan Schmitt ad36f9fa06 docs: extend documentation
* mention prerequisite of nix
* explicitly mention implications when using the uninstaller.
* mention channel ownership when using nix as a daemon-service.
* add additional ways to work with the documentation.
* give another example how to run tests
2022-09-02 14:34:06 +02:00
Malo Bourgon 9b3104f90d Update changelog 2022-09-01 10:50:23 -07:00
Malo Bourgon 2ddebb3189 Improve documentation of homebrew module 2022-09-01 10:50:23 -07:00
Malo Bourgon 7710d1d7d6 Add global into a submodule
* Add `homebrew.global.autoUpdate` option.
* Remove `homebrew.global.noLock` option, and replace it with
  `hombrew.global.lockfiles`.
2022-09-01 10:50:21 -07:00
Michael Hoang ed4d2d69a0 karabiner-elements: don't use scripts
`launchd.daemons.*.script` are stored in `/nix/store` which might not be
mounted when the launch daemon attempts to start.
2022-09-01 14:39:26 +10:00
Malo Bourgon b547a7acb0 Create submodule for activation related homebrew options
* Adds `homebrew.onActivation` submodule.
* Moves `homebrew.autoUpdate` to `homebrew.onActivation.autoUpdate`.
* Moves `homebrew.cleanup` to `homebrew.onActivation.clean`.
* Adds new option `homebrew.onActivation.upgrade`.
2022-08-31 18:40:21 -07:00
Malo Bourgon 55e198cf5a Add somes tests for homebrew module 2022-08-30 13:30:05 -07:00
Malo Bourgon 46032bad42 Cleanup/improve homebrew module's code, documentation, and option descriptions 2022-08-30 13:30:03 -07:00
Malo Bourgon 02a38c6a89 Enable defining options for casks using submodule 2022-08-30 12:32:16 -07:00
Malo Bourgon 56031db9c1 Enable defining options for brews using submodule 2022-08-30 12:32:16 -07:00
Malo Bourgon bd93329d6c Enable defining options for taps using submodule 2022-08-30 12:32:16 -07:00
Malo Bourgon 92da7697d1 Add homebrew.caskArgs option 2022-08-30 12:32:14 -07:00
Domen KožarandGitHub 80cec5115a Merge pull request #512 from malob/readme-IRC-to-matrix
Update readme to point to Matrix instead of IRC
2022-08-30 20:09:00 +02:00
Domen KožarandGitHub fb820618be Merge pull request #510 from malob/convert-to-native-floats
Transition to using native floats for option types
2022-08-30 20:04:44 +02:00
Domen KožarandGitHub db543d325f Merge pull request #509 from malob/fix-warning-about-HOME
Add `-H` to `sudo nix-env [...]` calls in `darwin-rebuild.sh` to deal with warning
2022-08-30 19:56:26 +02:00
Domen KožarandGitHub be1b9867eb Merge pull request #511 from malob/fix-launchd-descriptions
Fix launchd options description oddities
2022-08-30 19:54:35 +02:00
Malo Bourgon 42cc9d2c27 Update readme to point to Matrix instead of IRC 2022-08-29 16:33:56 -07:00
Malo Bourgon 241d88ed20 Fix launchd options description oddities 2022-08-29 16:09:38 -07:00
Malo Bourgon 5fa362c32f Transition to using native floats 2022-08-29 15:39:16 -07:00
Malo Bourgon 1da877d28c Add -H to sudo nix-env [...] to deal with warning
After NixOS/nix#6676, the following warning is displayed when running
`darwin-rebuild switch`:
  warning: $HOME ('/Users/jamie') is not owned by you, falling back to the
  one defined in the 'passwd' file.
2022-08-29 11:59:54 -07:00
Domen KožarandGitHub 157a3c3c4e Merge pull request #501 from jab/patch-1
Fix copypasta in simple example
2022-08-29 09:35:18 +01:00
Domen KožarandGitHub 0fb911a78a Merge pull request #507 from misuzu/netbird-module
Add netbird module
2022-08-29 09:34:23 +01:00
Domen KožarandGitHub e6dedb44de Merge pull request #503 from lockejan/fix/deprecation-warning
fix(gitlab-runner): deprecated literalExample
2022-08-29 09:33:44 +01:00
misuzu 09a45c8458 Add netbird module 2022-08-28 18:42:46 +03:00
Michael Hoang afcce995bd karabiner-elements: init module 2022-08-28 20:01:28 +10:00
Jan Schmitt ee4521db7f fix(gitlab-runner): deprecated literalExample
* replace all occurrence's with literalExpression
* fixes #504
2022-08-26 17:39:26 +02:00
Joshua BronsonandGitHub 05cab3fc91 Fix copypasta in simple example 2022-08-25 09:43:42 -04:00
Michael Hoang 176c446b97 launchd: add extra KeepAlive options 2022-08-25 00:39:14 +10:00
Domen KožarandGitHub ef0e7f41cd Merge pull request #289 from angerman/angerman/gitlab-runner
adds gitlab-runner
2022-08-24 10:32:16 +02:00
Domen KožarandGitHub 2f3c9bb364 Merge pull request #493 from AlexOwl/patch-1
Fix brewfile behavior to allow cask_args, etc
2022-08-23 16:23:19 +02:00
Domen KožarandGitHub 5af1aa51f6 Merge pull request #490 from malob/update-nix-module
Bring `nix` module back in sync with the NixOS module (as much as possible)
2022-08-22 09:55:24 +02:00
Domen KožarandGitHub b344a20e80 Merge pull request #471 from tianyaochou/fix-alias-shell-escape
add escape to shell aliases
2022-08-22 09:52:46 +02:00
Domen KožarandGitHub 178707551f Merge pull request #494 from lockejan/appswitcher
feat: provide option to display the appswitcher on all displays
2022-08-22 09:51:43 +02:00
Domen KožarandGitHub 0ea1242721 Merge pull request #491 from yonran/387-no-developer-tools-were-found
Fix nix-rebuild --flake without XCode command line tools
2022-08-22 09:50:59 +02:00
Jan Schmitt fbca12e524 feat: provide option to display the appswitcher on all displays 2022-08-20 22:48:59 +02:00
AlexOwlandGitHub 903eb89a07 Update homebrew.nix 2022-08-19 21:07:04 +04:00
Malo Bourgon 796a72f0fe Update changelog 2022-08-16 17:41:13 -07:00
Malo Bourgon 8e2c71d1ca Tweak nix.gc module to more closely match NixOS module 2022-08-16 17:41:13 -07:00
Malo Bourgon c027fb5ee5 Update nix.gc module with same indenting/formatting as NixOS module 2022-08-16 17:41:13 -07:00
Malo Bourgon f75b461ae2 Fix tests failing due to Nix version check 2022-08-16 17:41:13 -07:00
Malo Bourgon ffc8ec5c9a Add .nix-defexpr to NIX_PATH the way the NixOS module does 2022-08-16 17:41:08 -07:00
Yonathan Randolph 2120245fc2 Fix #387 nix-rebuild --flake without XCode tools
Add nixpkgs git to PATH before /usr/bin/git so that when nix flake metadata invokes git, it does not invoke the XCode one.
2022-08-16 13:55:13 -07:00
Malo Bourgon 08edc0e19a Update/adapt daemon CPU/IO priority options in nix module
Stop using `nice` related options like NixOS, and because `launchd`
recommends using `ProcessType` instead. Note this commit also changes
the default `ProcessType` for the `nix-daemon` from `Interactive` to
`Standard`.
2022-08-16 10:41:51 -07:00
Malo Bourgon 7e74c1c9fb Move build user options to nix module to improve overlap with NixOS
Also add `config.ids` like in NixOS.
2022-08-16 10:41:51 -07:00
Malo Bourgon f88286eda0 Update nix.registry definition to match NixOS module 2022-08-16 10:41:51 -07:00
Malo Bourgon 7648c9befc Refactor nix.nixPath to make diff easier to compare with NixOS module 2022-08-16 10:41:51 -07:00
Malo Bourgon c3bdd6d95f Update nix.buildMachines def and implementation to match NixOS module 2022-08-16 10:41:51 -07:00
Malo Bourgon 39cf1e6fbe Minor tweaks to nix module options defs 2022-08-16 10:41:51 -07:00
Malo Bourgon d44b8be38c Reorder nix module implementation to better match order of NixOS module 2022-08-16 10:41:51 -07:00
Malo Bourgon 5786c079f8 Make nix.settings docs specific to (nix-)darwin where applicable 2022-08-16 10:41:51 -07:00
Malo Bourgon a00b3836a5 Update nix.settings def and implementation to match NixOS module 2022-08-16 10:41:51 -07:00
Malo Bourgon 5f141365af Update def and implementation of nix.package to match NixOS module
Also remove `nix.version` option since it's no longer being used
anywhere, old irrelevant `nix-info` module, and all support for
legacy `nix.profile` option.
2022-08-16 10:41:51 -07:00
Malo Bourgon 490ef80485 Reindent/format nix module to more closely match NixOS module 2022-08-16 10:41:51 -07:00
Malo Bourgon 9a5fb50ea9 Reorder nix module options to match order in NixOS module 2022-08-16 10:41:51 -07:00
Malo Bourgon f729a09a28 Update nix module to use settings sub options like in NixOS module
Also update option definitions to match those in `nixpkgs` where it
makes sense.
2022-08-16 10:41:51 -07:00
Domen KožarandGitHub 80871c71ed Merge pull request #489 from supermarin/update-macos
[github] Use macos-12
2022-08-16 13:28:37 +02:00
Marin Usalj 0ed84cbf72 Update install-nix-action and nix to 22.05
Might need to update nix further if it keeps erroring.
2022-08-12 14:25:48 -04:00
Marin Usalj 7d37b79015 [github] Use macos-12
It might be beneficial to set up a matrix
([docs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-multi-dimension-matrix))
and run all major supported macOS versions in parallel.

Reason: macos-10.15 is [being deprecated](https://github.com/actions/runner-images/issues/5583) and
will be fully unsupported by Aug 30 2022.
2022-08-12 14:15:02 -04:00
Pat McLaughlin c82b2327e5 add mouse scaling system setting 2022-08-06 11:19:25 -04:00
Domen KožarandGitHub 54a24f042f Merge pull request #476 from dstcruz/ScreencaptureType
Add option to set com.apple.screencapture type
2022-07-14 16:56:55 -05:00
Daniel Santa Cruz 2c6b9d9144 Add option to set com.apple.screencapture type 2022-07-12 14:50:50 -06:00
Malo Bourgon c1ac8e9b3d Use GNU version of sed from nixpkgs 2022-06-30 13:33:06 -07:00
Malo BourgonandPeter Esselius e5f24e97a7 Fix indent of line added to sudo file
Co-authored-by: Peter Esselius <esselius@users.noreply.github.com>
2022-06-30 13:33:06 -07:00
Malo Bourgon 6e8bc5e740 Use sed to disable sudo touch ID authentication 2022-06-30 13:33:06 -07:00
Malo Bourgon ca57e8bcdb Change option name and switch to using activation script 2022-06-30 13:32:46 -07:00
Malo Bourgon 1d98da837f Add option to enable sudo authentication with TouchID 2022-06-30 13:31:42 -07:00
Tianyao Chou a3cab812ac add escape to shell aliases 2022-06-30 19:21:36 +02:00
Daiderd Jordan 2f2bdf658d update example config 2022-05-07 11:33:56 +02:00
Domen KožarandGitHub bb3baef6e1 Merge pull request #459 from shyim/data-dir-nullable-redis
modules: make dataDir nullable in redis
2022-04-26 13:30:25 +01:00
Soner Sayakci 0119c40dfa modules: make dataDir nullable in redis 2022-04-26 14:04:02 +02:00
Daiderd JordanandGitHub 1a387b8b3e Merge pull request #447 from dsyang/additional-options
add options for configuring activity monitor
2022-04-25 23:03:55 +02:00
Daiderd JordanandGitHub aba9ce944e Merge pull request #429 from montchr/add-toplevel-option-lib
Add top-level `lib` option based on NixOS
2022-04-25 22:59:34 +02:00
Daiderd JordanandGitHub d010355f1b Merge pull request #453 from mtoohey31/fix/synthetic-instructions
Fix synthetic.conf instructions
2022-04-25 22:51:45 +02:00
Daiderd JordanandGitHub 175e7c23b9 Merge pull request #455 from eqyiel/add-launchevents
feat: add serviceConfig.LaunchEvents configuration option
2022-04-25 22:47:35 +02:00
Daiderd JordanandGitHub 8225b91297 Merge pull request #457 from montchr/hotfix-update-enablefontdir-usages
fonts: replace remaining reference to `enableFontDir`
2022-04-24 23:32:22 +02:00
Chris Montgomery 51e8b0b353 fonts: replace remaining reference to enableFontDir
see https://github.com/LnL7/nix-darwin/pull/456#issuecomment-1105472886

props to @jared-w for spotting my mistake
2022-04-24 13:36:19 -04:00
Domen KožarandGitHub 2979028c51 Merge pull request #456 from montchr/fonts-fontdir-option-rename
fonts: rename `fonts.enableFontDir` to `fonts.fontDir.enable` in line with NixOS
2022-04-19 21:12:53 +01:00
Chris Montgomery b67c312295 fonts: rename fonts.enableFontDir in line with NixOS
since 21.05 beta:

https://github.com/NixOS/nixpkgs/blob/e22337c8707f42e21938dc729643fa8904d33aeb/nixos/modules/config/fonts/fontdir.nix#L64
https://github.com/NixOS/nixpkgs/commit/c99bd9bedf7291390c28eddb31f8ed2aeec8ea7f
2022-04-19 10:30:52 -04:00
Ruben Maher 11c98bfad4 feat: add serviceConfig.LaunchEvents configuration option
This is required if you want to register an "xpc event stream handler". Check
out the README for https://github.com/snosrap/xpc_set_event_stream_handler for
more info.
2022-04-17 10:45:22 +09:00
Matthew Toohey a4f5ff411e Fix synthetic.conf instructions 2022-04-14 20:07:28 -04:00
Moritz Angermann 20483453b0 fixup 2022-03-30 09:31:05 +08:00
Moritz Angermann 0b1502ebe2 uid/gid/util 2022-03-30 09:31:04 +08:00
Moritz Angermann 1b8ac989e6 Update gitlab-runner.nix 2022-03-30 09:31:04 +08:00
Moritz Angermann 98c09f6545 adds gitlab-runner 2022-03-30 09:31:04 +08:00
Domen KožarandGitHub 4fdbb8168f Merge pull request #340 from hauleth/fix/use-short-hostname
Use short hostname as flake attribute name
2022-03-26 07:11:11 +00:00
Domen KožarandGitHub 8a1a454873 Merge pull request #450 from midchildan/fix/fxpreferredviewstyle
fix: incorrect default for FXPreferredViewStyle
2022-03-26 07:08:58 +00:00
Domen KožarandGitHub 9d6253f52c Merge pull request #431 from leungbk/more-NSGlobalDomain
Add NSGlobalDomain.NSAutomaticWindowAnimationsEnabled setting
2022-03-26 07:08:41 +00:00
Brian Leung af3eb87e82 Add NSGlobalDomain.NSAutomaticWindowAnimationsEnabled setting
* modules/system/defaults/NSGlobalDomain.nix: Define.
2022-03-25 23:04:45 -07:00
Domen KožarandGitHub 20813f1df7 Merge pull request #446 from dsyang/show-files-always
add option to show hidden files everywhere
2022-03-25 12:25:08 +00:00
Domen KožarandGitHub 1489a89c74 Merge pull request #449 from malob/autoupdate-manual
Add workflow to auto-update manual
2022-03-25 12:19:13 +00:00
midchildan f6161c1ed8 fix: incorrect default for FXPreferredViewStyle 2022-03-25 00:37:17 +09:00
Malo Bourgon f3a7282410 Add workflow to auto-update manual 2022-03-22 10:31:55 -07:00
Dan Yang faaa12ad24 add options for configuring activity monitor 2022-03-14 10:17:35 -07:00
Dan Yang 37e42a9fe4 add option to show hidden files everywhere 2022-03-14 10:04:28 -07:00
Domen KožarandGitHub 17fbc68a61 Merge pull request #445 from dsyang/finder-options
Add additional options to configure Finder
2022-03-13 12:18:50 +00:00
Domen KožarandGitHub c4ed319159 Merge pull request #440 from ylh/literalTest
cachix-agent: literalExample -> literalExpression
2022-03-13 12:17:13 +00:00
Dan Yang d61d8b3bd0 additional finder options 2022-03-10 00:43:27 -08:00
Dan Yang d1c5344222 option to show all hidden files 2022-03-10 00:12:30 -08:00
Chris MontgomeryandGitHub 3bb62d40a2 Merge branch 'LnL7:master' into add-toplevel-option-lib 2022-02-27 21:26:31 -05:00
Yestin L. Harrison 0df6e9f5fe cachix-agent: literalExample -> literalExpression 2022-02-23 14:09:52 -08:00
Daiderd JordanandGitHub 1df878b6f8 Merge pull request #438 from domenkozar/cachix-deploy
Add Cachix Agent
2022-02-19 18:50:39 +01:00
Domen KožarandGitHub 2186a66331 Merge pull request #435 from Enzime/support-pkgs
eval-config: Support passing in `pkgs`
2022-02-19 16:32:49 +01:00
Domen KožarandGitHub c944b5ee82 Merge pull request #437 from Kloenk/telegraf
telegraf: init module
2022-02-16 11:35:52 +01:00
Domen KožarandGitHub 4785322c4f Merge pull request #434 from opeik/patch-1
Don't reset experimental features
2022-02-16 11:35:02 +01:00
Domen Kožar 6dd5e881a0 Add Cachix Agent support 2022-02-16 11:21:17 +01:00
Finn Behrens efa1aa6ca5 telegraf: init module 2022-02-08 17:48:57 +01:00
Michael Hoang 5528b36698 eval-config: Support passing in pkgs
This is useful for flake users as they will usually already have an
instantiated Nixpkgs e.g.

    let
      pkgs = import nixpkgs {
        config.allowUnfree = true;
        overlays = [ ... ];
      }
    in darwin.lib.darwinSystem {
      inherit pkgs;
    }

This change makes `nix-darwin` match the behaviour of NixOS and
`home-manager`.
2022-02-04 21:32:40 +11:00
Sandro StikićandGitHub ae73fc3b03 Don't reset experimental features 2022-02-04 16:16:08 +08:00
Chris Montgomery 9c645f5c61 feat: add top-level lib option
For parity with NixOS:

https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/lib.nix
2022-01-23 12:42:09 -05:00
Daiderd JordanandGitHub bcdb6022b3 Merge pull request #426 from malob/brew-path-fix
Fix homebrew.brewPrefix default value on Apple Silicon
2022-01-18 09:37:10 +01:00
Malo Bourgon bef3621501 Fix homebrew.brewPrefix default value on Apple Silicon 2022-01-17 16:07:09 -08:00
Daiderd JordanandGitHub af65e183c3 Merge pull request #419 from tboerger/dock-features
modules/system/defaults/dock.nix: add options for hot corners
2022-01-17 21:57:10 +01:00
Daiderd JordanandGitHub f22e870a2e Merge pull request #414 from montchr/feature/system-defaults-universalaccess
defaults: add options for common defaults in the `com.apple.universalaccess` domain
2022-01-17 21:42:43 +01:00
Daiderd JordanandGitHub 13d129434d Merge pull request #418 from purcell/smarter-brew-prefix-default
Set brewPrefix defaults according to platform
2022-01-17 21:42:15 +01:00
Steve Purcell 7f68974ea4 Set brewPrefix defaults according to platform
This allows homebrew support to work out of the box on Apple Silicon
machines.

See #322
2022-01-17 17:23:31 +01:00
Thomas Boerger 4c243ea8c8 modules/system/defaults/dock.nix: make sure to use positive ints for hot corners 2022-01-17 00:33:29 +01:00
Thomas Boerger d053e8ade5 modules/system/defaults/dock.nix: add options for hot corners 2022-01-17 00:33:29 +01:00
Daiderd Jordan 9a388b6b56 bump stable tests to 21.05 2022-01-16 09:40:14 +01:00
Daiderd JordanandGitHub d3d7db7b86 Merge pull request #421 from domenkozar/modular-installer
move installer into a separate file
2022-01-16 09:20:16 +01:00
Daiderd JordanandGitHub 2296ffcd21 Merge pull request #397 from jsoo1/eval-config-check-param
eval-config: Add check parameter for compatibility with nixpkgs.
2022-01-16 09:03:43 +01:00
Daiderd JordanandGitHub 6555c36225 Merge pull request #394 from jsoo1/allow-functors
nixpkgs: Allow functors.
2022-01-16 08:56:55 +01:00
Domen Kožar 16c9343b25 move installer into a separate file 2022-01-11 14:14:42 +01:00
John Soo cb1b24cff1 eval-config: Add check parameter for compatibility with nixpkgs. 2022-01-04 16:39:46 -07:00
John Soo e5ba780a76 nixpkgs: Allow functors.
Replace builtins.isFunction with lib.isFunction, which allows functors.
2022-01-04 16:38:14 -07:00
Daiderd JordanandGitHub 15635ae638 Merge pull request #409 from hercules-ci/fix-args-warning
eval-config.nix: Fix args warning
2022-01-02 20:38:46 +01:00
Robert Hensing 19a1534e61 modules/documentation/default.nix: Fix args warning 2022-01-02 12:45:39 +01:00
Robert Hensing 0937f9c060 eval-config.nix: Fix args warning 2022-01-02 12:45:39 +01:00
Daiderd Jordan 40b518d336 nix: extend nix.conf content whitelist
Fixes #407
2022-01-02 11:50:09 +01:00
Daiderd Jordan a13e52e658 simplify synthetic.conf install commands 2022-01-02 11:50:06 +01:00
Daiderd JordanandGitHub 209b3fa1a8 Merge pull request #389 from kidonng/patch-4
Add manual install command to create symlink after 10.15 Catalina
2022-01-02 11:47:32 +01:00
Chris Montgomery 1cf5705283 defaults: add options for common universalaccess settings 2021-12-24 17:52:17 -05:00
Chris Montgomery 7709d31d76 defaults-write: sort variables and lists by name and option 2021-12-24 17:29:44 -05:00
Chris Montgomery f07acb443a defaults-write: formatting 2021-12-24 17:20:15 -05:00
Daiderd JordanandGitHub 5851d9613e Merge pull request #402 from abathur/fix_newer_apfs.util_error
fix dependence on apfs.util exit code
2021-12-21 21:07:10 +01:00
Travis A. Everett 94c3e407dd fix dependence on apfs.util exit code
apfs.util (or at least it's newer -t flag) has bad exit code semantics
and will return non-zero codes for both success and errors.

Closes #401 and most-likely fixes #378 as well
2021-12-21 10:07:23 -06:00
Daiderd Jordan e8f4288d16 uninstaller: copy services instead of symlinking 2021-12-21 15:42:45 +01:00
Daiderd Jordan bebb35922d bump nix-install-action 2021-12-21 15:42:42 +01:00
KidandGitHub d75a4fcf4d Add manual install command to create symlink after 10.15 Catalina 2021-12-06 21:43:50 +08:00
Daiderd Jordan 44da835ac4 add forward compatibility for literalExample deprecation
Fixes #367
2021-10-23 15:06:42 +02:00
Daiderd JordanandGitHub 8dfeb92ec1 Merge pull request #369 from cherryblossom000/typo-fixes
Fix some typos
2021-10-23 15:05:44 +02:00
cherryblossom000 99ff0b66ca Fix some typos 2021-10-21 20:37:43 +11:00
Daiderd Jordan e1a3f7292f improve flakes missing system error message 2021-09-15 20:22:23 +02:00
Daiderd Jordan 738eff4f33 Merge pull request #317 from darwinSystem 2021-09-15 20:11:08 +02:00
Daiderd Jordan d2bbe72e18 use current branch as darwin input for flakes
Overriding the registry was supposed to handle this but it seems the
behaviour changed at some point or never worked as intended if an url is
defined for the input.
2021-09-15 20:10:56 +02:00
Daiderd JordanandGitHub d4deef8194 Merge pull request #354 from kidonng/app
uninstaller: also remove `~/Applications/Nix Apps`
2021-09-14 19:12:49 +02:00
Daiderd JordanandGitHub f3c3b8db6e Merge pull request #351 from nosewings/master
system.defaults: enable automatic light/dark mode
2021-09-14 18:53:17 +02:00
Daiderd JordanandGitHub 39af16ede5 Merge pull request #357 from eraserhd/magic-mouse
defaults: magic mouse option
2021-09-14 18:52:46 +02:00
Drew Hess 9f7e95887f Pass system to darwinSystem rather than eval-config.
This allows us to specify what kind of darwinSystem we want to build,
rather than determining it at evaluation time.
2021-09-08 13:05:18 +01:00
Jason Felice 998fbfc039 defaults: magic mouse option 2021-08-24 17:13:48 -04:00
KidandGitHub a732ed4851 uninstaller: also remove ~/Applications/Nix Apps 2021-08-10 21:41:35 +08:00
Nicholas Coltharp 7a3f541d5c system.defaults: enable automatic light/dark mode 2021-08-06 18:43:03 -05:00
Łukasz Niemier de4239f97c fix: use short hostname as flake attribute name 2021-07-09 10:12:23 +02:00
Daiderd JordanandGitHub 007d700e64 Merge pull request #304 from aaschmid/configurable.brew.path
homebrew: make brew path configurable
2021-05-26 22:20:22 +02:00
Andreas Schmid f6bec24aeb homebrew: make brew path configurable
Signed-off-by: Andreas Schmid <service@aaschmid.de>
2021-05-26 22:03:00 +02:00
Daiderd JordanandGitHub f41d107db7 Merge pull request #330 from cormacrelf/patch-1
List the configuration file location in README
2021-05-26 18:38:42 +02:00
Daiderd JordanandGitHub daed264991 Merge pull request #332 from jfchevrette/patch-1
change inner double quotes to single quotes
2021-05-26 18:38:25 +02:00
Daiderd JordanandGitHub b8f941d091 Merge pull request #312 from tricktron/fix-install-flake-github-action
Fixes install flake GitHub action
2021-05-26 18:27:47 +02:00
Jean-Francois ChevretteandGitHub db933d1d41 change inner double quotes to single quotes 2021-05-12 17:47:29 -04:00
Cormac RelfandGitHub 774ab69801 List the configuration file location in README
I don't have unlimited time to read through the manual installation instructions just to see where the config file goes when I forget.
It's not great either that the first line of the README has a path that means nothing at all on macOS. That could be better too
but I'm not going to update the project's top tagline in a PR.
2021-05-04 14:26:54 +10:00
Daiderd JordanandGitHub a7492a8c76 Merge pull request #308 from hardselius/master
Fix nix flake info error
2021-04-06 09:20:09 +02:00
Thibault Gagnaux dbddb3a1a6 Adds GITHUB_TOKEN due to rate limiting 2021-03-26 07:17:26 +01:00
Thibault Gagnaux 78e10ac43f Uses nix flakes as described [here](https://github.com/cachix/install-nix-action) 2021-03-26 07:17:26 +01:00
Martin Hardselius 1f8eb9b128 Add nix flags to subcommand test
This change removes the need for having

  experimental-features = nix-command flakes

in nix.conf. It should also work outside of flake directories.
2021-03-23 09:49:47 +01:00
Martin Hardselius 4187519820 Make nix flake info fix backwards compatible
This change handles previous nix versions by testing for the presence of
the `metadata` subcommand and falling back on the `info` subcommand if
it does not exist.
2021-03-22 22:17:48 +01:00
Daiderd JordanandGitHub 1a76093026 Merge pull request #305 from marsam/add-spotifyd-module
spotifyd: add spotifyd service
2021-03-22 19:30:43 +01:00
Daiderd JordanandGitHub 682aff8164 Merge pull request #299 from marsam/do-not-use-stdenv.lib
darwin-[un]installer: Don't reference deprecated stdenv.lib
2021-03-22 19:20:40 +01:00
Martin HardseliusandGitHub 93752a83ea Fix nix flake info error
Fixes "error: 'info' is not a recognised command'"

Issue: #307
2021-03-21 23:54:10 +01:00
Mario Rodas f3aa13d141 spotifyd: add spotifyd service 2021-03-11 04:20:00 +00:00
Mario Rodas e78f90f795 darwin-[un]installer: Don't reference deprecated stdenv.lib
`stdenv.lib` has been deprecated, and the correct approach is to use
`lib` directly through `pkgs.lib`.
2021-02-23 04:20:00 +00:00
Daiderd Jordan 5c3146b75d users: migrate nixbld -> _nixbld
According to some investigation creating "role" accounts avoids
migration problems when upgrading to certain macOS versions, so create
the build users to match that definition and remove the old ones if
present.

    Role accounts require name starting with _ and UID in 200-400 range
2021-02-17 22:04:54 +01:00
Daiderd JordanandGitHub 3b28c4675a Merge pull request #262 from malob/brew-bundle
Add Homebrew Bundle module
2021-02-17 18:46:15 +01:00
Daiderd JordanandGitHub d87031b382 Merge pull request #265 from sandhose/flake-registry
Add nix.registry options
2021-02-17 18:45:19 +01:00
Daiderd JordanandGitHub 034600cb84 Merge pull request #288 from r-burns/fish-fenv
fish: fix fenv function path
2021-02-17 18:42:11 +01:00
Daiderd JordanandGitHub c8be627ed0 Merge pull request #292 from MaxSchlueter/fix-gnupg-agent
Fix gnupg-agent being kept alive
2021-02-17 18:29:46 +01:00
Max Schlueter 6d4bf1a29e Fix gnupg-agent being kept alive
The agent is restarted automatically after it has been launched
successfully, this creates a lot of noise in the logs. This change
reloads the agent only if it has crashed, i.e. returns with a non-zero
exit code.
2021-02-14 21:55:16 +09:00
Ryan Burns 771f01c4e6 fish: fix fenv function path 2021-02-04 17:52:27 -08:00
Daiderd JordanandGitHub dca3806552 Merge pull request #283 from kevingriffin/fish-fenv-fix
fish: fix fenv reference on 20.09
2021-02-04 23:05:02 +01:00
Kevin Griffin aa5611cc81 fish: fix fenv reference on 20.09
Referring to the deprecated package first causes
an error to be thrown before the correct package can be selected.
2021-01-30 11:27:01 +09:00
Daiderd JordanandGitHub 9e3e4033bc Merge pull request #281 from hauleth/fix/dnsmasq-resolver-file
Use separate config option to set port of DNSmasq
2021-01-28 20:35:47 +01:00
Daiderd JordanandGitHub 32d49bc88f Merge pull request #270 from kevingriffin/fish-environment-babelfish
Native fish environment with babelfish
2021-01-28 20:21:16 +01:00
Łukasz Niemier bd75d14b0f fix: use separate config option to set port of DNSmasq
Older approach seems to not work on macOS 11 Big Sur for some reason.
2021-01-28 14:09:30 +01:00
Kevin Griffin 867ef96e0b fish: add babelfish translation option
Configuration may be ran through fenv at shell start time
(as previously) or translated to fish at build time with
a specified babelfish package.
2021-01-17 10:30:27 +09:00
Malo Bourgon 23cb959893 Fix indentation again 2021-01-16 15:15:29 -08:00
Malo Bourgon acc906d982 Update changelog and fix indentation. 2021-01-16 12:39:01 -08:00
Malo Bourgon 2a0b9a9f60 Add options back in for setting global Homebrew variables 2020-12-30 19:01:22 -08:00
c61d659160 Fix typo in homebrew module
Co-authored-by: Scott Day <services.github@probablyadev.com>
2020-12-28 10:45:30 -08:00
Quentin Gliech 456f17b4d9 nix.registry option 2020-12-22 19:44:21 +01:00
Daiderd JordanandDaiderd Jordan 8834df4317 installer: silence apfs.util output
Passing incorrect flags prints help output to stdout so silence
everything.

Fixes #264
2020-12-22 10:14:02 +01:00
Daiderd JordanandDaiderd Jordan f8a04c7f6d installer: move channel setup out of activation
Fixes #234
2020-12-21 14:23:25 +01:00
Daiderd JordanandDaiderd Jordan 6dd655466d installer: remove profile step 2020-12-19 12:38:06 +01:00
Daiderd JordanandDaiderd Jordan 3cf11923eb use --dry-run check to re-apply system patches 2020-12-19 11:56:51 +01:00
Daiderd JordanandDaiderd Jordan 7e4b134554 add flake build example to readme 2020-12-19 10:13:35 +01:00
Daiderd JordanandGitHub 72c6e6f0d4 Merge pull request #263 from LnL7/harden-installer
Harden installer
2020-12-19 10:10:17 +01:00
Malo Bourgon 48449fbc0e Add CHANGELOG entry 2020-12-18 12:51:31 -08:00
Malo Bourgon 7fd183c5d2 Remove homebrew.userConfig options and cleanup docs 2020-12-18 11:52:03 -08:00
Daiderd JordanandDaiderd Jordan f47083bd71 installer: extend test with shell environment checks 2020-12-18 14:53:09 +01:00
Daiderd JordanandDaiderd Jordan 75cab75c22 installer: ensure /etc/static runs last
In the case that nix-darwin was installed for a single user installation
and later nix gets reinstalled with the daemon it's possible that
nix-daemon.sh loads afterwards, resulting in unexpected behaviour.
2020-12-18 14:53:08 +01:00
Malo Bourgon 6b56100982 Move Homebrew installation check to activation script 2020-12-17 16:54:29 -08:00
Malo Bourgon 9961b72463 Make better use of optional(s) functions in homebrew module 2020-12-17 14:42:07 -08:00
Malo Bourgon e1425db70d Move programs.brew-bundle to homebrew 2020-12-17 13:03:57 -08:00
Malo Bourgon a2146feaf6 Change noAutoUpdate option to autoUpdate in brew-bundle module 2020-12-14 19:39:10 -08:00
Malo Bourgon df06dc470f Update names of options that set user env vars in brew-bundle module 2020-12-14 19:14:35 -08:00
Malo Bourgon a38892c6c8 Rename brew-bunble.cleanupType to cleanup 2020-12-14 16:06:41 -08:00
Malo Bourgon 102a09dc16 Add brew-bundle.noAutoUpdate with true as default 2020-12-10 11:06:34 -08:00
Malo Bourgon fcb9659b20 Improve brew-bundle module documentation 2020-12-08 12:22:27 -08:00
Malo Bourgon ef8d9630ca Fix brew-bundle.extraConfig example 2020-12-08 11:42:15 -08:00
Malo Bourgon 31b0d5cb59 Move brew-bundle activation to user 2020-12-08 10:33:46 -08:00
Malo Bourgon 680c3e0c17 Add assertion checking that Homebrew is installed 2020-12-08 10:17:09 -08:00
Malo Bourgon c3bddd3e91 Add Homebrew Bundle module 2020-12-08 09:47:52 -08:00
Daiderd JordanandGitHub 465539ad1d Merge pull request #259 from virusdave/patch-1
Fix typo in nix-index docstring
2020-12-06 15:26:51 +01:00
Daiderd JordanandGitHub 32924fe28d Merge pull request #261 from cmacrae/yabai/load_sa
yabai: load scripting addition in yabai-sa daemon
2020-12-06 15:26:06 +01:00
Daiderd JordanandGitHub db1631f150 Merge pull request #252 from happysalada/fix_emacs_path
emacs: add system path env var
2020-12-06 15:25:48 +01:00
Daiderd JordanandGitHub 57df59ea2d Merge pull request #247 from happysalada/fix_nextdns
nextdns: add to modulelist
2020-12-06 15:21:49 +01:00
cmacrae 1fc92c0c61 yabai: load scripting addition in yabai-sa daemon 2020-12-03 17:30:30 +00:00
Dave NicponskiandGitHub 0884b87b5c Fix typo in nix-index docstring 2020-11-30 20:29:34 -05:00
happysalada a6b23918a7 emacs: add path config 2020-11-27 11:43:13 +09:00
happysalada dcbc6a4433 nexdns: add module and tests 2020-11-27 11:28:26 +09:00
Daiderd JordanandGitHub 6c6eb8ace6 Merge pull request #254 from stephank/fix-shells
Add /bin/dash to shells
2020-11-26 20:09:13 +01:00
Daiderd JordanandGitHub e1064b0c69 Merge pull request #251 from awseward/awseward/SwipeNavigateWithScrolls
Add options for MacOS swipe navigation
2020-11-26 19:53:08 +01:00
Stéphan Kochen d0d89fda1d Add /bin/dash to shells 2020-11-21 20:07:26 +01:00
Daiderd Jordan 6bd5208e7f github: increase flakes timeout
This relies on nixUnstable which might not be cached, resulting in
failed builds because it takes too long.
2020-11-15 16:22:47 +01:00
Daiderd Jordan a97f690dcc darwin-rebuild: add jq to path for flakes 2020-11-15 15:42:39 +01:00
Daiderd Jordan c6f44ea7ff installer: handle apfs.util on macOS 11.0 Big Sur
The flages of apfs.util changed in 11.0 so try both cases.

Fixes #249
2020-11-15 15:17:13 +01:00
Andrew Seward 5d0ed66ba9 Add options for swipe navigation
One for trackpad, one for mouse. I don't know much about the mouse side
of things, but thought I'd at least include it to be comprehensive.
2020-11-14 22:51:54 -08:00
Daiderd JordanandGitHub 56f01699fb Merge pull request #245 from happysalada/master
modules: add nextdns service
2020-11-08 14:05:33 +01:00
Raphael MegzariandGitHub ee55d78034 switch from agent to daemon to run as root 2020-11-07 20:40:45 +09:00
Daiderd JordanandGitHub 1145503ef9 Merge pull request #242 from akrmn/lorri-path
add git, gnutar and gzip to lorri's path
2020-11-05 21:17:53 +01:00
Moisés Ackerman d037dfaf20 add git, gnutar and gzip to lorri's path 2020-11-05 11:43:50 +01:00
happysalada aa739bc24d modules: add nextdns service 2020-11-05 13:06:51 +09:00
Daiderd JordanandGitHub 842c72f1c9 Merge pull request #244 from LnL7/flakes-test
update install-nix-action
2020-11-04 22:36:42 +01:00
Daiderd Jordan d00d0c8be8 update install-nix-action 2020-11-04 22:14:18 +01:00
Daiderd JordanandGitHub cb7b3d2471 Merge pull request #241 from awseward/add-redis-extraConfig
Add extraConfig option to Redis
2020-11-03 22:50:03 +01:00
Andrew Seward fe814c5e91 Add some test coverage for redis service 2020-11-02 19:26:39 -08:00
Andrew Seward 58fd716d05 Add extraConfig option to redis 2020-10-29 23:35:50 -07:00
Daiderd Jordan c2124383f4 add changelog entry for SHELL variable 2020-10-25 16:37:13 +01:00
Daiderd Jordan 079db5db5b don't set SHELL automatically based on programs.<shell>.enable 2020-10-25 16:37:02 +01:00
Daiderd Jordan 1804b8ecd2 include etc in activate-system
Since the etc actiation now includes a content whitelist files might get
replaced automatically after system updates.  So including it in the
activation here should resolve most issues.
2020-10-25 16:02:23 +01:00
Daiderd Jordan 74eb216078 remove nix 1.x config compatibility 2020-10-25 15:56:29 +01:00
Daiderd Jordan 5dfd0c4485 reuse evalConfig in default.nix 2020-10-25 14:49:15 +01:00
Daiderd Jordan 0dba44e04c disable NIX_PATH checks when using flakes 2020-10-25 12:56:39 +01:00
Daiderd Jordan 1216e9e0aa split out flake overrides into a separate module 2020-10-25 12:55:55 +01:00
Daiderd Jordan dfe84e9203 lnl: cleanup example config 2020-10-25 12:17:48 +01:00
Daiderd Jordan 3be9bc7b3e remove bootstrap.sh from readme 2020-10-25 11:52:28 +01:00
Daiderd Jordan 2f258bc917 link readme to the flakes wiki 2020-10-25 11:49:59 +01:00
Daiderd JordanandGitHub b346a283a8 Merge pull request #238 from c4710n/feature/swap-command-alt
add new option - system.keyboard.swapLeftCommandAndLeftAlt
2020-10-24 19:26:23 +02:00
c4710n bf0ac204bd add new option - system.keyboard.swapLeftCommandAndLeftAlt 2020-10-23 22:47:38 +08:00
Daiderd Jordan 2a60ef1956 switch example flake to master 2020-10-21 18:47:44 +02:00
Daiderd JordanandGitHub 67da67bb7a Merge pull request #235 from LnL7/flakes
flakes
2020-10-21 18:46:20 +02:00
Daiderd Jordan 8800c4717d always prefix flake with darwinConfigurations 2020-10-21 18:30:57 +02:00
Daiderd Jordan c8b38819b4 handle --print-build-logs for flakes 2020-10-21 18:30:57 +02:00
Daiderd Jordan e4c3940e2d add --impure flag for flakes 2020-10-21 18:30:57 +02:00
Daiderd Jordan 362c04011b readme flakes section 2020-10-21 18:30:57 +02:00
Daiderd Jordan 1741ab18a6 add workaround for flake test on github actions 2020-10-21 18:30:57 +02:00
Daiderd Jordan 46198ef432 add flake test 2020-10-21 18:30:57 +02:00
Daiderd Jordan d865c6ae4c add example flake and support --flake in darwin-rebuild 2020-10-21 18:30:57 +02:00
Daiderd Jordan 4a31cba84c add flake versions 2020-10-21 18:30:56 +02:00
Daiderd Jordan c4bc63d2b9 add flake and split evalConfig 2020-10-21 18:30:56 +02:00
Daiderd Jordan 849d527a15 lnl: remove kitty 2020-10-19 20:49:09 +02:00
Daiderd Jordan db82d8b9af clarify store/state permission check 2020-10-18 23:31:38 +02:00
Daiderd Jordan 828879f930 lnl: remove gitconfig symlink 2020-09-12 10:42:38 +02:00
Daiderd Jordan 069bd54726 add changelog entry for loaOf 2020-09-12 09:46:13 +02:00
Daiderd JordanandGitHub d888bdf3dd Merge pull request #224 from marsam/remove-types.loaOf
Remove deprecated types.loaOf
2020-09-12 09:37:50 +02:00
Daiderd JordanandGitHub 88faa8fbae Merge pull request #223 from malob/networking
Add separate options for ComputerName and LocalHostName in networking module
2020-09-12 09:36:55 +02:00
Daiderd JordanandGitHub 62c14a1529 Merge pull request #222 from tricktron/lorri
Adds Lorri module
2020-09-12 09:33:22 +02:00
Daiderd JordanandGitHub 28079f6d0f Merge pull request #225 from zachcoyle/add-trackpad-dragging-default
Add trackpad dragging default
2020-09-12 09:32:47 +02:00
Daiderd JordanandGitHub 6ae05c908e Merge pull request #220 from eraserhd/dark-mode
Enable setting dark mode
2020-09-12 09:32:36 +02:00
Zach Coyle b8a2fd1c18 Add trackpad dragging default 2020-09-05 11:06:56 -04:00
Mario Rodas a34dea283c Remove deprecated types.loaOf
types.loaOf has been deprecated for a long time and is now in the
process of removal. See: https://github.com/NixOS/nixpkgs/pull/96042
2020-09-02 04:20:00 +00:00
Malo Bourgon df4e6b697e Add separate options for ComputerName, HostName, and LocalHostName 2020-08-31 21:01:47 -07:00
Thibault Gagnaux 1dbe3b71e3 Disable StandardOutPath by default and refactor test to using plutil 2020-08-31 13:07:06 +02:00
Thibault Gagnaux 798fc52d12 Corrects description. 2020-08-30 19:27:41 +02:00
Thibault Gagnaux 91504bd926 Removes zsh and getEnv and adds needed NIX_PATH env. 2020-08-30 18:06:40 +02:00
Thibault Gagnaux 30593350fd Makes it work. 2020-08-29 16:35:43 +02:00
Thibault Gagnaux 11413f94b2 Adds lorri service. 2020-08-29 16:35:43 +02:00
Jason Felice e038c50316 Enable setting dark mode
This option does not take effect until the user logs out and then
back in.  I didn't call this out because I think there are several
options like this already.

I'm not sure Mac OS sets "Auto", but it isn't by setting this default.
2020-08-28 16:09:47 -04:00
Daiderd JordanandGitHub 943a6b25d7 Merge pull request #215 from basvandijk/installer-correct-referencees
darwin-[un]installer: make sure all dependencies are part of the closure
2020-08-26 18:21:07 +02:00
Daiderd JordanandGitHub cd2990c8cf Merge pull request #219 from alexfmpe/patch-1
Fix typo
2020-08-26 18:19:13 +02:00
Alexandre EstevesandGitHub a6f47f87f1 Fix typo 2020-08-26 13:19:51 +01:00
Bas van Dijk 03d3931656 darwin-[un]installer: make sure all dependencies are part of the closure
This makes sure the `darwin-installer` and `darwin-uninstaller`
packages can be nix copied to any target and reliably be executed
there.
2020-08-21 21:22:09 +02:00
Daiderd JordanandGitHub d5f26b4c0c Merge pull request #216 from hercules-ci/fix-missing-option-localSystem
documentation: Don't set localSystem which doesn't exist
2020-08-17 17:10:44 +02:00
Robert Hensing 58e6ca77d9 documentation: Don't set localSystem which doesn't exist
This is safe to remove, because it is not referenced anywhere in
nix-darwin.
It should have been discovered way earlier, but a bug in the
module system has allowed this value to be defined until
https://github.com/NixOS/nixpkgs/commit/fd75dc876586bde8cdb683a6952a41132e8db166
2020-08-16 10:15:18 +02:00
Daiderd Jordan 47fe6db9c9 darwin-installer: configure zsh 2020-06-17 19:37:33 +02:00
Daiderd Jordan 7e278ba51a enable zsh in simple example 2020-06-17 19:37:07 +02:00
Daiderd Jordan 20b9f53035 etc: add known hashes for bashrc/zsh/nix.conf 2020-06-17 19:37:07 +02:00
Daiderd Jordan b22481d03a etc: allow replacing files with known content
This enables replacing existing system files like /etc/bashrc by default
while keeping the safer behaviour for other files like /etc/passwd, etc.
that could potentially cause major problems for the system when replaced.
2020-06-17 19:23:31 +02:00
Daiderd Jordan 2d6479b72e lnl: fix evaluation and switch to neovim 2020-06-14 17:03:11 +02:00
Daiderd Jordan de1bf9b815 add build workflow 2020-06-12 23:48:33 +02:00
Daiderd Jordan 78434e602d replace NIX_PATH references with regular paths 2020-06-11 19:17:06 +02:00
Daiderd JordanandGitHub 1b71f9f21c Merge pull request #206 from pjan/pjan/CreateDesktop
Adds com.apple.finder CreateDesktop defaults to enable/disable desktop
2020-06-03 20:33:03 +02:00
pjan vandaele e7e49119bb Adds com.apple.finder CreateDesktop defaults to enable/disable desktop 2020-06-03 17:39:58 +08:00
Daiderd Jordan eace013f6b lnl: disable gnupg agent for secretive 2020-05-30 14:38:34 +02:00
Daiderd Jordan 6a3564296b lnl: update functions 2020-05-30 14:38:33 +02:00
Daiderd Jordan 3d20a28b33 lnl: update fetch-nixpkgs 2020-05-30 14:38:33 +02:00
Daiderd Jordan 0ab3fab8b7 lnl: fix min-free/max-free values 2020-05-30 14:38:33 +02:00
Daiderd JordanandGitHub 5c7d050e20 Merge pull request #205 from Mic92/nix-daemon
nix: better defaults settings for maxJobs/buildCores
2020-05-30 13:11:46 +02:00
Jörg Thalheim eb7b41a2a0 nix: better defaults settings for maxJobs/buildCores
most users just want to use all available cores.
This commit aligns our defaults with what we do in NixOS
2020-05-30 02:14:06 +01:00
Daiderd Jordan cec42039b0 install-cachix-action: v8 -> v9 2020-05-29 22:56:37 +02:00
Daiderd Jordan f55568ea4e system: cleanup patches activation 2020-05-29 22:54:25 +02:00
Daiderd Jordan 77121650d4 system: add patches module 2020-05-29 21:29:20 +02:00
Daiderd JordanandGitHub f0552188ba Merge pull request #201 from jamesottaway/only-sed-simple-example
Only enable `services.nix-daemon` when no config is present upon install
2020-05-25 20:05:02 +02:00
Daiderd JordanandGitHub 600bd4f9ed Merge pull request #200 from shardulbee/master
Separate yabai config and extra config by newline
2020-05-25 20:03:31 +02:00
James Ottaway 32fa78821f Only enable services.nix-daemon when no config is present upon install 2020-05-17 21:58:35 +10:00
Shardul Baral 97729d1e79 Separate yabai config and extra config by newline
If a user passes both `config` and `extraConfig` to the `yabai` serivce,
the generated `yabairc` file is invalid. This is because we do not add a
newline separator when we concatenate the config string generated by
`toYabaiConfig cfg.config` with `cfg.extraConfig`.

This PR prepends a newline to `cfg.extraConfig` if it is non-empty so
that the resulting `yabairc` config is valid.
2020-05-15 15:38:57 -04:00
Daiderd Jordan 5f6d300a2d add comment on how to trigger the debug workflows 2020-05-15 18:13:36 +02:00
Daiderd Jordan eb3a5a401f update label for debug workflow 2020-05-15 18:13:13 +02:00
Daiderd JordanandGitHub 8f057555c7 Merge pull request #197 from cmacrae/modules/services/spacebar
module: add spacebar service
2020-05-14 21:18:52 +02:00
cmacrae 7ebda10e40 module: add spacebar service 2020-05-14 19:41:28 +01:00
Daiderd JordanandGitHub 008c0efb11 Merge pull request #199 from LnL7/fix-gh-actions
update macos label
2020-05-14 19:22:55 +02:00
Daiderd Jordan 4903624ee6 update macos label
Seems like this was renamed to macos-$version and macos-latest.
2020-05-14 19:12:18 +02:00
Daiderd JordanandGitHub c5f7cee0ed Merge pull request #196 from cmacrae/modules/services/yabai
module: add yabai service
2020-05-13 19:24:31 +02:00
Daiderd JordanandGitHub 64a4bc854e Merge pull request #198 from Daniel-V1/fix-bash-completions
Fix Bash Completions
2020-05-11 22:26:37 +02:00
Daniel V 5796faef94 Set up XDG system environment variables sort of how they set them up
in nixos by appending them to the nix profiles
2020-05-11 06:56:21 -04:00
cmacrae 7ef533e8d1 module: add yabai service 2020-05-10 22:35:54 +01:00
Daniel V d3dff8cefb This fixes bash completion for me, though it may not be the best way.
Hopefully the pull request will go through or tell me how to do it better
2020-05-09 15:39:25 -04:00
Daiderd JordanandGitHub f885aff4c9 Merge pull request #195 from hauleth/ft/add-dnsmasq-service
Add DNSmasq service
2020-05-03 18:57:17 +02:00
Daiderd JordanandGitHub 2752bf1421 Merge pull request #192 from kalbasit/customize-label-prefix
launchd: allow customization of the default launchd prefix
2020-05-03 18:56:00 +02:00
Daiderd JordanandGitHub ee2c31205c Merge pull request #190 from zupo/patch-1
Add support for system.defaults.screencapture.disable-shadow
2020-05-03 16:53:22 +02:00
Łukasz Niemier 784b688dd9 docs: add example 2020-04-28 22:43:13 +02:00
Łukasz Niemier 43b7a6901b test: add tests for new service 2020-04-28 19:06:45 +02:00
Łukasz Niemier b30a04c00c ft: add DNSmasq service
This is useful for redirecting some TLDs to the different addresses. For
example I use it to make all requests to `*.localhost` to be resolved to
loopback address which allows me to easily work and test services that
are relying on different domains.
2020-04-28 18:49:08 +02:00
Wael M. NasreddineandWael M. Nasreddine cee84f4ea0 launchd: allow customization of the default launchd prefix 2020-04-14 15:01:37 -07:00
Nejc ZupanandGitHub c4970fbc4e Be nicer 2020-04-12 18:21:07 +01:00
Nejc ZupanandGitHub a67e6977c4 Add support for system.defaults.screencapture.disable-shadow 2020-04-12 18:18:46 +01:00
Daiderd JordanandGitHub 053f2cb9cb Merge pull request #184 from eraserhd/support-tmux-extraConfig
Rename programs.tmux.tmuxConfig -> extraConfig
2020-03-29 20:05:12 +02:00
Jason Felice ff77fcadc2 Rename programs.tmux.tmuxConfig -> extraConfig 2020-03-29 13:58:58 -04:00
Daiderd Jordan 5418d6bb8b add debug action 2020-03-29 12:41:47 +02:00
Daiderd Jordan e44188bf4c update badge 2020-03-28 19:24:59 +01:00
Daiderd JordanandGitHub 4ac6b67602 Merge pull request #186 from LnL7/github-actions
GitHub actions
2020-03-28 19:22:58 +01:00
Daiderd Jordan 1f336df3f2 try out github actions 2020-03-28 19:18:22 +01:00
Daiderd Jordan 2afc2c0f6a remove travis 2020-03-28 19:18:22 +01:00
Daiderd Jordan 1436543221 nix: kickstart and wait for the nix-daemon service 2020-03-28 19:18:21 +01:00
Daiderd Jordan 80a8a591a9 installer: try creating /run using synthetic.conf
Since macOS 10.15 Catalina / can't be changed directly anymore.

Fixes #166
2020-03-28 19:12:21 +01:00
Daiderd Jordan 75fa7cd6bf remove old boottsrap.sh script 2020-03-28 18:35:20 +01:00
Daiderd Jordan 073935fb99 fix evaluation of darwin.pkgs for recent nixpkgs
The _module attribute was renamed in https://github.com/NixOS/nixpkgs/commits/dcdd232939232d04c1132b4cc242dd3dac44be8c.
2020-03-22 23:13:59 +01:00
Daiderd JordanandGitHub 1ffae69c56 Merge pull request #169 from tricktron/fix/fonts-catalina
fonts: Adds support if Nix is on another filesystem.
2020-03-03 19:19:21 +01:00
Daiderd Jordan 6a255bd47c lnl: update 2020-02-29 23:49:53 +01:00
Daiderd Jordan 5fba29c1c8 nix-daemon: use wait4path
This prevents the service from starting (and thus failing) before the
nix store is mounted.
2020-02-24 22:38:32 +01:00
Daiderd Jordan 3d50598ae0 users: ensure uniqueness of gid/uid entries
Instead of a cryptic error during activation conflicting ids are now
caught during evaluation.

    error: The option `users.uids.30001' has conflicting definitions
2020-02-11 16:41:40 +01:00
Daiderd Jordan 590e9c872a darwin-rebuild: allow empty arguments
The wrapper already handles whitespace properly and empty values are
useful for certain flags like --option builders ''.
2020-02-03 22:49:46 +01:00
Daiderd JordanandGitHub 3201be1bd4 Merge pull request #168 from input-output-hk/pre-commands-buildkite
buildkite: add preCommands option
2020-01-28 08:26:42 +01:00
Daiderd JordanandGitHub a14315c96e Merge pull request #175 from treffynnon/more-system-defaults
[system.defaults] more sound, firewall/alf, spaces, loginwindow, SoftwareUpdate
2020-01-21 12:22:17 +01:00
Daiderd JordanandGitHub 3b3ae7ab7d Merge pull request #178 from Kaali/lazy-bash
Let bash load completions lazily
2020-01-21 12:21:16 +01:00
Väinö JärveläandDaiderd Jordan e1000fc1a6 bash: Let bash load completions lazily
As described in detail here: https://github.com/NixOS/nixpkgs/issues/32533
bash will load completion scripts in $p/share/bash-completion/completions/ on
startup instead of letting bash-completion do it's lazy loading. Bash startup
will then slow down (very noticeable when bash-completion is installed in a
profile).

This commit leaves loading of scripts in the hands of bash-completion,
improving startup time for everyone using `enableCompletion`.

Fixes #101
2020-01-21 12:18:28 +01:00
Daiderd Jordan 267f50e63d replace list values for types.loaOf
This type has been deprecated in nixpkgs, these options will be
replaced with types.attrsOf in the future.
2020-01-21 12:11:32 +01:00
Daiderd JordanandGitHub 7175f52860 Merge pull request #182 from wildsebastian/fix_commitIdFromGitRepo_call
Remove trailing slash from path in commitIdFromGitRepo call
2020-01-15 11:07:12 +01:00
Sebastian Wild 78f931cb53 Remove trailing slash from path
A change of `commitIdFromGitRepo` in nixpkgs/lib/sources.nix
resulted in the error message
"attribute '.git' missing at nixpkgs/lib/sources.nix:7:32" when
executing darwin-rebuils switch.
The commit with the change is
https://github.com/NixOS/nixpkgs/commit/c9214c394b248e1f26e45dbe1be2bd82363af3a6

Removing the trailing slash resolves the error.
2020-01-15 09:17:33 +01:00
Daiderd JordanandGitHub 4397563e91 Merge pull request #167 from lunaticare/fix/nixpath_darwin-config
Fix path to darwin-config
2020-01-14 23:51:11 +01:00
Daiderd JordanandGitHub 26d5d8f5ba Merge pull request #181 from cmacrae/defaults/hide-menu-bar
defaults: introduce NSGlobalDomain option for "_HIHideMenuBar"
2020-01-14 23:46:59 +01:00
cmacrae 11e6e68c99 defaults: introduce NSGlobalDomain option for "_HIHideMenuBar" 2020-01-01 20:51:31 +00:00
Thibault Gagnaux 547ccd60b4 Replaces cp with rsync to prevent partial copies across filesystems. 2019-12-22 22:31:34 +01:00
Thibault Gagnaux f5dd959832 Fixes the failing font test 2019-12-22 14:52:01 +01:00
Thibault Gagnaux a5d863ee64 fonts: Adds support if Nix is on another filesystem.
On Catalina, the default way is to install Nix on a new volume which breaks hardlinking the font files. If that is the case I just copy them.
2019-12-22 14:52:01 +01:00
Daiderd Jordan 3ec36dd667 darwin-installer: add missing shebang
Unclear in which conditions this does or doesn't work but using a
shebang is best practice and ensures an ancient version of bash isn't
used.

Fixes #179
2019-12-14 18:13:33 +01:00
Simon Holywell 39bc7bb131 fix autologin name docs 2019-11-04 15:28:38 +10:00
Simon Holywell 42c8f9bce3 adds com.apple.SoftwareUpdate 2019-11-04 14:54:31 +10:00
Simon Holywell 6100c826d4 adds com.apple.loginwindow 2019-11-04 14:35:56 +10:00
Simon Holywell 626a112ce3 adds com.apple.spaces 2019-11-04 14:35:21 +10:00
Simon Holywell 400a367d4e adds com.apple.alf 2019-11-04 14:06:28 +10:00
Simon Holywell 47a7731943 adds com.apple.sound.beep.feedback 2019-11-04 12:49:09 +10:00
Simon Holywell 8e90853f17 adds com.apple.sound.beep.volume 2019-11-04 12:39:47 +10:00
Daiderd Jordan 3fde04a384 tmux: add test for #173 2019-11-02 17:18:39 +01:00
Daiderd JordanandGitHub 2b7812a129 Merge pull request #174 from herberteuler/master
tmux: clear __NIX_DARWIN_SET_ENVIRONMENT_DONE
2019-11-02 17:06:55 +01:00
Daiderd Jordan 6d4a821311 travis: add another workaround for the installer test 2019-11-02 16:58:05 +01:00
Daiderd JordanandGitHub 9bfadc9244 Merge pull request #172 from treffynnon/patch-3
[bootstrap.sh] Moves build & rebuild to after user creation
2019-11-02 16:53:59 +01:00
Daiderd JordanandGitHub 68f56c0b95 Merge pull request #171 from treffynnon/patch-1
[bootstrap.sh] Fixes one character typo in bootstrap.sh
2019-11-02 16:50:54 +01:00
zhujun 2ef552b4d0 tmux: clear __NIX_DARWIN_SET_ENVIRONMENT_DONE
This is necessary to allow shell sessions inside tmux having a chance to
set environment properly
2019-11-01 13:37:18 +08:00
Simon HolywellandGitHub 983dce6d70 Moves build & rebuild to after user creation
If the users do not already exist then installers who already have a configuration containing

```nix
services.nix-daemon.enable = false;
```

will not be able to complete an initial bootstrap on a clean machine. This is because the bootstrap script currently only creates users after an initial rebuild.

The users must exist before the rebuild is completed or the whole thing fails.
2019-10-30 15:11:00 +10:00
Simon HolywellandGitHub 13a46bfad4 Fixes one character typo in bootstrap.sh 2019-10-30 14:48:09 +10:00
Samuel Leathers c9d1defa33 buildkite: add preCommands option 2019-10-17 14:40:49 -04:00
Dmitry PogodinandGitHub 5cd178c7f1 Fix path to darwin-config 2019-10-17 15:59:00 +03:00
Daiderd Jordan da52dc006c lnl: load :u packages in current instead of a subshell 2019-09-24 00:27:53 +02:00
Daiderd JordanandGitHub e274978a65 Merge pull request #161 from hercules-ci/delete-broken-hercules-ci-agent
Revert "Add hercules-ci-agent"
2019-09-12 23:02:17 +02:00
Robert Hensing f55fca00b3 Revert "Add hercules-ci-agent"
This reverts commit fb0a1763f5.

Reason: this implementation of the module is outdated and broken.
We recommend to follow instructions in the web app or
https://docs.hercules-ci.com
2019-09-10 15:50:19 +02:00
Daiderd JordanandGitHub d6a3aead15 Merge pull request #159 from marsam/remove-types-string
modules: remove usages of types.string
2019-09-01 10:10:15 +02:00
Daiderd JordanandGitHub be7f25b3f9 Merge pull request #155 from toonn/defaults-write-GlobalPreferences
Add defaults write for the alert sound
2019-09-01 09:58:01 +02:00
Daiderd JordanandGitHub eb2812d669 Merge pull request #154 from eraserhd/keyboard-fnState
Allow configuring external keyboard to use standard F-keys
2019-09-01 09:57:38 +02:00
Mario Rodas 2807a31f95 modules: remove usages of types.string 2019-08-31 04:20:00 -05:00
toonn 88d27c62d5 Add defaults write for the alert sound
Found in `System Preferences`->`Sound`->`Sound Effects`, the default is `Funk`.
2019-08-19 16:02:59 +02:00
Daiderd Jordan ef3d6e4354 lnl: remove default sandbox 2019-07-29 21:28:35 +02:00
Daiderd Jordan 21c2ffdda9 lnl: remove chunkwm dummy 2019-07-29 21:28:35 +02:00
Jason Felice c3d9dceede Allow configuring external keyboard to use standard F-keys 2019-07-22 11:05:48 -04:00
Daiderd JordanandGitHub 2fce9974b6 Merge pull request #147 from eraserhd/autossh
port autossh service from nixos
2019-07-02 19:11:24 +02:00
Jason Felice 26c6e5f758 port autossh service from nixos 2019-07-02 10:44:34 -04:00
Daiderd Jordan 2ee34a1d24 travis: add workaround for install test
This shouldn't be necessary and is probably a bug.
2019-07-02 00:25:43 +02:00
Daiderd Jordan a5e3dbb8a4 launchd: don't disable services when unloading 2019-07-01 23:44:21 +02:00
Daiderd Jordan 462a17b1f1 installer: detect multi-user install 2019-07-01 23:02:29 +02:00
Daiderd Jordan bbedef2143 darwin-rebuild: fix check 2019-07-01 22:42:44 +02:00
Daiderd Jordan 4bffc92b7a nix: check nix.useDaemon value
This case will cause problems when existing files in /etc are replaced
instead of skipped with a warning, potentially breaking the nix install
in the process.
2019-07-01 22:37:03 +02:00
Daiderd Jordan 8c2b25e60d nix: fix useDaemon conditions
The nix.useDaemon option enables using a multi-user install without
managing the nix installation with nix-darwin.  The following checks
apply to both cases.
2019-07-01 21:24:29 +02:00
Daiderd JordanandGitHub 2415dd6e42 Merge pull request #148 from domenkozar/patch-1
darwin-installer: use --show-trace
2019-07-01 21:06:54 +02:00
Domen KožarandGitHub 48a9159b35 darwin-installer: use --show-trace
This saved me some debugging
2019-06-25 19:50:37 +02:00
Daiderd JordanandGitHub 7dec9686fb Merge pull request #144 from kevingriffin/postgres-character-set
nix-darwin/postgresql: add character set config
2019-06-05 23:28:23 +02:00
Daiderd Jordan 7aa0ad23f4 darwin-rebuild: fix activate without an existing profile 2019-06-05 23:23:59 +02:00
Daiderd Jordan d56312be06 activation-scripts: create /run
In case this was removed or not bootstrapped by the installer.
2019-06-05 23:10:07 +02:00
Daiderd Jordan 24089a93d7 darwin-rebuild: add activate command
This command activates the current system again, mostly useful when the
system was built on another host and substituted.
2019-06-05 22:59:23 +02:00
Daiderd Jordan ae58eb80d2 nix-script: remove 2019-06-05 21:45:47 +02:00
Daiderd Jordan 7941b13682 version: fix description 2019-06-05 21:45:47 +02:00
Daiderd Jordan 3c4a001d99 nixos-rebuild: change default editor to vi 2019-06-05 21:45:47 +02:00
Daiderd Jordan 71c68087e8 darwin-rebuild: fix quoting 2019-06-05 21:45:46 +02:00
Kevin Griffin e60725bd3d postgresql: add character set config
`initdb` expects to read the locale or SQL_ASCII environment
variable to determine the most appropriate character set.
Instead, offer a configuration option.
2019-05-29 17:25:56 +09:00
Daiderd JordanandGitHub 8d557721a9 Merge pull request #141 from hercules-ci/hercules-ci-agent
Add hercules-ci-agent
2019-05-28 19:43:22 +02:00
Domen Kožar 642ad98829 hercules-ci-agent: simplify package import 2019-05-17 10:41:39 +07:00
Domen Kožar bb91a4d6c3 SSL_CERT_FILE -> NIX_SSL_CERT_FILE 2019-05-17 10:22:22 +07:00
Domen Kožar fb0a1763f5 Add hercules-ci-agent 2019-05-16 15:03:54 +07:00
Daiderd Jordan 3ba909eb2d version: add default darwinRevision
There's no channel for darwin so this can be unavailable if a tarball or
shallow clone is used.
2019-05-04 21:43:47 +02:00
Daiderd Jordan 61d81e7706 doc: fix module references 2019-05-04 21:23:53 +02:00
Daiderd Jordan ba29af7ae3 version: include darwin metadata in system label
This makes it possible to trace back what version of both darwin and
nixpkgs the system was built with.
2019-05-04 21:11:49 +02:00
Daiderd Jordan 3da5c1a322 lnl: open up per-user paths in sandbox 2019-05-04 18:37:21 +02:00
Daiderd Jordan b3e96fdf66 add changelog entry for manual 2019-05-04 16:15:55 +02:00
Daiderd Jordan 3ab430289f add link to manual and wiki 2019-05-04 16:10:39 +02:00
Daiderd JordanandGitHub 422b13681e Merge pull request #138 from LnL7/manual
doc: add manual
2019-05-04 16:10:19 +02:00
Daiderd Jordan 9bb40a50be travis: build manpages 2019-05-04 15:46:30 +02:00
Daiderd Jordan da88e60bca release.nix: add manual builds 2019-05-04 15:39:32 +02:00
Daiderd Jordan 23d8c6ca3d documentation: add module for darwin manual
Fixes #72
2019-05-04 15:38:17 +02:00
Daiderd Jordan b85b9a4206 doc: add manual build for module options 2019-05-04 15:38:01 +02:00
Daiderd Jordan 631fd857aa modules: add modules-list.nix and baseModules argument 2019-05-04 14:50:22 +02:00
Daiderd Jordan 66495818a3 sandbox: add missing option descriptions 2019-05-04 14:46:24 +02:00
Daiderd Jordan dc923dbac2 ofborg: fix option descriptions 2019-05-04 14:43:36 +02:00
Daiderd Jordan 2cda9f7113 darwin-option: add support for -I 2019-05-01 13:26:04 +02:00
Daiderd Jordan d3c46c9442 add changelog entry for NIX_PATH 2019-05-01 13:04:50 +02:00
Daiderd Jordan 58aa5bf185 nix: make nix.nixPath merge by default
Since named entries can be overridden now based on ordering now merging
is only a problem for removing one of the default search paths, in which
case a higher priority eg. mkForce can be used.

	{
	  nix.nixPath = [{ darwin-config = "/darwin.nix"; }];
	}

Will result in

	[ "darwin-config=/darwin.nix" "/nix/var/nix/profiles/per-user/root/channels" "$HOME/.nix-defexpr/channels" ]

Fixes #137
2019-05-01 12:42:31 +02:00
Daiderd Jordan 4d235b800d nix: allow specifying named NIX_PATH using and attrset
This gives the option nicer merge behaviour, otherwise setting a named
entry multiple times would result in duplicates which can't be resolved
without overriding the entire list.
2019-05-01 12:30:00 +02:00
Daiderd JordanandGitHub 51ecc4151f Merge pull request #135 from marsam/feature/postgresql-plugins
postgresql: Add support for extraPlugins
2019-03-30 10:30:58 +01:00
Daiderd JordanandGitHub 66d64a91e6 Merge pull request #136 from marsam/postgres-coreutils-ln
postgresql: Use core `ln` from coreutils
2019-03-30 10:30:08 +01:00
Mario Rodas 6a6d512d40 postgresql: Use core ln from coreutils
Otherwise it fallbacks to /bin/ln which is outdated and might not work.
2019-03-29 07:22:01 -05:00
Mario Rodas 8ee2585c0d postgresql: Add support for extraPlugins 2019-03-25 14:28:40 -05:00
Daiderd JordanandGitHub 2430e72100 Merge pull request #132 from ben-z/add-defaults-configs
Add defaults configs
2019-03-22 20:52:34 +01:00
Daiderd Jordan af7cd05699 launchd: add basic test for daemons/agents 2019-03-22 20:49:53 +01:00
Daiderd Jordan b68f77b404 launchd: ensure user LaunchAgents exist
Apparently this doesn't exist by default, so make sure it's created
first.

Fixes #134
2019-03-22 20:48:58 +01:00
Daiderd Jordan 13f2480374 lnl: update reexec aliases 2019-03-20 20:51:35 +01:00
Ben Zhang f17fb87fab Add NSGlobalDomain configs 2019-03-02 21:51:13 -08:00
Ben Zhang a08546158d add trackpad configs: ActuationStrength, FirstClickThreshold, SecondClickThreshold 2019-03-02 21:50:48 -08:00
Daiderd Jordan feaf3718db add changelog entry for user packages 2019-02-24 22:52:29 +01:00
Daiderd Jordan d00d00998e darwin: replace usages of nix-instantiate --eval with --find-file 2019-02-24 22:27:41 +01:00
Daiderd JordanandGitHub 944d217c3a Merge pull request #128 from kalbasit/nix-darwin_create-user-directory
users: create the home directory when creating a new user
2019-02-24 22:15:06 +01:00
Wael M. NasreddineandDaiderd Jordan 41a00f14b4 users: gate the creation with an option, false by default and use createhomedir 2019-02-24 22:13:45 +01:00
Wael M. NasreddineandDaiderd Jordan 7c68f69154 users: create/chown the home only when it is different than /var/empty 2019-02-24 22:06:45 +01:00
Wael M. NasreddineandDaiderd Jordan 303c5fbb00 users: create the home-directory for a new user 2019-02-24 22:06:37 +01:00
Daiderd Jordan 6c6c8f2164 users.users: only extend profiles if packages are defined 2019-02-23 12:00:39 +01:00
Daiderd JordanandGitHub ece03c592e Merge pull request #127 from kalbasit/nix-darwin_user-packages
users: install user packages via users.users.<name?>.packages
2019-02-23 11:45:40 +01:00
Daiderd JordanandGitHub c48c4c701a Merge pull request #121 from thefloweringash/channel-version-info
system-version: get version information from channels
2019-02-23 11:35:52 +01:00
Wael M. Nasreddine 5e6570c07c order the environment 2019-02-21 15:57:51 -08:00
Daiderd Jordan 1a3a9d91b4 nix-daemon: make default values overridable without mkForce 2019-02-22 00:02:10 +01:00
Daiderd Jordan 132a7f0a09 users: increase default nixbld users to 32 and set knownUsers by default
Since the users.nix.configureBuildUsers target nixbld users, don't require
them to be added to knownUsers explicitly.
2019-02-21 23:15:09 +01:00
Wael M. Nasreddine af347fe1ec copy systemPackages test to userPackages 2019-02-20 08:39:44 -08:00
Wael M. Nasreddine 59d84f93e4 do actually source the test 2019-02-20 08:39:14 -08:00
Wael M. Nasreddine 4ffabd184a users: install user packages via users.users.<name?>.packages 2019-02-20 08:20:32 -08:00
Daiderd Jordan 94d2d20a5f nix-daemon: enable forking workaround by default
This should be relatively safe and there's still no real solution for
it.
2019-02-18 23:06:50 +01:00
Daiderd JordanandGitHub 261160e679 Merge pull request #126 from LnL7/fonts-activation
fonts: rewrite activation
2019-02-17 19:33:31 +01:00
Daiderd Jordan 4d892e7774 fonts: rewrite activation
The new implementation is a bit smarter and only updates fonts that
changed.  But more importantly /run/current-system isn't used anymore
which breaks initial activation and installs the previous set of fonts
instead of the one in the new system.

Fixes #115
2019-02-17 11:31:40 +01:00
Daiderd Jordan 0a8785c61b lnl: start tmux panes in a sandbox by default 2019-02-16 21:33:17 +01:00
Daiderd Jordan 58a2956870 tmux: add defaultCommand option 2019-02-16 21:05:32 +01:00
Daiderd Jordan 1464d9efd3 lnl: sandbox fetch-nixpkgs-updates service 2019-02-16 17:47:29 +01:00
Daiderd Jordan 1e67f6a2bc sandbox: add module for sandbox profiles
This could be used outside of nix-darwin, but this is mainly useful for
services since all of the inputs are known there.

	{
	  # $ /usr/bin/sandbox-exec -f $profile $coreutils/bin/ls /
	  # ls: cannot access '/': Operation not permitted
	  security.sandbox.profiles.example.closure = [ pkgs.coreutils ];
	}
2019-02-16 16:55:07 +01:00
Daiderd Jordan 10c34f1277 lnl: add tmp and var/tmp to sandbox paths 2019-02-12 23:23:04 +01:00
Daiderd Jordan e61dcc1024 lnl: (re)enable sandboxing with extra-sandbox-paths
There are still some problems with frameworks, this opens up the sandbox
enough by default to work around that and make it work like expected in
most cases.
2019-02-12 20:25:29 +01:00
Andrew Childs 349a4837cf system-version: get version information from channels 2019-01-19 15:02:55 +09:00
Daiderd Jordan e812130e5d system-packages: fix test 2019-01-18 23:36:15 +01:00
Daiderd Jordan a1c56d5492 system-packages: verify libraries are not linked
By default environment.pathsToLink does not include /lib so libraries
should not be exposed directly in the system output.
2019-01-18 23:18:45 +01:00
Daiderd Jordan 236d9b0c2d system-packages: make test actually check the expected behaviour 2019-01-18 23:13:42 +01:00
Daiderd Jordan 629fa53498 nix-daemon: use system NIX_SSL_CERT_FILE
Otherwise the daemon wouldn't honor extra certificates from the
security.pki options.
2019-01-16 22:47:19 +01:00
Daiderd Jordan 655b66975f lnl: disable cachix 2019-01-16 22:38:54 +01:00
Daiderd Jordan c50ba6a354 security.pki: add test for ca-certificates.crt 2019-01-15 22:14:56 +01:00
Daiderd Jordan 2e525a93da security.pki: add module to configure ca certificates
This makes NIX_SSL_CERT_FILE configurable and makes
/etc/ssl/certs/ca-certificates.crt available like nixos.
2019-01-15 21:55:08 +01:00
Daiderd Jordan 61e30229cc lnl: cleanup and configure nixbld users 2019-01-07 20:18:03 +01:00
Daiderd JordanandGitHub 9cd9232a4a Merge pull request #119 from kirelagin/zsh-vendor-completions
zsh: Add vendor-completions to fpath
2019-01-07 19:52:42 +01:00
Kirill Elagin 644d6acb7a zsh: Add vendor-completions to fpath 2019-01-04 15:50:48 +03:00
Daiderd Jordan 462ec30cb3 checks: add test for nix-gc user validation 2019-01-04 00:50:14 +01:00
Daiderd Jordan 458d09882e checks: actually fix gc condition
Introduced in 28710738a3, the check should
_only_ run if the user is not configured not the other way around.
2019-01-04 00:40:10 +01:00
Daiderd Jordan aedd304983 nix-gc: fix evaluation 2019-01-03 20:59:23 +01:00
Daiderd Jordan f05d6a858f nix-gc: add test 2019-01-03 20:59:23 +01:00
Daiderd Jordan 28710738a3 checks: fix gc condition
Don't fail if the user is configured properly.
2019-01-03 19:29:49 +01:00
Daiderd Jordan 918492f3ef add changelog entry for the verifyNixPath option 2019-01-02 21:19:24 +01:00
Daiderd Jordan 8a6c783616 checks: generalize and make them more configurable
All the checks are now aggregated in system.checks.text making it easy
to allow certain checks to be disabled as well as disabling them
alltogether if desired. eg.

    # Disable all checks.
    system.checks.text = mkForce "";

Fixes #117
2019-01-02 21:13:45 +01:00
Daiderd Jordan 72b3648fa0 nix-gc: add check for nix.gc.automatic
This hopefully avoids problems for people that try to enable the service
with a single-user install.

Fixes #118
2019-01-02 20:46:39 +01:00
Daiderd Jordan f5116b0f4d nix-gc: add user option
This configures the user that runs the garbage collector, particularly
useful for single-user installs.  Otherwise it runs as root resulting in
permission issues afterwards.
2019-01-02 20:24:00 +01:00
Daiderd JordanandGitHub 0a8741be9c Merge pull request #97 from peel/patch-1
[services.emacs] use `fg-daemon` flag for service
2019-01-02 20:02:27 +01:00
Daiderd Jordan 7f4a9ecb4d lnl: add nix-daemon objc workaround 2018-12-18 23:32:18 +01:00
Daiderd Jordan 5f7c0b6f56 lnl: fix reexec aliases 2018-12-18 23:21:21 +01:00
Daiderd Jordan bd1ad9fd60 lnl: enable gnupg agent 2018-12-18 23:21:20 +01:00
Daiderd Jordan 255da174c8 lnl: add awscli 2018-12-18 23:21:18 +01:00
Daiderd JordanandGitHub 2412c7f9f9 Merge pull request #111 from thefloweringash/shell-child-env
Unify environment configuration and don't run in child shells
2018-10-29 11:32:10 +00:00
Andrew Childs b5fc279d1b Combine system environment tests and add zsh 2018-10-29 09:12:20 +09:00
Daiderd Jordan 34a6eca033 Revert "installer: add NIX_PATH fallback in <darwin> lookup"
This reverts commit 06f8d83f60.
2018-10-27 00:14:38 +01:00
Daiderd Jordan 0146366b21 Revert "nix: make channel entries for NIX_PATH dynamic"
This reverts commit 95fb1cb2aa, 1324ccf2c1 and e5c988edf1.
2018-10-26 18:05:33 +01:00
Daiderd Jordan 63dfbc93d5 installer: include channels in bootstrap NIX_PATH 2018-10-26 17:47:45 +01:00
Daiderd Jordan e5c988edf1 checks: include channel paths for NIX_PATH checks 2018-10-26 17:26:14 +01:00
Daiderd Jordan 06f8d83f60 installer: add NIX_PATH fallback in <darwin> lookup
The nix.nixPath option doesn't include everything, some paths are added
dynamically now.
2018-10-26 17:09:19 +01:00
Daiderd Jordan 1324ccf2c1 add changelog entry for nix.enableChannels
This should have the same behaviour but it changed slightly when
overriding the defaults.
2018-10-26 16:01:14 +01:00
Daiderd Jordan 95fb1cb2aa nix: make channel entries for NIX_PATH dynamic
This avoids warnings like this if the root or user channel profiles
don't exist.

    warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
2018-10-26 15:49:24 +01:00
Daiderd Jordan 79d356909b installer: don't use pure PATH for editor
For the rest of the installer we want to make sure nothing installed by
the user interferes, however a user's editor might be installed
anywhere.
2018-10-26 09:10:28 +01:00
Andrew Childs 676ef10377 Unify environment configuration and don't run in child shells
This should enable `nix run` to work under shells like fish and zsh,
as well as making child shells not needlessly reset any environment
that should be inherited.

Implementation adapted from NixOS.
2018-10-25 01:00:52 +09:00
Daiderd JordanandGitHub e6a698a701 Merge pull request #109 from marsam/feature/update-bashrc-config
Do not evaluate /etc/bashrc on non-interactive shells
2018-10-17 19:04:48 +02:00
Mario Rodas 1a786eb088 bash: place bashrc early non-interactive return below system setup
Setting PATH and environment setup is required in non-interactive shells
2018-10-16 19:54:07 -05:00
Mario Rodas dff88ee954 bash: do not evaluate completions on dumb terminals 2018-10-14 10:38:48 -05:00
Mario Rodas b82bc64a0e bash: do not evaluate /etc/bashrc on non-interactive shells 2018-10-14 10:38:40 -05:00
Daiderd Jordan 5fa894c90a tests: avoid depending on an actual font package 2018-10-12 22:03:40 +02:00
Daiderd Jordan 9a04aea8ea tmux: remove reattach-to-user-namespace
It's not been needed anymore for a few macOS releases now.
2018-10-12 21:59:41 +02:00
Daiderd JordanandGitHub 9a192471bb Merge pull request #108 from thefloweringash/dock-show-recents
system.defaults.dock: add `show-recents` option
2018-10-11 19:29:04 +02:00
Daiderd JordanandGitHub 166560ca76 Merge pull request #102 from peel/f-fonts-module
initialise fonts module
2018-10-11 19:10:42 +02:00
Andrew Childs 4cfb4b084e system.defaults.dock: add show-recents option 2018-10-11 11:58:17 +09:00
Piotr Limanowski 00cd92968e skip buildEnv and create a package with /share/fonts 2018-10-06 20:38:01 +02:00
Piotr Limanowski 2a53ac278f fonts: adds enableFontDir flag
For NixOS compatibility reasons we're using enableFontDir flag that
in turn enables/disables font management in /Library/Fonts directory.
2018-10-05 22:27:29 +02:00
Piotr Limanowski da886d015c fonts: extracts helpers to top-level let expr 2018-10-05 19:17:43 +02:00
Piotr Limanowski c2d7870587 adds info on automatic removal of manually-added fonts 2018-10-04 20:40:19 +02:00
Piotr Limanowski 397d2637e9 looks for fonts with both otf and ttf extensions 2018-10-04 13:48:57 +02:00
Piotr Limanowski 8fe33a584e adds recursive font searching 2018-10-04 13:14:45 +02:00
Daiderd JordanandGitHub 81068e51e9 Merge pull request #106 from thanegill/patch-1
Remove Security link from README
2018-10-02 22:02:01 +02:00
Thane GillandGitHub 487bec1a6f Remove Security link from README
Doesn't exist anymore
2018-10-02 11:49:32 -07:00
Piotr Limanowski 6d0cf2d842 add tests for fonts 2018-10-02 19:59:23 +02:00
Daiderd JordanandGitHub dff2df8bfe Merge pull request #103 from luigy/fix-quoting-in-nixPath-check
Fix quoting for nixPath check
2018-10-01 19:51:33 +02:00
Luigy Leon a15b59594f Fix quoting for nixPath check 2018-09-30 10:56:32 -04:00
Piotr Limanowski b10e114e33 re-add fonts on every rebuild 2018-09-30 14:53:16 +02:00
Piotr Limanowski 7a7cbdc165 initialise fonts module 2018-09-30 13:22:24 +02:00
Daiderd Jordan b2d62a6f44 lnl: move gitconfig to dotfiles 2018-09-21 20:14:02 +02:00
Daiderd JordanandGitHub 6a1a826450 Merge pull request #83 from marsam/feature/add-synapse-bt-sevice
synapse-bt: add synapse-bt service
2018-09-16 03:25:18 +02:00
Mario Rodas 6d5dcd60eb synapse-bt: Add basic test 2018-09-15 15:37:22 -05:00
Mario Rodas 5d272ddaf2 synapse-bt: add synapse-bt service 2018-09-15 15:37:22 -05:00
Daiderd JordanandGitHub c49311408b Merge pull request #99 from Enzime/add/synergy-service
synergy: Add module for client and server
2018-09-14 22:57:51 +02:00
Daiderd JordanandGitHub a49864fd95 Merge pull request #100 from LnL7/installer-2.1
installer: prefer nix from default profile
2018-09-14 22:39:24 +02:00
Daiderd Jordan 803bf18141 uninstaller: continue if removing channel fails and make nix-daemon reload more robust
Kind of a workaround, but failing to remove the channel isn't a big
deal.
2018-09-14 22:32:49 +02:00
Daiderd Jordan 75add386d3 installer: prefer nix from default profile
Using a nix 2.1 nix-channel/nix-env with a 2.0 nix-daemon doesn't work
because the buildenv implementation was moved to the daemon.  This means
the nix version of the target darwin system can't be used because the
daemon isn't upgraded yet.

    error: unsupported builtin function 'buildenv'
2018-09-14 22:29:08 +02:00
Daiderd Jordan 48f3ed6301 nix: only set NIX_REMOTE for nix 1.11
This isn't needed anymore, nix 2.0 figures this out automatically now.
2018-09-14 21:40:19 +02:00
Michael Hoang 32d7297f98 synergy: Add tests for config options 2018-09-14 21:01:08 +10:00
Michael Hoang 6d013ea166 synergy: Add module for client and server 2018-09-14 20:48:23 +10:00
Daiderd Jordan 9347dc05d1 lnl: make git commit verbose by default
Having the diff context for both commit and rebase -i is really useful
while writing commit messages.
2018-09-13 22:57:56 +02:00
Daiderd Jordan add86e33a2 lnl: add system packages 2018-09-05 22:49:54 +02:00
Piotr LimanowskiandGitHub 3fabc3d842 use fg-daemon flag for emacs service
As the default package is now emacs 26.1 and --daemon flag falls back to forking behaviour the recommended way is to use fg-daemon, see: lists.gnu.org/archive/html/emacs-devel/2016-11/msg00383.html, lists.gnu.org/archive/html/emacs-devel/2017-05/msg00861.html
2018-09-03 19:54:56 +02:00
Daiderd Jordan 7750896cc7 checks: update and improve darwin-config message
Now that environment.darwinConfig exists it's a better choice otherwise
multiple NIX_PATH entries need to be added.
2018-08-26 14:47:40 +02:00
Daiderd Jordan e57ac2ee71 simple: add environment.darwinConfig example 2018-08-26 14:33:40 +02:00
Daiderd Jordan f473b21c9f environment: add darwinConfig option to set darwin-config in NIX_PATH
This simplifies using a non default configuration.nix without requiring
a symlink or redefining NIX_PATH.

The nix.nixPath option only defines a default which means defining a value
will drop all of the defaults. This is because correct merge behaviour
isn't very clear for named entries.
2018-08-26 14:09:01 +02:00
Daiderd Jordan 483a906c90 lnl: add vim dotfiles comment 2018-08-25 18:54:08 +02:00
Daiderd Jordan e299b29e9a lnl: replace kwm
The new chunkwm is much faster and fixes a few issues that kwm used to
have. Sadly the package can't be built without CommandLineTools at the
moment because it depends on 10.11 frameworks.:
2018-08-25 00:36:00 +02:00
Daiderd Jordan 2b6447df5e chunkwm: support multiple outputs
Since the package contains both chunkwm (daemon) and chunc (client) the
daemon shouldn't really be in PATH by default.  Usually libexec is used
for this, however this would break the current expression used by
people.  This enables moving chunkc to a bin output for this purpose.

eg. https://github.com/LnL7/dotfiles/commit/7ad4b4d23d029bb36213171df6447ca0838e2226
2018-08-24 23:55:38 +02:00
Daiderd Jordan 90c34df929 lnl: use environment.d 2018-08-23 00:13:03 +02:00
Daiderd Jordan b1e32f0789 lnl: fix darwin-zsh-completions name 2018-08-22 22:57:36 +02:00
Daiderd Jordan c84e05a3be lnl: update alias functions 2018-08-21 23:42:15 +02:00
Daiderd Jordan f190254679 examples: remove nix-repl and nixUnstable references 2018-08-21 22:42:33 +02:00
Daiderd Jordan 6de3c1f3e1 lnl: simplify example config 2018-08-21 22:35:03 +02:00
Daiderd Jordan 4c6a5f4dfa lnl: disable vim guiSupport 2018-08-07 19:49:42 +02:00
Daiderd Jordan 7b379f115c lnl: add <darwinpkgs> 2018-08-03 23:03:33 +02:00
Daiderd Jordan 5a081e09ce vim: expose programs.vim.package 2018-08-03 20:39:23 +02:00
Daiderd Jordan 6424eb998d vim: formatting 2018-08-03 20:31:37 +02:00
Daiderd Jordan 958ebb7966 darwin-rebuild: don't run nix-build for edit 2018-08-03 20:16:43 +02:00
Daiderd JordanandGitHub f6970956c3 Merge pull request #94 from zimbatm/darwin-rebuild-edit
darwin-rebuild edit
2018-08-03 19:51:30 +02:00
Daiderd JordanandGitHub 6418523767 Merge pull request #92 from carlosdagos/privoxy-service
Add a privoxy service
2018-08-03 19:35:16 +02:00
zimbatm a25d345a7e darwin-rebuild edit
As a user I don't want to remember where the configuration exists. This
adds a command that will point the $EDITOR to the <darwin-config> file.

    darwin-rebuild edit
2018-08-03 15:13:42 +01:00
Daiderd Jordan 91de10c24a lnl: update 2018-08-02 21:02:08 +02:00
Carlos D 41a6a40f53 Add a privoxy service 2018-08-02 10:09:22 +10:00
Daiderd Jordan 2c65fecf2c lnl: add git statusbar 2018-08-01 22:32:49 +02:00
Daiderd Jordan 79ebb8aebc lnl: update tmux status 2018-08-01 22:14:25 +02:00
Daiderd Jordan 69dc676f7d lnl: cleanup vim config 2018-08-01 21:32:42 +02:00
Daiderd Jordan 35c23a8fbf lnl: update direnv/nix-repl aliases 2018-08-01 21:13:38 +02:00
Daiderd Jordan a893723b95 activation: fix missing /sbin entries in PATH 2018-08-01 21:08:13 +02:00
Daiderd JordanandGitHub 09d5b6aae5 Merge pull request #84 from periklis/fix-offlineimap-args
[service/offlineimap]: Fix args passing to execvp
2018-08-01 19:46:19 +02:00
Periklis TsirakidisandDaiderd Jordan 17af73ddd5 Fix args passing to execvp 2018-08-01 19:40:59 +02:00
Daiderd JordanandGitHub 5702b212b1 Merge pull request #87 from kirelagin/clean-path
installer and activation: Sanitise PATH
2018-08-01 19:23:49 +02:00
Daiderd JordanandGitHub 5cdfed8063 Merge pull request #90 from alyssais/skhd_default
Make the skhd service default to the skhd package
2018-08-01 19:20:14 +02:00
Alyssa Ross af84b3c519 Make the skhd service default to the skhd package
This can be overrided if necessary, but I don't see any reason the
nixpkgs package shouldn't be the default. It looks like this package
didn't exist when the service was created.
2018-07-27 16:12:49 +01:00
Daiderd Jordan fa3f67966b types.string -> types.str
These options unintentionally used the deprecated string type, the
important difference between these is the fact that string merges by
default (similar to eg. lines) while str can only have a single value.
2018-07-21 13:27:08 +02:00
Daiderd Jordan 67f1510862 lnl: increase synmaxcol 2018-07-08 11:53:55 +02:00
Daiderd Jordan 4e36591b07 lnl: khd -> skhd 2018-07-08 11:53:55 +02:00
Daiderd Jordan 2726b44842 lnl: add completions for darwin-rebuild 2018-07-08 11:53:55 +02:00
Daiderd Jordan e7ac0cc02d lnl: add xi.io alias 2018-07-08 11:53:54 +02:00
Daiderd Jordan ca4af74fca lnl: update nix prompt 2018-07-08 11:53:54 +02:00
Daiderd Jordan 4cd5454f29 lnl: add direnv 2018-07-08 11:53:54 +02:00
Kirill Elagin 45f0e832cd fixup! installer and activation: Sanitise PATH 2018-06-29 19:05:57 +03:00
Kirill Elagin 26bab2fd32 installer and activation: Sanitise PATH
This makes sure that the installation and activation processes are “pure”,
i.e. they use only binaries from nixpkgs or ones that come with macOS.

Closes #86.
2018-06-29 18:51:41 +03:00
Daiderd JordanandGitHub 9f18c93771 Merge pull request #85 from kirelagin/more-nix
installer: Bring our own `nix-instantiate`
2018-06-29 15:51:39 +02:00
Kirill Elagin 2fec230ccc installer: Bring our own nix-instantiate 2018-06-29 15:15:35 +03:00
Daiderd Jordan c1a1ac273d users: add forceRecreate option 2018-06-22 12:16:51 +02:00
Daiderd Jordan a9db65f39a lnl: enable socket listener for nix-daemon service 2018-06-21 15:23:46 +02:00
Daiderd Jordan 9987c71c83 nix-daemon: add tests 2018-06-21 15:22:12 +02:00
Daiderd Jordan 27a5758728 nix-daemon: add option to make service socket activated
This makes the service start on demand when a client connects to the
daemon socket, instead of keeping it alive.

    services.nix-daemon.enableSocketListener = true;
2018-06-21 15:20:49 +02:00
Daiderd Jordan a2a7e8173f lnl: fix hydra-bad-machines, whitespace? 2018-06-07 20:55:16 +02:00
Daiderd Jordan 81169fc83e lnl: add hydra-bad-machines alias 2018-06-07 01:18:48 +02:00
Daiderd Jordan b0a8af6cc9 lnl: add nix aliases 2018-06-06 23:18:06 +02:00
Daiderd JordanandGitHub 6f970ca1b0 Merge pull request #81 from periklis/service-offlineimap
Init offlineimap service
2018-06-06 20:39:19 +02:00
Periklis Tsirakidis 94fdf827e1 Add appropriate option defaults 2018-06-05 10:55:01 +02:00
Periklis Tsirakidis b85d89a1ae Init offlineimap service 2018-06-04 16:25:07 +02:00
Daiderd JordanandGitHub 07175b169b Merge pull request #80 from kirelagin/gpg-agent
gnupg: add gpg-agent service
2018-05-27 14:41:12 +02:00
Kirill Elagin 8e1f40ad48 gnupg: add gpg-agent service
Fixes #77.
2018-05-18 23:19:06 +03:00
Daiderd JordanandGitHub 192e2b40e0 Merge pull request #75 from rvl/buildkite-agent-fixes
buildkite-agent fixes
2018-05-12 11:17:15 +02:00
Rodney Lorrimar 6d6d11fdad fixup! buildkite-agent: fix variable expansion in hook scripts
Addresses PR review comment.
2018-05-10 11:43:49 +01:00
Daiderd Jordan 6dbc6d43b5 nixpkgs: replace usage of deprecated traceValIfNot 2018-05-04 19:12:43 +02:00
Rodney Lorrimar 80baf76185 buildkite-agent: Only start service once networking is available
buildkite-agent gets the hostname at startup, so needs to be started
after the hostname is set.
2018-04-25 09:37:30 +01:00
Rodney Lorrimar 6aac14a46d buildkite-agent: fix variable expansion in hook scripts
@cleverca found this bug in the declarative hooks config. Any shell
variables referenced in a hook script would get expanded by the hooks
directory builder.

Prevent variable expansion by quoting the here doc limit string.
2018-04-25 06:56:28 +01:00
Daiderd Jordan 5ea3bc169a lnl: fix relativenumber lag? 2018-04-22 14:35:18 +02:00
Daiderd Jordan 49b899dd97 installer: make configuration writable
If the installer is built from a channel or url the example is copied
from the store and won't have write permissions.
2018-04-14 00:28:11 +02:00
Daiderd Jordan cdab52bbe8 bump stateVersion in examples 2018-04-08 12:01:23 +02:00
Daiderd Jordan 7b028e944b nix: use literalExample for package 2018-03-29 22:40:51 +02:00
Daiderd Jordan a8847b28e7 darwin-option: improve default/example printing 2018-03-29 22:34:35 +02:00
Daiderd Jordan eb1a841b4f nix: use mkDefault for nix profile 2018-03-29 22:09:26 +02:00
Daiderd Jordan 4b8527e4e3 fix changelog dates, oops 2018-03-29 21:30:42 +02:00
Daiderd Jordan 22e832628f nix: add version option
This can be used to declare the system version of nix when a profile is
used instead of a package.
2018-03-29 21:19:37 +02:00
Daiderd Jordan acdcebb508 add changelog entry for nix.package 2018-03-29 21:11:37 +02:00
Daiderd Jordan cd049bfdf6 nix: use pkgs.nix by default instead of the default profile
This fixes version detection for 2.0.
2018-03-29 21:10:18 +02:00
Daiderd Jordan 4899b6658f khd: don't depend on kwm directly
Iff the kwm service is enabled the commands will still be in the default PATH.
2018-03-27 21:42:50 +02:00
Daiderd Jordan bd37b66faf skhd: simplify service 2018-03-27 21:34:30 +02:00
Daiderd Jordan 072d2e75ab zsh: fix nix run shells of nix 2.0 2018-03-27 00:32:31 +02:00
Daiderd Jordan 133b43a2cf readme: update with better example config 2018-03-26 22:47:40 +02:00
Daiderd Jordan 49a56612c0 simple: add comment for nix package/daemon options
Hopefully this helps to clarify the default behaviour.
2018-03-26 22:43:53 +02:00
Daiderd Jordan f2ff808a4f nix: update config options for 2.0 2018-03-26 22:14:58 +02:00
Daiderd Jordan a9e0f71c50 nix-daemon: make cacert overridable without mkForce
Fixes #74
2018-03-26 21:53:31 +02:00
Daiderd Jordan cde11cf2b8 add changelog entry for ssh.knownHosts 2018-03-06 21:25:23 +01:00
Daiderd Jordan bb9fe63acd ssh: add basic tests for known hosts 2018-03-06 21:21:48 +01:00
Daiderd Jordan 2b721afd99 ssh: add option to configure known hosts 2018-03-06 20:42:33 +01:00
Daiderd Jordan 84a3fcadd0 ofborg: add basic test 2018-03-05 23:00:50 +01:00
Daiderd Jordan 2bcccfab29 ofborg: add more comments to the example 2018-03-05 22:43:47 +01:00
Daiderd Jordan f1f6a81b9a buildkite: remove package from test closure 2018-03-05 21:46:12 +01:00
Daiderd Jordan 25b2f87b58 skhd: add basic test 2018-03-05 21:41:52 +01:00
Daiderd Jordan 0cd791527f lnl: fix qes keybinds 2018-03-05 21:23:13 +01:00
Daiderd JordanandGitHub 005ccb6987 Merge pull request #73 from peel/master
adds skhd module
2018-03-05 21:10:36 +01:00
peel 81018ab64d removes accessibility setting as it's been removed by darwin
for the record, this is related to https://support.apple.com/en-us/HT204899
2018-03-05 07:10:27 +01:00
Daiderd Jordan c232436db5 lnl: fix shift keybindings 2018-03-04 18:34:06 +01:00
Piotr Limanowski 577961c162 adds skhd module 2018-03-03 15:25:43 +01:00
Daiderd Jordan fa21f6426b lnl: updates 2018-03-03 14:18:57 +01:00
Daiderd Jordan 055287cf98 users: update the description for knownGroups/knownUsers 2018-03-03 13:51:48 +01:00
Daiderd Jordan 8aab7a0c68 khd: use net on_enter for kwm borders 2018-03-02 21:12:10 +01:00
Daiderd Jordan f4af8cd677 add screencapture option to defaults-write test 2018-03-01 21:41:38 +01:00
Daiderd JordanandGitHub d00893d2fa Merge pull request #71 from cmacrae/master
defaults: Add screencapture.location
2018-03-01 21:19:48 +01:00
cmacrae 9a1499b128 defaults: set screencapture.location's default to null 2018-03-01 13:20:16 +00:00
Daiderd Jordan 42fb777813 activate-system: run keyboard activation at boot
The keyboard mappings are not persistent and need to be reapplied after
a reboot.
2018-02-28 20:18:49 +01:00
cmacrae 93f0692422 examples: remove screencapture.location from @LnL's confg (sorry!) 2018-02-28 08:21:30 +00:00
cmacrae 55f4331e73 defaults: Add screencapture.location 2018-02-27 17:24:45 +00:00
Daiderd JordanandGitHub e9fc93dab5 Merge pull request #70 from rvl/buildkite-agent-module
Add buildkite-agent module
2018-02-26 20:39:54 +01:00
Rodney Lorrimar 48d6fe551d buildkite-agent service: add test case 2018-02-26 18:19:22 +00:00
Rodney Lorrimar 5869c4e45b fixup! buildkite-agent service: init for nix-darwin 2018-02-23 20:04:29 +00:00
Rodney Lorrimar ed6e80a179 buildkite-agent service: init for nix-darwin 2018-02-23 12:29:55 +00:00
Rodney Lorrimar ef9427dbf0 buildkite-agent service: copy from NixOS 2018-02-22 12:36:00 +00:00
Daiderd Jordan 3bf2c6652f nix: don't set signed-binary-caches for nix 2.0
The option was removed.
2018-02-01 20:02:35 +01:00
Daiderd Jordan 3888df8e2b ofborg: add channel commands to example 2018-01-30 01:28:35 +01:00
Daiderd Jordan 693c89f867 launchd: run unload without -w
The service will be removed anyway.
2018-01-29 23:14:47 +01:00
Daiderd Jordan e82885507b ofborg: add example configuration 2018-01-29 22:43:55 +01:00
Daiderd Jordan 5fa6f21d06 ofborg: init service 2018-01-29 22:37:25 +01:00
Daiderd Jordan 6f1c1049dd installer: fallback to a default editor 2018-01-24 22:37:40 +01:00
Daiderd Jordan 4757a160e2 hydra: disable spotlight 2018-01-23 19:45:25 +01:00
Daiderd Jordan dc575ed17d hydra: cleanup 2018-01-23 19:42:49 +01:00
Daiderd Jordan dc33fe3d89 system: use preferLocalBuild for simple derivations
Most of the builds like system.build.etc will be faster when built
locally, they also don't depend on CC.
2018-01-21 13:46:30 +01:00
Daiderd Jordan b761ee79a3 zsh: add test for most options 2018-01-20 23:00:24 +01:00
Daiderd Jordan 02a8d469da bash: move file 2018-01-20 01:35:42 +01:00
Daiderd Jordan 630ab79197 bash: remove shell wrapper 2018-01-20 01:34:45 +01:00
Daiderd Jordan abd9a7c2fe zsh: remove shell wrapper 2018-01-20 01:32:33 +01:00
Daiderd Jordan 1b8e3d3aeb lnl: add hydra-job-bisect helper 2018-01-18 22:19:36 +01:00
Daiderd Jordan ca457383ab lnl: add gnupg 2018-01-18 20:22:12 +01:00
Daiderd Jordan e431dd78a2 uninstaller: don't fail on nix-daemon checks 2018-01-18 18:51:46 +01:00
Daiderd Jordan 9454e409b7 checks: fail when db permissions are wrong 2018-01-18 00:12:38 +01:00
Daiderd Jordan c0f913d2ae checks: rename file 2018-01-17 23:28:54 +01:00
Daiderd Jordan e3281c90cf defaults: move com.apple.smb.server to /activate
Currently fails with permission errors.
2018-01-17 23:10:57 +01:00
Daiderd Jordan 81bdd38e8d defaults: add ServerDescription for sharing services 2018-01-17 22:36:06 +01:00
Daiderd Jordan c5ecf11b57 uninstaller: fix removal of /run/current-system 2018-01-17 22:16:48 +01:00
Daiderd Jordan f0d7b5a071 release: rename basic tests 2018-01-17 22:04:48 +01:00
Daiderd Jordan 6f45339cfe uninstaller: add post check 2018-01-17 22:00:05 +01:00
Daiderd Jordan fc3a096f67 uninstaller: remove darwin channel 2018-01-17 21:34:01 +01:00
Daiderd Jordan c2728318fb installer: add post check 2018-01-17 21:31:47 +01:00
Daiderd Jordan d4b34322c5 networking: don't set NetBIOSName
This doesn't look like the hostname on my system, it has an extra unique prefix.
2018-01-17 20:09:24 +01:00
Daiderd Jordan 4d4acf6550 zsh: don't clobber promptInit in a nix-shell
Configure this yourself if you want a different prompt
when a nix-shell is active.
2018-01-17 01:54:02 +01:00
Daiderd Jordan 2aeaa86bc7 formatting 2018-01-17 00:39:02 +01:00
Daiderd Jordan f8353f2336 nix: remove redundant user check 2018-01-17 00:36:38 +01:00
Daiderd Jordan 4747989bc6 installer: test activation on travis 2018-01-16 20:43:11 +01:00
Daiderd Jordan 2a271720d0 add single user warning to changelog 2018-01-16 20:41:57 +01:00
Daiderd Jordan 53517162da nix: fix daemon check, only set if store is not writable
Fixes issues for a single-user install introduced in
9792b08fdf.
2018-01-16 20:32:29 +01:00
Daiderd Jordan d8380cdd80 users: test isHidden = false; 2018-01-16 00:58:13 +01:00
Daiderd Jordan ed29ade5ce add uninstall section to the manual 2018-01-16 00:58:13 +01:00
Daiderd Jordan 3d7bad57b2 lnl: add rev-nixpkgs helper 2018-01-16 00:58:13 +01:00
Daiderd Jordan 64a46b7164 uninstaller: add header 2018-01-16 00:58:13 +01:00
Daiderd Jordan 02725e220a installer: fix editor check 2018-01-16 00:58:12 +01:00
Daiderd Jordan e2acb8f82a uninstaller: run on travis 2018-01-15 08:51:04 +01:00
Daiderd Jordan bd220c453d launchd: unlink services 2018-01-15 08:51:03 +01:00
Daiderd Jordan 6e42f63784 uninstaller: init 2018-01-15 01:12:26 +01:00
Daiderd Jordan 86fe053806 darwin: include nix in PATH
This makes rollbacks more reliable, previously you had to fix your PATH
before calling darwin-rebuild. This works now:

$ /nix/var/nix/profiles/system-866-link/sw/bin/darwin-rebuild switch -G 866
2018-01-14 22:24:36 +01:00
Daiderd Jordan 29f9fb52b3 activation-scripts: include system in PATH
This makes rollback more reliable by using the same version of tools
that where used previously. For example nix is used during the
activation checks.
2018-01-14 22:02:27 +01:00
Daiderd Jordan ca1678c06c release: show system path in tests 2018-01-14 21:17:25 +01:00
Daiderd Jordan d6e85130f4 examples: add zsh/fish options 2018-01-14 19:31:48 +01:00
Daiderd Jordan d44ac23e06 update README with installer instructions 2018-01-14 19:29:30 +01:00
Daiderd Jordan ac238d0323 installer: ask to edit configuration before installing
This is skipped when stdin is not a tty, unlike the other interactive
parts that look at stdout.
2018-01-14 19:08:02 +01:00
Daiderd Jordan d31dbefca7 installer: configure build users 2018-01-14 17:18:10 +01:00
Daiderd Jordan 4e0ddf3061 users: add option to configure nixbld users. 2018-01-14 16:58:09 +01:00
Daiderd Jordan 1ba19da50d users: make users hidden by default 2018-01-14 16:45:43 +01:00
Daiderd Jordan 937bf1e83c nix: add note about multi-user installs for distributed builds 2018-01-14 16:08:27 +01:00
Daiderd Jordan 46d6951fd2 activation-scripts: add test for pre/post hooks 2018-01-14 16:08:27 +01:00
Daiderd Jordan e9cbcbb549 installer: test on travis 2018-01-14 16:07:47 +01:00
Daiderd Jordan d107dfbc3a installer: move /run creation 2018-01-14 16:07:46 +01:00
Daiderd Jordan 850dc95145 installer: fix patch 2018-01-14 16:07:46 +01:00
Daiderd Jordan 04ed74ca63 hydra: make user a member of the hydra group
The trusted-users setting works based on group membership, the primary
group id doesn't matter.
2018-01-14 13:31:58 +01:00
Daiderd Jordan ca420b2f9e users: add test for group membership 2018-01-14 13:31:15 +01:00
Daiderd Jordan b1645201f1 users: add support for group members
Unlike user options this is updated if the group already exists.
2018-01-14 13:26:18 +01:00
Daiderd Jordan f0e4aabb78 bootstrap: remove profile patch 2018-01-14 01:53:57 +01:00
Daiderd Jordan bfac6569ab bootstrap: add fix for /etc/profile
Also skip channel creation if <darwin> is already configured.
2018-01-13 23:46:55 +01:00
Daiderd Jordan 977ed04a60 installer: setup /run 2018-01-13 23:33:27 +01:00
Daiderd Jordan 9dd2d679cb installer: add --check flag 2018-01-13 23:33:27 +01:00
Daiderd Jordan 32481b542b installer: init 2018-01-13 23:33:27 +01:00
Daiderd Jordan 335baf7936 add users to README 2018-01-13 23:28:11 +01:00
Daiderd Jordan 37a8e52746 add users.users entry to changelog 2018-01-13 23:22:47 +01:00
Daiderd Jordan 08dd63a119 hydra: fix user creation 2018-01-13 23:16:39 +01:00
Daiderd Jordan 5250bc0f69 users: remove enable option 2018-01-13 22:59:34 +01:00
Daiderd Jordan 243651e398 checks: add test for /run 2018-01-13 22:50:48 +01:00
Daiderd Jordan f6b9e43a84 checks: add /etc/profile check from bootstrap script 2018-01-13 19:45:57 +01:00
Daiderd Jordan 8bffb9877e hydra: use users module 2018-01-13 18:29:20 +01:00
Daiderd Jordan f6a72d972b hydra: fix example 2018-01-13 18:20:52 +01:00
Daiderd Jordan 59421c7d76 nix: add to systemPackages when nix.package is set 2018-01-13 18:18:48 +01:00
Daiderd Jordan ad3891f07a etc: skip warning when target has references to /etc/static 2018-01-13 18:10:48 +01:00
Daiderd Jordan 174a36a296 activation: rename pre/post hooks
Renamed extraPostActivation and extraUserPostActivation.
2018-01-13 17:12:02 +01:00
Daiderd Jordan 789623213e checks: impure darwin-config error message 2018-01-13 15:40:07 +01:00
Daiderd Jordan 849cf9edc4 simple: update example 2018-01-13 14:56:49 +01:00
Daiderd Jordan ed72bf6409 bash: don't setup environment in a nix-shell 2018-01-13 14:51:36 +01:00
Daiderd Jordan bf72128177 toplevel: don't depend on NIX_PATH for the CHANGELOG 2018-01-13 14:20:13 +01:00
Daiderd Jordan 535701cb7f users: update test for user creation/deletion 2018-01-13 14:04:38 +01:00
Daiderd Jordan 3db35e87f0 users: move submodules to separate files 2018-01-13 13:52:30 +01:00
Daiderd Jordan b8713d540c users: add options for user creation 2018-01-13 13:42:49 +01:00
Daiderd Jordan 5df343aae5 networking: rename networkservices -> knownNetworkServices 2018-01-13 02:13:51 +01:00
Daiderd Jordan 9e87afcb4e users: add test for group creation/deletion 2018-01-13 02:05:45 +01:00
Daiderd Jordan b593f31822 users: add options to create user groups 2018-01-13 02:01:15 +01:00
Daiderd Jordan 5c31a2c380 time: skip activation if nothing is enabled 2018-01-12 22:24:34 +01:00
Daiderd Jordan a326466ca7 lnl: move darwin-config 2018-01-12 21:57:34 +01:00
Daiderd Jordan 23da403335 lnl: cleanup aliases 2018-01-12 21:54:52 +01:00
Daiderd Jordan ca5c600c7a add system.keyboard to README 2018-01-11 21:44:28 +01:00
Daiderd Jordan 2989a747db keyboard: add option for remapping Tilde on non-us keyboards 2018-01-10 19:57:23 +01:00
Daiderd Jordan e0d8d10e92 lnl: add keyboard mapping 2018-01-10 19:46:51 +01:00
Daiderd Jordan ada37dc2b3 lnl: add pr-darwin alias 2018-01-10 19:45:40 +01:00
Daiderd Jordan c2a0025f7a nix: add warning for distributed builds 2018-01-09 22:34:28 +01:00
Daiderd Jordan b074b6634d run bootstrap on travis
Fixes #14
2018-01-09 20:51:53 +01:00
Daiderd Jordan 5303f80542 keyboard: add test for keyboard mappings 2018-01-08 22:22:37 +01:00
Daiderd Jordan d05229ca0d keyboard: add warning when enableKeyMapping is not set 2018-01-08 22:04:32 +01:00
Daiderd Jordan edc3be51ce keyboard: add options for keyboard mappings
Fixes #55
2018-01-08 22:01:44 +01:00
Daiderd Jordan 3bedff357a etc: make link warnings more noticable
Hopefully this helps to make it more obvious that the file will not be
created by nix-darwin. See #65
2018-01-08 19:08:02 +01:00
Daiderd Jordan ac840a44b4 networking: add warning when networkservices is empty 2018-01-08 18:45:12 +01:00
Daiderd Jordan c28d3ce2ce add networking.networkservices entry to changelog 2018-01-08 00:31:54 +01:00
Daiderd Jordan 4608964b30 add test for networking.networkservices 2018-01-08 00:31:52 +01:00
Daiderd Jordan 5c18e86a07 networking: add dns/search options
These options are only enabled for networkservices that are explicitly
enabled and will clear existing values if nothing is set.
2018-01-08 00:16:46 +01:00
Daiderd Jordan 48b888c800 nixpkgs: add test for overlays 2018-01-07 00:06:53 +01:00
Daiderd Jordan 94a30ef034 add overlays entry to changelog 2018-01-06 23:33:56 +01:00
Daiderd Jordan 6fe46e8335 add _file for anonymous packages module 2018-01-06 23:21:34 +01:00
Daiderd Jordan 9780fb0f0b nixpkgs: add support for overlays 2018-01-06 23:20:43 +01:00
Daiderd JordanandGitHub 52cf461055 Merge pull request #62 from pjan/enh/NSGlobalDomain
Adds more NSGlobalDomain options + tests
2018-01-05 18:36:13 +01:00
Daiderd Jordan 7eb4e21075 defaults: add option for NetBIOSName 2018-01-05 00:16:09 +01:00
Daiderd Jordan 3dfc5da1e7 remove unused file 2018-01-05 00:06:14 +01:00
Daiderd Jordan 2c4444ede4 Merge pull request #64 from pjan/fix/47 2018-01-05 00:02:21 +01:00
Daiderd JordanandGitHub 7ed9cb0c46 Merge pull request #51 from joseph-long/set-netbios-name
Set NetBIOS name with hostName
2018-01-04 23:56:02 +01:00
Daiderd Jordan 9b955c2e4d bootstrap: increase build users to 32 2018-01-04 21:46:16 +01:00
Daiderd Jordan 1779e06cd4 chunkwm: make chunkwmrc executable 2018-01-04 21:37:13 +01:00
pjan vandaele 062f14eb55 Closes #47. Adds tests for networking 2018-01-04 15:36:33 +09:00
pjan vandaele 01692f870b Adds more NSGlobalDomain options + tests 2018-01-04 11:59:50 +09:00
Daiderd JordanandGitHub 02a11717a4 Merge pull request #60 from nix-hackers/tmux-iterm2
tmux: play nice with iTerm2
2018-01-04 00:05:03 +01:00
Daiderd Jordan 5a52850a03 update README 2018-01-03 23:07:32 +01:00
Daiderd Jordan 9792b08fdf nix: allways set NIX_REMOTE=daemon when the db isn't writable 2018-01-03 23:04:43 +01:00
Daiderd Jordan 8bf46112d8 bootstrap: add warning for /etc/profile 2018-01-03 23:03:36 +01:00
Eric BaileyandEric Bailey b6e692361e tmux: play nice with iTerm2
That is, don't use reattach-to-user-namespace. iTerm2 provides an option to
allow applications in the terminal to access the clipboard, as well as deeper
shell integration utilities, which obviate the need for
reattach-to-user-namespace. What's more, iTerm2's tmux integration doesn't work
with it, nor when aggressive-resize is on.

See also:

- https://iterm2.com/documentation-preferences.html
- https://iterm2.com/documentation-utilities.html
- https://iterm2.com/documentation-tmux-integration.html
- https://github.com/tmux-plugins/tmux-sensible/issues/24
2018-01-03 13:32:07 -06:00
Daiderd Jordan f235d89c59 add nix.conf entry to changelog 2018-01-03 20:11:34 +01:00
Daiderd Jordan f63f4fe3fb nix: reload daemon when nix.conf changes 2018-01-03 20:10:24 +01:00
Daiderd Jordan 8b10783bda hydra: use post activation for authorized_keys 2018-01-03 00:33:06 +01:00
Daiderd JordanandGitHub de6232171a Merge pull request #61 from jwiegley/master
Allow for postActivation scripts, that happen last
2018-01-03 00:29:38 +01:00
John Wiegley e8a0378790 Allow for postActivation scripts, that happen last 2018-01-02 12:36:34 -08:00
Daiderd Jordan 2237479c22 lnl: add custom link for gitconfig 2018-01-01 23:55:56 +01:00
Daiderd Jordan 403e432746 launchd: fix type of inetdCompatibility 2018-01-01 23:03:11 +01:00
Daiderd JordanandGitHub 7aadb77aaa Merge pull request #58 from pjan/enh/dock_settings
Adds attrs type for defaults. Adds additional Dock settings.
2018-01-01 14:30:18 +01:00
pjan vandaele 1d8c5d9b79 fix + tests 2018-01-01 09:20:27 +09:00
pjan vandaele d7e67ce030 float type 2017-12-31 12:15:22 +09:00
pjan vandaele 6aec3fbb50 Adds attrs type for defaults. Adds additional Dock settings. 2017-12-28 12:23:29 +09:00
Daiderd Jordan fa8b71bdf6 add test for environment.shells 2017-12-13 23:05:46 +01:00
Daiderd Jordan ba7202e789 environment-shells: add option to manage /etc/shells 2017-12-13 23:02:11 +01:00
Daiderd Jordan 5894006537 whitespace 2017-12-13 22:58:18 +01:00
Daiderd Jordan 2c05db6aca remove test for accessibility programs 2017-12-06 13:50:27 +01:00
Daiderd Jordan 2c6f80380f improve git revision detection
lib.pathIsDirectory doesn't follow symlinks causing the git revision
detection to fail if NIX_PATH points to a symlink.
2017-12-03 18:22:48 +01:00
Daiderd Jordan 7045686b62 add CHANGELOG entry for accessiblity options 2017-11-29 00:21:58 +01:00
Daiderd Jordan c4e213745a security-accessibility: remove options
The accessibility database has been protected with SIP since macOS
10.12 and there doesn't seem to be another way to configure this
programmatically.
2017-11-29 00:14:31 +01:00
Daiderd Jordan 48af45075a nix-daemon: add option to configure a logfile 2017-11-28 22:25:51 +01:00
Daiderd Jordan a20e9d040c lnl: enable sandboxing 2017-11-28 22:06:34 +01:00
Daiderd Jordan 46d0a16e51 add CHANGELOG entry for programs.fish update 2017-11-06 00:10:13 +01:00
Daiderd JordanandGitHub 5d80f2c826 Merge pull request #50 from cbarrett/master
Port over the NixOS fish module
2017-11-06 00:09:29 +01:00
Daiderd Jordan bd620d1855 simplify running tests with nix-build 2017-11-05 22:55:16 +01:00
Daiderd Jordan bb98816c86 add tests section to the README 2017-11-05 22:16:51 +01:00
Colin Barrett ae37a8ac7b Fix tests 2017-11-05 12:39:24 -05:00
Daiderd Jordan 7d0421a1c8 examples-hydra: remove custom tmpdir 2017-10-30 10:16:07 +01:00
Daiderd Jordan cc3cb881ba lnl: fix tmux keybinding 2017-10-27 12:31:59 +02:00
Daiderd Jordan 99050fe859 lnl: add fzf-vim 2017-10-25 13:50:44 +02:00
Daiderd Jordan 164220fe13 lnl: update 2017-10-20 23:04:42 +02:00
Daiderd Jordan de97d16af1 whitespace 2017-10-20 22:29:26 +02:00
Daiderd Jordan e828743829 nix-info: install by default 2017-10-20 22:23:51 +02:00
Daiderd Jordan d4f3a3a8a9 set modulesPath 2017-10-20 22:19:26 +02:00
Daiderd Jordan 6ea3f405e8 darwin-rebuild: add --list-generations flag 2017-10-20 21:45:31 +02:00
Daiderd Jordan 78d426940a improve descriptions for a bunch of modules 2017-10-19 22:16:09 +02:00
Daiderd Jordan 061232c6db launchd: improve descriptions 2017-10-19 21:55:37 +02:00
Daiderd Jordan f555eb99ba alias: make deprecated options internal 2017-10-18 23:36:39 +02:00
Colin Barrett a069111873 Set PATH since that's not being done by setEnvironment 2017-10-15 23:42:37 -04:00
Colin Barrett 1dd1f60f90 nixos -> nix_darwin 2017-10-15 23:26:16 -04:00
Colin Barrett a6cd3bb61f Port over the NixOS fish module 2017-10-15 23:26:16 -04:00
Daiderd Jordan 48c8e01112 lnl: add nixpkgs pr helper 2017-10-14 17:10:38 +02:00
Daiderd Jordan 5a79244a7e readme: add nix-channel instructions to the manual install section 2017-10-10 22:21:30 +02:00
Joseph Long ec1a7e5d2f Fix #47: hostName now sets NetBIOS name 2017-10-08 11:29:36 -07:00
Daiderd Jordan f0ee1438ec nix-daemon: don't set tempDir by default 2017-10-08 13:15:13 +02:00
Daiderd Jordan 3efff52877 environment: don't link /lib by default 2017-10-07 12:59:10 +02:00
Daiderd Jordan e8355cdd93 system-build: change type of setEnvironment and setAliases
On NixOS system.build.setEnvironment also is a writeText
2017-10-07 12:41:33 +02:00
Daiderd Jordan a8b4770275 environment: include extraInit in set-environment script 2017-10-07 12:27:43 +02:00
Daiderd Jordan 94fddd38af zsh: move environment variables to zshenv 2017-10-07 11:19:11 +02:00
Daiderd Jordan af0579f4a1 system-path: fix type 2017-10-07 10:17:45 +02:00
Daiderd JordanandGitHub afdcebc111 Merge pull request #45 from jrolfs/improve-trackpad
Improve trackpad settings support
2017-10-06 22:58:40 +02:00
Daiderd Jordan c08fa97307 bootstrap: enable re-bootstrapping after a system upgrade 2017-10-06 22:44:59 +02:00
Daiderd Jordan 91a6785102 nixpkgs: change loeOf to listOf 2017-10-06 19:57:47 +02:00
Daiderd Jordan 9cbf0cc615 readme: add section on building with local changes 2017-10-06 19:44:35 +02:00
Jamie Rolfs 3c447cfa00 Add 'TrackpadThreeFingerDrag' setting to trackpad module 2017-10-03 14:16:30 -07:00
Jamie Rolfs cc279e8a04 Write trackpad preferences to non-bluetooth namespace as well 2017-10-03 14:16:23 -07:00
Daiderd Jordan 11b0d93c4e examples-lnl: add hydra utils 2017-10-03 00:24:01 +02:00
Daiderd Jordan 36ba568fc4 system-version: add assertioon for stateVersion 2017-10-01 17:00:44 +02:00
Daiderd Jordan 312bc0ee9a changelog add note about stateVersion 2017-10-01 16:49:27 +02:00
Daiderd Jordan d3941dc5ec nix: use old default for nix.nixPath with system.stateVersion = 1 2017-10-01 16:37:51 +02:00
Daiderd Jordan c8cc548dfc examples-simple: add stateVersion 2017-10-01 16:37:51 +02:00
Daiderd Jordan cf9f74596a system-version: add system.stateVersion option 2017-10-01 16:37:51 +02:00
Daiderd JordanandGitHub d371ec0208 Merge pull request #42 from sellout/fix-bootstrap
Use the correct path for the darwin channel when bootstrapping.
2017-09-17 20:41:35 +02:00
Greg Pfeil f2589f497e Use the correct path for the darwin channel.
Also, only `echo` that the example configuration is being copied when it’s
actually being copied.
2017-09-17 12:17:37 -06:00
Daiderd Jordan 81fb224167 bootstrap: use channel for example configuration
Fixes #41
2017-09-13 23:11:52 +02:00
Daiderd Jordan 6fa180702b modules: add redis service 2017-09-07 22:39:35 +02:00
Daiderd Jordan 9f0507cf7d activation-checks: add check for user channels 2017-09-06 23:56:45 +02:00
Daiderd Jordan 184e9f34be nix: include user channels in NIX_PATH 2017-09-06 23:39:15 +02:00
Daiderd Jordan 020d666957 lnl: disable auto capitalization and period substitution 2017-09-06 22:40:04 +02:00
Daiderd Jordan e641f368e4 lnl: remove extra man outputs 2017-09-06 22:36:47 +02:00
Daiderd Jordan 3e1b67d779 lnl: enable nix-index 2017-08-14 21:47:18 +02:00
Daiderd Jordan a7fe548f63 activation-checks: improve NIX_PATH warnings 2017-08-07 20:09:59 +02:00
Daiderd Jordan c24f744cd3 activation-checks: show initial changelog 2017-08-01 22:59:19 +02:00
Daiderd Jordan a4b604cdbf hydra: don't set uid for hydra user
OSX or sshd doesn't seem to like a uuid <500
2017-08-01 22:37:04 +02:00
Daiderd Jordan 9b3e6bddcf changelog: add entry for command-not-found support 2017-07-28 23:39:52 +02:00
Daiderd Jordan 45d259cb3e add programs.nix-index module 2017-07-28 23:17:53 +02:00
Daiderd Jordan cfc0e3465f lnl: remove some experimental khd bindings 2017-07-26 22:02:19 +02:00
Daiderd Jordan d5e07457be lnl: update 2017-07-26 08:42:39 +02:00
Daiderd Jordan c2354c99e7 lnl: remove extra vim plugins 2017-07-25 20:52:02 +02:00
Daiderd Jordan c5d51f3cde lnl: use /nix/var/tmp 2017-07-25 19:41:24 +02:00
Daiderd Jordan 122aa93c13 add changelog command to updating section 2017-07-24 23:27:41 +02:00
Daiderd Jordan 775e23ec99 fix nix-channel command in README 2017-07-24 23:14:25 +02:00
Daiderd Jordan b7e4b03bee darwin: add changelog command 2017-07-24 23:12:07 +02:00
Daiderd Jordan 79b180249a darwin: add check as command for darwin-rebuild 2017-07-24 23:12:07 +02:00
Daiderd JordanandGitHub 40eb1292aa Merge pull request #31 from clhodapp/nix-apps-dir
Make symlink within ~/Applications if it exists instead of skipping
2017-07-24 22:21:00 +02:00
Daiderd Jordan 6784d89dd2 lnl: move nix-daemon config back to example 2017-07-24 19:41:45 +02:00
Daiderd Jordan 0e6e71bc60 activation-checks: fix nixpkgs instructions 2017-07-24 19:31:57 +02:00
Daiderd Jordan 4281f777d7 activation-checks: don't fail before showing error message 2017-07-24 19:29:31 +02:00
Daiderd Jordan ed7da178fe fix typo in CHANGELOG 2017-07-23 19:29:25 +02:00
Daiderd Jordan 0663c81f11 remove test CHANGELOG entry 2017-07-23 19:25:09 +02:00
Daiderd Jordan 0ee39eb06a activation-checks: fix changelog diff 2017-07-23 19:22:40 +02:00
Daiderd Jordan d5ab829dbd travis: add <darwin> 2017-07-23 19:08:25 +02:00
Daiderd Jordan 6a2715dcb6 activation-checks: remove set +e 2017-07-23 19:07:04 +02:00
Daiderd Jordan b5e0b273c4 darwin: show CHANGELOG during activation 2017-07-23 18:56:37 +02:00
Daiderd Jordan 7845fd0423 activation-checks: fix evaluation 2017-07-23 18:27:01 +02:00
Daiderd Jordan 1d0ecb8914 nix: look for <darwin> in channels by default 2017-07-23 18:13:18 +02:00
Daiderd Jordan 6d91e5b565 darwin: add --check flag 2017-07-23 18:02:08 +02:00
Daiderd Jordan e4a11b2073 activation-checks: add NIX_PATH check for nixpkgs 2017-07-23 17:51:17 +02:00
Daiderd Jordan 345d9ffa0e activation-checks: add NIX_PATH check for darwin-config 2017-07-23 17:51:17 +02:00
Daiderd Jordan 05d8495ed8 activation-checks: add NIX_PATH check for darwin 2017-07-23 17:51:06 +02:00
Daiderd Jordan 8016f1e2fd add activation-checks 2017-07-23 16:05:46 +02:00
Daiderd Jordan b3a9587cfb bootstrap: add nix.maxJobs to simple example 2017-07-23 14:30:36 +02:00
Daiderd Jordan 876b962c86 bootstrap: add reminder to start a new shell 2017-07-23 14:11:22 +02:00
Daiderd Jordan 30ebdeee6e bootstrap: add option to configure bashrc 2017-07-23 14:09:05 +02:00
Daiderd Jordan d0850bcfbe bootstrap: check nixbld group before asking 2017-07-23 13:50:02 +02:00
Daiderd Jordan c5a81146dc bootstrap: remove upgrade step
nix always builds with libsodium support now
2017-07-23 13:45:07 +02:00
Daiderd Jordan b09fdc4f2f bootstrap: add channel as root 2017-07-23 13:39:40 +02:00
Daiderd Jordan e6fe26417f bootstrap: fix indentation 2017-07-23 13:36:57 +02:00
Daiderd Jordan 1eadb10b9b nix: include root channels in default NIX_PATH 2017-07-22 17:38:37 +02:00
Daiderd Jordan dba63848e8 add contributing section 2017-07-19 21:30:28 +02:00
Daiderd Jordan 49e20a1b3a add list of modules instead of examples 2017-07-19 21:12:49 +02:00
Daiderd Jordan a1ccb21e3e add license 2017-07-19 20:53:33 +02:00
Daiderd Jordan 61cd181a0f zsh: use container names for fzf docker completion 2017-07-18 22:34:09 +02:00
Daiderd Jordan 0a1461ce7d lnl: use nixUnstable 2017-07-18 22:32:39 +02:00
Daiderd Jordan dc6b81a4b3 nix: add support for nix 1.12 2017-07-18 22:32:39 +02:00
Daiderd Jordan a31b3699b4 nix: include cache.nixos.org by default 2017-07-18 21:13:36 +02:00
Daiderd Jordan 2156c30ad2 nix-daemon: fix eval 2017-07-18 20:32:32 +02:00
Daiderd Jordan 8960f57708 nix-daemon: fix condition 2017-07-18 20:27:54 +02:00
Daiderd Jordan b883ae533f nix-daemon: fix nixbld group warning 2017-07-18 20:19:53 +02:00
Daiderd Jordan 6a52afb886 add hydra example to release.nix 2017-07-17 23:43:24 +02:00
Daiderd Jordan 250f238e2b hydra: add activation script for hydra user and ssh keys 2017-07-17 22:49:22 +02:00
Daiderd Jordan 3730fdf15e enable activate-system serice by default 2017-07-17 21:46:35 +02:00
Daiderd Jordan d049c7b97a hydra: use nix.gc.automatic 2017-07-17 21:42:27 +02:00
Daiderd Jordan 750e02b10c lnl: add rerun tmux keybinding 2017-07-17 21:03:32 +02:00
Daiderd Jordan 1cea7669ef bash: disable completion by default 2017-07-11 20:21:09 +02:00
Daiderd Jordan a6ca6e7974 bash: don't set default prompt 2017-07-09 17:14:34 +02:00
Daiderd Jordan 88a11d28f1 bash: enable by default 2017-07-09 10:16:57 +02:00
Daiderd Jordan 71f25cba9d zsh: support nix-shell --run zsh 2017-07-09 10:14:49 +02:00
Daiderd Jordan 8c29d0985d fix typo 2017-07-06 21:54:38 +02:00
Daiderd JordanandGitHub ebc7f7b2da Merge pull request #39 from peel/f-networking
Adds an idea for networking module
2017-07-06 21:52:21 +02:00
Daiderd JordanandGitHub fcef55a53a Merge pull request #38 from peel/master
Adds service.emacs.exec to choose emacs binary to execute
2017-07-06 21:14:06 +02:00
Piotr Limanowski 8fe2cff0cc Adds an idea for networking module
The idea is to follow: https://nixos.org/nixos/options.html#networking so we can
share even more configuration ideas from NixOS.
2017-07-05 22:17:58 +02:00
Piotr Limanowski 972ee0cb82 Adds service.emacs.exec to choose emacs binary to execute
The motivation of the change is that some forks (ie. Wilfred/remacs)
choose not to use the emacs binary. Whereas it is perfectly possible
to generate /bin/emacs in a drv, but I strongly believe it's cleaner
to have a service parameter.
2017-07-04 21:13:32 +02:00
Daiderd JordanandGitHub 22be829197 Merge pull request #36 from peel/master
Adds support for ChunkWM
2017-07-03 20:27:45 +02:00
Piotr Limanowski fe8072ec15 Updates to ChunkWM changes; Removes somedefaults as suggested 2017-07-03 13:37:55 +02:00
Daiderd Jordan acd0fee357 postgresql: init service 2017-07-02 18:39:07 +02:00
Daiderd Jordan 2eec909faf lnl: add reexec-tmux 2017-07-02 18:08:10 +02:00
Piotr Limanowski e33942bab2 Adds support for ChunkWM 2017-06-29 07:24:02 +02:00
Daiderd JordanandGitHub 5e61ca9fb4 Merge pull request #35 from dirn/smart-periods
Add support for smart period substitution
2017-06-26 20:31:31 +02:00
Daiderd JordanandGitHub 7682413824 Merge pull request #34 from dirn/autocapitalization
Add support for autocapitalization
2017-06-26 20:30:24 +02:00
Andy Dirnberger 705ab0bcf2 Add support for smart period substitution
Signed-off-by: Andy Dirnberger <andy@dirnberger.me>
2017-06-25 17:03:28 -04:00
Daiderd JordanandGitHub 540ccf431d Merge pull request #33 from dirn/dock-icon-size
Add support for Dock icon size
2017-06-25 23:03:21 +02:00
Andy Dirnberger 725fac8eff Add support for autocapitalization
Signed-off-by: Andy Dirnberger <andy@dirnberger.me>
2017-06-25 16:55:37 -04:00
Andy Dirnberger ad4acf558f Add support for Dock icon size
Signed-off-by: Andy Dirnberger <andy@dirnberger.me>
2017-06-25 16:38:48 -04:00
Daiderd Jordan 54244e0bb0 lnl: update kwm config 2017-06-22 00:11:31 +02:00
Daiderd Jordan 86e76352f2 lnl: add tmux swap windows 2017-06-22 00:10:47 +02:00
Daiderd Jordan 164f3cc78e lnl: add khd/kwm to systemPackages 2017-06-22 00:09:51 +02:00
Daiderd Jordan e01e48de3b zsh: improve fzf docker completion 2017-06-21 23:48:32 +02:00
Daiderd Jordan f5efd16be6 zsh: add fzf completion for docker containers 2017-06-17 21:46:49 +02:00
Chris Hodapp b26b1e89c1 Make symlink within ~/Applications if it exists instead of skipping 2017-06-14 13:12:12 -07:00
Daiderd Jordan 983c465a72 zsh: use custom fzf completion 2017-06-13 01:00:57 +02:00
Daiderd Jordan adb30c416f hydra: change gc timer to 24h 2017-06-12 23:41:56 +02:00
Daiderd Jordan 0c43b6a223 lnl: fix M-r repeat tmux keybinding 2017-06-04 19:22:06 +02:00
Daiderd Jordan 9f669d69e3 tmux: fix vim copy bindings for >= v2.4 2017-06-04 19:20:19 +02:00
Daiderd Jordan 0ef2374531 bootstrap: remove set -e 2017-06-04 13:06:37 +02:00
Daiderd Jordan 1cb24dfc4c hydra: use daemon instead of agent
Launchd agents only start when the user is logged in through the UI.
2017-06-03 12:25:34 +02:00
Daiderd Jordan a9b12eb149 hydra: add ni-gc service 2017-06-03 12:20:56 +02:00
Daiderd Jordan 2f24ee83ca readme: add updating 2017-06-03 12:00:13 +02:00
Daiderd Jordan 8ad51d7d72 add hydra example 2017-06-03 11:55:47 +02:00
Daiderd Jordan 1bd24987c5 readme: fix ~/.bashrc instructions 2017-06-03 11:27:22 +02:00
Daiderd Jordan 5638925939 readme: add install instructions for bootstrap script 2017-06-03 11:24:48 +02:00
Daiderd JordanandGitHub f7e1f9f837 Merge pull request #30 from cmacrae/master
Bootstrap script
2017-06-03 11:12:50 +02:00
Daiderd Jordan 310ec89642 bootstrap: use nix-channel 2017-06-03 11:02:27 +02:00
Daiderd Jordan 4c6d8dc3a6 bootstrap: remove -shell flag for sysadminctl
Fixes creation of build users on 10.11
2017-06-03 10:56:24 +02:00
Daiderd Jordan 5fa9beff89 example: disable completion 2017-06-03 10:30:03 +02:00
Daiderd Jordan d703c39421 launchd: hide 'No such file or directory' messages with first activation 2017-06-03 00:15:27 +02:00
cmacrae 30ae060482 boostrap: Prompt for sudo in create_daemon_users if non-interactive 2017-06-02 15:43:38 +01:00
cmacrae 7075538f7e bootstrap: build user options/fetch repo with nix-prefetch-url 2017-06-01 22:59:39 +01:00
cmacrae bfb6ae05aa bootstrap: keep echo consistent 2017-06-01 22:58:09 +01:00
cmacrae a021f639c1 bootstrap: initial commit 2017-05-31 21:08:36 +01:00
Daiderd Jordan bed2e17e00 lnl: add tmux keybinding to repeat commands, etc. 2017-05-25 21:18:30 +02:00
Daiderd Jordan 6da4eb0ffe environment: use the default profile as a fallback 2017-05-25 12:51:59 +02:00
Daiderd Jordan 1ca3e65198 fix accessibility test 2017-05-24 23:17:39 +02:00
Daiderd Jordan beb02c612a lnl: update accessibility options 2017-05-24 22:58:01 +02:00
Daiderd Jordan fa843a70ca security: add enableAccessibilityAccess option 2017-05-24 22:55:20 +02:00
Daiderd Jordan aebf57d677 lnl: use active version of nix for the daemon 2017-05-22 23:42:44 +02:00
Daiderd Jordan d5596d5df2 programs-info: add module and run install-info on system packages.
Fixes #25
2017-05-21 10:51:01 +02:00
Daiderd Jordan cee2bb93cc applications: fix activation 2017-05-20 14:38:32 +02:00
Daiderd Jordan 290b1d8aad system-packages: link applications to ~/Applications 2017-05-20 14:23:05 +02:00
Daiderd Jordan e88b408ee7 nix-daemon: unset NIX_REMOTE if there are no build users. 2017-05-20 13:54:48 +02:00
Daiderd Jordan e95b40bf4c lnl: update khd/kwm config 2017-05-20 13:15:19 +02:00
Daiderd Jordan 2fda5848bb kwm: add option to manage config in /etc/kwmrc
Fixes #24
2017-05-20 13:14:17 +02:00
Daiderd Jordan 9f0b3c22c3 khd: use ~/.khdrc when to config is defined 2017-05-20 13:04:26 +02:00
Daiderd Jordan cfc9681113 khd: add option to configure i3 keybindings 2017-05-20 13:02:10 +02:00
Daiderd Jordan c8c2763c9e khd: add option to manage config in /etc/khdrc 2017-05-20 13:01:25 +02:00
275 changed files with 20585 additions and 2873 deletions
+2
View File
@@ -0,0 +1,2 @@
# nixpkgs: format with `nixfmt`
dc1c716ded39758062ed7e6bc410ad274119de9f
+1
View File
@@ -0,0 +1 @@
github: [emilazy, Enzime]
+135
View File
@@ -0,0 +1,135 @@
name: "Test"
on:
pull_request:
merge_group:
push:
branches:
- nix-darwin-26.05
env:
NIXPKGS_BRANCH: nixpkgs-26.05-darwin
NIX_VERSION: 2.24.11
jobs:
# The `test-stable` and `install-against-stable` job names are
# loadbearing, despite their inaccuracy on the unstable branch, as
# they are set as required checks in the repository configuration,
# which only repository admins can change.
#
# TODO: Change them once the repository configuration is updated.
test-stable:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-${{ env.NIX_VERSION }}/install
- run: nix flake check --override-input nixpkgs nixpkgs/${{ env.NIXPKGS_BRANCH }}
install-against-stable:
runs-on: macos-14
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-${{ env.NIX_VERSION }}/install
nix_path: nixpkgs=channel:${{ env.NIXPKGS_BRANCH }}
- name: Install channels
run: |
sudo nix-channel --add https://nixos.org/channels/${{ env.NIXPKGS_BRANCH }} nixpkgs
sudo nix-channel --update
- name: Install nix-darwin
run: |
sudo mkdir -p /etc/nix-darwin
sudo cp modules/examples/simple.nix /etc/nix-darwin/configuration.nix
nixConfHash=$(shasum -a 256 /etc/nix/nix.conf | cut -d ' ' -f 1)
sudo /usr/bin/sed -i.bak \
"s/# programs.fish.enable = true;/ \
imports = [ \
({ options, ... }: { \
nix.settings.access-tokens = [ \"github.com=\${{ secrets.GITHUB_TOKEN }}\" ]; \
environment.etc.\"nix\/nix.conf\".knownSha256Hashes = [ \"$nixConfHash\" ]; \
nix.nixPath = \
[ { darwin = \"${PWD////\/}\"; } ] \
++ options.nix.nixPath.default; \
}) \
]; \
/" \
/etc/nix-darwin/configuration.nix
sudo nix run .#darwin-rebuild -- switch \
-I darwin=. \
-I darwin-config=/etc/nix-darwin/configuration.nix
- name: Switch to new configuration
run: |
. /etc/bashrc
sudo /usr/bin/sed -i.bak \
"s/pkgs.vim/pkgs.hello/" \
/etc/nix-darwin/configuration.nix
sudo darwin-rebuild switch
hello
- name: Test uninstallation of nix-darwin
run: |
# We need to specify `--extra-experimental-features` because `experimental-features` is set by
# `cachix/install-nix-action` but not by our default config above
sudo nix run .#darwin-uninstaller \
--extra-experimental-features "nix-command flakes" \
--override-input nixpkgs nixpkgs/${{ env.NIXPKGS_BRANCH }}
sudo nix run .#darwin-uninstaller.tests.uninstaller \
--extra-experimental-features "nix-command flakes" \
--override-input nixpkgs nixpkgs/${{ env.NIXPKGS_BRANCH }}
install-flake:
runs-on: macos-14
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-${{ env.NIX_VERSION }}/install
- name: Install nix-darwin
run: |
sudo mkdir -p /etc/nix-darwin
darwin=$(pwd)
pushd /etc/nix-darwin
sudo nix flake init -t $darwin
nixConfHash=$(shasum -a 256 /etc/nix/nix.conf | cut -d ' ' -f 1)
sudo /usr/bin/sed -i.bak \
"s/# programs.fish.enable = true;/nix.settings.access-tokens = [ \"github.com=\${{ secrets.GITHUB_TOKEN }}\" ]; environment.etc.\"nix\/nix.conf\".knownSha256Hashes = [ \"$nixConfHash\" ];/" \
flake.nix
sudo /usr/bin/sed -i.bak \
's/darwinConfigurations."simple"/darwinConfigurations."'$(scutil --get LocalHostName)'"/g' \
flake.nix
sudo /usr/bin/sed -i.bak \
's/nixpkgs.hostPlatform = "aarch64-darwin";/nixpkgs.hostPlatform = "'$(nix eval --expr builtins.currentSystem --impure --raw)'";/' \
flake.nix
popd
sudo nix run .#darwin-rebuild -- switch \
--override-input nix-darwin . \
--override-input nixpkgs nixpkgs/${{ env.NIXPKGS_BRANCH }}
- name: Switch to new configuration
run: |
. /etc/bashrc
sudo /usr/bin/sed -i.bak \
"s/pkgs.vim/pkgs.hello/" \
/etc/nix-darwin/flake.nix
sudo darwin-rebuild switch \
--override-input nix-darwin . \
--override-input nixpkgs nixpkgs/${{ env.NIXPKGS_BRANCH }}
hello
- name: Test uninstallation of nix-darwin
run: |
sudo nix run .#darwin-uninstaller --override-input nixpkgs nixpkgs/${{ env.NIXPKGS_BRANCH }}
sudo nix run .#darwin-uninstaller.tests.uninstaller --override-input nixpkgs nixpkgs/${{ env.NIXPKGS_BRANCH }}
+45
View File
@@ -0,0 +1,45 @@
name: Update website
on:
push:
branches:
- master
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: macos-14
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Install Nix
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
- name: Build website
run: nix build .#website -o _site
- name: Upload website
id: deployment
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
# See: <https://github.com/actions/deploy-pages?tab=readme-ov-file#usage>
deploy:
name: Deploy
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
+3
View File
@@ -0,0 +1,3 @@
.DS_Store
*.swp
result*
-19
View File
@@ -1,19 +0,0 @@
language: nix
matrix:
include:
- os: osx
osx_image: xcode8.2
script:
- nix-build ./release.nix -A examples.simple
- nix-build ./release.nix -A tests.system-packages
- nix-build ./release.nix -A tests.system-path-bash
- nix-build ./release.nix -A tests.system-path-fish
- nix-build ./release.nix -A tests.system-path-zsh
- os: osx
osx_image: xcode7.3
script:
- nix-build ./release.nix -A examples.simple
- nix-build ./release.nix -A tests.system-packages
- nix-build ./release.nix -A tests.system-path-bash
- nix-build ./release.nix -A tests.system-path-fish
- nix-build ./release.nix -A tests.system-path-zsh
+289
View File
@@ -0,0 +1,289 @@
2026-05-16
- The reversed split-window key bindings previously generated by
`programs.tmux.enableSensible` are no longer emitted when
`system.stateVersion` is 7 or later, so tmux uses its conventional
behavior: `%` splits the current pane horizontally and `"` splits it
vertically.
Existing configurations with `system.stateVersion` 6 or earlier keep
the previous reversed bindings. You can explicitly choose either
behavior with `programs.tmux.reverseSplitBindings`.
2026-02-10
- Major changes to `homebrew` module
`homebrew.brewPrefix` was renamed to `homebrew.prefix`, and its semantics
changed: the old option pointed to the bin directory (e.g.,
`/opt/homebrew/bin`), while the new option points to the Homebrew prefix
(e.g., `/opt/homebrew`), matching `brew --prefix`.
`homebrew.whalebrews` was removed. Whalebrew support was removed from
Homebrew Bundle in Homebrew 4.7.0 (Nov 2025), so `whalebrew` entries in a
Brewfile now cause `brew bundle` to fail.
`homebrew.global.lockfiles` and `homebrew.global.noLock` no longer have any
effect. Homebrew Bundle removed lockfile support in Homebrew 4.4.0 (Oct 2024).
`homebrew.onActivation.cleanup` now supports a `"check"` mode, which checks
for unlisted packages and aborts activation if any are found, without
removing them.
Shell integration options were added: `homebrew.enableBashIntegration`,
`homebrew.enableFishIntegration`, and `homebrew.enableZshIntegration`.
New Brewfile entry types were added: `homebrew.goPackages`,
`homebrew.cargoPackages`, and `homebrew.vscode`.
New options were added for brews: `postinstall`, `link = "overwrite"`, and
`restart_service = "always"`. The `postinstall` option was also added for
casks.
2025-01-30
- Previously, some nix-darwin options applied to the user running
`darwin-rebuild`. As part of a longterm migration to make
nix-darwin focus on systemwide activation and support firstclass
multiuser setups, all system activation now runs as `root`, and
these options instead apply to the `system.primaryUser` user.
You will get an evaluation error if you are using any options to
which this applies.
To continue using these options, set `system.primaryUser` to the name
of the user you have been using to run `darwin-rebuild`. In the long
run, this setting will be deprecated and removed after all the
functionality it is relevant for has been adjusted to allow
specifying the relevant user separately, moved under the
`users.users.*` namespace, or migrated to Home Manager.
Accordingly, `darwin-rebuild` must now be run as root, the
`system.activationScripts.{extraUserActivation,preUserActivation,
postUserActivation}` settings have been removed, and all activation
scripts are now executed as `root` be careful if you override any
of them.
If you run into any unexpected issues with the migration, please
open an issue at <https://github.com/nix-darwin/nix-darwin/issues/new>
and include as much information as possible.
2025-01-29
- There is now a `nix.enable` toggle to disable management of the Nix
installation. Nix installation management has been made more
opinionated as a consequence; nix-darwin now only supports managing a
multiuser daemon installation of Nix, and unconditionally takes
ownership of the nix-daemon launchd daemon and the `_nixbld*` build
users when Nix installation management is enabled.
If the new constraints do not work with your setup, you can disable
the `nix.enable` option to opt out of Nix installation management
entirely; see the option documentation for caveats.
2025-01-18
- The default configuration path for all new installations
is `/etc/nix-darwin`. This was already the undocumented
default for `darwin-rebuild switch` when using flakes. This
is implemented by setting `environment.darwinConfig` to
`"/etc/nix-darwin/configuration.nix"` by default when
`system.stateVersion` ≥ 6.
2024-09-10
- The default Nix build user group ID is now set to 350 when
`system.stateVersion` ≥ 5, to reflect the default for new Nix
installations. This only affects installations that enable
`nix.configureBuildUsers`, and any divergence will be detected on
system activation. To use `nix.configureBuildUsers` with a higher
`system.stateVersion` on installations using the old group ID, set:
ids.gids.nixbld = 30000;
We do not recommend trying to change the group ID with macOS user
management tools without a complete uninstallation and reinstallation
of Nix.
2024-06-15
- SECURITY NOTICE: The previous implementation of the
`users.users.<name>.openssh.authorizedKeys.*` options would not delete
authorized keys files when the setting for a given user was removed.
This means that if you previously stopped managing a user's authorized
SSH keys with nix-darwin, or intended to revoke their access by
removing the option, the previous set of keys could still be used to
log in as that user.
You can check the /etc/ssh/authorized_keys.d directory to see which
keys were permitted; afterwards, please remove the directory and
re-run activation. The options continue to be supported and will now
correctly permit only the keys in your current system configuration.
2022-08-24
- Major changes to `homebrew` module
`homebrew.cleanup` was renamed to `homebrew.onActivation.cleanup`.
`homebrew.autoUpdate` was renamed to `homebrew.onActivation.autoUpdate`.
`homebrew.onActivation.upgrade` was added, and the default behavior of the
module was changed to not upgrade installed formulae and apps.
`homebrew.global.autoUpdate` was added.
`homebrew.global.noLock` was replaced with `hombrew.global.lockfiles`.
`homebrew.caskArgs` submodule was added for configuring arguments to be used
for all casks.
`homebrew.{taps,brews,casks}` were reimplemented as lists of submodules,
instead of lists of strings, with well documented options for all available
arguments for these Brewfile entry types, while preserving backwards
compatibility with the previous implementation.
2022-08-14
- nix module updated to bring it back in sync with it's NixOS counterpart
It should now be much more fiesable to share code for this module between
`nix-darwin` and NixOS configs.
`nix-darwin` now requires Nix >= 2.2.
`nix.package` can no longer be a path to a profile.
`nix.version` option has been removed. Use `nix.package.version` if you want
to reference the version Nix installed/used by your config.
Many options moved/renamed from `nix.*` to `nix.settings.*`. For example
`nix.binaryCaches` is now `nix.settings.substituters`.
You can use `nix.settings` to set any option in `nix.conf`.
`users.nix.*` options moved to `nix.*`.
`nix.daemonIONice` was renamed to `nix.daemonIOLowPriority`, and
`nix.daemonNiceLevel` was removed in favor a new option
`nix.nix.daemonProcessType`.
2021-01-16
- Added `homebrew` module, to manage formulas installed by Homebrew via `brew bundle`.
2020-10-25
- The option environment.variables.SHELL is no longer set automatically when,
eg. programs.zsh.enable is configured.
2020-09-12
- Options using the deprecated loaOf where removed, see https://github.com/NixOS/nixpkgs/pull/96042
The following options no longer accept lists:
environment.etc, environment.launchAgents.*, environment.launchDaemons.*,
users.users, programs.ssh.knownHosts
2019-05-04
- A configuration.nix manpage is now included by default, run
`man 5 configuration.nix` or `darwin-help`. The documentation option can be
disabled to exclude the manual and it's extra build dependencies.
documentation.enable = false;
2019-05-01
- nix.nixPath entries are now merged by default
system.stateVersion > 3
For the original behaviour, override the option using a higher priority.
nix.nixPath = lib.mkForce [ "darwin-config=/configuration.nix" ... ];
This option also supports specifying named NIX_PATH entries using an
attribute set now.
nix.nixPath = [{ darwin = "/src/darwin"; }];
2019-02-23
- The users module now supports declarative per-user packages similar to nixos.
eg.
users.users.<name>.packages = [ pkgs.hello ];
2019-01-02
- The NIX_PATH validation can be disabled now, this is particularly useful if
the darwin configuration is deployed from another machine in which case it
often doesn't matter that darwin-rebuild won't work on the host itself.
system.checks.verifyNixPath = false;
2018-03-29
- default nix.package no longer uses the default profile.
system.stateVersion > 2
For the original behaviour configure nix.package
nix.package = "/nix/var/nix/profiles/default";
2018-03-06
- added ssh.knownHosts, to manage global known_hosts.
2018-01-16
- fixed issue for single-user installs, be careful when rolling back to a
revision after 9792b08fdf049524742143f4f788e3eb61a769fda.
If you run into trouble try NIX_REMOTE= darwin-rebuild switch.
2018-01-13
- added users.users and users.groups to manage user accounts.
Changes will not be applied to existing users or groups.
2018-01-08
- added networking.networkservices, to manage dns servers and searchdomains.
This will clear existing values when enabled.
2018-01-06
- added nixpkgs.overlays, there is a chapter on overlays in the nixpkgs manual
https://nixos.org/nixpkgs/manual/#chap-overlays with more information.
2018-01-04
- the nix.useDaemon/services.nix-daemon.enable options now automatically
reload the daemon for you when nix.conf changes.
2017-11-29
- the security.enableAccessibilityAccess option was removed since it
no longer works on macOS 10.12 and later.
2017-11-06
- the programs.fish module was rewritten based on improvements from
NixOS. This might have some incompatible changes compared to the
previous implementation.
2017-10-06
- loeOf was removed from nixpkgs in 10881bbe11b2f66ebfa880795e5bc01a04158da4
Using single items instead of a list no longer works for
environment.systemPath and launchd.<serviceType>.<name>.path
2017-10-01
- added system.stateVersion option, add this to your configuration to
avoid breaking changes. This changelog and the activation checks
will show instructions on what to do to safely increment this value.
2017-07-06
- added user channels to the default nix.nixPath
Using a user channel now works without any custom configuration.
See https://github.com/NixOS/nix/issues/1548 if you are running into
issues when updating your channel.
2017-07-28
- added support for command-not-found, using nix-index
programs.nix-index.enable = true;
2017-07-23
- darwin entry in the default nix.nixPath was removed for
system.stateVersion > 1
Use a channel for nix-darwin or configure nix.nixPath
sudo nix-channel --add https://github.com/nix-darwin/nix-darwin/archive/master.tar.gz darwin
sudo nix-channel --update
nix.nixPath =
[ "darwin=$HOME/.nix-defexpr/darwin"
"darwin-config=$HOME/.nixpkgs/darwin-configuration.nix"
"/nix/var/nix/profiles/per-user/root/channels"
];
2017-01-09
- nix.profile was renamed to nix.package
+7
View File
@@ -0,0 +1,7 @@
Copyright 2017 <Daiderd Jordan>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+1 -210
View File
@@ -1,212 +1,3 @@
[<img src="https://lnl7.github.io/nix-darwin/images/nix-darwin.png" width="200px" alt="logo" />](https://github.com/LnL7/nix-darwin)
# nix-darwin
[![Build Status](https://travis-ci.org/LnL7/nix-darwin.svg?branch=master)](https://travis-ci.org/LnL7/nix-darwin)
Nix modules for darwin, `/etc/nixos/configuration.nix` for macOS.
## Install
This will link the system profile to `/run/current-system`. You have to create `/run` or symlink it to `private/var/run`.
If you use a symlink, you'll probably also want to add `services.activate-system.enable = true;` to your configuration.
> NOTE: the system activation scripts don't overwrite existing etc files, so files like `/etc/bashrc` won't be used by default.
Either modify the existing file to source/import the one from `/etc/static` or remove it.
```bash
# install nixpkgs version, which enables libsodium support (for signed binary caches)
# this is not required if you already upgraded nix at some point
nix-env -iA nixpkgs.nix
sudo ln -s private/var/run /run
git clone git@github.com:LnL7/nix-darwin.git ~/.nix-defexpr/darwin
cp ~/.nix-defexpr/darwin/modules/examples/simple.nix ~/.nixpkgs/darwin-configuration.nix
# bootstrap build using default nix.nixPath
export NIX_PATH=darwin=$HOME/.nix-defexpr/darwin:darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$NIX_PATH
# you can also use this to rebootstrap nix-darwin in case
# darwin-rebuild is to old to activate the system.
$(nix-build '<darwin>' -A system --no-out-link)/sw/bin/darwin-rebuild build
$(nix-build '<darwin>' -A system --no-out-link)/sw/bin/darwin-rebuild switch
. /etc/static/bashrc
```
... or for `fish`:
```fish
(nix-build '<darwin>' -A system --no-out-link)/sw/bin/darwin-rebuild build
(nix-build '<darwin>' -A system --no-out-link)/sw/bin/darwin-rebuild switch
```
This will create and manage a system profile in `/run/current-system`, just like nixos.
The default `NIX_PATH` in nix-darwin will look for this repository in `~/.nix-defexpr/darwin` and for your configuration in `~/.nixpkgs/darwin-configuration.nix`.
If you want to change these you can set your own with `nix.nixPath = [ ];`.
```
$ darwin-rebuild switch
building the system configuration...
these derivations will be built:
/nix/store/vfad6xgjzr56jcs051cg6vzch4dby92y-etc-zprofile.drv
/nix/store/cbmkscxsz0k02ynaph5xaxm1aql0p3vq-etc.drv
/nix/store/r5fpn177jhc16f8iyzk12gcw4pivzpbw-nixdarwin-system-16.09.drv
building path(s) /nix/store/wlq89shja597ip7mrmjv7yzk2lwyh8n0-etc-zprofile
building path(s) /nix/store/m8kcm1pa5j570h3indp71a439wsh9lzq-etc
building path(s) /nix/store/l735ffcdvcvy60i8pqf6v00vx7lnm6mz-nixdarwin-system-16.09
setting up /etc...
setting up launchd services...
writing defaults...
$
```
```
$ darwin-option services.activate-system.enable ~/src/nix-darwin
Value:
true
Default:
false
Example:
no example
Description:
Whether to activate system at boot time.
```
## Example configuration
Check out [modules/examples](https://github.com/LnL7/nix-darwin/tree/master/modules/examples) for some example configurations.
```nix
{ pkgs, ... }:
{
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[ pkgs.nix-repl
];
# Create /etc/bashrc that loads the nix-darwin environment.
programs.bash.enable = true;
# Recreate /run/current-system symlink after boot.
services.activate-system.enable = true;
}
```
## Modules
### system.defaults
A set of [modules](https://github.com/LnL7/nix-darwin/tree/master/modules/system/defaults) to manage macOS settings.
```nix
{
system.defaults.dock.autohide = true;
system.defaults.dock.orientation = "left";
system.defaults.dock.showhidden = true;
}
```
> NOTE: you have to restart the dock in order for these changes to apply. `killall Dock`
### environment.etc
Set of files to be linked in `/etc`, this won't overwrite any existing files.
Either modify the existing file to source/import the one from `/etc/static` or remove it.
```nix
{
environment.etc."foorc".text = ''
export FOO=1
if test -f /etc/foorc.local; then
. /etc/foorc.local
fi
'';
# Global user configuration, symlink these to the appropriate file:
# $ ln -s /etc/static/per-user/lnl/gitconfig ~/.gitconfig
environment.etc."per-user/lnl/gitconfig".text = ''
[include]
path = .gitconfig.local
[color]
ui = auto
'';
}
```
### launchd.daemons
Definition of launchd agents/daemons. The [serviceConfig](https://github.com/LnL7/nix-darwin/blob/master/modules/launchd/launchd.nix) options are used to generate the launchd plist file.
```nix
{
launchd.daemons.foo = {
serviceConfig.ProgramArguments = [ "/usr/bin/touch" "/tmp/foo.lock" ];
serviceConfig.RunAtLoad = true;
};
}
```
### services
A set of modules for predefined services, these generate the appropriate launchd daemons for you.
```nix
{
services.nix-daemon.enable = true;
services.nix-daemon.tempDir = "/nix/tmp";
}
```
### programs
A set of modules to manage configuration of certain programs.
```nix
{ pkgs, ... }:
{
environment.shellAliases.ls = "${pkgs.coreutils}/bin/ls";
programs.bash.enable = true;
programs.vim.enable = true;
programs.vim.enableSensible = true;
}
```
### nixpkgs.config
This attribute set is used as nixpkgs configuration when using nix-darwin.
```nix
{
environment.systemPackages =
[ # Use vim_configurable from packageOverrides
lnl.vim
];
nixpkgs.config.allowUnfree = true;
nixpkgs.config.packageOverrides = pkgs: {
lnl.vim = pkgs.vim_configurable.customize {
name = "vim";
vimrcConfig.customRC = ''
set nocompatible
filetype plugin indent on
syntax on
'';
};
};
}
```
This is the 26.05 release branch of nix-darwin. See [the main readme](https://github.com/nix-darwin/nix-darwin#readme) for documentation
+14 -55
View File
@@ -1,64 +1,23 @@
{ nixpkgs ? <nixpkgs>, configuration ? <darwin-config>, system ? builtins.currentSystem
{ nixpkgs ? <nixpkgs>
, configuration ? <darwin-config>
, system ? builtins.currentSystem
, pkgs ? import nixpkgs { inherit system; }
, lib ? pkgs.lib
}:
let
packages = { config, lib, pkgs, ... }: {
config = {
_module.args.pkgs = import nixpkgs {
inherit system;
inherit (config.nixpkgs) config;
};
eval = import ./eval-config.nix {
inherit lib;
modules = [
configuration
{ nixpkgs.source = lib.mkDefault nixpkgs; }
] ++ lib.optional (system != null) {
nixpkgs.system = lib.mkDefault system;
};
};
eval = pkgs.lib.evalModules {
check = true;
modules =
[ configuration
packages
./modules/alias.nix
./modules/system
./modules/system/activation-scripts.nix
./modules/system/defaults-write.nix
./modules/system/defaults/NSGlobalDomain.nix
./modules/system/defaults/LaunchServices.nix
./modules/system/defaults/dock.nix
./modules/system/defaults/finder.nix
./modules/system/defaults/trackpad.nix
./modules/system/etc.nix
./modules/system/launchd.nix
./modules/time
./modules/nix
./modules/nix/nix-darwin.nix
./modules/nix/nixpkgs.nix
./modules/environment
./modules/launchd
./modules/security
./modules/security/wrappers.nix
./modules/services/activate-system.nix
./modules/services/khd.nix
./modules/services/kwm.nix
./modules/services/emacs.nix
./modules/services/mopidy.nix
./modules/services/nix-daemon.nix
./modules/services/nix-gc.nix
./modules/programs/bash.nix
./modules/programs/fish.nix
./modules/programs/man.nix
./modules/programs/nix-script.nix
./modules/programs/tmux.nix
./modules/programs/vim.nix
./modules/programs/zsh
];
};
in
eval // {
darwin-uninstaller = pkgs.callPackage ./pkgs/darwin-uninstaller { };
{
inherit (eval.config._module.args) pkgs;
inherit (eval) options config;
system = eval.config.system.build.toplevel;
inherit (pkgs.callPackage ./pkgs/nix-tools { }) darwin-option darwin-rebuild darwin-version;
}
@@ -0,0 +1,8 @@
# System-wide profile for interactive zsh(1) login shells.
# Setup user specific overrides for this in ~/.zprofile. See zshbuiltins(1)
# and zshoptions(1) for more details.
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
@@ -0,0 +1,18 @@
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
@@ -0,0 +1,10 @@
# Generated by https://install.lix.systems/.
# See `/nix/nix-installer --version` for the version details.
build-users-group = nixbld
experimental-features = nix-command flakes
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
substituters = https://cache.nixos.org https://cache.lix.systems
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=
extra-nix-path = nixpkgs=flake:nixpkgs
@@ -0,0 +1,82 @@
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
# System-wide profile for interactive zsh(1) shells.
# Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
# and zshoptions(1) for more details.
# Correctly display UTF-8 with combining characters. We'll assume UTF-8 if the
# locale(1) binary is missing entirely.
if [[ ! -x /usr/bin/locale ]] || [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
setopt COMBINING_CHARS
fi
# Disable the log builtin, so we don't conflict with /usr/bin/log
disable log
# Save command history
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
# Beep on error
setopt BEEP
# Use keycodes (generated via zkbd) if present, otherwise fallback on
# values from terminfo
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
source ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
else
typeset -g -A key
[[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
[[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
[[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
[[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
[[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
[[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
[[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
[[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
[[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
[[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
[[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
[[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
[[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
[[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
[[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
[[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
[[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
[[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
[[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
[[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
[[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
[[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
[[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
[[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
[[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
[[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
[[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
[[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
[[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
[[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
[[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
fi
# Default key bindings
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
# Default prompt
PS1="%n@%m %1~ %# "
# Useful support for interacting with Terminal.app or other terminal programs
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
@@ -0,0 +1,81 @@
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
# System-wide profile for interactive zsh(1) shells.
# Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
# and zshoptions(1) for more details.
# Correctly display UTF-8 with combining characters.
if [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
setopt COMBINING_CHARS
fi
# Disable the log builtin, so we don't conflict with /usr/bin/log
disable log
# Save command history
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
# Beep on error
setopt BEEP
# Use keycodes (generated via zkbd) if present, otherwise fallback on
# values from terminfo
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
source ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
else
typeset -g -A key
[[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
[[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
[[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
[[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
[[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
[[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
[[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
[[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
[[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
[[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
[[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
[[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
[[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
[[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
[[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
[[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
[[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
[[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
[[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
[[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
[[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
[[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
[[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
[[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
[[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
[[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
[[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
[[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
[[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
[[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
[[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
fi
# Default key bindings
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
# Default prompt
PS1="%n@%m %1~ %# "
# Useful support for interacting with Terminal.app or other terminal programs
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
@@ -0,0 +1,2 @@
# Added by tailscaled
nameserver 100.100.100.100
@@ -0,0 +1,3 @@
# Written by https://github.com/DeterminateSystems/nix-installer.
# The contents below are based on options specified at installation time.
@@ -0,0 +1,80 @@
# System-wide profile for interactive zsh(1) shells.
# Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
# and zshoptions(1) for more details.
# Correctly display UTF-8 with combining characters.
if [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
setopt COMBINING_CHARS
fi
# Disable the log builtin, so we don't conflict with /usr/bin/log
disable log
# Save command history
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
# Beep on error
setopt BEEP
# Use keycodes (generated via zkbd) if present, otherwise fallback on
# values from terminfo
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
source ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
else
typeset -g -A key
[[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
[[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
[[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
[[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
[[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
[[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
[[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
[[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
[[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
[[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
[[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
[[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
[[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
[[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
[[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
[[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
[[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
[[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
[[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
[[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
[[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
[[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
[[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
[[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
[[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
[[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
[[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
[[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
[[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
[[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
[[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
fi
# Default key bindings
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
# Default prompt
PS1="%n@%m %1~ %# "
# Useful support for interacting with Terminal.app or other terminal programs
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
@@ -0,0 +1,10 @@
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
@@ -0,0 +1,74 @@
# System-wide profile for interactive zsh(1) shells.
# Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
# and zshoptions(1) for more details.
# Correctly display UTF-8 with combining characters. We'll assume UTF-8 if the
# locale(1) binary is missing entirely.
if [[ ! -x /usr/bin/locale ]] || [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
setopt COMBINING_CHARS
fi
# Disable the log builtin, so we don't conflict with /usr/bin/log
disable log
# Save command history
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
# Beep on error
setopt BEEP
# Use keycodes (generated via zkbd) if present, otherwise fallback on
# values from terminfo
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
source ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
else
typeset -g -A key
[[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
[[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
[[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
[[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
[[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
[[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
[[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
[[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
[[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
[[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
[[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
[[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
[[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
[[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
[[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
[[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
[[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
[[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
[[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
[[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
[[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
[[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
[[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
[[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
[[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
[[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
[[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
[[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
[[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
[[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
[[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
fi
# Default key bindings
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
# Default prompt
PS1="%n@%m %1~ %# "
# Useful support for interacting with Terminal.app or other terminal programs
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
@@ -0,0 +1,7 @@
# Set up Nix only on SSH connections
# See: https://github.com/DeterminateSystems/nix-installer/pull/714
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ] && [ -n "${SSH_CONNECTION:-}" ] && [ "${SHLVL:-0}" -eq 1 ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
@@ -0,0 +1,14 @@
# Generated by https://github.com/DeterminateSystems/nix-installer.
# See `/nix/nix-installer --version` for the version details.
!include nix.custom.conf
experimental-features = nix-command flakes
always-allow-substitutes = true
extra-trusted-substituters = https://cache.flakehub.com
extra-trusted-public-keys = cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM= cache.flakehub.com-4:Asi8qIv291s0aYLyH6IOnr5Kf6+OF14WVjkE6t3xMio= cache.flakehub.com-5:zB96CRlL7tiPtzA9/WKyPkp3A2vqxqgdgyTVNGShPDU= cache.flakehub.com-6:W4EGFwAGgBj3he7c5fNh9NkOXw0PUVaxygCVKeuvaqU= cache.flakehub.com-7:mvxJ2DZVHn/kRxlIaxYNMuDG1OvMckZu32um1TadOR8= cache.flakehub.com-8:moO+OVS0mnTjBTcOUh2kYLQEd59ExzyoW1QgQ8XAARQ= cache.flakehub.com-9:wChaSeTI6TeCuV/Sg2513ZIM9i0qJaYsF+lZCXg0J6o= cache.flakehub.com-10:2GqeNlIp6AKp4EF2MVbE1kBOp9iBSyo0UPR9KoR0o1Y=
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
upgrade-nix-store-path-url = https://install.determinate.systems/nix-upgrade/stable/universal
@@ -0,0 +1,9 @@
# Generated by https://github.com/DeterminateSystems/nix-installer.
# See `/nix/nix-installer --version` for the version details.
build-users-group = nixbld
experimental-features = nix-command flakes repl-flake
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
upgrade-nix-store-path-url = https://install.determinate.systems/nix-upgrade/stable/universal
@@ -0,0 +1,17 @@
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
@@ -0,0 +1,4 @@
# Written by https://github.com/DeterminateSystems/nix-installer.
# The contents below are based on options specified at installation time.
@@ -0,0 +1,13 @@
# Generated by https://github.com/DeterminateSystems/nix-installer.
# See `/nix/nix-installer --version` for the version details.
extra-experimental-features = nix-command flakes
always-allow-substitutes = true
extra-trusted-substituters = https://cache.flakehub.com
extra-trusted-public-keys = cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM= cache.flakehub.com-4:Asi8qIv291s0aYLyH6IOnr5Kf6+OF14WVjkE6t3xMio= cache.flakehub.com-5:zB96CRlL7tiPtzA9/WKyPkp3A2vqxqgdgyTVNGShPDU= cache.flakehub.com-6:W4EGFwAGgBj3he7c5fNh9NkOXw0PUVaxygCVKeuvaqU= cache.flakehub.com-7:mvxJ2DZVHn/kRxlIaxYNMuDG1OvMckZu32um1TadOR8= cache.flakehub.com-8:moO+OVS0mnTjBTcOUh2kYLQEd59ExzyoW1QgQ8XAARQ= cache.flakehub.com-9:wChaSeTI6TeCuV/Sg2513ZIM9i0qJaYsF+lZCXg0J6o= cache.flakehub.com-10:2GqeNlIp6AKp4EF2MVbE1kBOp9iBSyo0UPR9KoR0o1Y=
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
upgrade-nix-store-path-url = https://install.determinate.systems/nix-upgrade/stable/universal
!include nix.custom.conf
@@ -0,0 +1,3 @@
# Written by https://github.com/NixOS/nix-installer
# The contents below are based on options specified at installation time.
@@ -0,0 +1,10 @@
# Generated by https://github.com/NixOS/nix-installer
# See `/nix/nix-installer --version` for the version details.
extra-experimental-features = nix-command flakes
always-allow-substitutes = true
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
!include nix.custom.conf
@@ -0,0 +1,11 @@
# Generated by https://install.lix.systems/.
# See `/nix/lix-installer --version` for the version details.
extra-experimental-features = nix-command
always-allow-substitutes = true
extra-trusted-substituters = https://cache.lix.systems
extra-trusted-public-keys = cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
!include nix.custom.conf
@@ -0,0 +1,12 @@
# Generated by https://github.com/DeterminateSystems/nix-installer.
# See `/nix/nix-installer --version` for the version details.
build-users-group = nixbld
experimental-features = nix-command flakes
always-allow-substitutes = true
extra-trusted-substituters = https://cache.flakehub.com
extra-trusted-public-keys = cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM= cache.flakehub.com-4:Asi8qIv291s0aYLyH6IOnr5Kf6+OF14WVjkE6t3xMio= cache.flakehub.com-5:zB96CRlL7tiPtzA9/WKyPkp3A2vqxqgdgyTVNGShPDU= cache.flakehub.com-6:W4EGFwAGgBj3he7c5fNh9NkOXw0PUVaxygCVKeuvaqU= cache.flakehub.com-7:mvxJ2DZVHn/kRxlIaxYNMuDG1OvMckZu32um1TadOR8= cache.flakehub.com-8:moO+OVS0mnTjBTcOUh2kYLQEd59ExzyoW1QgQ8XAARQ= cache.flakehub.com-9:wChaSeTI6TeCuV/Sg2513ZIM9i0qJaYsF+lZCXg0J6o= cache.flakehub.com-10:2GqeNlIp6AKp4EF2MVbE1kBOp9iBSyo0UPR9KoR0o1Y=
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
upgrade-nix-store-path-url = https://install.determinate.systems/nix-upgrade/stable/universal
@@ -0,0 +1,8 @@
# Generated by https://github.com/DeterminateSystems/nix-installer.
# See `/nix/nix-installer --version` for the version details.
build-users-group = nixbld
experimental-features = nix-command flakes repl-flake
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
@@ -0,0 +1,11 @@
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
@@ -0,0 +1,3 @@
# Written by https://install.lix.systems/.
# The contents below are based on options specified at installation time.
@@ -0,0 +1,9 @@
# Generated by https://install.lix.systems/.
# See `/nix/nix-installer --version` for the version details.
build-users-group = nixbld
experimental-features = nix-command
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
substituters = https://cache.nixos.org https://cache.lix.systems
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=
@@ -0,0 +1,81 @@
# System-wide profile for interactive zsh(1) shells.
# Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
# and zshoptions(1) for more details.
# Correctly display UTF-8 with combining characters. We'll assume UTF-8 if the
# locale(1) binary is missing entirely.
if [[ ! -x /usr/bin/locale ]] || [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
setopt COMBINING_CHARS
fi
# Disable the log builtin, so we don't conflict with /usr/bin/log
disable log
# Save command history
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
# Beep on error
setopt BEEP
# Use keycodes (generated via zkbd) if present, otherwise fallback on
# values from terminfo
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
source ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
else
typeset -g -A key
[[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
[[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
[[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
[[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
[[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
[[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
[[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
[[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
[[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
[[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
[[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
[[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
[[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
[[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
[[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
[[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
[[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
[[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
[[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
[[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
[[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
[[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
[[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
[[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
[[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
[[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
[[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
[[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
[[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
[[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
[[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
fi
# Default key bindings
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
# Default prompt
PS1="%n@%m %1~ %# "
# Useful support for interacting with Terminal.app or other terminal programs
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
@@ -0,0 +1 @@
build-users-group = nixbld
@@ -0,0 +1,6 @@
# Generated by https://github.com/DeterminateSystems/nix-installer, version 0.14.0.
build-users-group = nixbld
experimental-features = nix-command flakes repl-flake
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
@@ -0,0 +1,7 @@
# Set up Nix only on SSH connections
# See: https://github.com/DeterminateSystems/nix-installer/pull/714
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ] && [ -n "${SSH_CONNECTION}" ] && [ "${SHLVL}" -eq 1 ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
@@ -0,0 +1,12 @@
# Generated by https://install.lix.systems/.
# See `/nix/lix-installer --version` for the version details.
extra-experimental-features = nix-command flakes
always-allow-substitutes = true
extra-trusted-substituters = https://cache.lix.systems
extra-trusted-public-keys = cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
!include nix.custom.conf
@@ -0,0 +1,10 @@
# Generated by https://github.com/DeterminateSystems/nix-installer.
# See `/nix/nix-installer --version` for the version details.
build-users-group = nixbld
experimental-features = nix-command flakes
always-allow-substitutes = true
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
upgrade-nix-store-path-url = https://install.determinate.systems/nix-upgrade/stable/universal
@@ -0,0 +1,5 @@
build-users-group = nixbld
max-jobs = 32
cores = 1
sandbox = false
@@ -0,0 +1,12 @@
# System-wide profile for interactive zsh(1) login shells.
# Setup user specific overrides for this in ~/.zprofile. See zshbuiltins(1)
# and zshoptions(1) for more details.
if [ -z "$LANG" ]; then
export LANG=C.UTF-8
fi
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
@@ -0,0 +1,6 @@
# Generated by https://github.com/DeterminateSystems/nix-installer, version 0.10.0.
experimental-features = nix-command flakes auto-allocate-uids
build-users-group = nixbld
auto-optimise-store = true
extra-nix-path = nixpkgs=flake:nixpkgs
bash-prompt-prefix = (nix:$name)\040
@@ -0,0 +1,73 @@
# System-wide profile for interactive zsh(1) shells.
# Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
# and zshoptions(1) for more details.
# Correctly display UTF-8 with combining characters.
if [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
setopt COMBINING_CHARS
fi
# Disable the log builtin, so we don't conflict with /usr/bin/log
disable log
# Save command history
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
# Beep on error
setopt BEEP
# Use keycodes (generated via zkbd) if present, otherwise fallback on
# values from terminfo
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
source ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
else
typeset -g -A key
[[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
[[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
[[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
[[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
[[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
[[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
[[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
[[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
[[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
[[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
[[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
[[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
[[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
[[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
[[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
[[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
[[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
[[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
[[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
[[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
[[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
[[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
[[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
[[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
[[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
[[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
[[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
[[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
[[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
[[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
[[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
fi
# Default key bindings
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
# Default prompt
PS1="%n@%m %1~ %# "
# Useful support for interacting with Terminal.app or other terminal programs
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
@@ -0,0 +1,2 @@
build-users-group = nixbld
+147
View File
@@ -0,0 +1,147 @@
{ pkgs
, options
, config
, version
, revision
, nixpkgsRevision
, extraSources ? []
, prefix ? ../..
}:
with pkgs;
let
lib = pkgs.lib;
gitHubDeclaration = user: repo: ref: subpath:
# Default to `master` if we don't know what revision the system
# configuration is using (custom nixpkgs, etc.).
let urlRef = if ref != null then ref else "master";
in {
url = "https://github.com/${user}/${repo}/blob/${urlRef}/${subpath}";
name = "<${repo}/${subpath}>";
};
optionsDoc = buildPackages.nixosOptionsDoc {
inherit options;
transformOptions = opt: opt // {
# Clean up declaration sites to not refer to the nix-darwin source tree.
# TODO: handle `extraSources`? (it's not set anywhere)
declarations = map
(decl:
if lib.hasPrefix (toString prefix) (toString decl) then
gitHubDeclaration "nix-darwin" "nix-darwin" revision
(lib.removePrefix "/"
(lib.removePrefix (toString prefix) (toString decl)))
# TODO: handle this in a better way (may require upstream
# changes to nixpkgs)
else if decl == "lib/modules.nix" then
gitHubDeclaration "NixOS" "nixpkgs" nixpkgsRevision decl
else decl)
opt.declarations;
};
};
in rec {
# TODO: Use `optionsDoc.optionsJSON` directly once upstream
# `nixosOptionsDoc` is more customizable.
optionsJSON = runCommand "options.json"
{ meta.description = "List of nix-darwin options in JSON format"; }
''
mkdir -p $out/{share/doc,nix-support}
cp -a ${optionsDoc.optionsJSON}/share/doc/nixos $out/share/doc/darwin
substitute \
${optionsDoc.optionsJSON}/nix-support/hydra-build-products \
$out/nix-support/hydra-build-products \
--replace-fail \
'${optionsDoc.optionsJSON}/share/doc/nixos' \
"$out/share/doc/darwin"
'';
# Generate the nix-darwin manual.
manualHTML = runCommand "darwin-manual-html"
{ nativeBuildInputs = [ buildPackages.nixos-render-docs ];
styles = lib.sourceFilesBySuffices (pkgs.path + "/doc") [ ".css" ];
meta.description = "The Darwin manual in HTML format";
allowedReferences = ["out"];
}
''
# Generate the HTML manual.
dst=$out/share/doc/darwin
mkdir -p $dst
cp $styles/style.css $dst
cp -r ${pkgs.documentation-highlighter} $dst/highlightjs
substitute ${./manual.md} manual.md \
--replace-fail '@DARWIN_VERSION@' "${version}" \
--replace-fail \
'@DARWIN_OPTIONS_JSON@' \
${optionsJSON}/share/doc/darwin/options.json
# Pass --redirects option if nixos-render-docs supports it
if nixos-render-docs manual html --help | grep --silent -E '^\s+--redirects\s'; then
redirects_opt="--redirects ${./redirects.json}"
fi
# TODO: --manpage-urls?
nixos-render-docs -j $NIX_BUILD_CORES manual html \
--manpage-urls ${pkgs.writeText "manpage-urls.json" "{}"} \
--revision ${lib.escapeShellArg revision} \
--generator "nixos-render-docs ${lib.version}" \
$redirects_opt \
--stylesheet style.css \
--stylesheet highlightjs/mono-blue.css \
--script ./highlightjs/highlight.pack.js \
--script ./highlightjs/loader.js \
--toc-depth 1 \
--chunk-toc-depth 1 \
./manual.md \
$dst/index.html
mkdir -p $out/nix-support
echo "nix-build out $out" >> $out/nix-support/hydra-build-products
echo "doc manual $dst" >> $out/nix-support/hydra-build-products
'';
# Index page of the nix-darwin manual.
manualHTMLIndex = "${manualHTML}/share/doc/darwin/index.html";
manualEpub = builtins.throw "The nix-darwin EPUB manual has been removed.";
# Generate the nix-darwin manpages.
manpages = runCommand "darwin-manpages"
{ nativeBuildInputs = [ buildPackages.nixos-render-docs ];
allowedReferences = ["out"];
}
''
# Generate manpages.
mkdir -p $out/share/man/man5
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
--revision ${lib.escapeShellArg revision} \
${optionsJSON}/share/doc/darwin/options.json \
$out/share/man/man5/configuration.nix.5
# TODO: get these parameterized in upstream nixos-render-docs
sed -i -e '
/^\.TH / s|NixOS|nix-darwin|g
/^\.SH "NAME"$/ {
N
s|NixOS|nix-darwin|g
}
/^\.SH "DESCRIPTION"$/ {
N; N
s|/etc/nixos/configuration|configuration|g
s|NixOS|nix-darwin|g
s|nixos|nix-darwin|g
}
/\.SH "AUTHORS"$/ {
N; N
s|Eelco Dolstra and the Nixpkgs/NixOS contributors|Daiderd Jordan and the nix-darwin contributors|g
}
' $out/share/man/man5/configuration.nix.5
'';
}
+8
View File
@@ -0,0 +1,8 @@
# nix-darwin Configuration Options {#book-darwin-manual}
## Version @DARWIN_VERSION@
```{=include=} options
id-prefix: opt-
list-id: configuration-variable-list
source: @DARWIN_OPTIONS_JSON@
```
+5
View File
@@ -0,0 +1,5 @@
{
"book-darwin-manual": [
"index.html#book-darwin-manual"
]
}
+24
View File
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>nix-darwin</title>
<script>
window.location.replace("https://github.com/nix-darwin/nix-darwin#readme");
</script>
<noscript>
<meta
http-equiv="refresh"
content="0; url=https://github.com/nix-darwin/nix-darwin#readme">
</noscript>
</head>
<body>
<h1>nix-darwin</h1>
<p>
nix-darwin is a declarative configuration system for macOS, based
on Nix. See the
<a href="https://github.com/nix-darwin/nix-darwin#readme">GitHub
repository</a> for more information.
</p>
</body>
</html>
+91
View File
@@ -0,0 +1,91 @@
let
nixDarwinVersion = builtins.fromJSON (builtins.readFile ./version.json);
checkRelease = lib:
# Avoid breaking configurations when the unstable Nixpkgs version
# rolls over.
#
# TODO: Something more refined than this would be ideal, as this
# still means you could be using unstable nix-darwin 25.05 with
# Nixpkgs 26.05, which would be unfortunate.
if nixDarwinVersion.isReleaseBranch then
lib.trivial.release == nixDarwinVersion.release
else
lib.versionAtLeast lib.trivial.release nixDarwinVersion.release;
in
{ lib
, modules
, baseModules ? import ./modules/module-list.nix
, specialArgs ? { }
, check ? true
, enableNixpkgsReleaseCheck ? true
}@args:
assert enableNixpkgsReleaseCheck -> checkRelease lib || throw ''
nix-darwin now uses release branches that correspond to Nixpkgs releases.
The nix-darwin and Nixpkgs branches in use must match, but you are currently
using nix-darwin ${nixDarwinVersion.release} with Nixpkgs ${lib.trivial.release}.
On macOS, you should use either the `nixpkgs-unstable` or
`nixpkgs-YY.MM-darwin` branches of Nixpkgs. These correspond to the
`master` and `nix-darwin-YY.MM` branches of nix-darwin, respectively. Check
<https://status.nixos.org/> for the currently supported Nixpkgs releases.
If youre using flakes, make sure your inputs look like this:
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/NIXPKGS-BRANCH";
nix-darwin.url = "github:nix-darwin/nix-darwin/NIX-DARWIN-BRANCH";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
#
};
If youre using channels, you can check your current channels with:
$ sudo nix-channel --list
nixpkgs https://nixos.org/channels/NIXPKGS-BRANCH
darwin https://github.com/nix-darwin/nix-darwin/archive/NIX-DARWIN-BRANCH.tar.gz
$ nix-channel --list
If `darwin` or `nixpkgs` are present in `nix-channel --list` (without
`sudo`), you should delete them with `nix-channel --remove NAME`. These can
contribute to version mismatch problems.
You can then fix your channels like this:
$ sudo nix-channel --add https://nixos.org/channels/NIXPKGS-BRANCH nixpkgs
$ sudo nix-channel --add https://github.com/nix-darwin/nix-darwin/archive/NIX-DARWIN-BRANCH.tar.gz darwin
$ sudo nix-channel --update
After that, activating your system again should work correctly. If it
doesnt, please open an issue at
<https://github.com/nix-darwin/nix-darwin/issues/new> and include as much
information as possible.
'';
let
argsModule = {
_file = ./eval-config.nix;
config = {
_module.args = {
inherit baseModules modules;
};
};
};
eval = lib.evalModules (builtins.removeAttrs args [ "lib" "enableNixpkgsReleaseCheck" ] // {
class = "darwin";
modules = modules ++ [ argsModule ] ++ baseModules;
specialArgs = { modulesPath = builtins.toString ./modules; } // specialArgs;
});
withExtraAttrs = configuration: configuration // {
inherit (configuration._module.args) pkgs;
system = configuration.config.system.build.toplevel;
extendModules = args: withExtraAttrs (configuration.extendModules args);
};
in withExtraAttrs eval
+11
View File
@@ -0,0 +1,11 @@
{
lib,
...
}:
{
options.flake.darwinConfigurations = lib.mkOption {
type = lib.types.lazyAttrsOf lib.types.raw;
default = { };
description = "Darwin system configurations";
};
}
Generated
+27
View File
@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1779622335,
"narHash": "sha256-ViA62qtL5za7V3d5I8OA9q9JcFhsVAiL5jVHwEclWqk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "705e9929918b43bd7b715dc0a878ac870449bb03",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-26.05-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+92
View File
@@ -0,0 +1,92 @@
{
description = "A collection of darwin modules";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin";
};
outputs = { self, nixpkgs }: let
forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forDarwinSystems = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-darwin" ];
jobs = forAllSystems (system: import ./release.nix {
inherit nixpkgs system;
nix-darwin = self;
});
in {
lib = {
evalConfig = import ./eval-config.nix;
darwinSystem = args@{ modules, ... }: self.lib.evalConfig (
{ inherit (nixpkgs) lib; }
// nixpkgs.lib.optionalAttrs (args ? pkgs) { inherit (args.pkgs) lib; }
// builtins.removeAttrs args [ "system" "pkgs" "inputs" ]
// {
modules = modules
++ nixpkgs.lib.optional (args ? pkgs) ({ lib, ... }: {
_module.args.pkgs = lib.mkForce args.pkgs;
})
# Backwards compatibility shim; TODO: warn?
++ nixpkgs.lib.optional (args ? system) ({ lib, ... }: {
nixpkgs.system = lib.mkDefault args.system;
})
# Backwards compatibility shim; TODO: warn?
++ nixpkgs.lib.optional (args ? inputs) {
_module.args.inputs = args.inputs;
}
++ [ ({ lib, ... }: {
nixpkgs.source = lib.mkDefault nixpkgs;
nixpkgs.flake.source = lib.mkDefault nixpkgs.outPath;
system.checks.verifyNixPath = lib.mkDefault false;
system.darwinVersionSuffix = ".${self.shortRev or self.dirtyShortRev or "dirty"}";
system.darwinRevision = let
rev = self.rev or self.dirtyRev or null;
in
lib.mkIf (rev != null) rev;
}) ];
});
};
overlays.default = final: prev: {
inherit (prev.callPackage ./pkgs/nix-tools { }) darwin-rebuild darwin-option darwin-version;
darwin-uninstaller = prev.callPackage ./pkgs/darwin-uninstaller { };
};
flakeModules.default = ./flake-module.nix;
darwinModules.hydra = ./modules/examples/hydra.nix;
darwinModules.lnl = ./modules/examples/lnl.nix;
darwinModules.simple = ./modules/examples/simple.nix;
templates.default = {
path = ./modules/examples/flake;
description = "nix flake init -t nix-darwin";
};
checks = forDarwinSystems (system: jobs.${system}.tests // jobs.${system}.examples);
packages = forAllSystems (system: {
inherit (jobs.${system}.docs) manualHTML manpages optionsJSON;
} // (nixpkgs.lib.optionalAttrs (nixpkgs.lib.hasSuffix "darwin" system) (let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in {
default = self.packages.${system}.darwin-rebuild;
inherit (pkgs) darwin-option darwin-rebuild darwin-version darwin-uninstaller;
# TODO: Include manuals for active release branches in the website.
# (This may involve moving it to a separate repository.)
website = pkgs.linkFarm "nix-darwin-website" {
"index.html" = ./doc/website/index.html;
manual = "${self.packages.${system}.manualHTML}/share/doc/darwin";
};
})));
};
}
+14 -3
View File
@@ -9,17 +9,28 @@ in
{
options = {
nix.profile = mkOption { default = null; };
networking.networkservices = mkOption { internal = true; default = null; };
security.enableAccessibilityAccess = mkOption { internal = true; default = null; };
security.accessibilityPrograms = mkOption { internal = true; default = null; };
};
config = {
assertions =
[ { assertion = config.nix.profile == null; message = "nix.profile was renamed to nix.package"; }
[ { assertion = config.security.enableAccessibilityAccess == null; message = "security.enableAccessibilityAccess was removed, it's broken since 10.12 because of SIP"; }
{ assertion = config.system.activationScripts.extraPostActivation.text == ""; message = "system.activationScripts.extraPostActivation was renamed to system.activationScripts.postActivation"; }
{ assertion = config.system.activationScripts.extraUserPostActivation.text == ""; message = "system.activationScripts.extraUserPostActivation was renamed to system.activationScripts.postUserActivation"; }
];
nix.package = mkIf (config.nix.profile != null) config.nix.profile;
warnings = mkIf (config.networking.networkservices != null) [
"networking.networkservices was renamed to networking.knownNetworkServices"
];
networking.knownNetworkServices = mkIf (config.networking.networkservices != null) config.networking.networkservices;
system.activationScripts.extraPostActivation.text = mkDefault "";
system.activationScripts.extraUserPostActivation.text = mkDefault "";
};
}
+149
View File
@@ -0,0 +1,149 @@
# This module defines the packages that appear in
# /run/current-system/sw.
{
config,
lib,
pkgs,
...
}:
let
makeDrvBinPath = lib.concatMapStringsSep ":" (p: if lib.isDerivation p then "${p}/bin" else p);
defaultPackageNames = [ ];
defaultPackages = map (
n:
let
pkg = pkgs.${n};
in
lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg
) defaultPackageNames;
defaultPackagesText = "[ ${lib.concatMapStringsSep " " (n: "pkgs.${n}") defaultPackageNames} ]";
in
{
imports = [
(lib.mkRenamedOptionModule ["environment" "postBuild"] ["environment" "extraSetup"])
];
options = {
environment = {
systemPath = lib.mkOption {
type = lib.types.listOf (lib.types.either lib.types.path lib.types.str);
description = "The set of paths that are added to PATH.";
apply = x: if lib.isList x then makeDrvBinPath x else x;
};
systemPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
example = lib.literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
description = ''
The set of packages that appear in
/run/current-system/sw. These packages are
automatically available to all users, and are
automatically updated every time you rebuild the system
configuration. (The latter is the main difference with
installing them in the default profile,
{file}`/nix/var/nix/profiles/default`.
'';
};
defaultPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = defaultPackages;
defaultText = lib.literalMD ''
these packages, with their `meta.priority` numerically increased
(thus lowering their installation priority):
${defaultPackagesText}
'';
example = [ ];
description = ''
Set of default packages that aren't strictly necessary
for a running system, entries can be removed for a more
minimal NixOS installation.
Like with systemPackages, packages are installed to
{file}`/run/current-system/sw`. They are
automatically available to all users, and are
automatically updated every time you rebuild the system
configuration.
'';
};
pathsToLink = lib.mkOption {
type = lib.types.listOf lib.types.str;
# According to https://github.com/NixOS/nixpkgs/blob/2795c506fe8fb7b03c36ccb51f75b6df0ab2553f/nixos/modules/config/system-path.nix#L108-L109
# `/lib` needs to be added to make NSS modules work, however currently we don't add it
# and it's unclear whether the comment applies on macOS as well.
default = [ ];
example = [ "/share/doc" ];
description = "List of directories to be symlinked in {file}`/run/current-system/sw`.";
};
extraOutputsToInstall = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [
"dev"
"info"
];
description = ''
Entries listed here will be appended to the `meta.outputsToInstall` attribute for each package in `environment.systemPackages`, and the files from the corresponding derivation outputs symlinked into {file}`/run/current-system/sw`.
For example, this can be used to install the `dev` and `info` outputs for all packages in the system environment, if they are available.
To use specific outputs instead of configuring them globally, select the corresponding attribute on the package derivation, e.g. `libxml2.dev` or `coreutils.info`.
'';
};
extraSetup = lib.mkOption {
type = lib.types.lines;
default = "";
description = "Shell fragments to be run after the system environment has been created. This should only be used for things that need to modify the internals of the environment, e.g. generating MIME caches. The environment being built can be accessed at $out.";
};
};
system = {
path = lib.mkOption {
internal = true;
description = ''
The packages you want in the system environment.
'';
};
};
};
config = {
environment.systemPackages = config.environment.defaultPackages;
environment.pathsToLink = [
"/bin"
"/share/locale"
];
system.path = pkgs.buildEnv {
name = "system-path";
paths = config.environment.systemPackages;
inherit (config.environment) pathsToLink extraOutputsToInstall;
ignoreCollisions = true;
# !!! Hacky, should modularise.
# outputs TODO: note that the tools will often not be linked by default
postBuild = ''
# Remove wrapped binaries, they shouldn't be accessible via PATH.
find $out/bin -maxdepth 1 -name ".*-wrapped" -type l -delete
${config.environment.extraSetup}
'';
};
};
}
+90
View File
@@ -0,0 +1,90 @@
# This module manages the terminfo database
# and its integration in the system.
{
config,
lib,
pkgs,
...
}:
{
options = {
environment.enableAllTerminfo = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
Whether to install all terminfo outputs
'';
};
security.sudo.keepTerminfo = lib.mkOption {
default = true;
type = lib.types.bool;
description = ''
Whether to preserve the `TERMINFO` and `TERMINFO_DIRS`
environment variables, for `root` and the `admin` group.
'';
};
};
config = {
# This should not contain packages that are broken or can't build, since it
# will break this expression
#
# can be generated with:
# lib.attrNames (lib.filterAttrs
# (_: drv: (builtins.tryEval (
# lib.isDerivation drv && drv ? terminfo && drv.meta.available && !drv.meta.broken && !drv.meta.unsupported)).value)
# pkgs)
environment.systemPackages = lib.mkIf config.environment.enableAllTerminfo (
map (x: x.terminfo) (
with pkgs.pkgsBuildBuild;
[
alacritty
alacritty-graphics
ghostty-bin
kitty
mtm
rio
rxvt-unicode-unwrapped
rxvt-unicode-unwrapped-emoji
st
tmux
wezterm
]
)
);
environment.pathsToLink = [
"/share/terminfo"
];
environment.etc.terminfo = {
source = "${config.system.path}/share/terminfo";
};
# TODO: use `environment.profileRelativeSessionVariables`
environment.variables = {
TERMINFO_DIRS = map (path: path + "/share/terminfo") config.environment.profiles ++ [ "/usr/share/terminfo" ];
};
environment.extraInit = ''
# reset TERM with new TERMINFO available (if any)
export TERM=$TERM
'';
security =
let
extraConfig = ''
# Keep terminfo database for root and %admin.
Defaults:root,%admin env_keep+=TERMINFO_DIRS
Defaults:root,%admin env_keep+=TERMINFO
'';
in
lib.mkIf config.security.sudo.keepTerminfo {
sudo = { inherit extraConfig; };
};
};
}
+111
View File
@@ -0,0 +1,111 @@
{ config, lib, pkgs, baseModules, modules, ... }:
with lib;
let
cfg = config.documentation;
# To reference the regular configuration from inside the docs evaluation further down.
# While not strictly necessary, this extra binding avoids accidental name capture in
# the future.
regularConfig = config;
argsModule = {
config._module.args = lib.mkForce (regularConfig._module.args // {
modules = [ ];
});
};
/* For the purpose of generating docs, evaluate options with each derivation
in `pkgs` (recursively) replaced by a fake with path "\${pkgs.attribute.path}".
It isn't perfect, but it seems to cover a vast majority of use cases.
Caveat: even if the package is reached by a different means,
the path above will be shown and not e.g. `${config.services.foo.package}`. */
manual = import ../../doc/manual {
inherit pkgs config;
version = config.system.darwinVersion;
revision = config.system.darwinRevision;
inherit (config.system) nixpkgsRevision;
options =
let
scrubbedEval = import ../../eval-config.nix {
inherit lib;
modules = [ argsModule ];
specialArgs = { pkgs = scrubDerivations "pkgs" pkgs; };
};
scrubDerivations = namePrefix: pkgSet: mapAttrs
(name: value:
let wholeName = "${namePrefix}.${name}"; in
if isAttrs value then
scrubDerivations wholeName value
// (optionalAttrs (isDerivation value) { outPath = "\${${wholeName}}"; })
else value
)
pkgSet;
in scrubbedEval.options;
};
helpScript = pkgs.writeScriptBin "darwin-help"
''
#! ${pkgs.stdenv.shell} -e
open ${manual.manualHTMLIndex}
'';
in
{
options = {
documentation.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to install documentation of packages from
{option}`environment.systemPackages` into the generated system path.
See "Multiple-output packages" chapter in the nixpkgs manual for more info.
'';
# which is at ../../../doc/multiple-output.xml
};
documentation.man.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to install manual pages and the {command}`man` command.
This also includes "man" outputs.
'';
};
documentation.info.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to install info pages and the {command}`info` command.
This also includes "info" outputs.
'';
};
documentation.doc.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to install documentation distributed in packages' `/share/doc`.
Usually plain text and/or HTML.
This also includes "doc" outputs.
'';
};
};
config = mkIf cfg.enable {
programs.man.enable = cfg.man.enable;
programs.info.enable = cfg.info.enable;
environment.systemPackages = mkMerge [
(mkIf cfg.man.enable [ manual.manpages ])
(mkIf cfg.doc.enable [ manual.manualHTML helpScript ])
];
system.build.manual = manual;
};
}
+91 -69
View File
@@ -1,66 +1,60 @@
{ config, lib, pkgs, ... }:
{ options, config, lib, pkgs, ... }:
with lib;
let
cfg = config.environment;
exportVariables =
mapAttrsToList (n: v: ''export ${n}="${v}"'') cfg.variables;
aliasCommands =
mapAttrsFlatten (n: v: ''alias ${n}="${v}"'') cfg.shellAliases;
mapAttrsToList (n: v: ''alias ${n}=${escapeShellArg v}'')
(filterAttrs (k: v: v != null) cfg.shellAliases);
in
makeDrvBinPath = concatMapStringsSep ":" (p: if isDerivation p then "${p}/bin" else p);
{
imports = [
(mkRemovedOptionModule [ "environment" "loginShell" ] ''
This option was only used to change the default command in tmux.
This has been removed in favour of changing the default command or default shell in tmux directly.
'')
];
in {
options = {
environment.systemPackages = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.nix-repl pkgs.vim ]";
description = ''
The set of packages that appear in
/run/current-system/sw. These packages are
automatically available to all users, and are
automatically updated every time you rebuild the system
configuration. (The latter is the main difference with
installing them in the default profile,
<filename>/nix/var/nix/profiles/default</filename>.
'';
};
environment.systemPath = mkOption {
type = types.loeOf types.str;
description = "The set of paths that are added to PATH.";
apply = x: if isList x then makeDrvBinPath x else x;
};
environment.profiles = mkOption {
type = types.listOf types.str;
description = "A list of profiles used to setup the global environment.";
};
environment.extraOutputsToInstall = mkOption {
type = types.listOf types.str;
default = [];
example = [ "doc" "info" "devdoc" ];
description = "List of additional package outputs to be symlinked into <filename>/run/current-system/sw</filename>.";
};
environment.darwinConfig = mkOption {
type = types.nullOr (types.either types.path types.str);
default =
if config.nixpkgs.flake.setNixPath then
# Dont set this for flakebased systems.
null
else if config.system.stateVersion >= 6 then
"/etc/nix-darwin/configuration.nix"
else
"${config.system.primaryUserHome}/.nixpkgs/darwin-configuration.nix";
defaultText = literalExpression ''
if config.nixpkgs.flake.setNixPath then
# Dont set this for flakebased systems.
null
else if config.system.stateVersion >= 6 then
"/etc/nix-darwin/configuration.nix"
else
"''${config.system.primaryUserHome}/.nixpkgs/darwin-configuration.nix"
'';
description = ''
The path of the darwin configuration.nix used to configure the system,
this updates the default darwin-config entry in NIX_PATH. Since this
changes an environment variable it will only apply to new shells.
environment.pathsToLink = mkOption {
type = types.listOf types.str;
default = [];
example = [ "/share/doc" ];
description = "List of directories to be symlinked in <filename>/run/current-system/sw</filename>.";
};
environment.loginShell = mkOption {
type = types.str;
default = "$SHELL";
description = "Configure default login shell.";
NOTE: Changing this requires running {command}`darwin-rebuild switch -I darwin-config=/path/to/configuration.nix`
the first time to make darwin-rebuild aware of the custom location.
'';
};
environment.variables = mkOption {
@@ -94,9 +88,29 @@ in {
description = ''
Shell script code called during global environment initialisation
after all variables and profileVariables have been set.
This code is assumed to be shell-independent, which means you should
stick to pure sh without sh word split.
'';
};
environment.shellInit = mkOption {
default = "";
description = ''
Shell script code called during shell initialisation.
This code is asumed to be shell-independent, which means you should
stick to pure sh without sh word split.
'';
type = types.lines;
};
environment.loginShellInit = mkOption {
default = "";
description = ''
Shell script code called during login shell initialisation.
This code is asumed to be shell-independent, which means you should
stick to pure sh without sh word split.
'';
type = types.lines;
};
environment.interactiveShellInit = mkOption {
@@ -108,49 +122,57 @@ in {
'';
type = types.lines;
};
};
config = {
environment.systemPath = [ (makeBinPath cfg.profiles) "/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin" ];
# This is horrible, sorry.
system.requiresPrimaryUser = mkIf (
config.nix.enable
&& !config.nixpkgs.flake.setNixPath
&& config.system.stateVersion < 6
&& options.environment.darwinConfig.highestPrio == (mkOptionDefault {}).priority
) [
"environment.darwinConfig"
];
environment.profiles =
[ # Use user, default and system profiles.
"$HOME/.nix-profile"
"/nix/var/nix/profiles/default"
"/run/current-system/sw"
];
environment.systemPath = mkMerge [
[ (makeBinPath cfg.profiles) ]
(mkOrder 1200 [ "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" ])
];
environment.pathsToLink =
[ "/bin"
"/lib"
"/share/info"
"/share/locale"
];
# Use user, default and system profiles.
environment.profiles = mkMerge [
(mkOrder 800 [ "$HOME/.nix-profile" ])
[ "/run/current-system/sw" "/nix/var/nix/profiles/default" ]
];
environment.extraInit = ''
# reset TERM with new TERMINFO available (if any)
export TERM=$TERM
export NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/$USER"
export NIX_PROFILES="${concatStringsSep " " (reverseList cfg.profiles)}"
'';
environment.variables =
{ NIX_SSL_CERT_FILE = mkDefault "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
{
XDG_CONFIG_DIRS = map (path: path + "/etc/xdg") cfg.profiles;
XDG_DATA_DIRS = map (path: path + "/share") cfg.profiles;
EDITOR = mkDefault "nano";
PAGER = mkDefault "less -R";
};
system.path = pkgs.buildEnv {
name = "system-path";
paths = cfg.systemPackages;
inherit (cfg) pathsToLink extraOutputsToInstall;
};
system.build.setEnvironment = pkgs.writeText "set-environment" ''
# Prevent this file from being sourced by child shells.
export __NIX_DARWIN_SET_ENVIRONMENT_DONE=1
system.build.setEnvironment = concatStringsSep "\n" exportVariables;
system.build.setAliases = concatStringsSep "\n" aliasCommands;
export PATH=${config.environment.systemPath}
${concatStringsSep "\n" exportVariables}
# Extra initialisation
${cfg.extraInit}
'';
system.build.setAliases = pkgs.writeText "set-aliases" ''
${concatStringsSep "\n" aliasCommands}
'';
};
}
+43
View File
@@ -0,0 +1,43 @@
{
description = "Example nix-darwin system flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin";
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nix-darwin, nixpkgs }:
let
configuration = { pkgs, ... }: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[ pkgs.vim
];
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Enable alternative shell support in nix-darwin.
# programs.fish.enable = true;
# Set Git commit hash for darwin-version.
system.configurationRevision = self.rev or self.dirtyRev or null;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 6;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#simple
darwinConfigurations."simple" = nix-darwin.lib.darwinSystem {
modules = [ configuration ];
};
};
}
+47
View File
@@ -0,0 +1,47 @@
{ config, lib, pkgs, ... }:
let
environment = lib.concatStringsSep " "
[ "NIX_REMOTE=daemon"
"NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
in
{
nix.settings.substituters = [ "http://cache1" ];
nix.settings.trusted-public-keys = [ "cache.daiderd.com-1:R8KOWZ8lDaLojqD+v9dzXAqGn29gEzPTTbr/GIpCTrI=" ];
nix.settings.trusted-users = [ "@admin" "@hydra" ];
nix.extraOptions = ''
pre-build-hook =
'';
nix.gc.automatic = true;
nix.gc.options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";
environment.etc."per-user/hydra/ssh/authorized_keys".text = lib.concatStringsSep "\n"
[ "command=\"${environment} ${config.nix.package}/bin/nix-store --serve --write\" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCVsc0pHGsskoayziMhA2e59bHPWe0bbKgusmqhuJFBGQ1BAk9UmPzKCWE3nCiV6CLD1+SygVkBjb06DYtc+94BnzviCa9qZtL0G4+2vhp6x8OvXh8xlf/eWw3k5MWlvu+kjJFpbW8wHWTiUqzH+uEeHklAosT0lFNjiIYd/Vs3JAezhUR62a6c7ZjWOd5F7ALGEKzOiwC4i37kSgGsIWNCbe0Ku7gyr718zhMGeyxax6saHhnkSpIB+7d6oHhKeiJSFMWctNmz1/qxXUPbxNaJvqgdKlVHhN+B7x/TIbkVr5pTC59Okx9LTcpflFIv79VT+Gf1K7VypZpSvJjG0xFRt8iDs1+ssWFBfvpo94vUbZ+ZwMDcBGR5iJeO41Gj5fYn5aaDl32RXfJ9Fkwael1L6pcXtkIc66jk+KQQpgoeNj8Y3Emntpqva/2AM41wDDvr5tKp5KhEKFLM95CoiWq+g88pZLcpqLK7wooDVqNkVUEbMaj9lBN0AzU9mcsIRGvTa6CmWAdBvwqS2fRZD97Oarqct9AWgb0X6mOUq9BJNi4i4xvjgnVkylLwtLUnibR/PeXMtkb9bv6BEZXNf5ACqxSjKXJyaIHI65I5TILCr5eEgaujgvmkREn6U3T1NZAUIeVe9aVYLqehYh79OHUBzggoHqidRrXBB/6zdg9UgQ=="
"command=\"${environment} ${config.nix.package}/bin/nix-store --serve --write\" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCnubA1pRqlpoAXkZ1q5nwhqi1RY2z840wFLFDj7vAMSups9E2U8PNIVtuVYApZpkBWIpzD4GGbQTF5Itnu5uBpJswc2Yat9yGWO/guuVyXIaRoBIM0Pg1WBWcWsz+k4rNludu9UQ74FHqEiqZIuIuOcgV+RIZn8xQlGt2kUqN9TWboHhZz8Zhx7EtGSJH6MJRLn3mA/pPjOF6k1jiiFG1pVDuqBTZPANkelWYCWAJ46jCyhxXltWE/jkBYGc/XbB8yT7DFE1XC6TVsSEp68R9PhVG3yqxqY06sniEyduSoGt/TDr6ycERd93bvLElXFATes85YiFszeaUgayYSKwQPe0q7YeHMhIXL0UYJYaKVVgT9saFDiHDzde7kKe+NA+J4+TbIk7Y/Ywn0jepsYV13M7TyEqgqbu9fvVGF3JI9+4g0m1gAzHTa7n6iiAedtz+Pi79uCEpRD2hWSSoLWroyPlep8j1p2tygtFsrieePEukesoToCTwqg1Ejnjh+yKdtUbc6xpyRvl3hKeO8QbCpfaaVd27e4vE4lP2JMW6nOo8b0wlVXQIFe5K2zh52q1MSwhLAq6Kg8oPmgj0lru4IivmPc+/NVwd3Qj3E9ZB8LRfTesfbcxHrC8lF5dL/QpLMeLwebrwCxL19gI0kxmDIaUQuHSyP3B2z+EmBKcN/Xw=="
];
users.knownGroups = [ "hydra" ];
users.knownUsers = [ "hydra" ];
users.groups.hydra = { gid = 530; description = "Hydra builder group"; members = [ "hydra" ]; };
users.users.hydra = { uid = 530; gid = 530; description = "Hydra"; home = "/Users/hydra"; shell = "/bin/bash"; };
system.activationScripts.postActivation.text = ''
printf "disabling spotlight indexing... "
mdutil -i off -d / &> /dev/null
mdutil -E / &> /dev/null
echo "ok"
printf "configuring ssh keys for hydra... "
mkdir -p ~hydra/.ssh
cp -f /etc/per-user/hydra/ssh/authorized_keys ~hydra/.ssh/authorized_keys
chown hydra:hydra ~hydra ~hydra/.ssh ~hydra/.ssh/authorized_keys
echo "ok"
'';
system.stateVersion = 6;
}
+217 -470
View File
@@ -1,71 +1,102 @@
{ config, lib, pkgs, ... }:
{ config, lib, inputs, pkgs, ... }:
{
system.primaryUser = "lnl";
system.defaults.NSGlobalDomain.AppleKeyboardUIMode = 3;
system.defaults.NSGlobalDomain.ApplePressAndHoldEnabled = false;
system.defaults.NSGlobalDomain.InitialKeyRepeat = 10;
system.defaults.NSGlobalDomain.KeyRepeat = 1;
system.defaults.NSGlobalDomain.NSAutomaticCapitalizationEnabled = false;
system.defaults.NSGlobalDomain.NSAutomaticInlinePredictionEnabled = false;
system.defaults.NSGlobalDomain.NSAutomaticDashSubstitutionEnabled = false;
system.defaults.NSGlobalDomain.NSAutomaticPeriodSubstitutionEnabled = false;
system.defaults.NSGlobalDomain.NSAutomaticQuoteSubstitutionEnabled = false;
system.defaults.NSGlobalDomain.NSAutomaticSpellingCorrectionEnabled = false;
system.defaults.NSGlobalDomain.NSNavPanelExpandedStateForSaveMode = true;
system.defaults.NSGlobalDomain.NSNavPanelExpandedStateForSaveMode2 = true;
system.defaults.NSGlobalDomain._HIHideMenuBar = true;
system.defaults.dock.autohide = true;
system.defaults.dock.mru-spaces = false;
system.defaults.dock.orientation = "left";
system.defaults.dock.showhidden = true;
system.defaults.dock.mru-spaces = false;
system.defaults.finder.AppleShowAllExtensions = true;
system.defaults.finder.QuitMenuItem = true;
system.defaults.finder.FXEnableExtensionChangeWarning = false;
system.defaults.trackpad.Clicking = true;
system.defaults.trackpad.TrackpadThreeFingerDrag = true;
system.keyboard.enableKeyMapping = true;
system.keyboard.remapCapsLockToControl = true;
environment.systemPackages =
[ pkgs.curl
[
config.programs.vim.package
pkgs.awscli
pkgs.brotli
pkgs.ctags
pkgs.curl
pkgs.direnv
pkgs.entr
pkgs.fzf
pkgs.gettext
pkgs.git
pkgs.gnupg
pkgs.htop
pkgs.jq
pkgs.mosh
pkgs.silver-searcher
pkgs.nix-repl
pkgs.ripgrep
pkgs.shellcheck
];
environment.extraOutputsToInstall = [ "man" ];
services.yabai.enable = true;
services.yabai.package = pkgs.yabai;
services.skhd.enable = true;
services.khd.enable = true;
services.khd.enableAccessibilityAccess = true;
services.kwm.enable = true;
services.kwm.enableAccessibilityAccess = true;
# security.sandbox.profiles.fetch-nixpkgs-updates.closure = [ pkgs.cacert pkgs.git ];
# security.sandbox.profiles.fetch-nixpkgs-updates.allowNetworking = true;
# security.sandbox.profiles.fetch-nixpkgs-updates.writablePaths = [ (toString ~/Code/nixos/nixpkgs) ];
launchd.user.agents.fetch-nixpkgs = {
command = "${pkgs.git}/bin/git -C ~/.nix-defexpr/nixpkgs fetch origin master";
environment.GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
serviceConfig.KeepAlive = false;
serviceConfig.ProcessType = "Background";
serviceConfig.StartInterval = 60;
};
# launchd.user.agents.fetch-nixpkgs-updates = {
# command = "/usr/bin/sandbox-exec -f ${config.security.sandbox.profiles.fetch-nixpkgs-updates.profile} ${pkgs.git}/bin/git -C ${toString ~/Code/nixos/nixpkgs} fetch origin master";
# environment.HOME = "";
# environment.NIX_SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
# serviceConfig.KeepAlive = false;
# serviceConfig.ProcessType = "Background";
# serviceConfig.StartInterval = 360;
# };
services.activate-system.enable = true;
# services.nix-daemon.enable = true;
# services.nix-daemon.tempDir = "/build/tmp";
# Dotfiles.
# launchd.user.agents.letty = {
# serviceConfig.Program = "${pkgs.lnl.letty}/bin/letty-blink";
# serviceConfig.WatchPaths = ["/var/mail/lnl"];
# serviceConfig.KeepAlive = false;
# serviceConfig.ProcessType = "Background";
# };
# services.nix-daemon.enableSocketListener = true;
# nix.distributedBuilds = true;
nix.extraOptions = ''
gc-keep-derivations = true
gc-keep-outputs = true
pre-build-hook =
min-free = 17179870000
max-free = 17179870000
log-lines = 128
'';
nix.binaryCachePublicKeys = [ "cache.daiderd.com-1:R8KOWZ8lDaLojqD+v9dzXAqGn29gEzPTTbr/GIpCTrI=" ];
nix.trustedBinaryCaches = [ https://d3i7ezr9vxxsfy.cloudfront.net ];
nix.trustedUsers = [ "@admin" ];
nix.settings.trusted-public-keys = [ "cache.daiderd.com-1:R8KOWZ8lDaLojqD+v9dzXAqGn29gEzPTTbr/GIpCTrI=" ];
nix.settings.trusted-substituters = [ "https://d3i7ezr9vxxsfy.cloudfront.net" ];
programs.nix-script.enable = true;
nix.settings.sandbox = true;
nix.settings.extra-sandbox-paths = [ "/private/tmp" "/private/var/tmp" "/usr/bin/env" ];
programs.nix-index.enable = true;
# programs.gnupg.agent.enable = true;
# programs.gnupg.agent.enableSSHSupport = true;
programs.tmux.enable = true;
programs.tmux.enableSensible = true;
@@ -73,143 +104,94 @@
programs.tmux.enableFzf = true;
programs.tmux.enableVim = true;
programs.tmux.tmuxConfig = ''
programs.tmux.extraConfig = ''
bind 0 set status
bind S choose-session
bind-key -r "<" swap-window -t -1
bind-key -r ">" swap-window -t +1
bind-key -n M-c run "tmux send-keys -t .+ C-\\\\ && tmux send-keys -t .+ C-a C-k C-l Up && tmux send-keys -t .+ Enter"
bind-key -n M-r run "tmux send-keys -t .+ C-a C-k C-l Up && tmux send-keys -t .+ Enter"
set -g pane-active-border-style fg=black
set -g pane-border-style fg=black
set -g status-bg black
set -g status-fg white
set -g status-right '#[fg=white]#(id -un)@#(hostname) #(jq --raw-output '.darwinLabel' /run/current-system/darwin-version.json)'
'';
programs.vim.enable = true;
programs.vim.enableSensible = true;
environment.etc."nix/user-sandbox.sb".text = ''
(version 1)
(allow default)
(deny file-write*
(subpath "/nix"))
(allow file-write*
(subpath "/nix/var/nix/gcroots/per-user")
(subpath "/nix/var/nix/profiles/per-user"))
programs.vim.plugins = [
{ names = [ "ReplaceWithRegister" "vim-indent-object" "vim-sort-motion" ]; }
{ names = [ "ale" "vim-gitgutter" "vim-dispatch" ]; }
{ names = [ "commentary" "vim-eunuch" "repeat" "tabular" ]; }
{ names = [ "fzfWrapper" "youcompleteme" ]; }
{ names = [ "gist-vim" "webapi-vim" ]; }
{ names = [ "polyglot" "colors-solarized" ]; }
{ names = [ "python-mode" ]; }
];
(allow process-exec
(literal "/bin/ps")
(with no-sandbox))
'';
programs.vim.extraKnownPlugins = with pkgs; {
ale = vimUtils.buildVimPluginFrom2Nix {
name = "vim-ale-2017-05-16";
src = fetchgit {
url = "https://github.com/w0rp/ale";
rev = "e2860f8a26dc9c04bb4ad6fb59ffb8c743717149";
sha256 = "1mpqvfyl47ap32g9qprxpwfcgxhm25ar6qy3p01n77fygva0371d";
};
};
# programs.vim.enable = true;
# programs.vim.enableSensible = true;
programs.vim.package = pkgs.neovim.override {
configure = {
packages.darwin.start = with pkgs.vimPlugins; [
vim-sensible
vim-surround
ReplaceWithRegister
polyglot
fzfWrapper
ale
deoplete-nvim
];
vim-nix = vimUtils.buildVimPluginFrom2Nix {
name = "vim-nix-2017-04-30";
src = fetchFromGitHub {
owner = "LnL7";
repo = "vim-nix";
rev = "867488a04c2ddc47f0f235f37599a06472fea299";
sha256 = "1mwc06z9q45cigyxd0r9qnfs4ph6lbcwx50rf5lmpavakcn3vqir";
};
customRC = ''
set completeopt=menuone
set encoding=utf-8
set hlsearch
set list
set number
set showcmd
set splitright
cnoremap %% <C-r>=expand('%:h') . '/'<CR>
nnoremap // :nohlsearch<CR>
let mapleader = ' '
" fzf
nnoremap <Leader>p :FZF<CR>
" vim-surround
vmap s S
" ale
nnoremap <Leader>d :ALEGoToDefinition<CR>
nnoremap <Leader>D :ALEGoToDefinitionInVSplit<CR>
nnoremap <Leader>k :ALESignature<CR>
nnoremap <Leader>K :ALEHover<CR>
nnoremap [a :ALEPreviousWrap<CR>
nnoremap ]a :ALENextWrap<CR>
" deoplete
inoremap <expr><C-g> deoplete#undo_completion()
inoremap <expr><C-l> deoplete#refresh()
inoremap <silent><expr><C-Tab> deoplete#mappings#manual_complete()
inoremap <silent><expr><Tab> pumvisible() ? "\<C-n>" : "\<TAB>"
let g:deoplete#enable_at_startup = 1
'';
};
};
programs.vim.vimConfig = ''
colorscheme solarized
set bg=dark
# Dotfiles.
# programs.vim.package = mkForce pkgs.lnl.vim;
set clipboard=unnamed
set relativenumber
set backup
set backupdir=~/.vim/tmp/backup//
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim/tmp/swap/
set noswapfile
set undodir=~/.vim/tmp/undo//
set undofile
if !isdirectory(expand(&undodir))
call mkdir(expand(&undodir), "p")
endif
if !isdirectory(expand(&backupdir))
call mkdir(expand(&backupdir), "p")
endif
if !isdirectory(expand(&directory))
call mkdir(expand(&directory), "p")
endif
vmap s S
inoremap <C-g> <Esc><CR>
vnoremap <C-g> <Esc><CR>
cnoremap <C-g> <Esc><CR>
cnoremap %% <C-r>=expand('%:h') . '/'<CR>
let mapleader = ' '
nnoremap <Leader>p :FZF<CR>
nnoremap <silent> <Leader>e :exe 'FZF ' . expand('%:h')<CR>
function! s:ag_to_qf(line)
let parts = split(a:line, ':')
return {'filename': parts[0], 'lnum': parts[1], 'col': parts[2],
\ 'text': join(parts[3:], ':')}
endfunction
function! s:ag_handler(lines)
if len(a:lines) < 2 | return | endif
let cmd = get({'ctrl-x': 'split',
\ 'ctrl-v': 'vertical split',
\ 'ctrl-t': 'tabe'}, a:lines[0], 'e')
let list = map(a:lines[1:], 's:ag_to_qf(v:val)')
let first = list[0]
execute cmd escape(first.filename, ' %#\')
execute first.lnum
execute 'normal!' first.col.'|zz'
if len(list) > 1
call setqflist(list)
copen
wincmd p
endif
endfunction
command! -nargs=* Ag call fzf#run({
\ 'source': printf('${pkgs.ag}/bin/ag --nogroup --column --color "%s"',
\ escape(empty(<q-args>) ? '^(?=.)' : <q-args>, '"\')),
\ 'sink*': function('<sid>ag_handler'),
\ 'options': '--ansi --expect=ctrl-t,ctrl-v,ctrl-x --delimiter : --nth 4.. '.
\ '--multi --bind ctrl-a:select-all,ctrl-d:deselect-all '.
\ '--color hl:68,hl+:110',
\ 'down': '50%' })
highlight clear SignColumn
let g:ale_sign_error = ''
let g:ale_sign_warning = ''
" let g:ycm_add_preview_to_completeopt = 1
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_semantic_triggers = {}
nmap <Leader>D :YcmCompleter GetDoc<CR>
nmap <Leader>d :YcmCompleter GoToDefinition<CR>
nmap <Leader>r :YcmCompleter GoToReferences<CR>
let g:pymode_folding = 0
let g:pymode_lint = 0
let g:pymode_options_colorcolumn = 0
let g:pymode_options_max_line_length = 120
let g:pymode_rope_complete_on_dot = 0
let g:pymode_rope_regenerate_on_write = 0
'';
programs.bash.completion.enable = true;
programs.zsh.enable = true;
programs.zsh.enableBashCompletion = true;
@@ -217,24 +199,62 @@
programs.zsh.enableFzfGit = true;
programs.zsh.enableFzfHistory = true;
programs.zsh.variables.cfg = "$HOME/.nixpkgs/darwin-config.nix";
programs.zsh.variables.cfg = "/etc/nix-darwin/configuration.nix";
programs.zsh.variables.darwin = "$HOME/.nix-defexpr/darwin";
programs.zsh.variables.pkgs = "$HOME/.nix-defexpr/nixpkgs";
programs.zsh.variables.nixpkgs = "$HOME/.nix-defexpr/nixpkgs";
programs.zsh.promptInit = ''
autoload -U promptinit && promptinit
PROMPT='%B%(?..%? )%b '
RPROMPT='%F{green}%~%f'
setopt PROMPTSUBST
_prompt_nix() {
[ -z "$IN_NIX_SHELL" ] || echo "%F{yellow}%B[''${name:+$name}]%b%f "
}
PS1='%F{red}%B%(?..%? )%b%f%# '
RPS1='$(_prompt_nix)%F{green}%~%f'
if [ -n "$IN_NIX_SANDBOX" ]; then
PS1+='%F{red}[sandbox]%f '
fi
'';
programs.zsh.loginShellInit = ''
reexec() {
unset __ETC_ZSHRC_SOURCED
unset __ETC_ZSHENV_SOURCED
unset __ETC_ZPROFILE_SOURCED
exec $SHELL -c 'echo "reexecuting shell: $SHELL" >&2 && exec $SHELL -l'
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
unset __ETC_ZPROFILE_SOURCED __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED
exec $SHELL -c 'echo >&2 "reexecuting shell: $SHELL" && exec $SHELL -l'
}
reexec-tmux() {
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
unset __ETC_ZPROFILE_SOURCED __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED
exec tmux new-session -A -s _ "$@"
}
reexec-sandbox() {
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
unset __ETC_ZPROFILE_SOURCED __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED
export IN_NIX_SANDBOX=1
exec /usr/bin/sandbox-exec -f /etc/nix/user-sandbox.sb $SHELL -l
}
ls() {
${pkgs.coreutils}/bin/ls --color=auto "$@"
}
install_name_tool() {
${pkgs.darwin.cctools}/bin/install_name_tool "$@"
}
nm() {
${pkgs.darwin.cctools}/bin/nm "$@"
}
otool() {
${pkgs.darwin.cctools}/bin/otool "$@"
}
'';
@@ -249,330 +269,57 @@
zle -N up-line-or-beginning-search
'';
environment.variables.HOMEBREW_CASK_OPTS = "--appdir=/Applications/cask";
environment.variables.SHELL = "${pkgs.zsh}/bin/zsh";
environment.variables.LANG = "en_US.UTF-8";
environment.shellAliases.g = "git log --pretty=color -32";
environment.shellAliases.gb = "git branch";
environment.shellAliases.gc = "git checkout";
environment.shellAliases.gcb = "git checkout -B";
environment.shellAliases.gd = "git diff --minimal --patch";
environment.shellAliases.gf = "git fetch";
environment.shellAliases.gl = "git log --pretty=color --graph";
environment.shellAliases.glog = "git log --pretty=nocolor";
environment.shellAliases.ga = "git log --pretty=color --all";
environment.shellAliases.gg = "git log --pretty=color --graph";
environment.shellAliases.gl = "git log --pretty=nocolor";
environment.shellAliases.grh = "git reset --hard";
environment.shellAliases.l = "ls -lh";
environment.shellAliases.ls = "ls -G";
environment.shellAliases.nb = "nix-build";
environment.shellAliases.ni = "nix-instantiate";
environment.shellAliases.ns = "nix-shell";
nix.nixPath =
[ # Use local nixpkgs checkout instead of channels.
"darwin=$HOME/.nix-defexpr/darwin"
"darwin-config=$HOME/.nixpkgs/darwin-configuration.nix"
"nixpkgs=$HOME/.nix-defexpr/nixpkgs"
"/nix/var/nix/profiles/per-user/root/channels"
];
environment.extraInit = ''
# Load and export variables from environment.d.
if [ -d /etc/environment.d ]; then
set -a
. /etc/environment.d/*
set +a
fi
'';
nixpkgs.config.allowUnfree = true;
nixpkgs.config.packageOverrides = pkgs: {
ycmd = pkgs.ycmd.override { gocode = null; godef = null; rustracerd = null; };
};
# TODO: add module for per-user config, etc, ...
environment.etc."per-user/lnl/gitconfig".text = ''
[include]
path = .gitconfig.local
nixpkgs.overlays = [
(self: super: {
vim_configurable = super.vim_configurable.override {
guiSupport = "no";
};
})
];
[core]
excludesfile = ~/.gitignore
autocrlf = input
# Dotfiles.
# nixpkgs.overlays = mkAfter inputs.dotfiles.darwinOverlays;
[color]
ui = auto
# Dotfiles.
# services.yabai.enable = true;
# services.yabai.package = pkgs.yabai;
# services.skhd.skhdConfig = builtins.readFile "${inputs.dotfiles}/skhd/skhdrc";
# services.yabai.extraConfig = builtins.readFile "${inputs.dotfiles}/yabai/yabairc";
[pretty]
color = format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset
nocolor = format:%h%d %s %an, %ar
# Dotfiles.
# $ cat ~/.gitconfig
# [include]
# path = /etc/per-user/lnl/gitconfig
# environment.etc."per-user/lnl/gitconfig".text = builtins.readFile "${inputs.dotfiles}/git/gitconfig";
[user]
name = Daiderd Jordan
nix.nrBuildUsers = 32;
[github]
user = LnL7
'';
environment.etc."per-user/lnl/khdrc".text = ''
# remap left-control h/j/k/l -> arrow keys
lctrl - h [Safari] : khd -p "- left"
lctrl - j [Safari] : khd -p "- down"
lctrl - k [Safari] : khd -p "- up"
lctrl - l [Safari] : khd -p "- right"
shift + lctrl - h [Safari] : khd -p "shift - left"
shift + lctrl - j [Safari] : khd -p "shift - down"
shift + lctrl - k [Safari] : khd -p "shift - up"
shift + lctrl - l [Safari] : khd -p "shift - right"
# remap left-control a / e -> start / end of line
lctrl - a [Safari] : khd -p "cmd - left"
lctrl - e [Safari] : khd -p "cmd - right"
shift + lctrl - e [Safari] : khd -p "shift + cmd - left"
shift + lctrl - e [Safari] : khd -p "shift + cmd - right"
# remap left-control b / w -> start / end of word
lctrl - b [Safari] : khd -p "alt - left"
lctrl - w [Safari] : khd -p "alt - right"
shift + lctrl - b [Safari] : khd -p "shift + alt - left"
shift + lctrl - w [Safari] : khd -p "shift + alt - right"
# remap left-control u / d -> page up / page down
lctrl - u [Safari] : khd -p "alt - up"
lctrl - d [Safari] : khd -p "alt - down"
shift + lctrl - u [Safari] : khd -p "shift + alt - up"
shift + lctrl - d [Safari] : khd -p "shift + alt - down"
# remap left-control x -> forward delete
lctrl - x [Safari] : khd -p "- delete"
# remap left-control g -> escape
lctrl - g [Safari] : khd -p "0x35"
# modifier only mappings
khd mod_trigger_timeout 0.2
lctrl : khd -p "0x35"
lshift : khd -p "shift - 9"
rshift : khd -p "shift - 0"
# enable kwm compatibility mode
khd kwm on
# set border color for different modes
# khd mode default color 0xddd5c4a1
khd mode default color 0x00000000
khd mode switcher color 0xddbdd322
khd mode scratchpad color 0xddd75f5f
khd mode swap color 0xdd458588
khd mode tree color 0xddfabd2f
khd mode space color 0xddb16286
khd mode info color 0xddcd950c
# toggle between modes
alt - f : khd -e "mode activate switcher"
switcher + alt - f : khd -e "mode activate default"
swap + alt - f : khd -e "mode activate switcher"
space + alt - f : khd -e "mode activate switcher"
tree + alt - f : khd -e "mode activate switcher"
info + alt - f : khd -e "mode activate switcher"
scratchpad + alt - f : khd -e "mode activate switcher"
switcher + alt - g : khd -e "mode activate default"
swap + alt - g : khd -e "mode activate default"
space + alt - g : khd -e "mode activate default"
tree + alt - g : khd -e "mode activate default"
info + alt - g : khd -e "mode activate default"
scratchpad + alt - g : khd -e "mode activate default"
switcher + ctrl - g : khd -e "mode activate default"
swap + ctrl - g : khd -e "mode activate default"
space + ctrl - g : khd -e "mode activate default"
tree + ctrl - g : khd -e "mode activate default"
info + ctrl - g : khd -e "mode activate default"
scratchpad + ctrl - g : khd -e "mode activate default"
switcher - 0x35 : khd -e "mode activate default"
swap - 0x35 : khd -e "mode activate default"
space - 0x35 : khd -e "mode activate default"
tree - 0x35 : khd -e "mode activate default"
info - 0x35 : khd -e "mode activate default"
scratchpad - 0x35 : khd -e "mode activate default"
switcher - w : khd -e "mode activate scratchpad"
switcher - a : khd -e "mode activate swap"
switcher - s : khd -e "mode activate space"
switcher - d : khd -e "mode activate tree"
switcher - q : khd -e "mode activate info"
# switcher mode
switcher - r : khd -e "reload" # reload config
switcher + shift - r : khd -e "mode activate default";\
: killall kwm # restart kwm
switcher - return : open -na /Applications/Utilities/Terminal.app;\
khd -e "mode activate default"
switcher - h : kwmc window -f west
switcher - l : kwmc window -f east
switcher - j : kwmc window -f south
switcher - k : kwmc window -f north
switcher - n : kwmc window -fm prev
switcher - m : kwmc window -fm next
switcher - 1 : kwmc space -fExperimental 1
switcher - 2 : kwmc space -fExperimental 2
switcher - 3 : kwmc space -fExperimental 3
switcher - 4 : kwmc space -fExperimental 4
switcher - 5 : kwmc space -fExperimental 5
switcher - 6 : kwmc space -fExperimental 6
switcher - z : kwmc space -fExperimental left
switcher - c : kwmc space -fExperimental right
switcher - f : kwmc space -fExperimental previous
switcher + shift - z : kwmc window -m space left;\
kwmc space -fExperimental left
switcher + shift - c : kwmc window -m space right;\
kwmc space -fExperimental right
switcher + shift - 1 : kwmc display -f 0
switcher + shift - 2 : kwmc display -f 1
switcher + shift - 3 : kwmc display -f 2
scratchpad - a : kwmc scratchpad add
scratchpad - s : kwmc scratchpad toggle 0
scratchpad - d : kwmc scratchpad remove
scratchpad - 1 : kwmc scratchpad toggle 1
scratchpad - 2 : kwmc scratchpad toggle 2
scratchpad - 3 : kwmc scratchpad toggle 3
scratchpad - 4 : kwmc scratchpad toggle 4
scratchpad - 5 : kwmc scratchpad toggle 5
scratchpad - 6 : kwmc scratchpad toggle 6
# swap mode
swap - h : kwmc window -s west
swap - j : kwmc window -s south
swap - k : kwmc window -s north
swap - l : kwmc window -s east
swap - m : kwmc window -s mark
swap + shift - k : kwmc window -m north
swap + shift - l : kwmc window -m east
swap + shift - j : kwmc window -m south
swap + shift - h : kwmc window -m west
swap + shift - m : kwmc window -m mark
swap - 1 : kwmc window -m space 1
swap - 2 : kwmc window -m space 2
swap - 3 : kwmc window -m space 3
swap - 4 : kwmc window -m space 4
swap - 5 : kwmc window -m space 5
swap - z : kwmc window -m space left
swap - c : kwmc window -m space right
swap + shift - 1 : kwmc window -m display 0
swap + shift - 2 : kwmc window -m display 1
swap + shift - 3 : kwmc window -m display 2
# space mode
space - a : kwmc space -t bsp
space - s : kwmc space -t monocle
space - d : kwmc space -t float
space - x : kwmc space -g increase horizontal
space - y : kwmc space -g increase vertical
space + shift - x : kwmc space -g decrease horizontal
space + shift - y : kwmc space -g decrease vertical
space - left : kwmc space -p increase left
space - right : kwmc space -p increase right
space - up : kwmc space -p increase top
space - down : kwmc space -p increase bottom
space - p : kwmc space -p increase all
space + shift - left : kwmc space -p decrease left
space + shift - right : kwmc space -p decrease right
space + shift - up : kwmc space -p decrease top
space + shift - down : kwmc space -p decrease bottom
space + shift - p : kwmc space -p decrease all
# tree mode
tree - a : kwmc window -c type bsp
tree - s : kwmc window -c type monocle
tree - f : kwmc window -z fullscreen
tree - d : kwmc window -z parent
tree - w : kwmc window -t focused
tree - r : kwmc tree rotate 90
tree - q : kwmc window -c split - mode toggle;\
khd -e "mode activate default"
tree - c : kwmc window -c type toggle;\
khd -e "mode activate default"
tree - h : kwmc window -c expand 0.05 west
tree - j : kwmc window -c expand 0.05 south
tree - k : kwmc window -c expand 0.05 north
tree - l : kwmc window -c expand 0.05 east
tree + shift - h : kwmc window -c reduce 0.05 west
tree + shift - j : kwmc window -c reduce 0.05 south
tree + shift - k : kwmc window -c reduce 0.05 north
tree + shift - l : kwmc window -c reduce 0.05 east
tree - p : kwmc tree -pseudo create
tree + shift - p : kwmc tree -pseudo destroy
tree - o : kwmc window -s prev
tree + shift - o : kwmc window -s next
'';
environment.etc."per-user/lnl/kwm/kwmrc".text = ''
kwmc config tiling bsp
kwmc config split-ratio 0.5
kwmc config spawn left
kwmc config padding 28 2 2 2
kwmc config gap 2 2
kwmc config display 1 padding 40 20 20 20
kwmc config display 1 gap 10 10
kwmc config display 2 padding 40 20 20 20
kwmc config display 2 gap 10 10
kwmc config space 0 1 name main
kwmc config space 0 2 name rnd
kwmc config space 0 3 mode monocle
kwmc config space 0 3 name web
kwmc config space 1 1 name rnd
kwmc config space 1 1 mode monocle
kwmc config space 2 1 name web
kwmc config focus-follows-mouse on
kwmc config mouse-follows-focus on
kwmc config standby-on-float on
kwmc config center-on-float on
kwmc config float-non-resizable on
kwmc config lock-to-container on
kwmc config cycle-focus on
kwmc config optimal-ratio 1.605
kwmc config border focused on
kwmc config border focused size 2
kwmc config border focused color 0x00000000
kwmc config border focused radius 6
kwmc config border marked on
kwmc config border marked size 2
kwmc config border marked color 0xDD7f7f7f
kwmc config border marked radius 6
kwmc rule owner="Airmail" properties={float="true"}
kwmc rule owner="Apple Store" properties={float="true"}
kwmc rule owner="System Preferences" properties={float="true"}
kwmc rule owner="iTerm2" properties={role="AXDialog"}
kwmc rule owner="iTunes" properties={float="true"}
'';
system.stateVersion = 6;
}
+8 -8
View File
@@ -1,16 +1,16 @@
{ config, lib, pkgs, ... }:
{
{ config, pkgs, ... }:
{
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[ pkgs.nix-repl
[ pkgs.vim
];
# Create /etc/bashrc that loads the nix-darwin environment.
programs.bash.enable = true;
# Recreate /run/current-system symlink after boot.
services.activate-system.enable = true;
# Enable alternative shell support in nix-darwin.
# programs.fish.enable = true;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 6;
}
+67
View File
@@ -0,0 +1,67 @@
{ config, lib, pkgs, ... }:
let
cfg = config.fonts;
in
{
imports = [
(lib.mkRemovedOptionModule [ "fonts" "enableFontDir" ] "No nix-darwin equivalent to this NixOS option. This is not required to install fonts.")
(lib.mkRemovedOptionModule [ "fonts" "fontDir" "enable" ] "No nix-darwin equivalent to this NixOS option. This is not required to install fonts.")
(lib.mkRemovedOptionModule [ "fonts" "fonts" ] ''
This option has been renamed to `fonts.packages' for consistency with NixOS.
Note that the implementation now keeps fonts in `/Library/Fonts/Nix Fonts' to allow them to coexist with fonts not managed by nix-darwin; existing fonts will be left directly in `/Library/Fonts' without getting updates and should be manually removed.'')
];
options = {
fonts.packages = lib.mkOption {
type = lib.types.listOf lib.types.path;
default = [ ];
example = lib.literalExpression "[ pkgs.dejavu_fonts ]";
description = ''
List of fonts to install into {file}`/Library/Fonts/Nix Fonts`.
'';
};
};
config = {
system.build.fonts = pkgs.runCommand "fonts"
{ preferLocalBuild = true; }
''
mkdir -p $out/Library/Fonts
store_dir=${lib.escapeShellArg builtins.storeDir}
while IFS= read -rd "" f; do
dest="$out/Library/Fonts/Nix Fonts/''${f#"$store_dir/"}"
mkdir -p "''${dest%/*}"
ln -sf "$f" "$dest"
done < <(
find -L ${lib.escapeShellArgs cfg.packages} \
-type f \
-regex '.*\.\(ttf\|ttc\|otf\|dfont\)' \
-print0
)
'';
system.activationScripts.fonts.text = ''
printf >&2 'setting up /Library/Fonts/Nix Fonts...\n'
# rsync uses the mtime + size of files to determine whether they
# need to be copied by default. This is inadequate for Nix store
# paths, but we don't want to use `--checksum` as it makes
# activation consistently slow when you have large fonts
# installed. Instead, we ensure that fonts are linked according to
# their full store paths in `system.build.fonts`, so that any
# given font path should only ever have one possible content.
${pkgs.rsync}/bin/rsync \
--archive \
--copy-links \
--delete-during \
--delete-missing-args \
"$systemConfig/Library/Fonts/Nix Fonts" \
'/Library/Fonts/'
'';
};
}
+1042
View File
File diff suppressed because it is too large Load Diff
+43 -13
View File
@@ -1,17 +1,15 @@
{ config, lib, pkgs, ... }:
with import ./lib.nix { inherit lib; };
with lib;
let
inherit (pkgs) stdenv;
cfg = config.launchd;
toEnvironmentText = name: value: {
name = "${value.serviceConfig.Label}.plist";
value.text = toPLIST value.serviceConfig;
value.text = generators.toPlist { escape = true; } value.serviceConfig;
};
launchdConfig = import ./launchd.nix;
@@ -22,7 +20,6 @@ let
{ config, name, ... }:
let
cmd = config.command;
env = config.environment // optionalAttrs (config.path != "") { PATH = config.path; };
in
@@ -37,11 +34,11 @@ let
};
path = mkOption {
type = types.loeOf (types.either types.path types.str);
type = types.listOf (types.either types.path types.str);
default = [];
description = ''
Packages added to the service's <envar>PATH</envar>
environment variable. Only the <filename>bin</filename>
Packages added to the service's {env}`PATH`
environment variable. Only the {file}`bin`
and subdirectories of each package is added.
'';
apply = ps: if isList ps then (makeDrvBinPath ps) else ps;
@@ -76,8 +73,8 @@ let
};
default = {};
description = ''
Each attribute in this set specifies an option for a <key> in the plist.
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html
Each attribute in this set specifies an option for a key in the plist.
<https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html>
'';
};
};
@@ -89,16 +86,28 @@ let
${config.script}
'');
serviceConfig.Label = mkDefault "org.nixos.${name}";
serviceConfig.ProgramArguments = mkIf (cmd != "") [ "/bin/sh" "-c" "exec ${cmd}" ];
serviceConfig.Label = mkDefault "${cfg.labelPrefix}.${name}";
serviceConfig.ProgramArguments = mkIf (config.command != "") [
"/bin/sh"
"-c"
"/bin/wait4path /nix/store && exec ${config.command}"
];
serviceConfig.EnvironmentVariables = mkIf (env != {}) env;
};
};
in
{
options = {
launchd.labelPrefix = mkOption {
type = types.str;
default = "org.nixos";
description = ''
The default prefix of the service label. Individual services can
override this by setting the Label attribute.
'';
};
launchd.envVariables = mkOption {
type = types.attrsOf (types.either types.str (types.listOf types.str));
default = {};
@@ -161,7 +170,16 @@ in
launchd.user.agents = mkOption {
default = {};
type = types.attrsOf (types.submodule serviceOptions);
type = types.attrsOf (types.submodule [
serviceOptions
({ name, ... }: {
options.managedBy = lib.mkOption {
type = lib.types.str;
internal = true;
default = lib.showOption [ "launchd" "user" "agents" name ];
};
})
]);
description = ''
Definition of per-user launchd agents.
@@ -178,6 +196,18 @@ in
config = {
system.requiresPrimaryUser =
lib.map (
name:
lib.showOption [
"launchd"
"user"
"envVariables"
name
]
) (attrNames cfg.user.envVariables)
++ lib.map ({ managedBy, ... }: managedBy) (attrValues cfg.user.agents);
environment.launchAgents = mapAttrs' toEnvironmentText cfg.agents;
environment.launchDaemons = mapAttrs' toEnvironmentText cfg.daemons;
+186 -139
View File
@@ -2,32 +2,35 @@
with lib;
let
launchdTypes = import ./types.nix { inherit config lib; };
in
{
options = {
Label = mkOption {
type = types.str;
description = ''
This required key uniquely identifies the job to launchd.
'';
description = "This required key uniquely identifies the job to launchd.";
};
Disabled = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key is used as a hint to launchctl(1) that it should not submit this job to launchd when
loading a job or jobs. The value of this key does NOT reflect the current state of the job on the run-ning running
ning system. If you wish to know whether a job is loaded in launchd, reading this key from a configura-tion configuration
tion file yourself is not a sufficient test. You should query launchd for the presence of the job using
the launchctl(1) list subcommand or use the ServiceManagement framework's SMJobCopyDictionary() method.
This optional key is used as a hint to `launchctl(1)` that it should not submit this job to launchd when
loading a job or jobs. The value of this key does NOT reflect the current state of the job on the running
system. If you wish to know whether a job is loaded in launchd, reading this key from a configuration
file yourself is not a sufficient test. You should query launchd for the presence of the job using
the `launchctl(1)` list subcommand or use the ServiceManagement framework's
`SMJobCopyDictionary()` method.
Note that as of Mac OS X v10.6, this key's value in a configuration file conveys a default value, which
is changed with the [-w] option of the launchctl(1) load and unload subcommands. These subcommands no
longer modify the configuration file, so the value displayed in the configuration file is not necessar-ily necessarily
ily the value that launchctl(1) will apply. See launchctl(1) for more information.
is changed with the [-w] option of the `launchctl(1)` load and unload subcommands. These subcommands no
longer modify the configuration file, so the value displayed in the configuration file is not necessarily
the value that `launchctl(1)` will apply. See `launchctl(1)` for more information.
Please also be mindful that you should only use this key if the provided on-demand and KeepAlive crite-ria criteria
ria are insufficient to describe the conditions under which your job needs to run. The cost to have a
Please also be mindful that you should only use this key if the provided on-demand and KeepAlive criteria
are insufficient to describe the conditions under which your job needs to run. The cost to have a
job loaded in launchd is negligible, so there is no harm in loading a job which only runs once or very
rarely.
'';
@@ -61,11 +64,11 @@ with lib;
type = types.nullOr (types.submodule {
options = {
Wait = mkOption {
type = types.nullOr types.str;
type = types.nullOr (types.either types.bool types.str);
default = null;
description = ''
This flag corresponds to the "wait" or "nowait" option of inetd. If true, then the listening
socket is passed via the standard in/out/error file descriptors. If false, then accept(2) is
socket is passed via the standard in/out/error file descriptors. If false, then `accept(2)` is
called on behalf of the job, and the result is passed via the standard in/out/error descriptors.
'';
};
@@ -77,8 +80,8 @@ with lib;
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
This configuration file only applies to the hosts listed with this key. Note: One should set kern.host-name kern.hostname
name in sysctl.conf(5) for this feature to work reliably.
This configuration file only applies to the hosts listed with this key. Note: One should set kern.hostname
in `sysctl.conf(5)` for this feature to work reliably.
'';
};
@@ -86,17 +89,17 @@ with lib;
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
This configuration file only applies to hosts NOT listed with this key. Note: One should set kern.host-name kern.hostname
name in sysctl.conf(5) for this feature to work reliably.
This configuration file only applies to hosts NOT listed with this key. Note: One should set kern.hostname
in `sysctl.conf(5)` for this feature to work reliably.
'';
};
LimitLoadToSessionType = mkOption {
type = types.nullOr types.str;
type = types.nullOr (types.oneOf [types.str (types.listOf types.str)]);
default = null;
description = ''
This configuration file only applies to sessions of the type specified. This key is used in concert
with the -S flag to launchctl.
with the -S flag to {command}`launchctl`.
'';
};
@@ -104,7 +107,7 @@ with lib;
type = types.nullOr types.path;
default = null;
description = ''
This key maps to the first argument of execvp(3). If this key is missing, then the first element of
This key maps to the first argument of `execvp(3)`. If this key is missing, then the first element of
the array of strings provided to the ProgramArguments will be used instead. This key is required in
the absence of the ProgramArguments key.
'';
@@ -114,17 +117,28 @@ with lib;
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
This key maps to the second argument of execvp(3). This key is required in the absence of the Program
key. Please note: many people are confused by this key. Please read execvp(3) very carefully!
This key maps to the second argument of `execvp(3)`. This key is required in the absence of the Program
key. Please note: many people are confused by this key. Please read `execvp(3)` very carefully!
'';
# TODO: Remove this some time after 25.11.
apply =
val:
if (builtins.isNull val) then
val
else
(map (
item:
lib.warnIf (lib.hasInfix "&amp;" item)
"A value for `ProgramArguments` contains the literal string `&amp;`. This is no longer necessary and will lead to double-escaping, as nix-darwin now automatically escapes special characters."
item
) val);
};
EnableGlobbing = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This flag causes launchd to use the glob(3) mechanism to update the program arguments before invoca-tion. invocation.
tion.
This flag causes launchd to use the `glob(3)` mechanism to update the program arguments before invocation.
'';
};
@@ -132,8 +146,8 @@ with lib;
type = types.nullOr types.bool;
default = null;
description = ''
This flag instructs launchd that the job promises to use vproc_transaction_begin(3) and
vproc_transaction_end(3) to track outstanding transactions that need to be reconciled before the
This flag instructs launchd that the job promises to use `vproc_transaction_begin(3)` and
`vproc_transaction_end(3)` to track outstanding transactions that need to be reconciled before the
process can safely terminate. If no outstanding transactions are in progress, then launchd is free to
send the SIGKILL signal.
'';
@@ -195,14 +209,29 @@ with lib;
'';
};
Crashed = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
If true, the the job will be restarted as long as it exited due to a signal which is typically
associated with a crash (SIGILL, SIGSEGV, etc.). If false, the job will be restarted in the
inverse condition.
'';
};
AfterInitialDemand = mkOption {
type = types.nullOr types.bool;
default = null;
};
};
}));
default = null;
description = ''
This optional key is used to control whether your job is to be kept continuously running or to let
demand and conditions control the invocation. The default is false and therefore only demand will start
the job. The value may be set to true to unconditionally keep the job alive. Alternatively, a dictio-nary dictionary
nary of conditions may be specified to selectively control whether launchd keeps a job alive or not. If
the job. The value may be set to true to unconditionally keep the job alive. Alternatively, a dictionary
of conditions may be specified to selectively control whether launchd keeps a job alive or not. If
multiple keys are provided, launchd ORs them, thus providing maximum flexibility to the job to refine
the logic and stall if necessary. If launchd finds no reason to restart the job, it falls back on
demand based invocation. Jobs that exit quickly and frequently when configured to be kept alive will
@@ -223,7 +252,7 @@ with lib;
type = types.nullOr types.str;
default = null;
description = ''
This optional key is used to specify a directory to chroot(2) to before running the job.
This optional key is used to specify a directory to `chroot(2)` to before running the job.
'';
};
@@ -231,7 +260,7 @@ with lib;
type = types.nullOr types.str;
default = null;
description = ''
This optional key is used to specify a directory to chdir(2) to before running the job.
This optional key is used to specify a directory to `chdir(2)` to before running the job.
'';
};
@@ -239,7 +268,7 @@ with lib;
type = types.nullOr (types.attrsOf types.str);
default = null;
description = ''
This optional key is used to specify additional environmental variables to be set before running the
This optional key is used to specify additional environment variables to be set before running the
job.
'';
};
@@ -248,7 +277,7 @@ with lib;
type = types.nullOr types.int;
default = null;
description = ''
This optional key specifies what value should be passed to umask(2) before running the job. Known bug:
This optional key specifies what value should be passed to `umask(2)` before running the job. Known bug:
Property lists don't support octal, so please convert the value to decimal.
'';
};
@@ -287,7 +316,7 @@ with lib;
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies whether initgroups(3) should be called before running the job. The default
This optional key specifies whether `initgroups(3)` should be called before running the job. The default
is true in 10.5 and false in 10.4. This key will be ignored if the UserName key is not set.
'';
};
@@ -329,57 +358,23 @@ with lib;
StartCalendarInterval = mkOption {
default = null;
example = { Hour = 2; Minute = 30; };
example = [{ Hour = 2; Minute = 30; }];
description = ''
This optional key causes the job to be started every calendar interval as specified. Missing arguments
are considered to be wildcard. The semantics are much like crontab(5). Unlike cron which skips job
invocations when the computer is asleep, launchd will start the job the next time the computer wakes
This optional key causes the job to be started every calendar interval as specified. The semantics are
much like {manpage}`crontab(5)`: Missing attributes are considered to be wildcard. Unlike cron which skips
job invocations when the computer is asleep, launchd will start the job the next time the computer wakes
up. If multiple intervals transpire before the computer is woken, those events will be coalesced into
one event upon wake from sleep.
one event upon waking from sleep.
::: {.important}
The list must not be empty and must not contain duplicate entries (attrsets which compare equally).
:::
::: {.caution}
Since missing attrs become wildcards, an empty attrset effectively means "every minute".
:::
'';
type = types.nullOr (types.listOf (types.submodule {
options = {
Minute = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The minute on which this job will be run.
'';
};
Hour = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The hour on which this job will be run.
'';
};
Day = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The day on which this job will be run.
'';
};
Weekday = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The weekday on which this job will be run (0 and 7 are Sunday).
'';
};
Month = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The month on which this job will be run.
'';
};
};
}));
type = types.nullOr launchdTypes.StartCalendarInterval;
};
StandardInPath = mkOption {
@@ -387,7 +382,7 @@ with lib;
default = null;
description = ''
This optional key specifies what file should be used for data being supplied to stdin when using
stdio(3).
`stdio(3)`.
'';
};
@@ -395,7 +390,7 @@ with lib;
type = types.nullOr types.path;
default = null;
description = ''
This optional key specifies what file should be used for data being sent to stdout when using stdio(3).
This optional key specifies what file should be used for data being sent to stdout when using `stdio(3)`.
'';
};
@@ -403,7 +398,7 @@ with lib;
type = types.nullOr types.path;
default = null;
description = ''
This optional key specifies what file should be used for data being sent to stderr when using stdio(3).
This optional key specifies what file should be used for data being sent to stderr when using `stdio(3)`.
'';
};
@@ -428,7 +423,7 @@ with lib;
SoftResourceLimits = mkOption {
default = null;
description = ''
Resource limits to be imposed on the job. These adjust variables set with setrlimit(2). The following
Resource limits to be imposed on the job. These adjust variables set with `setrlimit(2)`. The following
keys apply:
'';
type = types.nullOr (types.submodule {
@@ -454,7 +449,7 @@ with lib;
default = null;
description = ''
The maximum size (in bytes) of the data segment for a process; this defines how far a program may
extend its break with the sbrk(2) system call.
extend its break with the `sbrk(2)` system call.
'';
};
@@ -479,8 +474,8 @@ with lib;
default = null;
description = ''
The maximum number of open files for this process. Setting this value in a system wide daemon
will set the sysctl(3) kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResource-Limits) (HardResourceLimits)
Limits) value in addition to the setrlimit(2) values.
will set the `sysctl(3)` kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResourceLimits)
value in addition to the `setrlimit(2)` values.
'';
};
@@ -489,8 +484,8 @@ with lib;
default = null;
description = ''
The maximum number of simultaneous processes for this user id. Setting this value in a system
wide daemon will set the sysctl(3) kern.maxproc (SoftResourceLimits) or kern.maxprocperuid
(HardResourceLimits) value in addition to the setrlimit(2) values.
wide daemon will set the `sysctl(3)` kern.maxproc (SoftResourceLimits) or kern.maxprocperuid
(HardResourceLimits) value in addition to the `setrlimit(2)` values.
'';
};
@@ -520,7 +515,7 @@ with lib;
default = null;
example = { NumberOfFiles = 4096; };
description = ''
Resource limits to be imposed on the job. These adjust variables set with setrlimit(2). The following
Resource limits to be imposed on the job. These adjust variables set with `setrlimit(2)`. The following
keys apply:
'';
type = types.nullOr (types.submodule {
@@ -546,7 +541,7 @@ with lib;
default = null;
description = ''
The maximum size (in bytes) of the data segment for a process; this defines how far a program may
extend its break with the sbrk(2) system call.
extend its break with the `sbrk(2)` system call.
'';
};
@@ -562,7 +557,7 @@ with lib;
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) which a process may lock into memory using the mlock(2) function.
The maximum size (in bytes) which a process may lock into memory using the `mlock(2)` function.
'';
};
@@ -571,8 +566,8 @@ with lib;
default = null;
description = ''
The maximum number of open files for this process. Setting this value in a system wide daemon
will set the sysctl(3) kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResource-Limits) (HardResourceLimits)
Limits) value in addition to the setrlimit(2) values.
will set the `sysctl(3)` kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResourceLimits)
value in addition to the `setrlimit(2)` values.
'';
};
@@ -581,8 +576,8 @@ with lib;
default = null;
description = ''
The maximum number of simultaneous processes for this user id. Setting this value in a system
wide daemon will set the sysctl(3) kern.maxproc (SoftResourceLimits) or kern.maxprocperuid
(HardResourceLimits) value in addition to the setrlimit(2) values.
wide daemon will set the `sysctl(3)` kern.maxproc (SoftResourceLimits) or kern.maxprocperuid
(HardResourceLimits) value in addition to the `setrlimit(2)` values.
'';
};
@@ -625,22 +620,22 @@ with lib;
resource limits based on what kind of job it is. If left unspecified, the system will apply light
resource limits to the job, throttling its CPU usage and I/O bandwidth. The following are valid values:
Background
Background jobs are generally processes that do work that was not directly requested by the user.
The resource limits applied to Background jobs are intended to prevent them from disrupting the
user experience.
Background
: Background jobs are generally processes that do work that was not directly requested by the user.
The resource limits applied to Background jobs are intended to prevent them from disrupting the
user experience.
Standard
Standard jobs are equivalent to no ProcessType being set.
Standard
: Standard jobs are equivalent to no ProcessType being set.
Adaptive
Adaptive jobs move between the Background and Interactive classifications based on activity over
XPC connections. See xpc_transaction_begin(3) for details.
Adaptive
: Adaptive jobs move between the Background and Interactive classifications based on activity over
XPC connections. See `xpc_transaction_begin(3)` for details.
Interactive
Interactive jobs run with the same resource limitations as apps, that is to say, none. Interac-tive Interactive
tive jobs are critical to maintaining a responsive user experience, and this key should only be
used if an app's ability to be responsive depends on it, and cannot be made Adaptive.
Interactive
: Interactive jobs run with the same resource limitations as apps, that is to say, none. Interactive
jobs are critical to maintaining a responsive user experience, and this key should only be
used if an app's ability to be responsive depends on it, and cannot be made Adaptive.
'';
};
@@ -648,8 +643,8 @@ with lib;
type = types.nullOr types.bool;
default = null;
description = ''
When a job dies, launchd kills any remaining processes with the same process group ID as the job. Set-ting Setting
ting this key to true disables that behavior.
When a job dies, launchd kills any remaining processes with the same process group ID as the job. Setting
this key to true disables that behavior.
'';
};
@@ -662,6 +657,15 @@ with lib;
'';
};
LowPriorityBackgroundIO = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies whether the kernel should consider this daemon to be low priority when
doing file system I/O when the process is throttled with the Darwin-background classification.
'';
};
LaunchOnlyOnce = mkOption {
type = types.nullOr types.bool;
default = null;
@@ -673,7 +677,7 @@ with lib;
MachServices = mkOption {
default = null;
example = { ResetAtClose = true; };
example = { "org.nixos.service" = { ResetAtClose = true; }; };
description = ''
This optional key is used to specify Mach services to be registered with the Mach bootstrap sub-system.
Each key in this dictionary should be the name of service to be advertised. The value of the key must
@@ -682,7 +686,7 @@ with lib;
Finally, for the job itself, the values will be replaced with Mach ports at the time of check-in with
launchd.
'';
type = types.nullOr (types.submodule {
type = types.nullOr (types.attrsOf (types.either types.bool (types.submodule {
options = {
ResetAtClose = mkOption {
type = types.nullOr types.bool;
@@ -690,8 +694,8 @@ with lib;
description = ''
If this boolean is false, the port is recycled, thus leaving clients to remain oblivious to the
demand nature of job. If the value is set to true, clients receive port death notifications when
the job lets go of the receive right. The port will be recreated atomically with respect to boot-strap_look_up() bootstrap_look_up()
strap_look_up() calls, so that clients can trust that after receiving a port death notification,
the job lets go of the receive right. The port will be recreated atomically with respect to bootstrap_look_up()
calls, so that clients can trust that after receiving a port death notification,
the new port will have already been recreated. Setting the value to true should be done with
care. Not all clients may be able to handle this behavior. The default value is false.
'';
@@ -706,7 +710,52 @@ with lib;
'';
};
};
});
})));
};
LaunchEvents = mkOption {
type = types.nullOr (types.attrs);
default = null;
description = ''
Specifies higher-level event types to be used as launch-on-demand event
sources. Each sub-dictionary defines events for a particular event
subsystem, such as "com.apple.iokit.matching", which can be used to
launch jobs based on the appearance of nodes in the IORegistry. Each
dictionary within the sub-dictionary specifies an event descriptor that
is specified to each event subsystem. With this key, the job promises to
use the xpc_set_event_stream_handler(3) API to consume events. See
xpc_events(3) for more details on event sources.
'';
example = {
"com.apple.iokit.matching" = {
"com.apple.usb.device" = {
IOMatchLaunchStream = true;
IOProviderClass = "IOUSBDevice";
idProduct = "*";
idVendor = "*";
};
};
};
};
ServiceIPC = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies whether the job participates in advanced
communication with launchd. The default is false. This flag is
incompatible with the inetdCompatibility key.
'';
};
SessionCreate = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This key specifies that the job should be spawned into a new security
audit session rather than the default session for the context is belongs
to. See auditon(2) for details.
'';
};
Sockets = mkOption {
@@ -714,16 +763,16 @@ with lib;
description = ''
This optional key is used to specify launch on demand sockets that can be used to let launchd know when
to run the job. The job must check-in to get a copy of the file descriptors using APIs outlined in
launch(3). The keys of the top level Sockets dictionary can be anything. They are meant for the appli-cation application
cation developer to use to differentiate which descriptors correspond to which application level proto-cols protocols
cols (e.g. http vs. ftp vs. DNS...). At check-in time, the value of each Sockets dictionary key will
launch(3). The keys of the top level Sockets dictionary can be anything. They are meant for the application
developer to use to differentiate which descriptors correspond to which application level protocols
(e.g. http vs. ftp vs. DNS...). At check-in time, the value of each Sockets dictionary key will
be an array of descriptors. Daemon/Agent writers should consider all descriptors of a given key to be
to be effectively equivalent, even though each file descriptor likely represents a different networking
protocol which conforms to the criteria specified in the job configuration file.
The parameters below are used as inputs to call getaddrinfo(3).
The parameters below are used as inputs to call `getaddrinfo(3)`.
'';
type = types.nullOr (types.loaOf (types.submodule {
type = types.nullOr (types.attrsOf (types.submodule {
options = {
SockType = mkOption {
type = types.nullOr (types.enum [ "stream" "dgram" "seqpacket" ]);
@@ -738,7 +787,7 @@ with lib;
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies whether listen(2) or connect(2) should be called on the created file
This optional key specifies whether `listen(2)` or `connect(2)` should be called on the created file
descriptor. The default is true ("to listen").
'';
};
@@ -747,7 +796,7 @@ with lib;
type = types.nullOr types.str;
default = null;
description = ''
This optional key specifies the node to connect(2) or bind(2) to.
This optional key specifies the node to `connect(2)` or `bind(2)` to.
'';
};
@@ -755,7 +804,7 @@ with lib;
type = types.nullOr types.str;
default = null;
description = ''
This optional key specifies the service on the node to connect(2) or bind(2) to.
This optional key specifies the service on the node to `connect(2)` or `bind(2)` to.
'';
};
@@ -771,7 +820,7 @@ with lib;
type = types.nullOr (types.enum [ "TCP" ]);
default = null;
description = ''
This optional key specifies the protocol to be passed to socket(2). The only value understood by
This optional key specifies the protocol to be passed to `socket(2)`. The only value understood by
this key at the moment is "TCP".
'';
};
@@ -780,8 +829,8 @@ with lib;
type = types.nullOr types.path;
default = null;
description = ''
This optional key implies SockFamily is set to "Unix". It specifies the path to connect(2) or
bind(2) to.
This optional key implies SockFamily is set to "Unix". It specifies the path to `connect(2)` or
`bind(2)` to.
'';
};
@@ -790,8 +839,8 @@ with lib;
default = null;
description = ''
This optional key is a variant of SockPathName. Instead of binding to a known path, a securely
generated socket is created and the path is assigned to the environment variable that is inher-ited inherited
ited by all jobs spawned by launchd.
generated socket is created and the path is assigned to the environment variable that is inherited
by all jobs spawned by launchd.
'';
};
@@ -809,8 +858,7 @@ with lib;
default = null;
description = ''
This optional key can be used to request that the service be registered with the
mDNSResponder(8). If the value is boolean, the service name is inferred from the SockService-Name. SockServiceName.
Name.
`mDNSResponder(8)`. If the value is boolean, the service name is inferred from the SockServiceName.
'';
};
@@ -819,9 +867,9 @@ with lib;
default = null;
description = ''
This optional key can be used to request that the datagram socket join a multicast group. If the
value is a hostname, then getaddrinfo(3) will be used to join the correct multicast address for a
given socket family. If an explicit IPv4 or IPv6 address is given, it is required that the Sock-Family SockFamily
Family family also be set, otherwise the results are undefined.
value is a hostname, then `getaddrinfo(3)` will be used to join the correct multicast address for a
given socket family. If an explicit IPv4 or IPv6 address is given, it is required that the SockFamily
family also be set, otherwise the results are undefined.
'';
};
};
@@ -829,6 +877,5 @@ with lib;
};
};
config = {
};
config = {};
}
-57
View File
@@ -1,57 +0,0 @@
{ lib }:
with lib;
let
attrFilter = name: value: name != "_module" && value != null;
in
rec {
toPLIST = x: ''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
'' + pprExpr "" x
+ "\n</plist>";
pprExpr = ind: x:
if isNull x then "" else
if isBool x then pprBool ind x else
if isInt x then pprInt ind x else
if isString x then pprStr ind x else
if isList x then pprList ind x else
if isAttrs x then pprAttrs ind x else
throw "invalid plist type";
pprLiteral = ind: x: ind + x;
pprBool = ind: x: pprLiteral ind (if x then "<true/>" else "<false/>");
pprInt = ind: x: pprLiteral ind "<integer>${toString x}</integer>";
pprStr = ind: x: pprLiteral ind "<string>${x}</string>";
pprKey = ind: x: pprLiteral ind "<key>${x}</key>";
pprIndent = ind: (pprExpr "\t${ind}");
pprItem = ind: concatMapStringsSep "\n" (pprIndent ind);
pprList = ind: x: concatStringsSep "\n" [
(pprLiteral ind "<array>")
(pprItem ind x)
(pprLiteral ind "</array>")
];
pprAttrs = ind: x: concatStringsSep "\n" [
(pprLiteral ind "<dict>")
(pprAttr ind x)
(pprLiteral ind "</dict>")
];
pprAttr = ind: x: concatStringsSep "\n" (flatten (mapAttrsToList (name: value: optional (attrFilter name value) [
(pprKey "\t${ind}" name)
(pprExpr "\t${ind}" value)
]) x));
}
+110
View File
@@ -0,0 +1,110 @@
{ lib, ... }:
let
inherit (lib) imap1 types mkOption showOption optionDescriptionPhrase mergeDefinitions;
inherit (builtins) map filter length deepSeq throw toString concatLists;
inherit (lib.options) showDefs;
wildcardText = lib.literalMD "`*`";
/**
A type of list which does not allow duplicate elements. The base/inner
list type to use (e.g. `types.listOf` or `types.nonEmptyListOf`) is passed
via argument `listType`, which must be the final type and not a function.
NOTE: The extra check for duplicates is quadratic and strict, so use this
type sparingly and only:
* when needed, and
* when the list is expected to be recursively short (e.g. < 10 elements)
and shallow (i.e. strict evaluation of the list won't take too long)
The implementation of this function is similar to that of
`types.nonEmptyListOf`.
*/
types'.uniqueList = listType: listType // {
description = "unique ${types.optionDescriptionPhrase (class: class == "noun") listType}";
substSubModules = m: types'.uniqueList (listType.substSubModules m);
# This has been taken from the implementation of `types.listOf`, but has
# been modified to throw on duplicates. This check cannot be done in the
# `check` fn as this check is deep/strict, and because `check` runs
# prior to merging.
merge = loc: defs:
let
# Each element of `dupes` is a list. When there are duplicates,
# later lists will be duplicates of earlier lists, so just throw on
# the first set of duplicates found so that we don't have duplicate
# error msgs.
checked = filter (li:
if length li > 1
then throw "The option `${showOption loc}' contains duplicate entries after merging:\n${showDefs li}"
else false) dupes;
dupes = map (def: filter (def': def'.value == def.value) merged) merged;
merged = filter (x: x ? value) (concatLists (imap1 (n: def:
imap1 (m: el:
let
inherit (def) file;
loc' = loc ++ ["[definition ${toString n}-entry ${toString m}]"];
in
(mergeDefinitions
loc'
listType.nestedTypes.elemType
[{ inherit file; value = el; }]
).optionalValue // {inherit loc' file;}
) def.value
) defs));
in
deepSeq checked (map (x: x.value) merged);
};
in {
StartCalendarInterval = let
CalendarIntervalEntry = types.submodule {
options = {
Minute = mkOption {
type = types.nullOr (types.ints.between 0 59);
default = null;
defaultText = wildcardText;
description = ''
The minute on which this job will be run.
'';
};
Hour = mkOption {
type = types.nullOr (types.ints.between 0 23);
default = null;
defaultText = wildcardText;
description = ''
The hour on which this job will be run.
'';
};
Day = mkOption {
type = types.nullOr (types.ints.between 1 31);
default = null;
defaultText = wildcardText;
description = ''
The day on which this job will be run.
'';
};
Weekday = mkOption {
type = types.nullOr (types.ints.between 0 7);
default = null;
defaultText = wildcardText;
description = ''
The weekday on which this job will be run (0 and 7 are Sunday).
'';
};
Month = mkOption {
type = types.nullOr (types.ints.between 1 12);
default = null;
defaultText = wildcardText;
description = ''
The month on which this job will be run.
'';
};
};
};
in
types.either CalendarIntervalEntry (types'.uniqueList (types.nonEmptyListOf CalendarIntervalEntry));
}
+5 -3
View File
@@ -5,17 +5,14 @@
with lib;
let
fileName = file: last (splitString "/" file);
mkDefaultIf = cond: value: mkIf cond (mkDefault value);
drv = mkTextDerivation (fileName name) config.text;
in
{
options = {
enable = mkOption {
type = types.bool;
default = true;
@@ -48,6 +45,11 @@ in
'';
};
knownSha256Hashes = mkOption {
internal = true;
type = types.listOf types.str;
default = [];
};
};
config = {
+54
View File
@@ -0,0 +1,54 @@
# This module was derived from
# https://github.com/NixOS/nixpkgs/blob/000387627d26f245a6d9a0a7a60b7feddecaeec0/nixos/modules/misc/meta.nix
{ lib, ... }:
with lib;
let
maintainer = mkOptionType {
name = "maintainer";
check = email: elem email (attrValues lib.maintainers);
merge = loc: defs: listToAttrs (singleton (nameValuePair (last defs).file (last defs).value));
};
listOfMaintainers = types.listOf maintainer // {
# Returns list of
# { "module-file" = [
# "maintainer1 <first@nixos.org>"
# "maintainer2 <second@nixos.org>" ];
# }
merge = loc: defs:
zipAttrs
(flatten (imap1 (n: def: imap1 (m: def':
maintainer.merge (loc ++ ["[${toString n}-${toString m}]"])
[{ inherit (def) file; value = def'; }]) def.value) defs));
};
in
{
options = {
meta = {
maintainers = mkOption {
type = listOfMaintainers;
internal = true;
default = [];
example = [ lib.maintainers.lnl7 ];
description = ''
List of maintainers of each module. This option should be defined at
most once per module.
NOTE: `lib` comes from Nixpkgs, which can go out of
sync with nix-darwin. For this reason, use definitions like
`maintainers.alice or "alice"`.
'';
};
};
};
meta.maintainers = [
maintainers.roberth or "roberth"
];
}
+53
View File
@@ -0,0 +1,53 @@
# Based on: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/ids.nix
# This module defines the global list of uids and gids. We keep a
# central list to prevent id collisions.
# IMPORTANT!
# We only add static uids and gids for services where it is not feasible
# to change uids/gids on service start, in example a service with a lot of
# files.
{ lib, config, ... }:
let
inherit (lib) types;
in
{
options = {
ids.uids = lib.mkOption {
internal = true;
description = ''
The user IDs used in NixOS.
'';
type = types.attrsOf types.int;
};
ids.gids = lib.mkOption {
internal = true;
description = ''
The group IDs used in NixOS.
'';
type = types.attrsOf types.int;
};
};
config = {
ids.uids = {
nixbld = lib.mkDefault 350;
_prometheus-node-exporter = 534;
_dnscrypt-proxy = 535;
};
ids.gids = {
nixbld = lib.mkDefault (if config.system.stateVersion < 5 then 30000 else 350);
_prometheus-node-exporter = 534;
_dnscrypt-proxy = 535;
};
};
}
+15
View File
@@ -0,0 +1,15 @@
{ lib, ... }:
{
options = {
lib = lib.mkOption {
default = { };
type = lib.types.attrsOf lib.types.attrs;
description = ''
This option allows modules to define helper functions, constants, etc.
'';
};
};
}
+123
View File
@@ -0,0 +1,123 @@
[
./alias.nix
./config/system-path.nix
./config/terminfo.nix
./documentation
./meta.nix
./misc/ids.nix
./misc/lib.nix
./security/pam.nix
./security/pki
./security/sandbox
./security/sudo.nix
./system
./system/base.nix
./system/primary-user.nix
./system/checks.nix
./system/activation-scripts.nix
./system/applications.nix
./system/defaults-write.nix
./system/defaults/controlcenter.nix
./system/defaults/LaunchServices.nix
./system/defaults/NSGlobalDomain.nix
./system/defaults/GlobalPreferences.nix
./system/defaults/CustomPreferences.nix
./system/defaults/clock.nix
./system/defaults/dock.nix
./system/defaults/finder.nix
./system/defaults/hitoolbox.nix
./system/defaults/iCal.nix
./system/defaults/screencapture.nix
./system/defaults/screensaver.nix
./system/defaults/alf.nix
./system/defaults/loginwindow.nix
./system/defaults/magicmouse.nix
./system/defaults/smb.nix
./system/defaults/SoftwareUpdate.nix
./system/defaults/spaces.nix
./system/defaults/trackpad.nix
./system/defaults/universalaccess.nix
./system/defaults/ActivityMonitor.nix
./system/defaults/WindowManager.nix
./system/etc.nix
./system/keyboard.nix
./system/launchd.nix
./system/nvram.nix
./system/patches.nix
./system/shells.nix
./system/startup.nix
./system/version.nix
./time
./networking
./networking/applicationFirewall.nix
./nix
./nix/linux-builder.nix
./nix/nix-darwin.nix
./nix/nixpkgs.nix
./nix/nixpkgs-flake.nix
./environment
./fonts
./launchd
./power
./power/sleep.nix
./services/activate-system
./services/aerospace
./services/autossh.nix
./services/buildkite-agents.nix
./services/chunkwm.nix
./services/cachix-agent.nix
./services/dnsmasq.nix
./services/dnscrypt-proxy.nix
./services/emacs.nix
./services/eternal-terminal.nix
./services/github-runner
./services/gitlab-runner.nix
./services/hercules-ci-agent
./services/ipfs.nix
./services/karabiner-elements
./services/khd
./services/kwm
./services/lorri.nix
./services/mail/offlineimap.nix
./services/mopidy.nix
./services/monitoring/telegraf.nix
./services/monitoring/netdata.nix
./services/monitoring/prometheus-node-exporter.nix
./services/netbird.nix
./services/nix-daemon.nix
./services/nix-gc
./services/nix-optimise
./services/ofborg
./services/openssh.nix
./services/postgresql
./services/privoxy
./services/redis
./services/sketchybar
./services/skhd
./services/spacebar
./services/spotifyd.nix
./services/synapse-bt.nix
./services/synergy
./services/tailscale.nix
./services/trezord.nix
./services/wg-quick.nix
./services/yabai
./services/nextdns
./services/jankyborders
./programs/_1password.nix
./programs/_1password-gui.nix
./programs/arqbackup.nix
./programs/bash
./programs/direnv.nix
./programs/fish.nix
./programs/gnupg.nix
./programs/man.nix
./programs/info
./programs/nix-index
./programs/ssh.nix
./programs/tmux.nix
./programs/vim.nix
./programs/zsh
./homebrew.nix
./users
]
@@ -0,0 +1,73 @@
{ config, lib, ... }:
let
cfg = config.networking.applicationFirewall;
socketfilterfw =
option: value:
lib.concatStringsSep " " [
"/usr/libexec/ApplicationFirewall/socketfilterfw"
"--${option}"
(if value then "on" else "off")
];
in
{
meta.maintainers = [
(lib.maintainers.prince213 or "prince213")
(lib.maintainers.ryanccn or "ryanccn")
];
options.networking.applicationFirewall = {
enable = lib.mkOption {
type = lib.types.nullOr lib.types.bool;
default = null;
example = true;
description = "Whether to enable application firewall.";
};
blockAllIncoming = lib.mkOption {
type = lib.types.nullOr lib.types.bool;
default = null;
example = true;
description = "Whether to block all incoming connections.";
};
allowSigned = lib.mkOption {
type = lib.types.nullOr lib.types.bool;
default = null;
example = true;
description = "Whether to allow built-in software to receive incoming connections.";
};
allowSignedApp = lib.mkOption {
type = lib.types.nullOr lib.types.bool;
default = null;
example = true;
description = "Whether to allow downloaded signed software to receive incoming connections.";
};
enableStealthMode = lib.mkOption {
type = lib.types.nullOr lib.types.bool;
default = null;
example = true;
description = "Whether to enable stealth mode.";
};
};
config = {
system.activationScripts.networking.text = ''
echo "configuring application firewall..." >&2
${lib.optionalString (cfg.enable != null) (socketfilterfw "setglobalstate" cfg.enable)}
${lib.optionalString (cfg.blockAllIncoming != null) (
socketfilterfw "setblockall" cfg.blockAllIncoming
)}
${lib.optionalString (cfg.allowSigned != null) (socketfilterfw "setallowsigned" cfg.allowSigned)}
${lib.optionalString (cfg.allowSignedApp != null) (
socketfilterfw "setallowsignedapp" cfg.allowSignedApp
)}
${lib.optionalString (cfg.enableStealthMode != null) (
socketfilterfw "setstealthmode" cfg.enableStealthMode
)}
'';
};
}
+212
View File
@@ -0,0 +1,212 @@
{ config, lib, ... }:
with lib;
let
cfg = config.networking;
hostnameRegEx = ''^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$'';
emptyList = lst: if lst != [] then lst else ["empty"];
onOff = cond: if cond then "on" else "off";
setNetworkServices = optionalString (cfg.knownNetworkServices != []) ''
networkservices=$(networksetup -listallnetworkservices)
${concatMapStringsSep "\n" (srv: ''
case "$networkservices" in
*${lib.escapeShellArg srv}*)
networksetup -setdnsservers ${lib.escapeShellArgs ([ srv ] ++ (emptyList cfg.dns))}
networksetup -setsearchdomains ${lib.escapeShellArgs ([ srv ] ++ (emptyList cfg.search))}
${optionalString (cfg.dhcpClientId != null) ''
networksetup -setdhcp ${lib.escapeShellArgs [ srv cfg.dhcpClientId ]}
''}
;;
esac
'') cfg.knownNetworkServices}
'';
in
{
options = {
networking.computerName = mkOption {
type = types.nullOr types.str;
default = null;
example = "Johns MacBook Pro";
description = ''
The user-friendly name for the system, set in System Preferences > Sharing > Computer Name.
Setting this option is equivalent to running `scutil --set ComputerName`.
This name can contain spaces and Unicode characters.
'';
};
networking.hostName = mkOption {
type = types.nullOr (types.strMatching hostnameRegEx);
default = null;
example = "Johns-MacBook-Pro";
description = ''
The hostname of your system, as visible from the command line and used by local and remote
networks when connecting through SSH and Remote Login.
Setting this option is equivalent to running the command `scutil --set HostName`.
(Note that networking.localHostName defaults to the value of this option.)
'';
};
networking.localHostName = mkOption {
type = types.nullOr (types.strMatching hostnameRegEx);
default = cfg.hostName;
example = "Johns-MacBook-Pro";
description = ''
The local hostname, or local network name, is displayed beneath the computer's name at the
top of the Sharing preferences pane. It identifies your Mac to Bonjour-compatible services.
Setting this option is equivalent to running the command `scutil --set LocalHostName`, where
running, e.g., `scutil --set LocalHostName 'Johns-MacBook-Pro'`, would set
the systems local hostname to "Johns-MacBook-Pro.local". The value of this option defaults
to the value of the networking.hostName option.
By default on macOS the local hostname is your computer's name with ".local" appended, with
any spaces replaced with hyphens, and invalid characters omitted.
'';
};
networking.domain = mkOption {
default = null;
example = "home.arpa";
type = types.nullOr types.str;
description = ''
The domain. It can be left empty if it is auto-detected through DHCP.
'';
};
networking.fqdn = mkOption {
type = types.str;
default =
if (cfg.hostName != "" && cfg.domain != null) then
"${cfg.hostName}.${cfg.domain}"
else
throw ''
The FQDN is required but cannot be determined from `networking.hostName`
and `networking.domain`. Please ensure these options are set properly or
set `networking.fqdn` directly.
'';
defaultText = literalExpression ''"''${networking.hostName}.''${networking.domain}"'';
description = ''
The fully qualified domain name (FQDN) of this host. By default, it is
the result of combining `networking.hostName` and `networking.domain.`
Using this option will result in an evaluation error if the hostname is empty or
no domain is specified.
Modules that accept a mere `networking.hostName` but prefer a fully qualified
domain name may use `networking.fqdnOrHostName` instead.
'';
};
networking.fqdnOrHostName = mkOption {
readOnly = true;
type = types.str;
default = if cfg.domain == null then cfg.hostName else cfg.fqdn;
defaultText = literalExpression ''
if cfg.domain == null then cfg.hostName else cfg.fqdn
'';
description = ''
Either the fully qualified domain name (FQDN), or just the host name if
it does not exists.
This is a convenience option for modules to read instead of `fqdn` when
a mere `hostName` is also an acceptable value; this option does not
throw an error when `domain` is unset.
'';
};
networking.knownNetworkServices = mkOption {
type = types.listOf types.str;
default = [];
example = [ "Wi-Fi" "Ethernet Adaptor" "Thunderbolt Ethernet" ];
description = ''
List of networkservices that should be configured.
To display a list of all the network services on the server's
hardware ports, use {command}`networksetup -listallnetworkservices`.
'';
};
networking.dhcpClientId = mkOption {
type = types.nullOr types.str;
default = null;
example = "my-client-id";
description = ''
The DHCP client identifier to use when requesting an IP address from a DHCP server.
If this option is set, it will be used by the system when requesting an IP address.
If not set, no changes will be made.
Set to the string "empty" to clear any previously configured client ID
and restore the system default behavior.
'';
};
networking.dns = mkOption {
type = types.listOf types.str;
default = [];
example = [ "8.8.8.8" "8.8.4.4" "2001:4860:4860::8888" "2001:4860:4860::8844" ];
description = "The list of dns servers used when resolving domain names.";
};
networking.search = mkOption {
type = types.listOf types.str;
default = [];
description = "The list of search paths used when resolving domain names.";
};
networking.wakeOnLan.enable = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Enable Wake-on-LAN for the device.
Battery powered devices may require being connected to power.
'';
};
};
config = {
warnings = [
(mkIf (cfg.knownNetworkServices == [] && cfg.dns != []) "networking.knownNetworkServices is empty, dns servers will not be configured.")
(mkIf (cfg.knownNetworkServices == [] && cfg.search != []) "networking.knownNetworkServices is empty, dns searchdomains will not be configured.")
(mkIf (cfg.knownNetworkServices == [] && cfg.dhcpClientId != null) "networking.knownNetworkServices is empty, dhcp client ID will not be configured.")
];
system.activationScripts.networking.text = ''
echo "configuring networking..." >&2
${optionalString (cfg.computerName != null) ''
scutil --set ComputerName ${escapeShellArg cfg.computerName}
''}
${optionalString (cfg.hostName != null) ''
scutil --set HostName ${escapeShellArg cfg.hostName}
''}
${optionalString (cfg.localHostName != null) ''
scutil --set LocalHostName ${escapeShellArg cfg.localHostName}
''}
${setNetworkServices}
${optionalString (cfg.wakeOnLan.enable != null) ''
systemsetup -setWakeOnNetworkAccess '${onOff cfg.wakeOnLan.enable}' &> /dev/null
''}
if [ -e /etc/hosts.before-nix-darwin ]; then
echo "restoring /etc/hosts..." >&2
sudo mv /etc/hosts{.before-nix-darwin,}
fi
'';
};
}
+878 -274
View File
File diff suppressed because it is too large Load Diff
+234
View File
@@ -0,0 +1,234 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.nix.linux-builder;
in
{
imports = [
(mkRemovedOptionModule [ "nix" "linux-builder" "modules" ] "This option has been replaced with `nix.linux-builder.config` which allows setting options directly like `nix.linux-builder.config.networking.hostName = \"banana\";.")
];
options.nix.linux-builder = {
enable = mkEnableOption "Linux builder";
package = mkOption {
type = types.package;
default = pkgs.darwin.linux-builder;
defaultText = "pkgs.darwin.linux-builder";
apply = pkg: pkg.override (old: {
# the linux-builder package requires `modules` as an argument, so it's
# always non-null.
modules = old.modules ++ [ cfg.config ];
});
description = ''
This option specifies the Linux builder to use.
'';
};
config = mkOption {
type = types.deferredModule;
default = { };
example = literalExpression ''
({ pkgs, ... }:
{
environment.systemPackages = [ pkgs.neovim ];
})
'';
description = ''
This option specifies extra NixOS configuration for the builder. You should first use the Linux builder
without changing the builder configuration otherwise you may not be able to build the Linux builder.
'';
};
mandatoryFeatures = mkOption {
type = types.listOf types.str;
default = [];
defaultText = literalExpression ''[]'';
example = literalExpression ''[ "big-parallel" ]'';
description = ''
A list of features mandatory for the Linux builder. The builder will
be ignored for derivations that don't require all features in
this list. All mandatory features are automatically included in
{var}`supportedFeatures`.
This sets the corresponding `nix.buildMachines.*.mandatoryFeatures` option.
'';
};
maxJobs = mkOption {
type = types.ints.positive;
default = cfg.package.nixosConfig.virtualisation.cores;
defaultText = ''
The `virtualisation.cores` of the build machine's final NixOS configuration.
'';
example = 2;
description = ''
Instead of setting this directly, you should set
{option}`nix.linux-builder.config.virtualisation.cores` to configure
the amount of cores the Linux builder should have.
The number of concurrent jobs the Linux builder machine supports. The
build machine will enforce its own limits, but this allows hydra
to schedule better since there is no work-stealing between build
machines.
This sets the corresponding `nix.buildMachines.*.maxJobs` option.
'';
};
protocol = mkOption {
type = types.str;
default = "ssh-ng";
defaultText = literalExpression ''"ssh-ng"'';
example = literalExpression ''"ssh"'';
description = ''
The protocol used for communicating with the build machine. Use
`ssh-ng` if your remote builder and your local Nix version support that
improved protocol.
Use `null` when trying to change the special localhost builder without a
protocol which is for example used by hydra.
'';
};
speedFactor = mkOption {
type = types.ints.positive;
default = 1;
defaultText = literalExpression ''1'';
description = ''
The relative speed of the Linux builder. This is an arbitrary integer
that indicates the speed of this builder, relative to other
builders. Higher is faster.
This sets the corresponding `nix.buildMachines.*.speedFactor` option.
'';
};
supportedFeatures = mkOption {
type = types.listOf types.str;
default = [ "kvm" "benchmark" "big-parallel" ];
defaultText = literalExpression ''[ "kvm" "benchmark" "big-parallel" ]'';
example = literalExpression ''[ "kvm" "big-parallel" ]'';
description = ''
A list of features supported by the Linux builder. The builder will
be ignored for derivations that require features not in this
list.
This sets the corresponding `nix.buildMachines.*.supportedFeatures` option.
'';
};
systems = mkOption {
type = types.listOf types.str;
default = [ cfg.package.nixosConfig.nixpkgs.hostPlatform.system ];
defaultText = ''
The `nixpkgs.hostPlatform.system` of the build machine's final NixOS configuration.
'';
example = literalExpression ''
[
"x86_64-linux"
"aarch64-linux"
]
'';
description = ''
This option specifies system types the build machine can execute derivations on.
This sets the corresponding `nix.buildMachines.*.systems` option.
'';
};
workingDirectory = mkOption {
type = types.str;
default = "/var/lib/linux-builder";
description = ''
The working directory of the Linux builder daemon process.
'';
};
ephemeral = mkEnableOption ''
wipe the builder's filesystem on every restart.
This is disabled by default as maintaining the builder's Nix Store reduces
rebuilds. You can enable this if you don't want your builder to accumulate
state.
'';
};
config = mkMerge [
(mkIf (!cfg.enable) {
system.activationScripts.preActivation.text = ''
rm -rf ${cfg.workingDirectory}
'';
})
(mkIf cfg.enable {
assertions = [
{
assertion = config.nix.enable;
message = ''`nix.linux-builder.enable` requires `nix.enable`'';
}
];
system.activationScripts.preActivation.text = ''
# Migrate if using the old working directory
if [ -e /var/lib/darwin-builder ] && [ ! -e ${cfg.workingDirectory} ]; then
mv /var/lib/darwin-builder ${cfg.workingDirectory}
fi
mkdir -p ${cfg.workingDirectory}
'';
launchd.daemons.linux-builder = {
environment = {
inherit (config.environment.variables) NIX_SSL_CERT_FILE;
};
# create-builder uses TMPDIR to share files with the builder, notably certs.
# macOS will clean up files in /tmp automatically that haven't been accessed in 3+ days.
# If we let it use /tmp, leaving the computer asleep for 3 days makes the certs vanish.
# So we'll use /run/org.nixos.linux-builder instead and clean it up ourselves.
script = ''
export TMPDIR=/run/org.nixos.linux-builder USE_TMPDIR=1
rm -rf $TMPDIR
mkdir -p $TMPDIR
trap "rm -rf $TMPDIR" EXIT
${lib.optionalString cfg.ephemeral ''
rm -f ${cfg.workingDirectory}/${cfg.package.nixosConfig.networking.hostName}.qcow2
''}
${cfg.package}/bin/create-builder
'';
serviceConfig = {
KeepAlive = true;
RunAtLoad = true;
WorkingDirectory = cfg.workingDirectory;
};
};
environment.etc."ssh/ssh_config.d/100-linux-builder.conf".text = ''
Host linux-builder
User builder
Hostname localhost
HostKeyAlias linux-builder
Port 31022
IdentityFile /etc/nix/builder_ed25519
'';
nix.distributedBuilds = true;
nix.buildMachines = [{
hostName = "linux-builder";
sshUser = "builder";
sshKey = "/etc/nix/builder_ed25519";
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo=";
inherit (cfg) mandatoryFeatures maxJobs protocol speedFactor supportedFeatures systems;
}];
nix.settings.builders-use-substitutes = true;
})
];
}
+42 -30
View File
@@ -1,41 +1,53 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
nix-tools = pkgs.callPackage ../../pkgs/nix-tools {
inherit (config.system) profile;
inherit (config.environment) systemPath;
nixPath = lib.optionalString config.nix.enable (lib.concatStringsSep ":" config.nix.nixPath);
nixPackage = if config.nix.enable then config.nix.package else null;
};
inherit (pkgs) stdenv;
darwin-uninstaller = pkgs.callPackage ../../pkgs/darwin-uninstaller { };
writeProgram = name: env: src:
pkgs.substituteAll ({
inherit name src;
dir = "bin";
isExecutable = true;
} // env);
darwin-option = writeProgram "darwin-option"
{
inherit (config.system) profile;
inherit (stdenv) shell;
}
../../pkgs/nix-tools/darwin-option.sh;
darwin-rebuild = writeProgram "darwin-rebuild"
{
inherit (config.system) profile;
inherit (stdenv) shell;
path = "${pkgs.coreutils}/bin:${config.environment.systemPath}";
}
../../pkgs/nix-tools/darwin-rebuild.sh;
mkToolModule = { name, package ? nix-tools.${name} }: { config, ... }: {
options.system.tools.${name}.enable = lib.mkEnableOption "${name} script" // {
default = config.system.tools.enable;
};
config = lib.mkIf config.system.tools.${name}.enable {
environment.systemPackages = [ package ];
};
};
in
{
options.system = {
tools.enable = lib.mkOption {
type = lib.types.bool;
internal = true;
default = true;
description = ''
Disable internal tools, such as darwin-rebuild and darwin-option. This
is useful to shrink systems which are not expected to rebuild or
reconfigure themselves. Use at your own risk!
'';
};
};
imports = [
(lib.mkRenamedOptionModule [ "system" "includeUninstaller" ] [ "system" "tools" "darwin-uninstaller" "enable" ])
(lib.mkRemovedOptionModule [ "system" "disableInstallerTools" ] "Please use system.tools.enable instead")
(mkToolModule { name = "darwin-option"; })
(mkToolModule { name = "darwin-rebuild"; })
(mkToolModule { name = "darwin-version"; })
(mkToolModule { name = "darwin-uninstaller"; package = darwin-uninstaller; })
];
config = {
environment.systemPackages =
[ # Include nix-tools by default
darwin-option
darwin-rebuild
];
system.build = {
inherit (nix-tools) darwin-option darwin-rebuild darwin-version;
};
};
}
+117
View File
@@ -0,0 +1,117 @@
{ config, options, lib, ... }:
with lib;
let
cfg = config.nixpkgs.flake;
in
{
options.nixpkgs.flake = {
source = mkOption {
# In newer Nix versions, particularly with lazy trees, outPath of
# flakes becomes a Nix-language path object. We deliberately allow this
# to gracefully come through the interface in discussion with @roberth.
#
# See: https://github.com/NixOS/nixpkgs/pull/278522#discussion_r1460292639
type = types.nullOr (types.either types.str types.path);
default = null;
defaultText = "if (using nix-darwin.lib.darwinSystem) then nixpkgs.source else null";
example = ''builtins.fetchTarball { name = "source"; sha256 = "${lib.fakeHash}"; url = "https://github.com/nixos/nixpkgs/archive/somecommit.tar.gz"; }'';
description = ''
The path to the nixpkgs sources used to build the system. This is automatically set up to be
the store path of the nixpkgs flake used to build the system if using
`nixpkgs.lib.darwinSystem`, and is otherwise null by default.
This can also be optionally set if the nix-darwin system is not built with a flake but still uses
pinned sources: set this to the store path for the nixpkgs sources used to build the system,
as may be obtained by `builtins.fetchTarball`, for example.
Note: the name of the store path must be "source" due to
<https://github.com/NixOS/nix/issues/7075>.
'';
};
setNixPath = mkOption {
type = types.bool;
default = config.nix.enable && cfg.source != null;
defaultText = literalExpression ''config.nix.enable && nixpkgs.flake.source != null'';
description = ''
Whether to set {env}`NIX_PATH` to include `nixpkgs=flake:nixpkgs` such that `<nixpkgs>`
lookups receive the version of nixpkgs that the system was built with, in concert with
{option}`nixpkgs.flake.setFlakeRegistry`.
This is on by default for nix-darwin configurations built with flakes.
This makes {command}`nix-build '<nixpkgs>' -A hello` work out of the box on flake systems.
Note that this option makes the nix-darwin closure depend on the nixpkgs sources, which may add
undesired closure size if the system will not have any nix commands run on it.
'';
};
setFlakeRegistry = mkOption {
type = types.bool;
default = config.nix.enable && cfg.source != null;
defaultText = literalExpression ''config.nix.enable && config.nixpkgs.flake.source != null'';
description = ''
Whether to pin nixpkgs in the system-wide flake registry (`/etc/nix/registry.json`) to the
store path of the sources of nixpkgs used to build the nix-darwin system.
This is on by default for nix-darwin configurations built with flakes.
This option makes {command}`nix run nixpkgs#hello` reuse dependencies from the system, avoid
refetching nixpkgs, and have a consistent result every time.
Note that this option makes the nix-darwin closure depend on the nixpkgs sources, which may add
undesired closure size if the system will not have any nix commands run on it.
'';
};
};
config = mkIf (cfg.source != null) (mkMerge [
{
assertions = [
{
assertion = cfg.setNixPath -> cfg.setFlakeRegistry;
message = ''
Setting `nixpkgs.flake.setNixPath` requires that `nixpkgs.flake.setFlakeRegistry` also
be set, since it is implemented in terms of indirection through the flake registry.
'';
}
# TODO: Upstream these to NixOS.
{
assertion = cfg.setNixPath -> config.nix.enable;
message = ''`nixpkgs.flake.setNixPath` requires `nix.enable`'';
}
{
assertion = cfg.setFlakeRegistry -> config.nix.enable;
message = ''`nixpkgs.flake.setFlakeRegistry` requires `nix.enable`'';
}
];
}
(mkIf cfg.setFlakeRegistry {
nix.registry.nixpkgs.to = mkDefault {
type = "path";
path = cfg.source;
};
})
(mkIf cfg.setNixPath {
# N.B. This does not include darwin-config in NIX_PATH unlike modules/nix/default.nix
# because we would need some kind of evil shim taking the *calling* flake's self path,
# perhaps, to ever make that work (in order to know where the Nix expr for the system came
# from and how to call it).
nix.nixPath = mkDefault ([ "nixpkgs=flake:nixpkgs" ]
++ optional config.nix.channel.enable "/nix/var/nix/profiles/per-user/root/channels");
})
]);
}
+305 -49
View File
@@ -1,73 +1,329 @@
{ config, lib, pkgs, ... }:
with lib;
{
config,
options,
lib,
pkgs,
...
}:
let
isConfig = x:
builtins.isAttrs x || builtins.isFunction x;
cfg = config.nixpkgs;
opt = options.nixpkgs;
optCall = f: x:
if builtins.isFunction f
then f x
else f;
isConfig = x: builtins.isAttrs x || lib.isFunction x;
mergeConfig = lhs_: rhs_:
optCall = f: x: if lib.isFunction f then f x else f;
mergeConfig =
lhs_: rhs_:
let
lhs = optCall lhs_ { inherit pkgs; };
rhs = optCall rhs_ { inherit pkgs; };
lhs = optCall lhs_ { inherit lib pkgs; };
rhs = optCall rhs_ { inherit lib pkgs; };
in
lhs // rhs //
optionalAttrs (lhs ? packageOverrides) {
packageOverrides = pkgs:
optCall lhs.packageOverrides pkgs //
optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
} //
optionalAttrs (lhs ? perlPackageOverrides) {
perlPackageOverrides = pkgs:
optCall lhs.perlPackageOverrides pkgs //
optCall (attrByPath ["perlPackageOverrides"] ({}) rhs) pkgs;
lib.recursiveUpdate lhs rhs
// lib.optionalAttrs (lhs ? allowUnfreePackages) {
allowUnfreePackages = lhs.allowUnfreePackages ++ (lib.attrByPath [ "allowUnfreePackages" ] [ ] rhs);
}
// lib.optionalAttrs (lhs ? packageOverrides) {
packageOverrides =
pkgs:
optCall lhs.packageOverrides pkgs // optCall (lib.attrByPath [ "packageOverrides" ] { } rhs) pkgs;
}
// lib.optionalAttrs (lhs ? perlPackageOverrides) {
perlPackageOverrides =
pkgs:
optCall lhs.perlPackageOverrides pkgs
// optCall (lib.attrByPath [ "perlPackageOverrides" ] { } rhs) pkgs;
};
configType = mkOptionType {
name = "nixpkgs config";
check = traceValIfNot isConfig;
merge = args: fold (def: mergeConfig def.value) {};
configType = lib.mkOptionType {
name = "nixpkgs-config";
description = "nixpkgs config";
check =
x:
let
traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
in
traceXIfNot isConfig;
merge = args: lib.foldr (def: mergeConfig def.value) { };
};
overlayType = lib.mkOptionType {
name = "nixpkgs-overlay";
description = "nixpkgs overlay";
check = lib.isFunction;
merge = lib.mergeOneOption;
};
pkgsType = lib.types.pkgs // {
# This type is only used by itself, so let's elaborate the description a bit
# for the purpose of documentation.
description = "An evaluation of Nixpkgs; the top level attribute set of packages";
};
hasBuildPlatform = opt.buildPlatform.highestPrio < (lib.mkOptionDefault { }).priority;
hasHostPlatform = opt.hostPlatform.isDefined;
hasPlatform = hasHostPlatform || hasBuildPlatform;
# Context for messages
hostPlatformLine = lib.optionalString hasHostPlatform "${lib.showOptionWithDefLocs opt.hostPlatform}";
buildPlatformLine = lib.optionalString hasBuildPlatform "${lib.showOptionWithDefLocs opt.buildPlatform}";
legacyOptionsDefined = lib.optional (
opt.system.highestPrio < (lib.mkDefault { }).priority
) opt.system;
defaultPkgs =
if opt.hostPlatform.isDefined then
let
isCross = cfg.buildPlatform != cfg.hostPlatform;
systemArgs =
if isCross then
{
localSystem = cfg.buildPlatform;
crossSystem = cfg.hostPlatform;
}
else
{
localSystem = cfg.hostPlatform;
};
in
import cfg.source (
{
inherit (cfg) config overlays;
}
// systemArgs
)
else
import cfg.source {
inherit (cfg) config overlays;
localSystem = { inherit (cfg) system; };
};
finalPkgs = if opt.pkgs.isDefined then cfg.pkgs.appendOverlays cfg.overlays else defaultPkgs;
in
{
options = {
nixpkgs.config = mkOption {
default = {};
example = literalExample
''
{ firefox.enableGeckoMediaPlayer = true;
packageOverrides = pkgs: {
firefox60Pkgs = pkgs.firefox60Pkgs.override {
enableOfficialBranding = true;
};
};
}
'';
type = configType;
options.nixpkgs = {
pkgs = lib.mkOption {
type = pkgsType;
example = lib.literalExpression "import <nixpkgs> {}";
description = ''
The configuration of the Nix Packages collection. (For
details, see the Nixpkgs documentation.) It allows you to set
package configuration options, and to override packages
globally through the <varname>packageOverrides</varname>
option. The latter is a function that takes as an argument
the <emphasis>original</emphasis> Nixpkgs, and must evaluate
to a set of new or overridden packages.
If set, the pkgs argument to all nix-darwin modules is the value of
this option, extended with `nixpkgs.overlays`, if
that is also set. The nix-darwin and Nixpkgs architectures must
match. Any other options in `nixpkgs.*`, notably `config`,
will be ignored.
The default value imports the Nixpkgs from
[](#opt-nixpkgs.source). The `config`, `overlays`, `localSystem`,
and `crossSystem` are based on this option's siblings.
This option can be used to increase
the performance of evaluation, or to create packages that depend
on a container that should be built with the exact same evaluation
of Nixpkgs, for example. Applications like this should set
their default value using `lib.mkDefault`, so
user-provided configuration can override it without using
`lib`.
'';
};
config = lib.mkOption {
default = { };
example = lib.literalExpression ''
{ allowBroken = true; allowUnfree = true; }
'';
type = configType;
description = ''
Global configuration for Nixpkgs.
The complete list of [Nixpkgs configuration options](https://nixos.org/manual/nixpkgs/stable/#sec-config-options-reference) is in the [Nixpkgs manual section on global configuration](https://nixos.org/manual/nixpkgs/stable/#chap-packageconfig).
Ignored when {option}`nixpkgs.pkgs` is set.
'';
};
overlays = lib.mkOption {
default = [ ];
example = lib.literalExpression ''
[
(self: super: {
openssh = super.openssh.override {
hpnSupport = true;
kerberos = self.libkrb5;
};
})
]
'';
type = lib.types.listOf overlayType;
description = ''
List of overlays to apply to Nixpkgs.
This option allows modifying the Nixpkgs package set accessed through the `pkgs` module argument.
For details, see the [Overlays chapter in the Nixpkgs manual](https://nixos.org/manual/nixpkgs/stable/#chap-overlays).
If the {option}`nixpkgs.pkgs` option is set, overlays specified using `nixpkgs.overlays` will be applied after the overlays that were already included in `nixpkgs.pkgs`.
'';
};
hostPlatform = lib.mkOption {
type = lib.types.either lib.types.str lib.types.attrs; # TODO utilize lib.systems.parsedPlatform
example = {
system = "aarch64-darwin";
};
# Make sure that the final value has all fields for sake of other modules
# referring to this. TODO make `lib.systems` itself use the module system.
apply = lib.systems.elaborate;
description = ''
Specifies the platform where the nix-darwin configuration will run.
To cross-compile, set also `nixpkgs.buildPlatform`.
Ignored when `nixpkgs.pkgs` is set.
'';
};
buildPlatform = lib.mkOption {
type = lib.types.either lib.types.str lib.types.attrs; # TODO utilize lib.systems.parsedPlatform
default = cfg.hostPlatform;
example = {
system = "x86_64-darwin";
};
# Make sure that the final value has all fields for sake of other modules
# referring to this.
apply =
inputBuildPlatform:
let
elaborated = lib.systems.elaborate inputBuildPlatform;
in
if lib.systems.equals elaborated cfg.hostPlatform then
cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001
else
elaborated;
defaultText = lib.literalExpression ''config.nixpkgs.hostPlatform'';
description = ''
Specifies the platform on which nix-darwin should be built.
By default, nix-darwin is built on the system where it runs, but you can
change where it's built. Setting this option will cause nix-darwin to be
cross-compiled.
For instance, if you're doing distributed multi-platform deployment,
or if you're building machines, you can set this to match your
development system and/or build farm.
Ignored when `nixpkgs.pkgs` is set.
'';
};
system = lib.mkOption {
type = lib.types.str;
example = "x86_64-darwin";
default =
if opt.hostPlatform.isDefined then
throw ''
Neither ${opt.system} nor any other option in nixpkgs.* is meant
to be read by modules and configurations.
Use pkgs.stdenv.hostPlatform instead.
''
else
throw ''
Neither ${opt.hostPlatform} nor the legacy option ${opt.system} has been set.
The option ${opt.system} is still fully supported for interoperability,
but will be deprecated in the future, so we recommend to set ${opt.hostPlatform}.
'';
defaultText = lib.literalMD ''
Traditionally `builtins.currentSystem`, but unset when invoking nix-darwin through `lib.darwinSystem`.
'';
description = ''
Specifies the Nix platform type on which nix-darwin should be built.
It is better to specify `nixpkgs.hostPlatform` instead.
Ignored when `nixpkgs.pkgs` or `nixpkgs.hostPlatform` is set.
'';
};
# nix-darwin only
source = lib.mkOption {
type = lib.types.path;
defaultText = lib.literalMD ''
`<nixpkgs>` or nix-darwin's `nixpkgs` flake input
'';
description = ''
The path to import Nixpkgs from. If you're setting a custom
[](#opt-nixpkgs.pkgs) or `_module.args.pkgs`, setting this
to something with `rev` and `shortRev` attributes (such as a
flake input or `builtins.fetchGit` result) will also set
`system.nixpkgsRevision` and related options.
(nix-darwin only)
'';
};
constructedByUs = lib.mkOption {
type = lib.types.bool;
internal = true;
description = ''
Whether `pkgs` was constructed by this module. This is false when any of
`nixpkgs.pkgs` or `_module.args.pkgs` is set. (nix-darwin only)
'';
};
};
config = {
_module.args = {
pkgs =
# We explicitly set the default override priority, so that we do not need
# to evaluate finalPkgs in case an override is placed on `_module.args.pkgs`.
# After all, to determine a definition priority, we need to evaluate `._type`,
# which is somewhat costly for Nixpkgs. With an explicit priority, we only
# evaluate the wrapper to find out that the priority is lower, and then we
# don't need to evaluate `finalPkgs`.
lib.mkOverride lib.modules.defaultOverridePriority finalPkgs.__splicedPackages;
};
# _module.args.pkgs is defined in ../../default.nix
nixpkgs.constructedByUs =
# We set it with default priority and it can not be merged, so if the
# pkgs module argument has that priority, it's from us.
(lib.modules.mergeAttrDefinitionsWithPrio options._module.args).pkgs.highestPrio
== lib.modules.defaultOverridePriority
# Although, if nixpkgs.pkgs is set, we did forward it, but we did not construct it.
&& !opt.pkgs.isDefined;
assertions = [
(
let
pkgsSystem = finalPkgs.stdenv.targetPlatform.system;
in
{
assertion = cfg.constructedByUs -> !hasPlatform -> cfg.system == pkgsSystem;
message = "The nix-darwin nixpkgs.pkgs option was set to a Nixpkgs invocation that compiles to target system ${pkgsSystem} but nix-darwin was configured for system ${config.nixpkgs.system} via nix-darwin option nixpkgs.system. The nix-darwin system settings must match the Nixpkgs target system.";
}
)
{
assertion = cfg.constructedByUs -> hasPlatform -> legacyOptionsDefined == [ ];
message = ''
Your system configures nixpkgs with the platform parameter${lib.optionalString hasBuildPlatform "s"}:
${hostPlatformLine}${buildPlatformLine}
However, it also defines the legacy options:
${lib.concatMapStrings lib.showOptionWithDefLocs legacyOptionsDefined}
For a future proof system configuration, we recommend to remove
the legacy definitions.
'';
}
{
assertion = opt.pkgs.isDefined -> cfg.config == { };
message = ''
Your system configures nixpkgs with an externally created instance.
`nixpkgs.config` options should be passed when creating the instance instead.
Current value:
${lib.generators.toPretty { multiline = true; } cfg.config}
Defined in:
${lib.concatMapStringsSep "\n" (file: " - ${file}") opt.config.files}
'';
}
];
};
}
+49
View File
@@ -0,0 +1,49 @@
{ config, lib, ... }:
let
cfg = config.power;
types = lib.types;
onOff = cond: if cond then "on" else "off";
in
{
options = {
power.restartAfterPowerFailure = lib.mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Whether to restart the computer after a power failure.
Option is not supported on all devices.
'';
};
power.restartAfterFreeze = lib.mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Whether to restart the computer after a system freeze.
'';
};
};
config = {
system.activationScripts.power.text = ''
echo "configuring power..." >&2
${lib.optionalString (cfg.restartAfterPowerFailure != null) ''
systemsetup -setRestartPowerFailure \
'${onOff cfg.restartAfterPowerFailure}' &> /dev/null
''}
${lib.optionalString (cfg.restartAfterFreeze != null) ''
systemsetup -setRestartFreeze \
'${onOff cfg.restartAfterFreeze}' &> /dev/null
''}
'';
};
}
+80
View File
@@ -0,0 +1,80 @@
{ config, lib, ... }:
let
cfg = config.power.sleep;
types = lib.types;
onOff = cond: if cond then "on" else "off";
in
{
options = {
power.sleep.computer = lib.mkOption {
type = types.nullOr (types.either types.ints.positive (types.enum ["never"]));
default = null;
example = "never";
description = ''
Amount of idle time (in minutes) until the computer sleeps.
`"never"` disables computer sleeping.
The system might not be considered idle before connected displays sleep, as
per the `power.sleep.display` option.
'';
};
power.sleep.display = lib.mkOption {
type = types.nullOr (types.either types.ints.positive (types.enum ["never"]));
default = null;
example = "never";
description = ''
Amount of idle time (in minutes) until displays sleep.
`"never"` disables display sleeping.
'';
};
power.sleep.harddisk = lib.mkOption {
type = types.nullOr (types.either types.ints.positive (types.enum ["never"]));
default = null;
example = "never";
description = ''
Amount of idle time (in minutes) until hard disks sleep.
`"never"` disables hard disk sleeping.
'';
};
power.sleep.allowSleepByPowerButton = lib.mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Whether the power button can sleep the computer.
'';
};
};
config = {
system.activationScripts.power.text = lib.mkAfter ''
${lib.optionalString (cfg.computer != null) ''
systemsetup -setComputerSleep '${toString cfg.computer}' &> /dev/null
''}
${lib.optionalString (cfg.display != null) ''
systemsetup -setDisplaySleep '${toString cfg.display}' &> /dev/null
''}
${lib.optionalString (cfg.harddisk != null) ''
systemsetup -setHardDiskSleep '${toString cfg.harddisk}' &> /dev/null
''}
${lib.optionalString (cfg.allowSleepByPowerButton != null) ''
systemsetup -setAllowPowerButtonToSleepComputer \
'${onOff cfg.allowSleepByPowerButton}' &> /dev/null
''}
'';
};
}
+49
View File
@@ -0,0 +1,49 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs._1password-gui;
in
{
options = {
programs._1password-gui = {
enable = lib.mkEnableOption "the 1Password GUI application";
package = lib.mkPackageOption pkgs "1Password GUI" {
default = [ "_1password-gui" ];
};
};
};
config = lib.mkIf cfg.enable {
# Based on https://github.com/reckenrode/nixos-configs/blob/22b8357fc6ffbd0df5ce50dc417c23a807a268a2/modules/by-name/1p/1password/darwin-module.nix
system.activationScripts.applications.text = lib.mkAfter ''
install -o root -g wheel -m0555 -d "/Applications/1Password.app"
rsyncFlags=(
# mtime is standardized in the nix store, which would leave only file size to distinguish files.
# Thus we need checksums, despite the speed penalty.
--checksum
# Converts all symlinks pointing outside of the copied tree (thus unsafe) into real files and directories.
# This neatly converts all the symlinks pointing to application bundles in the nix store into
# real directories, without breaking any relative symlinks inside of application bundles.
# This is good enough, because the make-symlinks-relative.sh setup hook converts all $out internal
# symlinks to relative ones.
--copy-unsafe-links
--archive
--delete
--chmod=-w
--no-group
--no-owner
)
${lib.getExe pkgs.rsync} "''${rsyncFlags[@]}" \
${cfg.package}/Applications/1Password.app/ /Applications/1Password.app
'';
};
}
+31
View File
@@ -0,0 +1,31 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs._1password;
in
{
options = {
programs._1password = {
enable = lib.mkEnableOption "the 1Password CLI tool";
package = lib.mkPackageOption pkgs "1Password CLI" {
default = [ "_1password-cli" ];
};
};
};
config = lib.mkIf cfg.enable {
# Integration with the 1Password GUI will only work if the CLI at `/usr/local/bin/op`
# Based on https://github.com/reckenrode/nixos-configs/blob/22b8357fc6ffbd0df5ce50dc417c23a807a268a2/modules/by-name/1p/1password/darwin-module.nix
system.activationScripts.applications.text = lib.mkAfter ''
install -o root -g wheel -m0555 -D \
${lib.getExe cfg.package} /usr/local/bin/op
'';
};
}
+41
View File
@@ -0,0 +1,41 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs.arqbackup;
in
{
options = {
programs.arqbackup = {
enable = lib.mkEnableOption "Arq backup";
# If `arq` is not available then we set `default` to `null` to prevent
# eval from breaking while `arq` hasn't been merged yet. Only if a user
# enables the module will they be required to set this option.
package = lib.mkPackageOption pkgs "arq" (lib.optionalAttrs (!pkgs ? arq) { default = null; });
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
launchd.daemons.arqagent = {
command = "${cfg.package}/Applications/Arq.app/Contents/Resources/ArqAgent.app/Contents/MacOS/ArqAgent";
serviceConfig.Label = "com.haystacksoftware.arqagent";
serviceConfig.RunAtLoad = true;
serviceConfig.KeepAlive = true;
};
launchd.user.agents.ArqMonitor = {
command = "${cfg.package}/Applications/Arq.app/Contents/Resources/ArqMonitor.app/Contents/MacOS/ArqMonitor";
serviceConfig.Label = "com.haystacksoftware.ArqMonitor";
serviceConfig.RunAtLoad = true;
serviceConfig.KeepAlive = true;
managedBy = "programs.arqbackup.enable";
};
};
}
-95
View File
@@ -1,95 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.bash;
shell = pkgs.runCommand pkgs.bashInteractive.name
{ buildInputs = [ pkgs.makeWrapper ]; }
''
source $stdenv/setup
mkdir -p $out/bin
makeWrapper ${pkgs.bashInteractive}/bin/bash $out/bin/bash
'';
in
{
options = {
programs.bash.enable = mkOption {
type = types.bool;
default = false;
description = "Whether to configure bash as an interactive shell.";
};
programs.bash.interactiveShellInit = mkOption {
default = "";
description = "Shell script code called during interactive bash shell initialisation.";
type = types.lines;
};
programs.bash.enableCompletion = mkOption {
type = types.bool;
default = true;
description = "Enable bash completion for all interactive bash shells.";
};
};
config = mkIf cfg.enable {
environment.systemPackages =
[ # Include bash package
pkgs.bashInteractive
] ++ optional cfg.enableCompletion pkgs.bash-completion;
environment.pathsToLink =
[ "/etc/bash_completion.d"
"/share/bash-completion/completions"
];
environment.loginShell = mkDefault "${shell}/bin/bash -l";
environment.variables.SHELL = mkDefault "${shell}/bin/bash";
environment.etc."bashrc".text = ''
# /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
# This file is read for interactive shells.
# Only execute this file once per shell.
if [ -n "$__ETC_BASHRC_SOURCED" -o -n "$NOSYSBASHRC" ]; then return; fi
__ETC_BASHRC_SOURCED=1
export PATH=${config.environment.systemPath}
${config.system.build.setEnvironment}
${config.system.build.setAliases}
${config.environment.extraInit}
${config.environment.interactiveShellInit}
${cfg.interactiveShellInit}
${optionalString cfg.enableCompletion ''
source "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
nullglobStatus=$(shopt -p nullglob)
shopt -s nullglob
for p in $NIX_PROFILES; do
for m in "$p/etc/bash_completion.d/"* "$p/share/bash-completion/completions/"*; do
source $m
done
done
eval "$nullglobStatus"
unset nullglobStatus p m
''}
# Read system-wide modifications.
if test -f /etc/bash.local; then
source /etc/bash.local
fi
'';
};
}
+111
View File
@@ -0,0 +1,111 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.bash;
in
{
imports = [
(mkRenamedOptionModule [ "programs" "bash" "enableCompletion" ] [ "programs" "bash" "completion" "enable" ])
];
options = {
programs.bash.enable = mkOption {
type = types.bool;
default = true;
description = "Whether to configure bash as an interactive shell.";
};
programs.bash.interactiveShellInit = mkOption {
default = "";
description = "Shell script code called during interactive bash shell initialisation.";
type = types.lines;
};
programs.bash.completion = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable bash completion for all interactive bash shells.
NOTE: This doesn't work with bash 3.2, which is installed by default on macOS by Apple.
'';
};
package = mkPackageOption pkgs "bash-completion" { };
};
};
config = mkIf cfg.enable {
environment.systemPackages =
[ # Include bash package
pkgs.bashInteractive
] ++ optional cfg.completion.enable cfg.completion.package;
environment.pathsToLink = optionals cfg.completion.enable
[ "/etc/bash_completion.d"
"/share/bash-completion/completions"
];
environment.etc."bashrc".text = ''
# /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
# This file is read for interactive shells.
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
# Only execute this file once per shell.
if [ -n "$__ETC_BASHRC_SOURCED" -o -n "$NOSYSBASHRC" ]; then return; fi
__ETC_BASHRC_SOURCED=1
if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then
. ${config.system.build.setEnvironment}
fi
# Return early if not running interactively, but after basic nix setup.
[[ $- != *i* ]] && return
# Make bash check its window size after a process completes
shopt -s checkwinsize
${config.system.build.setAliases.text}
${config.environment.interactiveShellInit}
${cfg.interactiveShellInit}
${optionalString cfg.completion.enable ''
if [ "$TERM" != "dumb" ]; then
source "${cfg.completion.package}/etc/profile.d/bash_completion.sh"
nullglobStatus=$(shopt -p nullglob)
shopt -s nullglob
for p in $NIX_PROFILES; do
for m in "$p/etc/bash_completion.d/"*; do
source $m
done
done
eval "$nullglobStatus"
unset nullglobStatus p m
fi
''}
# Read system-wide modifications.
if test -f /etc/bash.local; then
source /etc/bash.local
fi
'';
environment.etc."bashrc".knownSha256Hashes = [
"444c716ac2ccd9e1e3347858cb08a00d2ea38e8c12fdc5798380dc261e32e9ef" # macOS
"617b39e36fa69270ddbee19ddc072497dbe7ead840cbd442d9f7c22924f116f4" # official Nix installer
"6be16cf7c24a3c6f7ae535c913347a3be39508b3426f5ecd413e636e21031e66" # official Nix installer
"08ffbf991a9e25839d38b80a0d3bce3b5a6c84b9be53a4b68949df4e7e487bb7" # DeterminateSystems installer
];
};
}
+182
View File
@@ -0,0 +1,182 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.programs.direnv;
enabledOption =
x:
lib.mkEnableOption x
// {
default = true;
example = false;
};
format = pkgs.formats.toml {};
in {
meta.maintainers = [
lib.maintainers.mattpolzin or "mattpolzin"
];
options.programs.direnv = {
enable = lib.mkEnableOption ''
direnv integration. Takes care of both installation and
setting up the sourcing of the shell. Additionally enables nix-direnv
integration.
'';
package = lib.mkPackageOption pkgs "direnv" {};
finalPackage = lib.mkOption {
type = lib.types.package;
readOnly = true;
description = "The wrapped direnv package.";
};
enableBashIntegration = enabledOption ''
Bash integration
'';
enableZshIntegration = enabledOption ''
Zsh integration
'';
enableFishIntegration = enabledOption ''
Fish integration
'';
direnvrcExtra = lib.mkOption {
type = lib.types.lines;
default = "";
example = ''
export FOO="foo"
echo "loaded direnv!"
'';
description = ''
Extra lines to append to the sourced direnvrc
'';
};
silent = lib.mkEnableOption ''
the hiding of direnv logging
'';
loadInNixShell =
(lib.mkEnableOption ''
loading direnv in `nix-shell` `nix shell` or `nix develop`
'')
// {
default = true;
};
nix-direnv = {
enable =
(lib.mkEnableOption ''
a faster, persistent implementation of use_nix and use_flake, to replace the built-in one
'')
// {
default = true;
};
package = lib.mkPackageOption pkgs "nix-direnv" {};
};
settings = lib.mkOption {
inherit (format) type;
default = {};
example = lib.literalExpression ''
{
global = {
log_format = "-";
log_filter = "^$";
};
}
'';
description = ''
Direnv configuration. Refer to {manpage}`direnv.toml(1)`.
'';
};
};
config = lib.mkIf cfg.enable {
programs = {
direnv = {
finalPackage = pkgs.symlinkJoin {
inherit (cfg.package) name;
paths = [cfg.package];
# direnv has a fish library which automatically sources direnv for some reason
postBuild = ''
rm -rf "$out/share/fish"
'';
meta.mainProgram = "direnv";
};
settings = lib.mkIf cfg.silent {
global = {
log_format = lib.mkDefault "-";
log_filter = lib.mkDefault "^$";
};
};
};
zsh.interactiveShellInit = lib.mkIf cfg.enableZshIntegration ''
if ${lib.boolToString cfg.loadInNixShell} || printenv PATH | grep -vqc '/nix/store'; then
eval "$(${lib.getExe cfg.finalPackage} hook zsh)"
fi
'';
#$NIX_GCROOT for "nix develop" https://github.com/NixOS/nix/blob/6db66ebfc55769edd0c6bc70fcbd76246d4d26e0/src/nix/develop.cc#L530
#$IN_NIX_SHELL for "nix-shell"
bash.interactiveShellInit = lib.mkIf cfg.enableBashIntegration ''
if ${lib.boolToString cfg.loadInNixShell} || [ -z "$IN_NIX_SHELL$NIX_GCROOT$(printenv PATH | grep '/nix/store')" ] ; then
eval "$(${lib.getExe cfg.finalPackage} hook bash)"
fi
'';
fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration ''
if ${lib.boolToString cfg.loadInNixShell};
or printenv PATH | grep -vqc '/nix/store';
${lib.getExe cfg.finalPackage} hook fish | source
end
'';
};
environment = {
systemPackages = [
cfg.finalPackage
];
variables = {
DIRENV_CONFIG = "/etc/direnv";
};
etc = {
"direnv/direnv.toml".source = lib.mkIf (cfg.settings != {}) (
format.generate "direnv.toml" cfg.settings
);
"direnv/direnvrc".text = ''
${lib.optionalString cfg.nix-direnv.enable ''
#Load nix-direnv
source ${cfg.nix-direnv.package}/share/nix-direnv/direnvrc
''}
#Load direnvrcExtra
${cfg.direnvrcExtra}
#Load user-configuration if present (~/.direnvrc or ~/.config/direnv/direnvrc)
direnv_config_dir_home="''${DIRENV_CONFIG_HOME:-''${XDG_CONFIG_HOME:-$HOME/.config}/direnv}"
if [[ -f $direnv_config_dir_home/direnvrc ]]; then
source "$direnv_config_dir_home/direnvrc" >&2
elif [[ -f $HOME/.direnvrc ]]; then
source "$HOME/.direnvrc" >&2
fi
unset direnv_config_dir_home
'';
"direnv/lib/zz-user.sh".text = ''
direnv_config_dir_home="''${DIRENV_CONFIG_HOME:-''${XDG_CONFIG_HOME:-$HOME/.config}/direnv}"
for lib in "$direnv_config_dir_home/lib/"*.sh; do
source "$lib"
done
unset direnv_config_dir_home
'';
};
};
};
}
+181 -70
View File
@@ -1,40 +1,49 @@
{ config, lib, pkgs, ...}:
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.fish;
cfge = config.environment;
foreignEnv = pkgs.writeText "fish-foreign-env" ''
# TODO: environment.shellInit
${cfge.extraInit}
'';
cfg = config.programs.fish;
loginForeignEnv = pkgs.writeText "fish-login-foreign-env" ''
# TODO: environment.loginShellInit
'';
interactiveForeignEnv = pkgs.writeText "fish-interactive-foreign-env" ''
${cfge.interactiveShellInit}
'';
shell = pkgs.runCommand pkgs.fish.name
{ buildInputs = [ pkgs.makeWrapper ]; }
''
source $stdenv/setup
mkdir -p $out/bin
makeWrapper ${pkgs.fish}/bin/fish $out/bin/fish
'';
fishAliases = concatStringsSep "\n" (
mapAttrsFlatten (k: v: "alias ${k} '${v}'") cfg.shellAliases
fishAbbrs = concatStringsSep "\n" (
mapAttrsToList (k: v: "abbr -a ${k} -- ${escapeShellArg v}") cfg.shellAbbrs
);
fishVariables =
mapAttrsToList (n: v: ''set -x ${n} "${v}"'') cfg.variables;
fishAliases = concatStringsSep "\n" (
mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}")
(filterAttrs (k: v: v != null) cfg.shellAliases)
);
envShellInit = pkgs.writeText "shellInit" cfge.shellInit;
envLoginShellInit = pkgs.writeText "loginShellInit" cfge.loginShellInit;
envInteractiveShellInit = pkgs.writeText "interactiveShellInit" cfge.interactiveShellInit;
fenv = pkgs.fishPlugins.foreign-env or pkgs.fish-foreign-env;
# fishPlugins.foreign-env and fish-foreign-env have different function paths
fenvFunctionsDir = if (pkgs ? fishPlugins.foreign-env)
then "${fenv}/share/fish/vendor_functions.d"
else "${fenv}/share/fish-foreign-env/functions";
sourceEnv = file:
if cfg.useBabelfish then
"source /etc/fish/${file}.fish"
else
''
set fish_function_path ${fenvFunctionsDir} $fish_function_path
fenv source /etc/fish/foreign-env/${file} > /dev/null
set -e fish_function_path[1]
'';
babelfishTranslate = path: name:
pkgs.runCommand "${name}.fish" {} ''
${cfg.babelfishPackage}/bin/babelfish < ${path} > $out
'';
in
@@ -45,109 +54,211 @@ in
programs.fish = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to configure fish as an interactive shell.
'';
type = types.bool;
};
variables = mkOption {
type = types.attrsOf (types.either types.str (types.listOf types.str));
default = {};
package = lib.mkPackageOption pkgs "fish" { };
useBabelfish = mkOption {
type = types.bool;
default = false;
description = ''
A set of environment variables used in the global environment.
These variables will be set on shell initialisation.
The value of each variable can be either a string or a list of
strings. The latter is concatenated, interspersed with colon
characters.
If enabled, the configured environment will be translated to native fish using [babelfish](https://github.com/bouk/babelfish).
Otherwise, [foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) will be used.
'';
apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v);
};
babelfishPackage = mkOption {
type = types.package;
default = pkgs.babelfish;
description = ''
The babelfish package to use when useBabelfish is
set to true.
'';
};
vendor.config.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether fish should source configuration snippets provided by other packages.
'';
};
vendor.completions.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether fish should use completion files provided by other packages.
'';
};
vendor.functions.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether fish should autoload fish functions provided by other packages.
'';
};
shellAbbrs = mkOption {
default = {};
example = {
gco = "git checkout";
npu = "nix-prefetch-url";
};
description = ''
Set of fish abbreviations.
'';
type = with types; attrsOf str;
};
shellAliases = mkOption {
type = types.attrs;
default = cfge.shellAliases;
default = config.environment.shellAliases;
description = ''
Set of aliases for fish shell. See <option>environment.shellAliases</option>
Set of aliases for fish shell. See {option}`environment.shellAliases`
for an option format description.
'';
type = types.attrs;
};
shellInit = mkOption {
type = types.lines;
default = "";
description = ''
Shell Script code called during fish shell initialisation.
Shell script code called during fish shell initialisation.
'';
type = types.lines;
};
loginShellInit = mkOption {
type = types.lines;
default = "";
description = ''
Shell script code called during fish login shell initialisation.
'';
type = types.lines;
};
interactiveShellInit = mkOption {
type = types.lines;
default = "";
description = ''
Shell script code called during interactive fish shell initialisation.
'';
type = types.lines;
};
promptInit = mkOption {
type = types.lines;
default = "";
description = ''
Shell script code used to initialise fish prompt.
'';
type = types.lines;
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.fish ];
environment = mkMerge [
(mkIf cfg.useBabelfish
{
etc."fish/setEnvironment.fish".source = babelfishTranslate config.system.build.setEnvironment "setEnvironment";
etc."fish/shellInit.fish".source = babelfishTranslate envShellInit "shellInit";
etc."fish/loginShellInit.fish".source = babelfishTranslate envLoginShellInit "loginShellInit";
etc."fish/interactiveShellInit.fish".source = babelfishTranslate envInteractiveShellInit "interactiveShellInit";
})
environment.pathsToLink = [ "/share/fish" ];
(mkIf (!cfg.useBabelfish)
{
etc."fish/foreign-env/shellInit".source = envShellInit;
etc."fish/foreign-env/loginShellInit".source = envLoginShellInit;
etc."fish/foreign-env/interactiveShellInit".source = envInteractiveShellInit;
})
environment.loginShell = mkDefault "${shell}/bin/fish -l";
environment.variables.SHELL = mkDefault "${shell}/bin/fish";
{
etc."fish/nixos-env-preinit.fish".text =
if cfg.useBabelfish
then ''
# source the NixOS environment config
if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]
source /etc/fish/setEnvironment.fish
end
''
else ''
# This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently
# unset. We set it and then completely erase it, leaving its configuration to $__fish_datadir/config.fish
set fish_function_path ${fenvFunctionsDir} $__fish_datadir/functions
environment.etc."fish/config.fish".text = ''
# /etc/fish/config.fish: DO NOT EDIT -- this file has been generated automatically.
# source the NixOS environment config
if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]
fenv source ${config.system.build.setEnvironment}
end
set fish_function_path $fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions
# clear fish_function_path so that it will be correctly set when we return to $__fish_datadir/config.fish
set -e fish_function_path
'';
}
{
etc."fish/config.fish".text = ''
# /etc/fish/config.fish: DO NOT EDIT -- this file has been generated automatically.
set PATH ${replaceStrings [":"] [" "] config.environment.systemPath}
# if we haven't sourced the general config, do it
if not set -q __fish_nix_darwin_general_config_sourced
${sourceEnv "shellInit"}
${config.system.build.setEnvironment}
${cfg.shellInit}
fenv source ${foreignEnv}
${cfg.shellInit}
# and leave a note so we don't source this config section again from
# this very shell (children will source the general config anew)
set -g __fish_nix_darwin_general_config_sourced 1
end
${concatStringsSep "\n" fishVariables}
# if we haven't sourced the login config, do it
status --is-login; and not set -q __fish_nix_darwin_login_config_sourced
and begin
${sourceEnv "loginShellInit"}
if status --is-login
# TODO: environment.loginShellInit
${cfg.loginShellInit}
end
${cfg.loginShellInit}
if status --is-interactive
${fishAliases}
${optionalString (cfge.interactiveShellInit != "") ''
fenv source ${interactiveForeignEnv}
''}
# and leave a note so we don't source this config section again from
# this very shell (children will source the general config anew)
set -g __fish_nix_darwin_login_config_sourced 1
end
${cfg.interactiveShellInit}
${cfg.promptInit}
end
'';
# if we haven't sourced the interactive config, do it
status --is-interactive; and not set -q __fish_nix_darwin_interactive_config_sourced
and begin
${fishAbbrs}
${fishAliases}
${sourceEnv "interactiveShellInit"}
${cfg.promptInit}
${cfg.interactiveShellInit}
# and leave a note so we don't source this config section again from
# this very shell (children will source the general config anew,
# allowing configuration changes in, e.g, aliases, to propagate)
set -g __fish_nix_darwin_interactive_config_sourced 1
end
'';
}
# include programs that bring their own completions
{
pathsToLink = []
++ optional cfg.vendor.config.enable "/share/fish/vendor_conf.d"
++ optional cfg.vendor.completions.enable "/share/fish/vendor_completions.d"
++ optional cfg.vendor.functions.enable "/share/fish/vendor_functions.d";
}
{ systemPackages = [ cfg.package ]; }
];
};
}
+68
View File
@@ -0,0 +1,68 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
getExe'
mkIf
mkOption
mkPackageOption
optionalString
types
;
cfg = config.programs.gnupg;
in
{
options.programs.gnupg = {
package = mkPackageOption pkgs "gnupg" { };
agent.enable = mkOption {
type = types.bool;
default = false;
description = ''
Enables GnuPG agent for every user session.
'';
};
agent.enableSSHSupport = mkOption {
type = types.bool;
default = false;
description = ''
Enable SSH agent support in GnuPG agent. Also sets SSH_AUTH_SOCK
environment variable correctly.
'';
};
};
config = mkIf cfg.agent.enable {
environment.systemPackages = [ cfg.package ];
launchd.user.agents.gnupg-agent.serviceConfig = {
ProgramArguments = [
(getExe' cfg.package "gpg-connect-agent")
"/bye"
];
RunAtLoad = cfg.agent.enableSSHSupport;
KeepAlive.SuccessfulExit = false;
};
environment.extraInit = ''
# Bind gpg-agent to this TTY if gpg commands are used.
export GPG_TTY=$(tty)
''
+ (optionalString cfg.agent.enableSSHSupport ''
# SSH agent protocol doesn't support changing TTYs, so bind the agent
# to every new TTY.
${getExe' cfg.package "gpg-connect-agent"} --quiet updatestartuptty /bye > /dev/null 2>&1
export SSH_AUTH_SOCK=$(${getExe' cfg.package "gpgconf"} --list-dirs agent-ssh-socket)
'');
};
}
+35
View File
@@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.info;
in
{
options = {
programs.info.enable = mkOption {
type = types.bool;
default = true;
description = "Whether to enable info pages and the {command}`info` command.";
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.texinfoInteractive ];
environment.pathsToLink = [ "/info" "/share/info" ];
environment.extraOutputsToInstall = [ "info" ];
environment.extraSetup = ''
if test -w $out/share/info; then
shopt -s nullglob
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
${pkgs.texinfoInteractive}/bin/install-info $i $out/share/info/dir
done
fi
'';
};
}
+2 -2
View File
@@ -9,8 +9,8 @@ with lib;
type = types.bool;
default = true;
description = ''
Whether to enable manual pages and the <command>man</command> command.
This also includes "man" outputs of all <literal>systemPackages</literal>.
Whether to enable manual pages and the {command}`man` command.
This also includes "man" outputs of all `systemPackages`.
'';
};
+33
View File
@@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.nix-index;
in
{
options = {
programs.nix-index.enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable nix-index and its command-not-found helper.";
};
programs.nix-index.package = mkOption {
type = types.package;
default = pkgs.nix-index;
defaultText = "pkgs.nix-index";
description = "This option specifies the nix-index package to use.";
};
};
config = mkIf config.programs.nix-index.enable {
environment.systemPackages = [ cfg.package ];
environment.interactiveShellInit = "source ${cfg.package}/etc/profile.d/command-not-found.sh";
};
}
-47
View File
@@ -1,47 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.nix-script;
nix-script = pkgs.substituteAll {
inherit (cfg) name;
src = ../../pkgs/nix-tools/nix-script.sh;
dir = "bin";
isExecutable = true;
};
in
{
options = {
programs.nix-script.enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the nix script.
'';
};
programs.nix-script.name = mkOption {
type = types.str;
default = "nix";
description = ''
Name to use for the nix script.
'';
};
};
config = mkIf cfg.enable {
environment.systemPackages =
[ # Nix wrapper script
nix-script
];
};
}
+200
View File
@@ -0,0 +1,200 @@
{ config, lib, ... }:
let
cfg = config.programs.ssh;
knownHosts = builtins.attrValues cfg.knownHosts;
host =
{ name, config, ... }:
{
options = {
certAuthority = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
This public key is an SSH certificate authority, rather than an
individual host's key.
'';
};
hostNames = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ name ] ++ config.extraHostNames;
description = ''
The set of system-wide known SSH hosts. To make simple setups more
convenient the name of an attribute in this set is used as a host name
for the entry. This behaviour can be disabled by setting
`hostNames` explicitly. You can use
`extraHostNames` to add additional host names without
disabling this default.
'';
};
extraHostNames = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = ''
A list of additional host names and/or IP numbers used for
accessing the host's ssh service. This list is ignored if
`hostNames` is set explicitly.
'';
};
publicKey = lib.mkOption {
default = null;
type = lib.types.nullOr lib.types.str;
example = "ecdsa-sha2-nistp521 AAAAE2VjZHN...UEPg==";
description = ''
The public key data for the host. You can fetch a public key
from a running SSH server with the {command}`ssh-keyscan`
command. The public key should not include any host names, only
the key type and the key itself.
'';
};
publicKeyFile = lib.mkOption {
default = null;
type = lib.types.nullOr lib.types.path;
description = ''
The path to the public key file for the host. The public
key file is read at build time and saved in the Nix store.
You can fetch a public key file from a running SSH server
with the {command}`ssh-keyscan` command. The content
of the file should follow the same format as described for
the `publicKey` option.
'';
};
};
};
# Taken from: https://github.com/NixOS/nixpkgs/blob/f4aa6afa5f934ece2d1eb3157e392d056be01617/nixos/modules/services/networking/ssh/sshd.nix#L46-L93
userOptions = {
options.openssh.authorizedKeys = {
keys = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = ''
A list of verbatim OpenSSH public keys that should be added to the
user's authorized keys. The keys are added to a file that the SSH
daemon reads in addition to the the user's authorized_keys file.
You can combine the `keys` and
`keyFiles` options.
Warning: If you are using `NixOps` then don't use this
option since it will replace the key required for deployment via ssh.
'';
};
keyFiles = lib.mkOption {
type = lib.types.listOf lib.types.path;
default = [];
description = ''
A list of files each containing one OpenSSH public key that should be
added to the user's authorized keys. The contents of the files are
read at build time and added to a file that the SSH daemon reads in
addition to the the user's authorized_keys file. You can combine the
`keyFiles` and `keys` options.
'';
};
};
};
authKeysFiles = let
mkAuthKeyFile = u: lib.nameValuePair "ssh/nix_authorized_keys.d/${u.name}" {
text = ''
${builtins.concatStringsSep "\n" u.openssh.authorizedKeys.keys}
${lib.concatMapStrings (f: builtins.readFile f + "\n") u.openssh.authorizedKeys.keyFiles}
'';
};
usersWithKeys = builtins.attrValues (lib.flip lib.filterAttrs config.users.users (n: u:
lib.length u.openssh.authorizedKeys.keys != 0 || lib.length u.openssh.authorizedKeys.keyFiles != 0
));
in lib.listToAttrs (map mkAuthKeyFile usersWithKeys);
oldAuthorizedKeysHash = "5a5dc1e20e8abc162ad1cc0259bfd1dbb77981013d87625f97d9bd215175fc0a";
in
{
imports = [
(lib.mkRemovedOptionModule [ "services" "openssh" "authorizedKeysFiles" ] "No `nix-darwin` equivalent to this NixOS option.")
];
options = {
users.users = lib.mkOption {
type = with lib.types; attrsOf (submodule userOptions);
};
programs.ssh.extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
description = ''
Extra configuration text loaded in {file}`ssh_config`.
See {manpage}`ssh_config(5)` for help.
'';
};
programs.ssh.knownHosts = lib.mkOption {
default = {};
type = lib.types.attrsOf (lib.types.submodule host);
description = ''
The set of system-wide known SSH hosts. To make simple setups more
convenient the name of an attribute in this set is used as a host name
for the entry. This behaviour can be disabled by setting
`hostNames` explicitly. You can use
`extraHostNames` to add additional host names without
disabling this default.
'';
example = lib.literalExpression ''
{
myhost = {
extraHostNames = [ "myhost.mydomain.com" "10.10.1.4" ];
publicKeyFile = ./pubkeys/myhost_ssh_host_dsa_key.pub;
};
"myhost2.net".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILIRuJ8p1Fi+m6WkHV0KWnRfpM1WxoW8XAS+XvsSKsTK";
"myhost2.net/dsa" = {
hostNames = [ "myhost2.net" ];
publicKeyFile = ./pubkeys/myhost2_ssh_host_dsa_key.pub;
};
}
'';
};
};
config = {
assertions = lib.flip lib.mapAttrsToList cfg.knownHosts (name: data: {
assertion = (data.publicKey == null && data.publicKeyFile != null) ||
(data.publicKey != null && data.publicKeyFile == null);
message = "knownHost ${name} must contain either a publicKey or publicKeyFile";
});
environment.etc = authKeysFiles //
{ "ssh/ssh_known_hosts" = lib.mkIf (builtins.length knownHosts > 0) {
text = (lib.flip (lib.concatMapStringsSep "\n") knownHosts
(h: assert h.hostNames != [];
lib.optionalString h.certAuthority "@cert-authority " + builtins.concatStringsSep "," h.hostNames + " "
+ (if h.publicKey != null then h.publicKey else builtins.readFile h.publicKeyFile)
)) + "\n";
};
"ssh/ssh_config.d/100-nix-darwin.conf".text = config.programs.ssh.extraConfig;
"ssh/sshd_config.d/101-authorized-keys.conf" = {
text = ''
# sshd doesn't like reading from symbolic links, so we cat
# the file ourselves.
AuthorizedKeysCommand /bin/cat /etc/ssh/nix_authorized_keys.d/%u
# Just a simple cat, fine to use _sshd.
AuthorizedKeysCommandUser _sshd
'';
# Allows us to automatically migrate from using a file to a symlink
knownSha256Hashes = [ oldAuthorizedKeysHash ];
};
};
system.activationScripts.etc.text = ''
# Clean up .before-nix-darwin file left over from using knownSha256Hashes
auth_keys_orig=/etc/ssh/sshd_config.d/101-authorized-keys.conf.before-nix-darwin
if [ -e "$auth_keys_orig" ] && [ "$(shasum -a 256 $auth_keys_orig | cut -d ' ' -f 1)" = "${oldAuthorizedKeysHash}" ]; then
rm "$auth_keys_orig"
fi
'';
};
}
+44 -30
View File
@@ -3,7 +3,6 @@
with lib;
let
inherit (pkgs) stdenv;
cfg = config.programs.tmux;
@@ -19,6 +18,7 @@ let
--set __ETC_ZPROFILE_SOURCED "" \
--set __ETC_ZSHENV_SOURCED "" \
--set __ETC_ZSHRC_SOURCED "" \
--set __NIX_DARWIN_SET_ENVIRONMENT_DONE "" \
--add-flags -f --add-flags /etc/tmux.conf
'';
@@ -36,24 +36,35 @@ let
session=$(tmux list-sessions -F '#{session_name}' | fzf --query="$1" --exit-0)
tmux switch-client -t "$session"
'';
in
in {
{
imports = [
(mkRenamedOptionModule [ "programs" "tmux" "tmuxConfig" ] [ "programs" "tmux" "extraConfig" ])
(mkRemovedOptionModule [ "programs" "tmux" "defaultCommand" ] "Use `programs.tmux.extraConfig` to configure the default command instead. If unset, tmux will default to using your system configured login shell.")
];
options = {
programs.tmux.enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to configure tmux.
'';
description = "Whether to configure tmux.";
};
programs.tmux.enableSensible = mkOption {
type = types.bool;
default = false;
example = true;
description = "Enable sensible configuration options for tmux.";
};
programs.tmux.reverseSplitBindings = mkOption {
type = types.bool;
default = config.system.stateVersion <= 6 && cfg.enableSensible;
defaultText = literalExpression "config.system.stateVersion <= 6 && config.programs.tmux.enableSensible";
example = true;
description = ''
Enable sensible configuration options for tmux.
Whether to reverse the `%` and `"` split-window key bindings
emitted by the tmux module.
'';
};
@@ -61,27 +72,28 @@ in {
type = types.bool;
default = false;
example = true;
description = ''
Enable mouse support for tmux.
'';
description = "Enable mouse support for tmux.";
};
programs.tmux.enableFzf = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable fzf keybindings for selecting tmux sessions and panes.
'';
description = "Enable fzf keybindings for selecting tmux sessions and panes.";
};
programs.tmux.enableVim = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable vim style keybindings for copy mode, and navigation of tmux panes.
'';
description = "Enable vim style keybindings for copy mode, and navigation of tmux panes.";
};
programs.tmux.iTerm2 = mkOption {
type = types.bool;
default = false;
example = true;
description = "Cater to iTerm2 and its tmux integration, as appropriate.";
};
programs.tmux.tmuxOptions = mkOption {
@@ -90,15 +102,19 @@ in {
default = {};
};
programs.tmux.tmuxConfig = mkOption {
programs.tmux.extraConfig = mkOption {
type = types.lines;
default = "";
description = "Extra configuration to add to {file}`tmux.conf`.";
};
};
config = mkIf cfg.enable {
warnings = mkIf cfg.iTerm2 [
"The programs.tmux.iTerm2 is no longer needed and doesn't do anything anymore"
];
environment.systemPackages =
[ # Include wrapped tmux package.
tmux
@@ -106,17 +122,11 @@ in {
environment.etc."tmux.conf".text = ''
${tmuxOptions}
${cfg.tmuxConfig}
${cfg.extraConfig}
source-file -q /etc/tmux.conf.local
'';
programs.tmux.tmuxOptions.login-shell.text = if stdenv.isDarwin then ''
set -g default-command "${pkgs.reattach-to-user-namespace}/bin/reattach-to-user-namespace ${config.environment.loginShell}"
'' else ''
set -g default-command "${config.environment.loginShell}"
'';
programs.tmux.tmuxOptions.sensible.text = mkIf cfg.enableSensible ''
set -g default-terminal "screen-256color"
setw -g aggressive-resize on
@@ -128,8 +138,6 @@ in {
set -s escape-time 0
bind c new-window -c '#{pane_current_path}'
bind % split-window -v -c '#{pane_current_path}'
bind '"' split-window -h -c '#{pane_current_path}'
# TODO: make these interactive
bind C new-session
@@ -139,6 +147,11 @@ in {
# set -g utf8 on
'';
programs.tmux.tmuxOptions.splitBindings.text = mkIf cfg.reverseSplitBindings ''
bind % split-window -v -c '#{pane_current_path}'
bind '"' split-window -h -c '#{pane_current_path}'
'';
programs.tmux.tmuxOptions.mouse.text = mkIf cfg.enableMouse ''
set -g mouse on
setw -g mouse on
@@ -160,11 +173,12 @@ in {
bind s split-window -v -c '#{pane_current_path}'
bind v split-window -h -c '#{pane_current_path}'
bind -t vi-copy v begin-selection
bind-key -T copy-mode-vi p send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
bind-key -T copy-mode-vi v send-keys -X begin-selection
'' + optionalString stdenv.isLinux ''
bind -t vi-copy y copy-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
'' + optionalString stdenv.isDarwin ''
bind -t vi-copy y copy-pipe "${pkgs.reattach-to-user-namespace}/bin/reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
'');
};
+25 -32
View File
@@ -3,49 +3,35 @@
with lib;
let
cfg = config.programs.vim;
vim = pkgs.vim_configurable.customize {
name = "vim";
vimrcConfig.customRC = config.environment.etc."vimrc".text;
vimrcConfig.vam = {
knownPlugins = pkgs.vimPlugins // cfg.extraKnownPlugins;
pluginDictionaries = cfg.plugins;
};
};
text = import ../lib/write-text.nix {
inherit lib;
mkTextDerivation = name: text: pkgs.writeText "vim-options-${name}" text;
};
vimOptions = concatMapStringsSep "\n" (attr: attr.text) (attrValues cfg.vimOptions);
in
in {
{
options = {
programs.vim.enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to configure vim.
'';
description = "Whether to configure vim.";
};
programs.vim.enableSensible = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable sensible configuration options for vim.
'';
description = "Enable sensible configuration options for vim.";
};
programs.vim.extraKnownPlugins = mkOption {
type = types.attrsOf types.package;
default = {};
example = literalExample
example = literalExpression
''
{
vim-jsx = pkgs.vimUtils.buildVimPluginFrom2Nix {
@@ -60,18 +46,19 @@ in {
};
}
'';
description = ''
Custom plugin declarations to add to VAM's knownPlugins.
'';
description = "Custom plugin declarations to add to VAM's knownPlugins.";
};
programs.vim.plugins = mkOption {
type = types.listOf types.attrs;
default = [];
example = [ { names = [ "surround" "vim-nix" ]; } ];
description = ''
VAM plugin dictionaries to use for vim_configurable.
'';
description = "VAM plugin dictionaries to use for vim_configurable.";
};
programs.vim.package = mkOption {
internal = true;
type = types.package;
};
programs.vim.vimOptions = mkOption {
@@ -83,21 +70,18 @@ in {
programs.vim.vimConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra vimrcConfig to use for vim_configurable.
'';
description = "Extra vimrcConfig to use for vim_configurable.";
};
};
config = mkIf cfg.enable {
environment.systemPackages =
[ # Include vim_configurable package.
vim
[ # Include vim-full package.
cfg.package
];
environment.variables.EDITOR = "${vim}/bin/vim";
environment.variables.EDITOR = "${cfg.package}/bin/vim";
environment.etc."vimrc".text = ''
${vimOptions}
@@ -108,6 +92,15 @@ in {
endif
'';
programs.vim.package = pkgs.vim-full.customize {
name = "vim";
vimrcConfig.customRC = config.environment.etc."vimrc".text;
vimrcConfig.vam = {
knownPlugins = pkgs.vimPlugins // cfg.extraKnownPlugins;
pluginDictionaries = cfg.plugins;
};
};
programs.vim.plugins = mkIf cfg.enableSensible [
{ names = [ "fugitive" "surround" "vim-nix" ]; }
];
+103 -45
View File
@@ -1,36 +1,24 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.programs.zsh;
opt = options.programs.zsh;
zshVariables =
mapAttrsToList (n: v: ''${n}="${v}"'') cfg.variables;
fzfCompletion = "${pkgs.fzf.src}/shell/completion.zsh";
fzfCompletion = ./fzf-completion.zsh;
fzfGit = ./fzf-git.zsh;
fzfHistory = ./fzf-history.zsh;
shell = pkgs.runCommand pkgs.zsh.name
{ buildInputs = [ pkgs.makeWrapper ]; }
''
source $stdenv/setup
mkdir -p $out/bin
makeWrapper ${pkgs.zsh}/bin/zsh $out/bin/zsh
'';
in
{
options = {
programs.zsh.enable = mkOption {
type = types.bool;
default = false;
default = true;
description = "Whether to configure zsh as an interactive shell.";
};
@@ -67,10 +55,22 @@ in
programs.zsh.promptInit = mkOption {
type = types.lines;
default = "autoload -U promptinit && promptinit && prompt walters";
default = "autoload -U promptinit && promptinit && prompt suse && setopt prompt_sp";
description = "Shell script code used to initialise the zsh prompt.";
};
programs.zsh.histSize = mkOption {
type = types.int;
default = 2000;
description = "Change history size.";
};
programs.zsh.histFile = mkOption {
type = types.str;
default = "$HOME/.zsh_history";
description = "Change history file.";
};
programs.zsh.enableCompletion = mkOption {
type = types.bool;
default = true;
@@ -83,6 +83,19 @@ in
description = "Enable bash completion for all interactive zsh shells.";
};
programs.zsh.enableGlobalCompInit = mkOption {
type = types.bool;
default = cfg.enableCompletion;
defaultText = literalExpression "config.${opt.enableCompletion}";
description = ''
Enable execution of compinit call for all interactive zsh shells.
This option can be disabled if the user wants to extend its
`fpath` and a custom `compinit`
call in the local config is required.
'';
};
programs.zsh.enableFzfCompletion = mkOption {
type = types.bool;
default = false;
@@ -101,37 +114,59 @@ in
description = "Enable fzf keybinding for Ctrl-r history search.";
};
programs.zsh.enableAutosuggestions = mkOption {
type = types.bool;
default = false;
description = "Enable zsh-autosuggestions.";
};
programs.zsh.enableSyntaxHighlighting = mkOption {
type = types.bool;
default = false;
description = "Enable zsh-syntax-highlighting.";
};
programs.zsh.enableFastSyntaxHighlighting = mkEnableOption "zsh-fast-syntax-highlighting";
};
config = mkIf cfg.enable {
assertions = [
{
assertion = !(cfg.enableSyntaxHighlighting && cfg.enableFastSyntaxHighlighting);
message = "zsh-syntax-highlighting and zsh-fast-syntax-highlighting are mutually exclusive, please disable one of them.";
}
];
environment.systemPackages =
[ # Include zsh package
pkgs.zsh
] ++ optional cfg.enableCompletion pkgs.nix-zsh-completions
++ optional cfg.enableSyntaxHighlighting pkgs.zsh-syntax-highlighting;
++ optional cfg.enableAutosuggestions pkgs.zsh-autosuggestions
++ optional cfg.enableSyntaxHighlighting pkgs.zsh-syntax-highlighting
++ optional cfg.enableFastSyntaxHighlighting pkgs.zsh-fast-syntax-highlighting;
environment.pathsToLink = [ "/share/zsh" ];
environment.loginShell = mkDefault "${shell}/bin/zsh -l";
environment.variables.SHELL = mkDefault "${shell}/bin/zsh";
environment.etc."zshenv".text = ''
# /etc/zshenv: DO NOT EDIT -- this file has been generated automatically.
# This file is read for all shells.
# Only execute this file once per shell.
# But don't clobber the environment of interactive non-login children!
if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi
export __ETC_ZSHENV_SOURCED=1
if [ -n "''${__ETC_ZSHENV_SOURCED-}" ]; then return; fi
__ETC_ZSHENV_SOURCED=1
${cfg.shellInit}
if [[ -o rcs ]]; then
if [ -z "''${__NIX_DARWIN_SET_ENVIRONMENT_DONE-}" ]; then
. ${config.system.build.setEnvironment}
fi
# Tell zsh how to find installed completions
for p in ''${(z)NIX_PROFILES}; do
fpath=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions $fpath)
done
${cfg.shellInit}
fi
# Read system-wide modifications.
if test -f /etc/zshenv.local; then
@@ -144,10 +179,11 @@ in
# This file is read for login shells.
# Only execute this file once per shell.
if [ -n "$__ETC_ZPROFILE_SOURCED" ]; then return; fi
if [ -n "''${__ETC_ZPROFILE_SOURCED-}" ]; then return; fi
__ETC_ZPROFILE_SOURCED=1
${concatStringsSep "\n" zshVariables}
${config.system.build.setAliases.text}
${cfg.loginShellInit}
@@ -161,43 +197,43 @@ in
# /etc/zshrc: DO NOT EDIT -- this file has been generated automatically.
# This file is read for interactive shells.
bindkey -e
${optionalString cfg.enableFzfCompletion "source ${fzfCompletion}"}
${optionalString cfg.enableFzfGit "source ${fzfGit}"}
${optionalString cfg.enableFzfHistory "source ${fzfHistory}"}
# Only execute this file once per shell.
if [ -n "$__ETC_ZSHRC_SOURCED" -o -n "$NOSYSZSHRC" ]; then return; fi
__ETC_ZSHRC_SOURCED=1
# history defaults
SAVEHIST=2000
HISTSIZE=2000
HISTFILE=$HOME/.zsh_history
# Setup command line history.
# Don't export these, otherwise other shells (bash) will try to use same HISTFILE.
SAVEHIST=${builtins.toString cfg.histSize}
HISTSIZE=${builtins.toString cfg.histSize}
HISTFILE=${cfg.histFile}
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
export PATH=${config.environment.systemPath}
${config.system.build.setEnvironment}
${config.system.build.setAliases}
bindkey -e
${config.environment.extraInit}
${config.environment.interactiveShellInit}
${cfg.interactiveShellInit}
${cfg.promptInit}
# Tell zsh how to find installed completions
for p in ''${(z)NIX_PROFILES}; do
fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions)
done
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
${optionalString cfg.enableGlobalCompInit "autoload -U compinit && compinit"}
${optionalString cfg.enableBashCompletion "autoload -U bashcompinit && bashcompinit"}
${optionalString cfg.enableAutosuggestions
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
}
${optionalString cfg.enableSyntaxHighlighting
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
}
${optionalString cfg.enableFastSyntaxHighlighting
"source ${pkgs.zsh-fast-syntax-highlighting}/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
}
${optionalString cfg.enableFzfCompletion "source ${fzfCompletion}"}
${optionalString cfg.enableFzfGit "source ${fzfGit}"}
${optionalString cfg.enableFzfHistory "source ${fzfHistory}"}
# Read system-wide modifications.
if test -f /etc/zshrc.local; then
@@ -205,5 +241,27 @@ in
fi
'';
environment.etc."zprofile".knownSha256Hashes = [
"db8422f92d8cff684e418f2dcffbb98c10fe544b5e8cd588b2009c7fa89559c5"
"0235d3c1b6cf21e7043fbc98e239ee4bc648048aafaf6be1a94a576300584ef2" # macOS
"f320016e2cf13573731fbee34f9fe97ba867dd2a31f24893d3120154e9306e92" # macOS 26b1 and higher
];
environment.etc."zshrc".knownSha256Hashes = [
"19a2d673ffd47b8bed71c5218ff6617dfc5e8533b240b9ba79142a45f8823c23"
"fb5827cb4712b7e7932d438067ec4852c8955a9ff0f55e282473684623ebdfa1" # macOS
"4d1ab5704f9d167a042fecac0d056c8a79a8ebd71e032d3489536c8db9ffe3e0" # macOS 26b1 and higher
"c5a00c072c920f46216454978c44df044b2ec6d03409dc492c7bdcd92c94a110" # official Nix installer
"40b0d8751adae5b0100a4f863be5b75613a49f62706427e92604f7e04d2e2261" # official Nix installer
"bf76c5ed8e65e616f4329eccf662ee91be33b8bfd33713ce9946f2fe94fea7fa" # official Nix installer (macOS 26b1 and higher)
"2af1b563e389d11b76a651b446e858116d7a20370d9120a7e9f78991f3e5f336" # DeterminateSystems installer
"27274e44b88a1174787f9a3d437d3387edc4f9aaaf40356054130797f5dc7912" # DeterminateSystems installer (macOS 26b1 and higher)
];
environment.etc."zshenv".knownSha256Hashes = [
"d07015be6875f134976fce84c6c7a77b512079c1c5f9594dfa65c70b7968b65f" # DeterminateSystems installer
"4e8f7cb9b699511f4ba5f9d5f8de1c9f5efb5c607de88faf5f58b8b9cb38edbf" # experimental official Nix installer 2.33.3
];
};
}
+231
View File
@@ -0,0 +1,231 @@
# ____ ____
# / __/___ / __/
# / /_/_ / / /_
# / __/ / /_/ __/
# /_/ /___/_/-completion.zsh
#
# - $FZF_TMUX (default: 0)
# - $FZF_TMUX_HEIGHT (default: '40%')
# - $FZF_COMPLETION_TRIGGER (default: '**')
# - $FZF_COMPLETION_OPTS (default: empty)
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
if ! declare -f _fzf_compgen_path > /dev/null; then
_fzf_compgen_path() {
echo "$1"
command find -L "$1" \
-name .git -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \
-a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
}
fi
if ! declare -f _fzf_compgen_dir > /dev/null; then
_fzf_compgen_dir() {
command find -L "$1" \
-name .git -prune -o -name .svn -prune -o -type d \
-a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
}
fi
###########################################################
__fzfcmd_complete() {
[ -n "$TMUX_PANE" ] && [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] &&
echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
}
__fzf_generic_path_completion() {
local base lbuf compgen fzf_opts suffix tail fzf dir leftover matches
# (Q) flag removes a quoting level: "foo\ bar" => "foo bar"
base=${(Q)1}
lbuf=$2
compgen=$3
fzf_opts=$4
suffix=$5
tail=$6
fzf="$(__fzfcmd_complete)"
setopt localoptions nonomatch
dir="$base"
while [ 1 ]; do
if [[ -z "$dir" || -d ${~dir} ]]; then
leftover=${base/#"$dir"}
leftover=${leftover/#\/}
[ -z "$dir" ] && dir='.'
[ "$dir" != "/" ] && dir="${dir/%\//}"
dir=${~dir}
matches=$(eval "$compgen $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS" ${=fzf} ${=fzf_opts} -q "$leftover" | while read item; do
echo -n "${(q)item}$suffix "
done)
matches=${matches% }
if [ -n "$matches" ]; then
LBUFFER="$lbuf$matches$tail"
fi
zle redisplay
typeset -f zle-line-init >/dev/null && zle zle-line-init
break
fi
dir=$(dirname "$dir")
dir=${dir%/}/
done
}
_fzf_path_completion() {
__fzf_generic_path_completion "$1" "$2" _fzf_compgen_path \
"-m" "" " "
}
_fzf_dir_completion() {
__fzf_generic_path_completion "$1" "$2" _fzf_compgen_dir \
"" "/" ""
}
_fzf_feed_fifo() (
command rm -f "$1"
mkfifo "$1"
cat <&0 > "$1" &
)
_fzf_complete() {
local fifo fzf_opts lbuf fzf matches post
fifo="${TMPDIR:-/tmp}/fzf-complete-fifo-$$"
fzf_opts=$1
lbuf=$2
post="${funcstack[2]}_post"
type $post > /dev/null 2>&1 || post=cat
fzf="$(__fzfcmd_complete)"
_fzf_feed_fifo "$fifo"
matches=$(cat "$fifo" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS" ${=fzf} ${=fzf_opts} -q "${(Q)prefix}" | $post | tr '\n' ' ')
if [ -n "$matches" ]; then
LBUFFER="$lbuf$matches"
fi
zle redisplay
typeset -f zle-line-init >/dev/null && zle zle-line-init
command rm -f "$fifo"
}
_fzf_complete_docker() {
local cmd
cmd=${tokens[2]}
case $cmd in
image|push|rmi|run)
FZF_DEFAULT_OPTS="--min-height 15 $FZF_DEFAULT_OPTS --preview 'docker ps -af ancestor={+3} -n 4' --preview-window down:5:wrap" \
_fzf_complete '-m --header-lines=1' "$@" < <(docker images)
;;
*)
FZF_DEFAULT_OPTS="--min-height 15 $FZF_DEFAULT_OPTS --preview 'docker logs --tail=5 {+1}' --preview-window down:5:wrap" \
_fzf_complete '-m --header-lines=1' "$@" < <(docker ps --all)
;;
esac
}
_fzf_complete_docker_post() {
local cmd
cmd=${tokens[2]}
case $cmd in
image|push|rmi|run) awk '{ print ($2 == "<none>") ? $3 : $1 ":" $2}' ;;
*) awk '{print $NF}' ;;
esac
}
_fzf_complete_git() {
FZF_DEFAULT_OPTS="--min-height 15 $FZF_DEFAULT_OPTS --preview 'git log -5 --oneline {+1}' --preview-window down:5:wrap" \
_fzf_complete '-m' "$@" < <(git branch -v)
}
_fzf_complete_git_post() {
awk '{print $1}'
}
_fzf_complete_telnet() {
_fzf_complete '+m' "$@" < <(
command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0' |
awk '{if (length($2) > 0) {print $2}}' | sort -u
)
}
_fzf_complete_kill() {
FZF_DEFAULT_OPTS="--min-height 15 $FZF_DEFAULT_OPTS --preview 'echo {}' --preview-window down:3:wrap" \
_fzf_complete '-m --header-lines 1' "$@" < <(command ps -ef -r)
}
_fzf_complete_kill_post() {
awk '{print $2}'
}
_fzf_complete_ssh() {
_fzf_complete '+m' "$@" < <(
command cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host' | command grep -v '*') \
<(command grep -oE '^[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \
<(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |
awk '{if (length($2) > 0) {print $2}}' | sort -u
)
}
_fzf_complete_export() {
_fzf_complete '-m' "$@" < <(
declare -xp | sed 's/=.*//' | sed 's/.* //'
)
}
_fzf_complete_unset() {
_fzf_complete '-m' "$@" < <(
declare -xp | sed 's/=.*//' | sed 's/.* //'
)
}
_fzf_complete_unalias() {
_fzf_complete '+m' "$@" < <(
alias | sed 's/=.*//'
)
}
fzf-completion() {
local tokens cmd prefix trigger tail fzf matches lbuf d_cmds
setopt localoptions noshwordsplit noksh_arrays noposixbuiltins
# http://zsh.sourceforge.net/FAQ/zshfaq03.html
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
tokens=(${(z)LBUFFER})
if [ ${#tokens} -lt 1 ]; then
zle ${fzf_default_completion:-expand-or-complete}
return
fi
cmd=${tokens[1]}
# Explicitly allow for empty trigger.
trigger=${FZF_COMPLETION_TRIGGER-'**'}
[ -z "$trigger" -a ${LBUFFER[-1]} = ' ' ] && tokens+=("")
tail=${LBUFFER:$(( ${#LBUFFER} - ${#trigger} ))}
# Trigger sequence given
if [ ${#tokens} -gt 1 -a "$tail" = "$trigger" ]; then
d_cmds=(${=FZF_COMPLETION_DIR_COMMANDS:-cd pushd rmdir})
[ -z "$trigger" ] && prefix=${tokens[-1]} || prefix=${tokens[-1]:0:-${#trigger}}
[ -z "${tokens[-1]}" ] && lbuf=$LBUFFER || lbuf=${LBUFFER:0:-${#tokens[-1]}}
if eval "type _fzf_complete_${cmd} > /dev/null"; then
eval "prefix=\"$prefix\" _fzf_complete_${cmd} \"$lbuf\""
elif [ ${d_cmds[(i)$cmd]} -le ${#d_cmds} ]; then
_fzf_dir_completion "$prefix" "$lbuf"
else
_fzf_path_completion "$prefix" "$lbuf"
fi
# Fall back to default completion
else
zle ${fzf_default_completion:-expand-or-complete}
fi
}
[ -z "$fzf_default_completion" ] && {
binding=$(bindkey '^I')
[[ $binding =~ 'undefined-key' ]] || fzf_default_completion=$binding[(s: :w)2]
unset binding
}
zle -N fzf-completion
bindkey '^I' fzf-completion
-37
View File
@@ -1,37 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.security;
runSQL = sql: ''/usr/bin/sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "${sql}"'';
allowAccess = client: runSQL ''INSERT or REPLACE INTO access VALUES ('kTCCServiceAccessibility','${client}',1,1,1,NULL,NULL)'';
revokeAccess = clients: runSQL ''DELETE FROM access WHERE client LIKE '/nix/store/%' AND client NOT IN (${concatMapStringsSep "," (s: "'${s}'") clients})'';
in
{
options = {
security.accessibilityPrograms = mkOption {
type = types.listOf types.path;
default = [];
example = literalExample ''[ ''${pkgs.hello}/bin/hello" ]'';
description = "List of nix programs that are allowed control through the accessibility APIs.";
};
};
config = {
system.activationScripts.accessibility.text = ''
# Set up programs that require accessibility permissions
echo "setting up accessibility programs..." >&2
${revokeAccess cfg.accessibilityPrograms}
${concatMapStringsSep "\n" allowAccess cfg.accessibilityPrograms}
'';
};
}

Some files were not shown because too many files have changed in this diff Show More