Git Product home page Git Product logo

nixpkgs's Introduction

My Nix Configs

Build Nix envs

This repo contains my Nix configs for macOS and Linux and by extension, configuration for most tools/programs I use, at least in the terminal.

I'm continuously tweaking/improving my setup, trying to find ways to make more of my configuration declarative, and I like experimenting with bleeding edge updates/features, so this repo sees a lot of changes. I do try to ensure that master always builds and doesn't have any bad bugs (at least in my workflow), and keep the code fairly well documented.

Feel free to file an issue or start a discussion if you find a bug, or think something is broken, or think I'm doing something in a dumb/clumsy way and have a suggestion for a more elegant alternative, or try to crib something from my config but just can't get it working, or are looking at my config and think to yourself "does this guy know about X, cause I bet he'd be into it", or have some other type of feedback/comment. (Issues, are better for things that are actually issues, while discussions are better for ideas, questions, etc.)

I make no promises that I'll respond quickly, or fix the bug (especially if I'm not experiencing it), or whatever, but you definitely shouldn't feel like you're imposing in any way, and I probably will respond within a few days.

Below, I've highlighted stuff that I'm particularly happy with or think others might find helpful/useful.

Highlights

In no particular order:

  • Flakes!
    • All external dependencies managed through flakes for easy updating.
    • Outputs for nix-darwin macOS system configurations (using home-manager as a nix-darwin module) and a home-manager user configuration for Linux.
    • A function to simplify making nix-darwin system configurations (with home-manager integration), lib.mkDarwinSystem.
    • darwinModules output for nix-darwin modules with additional functionality and prepackaged configuration, including:
      • users-primaryUser that provides users.primaryUsers.{username,fullName,email,nixConfigDirectory} options, which allows specifying this information one time by setting these options and then referencing their values when setting other options.
    • homeManagerModules output for home-manager modules with additional functionality and prepackaged configuration, including:
      • [home-user-info], that provides the same options as the my nix-darwin module users-primaryUsers above under home.user-info. See examples of it in use in home/git.nix, home/neovim.nix.
      • colors which is a WIP module used to define colorschemes. See home/colors.nix, for an example of how to define a colorscheme.
      • programs-neovim-extras that provides programs.neovim.extras.{defaultEditor,nvrAliases,termBufferAutoChangeDir} options.
      • programs-kitty-extras that provides a,
        • programs.kitty.extras.colors option to configure a light and dark colorscheme, which when used also adds term-light, term-dark, and term-background scripts to home.packages to easily switch between them; and a
        • programs.kitty.extras.useSymbolsFromNerdFont option to use symbols from a NerdFont while using any font with Kitty.
      • malo-git-aliases
      • malo-gh-aliases
      • malo-startship-symbols that provides predefined configuration of symbols for Starship prompt using NerdFont symbols.
    • Support for non-flake compatible versions of Nix and legacy workflows through flake-compat:
      • default.nix, allows traditional Nix commands like nix-build to operate on the flake inputs/outputs.
  • Support for Macs with Apple Silicon including ability to easily overlay in x86 version of packages, when they don't build on ARM. Search pkgs-x86 in flake.nix and see nix.settings.extra-platforms in darwin/bootstrap.nix for details.
  • A GitHub workflow that builds the my macOS system nix-darwin config and home-manager Linux user config, and updates a Cachix cache. Also, once a week it updates all the flake inputs before building, and if the build succeeds, it commits the updated flake.lock file.
  • Git config with a bunch of handy aliases and better diffs using delta.
  • A slick Neovim config in Lua. See also neovim.nix.
  • Unified colorscheme (based on Solarized) with light and dark variant for Kitty terminal, Fish shell, Neovim, and other tools, where toggling between light and dark can be done for all of them simultaneously by calling a Fish function. This is achieved by:
    • using the colors module mentioned above;
    • using my programs-kitty-extras home-manager module (see above);
    • using a self-made WIP Solarized based colorscheme with Neovim; and
    • a Fish shell config, which provides a toggle-background function (and an alias tb) which toggles a universal environment variable ($term_background) between the values "light" and "dark", along with set-shell-colors function which trigger automatically when $term_background changes.
  • A nice shell prompt config for Fish using Starship.

nixpkgs's People

Contributors

jeremyschlatter avatar malob avatar matthewfallshaw avatar rubas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nixpkgs's Issues

homebrew installation?

Hi Malob,

Thanks a ton for the great nix-darwin configuration, I've been using it to write a very simple how to for M1 Macs https://discourse.nixos.org/t/simple-workable-config-for-m1-macbook-pro-monterey-12-0-1-with-nix-flakes-nix-darwin-and-home-manager/16834

I'm now looking at the homebrew aspect of your config, and I just wanted to confirm that there is not way as of yet to install homebrew using nix? It seems that the homebrew module and homebrew.enable = true expect homebrew to have been installed manually? Is that right?

Cheers,

Jun

Thank you

Hi,

I just want to say thank you for sharing your config and documenting it. I bootstrapped my dotfiles and heavily based my initial config on your repo.

Feel free to close the issue.

neovim error on requiring init.lua from init.vim

hello! i recently discovered your config and i tried to replicate at my own iwth some minor changes because i wanted to migrate from init.vim to init.lua

everything went ok owever i'm getting a weid error that i'm unable to debug and solve it :/

the error is:

Error detected while processing /home/matthew/.config/nvim/init.vim:
line   16:
E5108: Error executing lua attempt to compare string with number
Press ENTER or type command to continue

and that's my init.vim:

set packpath^=/nix/store/ayalijl9cyzsxlz5rj69nzlx49g22m05-vim-pack-dir
set runtimepath^=/nix/store/ayalijl9cyzsxlz5rj69nzlx49g22m05-vim-pack-dir

" vim-polyglot {{{
lua require('matthew.vim-polyglot')
" }}}
" nvim-tree-lua {{{
lua require('matthew.nvim-tree-lua')
" }}}
" galaxyline-nvim {{{
lua require('matthew.galaxyline-nvim')
" }}}
" nvim-bufferline-lua {{{
lua require('matthew.nvim-bufferline-lua')
" }}}
lua require('init')

and my init.lua:

local set = vim.opt
local wo = vim.wo
local g = vim.g
local cmd = vim.cmd
local env = vim.env

g.mapleader = ','
g.maplocalleader = '\\'

 -- my custom options
set.hidden = true
set.tabstop = 2
set.shiftwidth = 2
set.number = true
set.relativenumber = true
set.background = 'dark'
set.formatoptions:remove({ 'cro' })
set.autoindent = true
set.autoread = true
set.cmdheight = 1
set.whichwrap:append({ '<', '>', '[', ']', 'h', 'l' })
set.shortmess:append({ 'c' })
set.wildignore:append({ '**/node_modules/**', '**/deps/**', '**/_build/**' })
set.conceallevel = 0 -- `` on markdown and ** in org shows up
set.so = 999 -- cursor never leaves mid screen
set.nocompatible = true
set.nowrap = true
set.encoding = 'utf-8'
set.fileencoding = 'utf-8'
set.pumheight = 10 -- popup smaller
set.ruler = true
set.splitbelow = true -- horizontal split will be below
set.splitright = true -- vertical split will be to the right
set.t_Co = 256 -- support 256 colors
set.showtabline = 0 -- never show tabs
set.updatetime = 300
set.timeoutlen = 1000
set.incsearch = true
set.wildmenu = true
set.smarttab = true
set.expandtab = true
set.smartindent = true
set.laststatus = 2 -- always shoes status line
set.ignorecase = true -- make searches with lower case characters case insensative
set.smartcase  = true -- search is case sensitive only if it contains uppercase chars

-- load no config plugins
require('orgmode').setup()
require('gitsigns').setup()
require('colorizer').setup()
require('nvim-web-devicons').setup({ default = true; })

-- telescope keybindings
vim.api.nvim_set_keymap('', '<leader>ff', ':Telescpope find_files<cr>', { norepmap = true })
vim.api.nvim_set_keymap('', '<leader>fg', ':Telescpope live_grep<cr>', { norepmap = true })
vim.api.nvim_set_keymap('', '<leader>fb', ':Telescpope buffers<cr>', { norepmap = true })
vim.api.nvim_set_keymap('', '<leader>fh', ':Telescpope help_tags<cr>', { norepmap = true })

-- small plugins config and extra config
g.rainbow_active = 1
g.direnv_silent_load = 1
g.dashboard_default_executive = 'telescope'
g.bullets_enabled_file_types = { 'markdown', 'text', 'gitcommit', 'orgmode', 'scratch' }

cmd 'colorscheme dracula'
cmd 'filetype plugin on'
cmd 'filetype plugin indent on'

if g.syntax_on then
  cmd 'syntax enable'
end

-- true colors
--g.'\&t_8f' = '\<Esc>[38;2;%lu;%lu;%lum'
--g.'\&t_8b' = '\<Esc>[48;2;%lu;%lu;%lum'
set.termguicolors = true

vim.api.nvim_set_keymap('', '<cr>', [[:noh<cr><cr>]], { noremap = true })

-- you can't stop me
vim.api.nvim_set_keymap('c', 'w!!', [[!sudo tee %]])

could you help me?

Neovim Config

Thanks for sharing your config here! I used it with minor changes and it is a really neat set of tools and customizations.

I had two errors on the neovim config the past weeks and fixed them now.

  1. init_lsp_saga is deprecated it should be require'lspsaga'.setup { now apparently
  2. indent_blankline had similar changes to the api and the new line would be: require'ibl'.setup {

Happy to send a PR if this is an error others have two and the change make sense for me it removes two error messages on neovim startup.

mas-cli continually "updates" some apps

Apps currently experiencing this issue for me are:

  • 1Blocker
  • DaisyDisk

Apps are installed via mas using brew bundle, by the nix-darwin Hombrew module:

homebrew.masApps = {
"1Blocker" = 1107421413;
"1Password" = 1333542190;
"Accelerate for Safari" = 1459809092;
DaisyDisk = 411643860;
"Dark Mode for Safari" = 1397180934;
Deliveries = 924726344;
Fantastical = 975937182;
Keynote = 409183694;
"LG Screen Manager" = 1142051783;
MindNode = 1289197285;
Numbers = 409203825;
Pages = 409201541;
Patterns = 429449079;
Pixelmator = 407963104;
"Pixelmator Pro" = 1289583905;
"Save to Raindrop.io" = 1549370672;
Slack = 803453959;
SiteSucker = 442168834;
"Things 3" = 904280696;
"Type Fu" = 509818877;
Ulysses = 1225570693;
Vimari = 1480933944;
"WiFi Explorer" = 494803304;
Xcode = 497799835;
};

Should be resolved when this PR lands: mas-cli/mas#346

Module to Require Password as Well as Touch ID for Sudo

First off, thanks for sharing your great nix-darwin setup. Your contributions to nix-darwin, especially the Homebrew module, have been awesome for me! So thanks.

So I love the idea of using Nix-darwin to manage my Touch ID PAM setup. One suggestion I would love implemented would be to add a module to require a password as well Touch ID -- not just Touch ID. That way, sudo auth would be multi factor.

I could see how not everyone would want this, so I could understand maybe making a separate module for this instead of making it the default behavior of security.pam.enableSudoTouchIdAuth.

I am pretty much going to bed right now but I will give it a bit more thought on how I would implement it. I may try to submit a pull request except I suck at Nix's syntax so I thought I'd write up an issue before I tried anything (I am definitely passively hoping you get around to implementing this before I even try anything ;).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.