Compare commits
7 Commits
1e52b3a360
...
65e48c07c9
Author | SHA1 | Date |
---|---|---|
mat ess | 65e48c07c9 | |
mat ess | e1fb9b36fd | |
mat ess | 5f6c3ffd97 | |
mat ess | e11c455279 | |
mat ess | 736aca62e8 | |
mat ess | 7102375bd2 | |
mat ess | 0a206737ad |
|
@ -2,3 +2,5 @@ result
|
|||
result-*
|
||||
*.secret.*
|
||||
.nvimlog
|
||||
.pre-commit-config.yaml
|
||||
.direnv/
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"https://nix-community.cachix.org"
|
||||
"https://mat.cachix.org"
|
||||
"https://helix.cachix.org"
|
||||
"https://pre-commit-hooks.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
|
@ -17,6 +18,7 @@
|
|||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno="
|
||||
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
|
||||
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
|
||||
];
|
||||
trusted-users = [
|
||||
"@admin"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
system.defaults.NSGlobalDomain = {
|
||||
AppleInterfaceStyleSwitchesAutomatically = true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = [ pkgs.terminal-notifier ];
|
||||
|
@ -6,13 +6,17 @@
|
|||
# Fonts
|
||||
fonts.fontDir.enable = true;
|
||||
fonts.fonts = with pkgs; [
|
||||
borg-sans-mono
|
||||
inter
|
||||
recursive
|
||||
(nerdfonts.override {
|
||||
enableWindowsFonts = false;
|
||||
fonts = [
|
||||
"FantasqueSansMono"
|
||||
"JetBrainsMono"
|
||||
"CascadiaCode"
|
||||
"iA-Writer"
|
||||
"Inconsolata"
|
||||
"FiraCode"
|
||||
"SourceCodePro"
|
||||
"Lilex"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
|
|
@ -46,12 +46,14 @@
|
|||
"aerial"
|
||||
"alfred"
|
||||
"bartender"
|
||||
"bbedit"
|
||||
# "discord"
|
||||
# "element"
|
||||
"firefox"
|
||||
"jitsi-meet"
|
||||
"knockknock"
|
||||
# "lagrange"
|
||||
"lapce"
|
||||
"logi-options-plus"
|
||||
"lulu"
|
||||
"macsvg"
|
||||
|
|
56
flake.lock
56
flake.lock
|
@ -321,6 +321,22 @@
|
|||
"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": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
|
@ -396,6 +412,42 @@
|
|||
"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": {
|
||||
"inputs": {
|
||||
"dark-mode-notify-src": "dark-mode-notify-src",
|
||||
|
@ -408,9 +460,11 @@
|
|||
"home-manager-atemu": "home-manager-atemu",
|
||||
"homebrew-enabled": "homebrew-enabled",
|
||||
"kitty-icon": "kitty-icon",
|
||||
"kitty-rose-pine": "kitty-rose-pine",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-master": "nixpkgs-master",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"pre-commit": "pre-commit"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
|
|
73
flake.nix
73
flake.nix
|
@ -26,6 +26,11 @@
|
|||
home-manager-atemu.url = "github:Atemu/home-manager/darwin-copy-apps-fully-wip";
|
||||
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
|
||||
helix.url = "github:helix-editor/helix";
|
||||
helix.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
@ -33,11 +38,13 @@
|
|||
dark-mode-notify-src.flake = false;
|
||||
kitty-icon.url = "github:DinkDonk/kitty-icon";
|
||||
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.flake = false;
|
||||
};
|
||||
|
||||
outputs = { self, darwin, home-manager, flake-utils, ... }@inputs:
|
||||
outputs = { self, darwin, home-manager, flake-utils, pre-commit, ... }@inputs:
|
||||
let
|
||||
|
||||
inherit (darwin.lib) darwinSystem;
|
||||
|
@ -50,16 +57,16 @@
|
|||
nixpkgsConfig = {
|
||||
config = { allowUnfree = true; };
|
||||
overlays = attrValues self.overlays ++ [
|
||||
(final: prev:
|
||||
(final: _prev:
|
||||
import ./pkgs {
|
||||
inherit inputs;
|
||||
inherit (final) callPackage;
|
||||
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
|
||||
inherit (final.pkgs-x86);
|
||||
# inherit (final.pkgs-x86);
|
||||
})
|
||||
];
|
||||
};
|
||||
|
@ -85,7 +92,7 @@
|
|||
# `home-manager` module
|
||||
home-manager.darwinModules.home-manager
|
||||
(
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, ... }:
|
||||
let
|
||||
inherit (config.users) primaryUser;
|
||||
in
|
||||
|
@ -195,7 +202,7 @@
|
|||
|
||||
# Build and activate on new system with:
|
||||
# `nix build .#homeConfigurations.<name>.activationPackage; ./result/activate`
|
||||
homeConfigurations = rec {
|
||||
homeConfigurations = {
|
||||
cloudVM = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import inputs.nixpkgs-unstable {
|
||||
system = "x86_64-linux";
|
||||
|
@ -218,21 +225,21 @@
|
|||
|
||||
overlays = {
|
||||
# nixpkgs overlays
|
||||
pkgs-stable = final: prev: {
|
||||
pkgs-stable = _final: prev: {
|
||||
pkgs-stable = import inputs.nixpkgs {
|
||||
inherit (prev.stdenv) system;
|
||||
inherit (nixpkgsConfig) config;
|
||||
};
|
||||
};
|
||||
|
||||
pkgs-unstable = final: prev: {
|
||||
pkgs-unstable = _final: prev: {
|
||||
pkgs-unstable = import inputs.nixpkgs-unstable {
|
||||
inherit (prev.stdenv) system;
|
||||
inherit (nixpkgsConfig) config;
|
||||
};
|
||||
};
|
||||
|
||||
pkgs-master = final: prev: {
|
||||
pkgs-master = _final: prev: {
|
||||
pkgs-master = import inputs.nixpkgs-master {
|
||||
inherit (prev.stdenv) system;
|
||||
inherit (nixpkgsConfig) config;
|
||||
|
@ -242,7 +249,7 @@
|
|||
colors = import ./overlays/colors.nix;
|
||||
|
||||
# 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
|
||||
pkgs-x86 = import inputs.nixpkgs-unstable {
|
||||
system = "x86_64-darwin";
|
||||
|
@ -250,8 +257,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
patched = final: prev: optionalAttrs prev.stdenv.isDarwin {
|
||||
inherit (inputs) kitty-icon fisher-src;
|
||||
patched = _final: prev: optionalAttrs prev.stdenv.isDarwin {
|
||||
inherit (inputs) kitty-icon kitty-rose-pine fisher-src;
|
||||
lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; };
|
||||
};
|
||||
};
|
||||
|
@ -298,17 +305,33 @@
|
|||
};
|
||||
};
|
||||
|
||||
} // flake-utils.lib.eachDefaultSystem (system: {
|
||||
legacyPackages = import inputs.nixpkgs-unstable {
|
||||
inherit system;
|
||||
inherit (nixpkgsConfig) config;
|
||||
overlays = with self.overlays; [
|
||||
pkgs-master
|
||||
pkgs-stable
|
||||
colors
|
||||
apple-silicon
|
||||
patched
|
||||
];
|
||||
};
|
||||
});
|
||||
} // flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs-unstable {
|
||||
inherit system;
|
||||
inherit (nixpkgsConfig) config;
|
||||
overlays = with self.overlays; [
|
||||
pkgs-master
|
||||
pkgs-stable
|
||||
colors
|
||||
apple-silicon
|
||||
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; };
|
||||
});
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@
|
|||
# Other
|
||||
".." = "cd ..";
|
||||
":q" = "exit";
|
||||
cat = "${bat}/bin/bat --style=plain";
|
||||
cat = "${bat}/bin/bat --style=plain --paging=never";
|
||||
du = "${du-dust}/bin/dust";
|
||||
g = "${gitAndTools.git}/bin/git";
|
||||
ls = "${exa}/bin/exa";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Git
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
# Let-In --------------------------------------------------------------------------------------- {{{
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
colorsToKitty = colors: with colors; {
|
||||
inherit
|
||||
background
|
||||
|
@ -33,6 +32,7 @@ let
|
|||
color15 = white;
|
||||
url_color = brightgreen;
|
||||
};
|
||||
font = "CaskaydiaCove Nerd Font";
|
||||
in
|
||||
# }}}
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ in
|
|||
# General config ----------------------------------------------------------------------------- {{{
|
||||
|
||||
programs.kitty.settings = {
|
||||
font_family = "FiraCode Nerd Font";
|
||||
font_family = font;
|
||||
font_size = "14.0";
|
||||
adjust_line_height = "120%";
|
||||
disable_ligatures = "cursor"; # disable ligatures when cursor is on them
|
||||
|
@ -68,13 +68,18 @@ in
|
|||
macos_option_as_alt = "both";
|
||||
};
|
||||
|
||||
programs.kitty.extras.useSymbolsFromNerdFont = "FiraCode Nerd Font";
|
||||
programs.kitty.extras.useSymbolsFromNerdFont = font;
|
||||
# }}}
|
||||
|
||||
# Colors config ------------------------------------------------------------------------------ {{{
|
||||
programs.kitty.extras.colors.enable = true;
|
||||
programs.kitty.extras.colors.dark = colorsToKitty pkgs.lib.colors.tokyonight.dark;
|
||||
programs.kitty.extras.colors.light = colorsToKitty pkgs.lib.colors.tokyonight.light;
|
||||
programs.kitty.extras.colors = {
|
||||
enable = true;
|
||||
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 = {
|
||||
body = ''
|
||||
|
|
|
@ -17,9 +17,27 @@ in
|
|||
enable = true;
|
||||
config = {
|
||||
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.
|
||||
# https://direnv.net
|
||||
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.direnv.enable
|
||||
|
@ -31,7 +49,7 @@ in
|
|||
enable = true;
|
||||
package = pkgs.helix-flake;
|
||||
settings = {
|
||||
theme = "base16_transparent";
|
||||
theme = "rose_pine";
|
||||
editor.indent-guides.render = true;
|
||||
};
|
||||
};
|
||||
|
@ -98,10 +116,11 @@ in
|
|||
|
||||
# Useful nix related tools
|
||||
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
|
||||
nix-prefetch-git
|
||||
nix-tree
|
||||
nil # nix language server
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
m-cli # useful macOS CLI commands
|
||||
is-dark-mode # see /overlays/colors.nix
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
];
|
||||
directory.fish_style_pwd_dir_length = 1; # turn on fish directory truncation
|
||||
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
|
||||
# username.style_user = "bold blue"; # don't like the default
|
||||
};
|
||||
# }}}
|
||||
}
|
||||
|
|
|
@ -23,18 +23,18 @@ let
|
|||
|
||||
# Shell scripts for changing Kitty colors
|
||||
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 [ -n "$KITTY_WINDOW_ID" ]; then
|
||||
kitty @ --to $KITTY_LISTEN_ON set-colors --all --configured \
|
||||
${kitty-colors}/"$1".conf &
|
||||
${cfg.colors.color-pkg}/"$1".conf &
|
||||
fi
|
||||
'';
|
||||
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-background}/bin/term-background dark
|
||||
${term-background}/bin/term-background ${cfg.colors.dark-name}
|
||||
'';
|
||||
in
|
||||
{
|
||||
|
@ -67,6 +67,24 @@ in
|
|||
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 {
|
||||
|
@ -131,12 +149,10 @@ in
|
|||
};
|
||||
|
||||
programs.kitty.settings = optionalAttrs cfg.colors.enable
|
||||
(
|
||||
{
|
||||
allow_remote_control = "yes";
|
||||
listen_on = "unix:/tmp/mykitty";
|
||||
}
|
||||
) // optionalAttrs (cfg.useSymbolsFromNerdFont != "") {
|
||||
{
|
||||
allow_remote_control = "yes";
|
||||
listen_on = "unix:/tmp/mykitty";
|
||||
} // optionalAttrs (cfg.useSymbolsFromNerdFont != "") {
|
||||
|
||||
# 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}";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
final: prev: {
|
||||
_final: prev: {
|
||||
lib = prev.lib // {
|
||||
colors = {
|
||||
tokyonight = import ./colors/tokyonight.nix;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, lib, fetchurl, undmg, unzip, version ? "0.12", ... }:
|
||||
{ stdenv, fetchurl, undmg, unzip, version ? "0.12", ... }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
inherit version;
|
||||
|
|
Loading…
Reference in New Issue