Simplify per-host split
parent
628e694626
commit
7b80ebb2b1
|
@ -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
|
||||
|
|
17
flake.lock
17
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",
|
||||
|
|
31
flake.nix
31
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;
|
||||
};
|
||||
|
||||
|
|
|
@ -11,12 +11,7 @@
|
|||
programs.fish.plugins = [
|
||||
{
|
||||
name = "fisher";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jorgebucaran";
|
||||
repo = "fisher";
|
||||
rev = "93dafd242b52a0dc6bea54130d0ea041830c7fd6";
|
||||
sha256 = "0qbqlydh7b928473f7c4gy68sr1wnwyhcvvqzcik1vx5hdbka7ad";
|
||||
};
|
||||
src = pkgs.fisher-src;
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
options.games.enable = lib.mkEnableOption "Enable games (managed by homebrew)";
|
||||
}
|
Loading…
Reference in New Issue