diff --git a/.github/workflows/nix-test.yaml b/.github/workflows/nix-test.yaml index e4080ef..5f733e7 100644 --- a/.github/workflows/nix-test.yaml +++ b/.github/workflows/nix-test.yaml @@ -35,6 +35,7 @@ jobs: sed -i '' "s/defaultHostname/$(scutil --get LocalHostName)/g" nixos-config/flake.nix sed -i '' "s/mike.splain/runner/g" nixos-config/flake.nix sed -i '' "s/defaultSystem/${{matrix.os.arch}}/g" nixos-config/flake.nix + sed -i '' "s/defaultVersion/$(sw_vers --productVersion | cut -d. -f1)/g" nixos-config/flake.nix sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin sudo mv /etc/shells /etc/shells.before-nix-darwin diff --git a/nixos-config/flake.nix b/nixos-config/flake.nix index efefd89..9aedf64 100644 --- a/nixos-config/flake.nix +++ b/nixos-config/flake.nix @@ -93,7 +93,7 @@ extraSpecialArgs = { inherit inputs user pwnvim; }; users.${user.name} = { imports = [ ./home ]; }; }; - system = { system, hostName }: let + system = { system, hostName, osVersion }: let inherit (nixpkgs.lib.strings) hasInfix; platform = { isDarwin = hasInfix "darwin" system; @@ -120,7 +120,7 @@ # home-manager = configuration.homeManager; # } ]; - specialArgs = { inherit inputs hostName platform system user; }; + specialArgs = { inherit inputs hostName osVersion platform system user; }; in if platform.isDarwin then nix-darwin.lib.darwinSystem { inherit system modules specialArgs; @@ -172,11 +172,13 @@ SNS005454 = configuration.system { system = "aarch64-darwin"; hostName = "SNS005454"; + osVersion = "14"; # username = "mike.splain"; }; defaultHostname = configuration.system { system = "defaultSystem"; hostName = "defaultHostname"; + osVersion = "defaultVersion"; # username = "mike.splain"; }; diff --git a/nixos-config/platforms/darwin/homebrew/default.nix b/nixos-config/platforms/darwin/homebrew/default.nix index 065d07b..15e1942 100644 --- a/nixos-config/platforms/darwin/homebrew/default.nix +++ b/nixos-config/platforms/darwin/homebrew/default.nix @@ -1,4 +1,4 @@ -{ inputs, lib, user, hostName, ...}: +{ inputs, lib, user, hostName, osVersion, ...}: let inherit (inputs) homebrew-cask @@ -18,10 +18,13 @@ in # "Sonos-Inc/pdsw-engx-devops-sk8s/sk8s" "ncdu" ]; - casks = [ + casks = (if osVersion >= "14" then + [ + "jordanbaird-ice" + ] else []) ++ + [ "session-manager-plugin" "appcleaner" - "jordanbaird-ice" ]; # casks = [];