diff --git a/.example_work_profile/flake.nix b/.example_work_profile/flake.nix new file mode 100644 index 0000000..ac3503d --- /dev/null +++ b/.example_work_profile/flake.nix @@ -0,0 +1,29 @@ +{ + 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; }; + }; + }; + }; +} diff --git a/.example_work_profile/work_overrides/default.nix b/.example_work_profile/work_overrides/default.nix new file mode 100644 index 0000000..2ae36c0 --- /dev/null +++ b/.example_work_profile/work_overrides/default.nix @@ -0,0 +1,24 @@ +{ 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"; + }; +} \ No newline at end of file diff --git a/.example_work_profile/work_overrides/fish.nix b/.example_work_profile/work_overrides/fish.nix new file mode 100644 index 0000000..e80df6c --- /dev/null +++ b/.example_work_profile/work_overrides/fish.nix @@ -0,0 +1,13 @@ +{ 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"; + }; + }; +} \ No newline at end of file diff --git a/README.md b/README.md index d53a7af..15c9c5e 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,7 @@ # Config files ## Nix -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 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). The goods are in [flake.nix](./flake.nix). -It's very much a work-in-progress though so the legacy dotfile configs are below. -## Legacy stuff -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 +I've also set this up so that I can overlay a flake stored in a private repo, say for work-specific configurations. That will allow me to use the same base configs for both work and personal machines, but with some additional work-specific stuff on top. There's an example of how I did that in [.example_work_profile](./.example_work_profile). -``` \ No newline at end of file