diff --git a/config.nix b/config.nix index c8ee2f8..75a8bcd 100644 --- a/config.nix +++ b/config.nix @@ -8,29 +8,27 @@ let modules = [ config ./modules/system.nix + ./modules/environment.nix ]; }; config = { - system.build.path = pkgs.buildEnv { - name = "system-path"; - paths = - [ pkgs.lnl.vim - pkgs.curl - pkgs.fzf - pkgs.gettext - pkgs.git - pkgs.jq - pkgs.silver-searcher - pkgs.tmux + environment.systemPackages = + [ pkgs.lnl.vim + pkgs.curl + pkgs.fzf + pkgs.gettext + pkgs.git + pkgs.jq + pkgs.silver-searcher + pkgs.tmux - pkgs.nix-prefetch-scripts - pkgs.nix-repl - pkgs.nox - ]; - }; + pkgs.nix-prefetch-scripts + pkgs.nix-repl + pkgs.nox + ]; environment.etc."profile".text = '' export HOMEBREW_CASK_OPTS="--appdir=/Applications/cask" @@ -38,8 +36,8 @@ let conf=$HOME/src/nixpkgs-config pkgs=$HOME/.nix-defexpr/nixpkgs - alias ls="ls -G" - alias l="ls -hl" + alias ls='ls -G' + alias l='ls -hl' ''; environment.etc."tmux.conf".text = '' @@ -76,8 +74,8 @@ let nixdarwin-rebuild () { case $1 in - 'switch') nix-env -iA nixpkgs.nixdarwin.toplevel ;; - ''') return 1 ;; + 'switch') nix-env -f '' -iA nixdarwin.toplevel ;; + ''') return 1 ;; esac } ''; @@ -85,6 +83,8 @@ let in { + inherit eval; + packageOverrides = self: { nixdarwin = eval.config.system.build; @@ -104,6 +104,17 @@ in { set list set listchars=tab:»·,trail:·,extends:⟩,precedes:⟨ + set fillchars+=vert:\ ,stl:\ ,stlnc:\ + + set clipboard=unnamed + + let mapleader = " " + nnoremap p :FZF + + set hlsearch + nnoremap // :nohlsearch + + nnoremap K ht lrk$ ''; vimrcConfig.vam.pluginDictionaries = [ { names = [ "fzfWrapper" "youcompleteme" "surround" "vim-nix" "colors-solarized" ]; } diff --git a/modules/environment.nix b/modules/environment.nix new file mode 100644 index 0000000..68c5677 --- /dev/null +++ b/modules/environment.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.environment; + +in { + options = { + + environment.systemPackages = mkOption { + type = types.listOf types.package; + default = []; + example = literalExample "[ pkgs.nix-repl pkgs.vim ]"; + description = '' + The set of packages that appear in + /run/current-system/sw. These packages are + automatically available to all users, and are + automatically updated every time you rebuild the system + configuration. (The latter is the main difference with + installing them in the default profile, + /nix/var/nix/profiles/default. + ''; + }; + + environment.extraOutputsToInstall = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ "doc" "info" "devdoc" ]; + description = "List of additional package outputs to be symlinked into /run/current-system/sw."; + }; + + }; + + config = { + + system.path = pkgs.buildEnv { + name = "system-path"; + paths = cfg.systemPackages; + inherit (cfg) extraOutputsToInstall; + }; + + }; +} diff --git a/modules/system.nix b/modules/system.nix index 8bd54d5..a0d2762 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -11,24 +11,31 @@ in { system.build = mkOption { internal = true; + type = types.attrsOf types.package; default = {}; description = '' Attribute set of derivation used to setup the system. ''; }; - system.activationScripts = mkOption { + system.path = mkOption { internal = true; - default = {}; + type = types.package; + description = '' + The packages you want in the system environment. + ''; }; + # Used by + system.activationScripts = mkOption { internal = true; }; + }; config = { system.build.toplevel = pkgs.buildEnv { name = "nixdarwin-system"; - paths = [ cfg.build.path cfg.build.etc ]; + paths = [ cfg.path cfg.build.etc ]; }; };