From 7b80ebb2b1f9e31e963a5fb7d5ddcec67e937faf Mon Sep 17 00:00:00 2001 From: Matthew Ess Date: Mon, 17 Oct 2022 13:29:38 -0400 Subject: [PATCH] Simplify per-host split --- darwin/homebrew.nix | 8 -------- flake.lock | 17 +++++++++++++++++ flake.nix | 31 ++++++++++++------------------- home/fish.nix | 7 +------ modules/darwin/games.nix | 5 ----- 5 files changed, 30 insertions(+), 38 deletions(-) delete mode 100644 modules/darwin/games.nix diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index 6be6050..cbc5383 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -5,7 +5,6 @@ let caskIsPresent = cask: lib.any (x: x == cask) config.homebrew.casks; mkIfCaskPresent = cask: mkIf (caskIsPresent cask); brewEnabled = config.homebrew.enable; - gamesEnabled = config.games.enable; in { @@ -71,7 +70,6 @@ in "miniforge" "mullvadvpn" "obsidian" - "mullvadvpn" "rectangle" "secretive" "signal" @@ -80,12 +78,6 @@ in "transmission" "utm" "zoom" - ] ++ lib.optionals gamesEnabled [ - # games - "gog-galaxy" - "origin" - "sony-ps-remote-play" - "steam" ]; # Configuration related to casks diff --git a/flake.lock b/flake.lock index 5bab7cf..6d5e383 100644 --- a/flake.lock +++ b/flake.lock @@ -127,6 +127,22 @@ "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": false, "locked": { @@ -326,6 +342,7 @@ "inputs": { "dark-mode-notify-src": "dark-mode-notify-src", "darwin": "darwin", + "fisher-src": "fisher-src", "flake-compat": "flake-compat", "flake-utils": "flake-utils", "helix": "helix", diff --git a/flake.nix b/flake.nix index 5c4c3ab..d83bbd8 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,8 @@ dark-mode-notify-src.flake = false; kitty-icon.url = "github:DinkDonk/kitty-icon"; kitty-icon.flake = false; + fisher-src.url = "github:jorgebucaran/fisher"; + fisher-src.flake = false; }; outputs = { self, darwin, home-manager, flake-utils, ... }@inputs: @@ -131,7 +133,13 @@ environment.systemPackages = with pkgs; [ vscodium ]; - games.enable = true; + homebrew.casks = [ + # games + "gog-galaxy" + "origin" + "sony-ps-remote-play" + "steam" + ]; home-manager.sharedModules = [{ programs.fish.shellAliases = { code = "${pkgs.vscodium}/bin/codium"; @@ -150,7 +158,7 @@ yelpbook-m1 = darwinSystem { system = "aarch64-darwin"; modules = nixDarwinCommonModules ++ [ - ({ pkgs, ... }: { + ({ pkgs, lib, ... }: { users.primaryUser = workUserInfo; networking.knownNetworkServices = [ "Wi-Fi" @@ -158,7 +166,6 @@ nix.settings.cores = 2; nix.settings.max-jobs = 5; - games.enable = false; environment.systemPackages = with pkgs; [ yubiswitch vscode @@ -173,25 +180,12 @@ programs.fish.functions.devbox.body = '' 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: @@ -252,7 +246,7 @@ }; 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; }; }; }; @@ -265,7 +259,6 @@ general = import ./darwin/general.nix; homebrew = import ./darwin/homebrew.nix; # modules - games = import ./modules/darwin/games.nix; primary-user = import ./modules/darwin/primary-user.nix; }; diff --git a/home/fish.nix b/home/fish.nix index 2f3b36b..5f9b09b 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -11,12 +11,7 @@ programs.fish.plugins = [ { name = "fisher"; - src = pkgs.fetchFromGitHub { - owner = "jorgebucaran"; - repo = "fisher"; - rev = "93dafd242b52a0dc6bea54130d0ea041830c7fd6"; - sha256 = "0qbqlydh7b928473f7c4gy68sr1wnwyhcvvqzcik1vx5hdbka7ad"; - }; + src = pkgs.fisher-src; } ]; diff --git a/modules/darwin/games.nix b/modules/darwin/games.nix deleted file mode 100644 index de058e3..0000000 --- a/modules/darwin/games.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ lib, ... }: - -{ - options.games.enable = lib.mkEnableOption "Enable games (managed by homebrew)"; -}