Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
17f89c3
feat: add minimal just file
cameronraysmith Sep 8, 2023
6a941a5
refactor: add default.nix to home
cameronraysmith Sep 8, 2023
c8612d9
feat: add starship config from srid/nixos-config
cameronraysmith Sep 8, 2023
ccaee29
refactor: migrate terminal config flake -> ./home
cameronraysmith Sep 8, 2023
c5c58a2
refactor: update flake to account for refactoring
cameronraysmith Sep 8, 2023
ac0f230
refactor: update flake.lock
cameronraysmith Sep 8, 2023
1209e54
fix: remove disabled autojump deferring to zoxide
cameronraysmith Sep 8, 2023
f78bca9
fix: remove asciinema
cameronraysmith Sep 8, 2023
9c7decc
fix: specify formatter in flake
cameronraysmith Sep 8, 2023
092018a
fix: fully qualify references to all inputs
cameronraysmith Sep 8, 2023
20f7b14
feat: add run target that refs lint and check
cameronraysmith Sep 8, 2023
9635789
refactor: remove unused home.nix
cameronraysmith Sep 9, 2023
e3d5134
fix: update relative path to neovim in comment
cameronraysmith Sep 9, 2023
65edb96
feat: io/update/build/clean targets for justfile
cameronraysmith Sep 9, 2023
0fa764e
fix: point to nix-systems/default in comment
cameronraysmith Sep 9, 2023
c86c3be
fix: justfile indent spacing
cameronraysmith Sep 9, 2023
9684441
refactor: make `./home` a home-manager module
cameronraysmith Sep 9, 2023
dfeee74
feat: add direnv to use flake
cameronraysmith Sep 9, 2023
6edcef0
Add a devshell (since there is .envrc)
srid Sep 9, 2023
3c26b7b
Simplify justfile default
srid Sep 9, 2023
624181c
docs: update README
cameronraysmith Sep 10, 2023
b6e101d
fix: lint gitignore
cameronraysmith Sep 10, 2023
90e7fae
chore: update flake lock
cameronraysmith Sep 10, 2023
bc51772
feat: add manual dev recipe to justfile
cameronraysmith Sep 10, 2023
3b2419d
fix: spacing typo in README
cameronraysmith Sep 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
description = "A home-manager template providing useful tools & settings for Nix-based development";

inputs = {
# Principle inputs (updated by `nix run .#update`)
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
Expand All @@ -7,17 +9,30 @@

flake-parts.url = "github:hercules-ci/flake-parts";
nixos-flake.url = "github:srid/nixos-flake";
systems.url = "github:nix-systems/default";
};

outputs = inputs@{ self, ... }:
outputs =
inputs @ { self
, nixpkgs
, home-manager
, flake-parts
, nixos-flake
, systems
, ...
}:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
# systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
systems = import systems;
imports = [
inputs.nixos-flake.flakeModule
# Edit the contenst of the ./home directory to install packages and modify dotfile configuration in your
# $HOME.
#
# https://nix-community.github.io/home-manager/index.html#sec-usage-configuration
./home
];

flake.homeModules.default = ./home.nix;

flake.templates.default = {
description = "A `home-manager` template providing useful tools & settings for Nix-based development";
path = builtins.path {
Expand All @@ -31,7 +46,7 @@
perSystem = { self', pkgs, ... }:
let
# TODO: Change username
myUserName = "john";
myUserName = "runner";
in
{
legacyPackages.homeConfigurations.${myUserName} =
Expand Down
16 changes: 16 additions & 0 deletions home/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ self, ... }:
{
flake = {
homeModules = {
default = {
imports = [
# This loads ./home/neovim/default.nix - neovim configured for Haskell dev, and other things.
./neovim
./starship.nix
./terminal.nix
# Add more of your home-manager modules here.
];
};
};
};
}
23 changes: 23 additions & 0 deletions home/starship.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
# Starship configuration from this example:
# https://github.com/srid/nixos-config/blob/f9cf0def19fbc7aa1e836be481ce50d214e34036/home/starship.nix#L4-L19
programs.starship = {
enable = true;
settings = {
username = {
style_user = "blue bold";
style_root = "red bold";
format = "[$user]($style) ";
disabled = false;
show_always = true;
};
hostname = {
ssh_only = false;
ssh_symbol = "🌐 ";
format = "on [$hostname](bold red) ";
trim_at = ".local";
disabled = false;
};
};
};
}
76 changes: 76 additions & 0 deletions home/terminal.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{ pkgs, ... }:

# Platform-independent terminal setup
{
# Nix packages to install to $HOME
#
# Search for packages here: https://search.nixos.org/packages
home.packages = with pkgs; [
# Unix tools
ripgrep # Better `grep`
fd
sd
tree

# Nix dev
cachix
nil # Nix language server
nix-info
nixpkgs-fmt
nixci

# Publishing
asciinema

# Dev
gh
just
lazygit # Better git UI
tmate
];

home.shellAliases = rec {
e = "nvim";
g = "git";
lg = "lazygit";
t = "tree";
};

# Programs natively supported by home-manager.
programs = {
bat.enable = true;
autojump.enable = false;
# Type `z <pat>` to cd to some directory
zoxide.enable = true;
# Type `<ctrl> + r` to fuzzy search your shell history
fzf.enable = true;
jq.enable = true;
nix-index.enable = true;
htop.enable = true;


# on macOS, you probably don't need this
bash = {
enable = true;
initExtra = ''
# Make Nix and home-manager installed things available in PATH.
export PATH=/run/current-system/sw/bin/:/nix/var/nix/profiles/default/bin:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:$PATH
'';
};

# For macOS's default shell.
zsh = {
enable = true;
envExtra = ''
# Make Nix and home-manager installed things available in PATH.
export PATH=/run/current-system/sw/bin/:/nix/var/nix/profiles/default/bin:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:$PATH
'';
};

# https://zero-to-flakes.com/direnv
direnv = {
enable = true;
nix-direnv.enable = true;
};
};
}
18 changes: 18 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Like GNU `make`, but `just` rustier.
# https://just.systems/man/en/chapter_19.html
# run `just` from this directory to see available commands

# Default command when 'just' is run without arguments
# Run 'just <command>' to execute a command.
default: help

# Display help
help:
@printf "\nRun 'just -n <command>' to print what would be executed...\n\n"
@just --list
@echo "\n...by running 'just <command>'.\n"
@echo "This message is printed by 'just help' and just 'just'.\n"

# Lint nix files
lint:
nix run nixpkgs#nixpkgs-fmt -- .