Use custom neovim flake, centralise tokyonight source

nvim repo has been converted to flake for easier inclusion but still
stand-alone for non-nix systems

Move tokyonight repo fetch to flake input to keep consistent and reduce
multiple fetch calls
This commit is contained in:
Evie Litherland-Smith 2023-07-24 13:27:05 +01:00
parent d00e1ec199
commit e2c9d8eba7
16 changed files with 146 additions and 210 deletions

View file

@ -1,36 +1,12 @@
.PHONY: test switch build debug lock update hyprland waybar home full
test:
sudo nixos-rebuild test --flake .
switch:
sudo nixos-rebuild switch --flake .
.PHONY: build switch test
build:
sudo nixos-rebuild build --flake .
-nix run nixpkgs#home-manager -- build --flake .
debug:
sudo nixos-rebuild build --flake . --show-trace --refresh
switch:
sudo nixos-rebuild switch --flake .
-nix run nixpkgs#home-manager -- switch --flake .
lock:
nix flake lock --update-input nixpkgs --update-input home-manager
update:
nix flake update --refresh --commit-lock-file
hyprland:
-hyprctl reload
-pkill -1 kanshi
waybar:
-pkill -9 waybar
-hyprctl dispatch exec waybar
home:
nix run nixpkgs#home-manager -- switch --flake .
make hyprland
make waybar
full:
make switch
make home
test:
sudo nixos-rebuild test --flake .

View file

@ -19,6 +19,7 @@
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"neovim-custom",
"neovim-nightly-overlay",
"nixpkgs"
]
@ -57,6 +58,7 @@
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"neovim-custom",
"neovim-nightly-overlay",
"hercules-ci-effects",
"hercules-ci-agent",
@ -135,6 +137,7 @@
"flake-parts": "flake-parts_2",
"hercules-ci-agent": "hercules-ci-agent",
"nixpkgs": [
"neovim-custom",
"neovim-nightly-overlay",
"nixpkgs"
]
@ -217,21 +220,41 @@
"type": "github"
}
},
"neovim-custom": {
"inputs": {
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1690191730,
"narHash": "sha256-jaigjILRn7hU75nsRn7qqqqtD6vHpgT56inwOuYDImI=",
"ref": "refs/heads/main",
"rev": "01ea9bc452dd58e6071fa02b2e05ff6e8d3547c7",
"revCount": 114,
"type": "git",
"url": "https://git.xenia.me.uk/xenia/nvim.git"
},
"original": {
"type": "git",
"url": "https://git.xenia.me.uk/xenia/nvim.git"
}
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"neovim-custom",
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"dir": "contrib",
"lastModified": 1689722072,
"narHash": "sha256-Rjk2nAYMEB7+jy+4an3oTSQ7gn8K5U8ZGWLMaaCdHtI=",
"lastModified": 1689836628,
"narHash": "sha256-CDbbn0N6eiknKa4KrYc6+4LAb4za2IYSw/YGy5BPdcQ=",
"owner": "neovim",
"repo": "neovim",
"rev": "ab5cdbd167353a0c6a0ef0b864d78af13029339c",
"rev": "63b3408551561127f7845470eb51404bcd6f547b",
"type": "github"
},
"original": {
@ -248,15 +271,16 @@
"hercules-ci-effects": "hercules-ci-effects",
"neovim-flake": "neovim-flake",
"nixpkgs": [
"neovim-custom",
"nixpkgs"
]
},
"locked": {
"lastModified": 1689725104,
"narHash": "sha256-NQ9GCkrlk7NVnKA0JCprpjVwmE1J5/Xv5nj0WasXsP0=",
"lastModified": 1689897867,
"narHash": "sha256-qr3jIEZh6k83i5JBfJ1GuwSTybekrioSnd3iaZACr5g=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "f42a9b1db59af2dff882803c38c51be7d5680da2",
"rev": "258dfdf8fec67a1cea88a71d7613584300e062a0",
"type": "github"
},
"original": {
@ -300,6 +324,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1690031011,
"narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "12303c652b881435065a98729eb7278313041e49",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1689534811,
"narHash": "sha256-jnSUdzD/414d94plCyNlvTJJtiTogTep6t7ZgIKIHiE=",
@ -319,8 +359,9 @@
"inputs": {
"home-manager": "home-manager",
"hyprland": "hyprland",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2",
"neovim-custom": "neovim-custom",
"nixpkgs": "nixpkgs_3",
"tokyonight": "tokyonight",
"wallpapers": "wallpapers"
}
},
@ -339,6 +380,22 @@
"type": "github"
}
},
"tokyonight": {
"flake": false,
"locked": {
"lastModified": 1689285710,
"narHash": "sha256-x26qLaZzg7sJIc1d/5Q/DJ/YvRSc3s87PwPHTPTl+Xk=",
"owner": "folke",
"repo": "tokyonight.nvim",
"rev": "1ee11019f8a81dac989ae1db1a013e3d582e2033",
"type": "github"
},
"original": {
"owner": "folke",
"repo": "tokyonight.nvim",
"type": "github"
}
},
"wallpapers": {
"locked": {
"lastModified": 1687523055,

View file

@ -7,23 +7,27 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
wallpapers.url = "git+https://git.xenia.me.uk/xenia/wallpapers.git";
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
wallpapers.url = "git+https://git.xenia.me.uk/xenia/wallpapers.git";
neovim-custom.url = "git+https://git.xenia.me.uk/xenia/nvim.git";
tokyonight = {
url = "github:folke/tokyonight.nvim";
flake = false;
};
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
hyprland,
wallpapers,
neovim-custom,
tokyonight,
}: let
shell = "zsh";
in {
nixosConfigurations = let
@ -35,7 +39,7 @@
shell = pkgs.${shell};
openssh.authorizedKeys.keys = import ./auth/authorized_keys.nix;
};
specialArgs = {inherit inputs shell userConfig;};
specialArgs = {inherit shell userConfig hyprland;};
waybar-experimental-overlay = final: prev: {
waybar = prev.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];
@ -47,7 +51,7 @@
config.allowUnfree = true;
overlays = [
waybar-experimental-overlay
inputs.neovim-nightly-overlay.overlay
neovim-custom.outputs.overlay
];
};
in {
@ -75,7 +79,7 @@
};
homeConfigurations = let
extraSpecialArgs = {
inherit inputs;
inherit hyprland wallpapers neovim-custom tokyonight;
shellConfig = ./home/shell/${shell}.nix;
};
in {

View file

@ -1,13 +1,5 @@
{pkgs, ...}: {
xdg.configFile."git/tokyonight_night.gitconfig".source =
pkgs.fetchFromGitHub
{
owner = "folke";
repo = "tokyonight.nvim";
rev = "cd5156f4b4a6c4c337a46deb0c0bd37319920833";
sha256 = "/ht+ixR1eyYR0la00Xq5q1gCsgb5Ly90JghERwbaDPQ=";
}
+ "/extras/delta/tokyonight_night.gitconfig";
{tokyonight, ...}: {
xdg.configFile."git/tokyonight_night.gitconfig".source = "${tokyonight}/extras/delta/tokyonight_night.gitconfig";
programs.git = {
enable = true;
userName = "Evie Litherland-Smith";

View file

@ -2,7 +2,8 @@
pkgs,
lib,
config,
inputs,
hyprland,
wallpapers,
...
}: let
configure-gtk = pkgs.writeTextFile {
@ -25,7 +26,7 @@
};
in {
imports = [
inputs.hyprland.homeManagerModules.default
hyprland.homeManagerModules.default
./waybar
./rofi
./swaylock.nix
@ -56,8 +57,8 @@ in {
};
xdg.configFile = {
"hypr/hyprpaper.conf".text = lib.mkDefault ''
preload = ${inputs.wallpapers.outputs.default}
wallpaper = ,${inputs.wallpapers.outputs.default}
preload = ${wallpapers.outputs.default}
wallpaper = ,${wallpapers.outputs.default}
'';
"hypr/macchiato.conf".source = ./macchiato.conf;
"hypr/display.conf".text = lib.mkDefault '''';

View file

@ -108,34 +108,34 @@ bind = SUPER SHIFT, K, movewindow, u
bind = SUPER SHIFT, J, movewindow, d
# 1: home
bind = SUPER, A, moveworkspacetomonitor, 1 current
bind = SUPER, A, workspace, 1
bind = SUPER SHIFT, A, movetoworkspace, 1
bind = SUPER SHIFT, A, moveworkspacetomonitor, 1 current
bind = SUPER SHIFT, A, workspace, 1
# 2: dev
bind = SUPER, D, moveworkspacetomonitor, 2 current
bind = SUPER, D, workspace, 2
bind = SUPER SHIFT, D, movetoworkspace, 2
bind = SUPER SHIFT, D, moveworkspacetomonitor, 2 current
bind = SUPER SHIFT, D, workspace, 2
# 3: browser
bind = SUPER, W, moveworkspacetomonitor, 3 current
bind = SUPER, W, workspace, 3
bind = SUPER SHIFT, W, movetoworkspace, 3
bind = SUPER SHIFT, W, moveworkspacetomonitor, 3 current
bind = SUPER SHIFT, W, workspace, 3
windowrule = workspace 3,(firefox)
windowrulev2 = float,title:(File|Picture-in-Picture),class:(firefox)
windowrulev2 = pin,title:(File|Picture-in-Picture),class:(firefox)
# 4: files
bind = SUPER, F, moveworkspacetomonitor, 4 current
bind = SUPER, F, workspace, 4
bind = SUPER SHIFT, F, movetoworkspace, 4
bind = SUPER SHIFT, F, moveworkspacetomonitor, 4 current
bind = SUPER SHIFT, F, workspace, 4
windowrule = workspace 4,^(libreoffice).*
windowrule = workspace 4,(Zotero)
# 5: chat
bind = SUPER, C, moveworkspacetomonitor, 5 current
bind = SUPER, C, workspace, 5
bind = SUPER SHIFT, C, movetoworkspace, 5
bind = SUPER SHIFT, C, moveworkspacetomonitor, 5 current
bind = SUPER SHIFT, C, workspace, 5
windowrule = workspace 5,(Signal)
windowrule = workspace 5,(fractal)
windowrule = workspace 5,(discord)
@ -144,30 +144,30 @@ windowrulev2 = workspace 5,title:^(Zoom|zoom).*
windowrulev2 = float,title:^(Zoom|zoom).*
# 6: mail
bind = SUPER, Z, moveworkspacetomonitor, 6 current
bind = SUPER, Z, workspace, 6
bind = SUPER SHIFT, Z, movetoworkspace, 6
bind = SUPER SHIFT, Z, moveworkspacetomonitor, 6 current
bind = SUPER SHIFT, Z, workspace, 6
windowrule = workspace 6,(thunderbird)
# 7: remote
bind = SUPER, R, moveworkspacetomonitor, 7 current
bind = SUPER, R, workspace, 7
bind = SUPER SHIFT, R, movetoworkspace, 7
bind = SUPER SHIFT, R, moveworkspacetomonitor, 7 current
bind = SUPER SHIFT, R, workspace, 7
windowrule = workspace 7,(Nxplayer.bin)
windowrule = float,(Nxplayer.bin)
windowrule = center,(Nxplayer.bin)
# 8: steam
bind = SUPER, S, moveworkspacetomonitor, 8 current
bind = SUPER, S, workspace, 8
bind = SUPER SHIFT, S, movetoworkspace, 8
bind = SUPER SHIFT, S, moveworkspacetomonitor, 8 current
bind = SUPER SHIFT, S, workspace, 8
windowrule = workspace 8,^(steam).*
windowrule = workspace 8,(.gamescope-wrapped)
# 9: misc
bind = SUPER, X, moveworkspacetomonitor, 9 current
bind = SUPER, X, workspace, 9
bind = SUPER SHIFT, X, movetoworkspace, 9
bind = SUPER SHIFT, X, moveworkspacetomonitor, 9 current
bind = SUPER SHIFT, X, workspace, 9
bind = SUPER, period, workspace, m+1
bind = SUPER SHIFT, period, movetoworkspace, r+1

View file

@ -31,7 +31,7 @@
starship.enable = true;
taskwarrior = {
enable = true;
colorTheme = ./taskwarrior.theme;
# colorTheme = ./taskwarrior.theme;
};
};
xdg.configFile = {

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
{tokyonight, ...}: {
imports = [./default.nix];
programs = {
fish = {
@ -6,14 +6,7 @@
plugins = [
{
name = "tokyonight";
src =
pkgs.fetchFromGitHub {
owner = "folke";
repo = "tokyonight.nvim";
rev = "cd5156f4b4a6c4c337a46deb0c0bd37319920833";
sha256 = "/ht+ixR1eyYR0la00Xq5q1gCsgb5Ly90JghERwbaDPQ=";
}
+ "/extras/fish/tokyonight_night.fish";
src = "${tokyonight}/extras/fish/tokyonight_night.fish";
}
];
};

View file

@ -1,26 +0,0 @@
{pkgs, ...}: {
programs.bat = {
enable = true;
config = {
theme = "tokyonight";
};
themes = {
tokyonight = builtins.readFile (pkgs.fetchFromGitHub
{
owner = "folke";
repo = "tokyonight.nvim";
rev = "cd5156f4b4a6c4c337a46deb0c0bd37319920833";
sha256 = "/ht+ixR1eyYR0la00Xq5q1gCsgb5Ly90JghERwbaDPQ=";
}
+ "/extras/sublime/tokyonight_night.tmTheme");
Catppuccin-macchiato = builtins.readFile (pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "bat";
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
}
+ "/Catppuccin-macchiato.tmTheme");
};
};
}

View file

@ -1,7 +1,26 @@
{...}: {
imports = [
./neovim.nix
./bat.nix
./gitui.nix
];
{
pkgs,
neovim-custom,
tokyonight,
...
}: {
imports = [neovim-custom.homeManagerModules.default];
programs = {
bat = {
enable = true;
config.theme = "tokyonight";
themes.tokyonight = builtins.readFile "${tokyonight}/extras/sublime/tokyonight_night.tmTheme";
};
gitui = {
enable = true;
keyConfig = builtins.readFile (pkgs.fetchFromGitHub {
owner = "extrawurst";
repo = "gitui";
rev = "8f7f35b8a97e38a0e181032285554cd0961d588e";
sha256 = "sha256-zJDf6WhaUe8QTPCoVAdfCdUvYEcQpm2qddQiKw41kjY=";
}
+ "/vim_style_key_config.ron");
theme = builtins.readFile "${tokyonight}/extras/gitui/tokyonight_night.ron";
};
};
}

View file

@ -1,19 +0,0 @@
{pkgs, ...}: {
programs.gitui = {
enable = true;
keyConfig = builtins.readFile (pkgs.fetchFromGitHub {
owner = "extrawurst";
repo = "gitui";
rev = "8f7f35b8a97e38a0e181032285554cd0961d588e";
sha256 = "sha256-zJDf6WhaUe8QTPCoVAdfCdUvYEcQpm2qddQiKw41kjY=";
}
+ "/vim_style_key_config.ron");
theme = builtins.readFile (pkgs.fetchFromGitHub {
owner = "folke";
repo = "tokyonight.nvim";
rev = "1ee11019f8a81dac989ae1db1a013e3d582e2033";
sha256 = "sha256-x26qLaZzg7sJIc1d/5Q/DJ/YvRSc3s87PwPHTPTl+Xk=";
}
+ "/extras/gitui/tokyonight_night.ron");
};
}

View file

@ -1,44 +0,0 @@
{pkgs, ...}: {
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withRuby = true;
withPython3 = true;
extraPackages = with pkgs; [
# Misc utils
curl
fzf
git
gnutar
gnumake
gnused
gcc
ripgrep
tree-sitter
# Language servers
nil
lua-language-server
fortls
nodePackages.pyright
nodePackages.yaml-language-server
nodePackages.vim-language-server
nodePackages.bash-language-server
# Null LSP formatters
alejandra
beautysh
black
nodePackages.fixjson
fprettify
isort
python3Packages.mdformat
shellharden
stylua
];
};
}

View file

@ -1,8 +1,4 @@
{
pkgs,
shellConfig,
...
}: let
{shellConfig, ...}: let
username = "xenia";
homeDirectory = "/home/${username}";
in {
@ -16,8 +12,5 @@ in {
inherit username homeDirectory;
stateVersion = "22.11";
};
programs = {
home-manager.enable = true;
neovim.package = pkgs.neovim-nightly;
};
programs.home-manager.enable = true;
}

View file

@ -31,10 +31,7 @@ in {
zoom-us
];
};
programs = {
home-manager.enable = true;
neovim.package = pkgs.neovim-nightly;
};
programs.home-manager.enable = true;
services.kanshi = {
enable = true;
systemdTarget = "hyprland-session.target";

View file

@ -1,8 +1,4 @@
{
pkgs,
shellConfig,
...
}: let
{shellConfig, ...}: let
username = "xenia";
homeDirectory = "/home/${username}";
in {
@ -17,10 +13,7 @@ in {
inherit username homeDirectory;
stateVersion = "22.11";
};
programs = {
home-manager.enable = true;
neovim.package = pkgs.neovim-nightly;
};
programs.home-manager.enable = true;
xdg.configFile."hypr/display.conf".text = ''
monitor=DP-1,highrr,auto,1
monitor=DP-2,highrr,auto,1

View file

@ -1,10 +1,10 @@
{
pkgs,
inputs,
hyprland,
...
}: {
imports = [
inputs.hyprland.nixosModules.default
hyprland.nixosModules.default
./common.nix
];
environment.systemPackages = with pkgs; [