Big reorg based on malob

work
Matthew Ess 2022-09-15 17:17:21 -04:00
parent 859d5488e5
commit a79991d5c9
18 changed files with 217 additions and 271 deletions

View File

@ -6,7 +6,7 @@ spiritually a fork of https://github.com/malob/nixpkgs, but using a repo i alrea
## installation ## installation
```shell ```shell
$ nix build .#darwinConfigurations.matbook.system $ nix build .#configurations.matbook.system
$ ./result/sw/bin/darwin-rebuild switch --flake . $ ./result/sw/bin/darwin-rebuild switch --flake .
``` ```

View File

@ -1,40 +0,0 @@
syntax on
filetype plugin indent on
set cursorline "highlight current line
set showmatch "highlight matching [{()}]
set tabstop=2 "number of visual spaces per TAB when reading
set softtabstop=2 "number of spaces per TAB when editing
set expandtab "tabs are spaces
set shiftwidth=2 "indents
set ww=<,>,[,] "wrap
set splitbelow "split underneath
set splitright "split to the right
command Mks NERDTreeClose | mksession!
command Term split | term
command Vterm vsplit | term
"save readonly
cmap w!! w !sudo tee >/dev/null %
"terminal exit
tnoremap <Esc> <C-\><C-n><CR>
"nohl
nnoremap <silent> ,<space> :nohlsearch<CR>
colorscheme tokyonight
let g:lightline = {'colorscheme': 'tokyonight'}
"cursor saving
autocmd BufReadPost * if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
"nerdtree
"show hidden files
let NERDTreeShowHidden=1
"open on vim open
"autocmd vimenter * NERDTree
"switch to editing window
"autocmd vimenter * wincmd p
"close if only nerdtree is left
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"show/hide nerdtree
nnoremap <silent> <c-b> :NERDTreeToggle<CR>

View File

@ -1,7 +0,0 @@
{ system ? builtins.currentSystem
, nixpkgs ? ./nixpkgs.nix
, pkgs ? import nixpkgs { inherit system; }
, lib ? pkgs.lib
, ...
}@args:
import (import ./default.nix).inputs.darwin args

View File

@ -2,36 +2,40 @@
{ {
# Nix configuration ------------------------------------------------------------------------------ # Nix configuration ------------------------------------------------------------------------------
nix.settings.trusted-substituters = [ nix.settings = {
trusted-substituters = [
"https://cache.nixos.org/" "https://cache.nixos.org/"
"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" "https://mat.cachix.org"
]; ];
nix.settings.trusted-public-keys = [ trusted-public-keys = [
"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=" "mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno="
]; ];
nix.settings.trusted-users = [ trusted-users = [
"@admin" "@admin"
]; ];
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
extra-platforms = lib.mkIf (pkgs.system == "aarch64-darwin") [ "x86_64-darwin" "aarch64-darwin" ];
};
nix.configureBuildUsers = true; nix.configureBuildUsers = true;
# Enable experimental nix command and flakes
nix.extraOptions = ''
auto-optimise-store = true
experimental-features = nix-command flakes
'' + lib.optionalString (pkgs.system == "aarch64-darwin") ''
extra-platforms = x86_64-darwin aarch64-darwin
'';
# Auto upgrade nix package and the daemon service. # Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true; services.nix-daemon.enable = true;
# Make Fish the default shell # Make Fish the default shell
environment.shells = with pkgs; [
bashInteractive
fish
zsh
];
programs.fish.enable = true; programs.fish.enable = true;
programs.fish.useBabelfish = true; programs.fish.useBabelfish = true;
programs.fish.babelfishPackage = pkgs.babelfish; programs.fish.babelfishPackage = pkgs.babelfish;

View File

@ -0,0 +1,21 @@
{
# dark-mode-notify configuration
# {{{
launchd.enable = true;
launchd.agents.dark-mode-notify = {
enable = true;
config = {
Label = "ke.bou.dark-mode-notify";
KeepAlive = true;
StandardErrorPath = null;
StandardOutPath = null;
ProgramArguments = [
"${pkgs.dark-mode-notify}/bin/dark-mode-notify"
"${pkgs.fish}/bin/fish"
"-c"
"set-background-to-env DARKMODE"
];
};
};
# }}}
}

View File

@ -2,10 +2,7 @@
{ {
system.defaults.NSGlobalDomain = { system.defaults.NSGlobalDomain = {
# "com.apple.trackpad.scaling" = "3.0"; AppleInterfaceStyleSwitchesAutomatically = true;
# AppleInterfaceStyleSwitchesAutomatically = false;
# InitialKeyRepeat = 15;
# KeyRepeat = 2;
NSAutomaticCapitalizationEnabled = false; NSAutomaticCapitalizationEnabled = false;
_HIHideMenuBar = false; _HIHideMenuBar = false;
}; };

View File

@ -1,30 +1,13 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
imports = [
./bootstrap.nix
./homebrew.nix
./macos-defaults.nix
];
# Apps # Apps
# `home-manager` currently has issues adding them to `~/Applications` # `home-manager` currently has issues adding them to `~/Applications`
# Issue: https://github.com/nix-community/home-manager/issues/1341 # Issue: https://github.com/nix-community/home-manager/issues/1341
# See workaround at ../home/copyApplications.nix # See workaround at ../home/copyApplications.nix
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
discord-ptb
element-desktop
# firefox *
kitty kitty
lagrange
# mullvad-vpn *
obsidian
# signal-desktop *
slack
# steam *
terminal-notifier terminal-notifier
# zoom-us *
# *no nixpkgs darwin support T.T
]; ];
# https://github.com/nix-community/home-manager/issues/423 # https://github.com/nix-community/home-manager/issues/423
@ -33,11 +16,6 @@
}; };
programs.nix-index.enable = true; programs.nix-index.enable = true;
environment.shells = with pkgs; [
bashInteractive
fish
zsh
];
# Fonts # Fonts
fonts.fontDir.enable = true; fonts.fontDir.enable = true;
fonts.fonts = with pkgs; [ fonts.fonts = with pkgs; [

View File

@ -61,17 +61,22 @@ in
"alfred" "alfred"
"bartender" "bartender"
# "cursorcerer" # "cursorcerer"
"discord"
"element"
"firefox" "firefox"
"jitsi-meet" "jitsi-meet"
"knockknock" "knockknock"
"lagrange"
"logitech-options" "logitech-options"
"lulu" "lulu"
"macsvg" "macsvg"
"miniforge" "miniforge"
# "mullvadvpn" # "mullvadvpn"
"obsidian"
"rectangle" "rectangle"
"secretive" "secretive"
"signal" "signal"
"slack"
"stay" "stay"
"transmission" "transmission"
# "twitch" # "twitch"
@ -87,7 +92,7 @@ in
# 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.username}/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.

124
flake.nix
View File

@ -59,43 +59,44 @@
attrValues attrValues
genAttrs genAttrs
makeOverridable makeOverridable
optional optionalAttrs;
optionalAttrs
singleton;
# Configuration for `nixpkgs` # Configuration for `nixpkgs`
nixpkgsConfig = { nixpkgsConfig = {
config = { allowUnfree = true; }; config = { allowUnfree = true; };
overlays = attrValues self.overlays ++ singleton ( overlays = attrValues self.overlays ++ [
final: prev: (final: prev:
let import ./pkgs {
pkgs = import ./pkgs {
inherit inputs genAttrs; inherit inputs genAttrs;
inherit (final) callPackage; inherit (final) callPackage;
inherit (final.stdenv) system; inherit (final.stdenv) system;
}; })
in (final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin")
pkgs // 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);
} })
); ];
}; };
# Shared home-manager configs
homeManagerStateVersion = "22.05"; homeManagerStateVersion = "22.05";
homeManagerCommonConfig = {
imports = attrValues self.homeManagerModules ++ [ primaryUserInfo = {
./home username = "mat";
{ home.stateVersion = homeManagerStateVersion; } fullName = "mat ess";
]; email = "mat@mat.services";
nixConfigDirectory = "/Users/mat/dotfiles.nix";
};
workUserInfo = {
username = "mess";
fullName = "Matthew Ess";
email = "mess@yelp.com";
nixConfigDirectory = "/Users/mess/dotfiles.nix";
}; };
# Modules shared by most `nix-darwin` personal configurations. # Modules shared by most `nix-darwin` personal configurations.
nixDarwinCommonModules = attrValues self.darwinModules ++ [ nixDarwinCommonModules = attrValues self.darwinModules ++ [
# Main `nix-darwin` config
./darwin
# `home-manager` module # `home-manager` module
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
( (
@ -105,15 +106,20 @@
in in
{ {
nixpkgs = nixpkgsConfig; nixpkgs = nixpkgsConfig;
# Hack to support legacy worklows that use `<nixpkgs>` etc. # Hack to support legacy worklows that use `<nixpkgs>`, darwin-option, etc.
nix.nixPath = { nix.nixPath = {
nixpkgs = "$HOME/dotfiles.nix/nixpkgs.nix"; nixpkgs = "${inputs.nixpkgs-unstable}";
darwin = "$HOME/dotfiles.nix/darwin.nix"; darwin = "${inputs.darwin}";
}; };
# `home-manager` config # `home-manager` config
users.users.${primaryUser}.home = "/Users/${primaryUser}"; users.users.${primaryUser.username}.home = "/Users/${primaryUser.username}";
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.users.${primaryUser} = homeManagerCommonConfig; home-manager.users.${primaryUser.username} = {
imports = attrValues self.homeManagerModules;
home.stateVersion = homeManagerStateVersion;
home.primaryUser = primaryUser;
home.enableNixpkgsReleaseCheck = true;
};
# Add a registry entry for this flake # Add a registry entry for this flake
nix.registry.my.flake = self; nix.registry.my.flake = self;
} }
@ -135,7 +141,7 @@
system = "aarch64-darwin"; system = "aarch64-darwin";
modules = nixDarwinCommonModules ++ [ modules = nixDarwinCommonModules ++ [
({ pkgs, ... }: { ({ pkgs, ... }: {
users.primaryUser = "mat"; users.primaryUser = primaryUserInfo;
networking.computerName = "matbook pro m1"; networking.computerName = "matbook pro m1";
networking.hostName = "matbook"; networking.hostName = "matbook";
networking.knownNetworkServices = [ networking.knownNetworkServices = [
@ -153,8 +159,6 @@
programs.fish.shellAliases = { programs.fish.shellAliases = {
code = "${pkgs.vscodium}/bin/codium"; code = "${pkgs.vscodium}/bin/codium";
}; };
programs.git.userEmail = "mat@mat.services";
programs.git.userName = "mat ess";
programs.ssh.matchBlocks.remarkable = { programs.ssh.matchBlocks.remarkable = {
hostname = "10.11.99.1"; hostname = "10.11.99.1";
user = "root"; user = "root";
@ -170,7 +174,7 @@
system = "aarch64-darwin"; system = "aarch64-darwin";
modules = nixDarwinCommonModules ++ [ modules = nixDarwinCommonModules ++ [
({ pkgs, ... }: { ({ pkgs, ... }: {
users.primaryUser = "mess"; users.primaryUser = workUserInfo;
networking.knownNetworkServices = [ networking.knownNetworkServices = [
"Wi-Fi" "Wi-Fi"
]; ];
@ -184,8 +188,6 @@
]; ];
homebrew.casks = [ "itsycal" ]; homebrew.casks = [ "itsycal" ];
home-manager.sharedModules = [{ home-manager.sharedModules = [{
programs.git.userEmail = "mess@yelp.com";
programs.git.userName = "Matthew Ess";
programs.ssh.matchBlocks.devbox = { programs.ssh.matchBlocks.devbox = {
hostname = "amp1"; hostname = "amp1";
forwardAgent = true; forwardAgent = true;
@ -204,22 +206,35 @@
system = "x86_64-darwin"; system = "x86_64-darwin";
modules = nixDarwinCommonModules ++ [ modules = nixDarwinCommonModules ++ [
({ lib, ... }: { ({ lib, ... }: {
users.primaryUser = "runner"; users.primaryUser = primaryUserInfo // {
username = "runner";
nixConfigDirectory = "/Users/runner/work/nixpkgs/nixpkgs";
};
homebrew.enable = lib.mkForce false; 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;
}; };
# Build and activate on new system with:
# `nix build .#homeConfigurations.<name>.activationPackage; ./result/activate`
homeConfigurations = rec {
cloudVM = home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs-unstable {
system = "x86_64-linux";
inherit (nixpkgsConfig) config overlays;
};
modules = attrValues self.homeManagerModules ++ [
({ config, ... }: {
home.username = config.home.primaryUser.username;
home.homeDirectory = "/home/${config.home.username}";
home.stateVersion = homeManagerStateVersion;
home.primaryUser = primaryUserInfo // {
nixConfigDirectory = "${config.home.homeDirectory}/dotfiles.nix";
};
})
];
}; };
}; };
@ -270,21 +285,38 @@
}; };
}; };
# `nix-darwin` modules (some are pending upstream acceptance) # `nix-darwin` configs and modules
darwinModules = { darwinModules = {
# configs
bootstrap = import ./darwin/bootstrap.nix;
defaults = import ./darwin/defaults.nix;
general = import ./darwin/general.nix;
homebrew = import ./darwin/homebrew.nix;
# modules
games = import ./modules/darwin/games.nix; games = import ./modules/darwin/games.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; primary-user = import ./modules/darwin/primary-user.nix;
}; };
# home manager configurations # home manager configurations
homeManagerModules = { homeManagerModules = {
# configs-git-aliases = import ./home/configs/git-aliases.nix; # configs
# 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;
copyApplications = import ./home/copyApplications.nix;
files = import ./home/files.nix;
fish = import ./home/fish.nix;
git = import ./home/git.nix;
kakoune = import ./home/kakoune.nix;
kitty = import ./home/kitty.nix;
programs = import ./home/programs.nix;
starship = import ./home/starship.nix;
# modules
programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix; programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix;
programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix; programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix;
home-primary-user = { lib, ... }: {
options.home.primaryUser =
(self.darwinModules.primary-user { inherit lib; }).options.users.primaryUser;
};
}; };
} // flake-utils.lib.eachDefaultSystem (system: { } // flake-utils.lib.eachDefaultSystem (system: {

15
home/files.nix Normal file
View File

@ -0,0 +1,15 @@
{ config, ... }: {
# Misc configuration files --------------------------------------------------------------------{{{
xdg = {
enable = true;
};
home.file.".pijulconfig".text = ''
[author]
name = "mat"
full_name = "${config.programs.git.userName}"
email = "${config.programs.git.userEmail}"
'';
# }}}
}

View File

@ -162,6 +162,10 @@
from-nix kak $file from-nix kak $file
''; '';
}; };
fish_command_not_found.body = ''
command_not_found_handle $argv
'';
}; };
# }}} # }}}
@ -181,8 +185,8 @@
drsf = "from-nix darwin-rebuild switch --flake ."; drsf = "from-nix darwin-rebuild switch --flake .";
# darwin-rebuild switch (no homebrew) # darwin-rebuild switch (no homebrew)
drs = "from-nix darwin-rebuild switch --flake . --override-input homebrew-enabled github:boolean-option/false"; drs = "from-nix darwin-rebuild switch --flake . --override-input homebrew-enabled github:boolean-option/false";
# edit darwin-rebuild config in codium # edit darwin-rebuild config in code/codium
drc = "codium ${nixConfigDir}"; drc = "code ${nixConfigDir}";
# edit darwin-rebuild config in vim # edit darwin-rebuild config in vim
drv = "vim ${nixConfigDir}"; drv = "vim ${nixConfigDir}";
# edit darwin-rebuild config in kakoune # edit darwin-rebuild config in kakoune
@ -199,7 +203,7 @@
# Other # Other
".." = "cd .."; ".." = "cd ..";
":q" = "exit"; ":q" = "exit";
cat = "${bat}/bin/bat"; cat = "${bat}/bin/bat --style=plain";
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";
@ -210,6 +214,7 @@
top = "${bottom}/bin/btm"; top = "${bottom}/bin/btm";
htop = "${bottom}/bin/btm"; htop = "${bottom}/bin/btm";
tb = "toggle-background"; tb = "toggle-background";
} // lib.optionalAttrs stdenv.isDarwin {
sb = "set-background-to-macOS"; sb = "set-background-to-macOS";
conda-init = "eval /opt/homebrew/Caskroom/miniforge/base/bin/conda 'shell.fish' 'hook' $argv | source"; conda-init = "eval /opt/homebrew/Caskroom/miniforge/base/bin/conda 'shell.fish' 'hook' $argv | source";
}; };
@ -234,45 +239,4 @@
init-shell-colors init-shell-colors
''; '';
# }}} # }}}
# Starship Prompt
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.starship.enable
programs.starship.enable = true;
# Starship settings -------------------------------------------------------------------------- {{{
programs.starship.settings = {
# See docs here: https://starship.rs/config/
# Symbols config configured in Flake.
battery.display = [
{ threshold = 25; } # display battery information if charge is <= 25%
];
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
};
# }}}
# dark-mode-notify configuration
# {{{
launchd.enable = true;
launchd.agents.dark-mode-notify = {
enable = true;
config = {
Label = "ke.bou.dark-mode-notify";
KeepAlive = true;
StandardErrorPath = null;
StandardOutPath = null;
ProgramArguments = [
"${pkgs.dark-mode-notify}/bin/dark-mode-notify"
"${pkgs.fish}/bin/fish"
"-c"
"set-background-to-env DARKMODE"
];
};
};
# }}}
} }

View File

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
# Git # Git
@ -6,6 +6,9 @@
# Aliases config imported in flake. # Aliases config imported in flake.
programs.git.enable = true; programs.git.enable = true;
programs.git.userEmail = config.home.primaryUser.email;
programs.git.userName = config.home.primaryUser.fullName;
programs.git.extraConfig = { programs.git.extraConfig = {
core.editor = "kak"; core.editor = "kak";
diff.colorMoved = "default"; diff.colorMoved = "default";

View File

@ -1,18 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
# Import config broken out into files # Programs + packages with configuration --------------------------------------------------------------- {{{
imports = [
./copyApplications.nix
./git.nix
./kakoune.nix
./kitty.nix
./shells.nix
];
home.enableNixpkgsReleaseCheck = true;
# Packages with configuration --------------------------------------------------------------- {{{
programs = { programs = {
# a nicer cat # a nicer cat
@ -20,7 +9,7 @@
bat = { bat = {
enable = true; enable = true;
config = { config = {
style = "plain"; style = "auto";
}; };
}; };
# Direnv, load and unload environment variables depending on the current directory. # Direnv, load and unload environment variables depending on the current directory.
@ -52,24 +41,12 @@
helix = { helix = {
enable = true; enable = true;
}; };
neovim = {
enable = true;
# viAlias = true;
# vimAlias = true;
# vimdiffAlias = true;
extraConfig = builtins.readFile ../configs/init.vim;
plugins = with pkgs.vimPlugins; [
neovim-sensible
tokyonight-nvim
lightline-vim
ctrlp
];
};
ssh = { ssh = {
enable = true; enable = true;
matchBlocks."*".extraOptions = { matchBlocks."*".extraOptions = {
UseKeychain = "yes"; UseKeychain = "yes";
AddKeysToAgent = "yes"; AddKeysToAgent = "yes";
} // lib.optionalAttrs pkgs.stdenv.isDarwin {
# TODO: gate this behind a check if the cask is present # TODO: gate this behind a check if the cask is present
IdentityAgent = "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; IdentityAgent = "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
}; };
@ -125,18 +102,4 @@
is-dark-mode # see /overlays/colors.nix is-dark-mode # see /overlays/colors.nix
]; ];
# }}} # }}}
# Misc configuration files --------------------------------------------------------------------{{{
xdg = {
enable = true;
};
home.file.".pijulconfig".text = ''
[author]
name = "mat"
full_name = "${config.programs.git.userName}"
email = "${config.programs.git.userEmail}"
'';
# }}}
} }

22
home/starship.nix Normal file
View File

@ -0,0 +1,22 @@
{
# Starship Prompt
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.starship.enable
programs.starship.enable = true;
# Starship settings -------------------------------------------------------------------------- {{{
programs.starship.settings = {
# See docs here: https://starship.rs/config/
# Symbols config configured in Flake.
battery.display = [
{ threshold = 25; } # display battery information if charge is <= 25%
];
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
};
# }}}
}

View File

@ -0,0 +1,26 @@
{ lib, ... }:
let
inherit (lib) mkOption types;
in
{
options.users.primaryUser = {
username = mkOption {
type = with types; nullOr string;
default = null;
};
fullName = mkOption {
type = with types; nullOr string;
default = null;
};
email = mkOption {
type = with types; nullOr string;
default = null;
};
nixConfigDirectory = mkOption {
type = with types; nullOr string;
default = null;
};
};
}

View File

@ -1,17 +0,0 @@
# Additional configuration for `nix-index` to enable `command-not-found` functionality with Fish.
{ config, lib, pkgs, ... }:
{
config = lib.mkIf config.programs.nix-index.enable {
programs.fish.interactiveShellInit = ''
function __fish_command_not_found_handler --on-event="fish_command_not_found"
${if config.programs.fish.useBabelfish then ''
command_not_found_handle $argv
'' else ''
${pkgs.bashInteractive}/bin/bash -c \
"source ${config.progams.nix-index.package}/etc/profile.d/command-not-found.sh; command_not_found_handle $argv"
''}
end
'';
};
}

View File

@ -1,14 +0,0 @@
{ lib, ... }:
let
inherit (lib) mkOption types;
in
{
options = {
users.primaryUser = mkOption {
type = with types; nullOr string;
default = null;
};
};
}

View File

@ -1,6 +0,0 @@
{ system ? builtins.currentSystem
, config ? { }
, overlays ? [ ]
, ...
}@args:
import (import ./default.nix).inputs.nixpkgs-unstable args