diff --git a/groups/all/default.nix b/groups/all/default.nix index 3f035f8..a7c21fd 100644 --- a/groups/all/default.nix +++ b/groups/all/default.nix @@ -1,4 +1,4 @@ -{...}: { +{ ... }: { nix.settings = { experimental-features = ["nix-command" "flakes"]; download-buffer-size = 524288000; diff --git a/groups/servers/default.nix b/groups/servers/default.nix index aea0e86..b142ca8 100644 --- a/groups/servers/default.nix +++ b/groups/servers/default.nix @@ -1,4 +1,4 @@ -{...}: { +{ ... }: { nix.settings = { trusted-users = ["root" "@wheel"]; }; diff --git a/homes/aurora/default.nix b/homes/aurora/default.nix index 3b3111f..8a0d13e 100644 --- a/homes/aurora/default.nix +++ b/homes/aurora/default.nix @@ -8,7 +8,8 @@ root, system, ... -}: { +}: +{ imports = [ inputs.zen.homeModules.twilight @@ -76,7 +77,8 @@ fonts.fontconfig.enable = true; - home.file.".mozilla/native-messaging-hosts/tridactyl.json".source = "${upkgs.tridactyl-native}/lib/mozilla/native-messaging-hosts/tridactyl.json"; + home.file.".mozilla/native-messaging-hosts/tridactyl.json".source = + "${upkgs.tridactyl-native}/lib/mozilla/native-messaging-hosts/tridactyl.json"; # some packages are enabled from their own module in ./modules home.packages = with upkgs; [ @@ -99,7 +101,7 @@ ripgrep # rlly fast grep :3 zip # zips .zip unzip # unzips .zip - (btop.override {rocmSupport = true;}) # btop + amd gpu support + (btop.override { rocmSupport = true; }) # btop + amd gpu support nmap # network discovery and mapping tool! distrobox # use any linux distro inside ur terminal x3 parted # create, resize, copy, image partitions diff --git a/homes/modules/de/waybar/waybar.nix b/homes/modules/de/waybar/waybar.nix index 71e1f20..ba2abb0 100644 --- a/homes/modules/de/waybar/waybar.nix +++ b/homes/modules/de/waybar/waybar.nix @@ -14,8 +14,7 @@ "hyprland/workspaces" = { format = "{id}"; }; - "ext/workspaces" = { - # not enabled yet, hyprland and mango need two different configs ;-; + "ext/workspaces" = { # not enabled yet, hyprland and mango need two different configs ;-; format = "{id}"; ignore-hidden = true; on-click = "activate"; diff --git a/homes/modules/programs/alacritty/default.nix b/homes/modules/programs/alacritty/default.nix index 4ee6e8e..8262825 100644 --- a/homes/modules/programs/alacritty/default.nix +++ b/homes/modules/programs/alacritty/default.nix @@ -1,4 +1,5 @@ -{upkgs, ...}: { +{ upkgs, ... }: +{ programs.alacritty = { enable = true; package = upkgs.alacritty-graphics; diff --git a/homes/modules/programs/neovim/init.lua b/homes/modules/programs/neovim/init.lua index 98013ef..dcd03a8 100644 --- a/homes/modules/programs/neovim/init.lua +++ b/homes/modules/programs/neovim/init.lua @@ -8,18 +8,10 @@ vim.opt.colorcolumn = "80" require("plugins") require("lsp") -vim.keymap.set("n", "", function() - vim.cmd("wincmd h") -end) -vim.keymap.set("n", "", function() - vim.cmd("wincmd j") -end) -vim.keymap.set("n", "", function() - vim.cmd("wincmd k") -end) -vim.keymap.set("n", "", function() - vim.cmd("wincmd l") -end) +vim.keymap.set('n', '', function() vim.cmd('wincmd h') end) +vim.keymap.set('n', '', function() vim.cmd('wincmd j') end) +vim.keymap.set('n', '', function() vim.cmd('wincmd k') end) +vim.keymap.set('n', '', function() vim.cmd('wincmd l') end) local uv = vim.loop local colorscheme_filepath = "/home/aurora/.cache/nvim/neovim-colors" diff --git a/homes/modules/programs/neovim/lua/plugins/format.lua b/homes/modules/programs/neovim/lua/plugins/format.lua index 5ca4e27..0e652f5 100644 --- a/homes/modules/programs/neovim/lua/plugins/format.lua +++ b/homes/modules/programs/neovim/lua/plugins/format.lua @@ -1,53 +1,8 @@ -vim.keymap.set("n", "P", function() - vim.api.nvim_exec_autocmds("User", { pattern = "ConformProject" }) - vim.cmd("ConformProject") -end, { noremap = true, silent = true }) - -vim.api.nvim_create_user_command("ConformProject", function() - local conform = require("conform") - local root = vim.fn.getcwd() - - -- respects .gitignore - local handle = io.popen(string.format("cd %s && git ls-files --cached --others --exclude-standard", root)) - - if not handle then - vim.notify("Failed to scan project files", vim.log.levels.ERROR) - return - end - - local files = {} - for file in handle:lines() do - table.insert(files, vim.fn.fnamemodify(file, ":p")) - end - handle:close() - - -- format each file - -- TODO: maybe run each formatter on the directory instead as it may be faster - -- although that would actually mean we can't count what files were formatted so i don't know - local formatted_count = 0 - for _, filepath in ipairs(files) do - local bufnr = vim.fn.bufadd(filepath) - vim.fn.bufload(bufnr) - - local ok, err = conform.format({ bufnr = bufnr }) - if ok then - formatted_count = formatted_count + 1 - -- Save the buffer - vim.api.nvim_buf_call(bufnr, function() - vim.cmd("write") - end) - end - end - - vim.notify(string.format("Formatted %d files", formatted_count), vim.log.levels.INFO) -end, {}) - -- docs -> https://github.com/stevearc/conform.nvim return { { "conform.nvim", enabled = nixCats("format") or false, - event = "User ConformProject", -- also will load when we format the entire project yayayayy :333 keys = { { "p", desc = "Format File (pretty :3)" }, }, diff --git a/homes/modules/programs/neovim/nixcats.nix b/homes/modules/programs/neovim/nixcats.nix index 106625a..97c78f6 100644 --- a/homes/modules/programs/neovim/nixcats.nix +++ b/homes/modules/programs/neovim/nixcats.nix @@ -4,12 +4,13 @@ inputs, mpkgs, ... -}: let - inherit - (inputs.nixcats) +}: +let + inherit (inputs.nixcats) utils ; -in { +in +{ imports = [ inputs.nixcats.homeModule ]; @@ -30,220 +31,224 @@ in { ]; # see the packageDefinitions below. # This says which of those to install. - packageNames = ["auroranvim"]; + packageNames = [ "auroranvim" ]; luaPath = "${./.}"; # the .replace vs .merge options are for modules based on existing configurations, # they refer to how multiple categoryDefinitions get merged together by the module. # for useage of this section, refer to :h nixCats.flake.outputs.categories - categoryDefinitions.replace = { - pkgs, - settings, - categories, - extra, - name, - mkNvimPlugin, - ... - } @ packageDef: { - lspsAndRuntimeDeps = with pkgs; { - general = [ - ripgrep - fd - ]; - treesitter = [ - tree-sitter - ]; - lang = { - lua = [ - lua-language-server - stylua + categoryDefinitions.replace = + { + pkgs, + settings, + categories, + extra, + name, + mkNvimPlugin, + ... + }@packageDef: + { + lspsAndRuntimeDeps = with pkgs; { + general = [ + ripgrep + fd ]; - nix = [ - nil - nix-doc # TODO: i forgot what this is for - alejandra + treesitter = [ + tree-sitter ]; - rust = [ - cargo - mpkgs.rust-analyzer - # nightly rustfmt has nicer features :3 - inputs.fenix.packages.${system}.complete.rustfmt - ]; - zig = [ - zls - ]; - elixir = [ - elixir-ls - ]; - gleam = [ - gleam - ]; - haskell = [ - haskell-language-server - ormolu - ]; - java = [ - jdt-language-server - javaPackages.compiler.openjdk17 - javaPackages.compiler.openjdk21 - ]; - protobuf = [ - protols - buf - ]; - }; - }; - - startupPlugins = with pkgs.vimPlugins; { - general = [ - lze - plenary-nvim - nvim-notify - nvim-web-devicons - base16-nvim - mini-nvim - ]; - treesitter = [ - nvim-treesitter-textobjects - nvim-treesitter.withAllGrammars - ]; - }; - - optionalPlugins = with pkgs.vimPlugins; { - general = [ - ]; - ui = [ - dressing-nvim - ]; - qol = [ - undotree - mini-hipatterns - ]; - telescope = [ - telescope-nvim - telescope-fzf-native-nvim - telescope-ui-select-nvim - ]; - fyler = [ - fyler-nvim - ]; - lsp = [ - nvim-lspconfig - ]; - completion = [ - blink-cmp - nvim-cmp - luasnip - friendly-snippets - cmp_luasnip - cmp-buffer - cmp-path - cmp-nvim-lua - cmp-nvim-lsp - cmp-cmdline - cmp-nvim-lsp-signature-help - cmp-cmdline-history - lspkind-nvim - ]; - format = [ - conform-nvim - ]; - comment = [ - comment-nvim - ]; - lang = { - java = [ - nvim-jdtls - ]; - }; - }; - - # shared libraries to be added to LD_LIBRARY_PATH - # variable available to nvim runtime - sharedLibraries = { - general = with pkgs; [ - # libgit2 - ]; - }; - - environmentVariables = { - lang = { - rust.lsp = { - # it literally won't see the rust-analyzer provided to it - # if you don't use an envrionment variable to tell it - RUST_ANALYZER_CMD = "${mpkgs.rust-analyzer}/bin/rust-analyzer"; - }; - elixir.lsp = { - ELIXIR_LS_CMD = "${pkgs.elixir-ls}/scripts/language_server.sh"; - }; - java.lsp = { - JAVA_HOME = "${pkgs.javaPackages.compiler.openjdk17}"; - OPENJDK_17 = "${pkgs.javaPackages.compiler.openjdk17}"; - OPENJDK_21 = "${pkgs.javaPackages.compiler.openjdk21}"; + lang = { + lua = [ + lua-language-server + stylua + ]; + nix = [ + nil + nix-doc # TODO: i forgot what this is for + alejandra + ]; + rust = [ + cargo + mpkgs.rust-analyzer + # nightly rustfmt has nicer features :3 + inputs.fenix.packages.${system}.complete.rustfmt + ]; + zig = [ + zls + ]; + elixir = [ + elixir-ls + ]; + gleam = [ + gleam + ]; + haskell = [ + haskell-language-server + ormolu + ]; + java = [ + jdt-language-server + javaPackages.compiler.openjdk17 + javaPackages.compiler.openjdk21 + ]; + protobuf = [ + protols + buf + ]; }; }; + + startupPlugins = with pkgs.vimPlugins; { + general = [ + lze + plenary-nvim + nvim-notify + nvim-web-devicons + base16-nvim + mini-nvim + ]; + treesitter = [ + nvim-treesitter-textobjects + nvim-treesitter.withAllGrammars + ]; + }; + + optionalPlugins = with pkgs.vimPlugins; { + general = [ + ]; + ui = [ + dressing-nvim + ]; + qol = [ + undotree + mini-hipatterns + ]; + telescope = [ + telescope-nvim + telescope-fzf-native-nvim + telescope-ui-select-nvim + ]; + fyler = [ + fyler-nvim + ]; + lsp = [ + nvim-lspconfig + ]; + completion = [ + blink-cmp + nvim-cmp + luasnip + friendly-snippets + cmp_luasnip + cmp-buffer + cmp-path + cmp-nvim-lua + cmp-nvim-lsp + cmp-cmdline + cmp-nvim-lsp-signature-help + cmp-cmdline-history + lspkind-nvim + ]; + format = [ + conform-nvim + ]; + comment = [ + comment-nvim + ]; + lang = { + java = [ + nvim-jdtls + ]; + }; + }; + + # shared libraries to be added to LD_LIBRARY_PATH + # variable available to nvim runtime + sharedLibraries = { + general = with pkgs; [ + # libgit2 + ]; + }; + + environmentVariables = { + lang = { + rust.lsp = { + # it literally won't see the rust-analyzer provided to it + # if you don't use an envrionment variable to tell it + RUST_ANALYZER_CMD = "${mpkgs.rust-analyzer}/bin/rust-analyzer"; + }; + elixir.lsp = { + ELIXIR_LS_CMD = "${pkgs.elixir-ls}/scripts/language_server.sh"; + }; + java.lsp = { + JAVA_HOME = "${pkgs.javaPackages.compiler.openjdk17}"; + OPENJDK_17 = "${pkgs.javaPackages.compiler.openjdk17}"; + OPENJDK_21 = "${pkgs.javaPackages.compiler.openjdk21}"; + }; + }; + }; + + extraWrapperArgs = { }; + # lists of the functions you would have passed to + # python.withPackages or lua.withPackages + + # get the path to this python environment + # in your lua config via + # vim.g.python3_host_prog + # or run from nvim terminal via :!-python3 + extraPython3Packages = { }; + # populates $LUA_PATH and $LUA_CPATH + extraLuaPackages = { }; }; - extraWrapperArgs = {}; - # lists of the functions you would have passed to - # python.withPackages or lua.withPackages - - # get the path to this python environment - # in your lua config via - # vim.g.python3_host_prog - # or run from nvim terminal via :!-python3 - extraPython3Packages = {}; - # populates $LUA_PATH and $LUA_CPATH - extraLuaPackages = {}; - }; - # see :help nixCats.flake.outputs.packageDefinitions packageDefinitions.replace = { # these are the names of your packages # you can include as many as you wish. - auroranvim = {pkgs, ...}: { - # they contain a settings set defined above - # see :help nixCats.flake.outputs.settings - settings = { - wrapRc = true; - # IMPORTANT: - # your alias may not conflict with your other packages. - aliases = [ - "auravim" - "foxyvim" - "avix" - "fvix" - ]; - }; - # and a set of categories that you want - # (and other information to pass to lua) - categories = { - general = true; + auroranvim = + { pkgs, ... }: + { + # they contain a settings set defined above + # see :help nixCats.flake.outputs.settings + settings = { + wrapRc = true; + # IMPORTANT: + # your alias may not conflict with your other packages. + aliases = [ + "auravim" + "foxyvim" + "avix" + "fvix" + ]; + }; + # and a set of categories that you want + # (and other information to pass to lua) + categories = { + general = true; - ui = true; - qol = true; - telescope = true; - fyler = true; - lsp = true; - completion = true; - treesitter = true; - format = true; - comment = true; + ui = true; + qol = true; + telescope = true; + fyler = true; + lsp = true; + completion = true; + treesitter = true; + format = true; + comment = true; - lang = { - lua = true; - nix = true; - rust = true; - zig = true; - elixir = true; - gleam = true; - haskell = true; - java = true; - protobuf = true; + lang = { + lua = true; + nix = true; + rust = true; + zig = true; + elixir = true; + gleam = true; + haskell = true; + java = true; + protobuf = true; + }; }; }; - }; }; }; }; diff --git a/homes/modules/programs/nixcord.nix b/homes/modules/programs/nixcord.nix index 165c765..6ce4c88 100644 --- a/homes/modules/programs/nixcord.nix +++ b/homes/modules/programs/nixcord.nix @@ -1,4 +1,5 @@ -{inputs, ...}: { +{ inputs, ... }: +{ imports = [ inputs.nixcord.homeModules.nixcord ]; diff --git a/homes/modules/programs/yazi/yazi.nix b/homes/modules/programs/yazi/yazi.nix index 2dcb306..dfc4f09 100644 --- a/homes/modules/programs/yazi/yazi.nix +++ b/homes/modules/programs/yazi/yazi.nix @@ -1,4 +1,5 @@ -{upkgs, ...}: { +{ upkgs, ... }: +{ # optional dependencies can be found here: # https://yazi-rs.github.io/docs/installation/ home.packages = with upkgs; [ @@ -23,12 +24,12 @@ mgr.prepend_keymap = [ # drag and drop!! { - on = [""]; + on = [ "" ]; run = ''shell "ripdrag -x -a \"$@\"" --confirm''; } # copy hovered file to clipboard { - on = [""]; + on = [ "" ]; run = ''shell -- path=%h; echo "file://$path" | wl-copy -t text/uri-list''; } ]; diff --git a/homes/modules/shell/zsh.nix b/homes/modules/shell/zsh.nix index db2c986..e882695 100644 --- a/homes/modules/shell/zsh.nix +++ b/homes/modules/shell/zsh.nix @@ -1,4 +1,5 @@ -{upkgs, ...}: { +{ upkgs, ... }: +{ programs.zsh = { enable = true; enableCompletion = true; diff --git a/homes/modules/wm/hyprland/hyprland.nix b/homes/modules/wm/hyprland/hyprland.nix index e0baf8f..cc22886 100644 --- a/homes/modules/wm/hyprland/hyprland.nix +++ b/homes/modules/wm/hyprland/hyprland.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ wayland.windowManager.hyprland = { enable = true; package = null; diff --git a/homes/modules/wm/mango/default.nix b/homes/modules/wm/mango/default.nix index af708ad..6f55063 100644 --- a/homes/modules/wm/mango/default.nix +++ b/homes/modules/wm/mango/default.nix @@ -1,4 +1,5 @@ -{inputs, ...}: { +{ inputs, ... }: +{ imports = [ inputs.mango.hmModules.mango ]; diff --git a/homes/modules/wm/river.nix b/homes/modules/wm/river.nix index 877f3e7..57a9626 100644 --- a/homes/modules/wm/river.nix +++ b/homes/modules/wm/river.nix @@ -1,78 +1,83 @@ -{...}: { - wayland.windowManager.river = let - layout = "rivertile"; - in { - enable = true; - xwayland.enable = true; +{ ... }: +{ + wayland.windowManager.river = + let + layout = "rivertile"; + in + { + enable = true; + xwayland.enable = true; - settings = let - main = "Super"; + settings = + let + main = "Super"; - # applications - terminal = "alacritty"; - browser = "firefox"; - in { - default-layout = "${layout}"; - output-layout = "${layout}"; - border-width = 1; + # applications + terminal = "alacritty"; + browser = "firefox"; + in + { + default-layout = "${layout}"; + output-layout = "${layout}"; + border-width = 1; - spawn = [ - "${layout}" + spawn = [ + "${layout}" - "awww-daemon" - "waybar" - ]; + "awww-daemon" + "waybar" + ]; - map.normal = { - "${main} C" = "close"; # close focused window - "${main}+Alt Delete" = "exit"; # exit river + map.normal = { + "${main} C" = "close"; # close focused window + "${main}+Alt Delete" = "exit"; # exit river - # app launcher - "${main} D" = ''spawn "pkill -x rofi || rofi -show drun -show-icons"''; - "Alt Tab" = ''spawn "pkill -x rofi || rofi -modi window -show window -show-icons"''; + # app launcher + "${main} D" = ''spawn "pkill -x rofi || rofi -show drun -show-icons"''; + "Alt Tab" = ''spawn "pkill -x rofi || rofi -modi window -show window -show-icons"''; - # spawn applications - "${main} T" = ''spawn "${terminal}"''; - "${main} R" = ''spawn "${browser}"''; + # spawn applications + "${main} T" = ''spawn "${terminal}"''; + "${main} R" = ''spawn "${browser}"''; - # move focused view to top of layout stack - "${main} N" = "zoom"; + # move focused view to top of layout stack + "${main} N" = "zoom"; - # focus next/previous view - "${main} J" = "focus-view previous"; - "${main} K" = "focus-view next"; - # move to next/previous output - "${main} H" = "focus-output previous"; - "${main} L" = "focus-output next"; + # focus next/previous view + "${main} J" = "focus-view previous"; + "${main} K" = "focus-view next"; + # move to next/previous output + "${main} H" = "focus-output previous"; + "${main} L" = "focus-output next"; - # swap next/previous view - "${main}+Alt J" = "swap previous"; - "${main}+Alt K" = "swap next"; - # send view to next/previous output - # and switch to that output (wip) - "${main}+Alt H" = "send-to-output previous"; - #"${main}+Alt H" = "focus-output previous"; - "${main}+Alt L" = "send-to-output next"; - #"${main}+Alt L" = "focus-output next"; + # swap next/previous view + "${main}+Alt J" = "swap previous"; + "${main}+Alt K" = "swap next"; + # send view to next/previous output + # and switch to that output (wip) + "${main}+Alt H" = "send-to-output previous"; + #"${main}+Alt H" = "focus-output previous"; + "${main}+Alt L" = "send-to-output next"; + #"${main}+Alt L" = "focus-output next"; - # move views - #"${main}+Alt H" = "move left 100"; - #"${main}+Alt J" = "move down 100"; - #"${main}+Alt K" = "move up 100"; - #"${main}+Alt L" = "move right 100"; + # move views + #"${main}+Alt H" = "move left 100"; + #"${main}+Alt J" = "move down 100"; + #"${main}+Alt K" = "move up 100"; + #"${main}+Alt L" = "move right 100"; - # snap views - #"${main}+Control H" = "snap left"; - #"${main}+Control J" = "snap down"; - #"${main}+Control K" = "snap up"; - #"${main}+Control L" = "snap right"; + # snap views + #"${main}+Control H" = "snap left"; + #"${main}+Control J" = "snap down"; + #"${main}+Control K" = "snap up"; + #"${main}+Control L" = "snap right"; - # resize views - #"${main}+Shift H" = "resize horizontal -100"; - #"${main}+Shift J" = "resize vertical -100"; - #"${main}+Shift K" = "resize vertical 100"; - #"${main}+Shift L" = "resize horizontal 100"; - }; + # resize views + #"${main}+Shift H" = "resize horizontal -100"; + #"${main}+Shift J" = "resize vertical -100"; + #"${main}+Shift K" = "resize vertical 100"; + #"${main}+Shift L" = "resize horizontal 100"; + }; + }; }; - }; } diff --git a/homes/modules/wm/sway.nix b/homes/modules/wm/sway.nix index a878169..a5c2f58 100644 --- a/homes/modules/wm/sway.nix +++ b/homes/modules/wm/sway.nix @@ -1,4 +1,5 @@ -{config, ...}: { +{ config, ... }: +{ wayland.windowManager.sway = { enable = true; config = rec { @@ -6,44 +7,46 @@ terminal = "alacritty"; # disable sway bar - bars = []; + bars = [ ]; # set border colors #colors = { #focused = startup = [ - {command = "awww-daemon";} - {command = "waybar";} + { command = "awww-daemon"; } + { command = "waybar"; } ]; - keybindings = let - main = config.wayland.windowManager.sway.config.modifier; - terminal = config.wayland.windowManager.sway.config.terminal; - browser = "firefox"; - in { - "${main}+c" = "kill"; # close focused window - "${main}+Alt+Delete" = "exit"; # exit sway + keybindings = + let + main = config.wayland.windowManager.sway.config.modifier; + terminal = config.wayland.windowManager.sway.config.terminal; + browser = "firefox"; + in + { + "${main}+c" = "kill"; # close focused window + "${main}+Alt+Delete" = "exit"; # exit sway - # open launcher - "${main}+d" = "exec pkill -x rofi || rofi -show drun -show-icons"; - "Alt+Tab" = "exec pkill -x rofi || rofi -modi window -show window -show-icons"; + # open launcher + "${main}+d" = "exec pkill -x rofi || rofi -show drun -show-icons"; + "Alt+Tab" = "exec pkill -x rofi || rofi -modi window -show window -show-icons"; - "${main}+t" = "exec ${terminal}"; # open terminal - "${main}+r" = "exec ${browser}"; # open browser + "${main}+t" = "exec ${terminal}"; # open terminal + "${main}+r" = "exec ${browser}"; # open browser - # move focus - "${main}+h" = "focus left"; - "${main}+j" = "focus down"; - "${main}+k" = "focus up"; - "${main}+l" = "focus right"; + # move focus + "${main}+h" = "focus left"; + "${main}+j" = "focus down"; + "${main}+k" = "focus up"; + "${main}+l" = "focus right"; - # move focused window - "${main}+Alt+h" = "move left"; - "${main}+Alt+j" = "move down"; - "${main}+Alt+k" = "move up"; - "${main}+Alt+l" = "move right"; - }; + # move focused window + "${main}+Alt+h" = "move left"; + "${main}+Alt+j" = "move down"; + "${main}+Alt+k" = "move up"; + "${main}+Alt+l" = "move right"; + }; }; }; } diff --git a/hosts/arcturus/default.nix b/hosts/arcturus/default.nix index 458a92c..6bd53fe 100644 --- a/hosts/arcturus/default.nix +++ b/hosts/arcturus/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ config, lib, pkgs, ... }: +{ imports = [ ./hardware-configuration.nix ]; @@ -116,7 +117,7 @@ users.users.foxora = { isNormalUser = true; - extraGroups = ["wheel"]; + extraGroups = [ "wheel" ]; packages = with pkgs; [ tree diff --git a/hosts/arcturus/hardware-configuration.nix b/hosts/arcturus/hardware-configuration.nix index b37a44d..2cb46e2 100644 --- a/hosts/arcturus/hardware-configuration.nix +++ b/hosts/arcturus/hardware-configuration.nix @@ -1,35 +1,32 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + { - config, - lib, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = ["ahci" "ehci_pci" "megaraid_sas" "usb_storage" "usbhid" "sd_mod" "sr_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ "ahci" "ehci_pci" "megaraid_sas" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/7f22e35f-7536-49c4-9c04-88874e87f266"; - fsType = "btrfs"; - }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/7f22e35f-7536-49c4-9c04-88874e87f266"; + fsType = "btrfs"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/0213-F9A0"; - fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; - }; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/0213-F9A0"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; - swapDevices = [ - {device = "/dev/disk/by-uuid/0d04172b-aed8-42ea-9cb8-e5dcbf960200";} - ]; + swapDevices = + [ { device = "/dev/disk/by-uuid/0d04172b-aed8-42ea-9cb8-e5dcbf960200"; } + ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/lyra/default.nix b/hosts/lyra/default.nix index 383d25f..499d59e 100644 --- a/hosts/lyra/default.nix +++ b/hosts/lyra/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ config, lib, pkgs, ... }: +{ imports = [ ./hardware-configuration.nix ]; @@ -56,7 +57,7 @@ users.users.foxora = { isNormalUser = true; - extraGroups = ["wheel"]; + extraGroups = [ "wheel" ]; packages = with pkgs; [ tree @@ -90,3 +91,4 @@ system.stateVersion = "25.11"; } + diff --git a/hosts/lyra/hardware-configuration.nix b/hosts/lyra/hardware-configuration.nix index ca0abd6..6dbf2fa 100644 --- a/hosts/lyra/hardware-configuration.nix +++ b/hosts/lyra/hardware-configuration.nix @@ -1,35 +1,32 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + { - config, - lib, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "megaraid_sas" "usb_storage" "usbhid" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "megaraid_sas" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/1bc53888-6db8-46df-aa28-975b710c5de8"; - fsType = "ext4"; - }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/1bc53888-6db8-46df-aa28-975b710c5de8"; + fsType = "ext4"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/12CE-A600"; - fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; - }; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/12CE-A600"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; - swapDevices = [ - {device = "/dev/disk/by-uuid/60643004-6916-46b3-8655-66fdc28cf5ad";} - ]; + swapDevices = + [ { device = "/dev/disk/by-uuid/60643004-6916-46b3-8655-66fdc28cf5ad"; } + ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/nixarawrui/default.nix b/hosts/nixarawrui/default.nix index d0bc4bc..03db509 100644 --- a/hosts/nixarawrui/default.nix +++ b/hosts/nixarawrui/default.nix @@ -3,7 +3,8 @@ root, upkgs, ... -}: { +}: +{ imports = [ ./hardware-configuration.nix @@ -12,7 +13,7 @@ # Use the systemd-boot EFI boot loader. boot = rec { - initrd.kernelModules = ["amdgpu"]; + initrd.kernelModules = [ "amdgpu" ]; loader = { systemd-boot.enable = true; @@ -22,8 +23,8 @@ kernelPackages = upkgs.cachyosKernels.linuxPackages-cachyos-latest-lto-x86_64-v4; # TODO: idk make this a toggle or smth idfk # kernelPackages = upkgs.linuxPackages_latest; - kernelModules = ["v4l2loopback"]; - extraModulePackages = with kernelPackages; [v4l2loopback]; + kernelModules = [ "v4l2loopback" ]; + extraModulePackages = with kernelPackages; [ v4l2loopback ]; # qemu # binfmt.emulatedSystems = [ @@ -98,7 +99,7 @@ ]; config.common = { - "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; + "org.freedesktop.impl.portal.FileChooser" = [ "termfilechooser" ]; }; }; @@ -213,9 +214,10 @@ }; }; - systemd.tmpfiles.rules = let - imagePath = root + "/homes/aurora/profile.png"; - in + systemd.tmpfiles.rules = + let + imagePath = root + "/homes/aurora/profile.png"; + in lib.mkIf (builtins.pathExists imagePath) [ "L /var/lib/AccountsService/icons/aurora - - - - ${imagePath}" ]; diff --git a/snow.nix b/snow.nix index 8a63ff9..b29ba1a 100644 --- a/snow.nix +++ b/snow.nix @@ -1,135 +1,136 @@ -{cerulean, ...} @ inputs: +{ cerulean, ... }@inputs: cerulean.mkNexus ./. (self: { nexus = { - args = {inherit inputs;}; + args = { inherit inputs; }; - modules = with inputs; []; + modules = with inputs; [ ]; base = inputs.nixpkgs; homeManager = inputs.home-manager; groups = { - servers = {}; + servers = { }; }; - nodes = let - inherit - (self.nexus) - groups - ; - in { - nixarawrui = { - system = "x86_64-linux"; + nodes = + let + inherit (self.nexus) + groups + ; + in + { + nixarawrui = { + system = "x86_64-linux"; - base = inputs.nixpkgs-unstable; - homeManager = inputs.home-manager-unstable; + base = inputs.nixpkgs-unstable; + homeManager = inputs.home-manager-unstable; - modules = with inputs; [ - sddm-silent.nixosModules.default - inputs.mango.nixosModules.mango - ]; - }; + modules = with inputs; [ + sddm-silent.nixosModules.default + inputs.mango.nixosModules.mango + ]; + }; - arcturus = { - system = "x86_64-linux"; + arcturus = { + system = "x86_64-linux"; - groups = [ - groups.servers - ]; + groups = [ + groups.servers + ]; - modules = with inputs; [ - microvm.nixosModules.host + modules = with inputs; [ + microvm.nixosModules.host - { - microvm.vms = { - home-assistant = { - autostart = true; + { + microvm.vms = { + home-assistant = { + autostart = true; - config = { - imports = [./vms/home-assistant/default.nix]; + config = { + imports = [ ./vms/home-assistant/default.nix ]; - networking.hostName = "home-assistant"; + networking.hostName = "home-assistant"; - boot.kernelParams = [ - "console=ttyS0" - "console=ttyS1" - "8250.nr_uarts=2" - ]; - systemd.services."serial-getty@ttyS1".enable = true; - - microvm = { - hypervisor = "qemu"; - - # needed to get interface working - qemu.extraArgs = [ - "-monitor" - "unix:/var/lib/microvms/home-assistant/monitor.sock,server,nowait" - "-chardev" - "socket,id=serial1,path=/var/lib/microvms/home-assistant/serial.sock,server=on,wait=off" - "-serial" - "chardev:serial1" + boot.kernelParams = [ + "console=ttyS0" + "console=ttyS1" + "8250.nr_uarts=2" ]; + systemd.services."serial-getty@ttyS1".enable = true; - # memory cannot be 2GB so i doubled it and used 4GB: - # https://github.com/microvm-nix/microvm.nix/issues/171 - # TODO: can be fixed by turning off acpi in qemu - mem = 4096; # 4GB - vcpu = 2; + microvm = { + hypervisor = "qemu"; - interfaces = [ - { - type = "tap"; - id = "vm-hass"; - mac = "0a:00:a0:70:01:01"; - } - ]; + # needed to get interface working + qemu.extraArgs = [ + "-monitor" + "unix:/var/lib/microvms/home-assistant/monitor.sock,server,nowait" + "-chardev" + "socket,id=serial1,path=/var/lib/microvms/home-assistant/serial.sock,server=on,wait=off" + "-serial" + "chardev:serial1" + ]; - volumes = [ - #{ - #image = "/var/lib/microvms/home-assistant/data.img"; - #mountPoint = "/var/lib/hass"; - #autoCreate = false; - #} - ]; - }; + # memory cannot be 2GB so i doubled it and used 4GB: + # https://github.com/microvm-nix/microvm.nix/issues/171 + # TODO: can be fixed by turning off acpi in qemu + mem = 4096; # 4GB + vcpu = 2; - systemd.network.enable = true; - systemd.network.networks."20-lan" = { - matchConfig.Type = "ether"; - networkConfig = { - Address = ["10.16.1.127/24"]; - Gateway = "10.16.1.1"; - DNS = ["10.16.1.1"]; - IPv6AcceptRA = true; - DHCP = "yes"; + interfaces = [ + { + type = "tap"; + id = "vm-hass"; + mac = "0a:00:a0:70:01:01"; + } + ]; + + volumes = [ + #{ + #image = "/var/lib/microvms/home-assistant/data.img"; + #mountPoint = "/var/lib/hass"; + #autoCreate = false; + #} + ]; + }; + + systemd.network.enable = true; + systemd.network.networks."20-lan" = { + matchConfig.Type = "ether"; + networkConfig = { + Address = [ "10.16.1.127/24" ]; + Gateway = "10.16.1.1"; + DNS = [ "10.16.1.1" ]; + IPv6AcceptRA = true; + DHCP = "yes"; + }; }; }; }; }; - }; - } - ]; + } + ]; - deploy.ssh = { - host = "10.16.1.163"; - port = 2222; - user = "foxora"; + deploy.ssh = { + host = "10.16.1.163"; + port = 2222; + user = "foxora"; + }; + }; + + lyra = { + system = "x86_64-linux"; + + groups = [ + groups.servers + ]; + + deploy.ssh = { + host = "10.16.1.58"; + port = 2222; + user = "foxora"; + }; }; }; - - lyra = { - system = "x86_64-linux"; - - groups = [ - groups.servers - ]; - - deploy.ssh = { - host = "10.16.1.58"; - port = 2222; - user = "foxora"; - }; - }; - }; }; }) diff --git a/vms/home-assistant/default.nix b/vms/home-assistant/default.nix index a4be467..94f7c73 100644 --- a/vms/home-assistant/default.nix +++ b/vms/home-assistant/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ config, lib, pkgs, ... }: +{ services.home-assistant = { enable = true; configDir = "/var/lib/hass/hass"; @@ -20,29 +21,28 @@ "mobile_app" ]; - extraPackages = python3Packages: - with python3Packages; [ - getmac - aiohue - numpy - aiodhcpwatcher - async-upnp-client - gtts - numpy - plexapi - pyipp - paho-mqtt - pyturbojpeg - ]; + extraPackages = python3Packages: with python3Packages; [ + getmac + aiohue + numpy + aiodhcpwatcher + async-upnp-client + gtts + numpy + plexapi + pyipp + paho-mqtt + pyturbojpeg + ]; }; # configures the config directory to be mounted # correctly with the right permissions systemd.services.hass-permissions = { - wantedBy = ["multi-user.target"]; - after = ["var-lib-hass.mount"]; - requires = ["var-lib-hass.mount"]; - before = ["home-assistant.service"]; + wantedBy = [ "multi-user.target" ]; + after = [ "var-lib-hass.mount" ]; + requires = [ "var-lib-hass.mount" ]; + before = [ "home-assistant.service" ]; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.bash}/bin/bash -c 'mkdir -p /var/lib/hass/hass && chown hass:hass /var/lib/hass/hass'";