mirror of
https://github.com/jbowdre/dotfiles.git
synced 2024-11-25 10:32:19 +00:00
Compare commits
No commits in common. "6ed0f8f76c3d7e4bdf4f24011dc9128e2021bb61" and "9d267a82e69e9209a5b99c6f4e6162989d7af37c" have entirely different histories.
6ed0f8f76c
...
9d267a82e6
36 changed files with 43 additions and 138 deletions
|
@ -1,10 +0,0 @@
|
||||||
# Work profile overlay
|
|
||||||
|
|
||||||
_Inspired by [Published my Nix Dotfiles](https://www.chrisportela.com/posts/published-nix-dotfiles/)._
|
|
||||||
|
|
||||||
This repo demonstrates how I use a private repo to overlay my work-specific configurations on top of my personal ones. To use it, I just:
|
|
||||||
1. Clone the private repo to my machine.
|
|
||||||
2. `cd` into the private repo.
|
|
||||||
3. Run `home-manager switch --flake .#<username>@<hostname>` to activate the work profile (and then use the `switch-home` function to (re)activate it in the future).
|
|
||||||
|
|
||||||
When the public `dotfiles` repo gets updated, I run `nix flake lock --update-input dotfiles` to pull in the changes before doing `switch-home` to reapply the config.
|
|
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
description = "A flake to overlay private configurations on my public flake";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
dotfiles.url = "github:jbowdre/dotfiles";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, dotfiles, nixpkgs } @inputs:
|
|
||||||
let
|
|
||||||
inherit (dotfiles) homeConfigurations homeManagerModules lib overlays packages;
|
|
||||||
inherit (self) outputs;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
homeManagerModules = import "${dotfiles}/modules/home-manager";
|
|
||||||
|
|
||||||
overlays = import "${dotfiles}/overlays" { inherit inputs outputs; };
|
|
||||||
|
|
||||||
homeConfigurations = {
|
|
||||||
"work-user@work-system" = lib.homeManagerConfiguration {
|
|
||||||
modules = [
|
|
||||||
"${dotfiles}/home/global"
|
|
||||||
./work_overrides
|
|
||||||
];
|
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
{ pkgs, ... }: {
|
|
||||||
imports = [
|
|
||||||
./fish.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
home = {
|
|
||||||
# username override
|
|
||||||
username = "work-user";
|
|
||||||
packages = with pkgs; [
|
|
||||||
packer
|
|
||||||
terraform
|
|
||||||
vagrant
|
|
||||||
vault
|
|
||||||
wsl-open
|
|
||||||
wslu
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
htop.enable = true;
|
|
||||||
|
|
||||||
git.userEmail = "work-user@company.tld";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ pkgs, lib, config, ... }: {
|
|
||||||
programs.fish = {
|
|
||||||
# Shell overrides for work
|
|
||||||
|
|
||||||
shellAbbrs = rec {
|
|
||||||
putmykey = "ssh-copy-id -i ~/.ssh/id_ed25519";
|
|
||||||
putrootkey = "ssh-copy-id -i ~/.ssh/id_ed25519-root";
|
|
||||||
ssh = "ssh -i ~/.ssh/id_ed25519 -l work-user";
|
|
||||||
sshroot = "ssh -i ~/.ssh/id_ed25519-root -l root";
|
|
||||||
vpnkit = "wsl.exe -d wsl-vpnkit --cd /app service wsl-vpnkit";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
18
README.md
18
README.md
|
@ -1,9 +1,19 @@
|
||||||
# Config files
|
# Config files
|
||||||
|
|
||||||
## Nix
|
## Nix
|
||||||
I've started the process of leveraging [Nix](https://nixos.org/explore.html) to manage my system configurations. This repo holds files used for managing user environments with [Home Manager](https://github.com/nix-community/home-manager), largely adapted from the wonderful examples at [nix-starter-configs](https://github.com/Misterio77/nix-starter-configs).
|
I've started the process of leveraging [Nix](https://nixos.org/explore.html) to manage my system configurations. This repo will (eventually?) hold files used for managing user environments with [Home Manager](https://github.com/nix-community/home-manager). The goods are in [flake.nix](./flake.nix) and the [nix](./nix/) directory.
|
||||||
|
|
||||||
I've preserved my previous configs in the [.legacy_dotfiles](./.legacy_dotfiles) directory, but I'm not actively maintaining them anymore.
|
It's very much a work-in-progress though so the legacy dotfile configs are below.
|
||||||
|
## Legacy stuff
|
||||||
The [.example_work_profile](./.example_work_profile) directory demonstrates how I use a private repo to overlay my work-specific configurations on top of my personal ones.
|
Clone the repo:
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/jbowdre/dotfiles.git ~/.dotfiles
|
||||||
|
```
|
||||||
|
Use `ln` to symlink the desired configs into your home directory:
|
||||||
|
```sh
|
||||||
|
ln -s ~/.dotfiles/zsh/.zshrc ~/.zshrc
|
||||||
|
ln -s ~/.dotfiles/vim/.vimrc ~/.vimrc
|
||||||
|
ln -s ~/.dotfiles/tmux/.tmux.conf ~/.tmux.conf
|
||||||
|
ln -s ~/.dotfiles/pwsh/Microsoft.PowerShell_profile.ps1 ~/.config/powershell/Microsoft.PowerShell_profile.ps1
|
||||||
|
|
||||||
|
```
|
16
flake.nix
16
flake.nix
|
@ -38,19 +38,19 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit lib;
|
inherit lib;
|
||||||
nixosModules = import ./modules/nixos;
|
nixosModules = import ./nix/modules/nixos;
|
||||||
homeManagerModules = import ./modules/home-manager;
|
homeManagerModules = import ./nix/modules/home-manager;
|
||||||
|
|
||||||
overlays = import ./overlays { inherit inputs outputs; };
|
overlays = import ./nix/overlays { inherit inputs outputs; };
|
||||||
|
|
||||||
packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
|
packages = forEachSystem (pkgs: import ./nix/pkgs { inherit pkgs; });
|
||||||
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
|
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
|
||||||
formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
|
formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
# Pixelbook converted to NixOS
|
# Pixelbook converted to NixOS
|
||||||
pixnix = lib.nixosSystem {
|
pixnix = lib.nixosSystem {
|
||||||
modules = [ ./hosts/pixnix ];
|
modules = [ ./nix/hosts/pixnix ];
|
||||||
specialArgs = { inherit inputs outputs; };
|
specialArgs = { inherit inputs outputs; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -59,17 +59,17 @@
|
||||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
"john@penguin-fw" = lib.homeManagerConfiguration {
|
"john@penguin-fw" = lib.homeManagerConfiguration {
|
||||||
modules = [ ./home/penguin-fw.nix ];
|
modules = [ ./nix/home/penguin-fw.nix ];
|
||||||
pkgs = pkgsFor.x86_64-linux;
|
pkgs = pkgsFor.x86_64-linux;
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
extraSpecialArgs = { inherit inputs outputs; };
|
||||||
};
|
};
|
||||||
"john@penguin-duet" = lib.homeManagerConfiguration {
|
"john@penguin-duet" = lib.homeManagerConfiguration {
|
||||||
modules = [ ./home/penguin-duet.nix ];
|
modules = [ ./nix/home/penguin-duet.nix ];
|
||||||
pkgs = pkgsFor.aarch64-linux;
|
pkgs = pkgsFor.aarch64-linux;
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
extraSpecialArgs = { inherit inputs outputs; };
|
||||||
};
|
};
|
||||||
"john@pixnix" = lib.homeManagerConfiguration {
|
"john@pixnix" = lib.homeManagerConfiguration {
|
||||||
modules = [ ./home/pixnix.nix ];
|
modules = [ ./nix/home/pixnix.nix ];
|
||||||
pkgs = pkgsFor.x86_64-linux;
|
pkgs = pkgsFor.x86_64-linux;
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
extraSpecialArgs = { inherit inputs outputs; };
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
{ lib, ... }: {
|
|
||||||
programs.exa = {
|
|
||||||
enable = true;
|
|
||||||
enableAliases = true;
|
|
||||||
extraOptions = [
|
|
||||||
"--group-directories-first"
|
|
||||||
];
|
|
||||||
git = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
let
|
|
||||||
email = lib.concatStringsSep "" [ "john@bo" "wdre.net" ];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.git = {
|
|
||||||
enable = lib.mkDefault true;
|
|
||||||
delta.enable = true;
|
|
||||||
aliases = {
|
|
||||||
graph = "log --decorate --oneline --graph";
|
|
||||||
fast-forward = "merge --ff-only";
|
|
||||||
};
|
|
||||||
userEmail = lib.mkDefault email;
|
|
||||||
userName = lib.mkDefault "John Bowdre";
|
|
||||||
extraConfig = {
|
|
||||||
init.defaultBranch = "main";
|
|
||||||
pull.rebase = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -2,7 +2,6 @@
|
||||||
# Core CLI apps
|
# Core CLI apps
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./exa.nix
|
|
||||||
./git.nix
|
./git.nix
|
||||||
./fish.nix
|
./fish.nix
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
|
@ -11,11 +10,10 @@
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
babelfish # Lets fish speak bash
|
babelfish # Lets fish speak bash
|
||||||
bottom # Prettier top
|
bottom # Better top
|
||||||
httpie # Better curl
|
httpie # Better curl
|
||||||
jq # JSON pretty printer and manipulator
|
jq # JSON pretty printer and manipulator
|
||||||
powershell # Powershell
|
powershell # Powershell
|
||||||
python3 # Python 3
|
|
||||||
tldr # TLDR pages
|
tldr # TLDR pages
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -8,10 +8,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
awscli # AWS CLI
|
|
||||||
google-cloud-sdk # GCP CLI
|
|
||||||
hugo # Static site generator
|
hugo # Static site generator
|
||||||
kubectl # Container wrangler
|
|
||||||
nil # Nix LSP
|
nil # Nix LSP
|
||||||
# nix-inspect # See which pkgs are in your Path
|
# nix-inspect # See which pkgs are in your Path
|
||||||
nixfmt # Nix formatter
|
nixfmt # Nix formatter
|
|
@ -2,22 +2,16 @@
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
hasPackage = pname: lib.any (p: p ? pname && p.name == pname) config.home.packages;
|
hasPackage = pname: lib.any (p: p ? pname && p.name == pname) config.home.packages;
|
||||||
hasKubectl = hasPackage "kubectl";
|
hasExa = hasPackage "exa";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
shellAbbrs = rec {
|
shellAbbrs = rec {
|
||||||
ccat = "egrep -v '^\s*(#|$)'";
|
|
||||||
ga = "git add";
|
|
||||||
gc = "git commit -m";
|
|
||||||
gp = "git push";
|
|
||||||
gs = "git status";
|
|
||||||
jqless = "jq -C | less -r";
|
jqless = "jq -C | less -r";
|
||||||
k = mkIf hasKubectl "kubectl";
|
ls = mkIf hasExa "exa";
|
||||||
n = "nix";
|
n = "nix";
|
||||||
sshpass = "ssh -o PubkeyAuthentication=no";
|
|
||||||
tf = "terraform";
|
tf = "terraform";
|
||||||
tfyolo = "terraform apply -auto-approve";
|
tfyolo = "terraform apply -auto-approve";
|
||||||
vi = "vim";
|
vi = "vim";
|
||||||
|
@ -25,12 +19,12 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
functions = {
|
functions = {
|
||||||
# Disable greeting
|
# Disable greeting
|
||||||
fish_greeting = "";
|
fish_greeting = "";
|
||||||
ssh = "TERM=xterm command ssh $argv";
|
|
||||||
# Rebuild home-manager
|
# Rebuild home-manager
|
||||||
switch-home = "home-manager switch -b backup --flake ${config.home.homeDirectory}/.dotfiles#$USER@$(hostname -s)";
|
switch-home = "home-manager switch -b backup --flake ${config.home.homeDirectory}/.dotfiles#$USER@$(hostname -s)";
|
||||||
};
|
};
|
16
nix/home/features/cli/git.nix
Normal file
16
nix/home/features/cli/git.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{ lib, ... }: {
|
||||||
|
programs.git = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
delta.enable = true;
|
||||||
|
aliases = {
|
||||||
|
graph = "log --decorate --oneline --graph";
|
||||||
|
fast-forward = "merge --ff-only";
|
||||||
|
};
|
||||||
|
userEmail = lib.mkDefault "john@bowdre.net";
|
||||||
|
userName = lib.mkDefault "John Bowdre";
|
||||||
|
extraConfig = {
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
pull.rebase = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, outputs, pkgs, lib, ... }: {
|
{ outputs, pkgs, lib, ... }: {
|
||||||
|
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -103,10 +103,6 @@
|
||||||
"yaml" = true;
|
"yaml" = true;
|
||||||
};
|
};
|
||||||
"powershell.codeFormatting.useCorrectCasing" = true;
|
"powershell.codeFormatting.useCorrectCasing" = true;
|
||||||
"powershell.powerShellAdditionalExePaths" = {
|
|
||||||
"pwsh" = "${config.home.homeDirectory}/.nix-profile/bin/pwsh";
|
|
||||||
};
|
|
||||||
"powershell.promptToUpdatePowerShell" = false;
|
|
||||||
"security.workspace.trust.untrustedFiles" = "open";
|
"security.workspace.trust.untrustedFiles" = "open";
|
||||||
"vim.statusBarColorControl" = true;
|
"vim.statusBarColorControl" = true;
|
||||||
"vim.useCtrlKeys" = false;
|
"vim.useCtrlKeys" = false;
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Loading…
Reference in a new issue