diff options
31 files changed, 177 insertions, 267 deletions
@@ -9,7 +9,6 @@ }; outputs = inputs @ { - self, nixpkgs, nixpkgsUnstable, lanzaboote, diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 2923ae0..5448bbb 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,9 +1,10 @@ -{lib, ...}: { +{config, ...}: { imports = [ - ./options.nix ./documentation.nix ./fonts.nix ./locale.nix + ./options.nix + ./packages.nix ./security.nix ./systemd.nix ./users.nix diff --git a/hosts/common/desktop/default.nix b/hosts/common/desktop/default.nix index d5cc99f..74faa77 100644 --- a/hosts/common/desktop/default.nix +++ b/hosts/common/desktop/default.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: { +{lib, ...}: { programs.xwayland.enable = true; xdg.portal.enable = true; environment.noXlibs = lib.mkForce false; diff --git a/hosts/common/desktop/gnome.nix b/hosts/common/desktop/gnome.nix index 76e02cb..e05a0cd 100644 --- a/hosts/common/desktop/gnome.nix +++ b/hosts/common/desktop/gnome.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { imports = [ ./. ]; diff --git a/hosts/common/documentation.nix b/hosts/common/documentation.nix index 85de6f9..ad7300d 100644 --- a/hosts/common/documentation.nix +++ b/hosts/common/documentation.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [man-pages man-pages-posix]; documentation = { dev.enable = true; diff --git a/hosts/common/fonts.nix b/hosts/common/fonts.nix index 9cec045..c49f99c 100644 --- a/hosts/common/fonts.nix +++ b/hosts/common/fonts.nix @@ -2,11 +2,11 @@ config, pkgs, ... -}: { - fonts = { - fonts = with pkgs; - if config.system.gui-stuff - then [ +}: let + guiFonts = + if config.sys.gui.enable + then + with pkgs; [ noto-fonts noto-fonts-extra noto-fonts-emoji @@ -14,15 +14,21 @@ fira-code (nerdfonts.override {fonts = ["FiraCode"];}) ] - else []; - fontconfig.defaultFonts = - if config.system.gui-stuff - then { - serif = ["Noto Serif"]; - sansSerif = ["Noto Sans"]; - emoji = ["Noto Color Emoji"]; - monospace = ["Fira Code"]; - } - else {}; + else []; + + guiDefaultFonts = + if config.sys.gui.enable + then { + serif = ["Noto Serif"]; + sansSerif = ["Noto Sans"]; + emoji = ["Noto Color Emoji"]; + monospace = ["Fira Code"]; + } + else {}; +in { + fonts = { + enableDefaultFonts = true; + fonts = guiFonts; + fontconfig.defaultFonts = guiDefaultFonts; }; } diff --git a/hosts/common/hardware/default.nix b/hosts/common/hardware/default.nix index e7e6350..4d54961 100644 --- a/hosts/common/hardware/default.nix +++ b/hosts/common/hardware/default.nix @@ -1,6 +1,5 @@ _: { imports = [ ./nvidia.nix - ./zfs.nix ]; } diff --git a/hosts/common/options.nix b/hosts/common/options.nix index 2d532ed..8d4bf5b 100644 --- a/hosts/common/options.nix +++ b/hosts/common/options.nix @@ -1,14 +1,14 @@ {lib, ...}: { - options.system = with lib.types; { - devel-packages = lib.mkOption { - type = bool; + options.sys = with lib; { + gui.enable = mkOption { + type = types.bool; default = false; - description = "install development packages for neovim lsp"; + description = "install gui-related packages"; }; - gui-stuff = lib.mkOption { - type = bool; + wsl.enable = mkOption { + type = types.bool; default = false; - description = "install gui-related packages"; + description = "signifies that the flake is being installed in wsl"; }; }; } diff --git a/hosts/glados-wsl/packages.nix b/hosts/common/packages.nix index dbb0091..dbb0091 100644 --- a/hosts/glados-wsl/packages.nix +++ b/hosts/common/packages.nix diff --git a/hosts/common/security.nix b/hosts/common/security.nix index 32c2ff5..04ae595 100644 --- a/hosts/common/security.nix +++ b/hosts/common/security.nix @@ -1,8 +1,10 @@ -_: { +{config, ...}: let + value = config.sys.wsl.enable; +in { security = { - apparmor.enable = true; - audit.enable = true; - auditd.enable = true; + apparmor.enable = value; + audit.enable = value; + auditd.enable = value; rtkit.enable = true; sudo = { configFile = '' diff --git a/hosts/common/systemd.nix b/hosts/common/systemd.nix index 1c71cfc..9d44da4 100644 --- a/hosts/common/systemd.nix +++ b/hosts/common/systemd.nix @@ -1,10 +1,12 @@ -{config, ...}: { +{config, ...}: let + value = config.sys.wsl.enable; +in { services = { journald.extraConfig = '' MaxRetentionSec=1w ''; resolved = { - enable = true; + enable = value; dnssec = "allow-downgrade"; extraConfig = '' [Resolve] diff --git a/hosts/glados-wsl/default.nix b/hosts/glados-wsl/default.nix index d77baf6..bc9bdd2 100644 --- a/hosts/glados-wsl/default.nix +++ b/hosts/glados-wsl/default.nix @@ -1,22 +1,23 @@ { - config, - modulesPath, - pkgs, - ... + config, + modulesPath, + pkgs, + ... }: { - imports = [ - (modulesPath + "/profiles/minimal.nix") - ../common - ./packages.nix - ../../users/seth - ]; + imports = [ + (modulesPath + "/profiles/minimal.nix") + ../common + ../../users/seth + ]; - # enable non-free packages - nixpkgs.config.allowUnfree = true; + sys.wsl.enable = true; - # Enable nix flakes - nix.package = pkgs.nixFlakes; - nix.settings.experimental-features = ["nix-command" "flakes"]; + # enable non-free packages + nixpkgs.config.allowUnfree = true; - system.stateVersion = "22.11"; + # Enable nix flakes + nix.package = pkgs.nixFlakes; + nix.settings.experimental-features = ["nix-command" "flakes"]; + + system.stateVersion = "22.11"; } diff --git a/hosts/glados/boot.nix b/hosts/glados/boot.nix index d0f0b22..e856fb1 100644 --- a/hosts/glados/boot.nix +++ b/hosts/glados/boot.nix @@ -19,7 +19,5 @@ enable = true; pkiBundle = "/etc/secureboot"; }; - - supportedFilesystems = ["zfs"]; }; } diff --git a/hosts/glados/default.nix b/hosts/glados/default.nix index 39687a2..d6eba70 100644 --- a/hosts/glados/default.nix +++ b/hosts/glados/default.nix @@ -1,5 +1,4 @@ { - config, modulesPath, pkgs, ... @@ -12,11 +11,10 @@ ./boot.nix ./network.nix ./packages.nix + ./services.nix ../../users/seth ]; - system.gui-stuff = true; - # enable non-free packages nixpkgs.config.allowUnfree = true; @@ -25,4 +23,5 @@ nix.settings.experimental-features = ["nix-command" "flakes"]; system.stateVersion = "23.05"; + sys.gui.enable = true; } diff --git a/hosts/glados/network.nix b/hosts/glados/network.nix index e55a0a2..021a1e9 100644 --- a/hosts/glados/network.nix +++ b/hosts/glados/network.nix @@ -1,4 +1,4 @@ -{config, ...}: { +_: { networking = { hostId = "replace_me"; networkmanager = { diff --git a/hosts/glados/packages.nix b/hosts/glados/packages.nix index 2765f35..7066911 100644 --- a/hosts/glados/packages.nix +++ b/hosts/glados/packages.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ git gnupg1 diff --git a/hosts/glados/services.nix b/hosts/glados/services.nix index a71acbd..95a7882 100644 --- a/hosts/glados/services.nix +++ b/hosts/glados/services.nix @@ -1,4 +1,4 @@ -{config, ...}: { +_: { services = { dbus.enable = true; pipewire = { @@ -9,4 +9,5 @@ pulse.enable = true; }; }; + hardware.pulseaudio.enable = false; } diff --git a/users/seth/config.nix b/users/seth/config.nix index 0aa42c9..78a0ddd 100644 --- a/users/seth/config.nix +++ b/users/seth/config.nix @@ -4,9 +4,5 @@ _: { ./programs ./shell ]; - - options.seth = { - devel-packages = false; - gui-stuff = false; - }; + seth.devel.enable = true; } diff --git a/users/seth/default.nix b/users/seth/default.nix index e53b125..4c40386 100644 --- a/users/seth/default.nix +++ b/users/seth/default.nix @@ -1,21 +1,16 @@ { config, pkgs, - modulesPath, ... }: { - imports = [ - "${modulesPath}/profiles/minimal.nix" - ]; - - users.users.seth = { + config.users.users.seth = { extraGroups = ["wheel"]; isNormalUser = true; hashedPassword = "***REMOVED***"; shell = pkgs.zsh; }; - home-manager.users.seth = { + config.home-manager.users.seth = { imports = [ ./config.nix ]; diff --git a/users/seth/options.nix b/users/seth/options.nix index b2e035d..9e7d460 100644 --- a/users/seth/options.nix +++ b/users/seth/options.nix @@ -1,14 +1,9 @@ {lib, ...}: { options.seth = with lib.types; { - devel-packages = lib.mkOption { - type = bool; + devel.enable = lib.mkOption { + type = types.bool; default = false; description = "install development packages for neovim lsp"; }; - gui-stuff = lib.mkOption { - type = bool; - default = false; - description = "install gui-related packages"; - }; }; } diff --git a/users/seth/programs/default.nix b/users/seth/programs/default.nix index 5773b22..8cb4a6c 100644 --- a/users/seth/programs/default.nix +++ b/users/seth/programs/default.nix @@ -1,26 +1,38 @@ -{pkgs, ...}: { - imports = [ - ./git.nix - # ./mangohud - ./neovim - # ./npm.nix - ./starship.nix - ./vim.nix - ./xdg.nix - ]; +{ + config, + pkgs, + ... +}: let + develPackages = + if config.seth.devel.enable + then + with pkgs; [ + alejandra + clang + deadnix + eclint + statix + ] + else []; +in { + imports = [ + ./git.nix + # ./mangohud + ./neovim + ./starship.nix + ./vim.nix + ./xdg.nix + ]; - home.packages = with pkgs; [ - alejandra - bat - clang - deadnix - eclint - exa - fd - gh - lld - ripgrep - statix - python311 - ]; + home.packages = with pkgs; + [ + bat + exa + fd + gh + lld + ripgrep + python311 + ] + ++ develPackages; } diff --git a/users/seth/programs/neovim/config/init.lua b/users/seth/programs/neovim/config/init.lua index 1dbf9bc..e9820fc 100644 --- a/users/seth/programs/neovim/config/init.lua +++ b/users/seth/programs/neovim/config/init.lua @@ -5,7 +5,7 @@ local cmd = vim.cmd local opt = vim.opt -vim.g.use_lsp_plugins = false +vim.g.use_lsp_plugins = true vim.g.use_mason = false require("getchoo") diff --git a/users/seth/programs/neovim/config/lua/getchoo/lsp/config/sources.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/sources.lua index 3b67ab2..318f67c 100644 --- a/users/seth/programs/neovim/config/lua/getchoo/lsp/config/sources.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/sources.lua @@ -11,7 +11,10 @@ local M = { null_ls = { diagnostics.alex, diagnostics.codespell, + diagnostics.deadnix, diagnostics.pylint, + diagnostics.statix, + formatting.alejandra, formatting.codespell, formatting.prettier, formatting.rustfmt, diff --git a/users/seth/programs/neovim/default.nix b/users/seth/programs/neovim/default.nix index 7bf2095..58d5634 100644 --- a/users/seth/programs/neovim/default.nix +++ b/users/seth/programs/neovim/default.nix @@ -1,47 +1,66 @@ -{pkgs, ...}: { +{ + config, + pkgs, + ... +}: let + lspPackages = + if config.seth.devel.enable + then + with pkgs; [ + alejandra + clang + codespell + deadnix + nodePackages.alex + nodePackages.bash-language-server + nodePackages.prettier + nodePackages.pyright + pylint + rust-analyzer + rustfmt + statix + stylua + sumneko-lua-language-server + yapf + ] + else []; + + lspPlugins = + if config.seth.devel.enable + then + with pkgs.vimPlugins; [ + nvim-tree-lua + nvim-lspconfig + null-ls-nvim + plenary-nvim + nvim-treesitter.withAllGrammars + nvim-cmp + cmp-nvim-lsp + cmp-buffer + cmp-path + cmp-vsnip + vim-vsnip + luasnip + cmp_luasnip + trouble-nvim + nvim-web-devicons + telescope-nvim + gitsigns-nvim + editorconfig-nvim + ] + else []; +in { programs.neovim = { enable = true; - extraPackages = with pkgs; [ - alejandra - clang - codespell - deadnix - nodePackages.alex - nodePackages.bash-language-server - nodePackages.prettier - nodePackages.pyright - pylint - rust-analyzer - rustfmt - statix - stylua - sumneko-lua-language-server - yapf - ]; - plugins = with pkgs.vimPlugins; [ - lualine-nvim - catppuccin-nvim - barbar-nvim - lightspeed-nvim - nvim-tree-lua - nvim-lspconfig - null-ls-nvim - plenary-nvim - (nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars)) - nvim-cmp - cmp-nvim-lsp - cmp-buffer - cmp-path - cmp-vsnip - vim-vsnip - luasnip - cmp_luasnip - trouble-nvim - nvim-web-devicons - telescope-nvim - gitsigns-nvim - editorconfig-nvim - ]; + extraPackages = lspPackages; + plugins = with pkgs.vimPlugins; + [ + lualine-nvim + catppuccin-nvim + barbar-nvim + lightspeed-nvim + ] + ++ lspPlugins; }; xdg.configFile.nvim = { diff --git a/users/seth/programs/npm.nix b/users/seth/programs/npm.nix deleted file mode 100644 index 07f7037..0000000 --- a/users/seth/programs/npm.nix +++ /dev/null @@ -1,10 +0,0 @@ -{config, ...}: { - programs.npm = { - enable = true; - npmrc = '' - prefix=${config.xdg.dataHome}/npm - cache=${config.xdg.cacheHome}/npm - init-module=${config.xdg.configHome}/npm/config/npm-init.js - ''; - }; -} diff --git a/users/seth/shell/bash.nix b/users/seth/shell/bash.nix index 18167a4..7412c46 100644 --- a/users/seth/shell/bash.nix +++ b/users/seth/shell/bash.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{config, ...}: { programs.bash = { enable = true; historyFile = "${config.xdg.stateHome}/bash/history"; diff --git a/users/seth/shell/default.nix b/users/seth/shell/default.nix index 993835b..748a2e9 100644 --- a/users/seth/shell/default.nix +++ b/users/seth/shell/default.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{config, ...}: { imports = [ ./bash.nix ./fish.nix diff --git a/users/seth/shell/fish.nix b/users/seth/shell/fish.nix index 88a5854..6c08684 100644 --- a/users/seth/shell/fish.nix +++ b/users/seth/shell/fish.nix @@ -1,9 +1,4 @@ -{ - config, - lib, - pkgs, - ... -}: { +{pkgs, ...}: { programs.fish = { enable = true; plugins = [ diff --git a/users/seth/shell/zsh/default.nix b/users/seth/shell/zsh/default.nix index f614804..be7f043 100644 --- a/users/seth/shell/zsh/default.nix +++ b/users/seth/shell/zsh/default.nix @@ -1,6 +1,5 @@ { config, - lib, pkgs, ... }: { diff --git a/users/seth/shell/zsh/files/catppuccin_frappe-zsh-syntax-highlighting.zsh b/users/seth/shell/zsh/files/catppuccin_frappe-zsh-syntax-highlighting.zsh deleted file mode 100644 index 37284d0..0000000 --- a/users/seth/shell/zsh/files/catppuccin_frappe-zsh-syntax-highlighting.zsh +++ /dev/null @@ -1,74 +0,0 @@ -# Catppuccin Frappe Theme (for zsh-syntax-highlighting) -# -# Paste this files contents inside your ~/.zshrc before you activate zsh-syntax-highlighting -ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor) -typeset -gA ZSH_HIGHLIGHT_STYLES - -# Main highlighter styling: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md -# -## General -### Diffs -### Markup -## Classes -## Comments -ZSH_HIGHLIGHT_STYLES[comment]='fg=#626880' -## Constants -## Entitites -## Functions/methods -ZSH_HIGHLIGHT_STYLES[alias]='fg=#a6d189' -ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=#a6d189' -ZSH_HIGHLIGHT_STYLES[global-alias]='fg=#a6d189' -ZSH_HIGHLIGHT_STYLES[function]='fg=#a6d189' -ZSH_HIGHLIGHT_STYLES[command]='fg=#a6d189' -ZSH_HIGHLIGHT_STYLES[precommand]='fg=#a6d189,italic' -ZSH_HIGHLIGHT_STYLES[autodirectory]='fg=#ef9f76,italic' -ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=#ef9f76' -ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=#ef9f76' -ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=#ca9ee6' -## Keywords -## Built ins -ZSH_HIGHLIGHT_STYLES[builtin]='fg=#a6d189' -ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=#a6d189' -ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=#a6d189' -## Punctuation -ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#e78284' -ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]='fg=#e78284' -ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=#e78284' -ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=#e78284' -## Serializable / Configuration Languages -## Storage -## Strings -ZSH_HIGHLIGHT_STYLES[command-substitution-quoted]='fg=#e5c890' -ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-quoted]='fg=#e5c890' -ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#e5c890' -ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]='fg=#ea999c' -ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#e5c890' -ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]='fg=#ea999c' -ZSH_HIGHLIGHT_STYLES[rc-quote]='fg=#e5c890' -## Variables -ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]='fg=#ea999c' -ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[assign]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[named-fd]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[numeric-fd]='fg=#c6d0f5' -## No category relevant in spec -ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#ea999c' -ZSH_HIGHLIGHT_STYLES[path]='fg=#c6d0f5,underline' -ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#e78284,underline' -ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=#c6d0f5,underline' -ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#e78284,underline' -ZSH_HIGHLIGHT_STYLES[globbing]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=#ca9ee6' -#ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=?' -#ZSH_HIGHLIGHT_STYLES[command-substitution-unquoted]='fg=?' -#ZSH_HIGHLIGHT_STYLES[process-substitution]='fg=?' -#ZSH_HIGHLIGHT_STYLES[arithmetic-expansion]='fg=?' -ZSH_HIGHLIGHT_STYLES[back-quoted-argument-unclosed]='fg=#ea999c' -ZSH_HIGHLIGHT_STYLES[redirection]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[arg0]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[default]='fg=#c6d0f5' -ZSH_HIGHLIGHT_STYLES[cursor]='fg=#c6d0f5' diff --git a/util/host.nix b/util/host.nix index 330edb6..048f39c 100644 --- a/util/host.nix +++ b/util/host.nix @@ -1,8 +1,4 @@ -{ - nixpkgs, - home-manager, - ... -}: { +{home-manager, ...}: { mkHost = { name, modules, |
