Skip to content

Commit

Permalink
Add nix files
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuheechul committed Mar 9, 2021
1 parent 523c3df commit ad24cc1
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nix/bin/channels.sh
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

set -x

nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
21 changes: 21 additions & 0 deletions nix/bin/init-home-manager.sh
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -x

nix-shell '<home-manager>' -A install

# use this as a template to replace ~/.config/nixpkgs/home.nix

cat << EOF > ~/.config/nixpkgs/home.nix
let
imports = [
~/dotfiles/nix/home.nix
];
in
{
inherit imports;
home.username = "$(whoami)";
home.homeDirectory = "$(echo $HOME)";
}
EOF
3 changes: 3 additions & 0 deletions nix/bin/install.sh
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

echo "nyy" | sh <(curl -L https://nixos.org/nix/install) --daemon
6 changes: 6 additions & 0 deletions nix/bin/shim/path.sh
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

cat << EOF > /etc/profile.d/user-shim-for-nix-path.sh
# the filename is intentionally behind `nix.sh`
export NIX_PATH=\${HOME}/.nix-defexpr/channels:\${NIX_PATH}
EOF
31 changes: 31 additions & 0 deletions nix/home.nix
@@ -0,0 +1,31 @@
{ config, pkgs, ... }:

let
packages = import ./pkgs.nix {pkgs=pkgs;};
in
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

# Home Manager needs a bit of information about you and the
# paths it should manage.
#
# home.username = "my-user";
# home.homeDirectory = "/home/my-user";
#
# to avoid having to check out username and home directory in dotfiles repo
# set values like above in ~/.config/nixpkgs/home.nix
# and import this file from ~/.config/nixpkgs/home.nix

# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.05";

home.packages = packages.toInstall;
}
50 changes: 50 additions & 0 deletions nix/pkgs.nix
@@ -0,0 +1,50 @@
{ pkgs }:

{
toInstall = [
pkgs.htop
pkgs.cowsay
pkgs.fortune

# essential
pkgs.zsh # my favorite shell interface
pkgs.git # to replace possible old git comes with OS
pkgs.bash # use latest bash
pkgs.tmux # terminal multiplexer
pkgs.neovim # my favorite editor
pkgs.starship # cross-shell prompt
pkgs.fzf # A command-line fuzzy finder
pkgs.direnv # auto loading env per dir
pkgs.htop # resource monitoring
pkgs.gnupg # GnuPG
pkgs.wget # useful for downloading files

# viewer
pkgs.exa # modern ls
pkgs.bat # cat with wings
pkgs.glow # markdown render on cli
pkgs.lf # terminal file manager
pkgs.fx # json viewer

# search
pkgs.ripgrep # modern grep
pkgs.fasd # Command-line productivity booster, offers quick access to files and directories
pkgs.fd # mordern find

# helper
pkgs.tig # git helper
pkgs.tldr # Simplified and community-driven man pages
pkgs.watch # execute a program periodically
pkgs.entr # Run arbitrary commands when files change
# pkgs.taskell # CLI kanban
pkgs.fpp # for tmux-fpp
pkgs.extract_url # for tmux-urlview
pkgs.jq # json processor
pkgs.jsonnet # templating with json
pkgs.gh # official Github CLI
pkgs.pueue # long running task manager

# misc
pkgs.neofetch
];
}

0 comments on commit ad24cc1

Please sign in to comment.