From 8feaad40a1c43454e6f6adf2b72330ec7cb5ea2c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jul 2024 12:19:18 +0200 Subject: [PATCH 1/7] refactor: rename 'fonts' to 'packages' in darwin module This commit renames the 'fonts' array in the darwin system fonts module to 'packages'. The refactor is aimed at improving the code readability and making the name more descriptive and representative of its content. --- modules/darwin/system/fonts/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/darwin/system/fonts/default.nix b/modules/darwin/system/fonts/default.nix index 0c90510..f8eecf8 100644 --- a/modules/darwin/system/fonts/default.nix +++ b/modules/darwin/system/fonts/default.nix @@ -17,9 +17,7 @@ in }; fonts = { - fontDir = enabled; - - fonts = with pkgs; + packages = with pkgs; [ noto-fonts noto-fonts-cjk-sans From 8202390990274b6c7775953d3c8ac2edb6cb5815 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jul 2024 12:19:28 +0200 Subject: [PATCH 2/7] feat: switch to stable nix package in darwin module This commit modifies the `nix` configuration in the `darwin` module, changing from the unstable `nix` package use to the stable version. This change is intended to improve stability and reliability of the module. --- modules/darwin/nix/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/darwin/nix/default.nix b/modules/darwin/nix/default.nix index ea488df..50bc1b4 100644 --- a/modules/darwin/nix/default.nix +++ b/modules/darwin/nix/default.nix @@ -11,7 +11,7 @@ in { options.metacfg.nix = with types; { enable = mkBoolOpt true "Whether or not to manage nix configuration."; - package = mkOpt package pkgs.nixUnstable "Which nix package to use."; + package = mkOpt package pkgs.nix "Which nix package to use."; }; config = mkIf cfg.enable { From 9131236f368420ae9d22b6b0dcf52beb168bdb65 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jul 2024 12:19:43 +0200 Subject: [PATCH 3/7] docs: update command syntax in README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace `❯` prompt symbol with `$` for clarity and consistency. Add additional command for Darwin. Remove outdated `command-not-found` section. Update nix and ssh command syntax for better readability and usage. --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 901c6fc..3274c0e 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,29 @@ Install a system via nixos-anywhere ```bash -❯ nix run github:numtide/nixos-anywhere -- \ +$ nix run github:numtide/nixos-anywhere -- \ --flake 'git+https://git.hoyer.xyz/harald/nixcfg'.#hostname \ root@hostname --no-reboot --tty -i $HOME/.ssh/id_ed25519 ... enter disk password -❯ ssh -t root@hostname systemd-cryptenroll /dev/luksdev --wipe-slot=tpm2 --tpm2-device=auto --tpm2-pcrs=1,15 +$ ssh -t root@hostname systemd-cryptenroll /dev/luksdev --wipe-slot=tpm2 --tpm2-device=auto --tpm2-pcrs=1,15 ``` nixos-rebuild remote git flake ```bash -❯ sudo nixos-rebuild boot --refresh --flake git+https://git.hoyer.xyz/harald/nixcfg +$ nixos-rebuild --use-remote-sudo -L --show-trace --refresh --flake git+https://git.hoyer.xyz/harald/nixcfg boot ``` +on darwin + +```bash +$ darwin-rebuild --use-remote-sudo -L --show-trace --refresh --flake git+https://git.hoyer.xyz/harald/nixcfg switch +``` + home-manager remote git flake ```bash -❯ nix --refresh run 'git+https://git.hoyer.xyz/harald/nixcfg' -- \ +$ nix --refresh run 'git+https://git.hoyer.xyz/harald/nixcfg' -- \ switch -b backup --flake 'git+https://git.hoyer.xyz/harald/nixcfg' ``` -`command-not-found` unable to open database - -```bash -❯ sudo nix-channel --update -``` From 5d9518fd1c526dbc35878f0c79135f616ebdefb1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jul 2024 13:28:03 +0200 Subject: [PATCH 4/7] feat: Add new base service config for Darwin system This commit introduces a new base configuration for the Darwin service. It includes options for system packages, shell programs and security features. This base configuration is customizable with an enable option. --- modules/darwin/services/base/default.nix | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 modules/darwin/services/base/default.nix diff --git a/modules/darwin/services/base/default.nix b/modules/darwin/services/base/default.nix new file mode 100644 index 0000000..eb10d63 --- /dev/null +++ b/modules/darwin/services/base/default.nix @@ -0,0 +1,57 @@ +{ options +, config +, lib +, pkgs +, ... +}: +with lib; +with lib.metacfg; +let + cfg = config.metacfg.base; +in +{ + options.metacfg.base = with types; { + enable = mkBoolOpt false "Whether or not to enable the base config."; + + }; + + config = mkIf cfg.enable { + environment = { + systemPackages = with pkgs; [ + age + delta + git + git-crypt + git-delete-merged-branches + home-manager + htop + mosh + nixpkgs-fmt + openssl + restic + rrsync + sops + tmux + vim + wget + starship + ]; + shells = [ pkgs.fish pkgs.bash ]; + }; + + programs = { + bash = { + ## shellInit = '' + interactiveShellInit = '' + bind '"\e[A": history-search-backward' + bind '"\e[B": history-search-forward' + ''; + }; + fish.enable = true; + }; + + security = { + pam.enableSudoTouchIdAuth = true; + }; + }; +} From b14804bbf8c2ad6282e9841cfc0158f2d14056ac Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jul 2024 13:28:14 +0200 Subject: [PATCH 5/7] feat(darwin suites): enable base in default.nix This commit enables the 'base' edition in the default.nix configuration file within the Darwin suites module. This update provides the necessary settings for the base installation, enhancing the flexibility of system setup. --- modules/darwin/suites/common/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/darwin/suites/common/default.nix b/modules/darwin/suites/common/default.nix index 64686a2..c684f73 100644 --- a/modules/darwin/suites/common/default.nix +++ b/modules/darwin/suites/common/default.nix @@ -16,6 +16,8 @@ in metacfg = { nix = enabled; + base = enabled; + system = { fonts = enabled; #input = enabled; From 037bb4d88f6cb4b4c1f755be8d4dd5fd675d38a1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jul 2024 13:28:45 +0200 Subject: [PATCH 6/7] feat: Update user configuration in default.nix This commit comments out several configurations in the user's default.nix on harald@mpro. Namely, it disables the sessionPath, home-manager, and alacritty, establishing a new setup for future use. --- homes/x86_64-darwin/harald@mpro/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homes/x86_64-darwin/harald@mpro/default.nix b/homes/x86_64-darwin/harald@mpro/default.nix index f7f8d31..5320d12 100644 --- a/homes/x86_64-darwin/harald@mpro/default.nix +++ b/homes/x86_64-darwin/harald@mpro/default.nix @@ -8,22 +8,23 @@ username = "harald"; homeDirectory = "/Users/${config.home.username}"; stateVersion = "23.11"; # Please read the comment before changing. - sessionPath = [ "$HOME/bin" ]; + # sessionPath = [ "$HOME/bin" ]; }; metacfg = { + cli-apps = { bash.enable = true; fish.enable = true; neovim.enable = true; - tmux.enable = true; bat.enable = true; starship.enable = true; - home-manager.enable = true; + #home-manager.enable = true; }; + tools = { direnv.enable = true; - alacritty.enable = true; + #alacritty.enable = true; ssh.enable = true; git.enable = true; }; From c42a15d23527a36aa27ddc6b5e5c04b55bcce505 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jul 2024 13:37:17 +0200 Subject: [PATCH 7/7] feat: Enable alacritty in default.nix Alacritty was previously commented out in default.nix configuration. This update has ensured it is now enabled. --- homes/x86_64-darwin/harald@mpro/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homes/x86_64-darwin/harald@mpro/default.nix b/homes/x86_64-darwin/harald@mpro/default.nix index 5320d12..c9bab11 100644 --- a/homes/x86_64-darwin/harald@mpro/default.nix +++ b/homes/x86_64-darwin/harald@mpro/default.nix @@ -24,7 +24,7 @@ tools = { direnv.enable = true; - #alacritty.enable = true; + alacritty.enable = true; ssh.enable = true; git.enable = true; };