[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 = { orange = {
normal = "ff5e69"; normal = "ff8c26";
bright = "fca151"; bright = "fca151";
pastel = ""; pastel = "";
}; };

1
configuration.nix Symbolic link
View file

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

View file

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

View file

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

View file

@ -38,24 +38,6 @@ let named = submodule {
options.riley = with lib; { 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 { theme = mkOption {
type = themeType; type = themeType;
description = '' description = ''
@ -124,7 +106,7 @@ let named = submodule {
<home-manager/nixos> <home-manager/nixos>
./ide ./kak
./gui ./gui
./fonts.nix ./fonts.nix
@ -137,6 +119,8 @@ let named = submodule {
riley.theme = (import ../colors.nix)."dark"; riley.theme = (import ../colors.nix)."dark";
time.timeZone = "Europe/Amsterdam";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# Web utils # Web utils

View file

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

View file

@ -1,15 +1,20 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
({ with lib; {
imports = [ imports = [
./window-manager.nix
./wm
./pulseaudio.nix ./pulseaudio.nix
./clipboard.nix ./clipboard.nix
./alacritty.nix ./alacritty.nix
]; ];
}) // (lib.mkIf (config.riley.gui) { options.riley.gui = mkEnableOption "gui applications and window manager";
config = mkIf config.riley.gui {
# Graphical applications # Graphical applications
users.users."riley".packages = with pkgs; [ users.users."riley".packages = with pkgs; [
@ -17,4 +22,5 @@
tdesktop 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 = { services.xserver = {
enable = true; enable = true;
windowManager.i3.enable = true; windowManager.i3.enable = true;

View file

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

View file

@ -22,7 +22,7 @@
face global macro rgb:fc4cbf+b face global macro rgb:fc4cbf+b
# Keywords # Keywords
face global keyword rgb:${blue.normal} face global keyword rgb:${foreground.normal}+b
# Literals # Literals
face global literal rgb:${yellow.bright} 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 insert <a-tab> <esc>:buffer-next<ret>
map global normal <a-tab> :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 colorscheme common
face global LineNumbers rgb:${background.slight} face global LineNumbers rgb:${background.slight}
@ -29,7 +33,7 @@ let kakrc = pkgs.writeTextFile (rec {
face global comment rgb:${foreground.slight} 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 } eval %sh{ kak-lsp --kakoune -s $kak_session }
@ -68,6 +72,15 @@ let kakrc = pkgs.writeTextFile (rec {
colorscheme rust 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 BufReload .* lsp-semantic-tokens
hook window -group semtok NormalIdle .* lsp-semantic-tokens hook window -group semtok NormalIdle .* lsp-semantic-tokens
hook window -group semtok InsertIdle .* lsp-semantic-tokens hook window -group semtok InsertIdle .* lsp-semantic-tokens
@ -175,18 +188,27 @@ let kakrc = pkgs.writeTextFile (rec {
''; '';
}); });
in { in with lib; {
environment.systemPackages = with pkgs; [
options.riley = {
kak.enable = (mkEnableOption "kakoune editor") // { default = true; };
kak.ide = mkEnableOption "kakoune with ide plugins";
};
config = mkIf (config.riley.kak.enable || config.riley.kak.ide) {
environment.systemPackages = with pkgs; [
(pkgs.kakoune.override { (pkgs.kakoune.override {
plugins = with kakounePlugins; [ plugins = [
# Custom config # Custom config
kakrc kakrc
] ++ (lib.optionals config.riley.kak.ide [
# Kakoune language server support # Kakoune language server support
(symlinkJoin { (symlinkJoin {
paths = [ paths = with kakounePlugins; [
# The language server client # The language server client
kak-lsp kak-lsp
@ -206,8 +228,10 @@ in {
''; '';
}) })
] ++ colors; ]) ++ colors;
}) })
]; ];
};
} }