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 .PHONY: build switch test
test:
sudo nixos-rebuild test --flake .
switch:
sudo nixos-rebuild switch --flake .
build: build:
sudo nixos-rebuild build --flake . sudo nixos-rebuild build --flake .
-nix run nixpkgs#home-manager -- build --flake .
debug: switch:
sudo nixos-rebuild build --flake . --show-trace --refresh sudo nixos-rebuild switch --flake .
-nix run nixpkgs#home-manager -- switch --flake .
lock: test:
nix flake lock --update-input nixpkgs --update-input home-manager sudo nixos-rebuild test --flake .
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

View file

@ -19,6 +19,7 @@
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"neovim-custom",
"neovim-nightly-overlay", "neovim-nightly-overlay",
"nixpkgs" "nixpkgs"
] ]
@ -57,6 +58,7 @@
"flake-parts_3": { "flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"neovim-custom",
"neovim-nightly-overlay", "neovim-nightly-overlay",
"hercules-ci-effects", "hercules-ci-effects",
"hercules-ci-agent", "hercules-ci-agent",
@ -135,6 +137,7 @@
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"hercules-ci-agent": "hercules-ci-agent", "hercules-ci-agent": "hercules-ci-agent",
"nixpkgs": [ "nixpkgs": [
"neovim-custom",
"neovim-nightly-overlay", "neovim-nightly-overlay",
"nixpkgs" "nixpkgs"
] ]
@ -217,21 +220,41 @@
"type": "github" "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": { "neovim-flake": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [
"neovim-custom",
"neovim-nightly-overlay", "neovim-nightly-overlay",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1689722072, "lastModified": 1689836628,
"narHash": "sha256-Rjk2nAYMEB7+jy+4an3oTSQ7gn8K5U8ZGWLMaaCdHtI=", "narHash": "sha256-CDbbn0N6eiknKa4KrYc6+4LAb4za2IYSw/YGy5BPdcQ=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "ab5cdbd167353a0c6a0ef0b864d78af13029339c", "rev": "63b3408551561127f7845470eb51404bcd6f547b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -248,15 +271,16 @@
"hercules-ci-effects": "hercules-ci-effects", "hercules-ci-effects": "hercules-ci-effects",
"neovim-flake": "neovim-flake", "neovim-flake": "neovim-flake",
"nixpkgs": [ "nixpkgs": [
"neovim-custom",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1689725104, "lastModified": 1689897867,
"narHash": "sha256-NQ9GCkrlk7NVnKA0JCprpjVwmE1J5/Xv5nj0WasXsP0=", "narHash": "sha256-qr3jIEZh6k83i5JBfJ1GuwSTybekrioSnd3iaZACr5g=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "f42a9b1db59af2dff882803c38c51be7d5680da2", "rev": "258dfdf8fec67a1cea88a71d7613584300e062a0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -300,6 +324,22 @@
} }
}, },
"nixpkgs_2": { "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": { "locked": {
"lastModified": 1689534811, "lastModified": 1689534811,
"narHash": "sha256-jnSUdzD/414d94plCyNlvTJJtiTogTep6t7ZgIKIHiE=", "narHash": "sha256-jnSUdzD/414d94plCyNlvTJJtiTogTep6t7ZgIKIHiE=",
@ -319,8 +359,9 @@
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-custom": "neovim-custom",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"tokyonight": "tokyonight",
"wallpapers": "wallpapers" "wallpapers": "wallpapers"
} }
}, },
@ -339,6 +380,22 @@
"type": "github" "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": { "wallpapers": {
"locked": { "locked": {
"lastModified": 1687523055, "lastModified": 1687523055,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
{pkgs, ...}: { {tokyonight, ...}: {
imports = [./default.nix]; imports = [./default.nix];
programs = { programs = {
fish = { fish = {
@ -6,14 +6,7 @@
plugins = [ plugins = [
{ {
name = "tokyonight"; name = "tokyonight";
src = src = "${tokyonight}/extras/fish/tokyonight_night.fish";
pkgs.fetchFromGitHub {
owner = "folke";
repo = "tokyonight.nvim";
rev = "cd5156f4b4a6c4c337a46deb0c0bd37319920833";
sha256 = "/ht+ixR1eyYR0la00Xq5q1gCsgb5Ly90JghERwbaDPQ=";
}
+ "/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 = [ pkgs,
./neovim.nix neovim-custom,
./bat.nix tokyonight,
./gitui.nix ...
]; }: {
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 @@
{ {shellConfig, ...}: let
pkgs,
shellConfig,
...
}: let
username = "xenia"; username = "xenia";
homeDirectory = "/home/${username}"; homeDirectory = "/home/${username}";
in { in {
@ -16,8 +12,5 @@ in {
inherit username homeDirectory; inherit username homeDirectory;
stateVersion = "22.11"; stateVersion = "22.11";
}; };
programs = { programs.home-manager.enable = true;
home-manager.enable = true;
neovim.package = pkgs.neovim-nightly;
};
} }

View file

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

View file

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

View file

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