this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Nix configuration to dotfiles

+262 -3
+14 -3
Makefile
··· 1 1 TARGETS ?= fish vim kitty git ctags wm misc 2 2 3 - all: $(TARGETS) 3 + all: nix $(TARGETS) 4 + 5 + nix: check 6 + @printf "%s\t" $@ 7 + @stow -t "${HOME}" -R "$@" 2> /dev/null && printf "\033[32m✓" || printf "\033[31m✗" 8 + @printf "\033[m\n" 9 + @darwin-rebuild switch -I "${HOME}/.config/nixpkgs/darwin/configuration.nix" 4 10 5 - $(TARGETS): 11 + $(TARGETS): check 6 12 @printf "%s\t" $@ 7 13 @stow -t "${HOME}" -R "$@" 2> /dev/null && printf "\033[32m✓" || printf "\033[31m✗" 8 14 @printf "\033[m\n" 9 15 10 - .PHONY: $(TARGETS) all 16 + check: 17 + @if ! which stow 2>/dev/null >/dev/null; \ 18 + then printf "\033[31mGNU Stow not found\033[m\n"; \ 19 + exit 1; fi 20 + 21 + .PHONY: $(TARGETS) nix all
+98
nix/.config/nixpkgs/darwin/configuration.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + system.defaults.dock.autohide = true; 5 + 6 + system.keyboard.enableKeyMapping = true; 7 + system.keyboard.remapCapsLockToControl = true; 8 + 9 + # List packages installed in system profile. To search by name, run: 10 + # $ nix-env -qaP | grep wget 11 + environment.systemPackages = with pkgs; 12 + [ neovim 13 + neovim-remote 14 + universal-ctags 15 + ripgrep 16 + fzy 17 + jq 18 + direnv 19 + git 20 + gitAndTools.hub 21 + gitAndTools.git-imerge 22 + gitAndTools.git-test 23 + gitAndTools.tig 24 + gnupg 25 + keychain 26 + noti 27 + entr 28 + httpie 29 + dnsmasq 30 + ]; 31 + 32 + environment.shells = [ pkgs.fish ]; 33 + 34 + fonts.enableFontDir = true; 35 + fonts.fonts = let 36 + iosevkaTerm = pkgs.iosevka.override { 37 + set = "term"; 38 + family = "Iosevka Term"; 39 + design = [ "ss10" "term" ]; 40 + }; 41 + iosevka = pkgs.iosevka.override { 42 + set = "ss10"; 43 + family = null; 44 + design = [ "ss10" "calt-logic" ]; 45 + }; 46 + in [ 47 + pkgs.lato 48 + iosevka 49 + iosevkaTerm 50 + ]; 51 + 52 + # Use a custom configuration.nix location. 53 + # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix 54 + environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix"; 55 + 56 + # Auto upgrade nix package and the daemon service. 57 + services.nix-daemon.enable = true; 58 + services.nix-daemon.enableSocketListener = true; 59 + 60 + # Set .localhost. TLD on loopback address 61 + launchd.daemons.dnsmasq = { 62 + command = "${pkgs.dnsmasq}/bin/dnsmasq -a 127.0.0.1 --keep-in-foreground"; 63 + serviceConfig.KeepAlive = true; 64 + serviceConfig.RunAtLoad = true; 65 + }; 66 + environment.etc."dnsmasq.conf" = { 67 + enable = true; 68 + text = '' 69 + address=/localhost/127.0.0.1 70 + ''; 71 + }; 72 + environment.etc."resolver/localhost" = { 73 + enable = true; 74 + text = "nameserver 127.0.0.1"; 75 + }; 76 + 77 + nix.package = pkgs.nixStable; 78 + # nix.useSandbox = true; 79 + # nix.sandboxPaths = [ "/System/Library/Frameworks" "/System/Library/PrivateFrameworks" "/usr/lib" "/private/tmp" "/private/var/tmp" "/usr/bin/env" ]; 80 + 81 + nixpkgs.config.allowUnfree = true; 82 + 83 + programs.gnupg.agent.enable = false; 84 + programs.gnupg.agent.enableSSHSupport = true; 85 + 86 + # programs.nix-index.enable = true; 87 + 88 + programs.fish.enable = true; 89 + 90 + # Used for backwards compatibility, please read the changelog before changing. 91 + # $ darwin-rebuild changelog 92 + system.stateVersion = 3; 93 + 94 + # You should generally set this to the total number of logical cores in your system. 95 + # $ sysctl -n hw.ncpu 96 + nix.maxJobs = 12; 97 + nix.buildCores = 12; 98 + }
+13
nix/.config/nixpkgs/overlays/erlang.nix
··· 1 + self: super: 2 + 3 + { 4 + fetchMixDeps = self.callPackage ./erlang/fetch-mix-deps.nix {}; 5 + 6 + erlangSourcer = self.callPackage ./erlang/sourcer.nix { 7 + erlang = self.beam.packages.erlang; 8 + }; 9 + 10 + elixirLS = self.callPackage ./erlang/elixir-ls.nix { 11 + erlang = self.beam.packages.erlang; 12 + }; 13 + }
+51
nix/.config/nixpkgs/overlays/erlang/elixir-ls.nix
··· 1 + { stdenv, erlang, fetchFromGitHub }: 2 + 3 + stdenv.mkDerivation rec { 4 + name = "elixir-ls"; 5 + version = "unstable-2019-07-15"; 6 + 7 + nativeBuildInputs = [ elixir hex git ]; 8 + 9 + deps = fetchMixDeps { 10 + inherit name version src; 11 + }; 12 + 13 + # refresh: nix-prefetch-git https://github.com/elixir-lsp/elixir-ls.git [--rev branchName | --rev sha] 14 + src = fetchFromGitHub { 15 + rev = "95c021fdb8e279ae3e9ab0ae1af8624d5572fad3"; 16 + owner = "elixir-lsp"; 17 + repo = "elixir-ls"; 18 + sha256 = "0qkqra09rvw6hxa8pbdvxnvqlvgw0qyq2rlgd56hxjbxa280ba1c"; 19 + }; 20 + 21 + dontStrip = true; 22 + 23 + configurePhase = '' 24 + runHook preConfigure 25 + export HEX_OFFLINE=1 26 + export MIX_HOME=`pwd` 27 + 28 + cp --no-preserve=all -R ${deps}/deps deps 29 + mix local.rebar rebar3 ${rebar3}/bin/rebar3 30 + runHook postConfigure 31 + ''; 32 + 33 + buildPhase = '' 34 + runHook preBuild 35 + export MIX_ENV=prod 36 + 37 + mix elixir_ls.release 38 + 39 + runHook postBuild 40 + ''; 41 + 42 + installPhase = '' 43 + mkdir -p $out/bin 44 + cp -Rv release $out/lib 45 + substitute release/language_server.sh $out/bin/language_server.sh \ 46 + --replace "ERL_LIBS=\"\$SCRIPTPATH:\$ERL_LIBS\"" "ERL_LIBS=$out/lib:\$ERL_LIBS" \ 47 + --replace "elixir -e" "${elixir}/bin/elixir -e" 48 + chmod +x $out/bin/language_server.sh 49 + mv $out/bin/language_server.sh $out/bin/elixir-ls 50 + ''; 51 + }
+40
nix/.config/nixpkgs/overlays/erlang/fetch-mix-deps.nix
··· 1 + { stdenv, elixir, rebar3, git, cacert }: 2 + 3 + { name, version, sha256 ? null, src, env ? "prod" }: 4 + 5 + with stdenv; 6 + 7 + mkDerivation { 8 + name = "mix-deps-${name}-${version}"; 9 + 10 + nativeBuildInputs = [ elixir git cacert ]; 11 + 12 + phases = [ "downloadPhase" "installPhase" ]; 13 + 14 + downloadPhase = '' 15 + export HEX_HOME=$PWD 16 + export MIX_HOME=$PWD 17 + export MIX_ENV=${env} 18 + 19 + echo $HEX_HOME 20 + 21 + cp -R ${src}/* . 22 + 23 + mix local.hex --force 24 + mix local.rebar rebar3 ${rebar3}/bin/rebar3 25 + mix deps.get 26 + 27 + ls -la deps 28 + ''; 29 + 30 + installPhase = '' 31 + mkdir -p "$out" 32 + cp -R deps "$out" 33 + ''; 34 + 35 + outputHashAlgo = "sha256"; 36 + outputHashMode = "recursive"; 37 + # outputHash = sha256; 38 + 39 + impureEnvVars = lib.fetchers.proxyImpureEnvVars; 40 + }
+6
nix/.config/nixpkgs/overlays/erlang/sourcer.json
··· 1 + { 2 + "owner": "erlang", 3 + "repo": "sourcer", 4 + "rev": "e598ec52ed2c62eb50e4556dc9cd5adb664de610", 5 + "sha256": "1kq466vqcc5fwynl457xzqamj1ldfbbv03x7dg5m8167swdi93am" 6 + }
+13
nix/.config/nixpkgs/overlays/erlang/sourcer.nix
··· 1 + { erlang, fetchFromGitHub, gitMinimal }: 2 + 3 + let 4 + json = builtins.fromJSON (builtins.readFile ./sourcer.json); 5 + in erlang.rebar3Relx rec { 6 + name = "erlang-ls"; 7 + version = "unstable-2019-07-26"; 8 + releaseType = "escript"; 9 + 10 + nativeBuildInputs = [ gitMinimal ]; 11 + 12 + src = fetchFromGitHub json; 13 + }
+17
nix/.config/nixpkgs/overlays/mkcert.nix
··· 1 + self: super: 2 + 3 + { 4 + mkcert = self.buildGoPackage rec { 5 + name = "mkcert-${version}"; 6 + version = "1.3.0"; 7 + 8 + goPackagePath = "github.com/FiloSottile/mkcert"; 9 + 10 + src = self.fetchFromGitHub { 11 + owner = "FiloSottile"; 12 + repo = "mkcert"; 13 + rev = "99e15e29f975e5fa7c897e04015aeba30b692749"; 14 + sha256 = "1aadnsx5pfmryf8mgxg9g0i083dm1pmrc6v4ln2mm3n89wwqc9b7"; 15 + }; 16 + }; 17 + }
+10
nix/.config/nixpkgs/overlays/tokei.nix
··· 1 + self: super: 2 + 3 + { 4 + tokei = self.tokei.overrideDerivation (cfg: { 5 + buildInputs = self.stdenv.lib.optionals self.stdenv.isDarwin [ 6 + self.libiconv 7 + self.darwin.apple_sdk.frameworks.Security 8 + ]; 9 + }); 10 + }