[modules]: Moved some options to the files where they belong

This commit is contained in:
Riley Apeldoorn 2022-01-23 17:03:10 +01:00
parent 74dda4d72b
commit 9b49e2eefa
16 changed files with 91 additions and 66 deletions

View file

@ -97,7 +97,7 @@ let inherit (builtins) mapAttrs map; in rec {
};
orange = {
normal = "ff5e69";
normal = "ff8c26";
bright = "fca151";
pastel = "";
};

1
configuration.nix Symbolic link
View file

@ -0,0 +1 @@
/etc/nixos/machines/thor/configuration.nix

View file

@ -8,7 +8,7 @@
riley = {
gui = true;
ide = true;
kak.ide = true;
};
networking = {

View file

@ -7,8 +7,8 @@
];
riley = {
ide = true;
gui = true;
kak.ide = true;
};
networking = {
@ -16,6 +16,10 @@
interfaces.enp9s0.useDHCP = true;
};
users.users."riley".packages = with pkgs; [
minecraft
];
devices = {
# Audio devices

View file

@ -38,24 +38,6 @@ let named = submodule {
options.riley = with lib; {
ide = mkOption {
type = types.bool;
description = ''
Enable IDE-like plugins such as language servers for Rust, Haskell and
Nix in the editor, and configure accordingly. If disabled, the editor
will lack some features such as semantic highlighting.
'';
default = true;
};
gui = mkOption {
type = types.bool;
description = ''
Enable the display server and related graphical programs.
'';
default = true;
};
theme = mkOption {
type = themeType;
description = ''
@ -124,7 +106,7 @@ let named = submodule {
<home-manager/nixos>
./ide
./kak
./gui
./fonts.nix
@ -137,6 +119,8 @@ let named = submodule {
riley.theme = (import ../colors.nix)."dark";
time.timeZone = "Europe/Amsterdam";
environment.systemPackages = with pkgs; [
# Web utils

View file

@ -1,6 +1,6 @@
{ pkgs, lib, config, ... }:
(lib.mkIf (config.riley.gui) {
with lib; (mkIf config.riley.gui {
home-manager.users."riley" = {
programs.alacritty = {
enable = true;

View file

@ -1,20 +1,26 @@
{ pkgs, config, lib, ... }:
({
with lib; {
imports = [
./window-manager.nix
./wm
./pulseaudio.nix
./clipboard.nix
./alacritty.nix
];
}) // (lib.mkIf (config.riley.gui) {
options.riley.gui = mkEnableOption "gui applications and window manager";
# Graphical applications
users.users."riley".packages = with pkgs; [
google-chrome
tdesktop
];
config = mkIf config.riley.gui {
})
# Graphical applications
users.users."riley".packages = with pkgs; [
google-chrome
tdesktop
];
};
}

View file

@ -27,7 +27,10 @@ let theme = config.riley.theme.hex;
};
});
in (lib.mkIf (config.riley.gui) {
in
with lib; (mkIf config.riley.gui {
services.xserver = {
enable = true;
windowManager.i3.enable = true;

View file

@ -62,6 +62,9 @@ with lib; let mod = modifier;
"${mod}+A" = "split v";
"${mod}+S" = "split h";
"${mod}+Q" = "layout tabbed";
"${mod}+W" = "layout default";
"${mod}+F" = "fullscreen toggle";
"${mod}+BackSpace" = "kill";

View file

@ -22,7 +22,7 @@
face global macro rgb:fc4cbf+b
# Keywords
face global keyword rgb:${blue.normal}
face global keyword rgb:${foreground.normal}+b
# Literals
face global literal rgb:${yellow.bright}

View file

@ -17,6 +17,10 @@ let kakrc = pkgs.writeTextFile (rec {
map global insert <a-tab> <esc>:buffer-next<ret>
map global normal <a-tab> :buffer-next<ret>
def new-tab %{ prompt -file-completion '>' 'terminal kak -c %val{session} %val{text}' }
map global normal <a-ret> ': new-tab<ret>'
colorscheme common
face global LineNumbers rgb:${background.slight}
@ -29,7 +33,7 @@ let kakrc = pkgs.writeTextFile (rec {
face global comment rgb:${foreground.slight}
'' + (lib.optionalString (config.riley.ide) ''
'' + (lib.optionalString (config.riley.kak.ide) ''
eval %sh{ kak-lsp --kakoune -s $kak_session }
@ -68,6 +72,15 @@ let kakrc = pkgs.writeTextFile (rec {
colorscheme rust
git show-diff
hook buffer BufReload .* %{
git update-diff
}
hook buffer NormalIdle .* %{ git update-diff }
hook buffer InsertIdle .* %{ git update-diff }
hook window -group semtok BufReload .* lsp-semantic-tokens
hook window -group semtok NormalIdle .* lsp-semantic-tokens
hook window -group semtok InsertIdle .* lsp-semantic-tokens
@ -175,39 +188,50 @@ let kakrc = pkgs.writeTextFile (rec {
'';
});
in {
environment.systemPackages = with pkgs; [
in with lib; {
(pkgs.kakoune.override {
plugins = with kakounePlugins; [
options.riley = {
kak.enable = (mkEnableOption "kakoune editor") // { default = true; };
kak.ide = mkEnableOption "kakoune with ide plugins";
};
# Custom config
kakrc
config = mkIf (config.riley.kak.enable || config.riley.kak.ide) {
# Kakoune language server support
(symlinkJoin {
paths = [
environment.systemPackages = with pkgs; [
(pkgs.kakoune.override {
plugins = [
# The language server client
kak-lsp
# Custom config
kakrc
# Include default language servers
rnix-lsp
haskell-language-server
] ++ (lib.optionals config.riley.kak.ide [
# Overwrite kak-lsp.toml
kak-lsp-config
# Kakoune language server support
(symlinkJoin {
paths = with kakounePlugins; [
];
name = "kak-lsp-${kak-lsp.version}";
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/kak-lsp --add-flags "--config $out/share/kak-lsp/kak-lsp.toml"
'';
})
# The language server client
kak-lsp
] ++ colors;
})
# Include default language servers
rnix-lsp
haskell-language-server
# Overwrite kak-lsp.toml
kak-lsp-config
];
name = "kak-lsp-${kak-lsp.version}";
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/kak-lsp --add-flags "--config $out/share/kak-lsp/kak-lsp.toml"
'';
})
]) ++ colors;
})
];
};
];
}