Add work configuration

work
Matthew Ess 2022-07-29 22:15:19 -04:00
parent 001783fc7e
commit dcaa733d4e
7 changed files with 76 additions and 30 deletions

View File

@ -7,20 +7,19 @@
"https://hydra.iohk.io" "https://hydra.iohk.io"
"https://cache.iog.io" "https://cache.iog.io"
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://mat.cachix.org"
]; ];
nix.binaryCachePublicKeys = [ nix.binaryCachePublicKeys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno="
]; ];
nix.trustedUsers = [ nix.trustedUsers = [
"@admin" "@admin"
]; ];
users.nix.configureBuildUsers = true; users.nix.configureBuildUsers = true;
nix.buildCores = 2;
nix.maxJobs = 4;
# Enable experimental nix command and flakes # Enable experimental nix command and flakes
nix.extraOptions = '' nix.extraOptions = ''
auto-optimise-store = true auto-optimise-store = true

View File

@ -4,6 +4,7 @@ let
inherit (lib) mkIf; inherit (lib) mkIf;
mkIfCaskPresent = cask: mkIf (lib.any (x: x == cask) config.homebrew.casks); mkIfCaskPresent = cask: mkIf (lib.any (x: x == cask) config.homebrew.casks);
brewEnabled = config.homebrew.enable; brewEnabled = config.homebrew.enable;
gamesEnabled = config.games.enable;
in in
{ {
@ -16,7 +17,8 @@ in
# https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish # https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish
# For some reason if the Fish completions are added at the end of `fish_complete_path` they don't # For some reason if the Fish completions are added at the end of `fish_complete_path` they don't
# seem to work, but they do work if added at the start. # seem to work, but they do work if added at the start.
programs.fish.interactiveShellInit = mkIf brewEnabled '' # programs.fish.interactiveShellInit = mkIf brewEnabled ''
programs.fish.interactiveShellInit = ''
if test -d (brew --prefix)"/share/fish/completions" if test -d (brew --prefix)"/share/fish/completions"
set -p fish_complete_path (brew --prefix)/share/fish/completions set -p fish_complete_path (brew --prefix)/share/fish/completions
end end
@ -58,21 +60,24 @@ in
"alfred" "alfred"
"bartender" "bartender"
"firefox" "firefox"
"gog-galaxy"
"jitsi-meet" "jitsi-meet"
"knockknock" "knockknock"
"lulu" "lulu"
"mimestream"
# "mullvadvpn" # "mullvadvpn"
"origin"
"rectangle" "rectangle"
"seaglass" "seaglass"
"secretive" "secretive"
"signal" "signal"
"steam"
"transmission" "transmission"
# "twitch" # "twitch"
# "utm" # "utm"
# "zoom" # "zoom"
] ++ lib.optionals gamesEnabled [
# games
"gog-galaxy"
"origin"
"steam"
]; ];
# Configuration related to casks # Configuration related to casks

View File

@ -136,6 +136,22 @@
"type": "github" "type": "github"
} }
}, },
"kitty-icon": {
"flake": false,
"locked": {
"lastModified": 1640552536,
"narHash": "sha256-3Jri8/y/s6/QkOBb03R9nd1gyZPGZlekhli9ShTzOxg=",
"owner": "DinkDonk",
"repo": "kitty-icon",
"rev": "b19b3969d3bdc870beeff332355f92e38dc5a704",
"type": "github"
},
"original": {
"owner": "DinkDonk",
"repo": "kitty-icon",
"type": "github"
}
},
"luar-src": { "luar-src": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -210,6 +226,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"homebrew-enabled": "homebrew-enabled", "homebrew-enabled": "homebrew-enabled",
"kakoune-sudo-write-src": "kakoune-sudo-write-src", "kakoune-sudo-write-src": "kakoune-sudo-write-src",
"kitty-icon": "kitty-icon",
"luar-src": "luar-src", "luar-src": "luar-src",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-master": "nixpkgs-master", "nixpkgs-master": "nixpkgs-master",

View File

@ -42,6 +42,10 @@
url = github:occivink/kakoune-sudo-write; url = github:occivink/kakoune-sudo-write;
flake = false; flake = false;
}; };
kitty-icon = {
url = github:DinkDonk/kitty-icon;
flake = false;
};
}; };
outputs = { self, darwin, nixpkgs, home-manager, flake-utils, ... }@inputs: outputs = { self, darwin, nixpkgs, home-manager, flake-utils, ... }@inputs:
@ -130,6 +134,34 @@
networking.knownNetworkServices = [ networking.knownNetworkServices = [
"Wi-Fi" "Wi-Fi"
]; ];
nix.buildCores = 2;
nix.maxJobs = 4;
games.enable = true;
home-manager.sharedModules = [{
programs.git.userEmail = "mat@mat.services";
programs.git.userName = "mat ess";
}];
}
];
};
yelpbook-m1 = darwinSystem {
system = "aarch64-darwin";
modules = nixDarwinCommonModules ++ [
{
users.primaryUser = "mess";
networking.knownNetworkServices = [
"Wi-Fi"
];
nix.buildCores = 2;
nix.maxJobs = 5;
games.enable = false;
home-manager.sharedModules = [{
programs.git.userEmail = "mess@yelp.com";
programs.git.userName = "Matthew Ess";
}];
} }
]; ];
}; };
@ -156,21 +188,6 @@
nixpkgs = nixpkgsConfig; nixpkgs = nixpkgsConfig;
}; };
}; };
# attrValues self.darwinModules ++ [
# # Main `nix-darwin` config
# ./configuration.nix
# # `home-manager` module
# home-manager.darwinModules.home-manager
# {
# nixpkgs = nixpkgsConfig;
# # `home-manager` config
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.users.mat = import ./home.nix;
# }
# ];
# };
}; };
# Overlays --------------------------------------------------------------- {{{ # Overlays --------------------------------------------------------------- {{{
@ -210,9 +227,8 @@
}; };
patched = final: prev: optionalAttrs prev.stdenv.isDarwin { patched = final: prev: optionalAttrs prev.stdenv.isDarwin {
lib = prev.lib // { inherit (inputs) kitty-icon;
homebrew-enabled = inputs.homebrew-enabled.value; lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; };
};
kakounePlugins = prev.kakounePlugins // { kakounePlugins = prev.kakounePlugins // {
auto-pairs-kak = prev.kakounePlugins.auto-pairs-kak.overrideAttrs (attrs: { auto-pairs-kak = prev.kakounePlugins.auto-pairs-kak.overrideAttrs (attrs: {
src = inputs.auto-pairs-kak-src; src = inputs.auto-pairs-kak-src;
@ -223,6 +239,7 @@
# `nix-darwin` modules (some are pending upstream acceptance) # `nix-darwin` modules (some are pending upstream acceptance)
darwinModules = { darwinModules = {
games = import ./modules/darwin/games.nix;
programs-nix-index = import ./modules/darwin/programs/nix-index.nix; programs-nix-index = import ./modules/darwin/programs/nix-index.nix;
security-pam = import ./modules/darwin/security/pam.nix; security-pam = import ./modules/darwin/security/pam.nix;
users = import ./modules/darwin/users.nix; users = import ./modules/darwin/users.nix;

View File

@ -7,7 +7,7 @@
programs.git.enable = true; programs.git.enable = true;
programs.git.extraConfig = { programs.git.extraConfig = {
core.editor = "${pkgs.neovim-remote}/bin/nvr --remote-wait-silent -cc split"; # core.editor = "${pkgs.neovim-remote}/bin/nvr --remote-wait-silent -cc split";
diff.colorMoved = "default"; diff.colorMoved = "default";
pull.rebase = true; pull.rebase = true;
init.defaultBranch = "main"; init.defaultBranch = "main";
@ -17,9 +17,6 @@
".DS_Store" ".DS_Store"
]; ];
programs.git.userEmail = "mat@mat.services";
programs.git.userName = "mat ess";
# Enhanced diffs # Enhanced diffs
programs.git.delta.enable = true; programs.git.delta.enable = true;

View File

@ -114,6 +114,6 @@ in
programs.kitty.extras.fixIcon = { programs.kitty.extras.fixIcon = {
enable = true; enable = true;
appPath = "~/Applications/Home\\ Manager\\ Apps/kitty.app"; appPath = "~/Applications/Home\\ Manager\\ Apps/kitty.app";
iconPath = "~/Development/kitty-icon/kitty-dark.icns"; iconPath = "${pkgs.kitty-icon}/kitty-dark.icns";
}; };
} }

11
modules/darwin/games.nix Normal file
View File

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