Add some packages, format with nixpkgs-fmt
parent
52f410cb3e
commit
a695374977
|
@ -4,9 +4,13 @@
|
||||||
|
|
||||||
nix.binaryCaches = [
|
nix.binaryCaches = [
|
||||||
"https://cache.nixos.org/"
|
"https://cache.nixos.org/"
|
||||||
|
"https://hydra.iohk.io"
|
||||||
|
"https://nix-community.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="
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
];
|
];
|
||||||
nix.trustedUsers = [
|
nix.trustedUsers = [
|
||||||
"@admin"
|
"@admin"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
|
@ -37,17 +37,19 @@ in
|
||||||
"homebrew/core"
|
"homebrew/core"
|
||||||
"homebrew/services"
|
"homebrew/services"
|
||||||
"nrlquaker/createzap"
|
"nrlquaker/createzap"
|
||||||
|
"unisonweb/unison"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Prefer installing application from the Mac App Store
|
# Prefer installing application from the Mac App Store
|
||||||
homebrew.masApps = {
|
homebrew.masApps = {
|
||||||
Bitwarden = 1352778147;
|
Bitwarden = 1352778147;
|
||||||
Spark = 1176895641;
|
Spark = 1176895641;
|
||||||
};
|
};
|
||||||
|
|
||||||
# If an app isn't available in the Mac App Store, or the version in the App Store has
|
# If an app isn't available in the Mac App Store, or the version in the App Store has
|
||||||
# limitiations, e.g., Transmit, install the Homebrew Cask.
|
# limitiations, e.g., Transmit, install the Homebrew Cask.
|
||||||
homebrew.casks = [
|
homebrew.casks = [
|
||||||
|
"aerial"
|
||||||
"alfred"
|
"alfred"
|
||||||
"discord"
|
"discord"
|
||||||
"element"
|
"element"
|
||||||
|
@ -59,14 +61,15 @@ in
|
||||||
"rectangle"
|
"rectangle"
|
||||||
"signal"
|
"signal"
|
||||||
"steam"
|
"steam"
|
||||||
|
"unison-language"
|
||||||
"vscodium"
|
"vscodium"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Configuration related to casks
|
# Configuration related to casks
|
||||||
environment.variables.SSH_AUTH_SOCK = mkIfCaskPresent "secretive"
|
environment.variables.SSH_AUTH_SOCK = mkIfCaskPresent "secretive"
|
||||||
"/Users/${config.users.primaryUser}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
|
"/Users/${config.users.primaryUser}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
|
||||||
|
|
||||||
# For cli packages that aren't currently available for macOS in `nixpkgs`.Packages should be
|
# For cli packages that aren't currently available for macOS in `nixpkgs`.Packages should be
|
||||||
# installed in `../home/default.nix` whenever possible.
|
# installed in `../home/default.nix` whenever possible.
|
||||||
homebrew.brews = [];
|
homebrew.brews = [ ];
|
||||||
}
|
}
|
22
default.nix
22
default.nix
|
@ -1,10 +1,14 @@
|
||||||
# See https://nixos.wiki/wiki/Flakes#Using_flakes_project_from_a_legacy_Nix
|
# See https://nixos.wiki/wiki/Flakes#Using_flakes_project_from_a_legacy_Nix
|
||||||
(import (
|
(import
|
||||||
let
|
(
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
let
|
||||||
in fetchTarball {
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
in
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash; }
|
fetchTarball {
|
||||||
) {
|
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||||
src = ./.;
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||||
}).defaultNix
|
}
|
||||||
|
)
|
||||||
|
{
|
||||||
|
src = ./.;
|
||||||
|
}).defaultNix
|
||||||
|
|
306
flake.nix
306
flake.nix
|
@ -18,170 +18,170 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, darwin, nixpkgs, home-manager, flake-utils, ... }@inputs:
|
outputs = { self, darwin, nixpkgs, home-manager, flake-utils, ... }@inputs:
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (darwin.lib) darwinSystem;
|
inherit (darwin.lib) darwinSystem;
|
||||||
inherit (inputs.nixpkgs-unstable.lib) attrValues makeOverridable optionalAttrs singleton;
|
inherit (inputs.nixpkgs-unstable.lib) attrValues makeOverridable optionalAttrs singleton;
|
||||||
|
|
||||||
# Configuration for `nixpkgs`
|
# Configuration for `nixpkgs`
|
||||||
nixpkgsConfig = {
|
nixpkgsConfig = {
|
||||||
config = { allowUnfree = true; };
|
config = { allowUnfree = true; };
|
||||||
# overlays = attrValues self.overlays;
|
# overlays = attrValues self.overlays;
|
||||||
overlays = attrValues self.overlays ++ singleton (
|
overlays = attrValues self.overlays ++ singleton (
|
||||||
# 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
|
||||||
final: prev: (optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
|
final: prev: (optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
|
||||||
inherit (final.pkgs-x86)
|
inherit (final.pkgs-x86)
|
||||||
# idris2
|
# idris2
|
||||||
# nix-index
|
# nix-index
|
||||||
# purescript;
|
# purescript;
|
||||||
niv;
|
niv;
|
||||||
})
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
# Shared home-manager configs
|
|
||||||
homeManagerStateVersion = "22.05";
|
|
||||||
homeManagerCommonConfig = {
|
|
||||||
imports = attrValues self.homeManagerModules ++ [
|
|
||||||
./home
|
|
||||||
{ home.stateVersion = homeManagerStateVersion; }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Modules shared by most `nix-darwin` personal configurations.
|
|
||||||
nixDarwinCommonModules = attrValues self.darwinModules ++ [
|
|
||||||
# Main `nix-darwin` config
|
|
||||||
./darwin
|
|
||||||
# `home-manager` module
|
|
||||||
home-manager.darwinModules.home-manager
|
|
||||||
(
|
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
inherit (config.users) primaryUser;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
nixpkgs = nixpkgsConfig;
|
|
||||||
# Hack to support legacy worklows that use `<nixpkgs>` etc.
|
|
||||||
nix.nixPath = { nixpkgs = "$HOME/dotfiles.nix/nixpkgs.nix"; };
|
|
||||||
# `home-manager` config
|
|
||||||
users.users.${primaryUser}.home = "/Users/${primaryUser}";
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.users.${primaryUser} = homeManagerCommonConfig;
|
|
||||||
# Add a registry entry for this flake
|
|
||||||
nix.registry.my.flake = self;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# `nix-darwin` configs
|
|
||||||
darwinConfigurations = rec {
|
|
||||||
# Mininal configurations to bootstrap systems
|
|
||||||
bootstrap-x86 = makeOverridable darwinSystem {
|
|
||||||
system = "x86_64-darwin";
|
|
||||||
modules = [ ./darwin/bootstrap.nix { nixpkgs = nixpkgsConfig; } ];
|
|
||||||
};
|
|
||||||
bootstrap-arm = bootstrap-x86.override { system = "aarch64-darwin"; };
|
|
||||||
|
|
||||||
# M1 MBP
|
|
||||||
matbook = darwinSystem {
|
|
||||||
system = "aarch64-darwin";
|
|
||||||
modules = nixDarwinCommonModules ++ [
|
|
||||||
{
|
|
||||||
users.primaryUser = "mat";
|
|
||||||
networking.computerName = "matbook pro m1";
|
|
||||||
networking.hostName = "matbook";
|
|
||||||
networking.knownNetworkServices = [
|
|
||||||
"Wi-Fi"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Config with small modifications needed/desired for CI with GitHub workflow
|
|
||||||
githubCI = darwinSystem {
|
|
||||||
system = "x86_64-darwin";
|
|
||||||
modules = nixDarwinCommonModules ++ [
|
|
||||||
({ lib, ... }: {
|
|
||||||
users.primaryUser = "runner";
|
|
||||||
homebrew.enable = lib.mkForce false;
|
|
||||||
})
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
# Shared home-manager configs
|
||||||
|
homeManagerStateVersion = "22.05";
|
||||||
|
homeManagerCommonConfig = {
|
||||||
|
imports = attrValues self.homeManagerModules ++ [
|
||||||
|
./home
|
||||||
|
{ home.stateVersion = homeManagerStateVersion; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Build and activate with `nix build .#cloudVM.activationPackage; ./result/activate`
|
# Modules shared by most `nix-darwin` personal configurations.
|
||||||
cloudVM = home-manager.lib.homeManagerConfiguration {
|
nixDarwinCommonModules = attrValues self.darwinModules ++ [
|
||||||
system = "x86_64-linux";
|
# Main `nix-darwin` config
|
||||||
stateVersion = homeManagerStateVersion;
|
./darwin
|
||||||
homeDirectory = "/home/mat";
|
# `home-manager` module
|
||||||
username = "mat";
|
home-manager.darwinModules.home-manager
|
||||||
configuration = {
|
(
|
||||||
imports = [ homeManagerCommonConfig ];
|
{ config, lib, pkgs, ... }:
|
||||||
nixpkgs = nixpkgsConfig;
|
let
|
||||||
};
|
inherit (config.users) primaryUser;
|
||||||
};
|
in
|
||||||
|
{
|
||||||
# attrValues self.darwinModules ++ [
|
nixpkgs = nixpkgsConfig;
|
||||||
# # Main `nix-darwin` config
|
# Hack to support legacy worklows that use `<nixpkgs>` etc.
|
||||||
# ./configuration.nix
|
nix.nixPath = { nixpkgs = "$HOME/dotfiles.nix/nixpkgs.nix"; };
|
||||||
# # `home-manager` module
|
# `home-manager` config
|
||||||
# home-manager.darwinModules.home-manager
|
users.users.${primaryUser}.home = "/Users/${primaryUser}";
|
||||||
# {
|
home-manager.useGlobalPkgs = true;
|
||||||
# nixpkgs = nixpkgsConfig;
|
home-manager.users.${primaryUser} = homeManagerCommonConfig;
|
||||||
# # `home-manager` config
|
# Add a registry entry for this flake
|
||||||
# home-manager.useGlobalPkgs = true;
|
nix.registry.my.flake = self;
|
||||||
# home-manager.useUserPackages = true;
|
}
|
||||||
# home-manager.users.mat = import ./home.nix;
|
)
|
||||||
# }
|
];
|
||||||
# ];
|
in
|
||||||
# };
|
{
|
||||||
};
|
# `nix-darwin` configs
|
||||||
|
darwinConfigurations = rec {
|
||||||
# Overlays --------------------------------------------------------------- {{{
|
# Mininal configurations to bootstrap systems
|
||||||
|
bootstrap-x86 = makeOverridable darwinSystem {
|
||||||
overlays = {
|
|
||||||
# nixpkgs overlays
|
|
||||||
pkgs-stable = final: prev: {
|
|
||||||
pkgs-stable = import inputs.nixpkgs {
|
|
||||||
inherit (prev.stdenv) system;
|
|
||||||
inherit (nixpkgsConfig) config;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
pkgs-unstable = final: prev: {
|
|
||||||
pkgs-unstable = import inputs.nixpkgs-unstable {
|
|
||||||
inherit (prev.stdenv) system;
|
|
||||||
inherit (nixpkgsConfig) config;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
colors = import ./overlays/colors.nix;
|
|
||||||
|
|
||||||
# Overlay useful on Macs with Apple Silicon
|
|
||||||
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";
|
system = "x86_64-darwin";
|
||||||
inherit (nixpkgsConfig) config;
|
modules = [ ./darwin/bootstrap.nix { nixpkgs = nixpkgsConfig; } ];
|
||||||
|
};
|
||||||
|
bootstrap-arm = bootstrap-x86.override { system = "aarch64-darwin"; };
|
||||||
|
|
||||||
|
# M1 MBP
|
||||||
|
matbook = darwinSystem {
|
||||||
|
system = "aarch64-darwin";
|
||||||
|
modules = nixDarwinCommonModules ++ [
|
||||||
|
{
|
||||||
|
users.primaryUser = "mat";
|
||||||
|
networking.computerName = "matbook pro m1";
|
||||||
|
networking.hostName = "matbook";
|
||||||
|
networking.knownNetworkServices = [
|
||||||
|
"Wi-Fi"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Config with small modifications needed/desired for CI with GitHub workflow
|
||||||
|
githubCI = darwinSystem {
|
||||||
|
system = "x86_64-darwin";
|
||||||
|
modules = nixDarwinCommonModules ++ [
|
||||||
|
({ lib, ... }: {
|
||||||
|
users.primaryUser = "runner";
|
||||||
|
homebrew.enable = lib.mkForce false;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Build and activate with `nix build .#cloudVM.activationPackage; ./result/activate`
|
||||||
|
cloudVM = home-manager.lib.homeManagerConfiguration {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
stateVersion = homeManagerStateVersion;
|
||||||
|
homeDirectory = "/home/mat";
|
||||||
|
username = "mat";
|
||||||
|
configuration = {
|
||||||
|
imports = [ homeManagerCommonConfig ];
|
||||||
|
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 = {
|
||||||
|
# nixpkgs overlays
|
||||||
|
pkgs-stable = final: prev: {
|
||||||
|
pkgs-stable = import inputs.nixpkgs {
|
||||||
|
inherit (prev.stdenv) system;
|
||||||
|
inherit (nixpkgsConfig) config;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
pkgs-unstable = final: prev: {
|
||||||
|
pkgs-unstable = import inputs.nixpkgs-unstable {
|
||||||
|
inherit (prev.stdenv) system;
|
||||||
|
inherit (nixpkgsConfig) config;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
colors = import ./overlays/colors.nix;
|
||||||
|
|
||||||
|
# Overlay useful on Macs with Apple Silicon
|
||||||
|
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";
|
||||||
|
inherit (nixpkgsConfig) config;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
# `nix-darwin` modules (some are pending upstream acceptance)
|
# `nix-darwin` modules (some are pending upstream acceptance)
|
||||||
darwinModules = {
|
darwinModules = {
|
||||||
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
# home manager configurations
|
# home manager configurations
|
||||||
homeManagerModules = {
|
homeManagerModules = {
|
||||||
# configs-git-aliases = import ./home/configs/git-aliases.nix;
|
# configs-git-aliases = import ./home/configs/git-aliases.nix;
|
||||||
# configs-gh-aliases = import ./home/configs/gh-aliases.nix;
|
# configs-gh-aliases = import ./home/configs/gh-aliases.nix;
|
||||||
configs-starship-symbols = import ./home/configs/starship-symbols.nix;
|
configs-starship-symbols = import ./home/configs/starship-symbols.nix;
|
||||||
programs-neovim-extras = import ./modules/home/programs/neovim/extras.nix;
|
programs-neovim-extras = import ./modules/home/programs/neovim/extras.nix;
|
||||||
programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix;
|
programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // flake-utils.lib.eachDefaultSystem (system: {
|
} // flake-utils.lib.eachDefaultSystem (system: {
|
||||||
legacyPackages = import inputs.nixpkgs-unstable {
|
legacyPackages = import inputs.nixpkgs-unstable {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.atuin.enable
|
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.atuin.enable
|
||||||
atuin = {
|
atuin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {};
|
settings = { };
|
||||||
};
|
};
|
||||||
# a nicer cat
|
# a nicer cat
|
||||||
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.bat.enable
|
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.bat.enable
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
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 without installing it
|
||||||
niv # easy dependency management for nix projects
|
niv # easy dependency management for nix projects
|
||||||
nixfmt
|
nixpkgs-fmt
|
||||||
nix-prefetch-git
|
nix-prefetch-git
|
||||||
# nodePackages.node2nix
|
# nodePackages.node2nix
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ let
|
||||||
inactive_tab_background = "#${strong}";
|
inactive_tab_background = "#${strong}";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# }}}
|
# }}}
|
||||||
{
|
{
|
||||||
# Kitty terminal
|
# Kitty terminal
|
||||||
# https://sw.kovidgoyal.net/kitty/conf.html
|
# https://sw.kovidgoyal.net/kitty/conf.html
|
||||||
|
|
|
@ -128,35 +128,36 @@
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
programs.fish.shellAliases =
|
programs.fish.shellAliases =
|
||||||
let
|
let
|
||||||
nixConfigDir = "${config.home.homeDirectory}/dotfiles.nix";
|
nixConfigDir = "${config.home.homeDirectory}/dotfiles.nix";
|
||||||
in with pkgs; {
|
in
|
||||||
# My additions
|
with pkgs; {
|
||||||
code = "codium";
|
# My additions
|
||||||
# OG
|
code = "codium";
|
||||||
# Nix related
|
# OG
|
||||||
drb = "darwin-rebuild build --flake ${nixConfigDir}/";
|
# Nix related
|
||||||
drs = "darwin-rebuild switch --flake ${nixConfigDir}/";
|
drb = "darwin-rebuild build --flake ${nixConfigDir}/";
|
||||||
drc = "codium ${nixConfigDir}";
|
drs = "darwin-rebuild switch --flake ${nixConfigDir}/";
|
||||||
flakeup = "nix flake update --recreate-lock-file ${nixConfigDir}/";
|
drc = "codium ${nixConfigDir}";
|
||||||
nb = "nix build";
|
flakeup = "nix flake update --recreate-lock-file ${nixConfigDir}/";
|
||||||
nd = "nix develop";
|
nb = "nix build";
|
||||||
nf = "nix flake";
|
nd = "nix develop";
|
||||||
nr = "nix run";
|
nf = "nix flake";
|
||||||
ns = "nix search";
|
nr = "nix run";
|
||||||
|
ns = "nix search";
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
".." = "cd ..";
|
".." = "cd ..";
|
||||||
":q" = "exit";
|
":q" = "exit";
|
||||||
cat = "${bat}/bin/bat";
|
cat = "${bat}/bin/bat";
|
||||||
du = "${du-dust}/bin/dust";
|
du = "${du-dust}/bin/dust";
|
||||||
g = "${gitAndTools.git}/bin/git";
|
g = "${gitAndTools.git}/bin/git";
|
||||||
la = "ll -a";
|
la = "ll -a";
|
||||||
ll = "ls -l --time-style long-iso --icons";
|
ll = "ls -l --time-style long-iso --icons";
|
||||||
ls = "${exa}/bin/exa";
|
ls = "${exa}/bin/exa";
|
||||||
ps = "${procs}/bin/procs";
|
ps = "${procs}/bin/procs";
|
||||||
tb = "toggle-background";
|
tb = "toggle-background";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configuration that should be above `loginShellInit` and `interactiveShellInit`.
|
# Configuration that should be above `loginShellInit` and `interactiveShellInit`.
|
||||||
programs.fish.shellInit = ''
|
programs.fish.shellInit = ''
|
||||||
|
|
|
@ -13,5 +13,5 @@
|
||||||
''}
|
''}
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -17,24 +17,25 @@ let
|
||||||
# added line that includes the name of the option, to make it easier to identify the line that
|
# added line that includes the name of the option, to make it easier to identify the line that
|
||||||
# should be deleted when the option is disabled.
|
# should be deleted when the option is disabled.
|
||||||
mkSudoTouchIdAuthScript = isEnabled:
|
mkSudoTouchIdAuthScript = isEnabled:
|
||||||
let
|
let
|
||||||
file = "/etc/pam.d/sudo";
|
file = "/etc/pam.d/sudo";
|
||||||
option = "security.pam.enableSudoTouchIdAuth";
|
option = "security.pam.enableSudoTouchIdAuth";
|
||||||
in ''
|
in
|
||||||
${if isEnabled then ''
|
''
|
||||||
# Enable sudo Touch ID authentication, if not already enabled
|
${if isEnabled then ''
|
||||||
if ! grep 'pam_tid.so' ${file} > /dev/null; then
|
# Enable sudo Touch ID authentication, if not already enabled
|
||||||
sed -i "" '2i\
|
if ! grep 'pam_tid.so' ${file} > /dev/null; then
|
||||||
auth sufficient pam_tid.so # nix-darwin: ${option}
|
sed -i "" '2i\
|
||||||
' ${file}
|
auth sufficient pam_tid.so # nix-darwin: ${option}
|
||||||
fi
|
' ${file}
|
||||||
'' else ''
|
fi
|
||||||
# Disable sudo Touch ID authentication, if added by nix-darwin
|
'' else ''
|
||||||
if grep '${option}' ${file} > /dev/null; then
|
# Disable sudo Touch ID authentication, if added by nix-darwin
|
||||||
sed -i "" '/${option}/d' ${file}
|
if grep '${option}' ${file} > /dev/null; then
|
||||||
fi
|
sed -i "" '/${option}/d' ${file}
|
||||||
''}
|
fi
|
||||||
'';
|
''}
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@ let
|
||||||
cfg = config.programs.kitty.extras;
|
cfg = config.programs.kitty.extras;
|
||||||
|
|
||||||
# Create a Kitty config string from a Nix set
|
# Create a Kitty config string from a Nix set
|
||||||
setToKittyConfig = with generators; toKeyValue { mkKeyValue = mkKeyValueDefault {} " "; };
|
setToKittyConfig = with generators; toKeyValue { mkKeyValue = mkKeyValueDefault { } " "; };
|
||||||
|
|
||||||
# Write a Nix set representing a kitty config into the Nix store
|
# Write a Nix set representing a kitty config into the Nix store
|
||||||
writeKittyConfig = fileName: config: pkgs.writeTextDir "${fileName}" (setToKittyConfig config);
|
writeKittyConfig = fileName: config: pkgs.writeTextDir "${fileName}" (setToKittyConfig config);
|
||||||
|
@ -36,7 +36,8 @@ let
|
||||||
${term-background}/bin/term-background dark
|
${term-background}/bin/term-background dark
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
|
|
||||||
options.programs.kitty.extras = {
|
options.programs.kitty.extras = {
|
||||||
colors = {
|
colors = {
|
||||||
|
@ -55,7 +56,7 @@ in {
|
||||||
|
|
||||||
dark = mkOption {
|
dark = mkOption {
|
||||||
type = with types; attrsOf str;
|
type = with types; attrsOf str;
|
||||||
default = {};
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Kitty color settings for dark background colorscheme.
|
Kitty color settings for dark background colorscheme.
|
||||||
'';
|
'';
|
||||||
|
@ -63,7 +64,7 @@ in {
|
||||||
|
|
||||||
light = mkOption {
|
light = mkOption {
|
||||||
type = with types; attrsOf str;
|
type = with types; attrsOf str;
|
||||||
default = {};
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Kitty color settings for light background colorscheme.
|
Kitty color settings for light background colorscheme.
|
||||||
'';
|
'';
|
||||||
|
@ -71,7 +72,7 @@ in {
|
||||||
|
|
||||||
common = mkOption {
|
common = mkOption {
|
||||||
type = with types; attrsOf str;
|
type = with types; attrsOf str;
|
||||||
default = {};
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Kitty color settings that the light and dark background colorschemes share.
|
Kitty color settings that the light and dark background colorschemes share.
|
||||||
'';
|
'';
|
||||||
|
@ -109,14 +110,15 @@ in {
|
||||||
term-background
|
term-background
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.kitty.settings = optionalAttrs cfg.colors.enable (
|
programs.kitty.settings = optionalAttrs cfg.colors.enable
|
||||||
|
(
|
||||||
|
|
||||||
cfg.colors.common // cfg.colors.${cfg.colors.default} // {
|
cfg.colors.common // cfg.colors.${cfg.colors.default} // {
|
||||||
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}";
|
||||||
|
|
|
@ -109,7 +109,7 @@ in
|
||||||
|
|
||||||
luaPackages = mkOption {
|
luaPackages = mkOption {
|
||||||
type = with types; listOf package;
|
type = with types; listOf package;
|
||||||
default = [];
|
default = [ ];
|
||||||
example = [ pkgs.luajitPackages.busted pkgs.luajitPackages.luafilesystem ];
|
example = [ pkgs.luajitPackages.busted pkgs.luajitPackages.luafilesystem ];
|
||||||
description = ''
|
description = ''
|
||||||
Lua packages to make available in Neovim Lua environment.
|
Lua packages to make available in Neovim Lua environment.
|
||||||
|
@ -151,7 +151,8 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
programs.fish.interactiveShellInit = mkIf
|
programs.fish.interactiveShellInit = mkIf
|
||||||
(cfg.termBufferAutoChangeDir || cfg.nvrAliases.enable) shellConfig;
|
(cfg.termBufferAutoChangeDir || cfg.nvrAliases.enable)
|
||||||
|
shellConfig;
|
||||||
|
|
||||||
programs.neovim.plugins = lib.singleton (
|
programs.neovim.plugins = lib.singleton (
|
||||||
pkgs.vimUtils.buildVimPluginFrom2Nix {
|
pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||||
|
|
11
nixpkgs.nix
11
nixpkgs.nix
|
@ -1,7 +1,6 @@
|
||||||
{
|
{ system ? builtins.currentSystem
|
||||||
system ? builtins.currentSystem,
|
, config ? { }
|
||||||
config ? {},
|
, overlays ? [ ]
|
||||||
overlays ? [],
|
, ...
|
||||||
...
|
|
||||||
}@args:
|
}@args:
|
||||||
import (import ./default.nix).inputs.nixpkgs-unstable args
|
import (import ./default.nix).inputs.nixpkgs-unstable args
|
||||||
|
|
|
@ -28,7 +28,7 @@ final: prev: {
|
||||||
darkBase = "002b36"; # base03
|
darkBase = "002b36"; # base03
|
||||||
darkBasehl = "073642"; # base02
|
darkBasehl = "073642"; # base02
|
||||||
darkestTone = "586e75"; # base01
|
darkestTone = "586e75"; # base01
|
||||||
darkTone = "657b83"; # base00
|
darkTone = "657b83"; # base00
|
||||||
lightTone = "839496"; # base0
|
lightTone = "839496"; # base0
|
||||||
lightestTone = "93a1a1"; # base1
|
lightestTone = "93a1a1"; # base1
|
||||||
lightBasehl = "eee8d5"; # base2
|
lightBasehl = "eee8d5"; # base2
|
||||||
|
|
Loading…
Reference in New Issue