Simplify per-host split

work
Matthew Ess 2022-10-17 13:29:38 -04:00
parent 628e694626
commit 7b80ebb2b1
5 changed files with 30 additions and 38 deletions

View File

@ -5,7 +5,6 @@ let
caskIsPresent = cask: lib.any (x: x == cask) config.homebrew.casks; caskIsPresent = cask: lib.any (x: x == cask) config.homebrew.casks;
mkIfCaskPresent = cask: mkIf (caskIsPresent cask); mkIfCaskPresent = cask: mkIf (caskIsPresent cask);
brewEnabled = config.homebrew.enable; brewEnabled = config.homebrew.enable;
gamesEnabled = config.games.enable;
in in
{ {
@ -71,7 +70,6 @@ in
"miniforge" "miniforge"
"mullvadvpn" "mullvadvpn"
"obsidian" "obsidian"
"mullvadvpn"
"rectangle" "rectangle"
"secretive" "secretive"
"signal" "signal"
@ -80,12 +78,6 @@ in
"transmission" "transmission"
"utm" "utm"
"zoom" "zoom"
] ++ lib.optionals gamesEnabled [
# games
"gog-galaxy"
"origin"
"sony-ps-remote-play"
"steam"
]; ];
# Configuration related to casks # Configuration related to casks

View File

@ -127,6 +127,22 @@
"type": "github" "type": "github"
} }
}, },
"fisher-src": {
"flake": false,
"locked": {
"lastModified": 1665682222,
"narHash": "sha256-q9Yi6ZlHNFnPN05RpO+u4B5wNR1O3JGIn2AJ3AEl4xs=",
"owner": "jorgebucaran",
"repo": "fisher",
"rev": "36810b39401536650d7a1018c8f3832f51741950",
"type": "github"
},
"original": {
"owner": "jorgebucaran",
"repo": "fisher",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -326,6 +342,7 @@
"inputs": { "inputs": {
"dark-mode-notify-src": "dark-mode-notify-src", "dark-mode-notify-src": "dark-mode-notify-src",
"darwin": "darwin", "darwin": "darwin",
"fisher-src": "fisher-src",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"helix": "helix", "helix": "helix",

View File

@ -28,6 +28,8 @@
dark-mode-notify-src.flake = false; dark-mode-notify-src.flake = false;
kitty-icon.url = "github:DinkDonk/kitty-icon"; kitty-icon.url = "github:DinkDonk/kitty-icon";
kitty-icon.flake = false; kitty-icon.flake = false;
fisher-src.url = "github:jorgebucaran/fisher";
fisher-src.flake = false;
}; };
outputs = { self, darwin, home-manager, flake-utils, ... }@inputs: outputs = { self, darwin, home-manager, flake-utils, ... }@inputs:
@ -131,7 +133,13 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vscodium vscodium
]; ];
games.enable = true; homebrew.casks = [
# games
"gog-galaxy"
"origin"
"sony-ps-remote-play"
"steam"
];
home-manager.sharedModules = [{ home-manager.sharedModules = [{
programs.fish.shellAliases = { programs.fish.shellAliases = {
code = "${pkgs.vscodium}/bin/codium"; code = "${pkgs.vscodium}/bin/codium";
@ -150,7 +158,7 @@
yelpbook-m1 = darwinSystem { yelpbook-m1 = darwinSystem {
system = "aarch64-darwin"; system = "aarch64-darwin";
modules = nixDarwinCommonModules ++ [ modules = nixDarwinCommonModules ++ [
({ pkgs, ... }: { ({ pkgs, lib, ... }: {
users.primaryUser = workUserInfo; users.primaryUser = workUserInfo;
networking.knownNetworkServices = [ networking.knownNetworkServices = [
"Wi-Fi" "Wi-Fi"
@ -158,7 +166,6 @@
nix.settings.cores = 2; nix.settings.cores = 2;
nix.settings.max-jobs = 5; nix.settings.max-jobs = 5;
games.enable = false;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
yubiswitch yubiswitch
vscode vscode
@ -173,25 +180,12 @@
programs.fish.functions.devbox.body = '' programs.fish.functions.devbox.body = ''
ssh -t devbox "agenttmux attach; or agenttmux new -s yelp" ssh -t devbox "agenttmux attach; or agenttmux new -s yelp"
''; '';
launchd.agents.tarsnap.enable = lib.mkForce false;
}]; }];
}) })
]; ];
}; };
# Config with small modifications needed/desired for CI with GitHub workflow
githubCI = darwinSystem {
system = "x86_64-darwin";
modules = nixDarwinCommonModules ++ [
({ lib, ... }: {
users.primaryUser = primaryUserInfo // {
username = "runner";
nixConfigDirectory = "/Users/runner/work/nixpkgs/nixpkgs";
};
homebrew.enable = lib.mkForce false;
})
];
};
}; };
# Build and activate on new system with: # Build and activate on new system with:
@ -252,7 +246,7 @@
}; };
patched = final: prev: optionalAttrs prev.stdenv.isDarwin { patched = final: prev: optionalAttrs prev.stdenv.isDarwin {
inherit (inputs) kitty-icon; inherit (inputs) kitty-icon fisher-src;
lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; }; lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; };
}; };
}; };
@ -265,7 +259,6 @@
general = import ./darwin/general.nix; general = import ./darwin/general.nix;
homebrew = import ./darwin/homebrew.nix; homebrew = import ./darwin/homebrew.nix;
# modules # modules
games = import ./modules/darwin/games.nix;
primary-user = import ./modules/darwin/primary-user.nix; primary-user = import ./modules/darwin/primary-user.nix;
}; };

View File

@ -11,12 +11,7 @@
programs.fish.plugins = [ programs.fish.plugins = [
{ {
name = "fisher"; name = "fisher";
src = pkgs.fetchFromGitHub { src = pkgs.fisher-src;
owner = "jorgebucaran";
repo = "fisher";
rev = "93dafd242b52a0dc6bea54130d0ea041830c7fd6";
sha256 = "0qbqlydh7b928473f7c4gy68sr1wnwyhcvvqzcik1vx5hdbka7ad";
};
} }
]; ];

View File

@ -1,5 +0,0 @@
{ lib, ... }:
{
options.games.enable = lib.mkEnableOption "Enable games (managed by homebrew)";
}