tmux: initial configuration
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Jake Hillion 2023-01-11 20:22:35 +00:00
parent f1c6a62468
commit 2b2ebd9e0b
7 changed files with 79 additions and 9 deletions

View File

@ -20,6 +20,27 @@
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1673343300,
"narHash": "sha256-5Xdj6kpXYMie0MlnGwqK5FaMdsedxvyuakWtyKB3zaQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "176e455371a8371586e8a3ff0d56ee9f3ca2324e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1673345971,
@ -55,9 +76,25 @@
"root": {
"inputs": {
"agenix": "agenix",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",

View File

@ -5,11 +5,14 @@
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
description = "Hillion Nix flake";
outputs = { self, nixpkgs, nixpkgs-unstable, agenix }@inputs: {
outputs = { self, nixpkgs, nixpkgs-unstable, agenix, home-manager }@inputs: {
nixosConfigurations =
let
fqdns = builtins.attrNames (builtins.readDir ./hosts);
@ -21,6 +24,7 @@
modules = [
./hosts/${fqdn}/default.nix
agenix.nixosModule
home-manager.nixosModule
{
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
}

View File

@ -2,6 +2,7 @@
{
imports = [
../home/default.nix
./shell.nix
./ssh.nix
./tailscale.nix
@ -28,7 +29,6 @@
users."jake" = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # enable sudo
shell = pkgs.zsh;
};
};

View File

@ -1,6 +1,8 @@
{ lib, config, ... }:
{ pkgs, lib, config, ... }:
{
config.users.defaultUserShell = pkgs.zsh;
config.programs.zsh = {
enable = true;
histSize = 100000;
@ -9,12 +11,6 @@
syntaxHighlighting = {
enable = true;
};
autosuggestions = {
enable = true;
highlightStyle = "fg=5";
strategy = [ "match_prev_cmd" "completion" "history" ];
};
};
}

15
modules/home/default.nix Normal file
View File

@ -0,0 +1,15 @@
{ pkgs, lib, config, ... }:
{
home-manager.users.root.home.stateVersion = "22.11";
home-manager.users.jake.home.stateVersion = "22.11";
imports = [
./tmux/default.nix
];
## Set an empty ZSH config and defer to the global one
## This is particularly important for root on tmpfs
home-manager.users.root.programs.zsh.enable = true;
home-manager.users.jake.programs.zsh.enable = true;
}

View File

@ -0,0 +1,10 @@
setw -g mouse on
# Bindings
bind C-Y set-window-option synchronize-panes
bind -n C-k clear-history
# New panes in the same directory
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

View File

@ -0,0 +1,8 @@
{ pkgs, lib, config, ... }:
{
home-manager.users.jake.programs.tmux = {
enable = true;
extraConfig = lib.readFile ./.tmux.conf;
};
}