Refactor back to a more modular configuration
This commit is contained in:
parent
f85d4968ed
commit
f7ba471218
178 changed files with 2245 additions and 1847 deletions
|
@ -60,6 +60,10 @@
|
||||||
|
|
||||||
overlays = import ./overlays { inherit inputs; };
|
overlays = import ./overlays { inherit inputs; };
|
||||||
|
|
||||||
|
homeManagerModules.default = import ./modules/home-manager;
|
||||||
|
|
||||||
|
nixosModules.default = import ./modules/nixos;
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
lemp11 = nixpkgs.lib.nixosSystem {
|
lemp11 = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = specialArgs // {
|
specialArgs = specialArgs // {
|
||||||
|
@ -139,7 +143,5 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules = import ./modules { lib = nixpkgs.lib; };
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
7
home/common/default.nix
Normal file
7
home/common/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ outputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
outputs.homeManagerModules.default
|
||||||
|
];
|
||||||
|
}
|
32
home/opdavies/PW05CH3L.nix
Normal file
32
home/opdavies/PW05CH3L.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
imports = [ ../common ];
|
||||||
|
|
||||||
|
homeManagerModules = {
|
||||||
|
cli = {
|
||||||
|
direnv.enable = true;
|
||||||
|
fzf.enable = true;
|
||||||
|
|
||||||
|
git = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
user.emailAddress = "oliver.davies@tfw.wales";
|
||||||
|
};
|
||||||
|
|
||||||
|
node.enable = true;
|
||||||
|
ranger.enable = true;
|
||||||
|
starship.enable = true;
|
||||||
|
tmux.enable = true;
|
||||||
|
tmux-sessionizer.enable = true;
|
||||||
|
zsh.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
coding = {
|
||||||
|
neovim.enable = true;
|
||||||
|
phpactor.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."pam-gnupg".text = ''
|
||||||
|
C0D940F9A390F286FCAAE8439D501171E39D0A47
|
||||||
|
'';
|
||||||
|
}
|
5
home/opdavies/lemp11.nix
Normal file
5
home/opdavies/lemp11.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [ ../common ];
|
||||||
|
|
||||||
|
homeManagerModules.cli.zsh.enable = true;
|
||||||
|
}
|
11
home/opdavies/nixedo.nix
Normal file
11
home/opdavies/nixedo.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
imports = [ ../common ];
|
||||||
|
|
||||||
|
homeManagerModules = {
|
||||||
|
cli = {
|
||||||
|
fzf.enable = true;
|
||||||
|
starship.enable = true;
|
||||||
|
zsh.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
43
home/opdavies/t480.nix
Normal file
43
home/opdavies/t480.nix
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
imports = [ ../common ];
|
||||||
|
|
||||||
|
homeManagerModules = {
|
||||||
|
cli = {
|
||||||
|
bluetuith.enable = true;
|
||||||
|
direnv.enable = true;
|
||||||
|
fzf.enable = true;
|
||||||
|
|
||||||
|
git = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
user.emailAddress = "oliver@oliverdavies.uk";
|
||||||
|
};
|
||||||
|
|
||||||
|
node.enable = true;
|
||||||
|
notes.enable = true;
|
||||||
|
ranger.enable = true;
|
||||||
|
starship.enable = true;
|
||||||
|
tmux.enable = true;
|
||||||
|
tmux-sessionizer.enable = true;
|
||||||
|
zsh.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
coding = {
|
||||||
|
neovim.enable = true;
|
||||||
|
phpactor.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
desktop = {
|
||||||
|
firefox.enable = true;
|
||||||
|
flameshot.enable = true;
|
||||||
|
gtk.enable = true;
|
||||||
|
mpv.enable = true;
|
||||||
|
qutebrowser.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."pam-gnupg".text = ''
|
||||||
|
098EE055DAD2B9CB68154C6759DD38292D2273B6
|
||||||
|
1E21B58D69FFEFAD077F152A50FEA938A3413F50
|
||||||
|
'';
|
||||||
|
}
|
3
home/opdavies/t490.nix
Normal file
3
home/opdavies/t490.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
imports = [ ../common ];
|
||||||
|
}
|
|
@ -1,37 +1,21 @@
|
||||||
{ inputs, username, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
git = {
|
|
||||||
name = "Oliver Davies";
|
|
||||||
emailAddress = "oliver.davies@tfw.wales";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = with inputs.self.nixosModules; [
|
imports = [
|
||||||
editor-nvim
|
../common
|
||||||
mixins-common
|
|
||||||
mixins-direnv
|
|
||||||
mixins-docker
|
|
||||||
mixins-fzf
|
|
||||||
mixins-node
|
|
||||||
mixins-notes
|
|
||||||
mixins-phpactor
|
|
||||||
mixins-ranger
|
|
||||||
mixins-scripts
|
|
||||||
mixins-starship
|
|
||||||
mixins-tmux
|
|
||||||
mixins-zsh
|
|
||||||
|
|
||||||
users-opdavies
|
../../users/opdavies.nix
|
||||||
|
|
||||||
(import ../../modules/mixins/git.nix { inherit git; })
|
|
||||||
|
|
||||||
./modules/wiki.nix
|
./modules/wiki.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nixosModules = {
|
||||||
|
cli = {
|
||||||
|
docker.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
wsl = {
|
wsl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultUser = username;
|
defaultUser = "opdavies";
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.opdavies.home.sessionVariables.WAYLAND_DISPLAY = "";
|
home-manager.users.opdavies.home.sessionVariables.WAYLAND_DISPLAY = "";
|
||||||
|
|
|
@ -12,7 +12,11 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./users
|
||||||
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
|
||||||
|
outputs.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
nix = {
|
nix = {
|
|
@ -27,6 +27,10 @@ let
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
outputs.homeManagerModules.default
|
||||||
|
];
|
||||||
|
|
||||||
home.username = "opdavies";
|
home.username = "opdavies";
|
||||||
home.homeDirectory = "/home/${config.home.username}";
|
home.homeDirectory = "/home/${config.home.username}";
|
||||||
|
|
5
hosts/common/users/default.nix
Normal file
5
hosts/common/users/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./opdavies.nix
|
||||||
|
];
|
||||||
|
}
|
7
hosts/common/users/opdavies.nix
Normal file
7
hosts/common/users/opdavies.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
users.users.opdavies = { };
|
||||||
|
|
||||||
|
home-manager.users.opdavies = import ../../../home/opdavies/${config.networking.hostName}.nix;
|
||||||
|
}
|
|
@ -1,61 +1,20 @@
|
||||||
{ inputs, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = with inputs.self.nixosModules; [
|
imports = [
|
||||||
|
../common
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./programs.nix
|
||||||
|
./services.nix
|
||||||
|
|
||||||
mixins-avahi
|
../../users/opdavies.nix
|
||||||
mixins-bluetooth
|
../../users/eric.nix
|
||||||
mixins-common
|
|
||||||
mixins-zram
|
|
||||||
mixins-zsh
|
|
||||||
|
|
||||||
users-opdavies
|
|
||||||
users-eric
|
|
||||||
];
|
];
|
||||||
|
|
||||||
services = {
|
nixosModules = {
|
||||||
auto-cpufreq.enable = true;
|
core = {
|
||||||
gvfs.enable = true;
|
bluetooth.enable = true;
|
||||||
openssh.enable = true;
|
zram.enable = true;
|
||||||
power-profiles-daemon.enable = false;
|
|
||||||
thermald.enable = true;
|
|
||||||
|
|
||||||
pipewire = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
alsa = {
|
|
||||||
enable = true;
|
|
||||||
support32Bit = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
printing.enable = true;
|
|
||||||
pulseaudio.enable = false;
|
|
||||||
|
|
||||||
xserver = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
xkb = {
|
|
||||||
layout = "gb";
|
|
||||||
variant = "";
|
|
||||||
};
|
|
||||||
|
|
||||||
desktopManager.cinnamon.enable = true;
|
|
||||||
displayManager.lightdm.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
firefox = {
|
|
||||||
enable = true;
|
|
||||||
languagePacks = [ "en-GB" ];
|
|
||||||
preferences = {
|
|
||||||
"intl.accept_languages" = "en-GB, en";
|
|
||||||
"intl.regional_prefs.use_os_locales" = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
13
hosts/lemp11/programs.nix
Normal file
13
hosts/lemp11/programs.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
firefox = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
languagePacks = [ "en-GB" ];
|
||||||
|
preferences = {
|
||||||
|
"intl.accept_languages" = "en-GB, en";
|
||||||
|
"intl.regional_prefs.use_os_locales" = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
35
hosts/lemp11/services.nix
Normal file
35
hosts/lemp11/services.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
auto-cpufreq.enable = true;
|
||||||
|
gvfs.enable = true;
|
||||||
|
openssh.enable = true;
|
||||||
|
power-profiles-daemon.enable = false;
|
||||||
|
thermald.enable = true;
|
||||||
|
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
alsa = {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
printing.enable = true;
|
||||||
|
pulseaudio.enable = false;
|
||||||
|
|
||||||
|
xserver = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
xkb = {
|
||||||
|
layout = "gb";
|
||||||
|
variant = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
desktopManager.cinnamon.enable = true;
|
||||||
|
displayManager.lightdm.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -2,35 +2,21 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ inputs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = with inputs.self.nixosModules; [
|
imports = [
|
||||||
|
../common
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./modules
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
|
|
||||||
mixins-avahi
|
../../users/opdavies.nix
|
||||||
mixins-common
|
|
||||||
mixins-fzf
|
|
||||||
mixins-openssh
|
|
||||||
mixins-podman
|
|
||||||
mixins-starship
|
|
||||||
mixins-zsh
|
|
||||||
|
|
||||||
users-opdavies
|
|
||||||
|
|
||||||
./modules/acme.nix
|
|
||||||
./modules/audiobookshelf.nix
|
|
||||||
./modules/cloudflared.nix
|
|
||||||
./modules/containers
|
|
||||||
./modules/forgejo.nix
|
|
||||||
./modules/immich.nix
|
|
||||||
./modules/jellyfin.nix
|
|
||||||
./modules/nginx
|
|
||||||
./modules/paperless.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.dconf.enable = true;
|
nixosModules = {
|
||||||
|
core.openssh.enable = true;
|
||||||
|
cli.podman.enable = true;
|
||||||
|
desktop.dconf.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
services.logind.lidSwitchExternalPower = "ignore";
|
services.logind.lidSwitchExternalPower = "ignore";
|
||||||
|
|
||||||
|
|
13
hosts/nixedo/modules/default.nix
Normal file
13
hosts/nixedo/modules/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./acme.nix
|
||||||
|
./audiobookshelf.nix
|
||||||
|
./cloudflared.nix
|
||||||
|
./containers
|
||||||
|
./forgejo.nix
|
||||||
|
./immich.nix
|
||||||
|
./jellyfin.nix
|
||||||
|
./nginx
|
||||||
|
./paperless.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,61 +1,35 @@
|
||||||
{ inputs, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
git = {
|
|
||||||
name = "Oliver Davies";
|
|
||||||
emailAddress = "oliver@oliverdavies.uk";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = with inputs.self.nixosModules; [
|
imports = [
|
||||||
|
../common
|
||||||
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./modules
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
|
./services.nix
|
||||||
|
|
||||||
editor-nvim
|
../../users/opdavies.nix
|
||||||
mixins-avahi
|
|
||||||
mixins-bluetooth
|
|
||||||
mixins-common
|
|
||||||
mixins-direnv
|
|
||||||
mixins-firefox
|
|
||||||
mixins-flameshot
|
|
||||||
mixins-fonts
|
|
||||||
mixins-fzf
|
|
||||||
mixins-gnupg
|
|
||||||
mixins-gtk
|
|
||||||
mixins-qutebrowser
|
|
||||||
mixins-mpv
|
|
||||||
mixins-node
|
|
||||||
mixins-notes
|
|
||||||
mixins-phpactor
|
|
||||||
mixins-pipewire
|
|
||||||
mixins-ranger
|
|
||||||
mixins-screenkey
|
|
||||||
mixins-scripts
|
|
||||||
mixins-starship
|
|
||||||
mixins-thunar
|
|
||||||
mixins-tmux
|
|
||||||
mixins-zram
|
|
||||||
mixins-zsh
|
|
||||||
profiles-dwm
|
|
||||||
profiles-xbanish
|
|
||||||
|
|
||||||
(import ../../modules/mixins/git.nix { inherit git; })
|
|
||||||
|
|
||||||
(import ../../modules/mixins/kanata.nix {
|
|
||||||
devices = [
|
|
||||||
"/dev/input/event1"
|
|
||||||
];
|
|
||||||
})
|
|
||||||
|
|
||||||
users-opdavies
|
|
||||||
|
|
||||||
./modules/cron.nix
|
|
||||||
./modules/neomutt.nix
|
|
||||||
./modules/newsboat
|
|
||||||
./modules/ollama.nix
|
|
||||||
./modules/wiki.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nixosModules = {
|
||||||
|
core = {
|
||||||
|
bluetooth.enable = true;
|
||||||
|
openssh.enable = true;
|
||||||
|
pipewire.enable = true;
|
||||||
|
xbanish.enable = true;
|
||||||
|
zram.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
desktop = {
|
||||||
|
dconf.enable = true;
|
||||||
|
dwm.enable = true;
|
||||||
|
fonts.enable = true;
|
||||||
|
st.enable = true;
|
||||||
|
thunar.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot = {
|
systemd-boot = {
|
||||||
|
@ -118,35 +92,4 @@ in
|
||||||
zeroad
|
zeroad
|
||||||
zoom-us
|
zoom-us
|
||||||
];
|
];
|
||||||
|
|
||||||
services = {
|
|
||||||
auto-cpufreq.enable = true;
|
|
||||||
gvfs.enable = true;
|
|
||||||
power-profiles-daemon.enable = false;
|
|
||||||
printing.enable = true;
|
|
||||||
pulseaudio.enable = false;
|
|
||||||
throttled.enable = true;
|
|
||||||
thermald.enable = true;
|
|
||||||
upower.enable = true;
|
|
||||||
|
|
||||||
xserver = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
displayManager.startx.enable = true;
|
|
||||||
|
|
||||||
xkb = {
|
|
||||||
layout = "gb";
|
|
||||||
variant = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.dconf.enable = true;
|
|
||||||
|
|
||||||
home-manager.users.opdavies = {
|
|
||||||
xdg.configFile."pam-gnupg".text = ''
|
|
||||||
098EE055DAD2B9CB68154C6759DD38292D2273B6
|
|
||||||
1E21B58D69FFEFAD077F152A50FEA938A3413F50
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
9
hosts/t480/modules/default.nix
Normal file
9
hosts/t480/modules/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./cron.nix
|
||||||
|
./neomutt.nix
|
||||||
|
./newsboat
|
||||||
|
./ollama.nix
|
||||||
|
./wiki.nix
|
||||||
|
];
|
||||||
|
}
|
23
hosts/t480/services.nix
Normal file
23
hosts/t480/services.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
auto-cpufreq.enable = true;
|
||||||
|
gvfs.enable = true;
|
||||||
|
power-profiles-daemon.enable = false;
|
||||||
|
printing.enable = true;
|
||||||
|
pulseaudio.enable = false;
|
||||||
|
throttled.enable = true;
|
||||||
|
thermald.enable = true;
|
||||||
|
upower.enable = true;
|
||||||
|
|
||||||
|
xserver = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
displayManager.startx.enable = true;
|
||||||
|
|
||||||
|
xkb = {
|
||||||
|
layout = "gb";
|
||||||
|
variant = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,20 +1,27 @@
|
||||||
{ inputs, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = with inputs.self.nixosModules; [
|
imports = [
|
||||||
|
../common
|
||||||
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./programs.nix
|
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
./services
|
./services
|
||||||
./users.nix
|
./users.nix
|
||||||
|
|
||||||
mixins-common
|
../../users/opdavies.nix
|
||||||
mixins-zram
|
|
||||||
|
|
||||||
users-opdavies
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nixosModules = {
|
||||||
|
core = {
|
||||||
|
bluetooth.enable = true;
|
||||||
|
zram.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
desktop.dconf.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot = {
|
systemd-boot = {
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs = {
|
|
||||||
dconf.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,57 +0,0 @@
|
||||||
# Based on https://github.com/MatthewCroughan/nixcfg/blob/afab322e6da20cc038d8577dd4a365673702d183/modules/default.nix.
|
|
||||||
# Autoloads files within modules/ and makes them available by their module
|
|
||||||
# type and name, e.g. `mixins-zsh`, `editor-nvim` and `users-opdavies` when
|
|
||||||
# imported with `inputs.self.nixosModules`.
|
|
||||||
|
|
||||||
{ lib }:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (builtins)
|
|
||||||
attrNames
|
|
||||||
filter
|
|
||||||
listToAttrs
|
|
||||||
map
|
|
||||||
readDir
|
|
||||||
toString
|
|
||||||
;
|
|
||||||
|
|
||||||
inherit (lib)
|
|
||||||
filterAttrs
|
|
||||||
foldAttrs
|
|
||||||
hasSuffix
|
|
||||||
mapAttrsToList
|
|
||||||
nameValuePair
|
|
||||||
removeSuffix
|
|
||||||
zipListsWith
|
|
||||||
;
|
|
||||||
|
|
||||||
inherit (lib.filesystem) listFilesRecursive;
|
|
||||||
|
|
||||||
generateModules =
|
|
||||||
folder: prefix:
|
|
||||||
|
|
||||||
let
|
|
||||||
findSuffix = suffix: dir: (filter (x: (hasSuffix suffix (toString x))) (listFilesRecursive dir));
|
|
||||||
|
|
||||||
allNixFiles = findSuffix ".nix" folder;
|
|
||||||
|
|
||||||
allModuleNames = map (removeSuffix ".nix") (map baseNameOf allNixFiles);
|
|
||||||
|
|
||||||
zippedList = (
|
|
||||||
zipListsWith (x: y: nameValuePair (prefix + "-" + x) (import y)) allModuleNames allNixFiles
|
|
||||||
);
|
|
||||||
in
|
|
||||||
listToAttrs zippedList;
|
|
||||||
generateModulesAuto =
|
|
||||||
root:
|
|
||||||
let
|
|
||||||
moduleFolderNames = attrNames (filterAttrs (n: v: v == "directory") (readDir (toString root)));
|
|
||||||
moduleFolderPaths = map (x: (toString root) + "/" + x) moduleFolderNames;
|
|
||||||
|
|
||||||
zippedList = listToAttrs (
|
|
||||||
zipListsWith (x: y: nameValuePair x y) moduleFolderNames moduleFolderPaths
|
|
||||||
);
|
|
||||||
in
|
|
||||||
foldAttrs (item: acc: item) { } (mapAttrsToList (n: v: generateModules v n) zippedList);
|
|
||||||
in
|
|
||||||
generateModulesAuto ./.
|
|
|
@ -1,185 +0,0 @@
|
||||||
{
|
|
||||||
home-manager.users.opdavies =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
programs.neovim =
|
|
||||||
let
|
|
||||||
php = pkgs.php82;
|
|
||||||
phpPackages = pkgs.php82Packages;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
|
||||||
comment-nvim
|
|
||||||
conf-vim
|
|
||||||
edit-alternate-vim
|
|
||||||
gitsigns-nvim
|
|
||||||
harpoon2
|
|
||||||
mini-nvim
|
|
||||||
nvim-web-devicons
|
|
||||||
phpactor
|
|
||||||
refactoring-nvim
|
|
||||||
standard-vim
|
|
||||||
undotree
|
|
||||||
vim-caser
|
|
||||||
vim-nix
|
|
||||||
vim-pasta
|
|
||||||
vim-repeat
|
|
||||||
vim-sleuth
|
|
||||||
vim-textobj-indent
|
|
||||||
vim-textobj-user
|
|
||||||
vim-textobj-xmlattr
|
|
||||||
vim-unimpaired
|
|
||||||
|
|
||||||
# Testing
|
|
||||||
vim-test
|
|
||||||
vimux
|
|
||||||
|
|
||||||
# Git
|
|
||||||
vim-fugitive
|
|
||||||
|
|
||||||
# Debugging
|
|
||||||
nvim-dap
|
|
||||||
nvim-dap-ui
|
|
||||||
nvim-dap-virtual-text
|
|
||||||
|
|
||||||
# Treesitter
|
|
||||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (
|
|
||||||
plugins: with plugins; [
|
|
||||||
bash
|
|
||||||
comment
|
|
||||||
css
|
|
||||||
csv
|
|
||||||
dockerfile
|
|
||||||
gitattributes
|
|
||||||
gitignore
|
|
||||||
go
|
|
||||||
html
|
|
||||||
javascript
|
|
||||||
json
|
|
||||||
kdl
|
|
||||||
lua
|
|
||||||
luadoc
|
|
||||||
make
|
|
||||||
markdown
|
|
||||||
markdown_inline
|
|
||||||
nix
|
|
||||||
php
|
|
||||||
phpdoc
|
|
||||||
query
|
|
||||||
rst
|
|
||||||
scss
|
|
||||||
sql
|
|
||||||
terraform
|
|
||||||
twig
|
|
||||||
typescript
|
|
||||||
vim
|
|
||||||
vimdoc
|
|
||||||
vue
|
|
||||||
xml
|
|
||||||
yaml
|
|
||||||
]
|
|
||||||
))
|
|
||||||
nvim-treesitter-textobjects
|
|
||||||
|
|
||||||
# LSP, linting and formatting
|
|
||||||
conform-nvim
|
|
||||||
lsp-status-nvim
|
|
||||||
nvim-lint
|
|
||||||
nvim-lspconfig
|
|
||||||
|
|
||||||
# Completion
|
|
||||||
cmp-buffer
|
|
||||||
cmp-calc
|
|
||||||
cmp-cmdline
|
|
||||||
cmp-nvim-lsp
|
|
||||||
cmp-path
|
|
||||||
cmp-treesitter
|
|
||||||
cmp_luasnip
|
|
||||||
lspkind-nvim
|
|
||||||
nvim-cmp
|
|
||||||
|
|
||||||
# Snippets
|
|
||||||
friendly-snippets
|
|
||||||
luasnip
|
|
||||||
|
|
||||||
# Telescope
|
|
||||||
plenary-nvim
|
|
||||||
popup-nvim
|
|
||||||
telescope-frecency-nvim
|
|
||||||
telescope-fzf-native-nvim
|
|
||||||
telescope-live-grep-args-nvim
|
|
||||||
telescope-nvim
|
|
||||||
telescope-ui-select-nvim
|
|
||||||
|
|
||||||
# Databases
|
|
||||||
vim-dadbod
|
|
||||||
vim-dadbod-ui
|
|
||||||
vim-dadbod-completion
|
|
||||||
|
|
||||||
# Themes
|
|
||||||
catppuccin-nvim
|
|
||||||
];
|
|
||||||
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
# Languages
|
|
||||||
nodePackages.typescript
|
|
||||||
nodejs-slim
|
|
||||||
php
|
|
||||||
|
|
||||||
# Language servers
|
|
||||||
bash-language-server
|
|
||||||
dockerfile-language-server-nodejs
|
|
||||||
emmet-language-server
|
|
||||||
gopls
|
|
||||||
lua-language-server
|
|
||||||
lua54Packages.luacheck
|
|
||||||
marksman
|
|
||||||
nixd
|
|
||||||
phpactor
|
|
||||||
tailwindcss-language-server
|
|
||||||
terraform-ls
|
|
||||||
typescript-language-server
|
|
||||||
vscode-langservers-extracted
|
|
||||||
vue-language-server
|
|
||||||
yaml-language-server
|
|
||||||
|
|
||||||
# Formatters
|
|
||||||
black
|
|
||||||
eslint_d
|
|
||||||
nixfmt-rfc-style
|
|
||||||
nodePackages.prettier
|
|
||||||
stylua
|
|
||||||
yamlfmt
|
|
||||||
|
|
||||||
# Tools
|
|
||||||
hadolint
|
|
||||||
html-tidy
|
|
||||||
mariadb
|
|
||||||
nodePackages.jsonlint
|
|
||||||
nodePackages.markdownlint-cli
|
|
||||||
phpPackages.php-codesniffer
|
|
||||||
phpPackages.phpstan
|
|
||||||
proselint
|
|
||||||
ripgrep
|
|
||||||
shellcheck
|
|
||||||
yamllint
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.configFile.nvim = {
|
|
||||||
source = ./config;
|
|
||||||
recursive = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home.file.".markdownlint.yaml".text = ''
|
|
||||||
default: true
|
|
||||||
|
|
||||||
line-length: false
|
|
||||||
|
|
||||||
no-duplicate-heading:
|
|
||||||
siblings_only: true
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,15 +1,23 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
hardware.bluetooth.enable = true;
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
services.blueman.enable = true;
|
with lib;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
let
|
||||||
bluetuith
|
cfg = config.homeManagerModules.cli.bluetuith;
|
||||||
];
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.bluetuith.enable = mkEnableOption "Enable bluetuith";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
bluetuith
|
||||||
|
];
|
||||||
|
|
||||||
home-manager.users.opdavies = {
|
|
||||||
xdg.configFile."bluetuith/bluetuith.conf" = {
|
xdg.configFile."bluetuith/bluetuith.conf" = {
|
||||||
text = ''
|
text = ''
|
||||||
{
|
{
|
16
modules/home-manager/cli/default.nix
Normal file
16
modules/home-manager/cli/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./bluetuith.nix
|
||||||
|
./direnv.nix
|
||||||
|
./fzf.nix
|
||||||
|
./git.nix
|
||||||
|
./node.nix
|
||||||
|
./notes.nix
|
||||||
|
./ranger.nix
|
||||||
|
./scripts
|
||||||
|
./starship.nix
|
||||||
|
./tmux.nix
|
||||||
|
./tmux-sessionizer.nix
|
||||||
|
./zsh
|
||||||
|
];
|
||||||
|
}
|
21
modules/home-manager/cli/direnv.nix
Normal file
21
modules/home-manager/cli/direnv.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.direnv;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.direnv.enable = mkEnableOption "Enable direnv";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.direnv = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
|
||||||
|
silent = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
modules/home-manager/cli/fzf.nix
Normal file
21
modules/home-manager/cli/fzf.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.fzf;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.fzf.enable = mkEnableOption "Enable fzf";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.fzf = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
FZF_DEFAULT_OPTS = "--reverse";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
178
modules/home-manager/cli/git.nix
Normal file
178
modules/home-manager/cli/git.nix
Normal file
|
@ -0,0 +1,178 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.git;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.git = {
|
||||||
|
enable = mkEnableOption "Enable git";
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = types.submodule {
|
||||||
|
options = {
|
||||||
|
emailAddress = mkOption {
|
||||||
|
description = "User email address.";
|
||||||
|
type = types.str;
|
||||||
|
apply =
|
||||||
|
x:
|
||||||
|
assert builtins.match "^[^@]+@[^@]+\\.[^@]+$" x != null;
|
||||||
|
x;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.file."${config.xdg.configHome}/git/message".text = ''
|
||||||
|
|
||||||
|
|
||||||
|
# Description
|
||||||
|
#
|
||||||
|
# - Why is this change necessary?
|
||||||
|
# - How does it address the issue?
|
||||||
|
# - What side effects does this change have?
|
||||||
|
#
|
||||||
|
# For breaking changes, uncomment the following line and describe the change:
|
||||||
|
#
|
||||||
|
# BREAKING CHANGE:
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Add any issue IDs or commit SHAs that this commit references:
|
||||||
|
#
|
||||||
|
# Refs:
|
||||||
|
|
||||||
|
'';
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "Oliver Davies";
|
||||||
|
userEmail = cfg.user.emailAddress;
|
||||||
|
|
||||||
|
aliases = {
|
||||||
|
aa = "add --all";
|
||||||
|
assume = "update-index --assume-unchanged";
|
||||||
|
assumed = "!git ls-files -v | grep '^[hsmrck?]' | cut -c 3-";
|
||||||
|
b = "branch";
|
||||||
|
blame = "blame -w -C -C -C";
|
||||||
|
browse = "!gh repo view --web";
|
||||||
|
ca = "commit --amend --verbose";
|
||||||
|
car = "commit --amend --no-edit";
|
||||||
|
cl = "!hub clone";
|
||||||
|
co = "checkout";
|
||||||
|
compare = "!hub compare";
|
||||||
|
current-branch = "rev-parse --abbrev-ref HEAD";
|
||||||
|
dc = "diff --color --word-diff --cached";
|
||||||
|
df = "diff --color --word-diff";
|
||||||
|
dup = "!git checkout develop && git fetch origin && echo && git sl develop..origin/develop && echo && git pull --quiet && git checkout -";
|
||||||
|
fixup = "commit --fixup";
|
||||||
|
issues = "!gh issue list --web";
|
||||||
|
mup = "!git master-to-main-wrapper checkout %BRANCH% && git fetch origin && echo && git sl %BRANCH%..origin/%BRANCH% && echo && git pull --quiet && git checkout -";
|
||||||
|
no-ff = "merge --no-ff";
|
||||||
|
pl = "pull";
|
||||||
|
prune = "remote prune origin";
|
||||||
|
ps = "push";
|
||||||
|
pulls = "!gh pr list --web";
|
||||||
|
rbc = "rebase --continue";
|
||||||
|
rdup = "!git dup && git rebase develop";
|
||||||
|
remotes = "remote -v";
|
||||||
|
repush = "!git pull --rebase && git push";
|
||||||
|
ri = "rebase --interactive";
|
||||||
|
rid = "!git rebase -i $(git merge-base develop HEAD)";
|
||||||
|
rim = "!git rebase -i $(git master-to-main-wrapper merge-base %BRANCH% HEAD)";
|
||||||
|
rip = "!git rebase -i $(git merge-base production HEAD)";
|
||||||
|
ris = "!git rebase -i $(git merge-base staging HEAD)";
|
||||||
|
riu = "!git rebase -i $(git rev-parse --abbrev-ref --symbolic-full-name @{u})";
|
||||||
|
rmup = "!git mup && git master-to-main-wrapper rebase %BRANCH%";
|
||||||
|
sl = "log --oneline --decorate -20";
|
||||||
|
sla = "log --oneline --decorate --graph --all -20";
|
||||||
|
slap = "log --oneline --decorate --graph --all";
|
||||||
|
slp = "log --oneline --decorate";
|
||||||
|
stash = "stash --included-untracked";
|
||||||
|
unassume = "update-index --no-assume-unchanged";
|
||||||
|
uncommit = "reset --soft HEAD^";
|
||||||
|
unstage = "reset";
|
||||||
|
update = "!git fetch --all --jobs=4 --prune --progress && git rebase --autostash --stat";
|
||||||
|
upstream = "rev-parse --abbrev-ref --symbolic-full-name @{u}";
|
||||||
|
ureset = "!git reset --hard $(git upstream)";
|
||||||
|
worktrees = "worktree list";
|
||||||
|
};
|
||||||
|
|
||||||
|
ignores = [
|
||||||
|
"/.ddev/providers/"
|
||||||
|
"/.direnv/"
|
||||||
|
"/.ignored/"
|
||||||
|
"/.issue-id"
|
||||||
|
"/.phpactor.json"
|
||||||
|
"/notes"
|
||||||
|
"/todo"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
branch = {
|
||||||
|
autosetupmerge = true;
|
||||||
|
autosetuprebase = "always";
|
||||||
|
sort = "-committerdate";
|
||||||
|
};
|
||||||
|
|
||||||
|
checkout.defaultRemote = "origin";
|
||||||
|
color.ui = true;
|
||||||
|
column.ui = "auto";
|
||||||
|
commit.template = "${config.xdg.configHome}/git/message";
|
||||||
|
|
||||||
|
core = {
|
||||||
|
editor = "nvim";
|
||||||
|
excludesFile = "~/.config/git/ignore";
|
||||||
|
};
|
||||||
|
|
||||||
|
diff.tool = "vimdiff";
|
||||||
|
fetch.prune = true;
|
||||||
|
gpg.format = "ssh";
|
||||||
|
grep.lineNumber = true;
|
||||||
|
help.autocorrect = "1";
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
|
||||||
|
maintenance = {
|
||||||
|
auto = false;
|
||||||
|
strategy = "incremental";
|
||||||
|
};
|
||||||
|
|
||||||
|
merge.ff = "only";
|
||||||
|
|
||||||
|
push = {
|
||||||
|
autoSetupRemote = true;
|
||||||
|
default = "upstream";
|
||||||
|
};
|
||||||
|
|
||||||
|
pull = {
|
||||||
|
ff = "only";
|
||||||
|
rebase = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
rebase = {
|
||||||
|
autosquash = true;
|
||||||
|
autostash = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
user.signingkey = "~/.ssh/id_rsa.pub";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home = {
|
||||||
|
packages = with pkgs; [ nixpkgs-2411.git-instafix ];
|
||||||
|
|
||||||
|
sessionVariables = {
|
||||||
|
GIT_INSTAFIX_UPSTREAM = "origin/main";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
25
modules/home-manager/cli/node.nix
Normal file
25
modules/home-manager/cli/node.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.node;
|
||||||
|
|
||||||
|
inherit (config.xdg) configHome dataHome stateHome;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.node.enable = mkEnableOption "Enable node";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
xdg.configFile."${config.home.sessionVariables.NPM_CONFIG_USERCONFIG}".text = ''
|
||||||
|
cache=${configHome}/npm
|
||||||
|
init-module=${configHome}/npm/config/npm-init.js
|
||||||
|
logs-dir=${stateHome}/npm/logs
|
||||||
|
prefix=${dataHome}/npm
|
||||||
|
'';
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
NPM_CONFIG_USERCONFIG = "${configHome}/npm/npmrc";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
30
modules/home-manager/cli/notes.nix
Normal file
30
modules/home-manager/cli/notes.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.notes;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.notes.enable = mkEnableOption "Enable notes";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
xdg = {
|
||||||
|
enable = true;
|
||||||
|
userDirs.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home = {
|
||||||
|
packages = with pkgs; [ notes ];
|
||||||
|
|
||||||
|
sessionVariables = {
|
||||||
|
NOTES_DIRECTORY = "${config.xdg.userDirs.documents}/wiki/notes";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
14
modules/home-manager/cli/ranger.nix
Normal file
14
modules/home-manager/cli/ranger.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.ranger;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.ranger.enable = mkEnableOption "Enable ranger";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.ranger.enable = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
home-manager.users.opdavies.home = {
|
home = {
|
||||||
sessionPath = [ "$HOME/.local/bin" ];
|
sessionPath = [ "$HOME/.local/bin" ];
|
||||||
|
|
||||||
file.".local/bin" = {
|
file.".local/bin" = {
|
187
modules/home-manager/cli/starship.nix
Normal file
187
modules/home-manager/cli/starship.nix
Normal file
|
@ -0,0 +1,187 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.starship;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.starship.enable = mkEnableOption "Enable starship";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.starship =
|
||||||
|
let
|
||||||
|
inherit (builtins) concatStringsSep;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
add_newline = false;
|
||||||
|
|
||||||
|
# https://starship.rs/config/#prompt
|
||||||
|
format = concatStringsSep "" [
|
||||||
|
"\n"
|
||||||
|
"$username"
|
||||||
|
"$hostname"
|
||||||
|
"$directory"
|
||||||
|
"$vcsh"
|
||||||
|
"$git_branch"
|
||||||
|
"$git_status"
|
||||||
|
"$git_metrics"
|
||||||
|
"$docker_context"
|
||||||
|
"$nodejs"
|
||||||
|
"$php"
|
||||||
|
"$terraform"
|
||||||
|
"$nix_shell"
|
||||||
|
"$direnv"
|
||||||
|
"\${custom.mob}"
|
||||||
|
"$memory_usage"
|
||||||
|
"$cmd_duration"
|
||||||
|
"$lua"
|
||||||
|
"$status"
|
||||||
|
"$character"
|
||||||
|
];
|
||||||
|
|
||||||
|
cmd_duration.disabled = true;
|
||||||
|
direnv.disabled = false;
|
||||||
|
directory.format = "[$path]($style) ";
|
||||||
|
git_status.disabled = true;
|
||||||
|
nix_shell.disabled = true;
|
||||||
|
nodejs.disabled = true;
|
||||||
|
php.disabled = true;
|
||||||
|
username.disabled = true;
|
||||||
|
|
||||||
|
custom = {
|
||||||
|
mob = {
|
||||||
|
command = "echo $MOB_TIMER_ROOM";
|
||||||
|
format = "[($output)]($style) ";
|
||||||
|
when = "[[ -v MOB_TIMER_ROOM ]]";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://starship.rs/presets/plain-text
|
||||||
|
aws.symbol = "aws ";
|
||||||
|
azure.symbol = "az ";
|
||||||
|
bun.symbol = "bun ";
|
||||||
|
c.symbol = "C ";
|
||||||
|
character = {
|
||||||
|
success_symbol = "[>](bold green)";
|
||||||
|
error_symbol = "[x](bold red)";
|
||||||
|
vimcmd_symbol = "[<](bold green)";
|
||||||
|
};
|
||||||
|
cobol.symbol = "cobol ";
|
||||||
|
conda.symbol = "conda ";
|
||||||
|
crystal.symbol = "cr ";
|
||||||
|
cmake.symbol = "cmake ";
|
||||||
|
daml.symbol = "daml ";
|
||||||
|
dart.symbol = "dart ";
|
||||||
|
deno.symbol = "deno ";
|
||||||
|
dotnet.symbol = ".NET ";
|
||||||
|
directory.read_only = " ro";
|
||||||
|
docker_context.symbol = "docker ";
|
||||||
|
elixir.symbol = "exs ";
|
||||||
|
elm.symbol = "elm ";
|
||||||
|
fennel.symbol = "fnl ";
|
||||||
|
fossil_branch.symbol = "fossil ";
|
||||||
|
gcloud.symbol = "gcp ";
|
||||||
|
git_branch.symbol = "git ";
|
||||||
|
git_commit.tag_symbol = " tag ";
|
||||||
|
git_status = {
|
||||||
|
ahead = ">";
|
||||||
|
behind = "<";
|
||||||
|
diverged = "<>";
|
||||||
|
renamed = "r";
|
||||||
|
deleted = "x";
|
||||||
|
};
|
||||||
|
gleam.symbol = "gleam ";
|
||||||
|
golang.symbol = "go ";
|
||||||
|
gradle.symbol = "gradle ";
|
||||||
|
guix_shell.symbol = "guix ";
|
||||||
|
hg_branch.symbol = "hg ";
|
||||||
|
java.symbol = "java ";
|
||||||
|
julia.symbol = "jl ";
|
||||||
|
kotlin.symbol = "kt ";
|
||||||
|
lua.symbol = "lua ";
|
||||||
|
nodejs.symbol = "nodejs ";
|
||||||
|
memory_usage.symbol = "memory ";
|
||||||
|
meson.symbol = "meson ";
|
||||||
|
nats.symbol = "nats ";
|
||||||
|
nim.symbol = "nim ";
|
||||||
|
nix_shell.symbol = "nix ";
|
||||||
|
ocaml.symbol = "ml ";
|
||||||
|
opa.symbol = "opa ";
|
||||||
|
os.symbols = {
|
||||||
|
AIX = "aix ";
|
||||||
|
Alpaquita = "alq ";
|
||||||
|
AlmaLinux = "alma ";
|
||||||
|
Alpine = "alp ";
|
||||||
|
Amazon = "amz ";
|
||||||
|
Android = "andr ";
|
||||||
|
Arch = "rch ";
|
||||||
|
Artix = "atx ";
|
||||||
|
CentOS = "cent ";
|
||||||
|
Debian = "deb ";
|
||||||
|
DragonFly = "dfbsd ";
|
||||||
|
Emscripten = "emsc ";
|
||||||
|
EndeavourOS = "ndev ";
|
||||||
|
Fedora = "fed ";
|
||||||
|
FreeBSD = "fbsd ";
|
||||||
|
Garuda = "garu ";
|
||||||
|
Gentoo = "gent ";
|
||||||
|
HardenedBSD = "hbsd ";
|
||||||
|
Illumos = "lum ";
|
||||||
|
Kali = "kali ";
|
||||||
|
Linux = "lnx ";
|
||||||
|
Mabox = "mbox ";
|
||||||
|
Macos = "mac ";
|
||||||
|
Manjaro = "mjo ";
|
||||||
|
Mariner = "mrn ";
|
||||||
|
MidnightBSD = "mid ";
|
||||||
|
Mint = "mint ";
|
||||||
|
NetBSD = "nbsd ";
|
||||||
|
NixOS = "nix ";
|
||||||
|
OpenBSD = "obsd ";
|
||||||
|
OpenCloudOS = "ocos ";
|
||||||
|
openEuler = "oeul ";
|
||||||
|
openSUSE = "osuse ";
|
||||||
|
OracleLinux = "orac ";
|
||||||
|
Pop = "pop ";
|
||||||
|
Raspbian = "rasp ";
|
||||||
|
Redhat = "rhl ";
|
||||||
|
RedHatEnterprise = "rhel ";
|
||||||
|
RockyLinux = "rky ";
|
||||||
|
Redox = "redox ";
|
||||||
|
Solus = "sol ";
|
||||||
|
SUSE = "suse ";
|
||||||
|
Ubuntu = "ubnt ";
|
||||||
|
Ultramarine = "ultm ";
|
||||||
|
Unknown = "unk ";
|
||||||
|
Void = "void ";
|
||||||
|
Windows = "win ";
|
||||||
|
};
|
||||||
|
package.symbol = "pkg ";
|
||||||
|
perl.symbol = "pl ";
|
||||||
|
php.symbol = "php ";
|
||||||
|
pijul_channel.symbol = "pijul ";
|
||||||
|
pulumi.symbol = "pulumi ";
|
||||||
|
purescript.symbol = "purs ";
|
||||||
|
python.symbol = "py ";
|
||||||
|
quarto.symbol = "quarto ";
|
||||||
|
raku.symbol = "raku ";
|
||||||
|
ruby.symbol = "rb ";
|
||||||
|
rust.symbol = "rs ";
|
||||||
|
scala.symbol = "scala ";
|
||||||
|
spack.symbol = "spack ";
|
||||||
|
solidity.symbol = "solidity ";
|
||||||
|
status.symbol = "[x](bold red) ";
|
||||||
|
sudo.symbol = "sudo ";
|
||||||
|
swift.symbol = "swift ";
|
||||||
|
typst.symbol = "typst ";
|
||||||
|
terraform.symbol = "terraform ";
|
||||||
|
zig.symbol = "zig ";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
46
modules/home-manager/cli/tmux-sessionizer.nix
Normal file
46
modules/home-manager/cli/tmux-sessionizer.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.tmux-sessionizer;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.tmux-sessionizer.enable = mkEnableOption "Enable tmux-sessionizer";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
tmux-sessionizer
|
||||||
|
];
|
||||||
|
|
||||||
|
xdg.configFile."tmux-sessionizer/default".source = "${
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = ".tmux-sessionizer";
|
||||||
|
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
tmux
|
||||||
|
];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
set +o errexit
|
||||||
|
set +o nounset
|
||||||
|
|
||||||
|
if [[ "$PWD" == "${config.xdg.userDirs.extraConfig.XDG_REPOS_DIR}/os" || "$PWD" == "${config.xdg.userDirs.extraConfig.XDG_REPOS_DIR}/personal" ]]; then
|
||||||
|
clear
|
||||||
|
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmux new-window -d -n scratch
|
||||||
|
nvim .
|
||||||
|
clear
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
}/bin/.tmux-sessionizer";
|
||||||
|
};
|
||||||
|
}
|
97
modules/home-manager/cli/tmux.nix
Normal file
97
modules/home-manager/cli/tmux.nix
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.tmux;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.tmux.enable = mkEnableOption "Enable tmux";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
terminal = "tmux-256color";
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
set-option -g status-keys "vi"
|
||||||
|
set-option -sa terminal-features "''${TERM}:RGB"
|
||||||
|
|
||||||
|
bind -n S-Left resize-pane -L 2
|
||||||
|
bind -n S-Right resize-pane -R 2
|
||||||
|
bind -n S-Down resize-pane -D 1
|
||||||
|
bind -n S-Up resize-pane -U 1
|
||||||
|
|
||||||
|
bind -n C-Left resize-pane -L 10
|
||||||
|
bind -n C-Right resize-pane -R 10
|
||||||
|
bind -n C-Down resize-pane -D 5
|
||||||
|
bind -n C-Up resize-pane -U 5
|
||||||
|
|
||||||
|
# Status line customisation
|
||||||
|
set-option -g status-left ""
|
||||||
|
set-option -g status-right " #{session_name}"
|
||||||
|
set-option -g status-right-length 100
|
||||||
|
set-option -g status-style "fg=#7C7D83 bg=default"
|
||||||
|
set-option -g window-status-activity-style none
|
||||||
|
set-option -g window-status-current-style "fg=#E9E9EA"
|
||||||
|
|
||||||
|
bind c new-window -c "#{pane_current_path}"
|
||||||
|
|
||||||
|
set -g base-index 1
|
||||||
|
set -g pane-base-index 1
|
||||||
|
set -g renumber-windows on
|
||||||
|
|
||||||
|
# Break a pane into a new window.
|
||||||
|
bind-key b break-pane -d
|
||||||
|
bind-key J command-prompt -p "join pane from: " "join-pane -h -s '%%'"
|
||||||
|
|
||||||
|
bind-key C-j choose-tree
|
||||||
|
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||||
|
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
|
||||||
|
|
||||||
|
bind C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
|
||||||
|
|
||||||
|
bind-key K run-shell 'tmux switch-client -n \; kill-session -t "$(tmux display-message -p "#S")" || tmux kill-session'
|
||||||
|
|
||||||
|
# Allow clearing screen with ctrl-l by using <prefix> C-l
|
||||||
|
bind C-l send-keys "C-l"
|
||||||
|
bind C-k send-keys "C-k"
|
||||||
|
|
||||||
|
# Enable mouse support.
|
||||||
|
setw -g mouse on
|
||||||
|
|
||||||
|
# Remove delay when switching Vim modes.
|
||||||
|
set -sg escape-time 0
|
||||||
|
|
||||||
|
set-option -g pane-active-border-style "fg=#1f2335"
|
||||||
|
set-option -g pane-border-style "fg=#1f2335"
|
||||||
|
|
||||||
|
# Vim-like pane navigation.
|
||||||
|
bind ^ last-window
|
||||||
|
bind h select-pane -L
|
||||||
|
bind j select-pane -D
|
||||||
|
bind k select-pane -U
|
||||||
|
bind l select-pane -R
|
||||||
|
|
||||||
|
bind-key -r f run-shell "tmux new-window tmux-sessionizer"
|
||||||
|
|
||||||
|
bind-key -r D new-window -c "#{pane_current_path}" "[[ -e TODO.md ]] && nvim TODO.md || nvim ~/Documents/wiki/todo.txt"
|
||||||
|
bind-key -r N new-window "notes"
|
||||||
|
bind-key -r W split-window -h -c ~/Documents/wiki "nvim '+Telescope find_files'"
|
||||||
|
'';
|
||||||
|
|
||||||
|
plugins = with pkgs.tmuxPlugins; [
|
||||||
|
vim-tmux-navigator
|
||||||
|
yank
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
115
modules/home-manager/cli/zsh/default.nix
Normal file
115
modules/home-manager/cli/zsh/default.nix
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeManagerModules.cli.zsh;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homeManagerModules.cli.zsh.enable = mkEnableOption "Enable zsh";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
|
||||||
|
zsh-abbr = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
abbreviations = import ./abbreviations.nix;
|
||||||
|
globalAbbreviations = import ./global-abbreviations.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
dotDir = ".config/zsh";
|
||||||
|
|
||||||
|
shellAliases = (import ./aliases.nix { inherit config; });
|
||||||
|
|
||||||
|
localVariables = {
|
||||||
|
ABBR_SET_EXPANSION_CURSOR = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
profileExtra = ''
|
||||||
|
if [[ -z "$DISPLAY" ]] && [[ "$(tty)" == "/dev/tty1" ]]; then
|
||||||
|
exec startx &>/dev/null
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
initExtra = ''
|
||||||
|
background() {
|
||||||
|
for ((i=2;i<=$#;i++)); do
|
||||||
|
''${@[1]} ''${@[$i]} &> /dev/null &
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# suffix
|
||||||
|
alias -s gz="tar -tf"
|
||||||
|
alias -s {html,HTML}="background zsh"
|
||||||
|
alias -s {jpg,JPG,png,PNG}="background okular"
|
||||||
|
alias -s {pdf,PDF}="background okular"
|
||||||
|
alias -s {zip,ZIP}="unzip -l"
|
||||||
|
|
||||||
|
git() {
|
||||||
|
case "$1" in
|
||||||
|
clone)
|
||||||
|
shift
|
||||||
|
|
||||||
|
local repo_url="$1"
|
||||||
|
local repo_path="''${2:-}"
|
||||||
|
|
||||||
|
if [ -n "$TARGET_DIR" ]; then
|
||||||
|
command git clone "$repo_url" "$repo_path"
|
||||||
|
else
|
||||||
|
command git clone "$repo_url"
|
||||||
|
repo_path=$(basename "$repo_url" .git)
|
||||||
|
fi
|
||||||
|
|
||||||
|
${pkgs.tmux-sessionizer}/bin/tmux-sessionizer "$repo_path"
|
||||||
|
;;
|
||||||
|
|
||||||
|
root)
|
||||||
|
shift
|
||||||
|
|
||||||
|
local ROOT="$(${pkgs.git}/bin/git rev-parse --show-toplevel 2> /dev/null || echo -n .)"
|
||||||
|
|
||||||
|
if [[ $# == 0 ]]; then
|
||||||
|
cd "''${ROOT}"
|
||||||
|
else
|
||||||
|
(cd "''${ROOT}" && eval "''${@}")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
${pkgs.git}/bin/git "''${@}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
mbsync() {
|
||||||
|
${pkgs.isync}/bin/mbsync --config "${config.xdg.configHome}/isync/mbsyncrc" "''${@}"
|
||||||
|
}
|
||||||
|
|
||||||
|
ttyper() {
|
||||||
|
command ${pkgs.ttyper}/bin/ttyper --language english1000 --words 50 "''${@}"
|
||||||
|
}
|
||||||
|
|
||||||
|
yt-dlp() {
|
||||||
|
command yt-dlp --paths ~/Videos "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
bindkey -s ^f "tmux-sessionizer\n"
|
||||||
|
bindkey -s ^v "nvim\n"
|
||||||
|
|
||||||
|
setopt auto_cd
|
||||||
|
setopt auto_pushd
|
||||||
|
setopt pushd_ignore_dups
|
||||||
|
setopt pushdminus
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/home-manager/coding/default.nix
Normal file
6
modules/home-manager/coding/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./neovim
|
||||||
|
./phpactor
|
||||||
|
];
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue