Skip to content

Commit

Permalink
install nixfmt and format this project with it
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Jul 26, 2019
1 parent dabcd52 commit e75df1a
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 125 deletions.
8 changes: 2 additions & 6 deletions darwin/default.nix
@@ -1,15 +1,11 @@
{ config, pkgs, ... }:

{
imports = [
../home-manager/nix-darwin
./lorri.nix
./defaults.nix
];
imports = [ ../home-manager/nix-darwin ./lorri.nix ./defaults.nix ];

# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = [];
environment.systemPackages = [ ];

# Use a custom configuration.nix location.
# $ darwin-rebuild switch -I darwin-config=$HOME/.dotfiles/darwin/default.nix
Expand Down
12 changes: 3 additions & 9 deletions darwin/lorri.nix
@@ -1,17 +1,11 @@
{ pkgs, ... }:

let
lorri = pkgs.callPackage ../pkgs/lorri.nix {};
in
{
let lorri = pkgs.callPackage ../pkgs/lorri.nix { };
in {
launchd.user.agents.lorri = {
command = "lorri daemon";

path = [
lorri
pkgs.nix
pkgs.gnutar
];
path = [ lorri pkgs.nix pkgs.gnutar ];

serviceConfig = {
StandardErrorPath = "/usr/local/var/log/lorri.err.log";
Expand Down
15 changes: 6 additions & 9 deletions dotfiles/default.nix
@@ -1,15 +1,7 @@
{ pkgs, ... }:

{
imports = [
./direnv.nix
./emacs.nix
./fzf.nix
./git.nix
./neovim.nix
./ssh.nix
./zsh.nix
];
imports = [ ./direnv.nix ./emacs.nix ./fzf.nix ./git.nix ./neovim.nix ./ssh.nix ./zsh.nix ];

home.packages = [
pkgs.ag
Expand All @@ -23,6 +15,11 @@
# https://github.com/jwoudenberg/dotfiles/commit/12bd31b269b82f0dc661140b8df275ef24f41b81)
# but I don't want to have to symlink into the overlays directory manually.
(pkgs.callPackage ../pkgs/lorri.nix { })

# remote packages. Probably could do this better (or use various cachix
# implementations) but I don't really want to.
(import (fetchTarball "https://github.com/serokell/nixfmt/archive/e4f31f45799554ff378370256a24f606a3025b0a.tar.gz")
{ })
];

programs.man.enable = true;
Expand Down
110 changes: 24 additions & 86 deletions dotfiles/emacs.nix
Expand Up @@ -9,11 +9,7 @@ let
configs = [
{
file = ./emacs/init.el;
pkgs = epkgs: [
epkgs.general
epkgs.delight
epkgs.use-package
];
pkgs = epkgs: [ epkgs.general epkgs.delight epkgs.use-package ];
}
{
file = ./emacs/evil.el;
Expand All @@ -22,9 +18,9 @@ let
# fail to build. We'll patch it out for now and hope it gets fixed in a
# future version.
(epkgs.evil-escape.overrideAttrs (attrs: {
patches = (attrs.patches or []) ++ [
patches = (attrs.patches or [ ]) ++ [
(pkgs.fetchpatch {
url = https://github.com/BrianHicks/evil-escape/commit/b548e8450570a0c8dea47b47221b728c047a9baf.patch;
url = "https://github.com/BrianHicks/evil-escape/commit/b548e8450570a0c8dea47b47221b728c047a9baf.patch";
sha256 = "1a2qrf4bpj7wm84qa3haqdg3pd9d8nh5vrj8v1sc0j1a9jifsbf6";
})
];
Expand All @@ -41,24 +37,15 @@ let
}
{
file = ./emacs/basics.el;
pkgs = epkgs: [
epkgs.bug-hunter
epkgs.shackle
epkgs.smartparens
epkgs.which-key
epkgs.exec-path-from-shell
];
pkgs = epkgs: [ epkgs.bug-hunter epkgs.shackle epkgs.smartparens epkgs.which-key epkgs.exec-path-from-shell ];
}
{
file = ./emacs/compilation.el;
pkgs = epkgs: [];
pkgs = epkgs: [ ];
}
{
file = ./emacs/completion.el;
pkgs = epkgs: [
epkgs.company
epkgs.company-statistics
];
pkgs = epkgs: [ epkgs.company epkgs.company-statistics ];
}
{
file = ./emacs/diffing.el;
Expand All @@ -70,62 +57,39 @@ let
}
{
file = ./emacs/display.el;
pkgs = epkgs: [
epkgs.airline-themes
epkgs.doom-themes
epkgs.hl-todo
epkgs.powerline
epkgs.solaire-mode
];
pkgs = epkgs: [ epkgs.airline-themes epkgs.doom-themes epkgs.hl-todo epkgs.powerline epkgs.solaire-mode ];
}
{
file = ./emacs/eshell-config.el;
pkgs = epkgs: [];
pkgs = epkgs: [ ];
}
{
file = ./emacs/folding.el;
pkgs = epkgs: [ epkgs.origami ];
}
{
file = ./emacs/git.el;
pkgs = epkgs: [
epkgs.evil-magit
epkgs.magit
];
pkgs = epkgs: [ epkgs.evil-magit epkgs.magit ];
}
{
file = ./emacs/helm-config.el;
pkgs = epkgs: [
epkgs.helm
epkgs.helm-ag
];
pkgs = epkgs: [ epkgs.helm epkgs.helm-ag ];
}
{
file = ./emacs/icons.el;
pkgs = epkgs: [ epkgs.all-the-icons ];
}
{
file = ./emacs/jumping.el;
pkgs = epkgs: [
epkgs.ace-window
epkgs.avy
];
pkgs = epkgs: [ epkgs.ace-window epkgs.avy ];
}
{
file = ./emacs/linting.el;
pkgs = epkgs: [
epkgs.flycheck
epkgs.flycheck-status-emoji
epkgs.flycheck-color-mode-line
];
pkgs = epkgs: [ epkgs.flycheck epkgs.flycheck-status-emoji epkgs.flycheck-color-mode-line ];
}
{
file = ./emacs/projects.el;
pkgs = epkgs: [
epkgs.ag
epkgs.helm-projectile
epkgs.projectile
];
pkgs = epkgs: [ epkgs.ag epkgs.helm-projectile epkgs.projectile ];
}
{
file = ./emacs/snippets.el;
Expand All @@ -147,10 +111,7 @@ let
}
{
file = ./emacs/lang/dockerfile.el;
pkgs = epkgs: [
epkgs.alchemist
epkgs.elixir-mode
];
pkgs = epkgs: [ epkgs.alchemist epkgs.elixir-mode ];
}
{
file = ./emacs/lang/elm.el;
Expand Down Expand Up @@ -181,49 +142,35 @@ let
}
{
file = ./emacs/lang/haskell.el;
pkgs = epkgs: [
epkgs.haskell-mode
epkgs.hindent
epkgs.hlint-refactor
epkgs.intero
];
pkgs = epkgs: [ epkgs.haskell-mode epkgs.hindent epkgs.hlint-refactor epkgs.intero ];
}
{
file = ./emacs/lang/html.el;
pkgs = epkgs: [
epkgs.emmet-mode
epkgs.web-mode
];
pkgs = epkgs: [ epkgs.emmet-mode epkgs.web-mode ];
}
{
file = ./emacs/lang/haml.el;
pkgs = epkgs: [ epkgs.idris-mode ];
}
{
file = ./emacs/lang/javascript.el;
pkgs = epkgs: [
epkgs.js2-mode
epkgs.prettier-js
];
pkgs = epkgs: [ epkgs.js2-mode epkgs.prettier-js ];
}
{
file = ./emacs/lang/json.el;
pkgs = epkgs: [ epkgs.json-mode ];
}
{
file = ./emacs/lang/markdown.el;
pkgs = epkgs: [
epkgs.markdown-mode
epkgs.markdown-toc
];
pkgs = epkgs: [ epkgs.markdown-mode epkgs.markdown-toc ];
}
{
file = ./emacs/lang/nix.el;
pkgs = epkgs: [ epkgs.nix-mode ];
}
{
file = ./emacs/lang/org-mode-config.el;
pkgs = epkgs: [];
pkgs = epkgs: [ ];
}
{
file = ./emacs/lang/ruby.el;
Expand All @@ -244,10 +191,7 @@ let
}
{
file = ./emacs/lang/terraform.el;
pkgs = epkgs: [
epkgs.hcl-mode
epkgs.terraform-mode
];
pkgs = epkgs: [ epkgs.hcl-mode epkgs.terraform-mode ];
}
{
file = ./emacs/lang/toml.el;
Expand All @@ -259,18 +203,12 @@ let
}
];

extraSystemPackages = [
pkgs.ag
pkgs.ispell
pkgs.shellcheck
];
extraSystemPackages = [ pkgs.ag pkgs.ispell pkgs.shellcheck ];

extraConfig =
''
(setq yas-snippet-dirs '("${./emacs-snippets}"))
extraConfig = ''
(setq yas-snippet-dirs '("${./emacs-snippets}"))
'';
in
{
in {
programs.emacs.enable = true;
programs.emacs.package = pkgs.emacsMacport;
programs.emacs.extraPackages = epkgs: builtins.concatMap (config: config.pkgs epkgs) configs ++ extraSystemPackages;
Expand Down
2 changes: 1 addition & 1 deletion dotfiles/git.nix
Expand Up @@ -14,7 +14,7 @@
co = "checkout";
dc = "diff --cached";
di = "diff";
gclone = "!\"gclone() { mkdir -p ~/code/$1; git clone git@github.com:$1.git ~/code/$1; }; gclone\"";
gclone = ''!"gclone() { mkdir -p ~/code/$1; git clone git@github.com:$1.git ~/code/$1; }; gclone"'';
publish = "!git push -u origin $(git rev-parse --abbrev-ref HEAD)";
st = "status";
};
Expand Down
4 changes: 1 addition & 3 deletions dotfiles/neovim.nix
Expand Up @@ -17,9 +17,7 @@

# TODO: does this have to be called myVimPackage? Why? Seems to be in
# `pkgs.wrapNeovim`
packages.myVimPackage = with pkgs.vimPlugins; {
start = [ vim-surround ];
};
packages.myVimPackage = with pkgs.vimPlugins; { start = [ vim-surround ]; };
};
};
}
3 changes: 1 addition & 2 deletions dotfiles/zsh.nix
Expand Up @@ -14,8 +14,7 @@ let
];

extraInitExtra = builtins.foldl' (soFar: new: soFar + "\n" + builtins.readFile new) "" extras;
in
{
in {
programs.zsh = {
enable = true;

Expand Down
16 changes: 7 additions & 9 deletions pkgs/lorri.nix
@@ -1,12 +1,10 @@
{ pkgs }:

let
src =
pkgs.fetchFromGitHub {
owner = "target";
repo = "lorri";
rev = "d3e452ebc2b24ab86aec18af44c8217b2e469b2a";
sha256 = "07yf3gl9sixh7acxayq4q8h7z4q8a66412z0r49sr69yxb7b4q89";
};
in
pkgs.callPackage src { inherit src; }
src = pkgs.fetchFromGitHub {
owner = "target";
repo = "lorri";
rev = "d3e452ebc2b24ab86aec18af44c8217b2e469b2a";
sha256 = "07yf3gl9sixh7acxayq4q8h7z4q8a66412z0r49sr69yxb7b4q89";
};
in pkgs.callPackage src { inherit src; }

0 comments on commit e75df1a

Please sign in to comment.