Compare commits

..

7 Commits

Author SHA1 Message Date
mat ess 65e48c07c9 Use Rosé Pine 2022-11-20 17:25:59 -05:00
mat ess e1fb9b36fd Add direnv 2022-11-20 17:08:25 -05:00
mat ess 5f6c3ffd97 Add pre-commit hooks and other fixes 2022-11-20 17:07:02 -05:00
mat ess e11c455279 Add nil 2022-11-20 11:49:45 -05:00
mat ess 736aca62e8 Update fonts 2022-11-20 10:38:04 -05:00
mat ess 7102375bd2 Add lapce, bbedit for messing around 2022-11-19 15:14:09 -05:00
mat ess 0a206737ad Restore bat color-setting 2022-11-19 15:13:42 -05:00
16 changed files with 183 additions and 59 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

2
.gitignore vendored
View File

@ -2,3 +2,5 @@ result
result-* result-*
*.secret.* *.secret.*
.nvimlog .nvimlog
.pre-commit-config.yaml
.direnv/

View File

@ -10,6 +10,7 @@
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://mat.cachix.org" "https://mat.cachix.org"
"https://helix.cachix.org" "https://helix.cachix.org"
"https://pre-commit-hooks.cachix.org"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
@ -17,6 +18,7 @@
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno=" "mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
]; ];
trusted-users = [ trusted-users = [
"@admin" "@admin"

View File

@ -1,5 +1,3 @@
{ ... }:
{ {
system.defaults.NSGlobalDomain = { system.defaults.NSGlobalDomain = {
AppleInterfaceStyleSwitchesAutomatically = true; AppleInterfaceStyleSwitchesAutomatically = true;

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { pkgs, ... }:
{ {
environment.systemPackages = [ pkgs.terminal-notifier ]; environment.systemPackages = [ pkgs.terminal-notifier ];
@ -6,13 +6,17 @@
# Fonts # Fonts
fonts.fontDir.enable = true; fonts.fontDir.enable = true;
fonts.fonts = with pkgs; [ fonts.fonts = with pkgs; [
borg-sans-mono
inter
recursive recursive
(nerdfonts.override { (nerdfonts.override {
enableWindowsFonts = false;
fonts = [ fonts = [
"FantasqueSansMono" "CascadiaCode"
"JetBrainsMono" "iA-Writer"
"Inconsolata"
"FiraCode" "FiraCode"
"SourceCodePro" "Lilex"
]; ];
}) })
]; ];

View File

@ -46,12 +46,14 @@
"aerial" "aerial"
"alfred" "alfred"
"bartender" "bartender"
"bbedit"
# "discord" # "discord"
# "element" # "element"
"firefox" "firefox"
"jitsi-meet" "jitsi-meet"
"knockknock" "knockknock"
# "lagrange" # "lagrange"
"lapce"
"logi-options-plus" "logi-options-plus"
"lulu" "lulu"
"macsvg" "macsvg"

View File

@ -321,6 +321,22 @@
"type": "github" "type": "github"
} }
}, },
"kitty-rose-pine": {
"flake": false,
"locked": {
"lastModified": 1661351382,
"narHash": "sha256-idqwpNC6hWIz5KtEGqL5C+KcUcKc9iPCstP5FQcZZ0I=",
"owner": "rose-pine",
"repo": "kitty",
"rev": "4dd9bbe6f838e61f0ef7e9ab9625adda34e129ef",
"type": "github"
},
"original": {
"owner": "rose-pine",
"repo": "kitty",
"type": "github"
}
},
"nci": { "nci": {
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
@ -396,6 +412,42 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1667292599,
"narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ef2f213d9659a274985778bff4ca322f3ef3ac68",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"pre-commit": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1668973924,
"narHash": "sha256-17VnhpKJRoYdt23SJcUUCi/qEt9d3OyFsz9YRYStrew=",
"owner": "cpcloud",
"repo": "pre-commit-hooks.nix",
"rev": "7ee855668b78b9d7d1b504121c5b146c67a2abd8",
"type": "github"
},
"original": {
"owner": "cpcloud",
"ref": "dot-git-dir",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"dark-mode-notify-src": "dark-mode-notify-src", "dark-mode-notify-src": "dark-mode-notify-src",
@ -408,9 +460,11 @@
"home-manager-atemu": "home-manager-atemu", "home-manager-atemu": "home-manager-atemu",
"homebrew-enabled": "homebrew-enabled", "homebrew-enabled": "homebrew-enabled",
"kitty-icon": "kitty-icon", "kitty-icon": "kitty-icon",
"kitty-rose-pine": "kitty-rose-pine",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-master": "nixpkgs-master", "nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable",
"pre-commit": "pre-commit"
} }
}, },
"rust-overlay": { "rust-overlay": {

View File

@ -26,6 +26,11 @@
home-manager-atemu.url = "github:Atemu/home-manager/darwin-copy-apps-fully-wip"; home-manager-atemu.url = "github:Atemu/home-manager/darwin-copy-apps-fully-wip";
home-manager-atemu.inputs.nixpkgs.follows = "nixpkgs-unstable"; home-manager-atemu.inputs.nixpkgs.follows = "nixpkgs-unstable";
# pre-commit and hooks
# pre-commit.url = "github:cachix/pre-commit-hooks.nix";
pre-commit.url = "github:cpcloud/pre-commit-hooks.nix/dot-git-dir";
pre-commit.inputs.flake-utils.follows = "flake-utils";
# Extra sources # Extra sources
helix.url = "github:helix-editor/helix"; helix.url = "github:helix-editor/helix";
helix.inputs.nixpkgs.follows = "nixpkgs-unstable"; helix.inputs.nixpkgs.follows = "nixpkgs-unstable";
@ -33,11 +38,13 @@
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;
kitty-rose-pine.url = "github:rose-pine/kitty";
kitty-rose-pine.flake = false;
fisher-src.url = "github:jorgebucaran/fisher"; fisher-src.url = "github:jorgebucaran/fisher";
fisher-src.flake = false; fisher-src.flake = false;
}; };
outputs = { self, darwin, home-manager, flake-utils, ... }@inputs: outputs = { self, darwin, home-manager, flake-utils, pre-commit, ... }@inputs:
let let
inherit (darwin.lib) darwinSystem; inherit (darwin.lib) darwinSystem;
@ -50,16 +57,16 @@
nixpkgsConfig = { nixpkgsConfig = {
config = { allowUnfree = true; }; config = { allowUnfree = true; };
overlays = attrValues self.overlays ++ [ overlays = attrValues self.overlays ++ [
(final: prev: (final: _prev:
import ./pkgs { import ./pkgs {
inherit inputs; inherit inputs;
inherit (final) callPackage; inherit (final) callPackage;
inherit (final.stdenv) system; inherit (final.stdenv) system;
}) })
(final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") (_final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin")
{ {
# Sub in x86 version of packages that don't build on Apple Silicon yet # Sub in x86 version of packages that don't build on Apple Silicon yet
inherit (final.pkgs-x86); # inherit (final.pkgs-x86);
}) })
]; ];
}; };
@ -85,7 +92,7 @@
# `home-manager` module # `home-manager` module
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
( (
{ config, lib, pkgs, ... }: { config, ... }:
let let
inherit (config.users) primaryUser; inherit (config.users) primaryUser;
in in
@ -195,7 +202,7 @@
# Build and activate on new system with: # Build and activate on new system with:
# `nix build .#homeConfigurations.<name>.activationPackage; ./result/activate` # `nix build .#homeConfigurations.<name>.activationPackage; ./result/activate`
homeConfigurations = rec { homeConfigurations = {
cloudVM = home-manager.lib.homeManagerConfiguration { cloudVM = home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs-unstable { pkgs = import inputs.nixpkgs-unstable {
system = "x86_64-linux"; system = "x86_64-linux";
@ -218,21 +225,21 @@
overlays = { overlays = {
# nixpkgs overlays # nixpkgs overlays
pkgs-stable = final: prev: { pkgs-stable = _final: prev: {
pkgs-stable = import inputs.nixpkgs { pkgs-stable = import inputs.nixpkgs {
inherit (prev.stdenv) system; inherit (prev.stdenv) system;
inherit (nixpkgsConfig) config; inherit (nixpkgsConfig) config;
}; };
}; };
pkgs-unstable = final: prev: { pkgs-unstable = _final: prev: {
pkgs-unstable = import inputs.nixpkgs-unstable { pkgs-unstable = import inputs.nixpkgs-unstable {
inherit (prev.stdenv) system; inherit (prev.stdenv) system;
inherit (nixpkgsConfig) config; inherit (nixpkgsConfig) config;
}; };
}; };
pkgs-master = final: prev: { pkgs-master = _final: prev: {
pkgs-master = import inputs.nixpkgs-master { pkgs-master = import inputs.nixpkgs-master {
inherit (prev.stdenv) system; inherit (prev.stdenv) system;
inherit (nixpkgsConfig) config; inherit (nixpkgsConfig) config;
@ -242,7 +249,7 @@
colors = import ./overlays/colors.nix; colors = import ./overlays/colors.nix;
# Overlay useful on Macs with Apple Silicon # Overlay useful on Macs with Apple Silicon
apple-silicon = final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") { apple-silicon = _final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
# Add access to x86 packages system is running Apple Silicon # Add access to x86 packages system is running Apple Silicon
pkgs-x86 = import inputs.nixpkgs-unstable { pkgs-x86 = import inputs.nixpkgs-unstable {
system = "x86_64-darwin"; system = "x86_64-darwin";
@ -250,8 +257,8 @@
}; };
}; };
patched = final: prev: optionalAttrs prev.stdenv.isDarwin { patched = _final: prev: optionalAttrs prev.stdenv.isDarwin {
inherit (inputs) kitty-icon fisher-src; inherit (inputs) kitty-icon kitty-rose-pine fisher-src;
lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; }; lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; };
}; };
}; };
@ -298,8 +305,9 @@
}; };
}; };
} // flake-utils.lib.eachDefaultSystem (system: { } // flake-utils.lib.eachDefaultSystem (system:
legacyPackages = import inputs.nixpkgs-unstable { let
pkgs = import inputs.nixpkgs-unstable {
inherit system; inherit system;
inherit (nixpkgsConfig) config; inherit (nixpkgsConfig) config;
overlays = with self.overlays; [ overlays = with self.overlays; [
@ -310,5 +318,20 @@
patched patched
]; ];
}; };
in
{
legacyPackages = pkgs;
checks.pre-commit = pre-commit.lib.${system}.run {
src = ./.;
hooks = {
deadnix.enable = true;
nix-linter.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
};
};
devShells.default = pkgs.mkShell { inherit (self.checks.${system}.pre-commit) shellHook; };
}); });
} }

View File

@ -204,7 +204,7 @@
# Other # Other
".." = "cd .."; ".." = "cd ..";
":q" = "exit"; ":q" = "exit";
cat = "${bat}/bin/bat --style=plain"; cat = "${bat}/bin/bat --style=plain --paging=never";
du = "${du-dust}/bin/dust"; du = "${du-dust}/bin/dust";
g = "${gitAndTools.git}/bin/git"; g = "${gitAndTools.git}/bin/git";
ls = "${exa}/bin/exa"; ls = "${exa}/bin/exa";

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, pkgs, ... }:
{ {
# Git # Git

View File

@ -1,7 +1,6 @@
{ config, lib, pkgs, ... }: { pkgs, ... }:
# Let-In --------------------------------------------------------------------------------------- {{{ # Let-In --------------------------------------------------------------------------------------- {{{
let let
inherit (lib) mkIf;
colorsToKitty = colors: with colors; { colorsToKitty = colors: with colors; {
inherit inherit
background background
@ -33,6 +32,7 @@ let
color15 = white; color15 = white;
url_color = brightgreen; url_color = brightgreen;
}; };
font = "CaskaydiaCove Nerd Font";
in in
# }}} # }}}
{ {
@ -44,7 +44,7 @@ in
# General config ----------------------------------------------------------------------------- {{{ # General config ----------------------------------------------------------------------------- {{{
programs.kitty.settings = { programs.kitty.settings = {
font_family = "FiraCode Nerd Font"; font_family = font;
font_size = "14.0"; font_size = "14.0";
adjust_line_height = "120%"; adjust_line_height = "120%";
disable_ligatures = "cursor"; # disable ligatures when cursor is on them disable_ligatures = "cursor"; # disable ligatures when cursor is on them
@ -68,13 +68,18 @@ in
macos_option_as_alt = "both"; macos_option_as_alt = "both";
}; };
programs.kitty.extras.useSymbolsFromNerdFont = "FiraCode Nerd Font"; programs.kitty.extras.useSymbolsFromNerdFont = font;
# }}} # }}}
# Colors config ------------------------------------------------------------------------------ {{{ # Colors config ------------------------------------------------------------------------------ {{{
programs.kitty.extras.colors.enable = true; programs.kitty.extras.colors = {
programs.kitty.extras.colors.dark = colorsToKitty pkgs.lib.colors.tokyonight.dark; enable = true;
programs.kitty.extras.colors.light = colorsToKitty pkgs.lib.colors.tokyonight.light; dark = colorsToKitty pkgs.lib.colors.tokyonight.dark;
light = colorsToKitty pkgs.lib.colors.tokyonight.light;
color-pkg = pkgs.kitty-rose-pine;
dark-name = "dist/rose-pine";
light-name = "dist/rose-pine-dawn";
};
programs.fish.functions.set-term-colors = { programs.fish.functions.set-term-colors = {
body = '' body = ''

View File

@ -17,9 +17,27 @@ in
enable = true; enable = true;
config = { config = {
style = "auto"; style = "auto";
theme = "base16-256";
}; };
}; };
# See `./fish.nix` for more on how this is used.
fish = {
functions = {
set-bat-colors = {
body = ''
if test "$term_background" = light
set -xg BAT_THEME "Monokai Extended Light"
else
set -xg BAT_THEME "TwoDark"
end
'';
onVariable = "term_background";
};
};
interactiveShellInit = ''
# Set `bat` colors based on value of `$term_backdround` when shell starts up.
set-bat-colors
'';
};
# Direnv, load and unload environment variables depending on the current directory. # Direnv, load and unload environment variables depending on the current directory.
# https://direnv.net # https://direnv.net
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.direnv.enable # https://rycee.gitlab.io/home-manager/options.html#opt-programs.direnv.enable
@ -31,7 +49,7 @@ in
enable = true; enable = true;
package = pkgs.helix-flake; package = pkgs.helix-flake;
settings = { settings = {
theme = "base16_transparent"; theme = "rose_pine";
editor.indent-guides.render = true; editor.indent-guides.render = true;
}; };
}; };
@ -98,10 +116,11 @@ in
# Useful nix related tools # Useful nix related tools
cachix # adding/managing alternative binary caches hosted by Cachix cachix # adding/managing alternative binary caches hosted by Cachix
comma # run software from without installing it comma # run software from nixpkgs without installing it
nixpkgs-fmt nixpkgs-fmt
nix-prefetch-git nix-prefetch-git
nix-tree nix-tree
nil # nix language server
] ++ lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
m-cli # useful macOS CLI commands m-cli # useful macOS CLI commands
is-dark-mode # see /overlays/colors.nix is-dark-mode # see /overlays/colors.nix

View File

@ -14,9 +14,7 @@
]; ];
directory.fish_style_pwd_dir_length = 1; # turn on fish directory truncation directory.fish_style_pwd_dir_length = 1; # turn on fish directory truncation
directory.truncation_length = 2; # number of directories not to truncate directory.truncation_length = 2; # number of directories not to truncate
# hostname.style = "bold green"; # don't like the default
memory_usage.disabled = true; # because it includes cached memory it's reported as full a lot memory_usage.disabled = true; # because it includes cached memory it's reported as full a lot
# username.style_user = "bold blue"; # don't like the default
}; };
# }}} # }}}
} }

View File

@ -23,18 +23,18 @@ let
# Shell scripts for changing Kitty colors # Shell scripts for changing Kitty colors
term-background = pkgs.writeShellScriptBin "term-background" '' term-background = pkgs.writeShellScriptBin "term-background" ''
# Accepts arguments "light" or "dark". # Accepts the name of a theme file in color-pkg
# If shell is running in a Kitty window set the colors. # If shell is running in a Kitty window set the colors.
if [ -n "$KITTY_WINDOW_ID" ]; then if [ -n "$KITTY_WINDOW_ID" ]; then
kitty @ --to $KITTY_LISTEN_ON set-colors --all --configured \ kitty @ --to $KITTY_LISTEN_ON set-colors --all --configured \
${kitty-colors}/"$1".conf & ${cfg.colors.color-pkg}/"$1".conf &
fi fi
''; '';
term-light = pkgs.writeShellScriptBin "term-light" '' term-light = pkgs.writeShellScriptBin "term-light" ''
${term-background}/bin/term-background light ${term-background}/bin/term-background ${cfg.colors.light-name}
''; '';
term-dark = pkgs.writeShellScriptBin "term-dark" '' term-dark = pkgs.writeShellScriptBin "term-dark" ''
${term-background}/bin/term-background dark ${term-background}/bin/term-background ${cfg.colors.dark-name}
''; '';
in in
{ {
@ -67,6 +67,24 @@ in
Kitty color settings for light background colorscheme. Kitty color settings for light background colorscheme.
''; '';
}; };
color-pkg = mkOption {
type = types.package;
default = kitty-colors;
description = "Package from which to load kitty colors.";
};
light-name = mkOption {
type = types.str;
default = "light";
description = "The name to use for the light colorscheme.";
};
dark-name = mkOption {
type = types.str;
default = "dark";
description = "The name to use for the dark colorscheme.";
};
}; };
useSymbolsFromNerdFont = mkOption { useSymbolsFromNerdFont = mkOption {
@ -131,12 +149,10 @@ in
}; };
programs.kitty.settings = optionalAttrs cfg.colors.enable programs.kitty.settings = optionalAttrs cfg.colors.enable
(
{ {
allow_remote_control = "yes"; allow_remote_control = "yes";
listen_on = "unix:/tmp/mykitty"; listen_on = "unix:/tmp/mykitty";
} } // optionalAttrs (cfg.useSymbolsFromNerdFont != "") {
) // optionalAttrs (cfg.useSymbolsFromNerdFont != "") {
# https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points # https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points
symbol_map = "U+E5FA-U+E62B,U+E700-U+E7C5,U+F000-U+F2E0,U+E200-U+E2A9,U+F500-U+FD46,U+E300-U+E3EB,U+F400-U+F4A8,U+2665,U+26a1,U+F27C,U+E0A3,U+E0B4-U+E0C8,U+E0CA,U+E0CC-U+E0D2,U+E0D4,U+23FB-U+23FE,U+2B58,U+F300-U+F313,U+E000-U+E00D ${cfg.useSymbolsFromNerdFont}"; symbol_map = "U+E5FA-U+E62B,U+E700-U+E7C5,U+F000-U+F2E0,U+E200-U+E2A9,U+F500-U+FD46,U+E300-U+E3EB,U+F400-U+F4A8,U+2665,U+26a1,U+F27C,U+E0A3,U+E0B4-U+E0C8,U+E0CA,U+E0CC-U+E0D2,U+E0D4,U+23FB-U+23FE,U+2B58,U+F300-U+F313,U+E000-U+E00D ${cfg.useSymbolsFromNerdFont}";

View File

@ -1,4 +1,4 @@
final: prev: { _final: prev: {
lib = prev.lib // { lib = prev.lib // {
colors = { colors = {
tokyonight = import ./colors/tokyonight.nix; tokyonight = import ./colors/tokyonight.nix;

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, undmg, unzip, version ? "0.12", ... }: { stdenv, fetchurl, undmg, unzip, version ? "0.12", ... }:
stdenv.mkDerivation { stdenv.mkDerivation {
inherit version; inherit version;