1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

added environment.systemPackages

This commit is contained in:
Daiderd Jordan 2016-10-19 20:03:17 +02:00
parent e9a483a569
commit 491e06ab15
3 changed files with 86 additions and 23 deletions

View file

@ -8,29 +8,27 @@ let
modules =
[ config
./modules/system.nix
./modules/environment.nix
<nixpkgs/nixos/modules/system/etc/etc.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 '<nixpkgs>' -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 <Leader>p :FZF<cr>
set hlsearch
nnoremap // :nohlsearch<cr>
nnoremap K ht lr<cr>k$
'';
vimrcConfig.vam.pluginDictionaries = [
{ names = [ "fzfWrapper" "youcompleteme" "surround" "vim-nix" "colors-solarized" ]; }

45
modules/environment.nix Normal file
View file

@ -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,
<filename>/nix/var/nix/profiles/default</filename>.
'';
};
environment.extraOutputsToInstall = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "doc" "info" "devdoc" ];
description = "List of additional package outputs to be symlinked into <filename>/run/current-system/sw</filename>.";
};
};
config = {
system.path = pkgs.buildEnv {
name = "system-path";
paths = cfg.systemPackages;
inherit (cfg) extraOutputsToInstall;
};
};
}

View file

@ -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 <nixos/modules/system/etc/etc.nix>
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 ];
};
};