From 3d9d98986756f40f8ce351bff0e6a72fa5f2ff12 Mon Sep 17 00:00:00 2001 From: shelken Date: Sun, 8 Sep 2024 14:06:06 +0800 Subject: [PATCH] feat: add mio config and update secrets repo to remove nano and add mio --- flake.lock | 6 +++--- flake.nix | 13 +++++++++++++ home/base/core/secrets.nix | 12 +++++++++++- hosts/mio/apps.nix | 8 ++++++++ hosts/mio/default.nix | 11 +++++++++++ hosts/mio/home.nix | 9 +++++++++ hosts/yuuko/home.nix | 2 +- modules/darwin/apps.nix | 6 +++--- modules/darwin/secrets.nix | 17 +++++++++++++++++ 9 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 hosts/mio/apps.nix create mode 100644 hosts/mio/default.nix create mode 100644 hosts/mio/home.nix create mode 100644 modules/darwin/secrets.nix diff --git a/flake.lock b/flake.lock index 6220ac6..80a7cac 100644 --- a/flake.lock +++ b/flake.lock @@ -500,10 +500,10 @@ "secrets": { "flake": false, "locked": { - "lastModified": 1725363806, - "narHash": "sha256-o3xA9d9HhmdI5y6/E0dBS4MPq9804hSXajEbPuZSjA8=", + "lastModified": 1725774741, + "narHash": "sha256-Rjc1mYKWu1MhjFJWVTt+JlT80GYZh/5p0SLW0q2eASM=", "ref": "refs/heads/main", - "rev": "77fce00f1224a825e579dc2cfcc4998c1df040ec", + "rev": "d33bdd77c1816fb6d918a211e1082e9b8938ee48", "shallow": true, "type": "git", "url": "ssh://git@github.com/shelken/secrets.nix.git" diff --git a/flake.nix b/flake.nix index 1168078..5312dca 100644 --- a/flake.nix +++ b/flake.nix @@ -81,6 +81,17 @@ "hosts/yuuko/home.nix" ]; }; + mioModules = { + darwin-modules = map mylib.relativeToRoot [ + "modules/darwin" + "hosts/mio" + ]; + home-modules = map mylib.relativeToRoot [ + "home/darwin" + "secrets/home.nix" + "hosts/mio/home.nix" + ]; + }; nanoModules = { darwin-modules = map mylib.relativeToRoot [ "modules/darwin" @@ -118,6 +129,8 @@ darwinConfigurations = { # mac mini yuuko = mylib.macosSystem (yuukoModules // args // {system = "aarch64-darwin";}); + # macbook air + mio = mylib.macosSystem (mioModules // args // {system = "aarch64-darwin";}); nano = mylib.macosSystem (nanoModules // args // {system = "x86_64-darwin";}); ling = mylib.macosSystem (lingModules // args // {system = "aarch64-darwin";}); }; diff --git a/home/base/core/secrets.nix b/home/base/core/secrets.nix index b4fe483..1f6034b 100644 --- a/home/base/core/secrets.nix +++ b/home/base/core/secrets.nix @@ -1,7 +1,17 @@ -{mylib, ...}: let +{ + mylib, + config, + lib, + ... +}: let inherit (mylib) mkBoolOpt; + inherit (lib) mkIf; + cfg = config.shelken.secrets; in { options.shelken.secrets = { enable = mkBoolOpt false "Whether or not use secrets"; }; + config = + mkIf cfg.enable { + }; } diff --git a/hosts/mio/apps.nix b/hosts/mio/apps.nix new file mode 100644 index 0000000..c0db605 --- /dev/null +++ b/hosts/mio/apps.nix @@ -0,0 +1,8 @@ +{ + # 版本差异的 + homebrew = { + casks = [ + "arc" + ]; + }; +} diff --git a/hosts/mio/default.nix b/hosts/mio/default.nix new file mode 100644 index 0000000..91ba55e --- /dev/null +++ b/hosts/mio/default.nix @@ -0,0 +1,11 @@ +_: let + hostname = "mio"; +in { + networking.hostName = hostname; + networking.computerName = hostname; + system.defaults.smb.NetBIOSName = hostname; + imports = [ + ./apps.nix + ]; + shelken.wm.aerospace.enable = true; +} diff --git a/hosts/mio/home.nix b/hosts/mio/home.nix new file mode 100644 index 0000000..cf22aac --- /dev/null +++ b/hosts/mio/home.nix @@ -0,0 +1,9 @@ +{...}: { + # programs.ssh = { + # inherit (myvars.networking.ssh) extraConfig; + # }; + shelken = { + wm.aerospace.enable = true; + secrets.enable = true; + }; +} diff --git a/hosts/yuuko/home.nix b/hosts/yuuko/home.nix index c55defb..cf22aac 100644 --- a/hosts/yuuko/home.nix +++ b/hosts/yuuko/home.nix @@ -4,6 +4,6 @@ # }; shelken = { wm.aerospace.enable = true; - secrets = true; + secrets.enable = true; }; } diff --git a/modules/darwin/apps.nix b/modules/darwin/apps.nix index 830e835..8f28e0c 100644 --- a/modules/darwin/apps.nix +++ b/modules/darwin/apps.nix @@ -103,9 +103,9 @@ in { }; taps = [ - "homebrew/cask-fonts" + #"homebrew/cask-fonts" "homebrew/services" - "homebrew/cask-versions" + #"homebrew/cask-versions" "shelken/tap" # self tap "hashicorp/tap" # terraform @@ -157,7 +157,7 @@ in { # Misc # "iina" # video player - # "raycast" # macOS 12+ (HotKey: alt/option + space)search, calculate and run scripts(with many plugins) + "raycast" # macOS 12+ (HotKey: alt/option + space)search, calculate and run scripts(with many plugins) "stats" # beautiful system status monitor in menu bar # "appcleaner" # app uninstall # "applite" # homebrew ui; need macOS 13+ diff --git a/modules/darwin/secrets.nix b/modules/darwin/secrets.nix new file mode 100644 index 0000000..1f6034b --- /dev/null +++ b/modules/darwin/secrets.nix @@ -0,0 +1,17 @@ +{ + mylib, + config, + lib, + ... +}: let + inherit (mylib) mkBoolOpt; + inherit (lib) mkIf; + cfg = config.shelken.secrets; +in { + options.shelken.secrets = { + enable = mkBoolOpt false "Whether or not use secrets"; + }; + config = + mkIf cfg.enable { + }; +}