1
Fork 0

Smos + intray + some nvim changes

This commit is contained in:
Matei Adriel 2023-09-04 05:58:39 +03:00
parent 9c4f714636
commit 2e8ec89ef5
No known key found for this signature in database
13 changed files with 1995 additions and 75 deletions

View file

@ -3,16 +3,6 @@ local M = {}
function M.setup() function M.setup()
require("lazy").setup("my.plugins", { require("lazy").setup("my.plugins", {
defaults = { lazy = true }, defaults = { lazy = true },
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
install = { install = {
-- install missing plugins on startup. This doesn't increase startup time. -- install missing plugins on startup. This doesn't increase startup time.
missing = true, missing = true,
@ -29,6 +19,16 @@ function M.setup()
-- Extra runtime path specified by nix -- Extra runtime path specified by nix
os.getenv("NVIM_EXTRA_RUNTIME") or "", os.getenv("NVIM_EXTRA_RUNTIME") or "",
}, },
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
}, },
}, },
}) })

View file

@ -1,5 +1,14 @@
local env = require("my.helpers.env") local env = require("my.helpers.env")
local header = [[
]]
local M = { local M = {
"goolord/alpha-nvim", "goolord/alpha-nvim",
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
@ -11,15 +20,7 @@ local M = {
-- See [the header generator](https://patorjk.com/software/taag/#p=display&v=0&f=ANSI%20Shadow&t=NEOVim%20%3A3) -- See [the header generator](https://patorjk.com/software/taag/#p=display&v=0&f=ANSI%20Shadow&t=NEOVim%20%3A3)
theme.section.header.opts.hl = "AlphaHeader" theme.section.header.opts.hl = "AlphaHeader"
theme.section.header.val = [[ theme.section.header.val = header
]]
local footer = function() local footer = function()
local version = "🚀 " local version = "🚀 "
.. vim.version().major .. vim.version().major

View file

@ -5,12 +5,11 @@ local M = {
"jbyuki/venn.nvim", -- draw ascii diagrams "jbyuki/venn.nvim", -- draw ascii diagrams
"mrjones2014/smart-splits.nvim", -- the name says it all "mrjones2014/smart-splits.nvim", -- the name says it all
}, },
keys = { "<C-w>", "<leader>v" }, keys = { "<C-S-w>", "<leader>V" },
event = "VeryLazy",
} }
local venn_hint = [[ local venn_hint = [[
Arrow^^^^^^ Select region with <C-v> Arrow^^^^^^ Select region with <C-v>
^ ^ _K_ ^ ^ _f_: surround it with box ^ ^ _K_ ^ ^ _f_: surround it with box
_H_ ^ ^ _L_ _H_ ^ ^ _L_
^ ^ _J_ ^ ^ _<Esc>_ ^ ^ _J_ ^ ^ _<Esc>_
@ -19,7 +18,7 @@ local venn_hint = [[
local window_hint = [[ local window_hint = [[
^^^^^^^^^^^^ Move ^^ Size ^^ ^^ Split ^^^^^^^^^^^^ Move ^^ Size ^^ ^^ Split
^^^^^^^^^^^^------------- ^^-----------^^ ^^--------------- ^^^^^^^^^^^^------------- ^^-----------^^ ^^---------------
^ ^ _k_ ^ ^ ^ ^ _K_ ^ ^ ^ _<C-k>_ ^ _s_: horizontally ^ ^ _k_ ^ ^ ^ ^ _K_ ^ ^ ^ _<C-k>_ ^ _s_: horizontally
_h_ ^ ^ _l_ _H_ ^ ^ _L_ _<C-h>_ _<C-l>_ _v_: vertically _h_ ^ ^ _l_ _H_ ^ ^ _L_ _<C-h>_ _<C-l>_ _v_: vertically
^ ^ _j_ ^ ^ ^ ^ _J_ ^ ^ ^ _<C-j>_ ^ _q_: close ^ ^ _j_ ^ ^ ^ ^ _J_ ^ ^ ^ _<C-j>_ ^ _q_: close
focus^^^^^^ window^^^^^^ ^_=_: equalize^ _o_: close remaining focus^^^^^^ window^^^^^^ ^_=_: equalize^ _o_: close remaining
@ -30,11 +29,11 @@ function M.config()
local pcmd = require("hydra.keymap-util").pcmd local pcmd = require("hydra.keymap-util").pcmd
local splits = require("smart-splits") local splits = require("smart-splits")
-- {{{ Diagrams
Hydra({ Hydra({
name = "Draw Diagram", name = "Draw Diagram",
hint = venn_hint, hint = venn_hint,
config = { config = {
color = "pink",
invoke_on_body = true, invoke_on_body = true,
hint = { hint = {
border = "rounded", border = "rounded",
@ -44,7 +43,7 @@ function M.config()
end, end,
}, },
mode = "n", mode = "n",
body = "<leader>v", body = "<leader>V",
heads = { heads = {
{ "H", "<C-v>h:VBox<CR>" }, { "H", "<C-v>h:VBox<CR>" },
{ "J", "<C-v>j:VBox<CR>" }, { "J", "<C-v>j:VBox<CR>" },
@ -54,6 +53,13 @@ function M.config()
{ "<Esc>", nil, { exit = true } }, { "<Esc>", nil, { exit = true } },
}, },
}) })
-- }}}
-- {{{ Windows
local resize = function(direction)
return function()
splits["resize_" .. direction](2)
end
end
Hydra({ Hydra({
name = "Windows", name = "Windows",
@ -62,7 +68,7 @@ function M.config()
invoke_on_body = true, invoke_on_body = true,
hint = { hint = {
border = "rounded", border = "rounded",
offset = -1, offset = -1, -- vertical offset (larger => higher up)
}, },
}, },
mode = "n", mode = "n",
@ -78,30 +84,10 @@ function M.config()
{ "K", "<C-w>K" }, { "K", "<C-w>K" },
{ "L", "<C-w>L" }, { "L", "<C-w>L" },
{ { "<C-h>", resize("left") },
"<C-h>", { "<C-j>", resize("down") },
function() { "<C-k>", resize("up") },
splits.resize_left(2) { "<C-l>", resize("right") },
end,
},
{
"<C-j>",
function()
splits.resize_down(2)
end,
},
{
"<C-k>",
function()
splits.resize_up(2)
end,
},
{
"<C-l>",
function()
splits.resize_right(2)
end,
},
{ "=", "<C-w>=", { desc = "equalize" } }, { "=", "<C-w>=", { desc = "equalize" } },
{ "s", pcmd("split", "E36") }, { "s", pcmd("split", "E36") },
{ "v", pcmd("vsplit", "E36") }, { "v", pcmd("vsplit", "E36") },
@ -109,6 +95,7 @@ function M.config()
{ "q", pcmd("close", "E444"), { desc = "close window" } }, { "q", pcmd("close", "E444"), { desc = "close window" } },
}, },
}) })
-- }}}
end end
return M return M

View file

@ -13,8 +13,8 @@ function M.config()
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
theme = "auto", theme = "auto",
disabled_filetypes = { disabled_filetypes = {
"undotree" "undotree",
} },
}, },
sections = { sections = {
lualine_a = { "branch" }, lualine_a = { "branch" },

1905
flake.lock

File diff suppressed because it is too large Load diff

View file

@ -99,6 +99,24 @@
# Nixos hardware # Nixos hardware
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# {{{ Self management
# Smos
smos.url = "github:NorfairKing/smos";
# smos.inputs.nixpkgs.follows = "nixpkgs-unstable";
# smos.inputs.home-manager.follows = "home-manager";
# Intray
intray.url = "github:NorfairKing/intray";
# intray.inputs.nixpkgs.follows = "nixpkgs";
# intray.inputs.home-manager.follows = "home-manager";
# Tickler
tickler.url = "github:NorfairKing/tickler";
tickler.inputs.nixpkgs.follows = "nixpkgs";
tickler.inputs.intray.follows = "intray";
# }}}
}; };
# }}} # }}}
@ -263,12 +281,16 @@
"https://nix-community.cachix.org" # I think I need this for neovim-nightly? "https://nix-community.cachix.org" # I think I need this for neovim-nightly?
"https://nixpkgs-wayland.cachix.org" "https://nixpkgs-wayland.cachix.org"
"https://anyrun.cachix.org" "https://anyrun.cachix.org"
"https://smos.cachix.org"
"https://intray.cachix.org"
]; ];
extra-trusted-public-keys = [ extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"smos.cachix.org-1:YOs/tLEliRoyhx7PnNw36cw2Zvbw5R0ASZaUlpUv+yM="
"intray.cachix.org-1:qD7I/NQLia2iy6cbzZvFuvn09iuL4AkTmHvjxrQlccQ="
]; ];
}; };
# }}} # }}}

View file

@ -0,0 +1,3 @@
{
imports = [ ./smos.nix ./intray.nix ];
}

View file

@ -0,0 +1,7 @@
{
programs.intray = {
enable = true;
data-dir = "/persist/state/home/adrielus/Intray";
cache-dir = "/persist/local/cache/home/adrielus/Intray";
};
}

View file

@ -0,0 +1,11 @@
{ config, ... }: {
programs.smos = {
enable = true;
notify.enable = true;
config = { };
};
satellite.persistence.at.data.apps.smos.directories = [
config.programs.smos.workflowDir
];
}

View file

@ -1,6 +1,16 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
themeMap = pkgs.callPackage (import ./themes.nix) { }; themeMap = pkgs.callPackage (import ./themes.nix) { };
discocss = pkgs.discocss.overrideAttrs (old: rec {
version = "0.3.0";
src = pkgs.fetchFromGitHub {
owner = "bddvlpr";
repo = "discocss";
rev = "v${version}";
hash = "sha256-2K7SPTvORzgZ1ZiCtS5TOShuAnmtI5NYkdQPRXIBP/I=";
};
});
in in
{ {
programs.discord = { programs.discord = {
@ -10,7 +20,7 @@ in
enableDevtools = true; enableDevtools = true;
}; };
home.packages = [ pkgs.discocss ]; home.packages = [ discocss ];
xdg.configFile."discocss/custom.css".source = config.satellite.theming.get themeMap; xdg.configFile."discocss/custom.css".source = config.satellite.theming.get themeMap;
satellite.persistence.at.state.apps.Discord.directories = [ satellite.persistence.at.state.apps.Discord.directories = [

View file

@ -10,6 +10,11 @@ let
inputs.spicetify-nix.homeManagerModules.spicetify inputs.spicetify-nix.homeManagerModules.spicetify
inputs.anyrun.homeManagerModules.default inputs.anyrun.homeManagerModules.default
# NOTE: using `pkgs.system` before `module.options` is evaluated
# leads to infinite recursion!
inputs.intray.homeManagerModules.x86_64-linux.default
inputs.smos.homeManagerModules.x86_64-linux.default
../features/cli ../features/cli
../features/persistence.nix ../features/persistence.nix
../../common ../../common
@ -39,7 +44,7 @@ in
# }}} # }}}
# Nicely reload system units when changing configs # Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch"; systemd.user.startServices = lib.mkForce "sd-switch";
# Enable the home-manager and git clis # Enable the home-manager and git clis
programs = { programs = {

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: { { pkgs, ... }: {
imports = [ imports = [
./global ./global
@ -6,6 +6,7 @@
./features/desktop/spotify.nix ./features/desktop/spotify.nix
./features/desktop/firefox ./features/desktop/firefox
./features/desktop/discord ./features/desktop/discord
./features/cli/productivity
./features/cli/khal.nix ./features/cli/khal.nix
./features/cli/pass.nix ./features/cli/pass.nix
./features/neovim ./features/neovim

View file

@ -1,6 +1,7 @@
# Configuration pieces included on all (nixos) hosts # Configuration pieces included on all (nixos) hosts
{ inputs, outputs, ... }: { inputs, outputs, ... }:
let let
# {{{ Imports
imports = [ imports = [
inputs.hyprland.nixosModules.default inputs.hyprland.nixosModules.default
inputs.disko.nixosModules.default inputs.disko.nixosModules.default
@ -10,6 +11,12 @@ let
inputs.impermanence.nixosModule inputs.impermanence.nixosModule
inputs.slambda.nixosModule inputs.slambda.nixosModule
# NOTE: using `pkgs.system` before `module.options` is evaluated
# leads to infinite recursion!
inputs.intray.nixosModules.x86_64-linux.default
inputs.smos.nixosModules.x86_64-linux.default
inputs.tickler.nixosModules.x86_64-linux.default
./persistence.nix ./persistence.nix
./nix.nix ./nix.nix
./openssh.nix ./openssh.nix
@ -19,6 +26,7 @@ let
./tailscale.nix ./tailscale.nix
../../../../common ../../../../common
]; ];
# }}}
in in
{ {
# Import all modules defined in modules/nixos # Import all modules defined in modules/nixos